3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2025-01-11 23:51:11 +01:00

Use set for sticky pistons

Dieser Commit ist enthalten in:
Camotoy 2021-09-10 16:36:56 -04:00
Ursprung 3632ebda8b
Commit c763939452
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -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) {