remove block metadata T2
This commit is contained in:
parent
2919d99126
commit
3db0dca073
77 changed files with 51 additions and 934 deletions
|
@ -1,8 +1,6 @@
|
|||
package server.clipboard;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import common.block.Block;
|
||||
|
@ -16,15 +14,14 @@ import common.color.DyeColor;
|
|||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.init.WoodType;
|
||||
import common.util.Facing;
|
||||
import common.util.Vec3i;
|
||||
import common.world.State;
|
||||
|
||||
public abstract class ReorderRegistry {
|
||||
private static final Set<Block> PLACE_LAST = new HashSet<Block>();
|
||||
private static final Set<Block> PLACE_FINAL = new HashSet<Block>();
|
||||
private static final Map<State, Vec3i> STATE_ATTACH = new HashMap<State, Vec3i>();
|
||||
private static final Map<Block, Vec3i> BLOCK_ATTACH = new HashMap<Block, Vec3i>();
|
||||
// private static final Map<State, Vec3i> STATE_ATTACH = new HashMap<State, Vec3i>();
|
||||
// private static final Map<Block, Vec3i> BLOCK_ATTACH = new HashMap<Block, Vec3i>();
|
||||
|
||||
public static boolean shouldPlaceLast(Block id) {
|
||||
return PLACE_LAST.contains(id);
|
||||
|
@ -35,11 +32,15 @@ public abstract class ReorderRegistry {
|
|||
}
|
||||
|
||||
public static Vec3i getAttachment(State state) {
|
||||
Vec3i direction = BLOCK_ATTACH.get(state.getBlock());
|
||||
if (direction != null) return direction;
|
||||
return STATE_ATTACH.get(state);
|
||||
return null; //TODO: add attachment clean
|
||||
}
|
||||
|
||||
// public static Vec3i getAttachment(State state) {
|
||||
// Vec3i direction = BLOCK_ATTACH.get(state.getBlock());
|
||||
// if (direction != null) return direction;
|
||||
// return STATE_ATTACH.get(state);
|
||||
// }
|
||||
|
||||
public static void register() {
|
||||
for(WoodType wood : WoodType.values()) {
|
||||
PLACE_LAST.add(BlockRegistry.byName(wood.getName() + "_sapling"));
|
||||
|
@ -124,6 +125,7 @@ public abstract class ReorderRegistry {
|
|||
PLACE_FINAL.add(Blocks.wall_banner);
|
||||
}
|
||||
|
||||
/*
|
||||
private static void addAttach(State state, Facing dir) {
|
||||
STATE_ATTACH.put(state, dir.getDirectionVec());
|
||||
}
|
||||
|
@ -247,4 +249,5 @@ public abstract class ReorderRegistry {
|
|||
|
||||
addAttach(Blocks.blue_mushroom, Facing.DOWN);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public abstract class RotationRegistry {
|
|||
public static void register() {
|
||||
List<RotationValue> values = Lists.newArrayList();
|
||||
for(Block block : common.init.BlockRegistry.blocks()) {
|
||||
for(Property<?> prop : block.getPropertyMap()) {
|
||||
for(Property<?> prop : block.getSavedProperties()) {
|
||||
for(Comparable v : prop.getStates()) {
|
||||
if(!(v instanceof DirectionVec vec))
|
||||
continue;
|
||||
|
|
|
@ -27,7 +27,7 @@ public class CommandBlock extends Command {
|
|||
if(idx >= 0) {
|
||||
Block block = BlockRegistry.byNameExact(last.substring(0, idx));
|
||||
if(block != null)
|
||||
return Lists.newArrayList(Iterables.transform(block.getValidStates(), state -> BlockRegistry.getName(state)));
|
||||
return Lists.newArrayList(Iterables.transform(block.getSavedStates(), state -> BlockRegistry.getName(state)));
|
||||
}
|
||||
return BlockRegistry.getKeys();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue