Add rotations to various blocks that were missing them.

Up/down levers still broken.

Fixes WORLDEDIT-3490.
Dieser Commit ist enthalten in:
wizjany 2017-02-26 18:56:38 -05:00
Ursprung a4455e875e
Commit e511758d99
3 geänderte Dateien mit 833 neuen und 122 gelöschten Zeilen

Datei anzeigen

@ -33,6 +33,7 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.BundledBlockData;
import com.sk89q.worldedit.world.registry.SimpleState;
import com.sk89q.worldedit.world.registry.State; import com.sk89q.worldedit.world.registry.State;
import com.sk89q.worldedit.world.registry.StateValue; import com.sk89q.worldedit.world.registry.StateValue;
@ -80,9 +81,14 @@ public class QueryTool implements BlockTool {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("States: "); builder.append("States: ");
boolean first = true; boolean first = true;
boolean hasVisibleStates = false;
for (Entry<String, ? extends State> e : states.entrySet()) { for (Entry<String, ? extends State> e : states.entrySet()) {
String name = e.getKey(); String name = e.getKey();
State state = e.getValue(); State state = e.getValue();
if (state instanceof SimpleState && ((SimpleState) state).getDataMask() == 0) {
continue; // don't try to determine states that aren't reflected in their data value
}
hasVisibleStates = true;
if (!first) { if (!first) {
builder.append(", "); builder.append(", ");
} }
@ -91,11 +97,14 @@ public class QueryTool implements BlockTool {
for (Entry<String, ? extends StateValue> entry : state.valueMap().entrySet()) { for (Entry<String, ? extends StateValue> entry : state.valueMap().entrySet()) {
if (entry.getValue().isSet(block)) { if (entry.getValue().isSet(block)) {
valName = entry.getKey(); valName = entry.getKey();
break;
} }
} }
builder.append("\u00A79").append(name).append(": \u00A7f").append(valName != null ? valName : "set"); builder.append("\u00A79").append(name).append(": \u00A7f").append(valName != null ? valName : "set");
} }
if (hasVisibleStates) {
player.printRaw(builder.toString()); player.printRaw(builder.toString());
}
return true; return true;
} }

Datei anzeigen

@ -25,7 +25,7 @@ import javax.annotation.Nullable;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
class SimpleState implements State { public class SimpleState implements State {
private Byte dataMask; private Byte dataMask;
private Map<String, SimpleStateValue> values; private Map<String, SimpleStateValue> values;
@ -47,7 +47,7 @@ class SimpleState implements State {
return null; return null;
} }
byte getDataMask() { public byte getDataMask() {
return dataMask != null ? dataMask : 0xF; return dataMask != null ? dataMask : 0xF;
} }