mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Use set for sticky pistons
This commit is contained in:
parent
3632ebda8b
commit
c763939452
1 changed files with 5 additions and 3 deletions
|
@ -49,7 +49,7 @@ public class BlockStateValues {
|
||||||
private static final LecternHasBookMap LECTERN_BOOK_STATES = new LecternHasBookMap();
|
private static final LecternHasBookMap LECTERN_BOOK_STATES = new LecternHasBookMap();
|
||||||
private static final Int2IntMap NOTEBLOCK_PITCHES = new FixedInt2IntMap();
|
private static final Int2IntMap NOTEBLOCK_PITCHES = new FixedInt2IntMap();
|
||||||
private static final Int2BooleanMap PISTON_VALUES = new Int2BooleanOpenHashMap();
|
private static final Int2BooleanMap PISTON_VALUES = new Int2BooleanOpenHashMap();
|
||||||
private static final Int2BooleanMap IS_STICKY_PISTON = new Int2BooleanOpenHashMap();
|
private static final IntSet STICKY_PISTONS = new IntOpenHashSet();
|
||||||
private static final Object2IntMap<Direction> PISTON_HEADS = new Object2IntOpenHashMap<>();
|
private static final Object2IntMap<Direction> PISTON_HEADS = new Object2IntOpenHashMap<>();
|
||||||
private static final Int2ObjectMap<Direction> PISTON_ORIENTATION = new Int2ObjectOpenHashMap<>();
|
private static final Int2ObjectMap<Direction> PISTON_ORIENTATION = new Int2ObjectOpenHashMap<>();
|
||||||
private static final IntSet ALL_PISTON_HEADS = new IntOpenHashSet();
|
private static final IntSet ALL_PISTON_HEADS = new IntOpenHashSet();
|
||||||
|
@ -132,7 +132,9 @@ public class BlockStateValues {
|
||||||
} else {
|
} else {
|
||||||
PISTON_VALUES.put(javaBlockState, javaId.contains("extended=true"));
|
PISTON_VALUES.put(javaBlockState, javaId.contains("extended=true"));
|
||||||
}
|
}
|
||||||
IS_STICKY_PISTON.put(javaBlockState, javaId.contains("sticky"));
|
if (javaId.contains("sticky")) {
|
||||||
|
STICKY_PISTONS.add(javaBlockState);
|
||||||
|
}
|
||||||
PISTON_ORIENTATION.put(javaBlockState, getBlockDirection(javaId));
|
PISTON_ORIENTATION.put(javaBlockState, getBlockDirection(javaId));
|
||||||
return;
|
return;
|
||||||
} else if (javaId.startsWith("minecraft:piston_head")) {
|
} else if (javaId.startsWith("minecraft:piston_head")) {
|
||||||
|
@ -255,7 +257,7 @@ public class BlockStateValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isStickyPiston(int blockState) {
|
public static boolean isStickyPiston(int blockState) {
|
||||||
return IS_STICKY_PISTON.get(blockState);
|
return STICKY_PISTONS.contains(blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isPistonHead(int state) {
|
public static boolean isPistonHead(int state) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue