Add rotations to various blocks that were missing them.

Up/down levers still broken.

Fixes WORLDEDIT-3490.
This commit is contained in:
wizjany 2017-02-26 18:56:38 -05:00
parent a4455e875e
commit e511758d99
3 changed files with 833 additions and 122 deletions

View File

@ -33,6 +33,7 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.world.World;
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.StateValue;
@ -80,9 +81,14 @@ public class QueryTool implements BlockTool {
StringBuilder builder = new StringBuilder();
builder.append("States: ");
boolean first = true;
boolean hasVisibleStates = false;
for (Entry<String, ? extends State> e : states.entrySet()) {
String name = e.getKey();
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) {
builder.append(", ");
}
@ -91,11 +97,14 @@ public class QueryTool implements BlockTool {
for (Entry<String, ? extends StateValue> entry : state.valueMap().entrySet()) {
if (entry.getValue().isSet(block)) {
valName = entry.getKey();
break;
}
}
builder.append("\u00A79").append(name).append(": \u00A7f").append(valName != null ? valName : "set");
}
player.printRaw(builder.toString());
if (hasVisibleStates) {
player.printRaw(builder.toString());
}
return true;
}

View File

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