From 32d837414b2dcef0e241e1281f739aa0c51b51d5 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 2 Nov 2019 20:35:51 +0100 Subject: [PATCH] static blocktype initialization instead of using hacky reflection --- .../adapter/mc1_14/BukkitAdapter_1_14.java | 3 +- .../adapter/mc1_14/Spigot_v1_14_R4.java | 5 +- .../fawe/bukkit/wrapper/AsyncBlock.java | 5 +- .../fawe/bukkit/wrapper/AsyncBlockState.java | 7 +- .../bukkit/adapter/CachedBukkitAdapter.java | 3 +- .../main/java/com/boydti/fawe/FaweCache.java | 7 +- .../implementation/blocks/CharBlocks.java | 3 +- .../implementation/blocks/CharGetBlocks.java | 5 +- .../implementation/blocks/CharSetBlocks.java | 3 +- .../implementation/filter/DistrFilter.java | 14 +- .../filter/block/ArrayFilterBlock.java | 4 +- .../filter/block/CharFilterBlock.java | 5 +- .../com/boydti/fawe/jnbt/anvil/MCAChunk.java | 5 +- .../cfi/HeightMapMCAGenerator.java | 6 +- .../object/changeset/DiskStorageHistory.java | 6 +- .../fawe/object/pattern/PropertyPattern.java | 14 +- .../pattern/SolidRandomOffsetPattern.java | 4 +- .../object/string/JoinedCharSequence.java | 70 + .../com/boydti/fawe/util/TextureUtil.java | 5 +- .../clipboard/io/SpongeSchematicReader.java | 3 +- .../clipboard/io/SpongeSchematicWriter.java | 5 +- .../transform/BlockTransformExtent.java | 6 +- .../worldedit/function/mask/ABlockMask.java | 7 +- .../worldedit/function/mask/BlockMask.java | 7 +- .../function/mask/BlockMaskBuilder.java | 25 +- .../mask/InverseSingleBlockTypeMask.java | 3 +- .../function/mask/SingleBlockTypeMask.java | 3 +- .../function/pattern/WaterloggedRemover.java | 4 +- .../registry/state/AbstractProperty.java | 3 +- .../registry/state/PropertyGroup.java | 3 +- .../worldedit/world/block/BlockState.java | 10 +- .../worldedit/world/block/BlockType.java | 10 +- .../world/block/BlockTypeSwitchBuilder.java | 2 +- .../worldedit/world/block/BlockTypes.java | 1609 +++++++---------- .../world/block/BlockTypesCache.java | 243 +++ 35 files changed, 1128 insertions(+), 989 deletions(-) create mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/string/JoinedCharSequence.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypesCache.java diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitAdapter_1_14.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitAdapter_1_14.java index bf54b126e..b076bcd74 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitAdapter_1_14.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitAdapter_1_14.java @@ -11,6 +11,7 @@ import com.boydti.fawe.util.TaskManager; import com.sk89q.worldedit.world.block.BlockID; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import net.jpountz.util.UnsafeUtils; import net.minecraft.server.v1_14_R1.Block; import net.minecraft.server.v1_14_R1.Chunk; @@ -273,7 +274,7 @@ public class BukkitAdapter_1_14 { for (int i = 0; i < num_palette; i++) { final int ordinal = paletteToBlock[i]; blockToPalette[ordinal] = Integer.MAX_VALUE; - final BlockState state = BlockTypes.states[ordinal]; + final BlockState state = BlockTypesCache.states[ordinal]; final IBlockData ibd = ((BlockMaterial_1_14) state.getMaterial()).getState(); palette.a(ibd); } diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/Spigot_v1_14_R4.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/Spigot_v1_14_R4.java index 66c0a9af9..5efd3d5d2 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/Spigot_v1_14_R4.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/Spigot_v1_14_R4.java @@ -64,6 +64,7 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.registry.BlockMaterial; import net.minecraft.server.v1_14_R1.Block; @@ -178,7 +179,7 @@ public final class Spigot_v1_14_R4 extends CachedBukkitAdapter implements Bukkit if (idbToStateOrdinal != null) return false; idbToStateOrdinal = new char[Block.REGISTRY_ID.a()]; // size for (int i = 0; i < idbToStateOrdinal.length; i++) { - BlockState state = BlockTypes.states[i]; + BlockState state = BlockTypesCache.states[i]; BlockMaterial_1_14 material = (BlockMaterial_1_14) state.getMaterial(); int id = Block.REGISTRY_ID.getId(material.getState()); idbToStateOrdinal[id] = state.getOrdinalChar(); @@ -612,7 +613,7 @@ public final class Spigot_v1_14_R4 extends CachedBukkitAdapter implements Bukkit } public BlockState adapt(IBlockData ibd) { - return BlockTypes.states[adaptToInt(ibd)]; + return BlockTypesCache.states[adaptToInt(ibd)]; } public int adaptToInt(IBlockData ibd) { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlock.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlock.java index ab8802f98..c492296f2 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlock.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlock.java @@ -11,6 +11,7 @@ import com.sk89q.worldedit.world.block.BlockID; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import org.bukkit.FluidCollisionMode; import org.bukkit.Location; import org.bukkit.Material; @@ -57,7 +58,7 @@ public class AsyncBlock implements Block { } public int getPropertyId() { - return world.getBlock(x, y, z).getInternalId() >> BlockTypes.BIT_OFFSET; + return world.getBlock(x, y, z).getInternalId() >> BlockTypesCache.BIT_OFFSET; } public int getCombinedId() { @@ -105,7 +106,7 @@ public class AsyncBlock implements Block { @Deprecated public boolean setTypeIdAndPropertyId(int id, int propertyId) { - return setCombinedId(id + (propertyId << BlockTypes.BIT_OFFSET)); + return setCombinedId(id + (propertyId << BlockTypesCache.BIT_OFFSET)); } @Deprecated diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlockState.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlockState.java index 24a8cc696..8b171a9a6 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlockState.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlockState.java @@ -9,6 +9,7 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Material; @@ -42,7 +43,7 @@ public class AsyncBlockState implements BlockState { } public int getPropertyId() { - return state.getInternalId() >> BlockTypes.BIT_OFFSET; + return state.getInternalId() >> BlockTypesCache.BIT_OFFSET; } @Override @@ -158,12 +159,12 @@ public class AsyncBlockState implements BlockState { @Override public byte getRawData() { - return (byte) (state.getInternalId() >> BlockTypes.BIT_OFFSET); + return (byte) (state.getInternalId() >> BlockTypesCache.BIT_OFFSET); } @Override public void setRawData(byte data) { - int combinedId = getTypeId() + (data << BlockTypes.BIT_OFFSET); + int combinedId = getTypeId() + (data << BlockTypesCache.BIT_OFFSET); state = com.sk89q.worldedit.world.block.BlockState.getFromInternalId(combinedId).toBaseBlock(state.getNbtData()); this.blockData = BukkitAdapter.adapt(state); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/CachedBukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/CachedBukkitAdapter.java index 76e0392d7..c196fcd2c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/CachedBukkitAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/CachedBukkitAdapter.java @@ -6,6 +6,7 @@ import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import java.util.List; @@ -58,7 +59,7 @@ public abstract class CachedBukkitAdapter implements IBukkitAdapter { @Override public BlockType adapt(Material material) { try { - return BlockTypes.values[blockTypes[material.ordinal()]]; + return BlockTypesCache.values[blockTypes[material.ordinal()]]; } catch (NullPointerException e) { if (init()) return adapt(material); throw e; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java b/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java index 570d88b1c..f59f22d1b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java @@ -28,6 +28,7 @@ import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.math.MutableVector3; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import java.lang.reflect.Field; import java.util.ArrayList; @@ -219,7 +220,7 @@ public enum FaweCache implements Trimable { public final CleanableThreadLocal BYTE_BUFFER_8192 = new CleanableThreadLocal<>(() -> new byte[8192]); public final CleanableThreadLocal BLOCK_TO_PALETTE = new CleanableThreadLocal<>(() -> { - int[] result = new int[BlockTypes.states.length]; + int[] result = new int[BlockTypesCache.states.length]; Arrays.fill(result, Integer.MAX_VALUE); return result; }); @@ -296,7 +297,7 @@ public enum FaweCache implements Trimable { int ordinal = blocksChars[i]; int palette = blockToPalette[ordinal]; if (palette == Integer.MAX_VALUE) { -// BlockState state = BlockTypes.states[ordinal]; +// BlockState state = BlockTypesCache.states[ordinal]; blockToPalette[ordinal] = palette = num_palette; paletteToBlock[num_palette] = ordinal; num_palette++; @@ -308,7 +309,7 @@ public enum FaweCache implements Trimable { int ordinal = blocksInts[i]; int palette = blockToPalette[ordinal]; if (palette == Integer.MAX_VALUE) { - BlockState state = BlockTypes.states[ordinal]; + BlockState state = BlockTypesCache.states[ordinal]; blockToPalette[ordinal] = palette = num_palette; paletteToBlock[num_palette] = ordinal; num_palette++; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java index 0f1b0e960..9f12d31f8 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java @@ -7,6 +7,7 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import java.util.Map; import java.util.Set; @@ -96,7 +97,7 @@ public abstract class CharBlocks implements IBlocks { @Override public BlockState getBlock(int x, int y, int z) { - return BlockTypes.states[get(x, y, z)]; + return BlockTypesCache.states[get(x, y, z)]; } public char get(int x, int y, int z) { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharGetBlocks.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharGetBlocks.java index 84b857470..9304969f3 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharGetBlocks.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharGetBlocks.java @@ -5,17 +5,18 @@ import com.boydti.fawe.beta.IChunkSet; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; public abstract class CharGetBlocks extends CharBlocks implements IChunkGet { @Override public BaseBlock getFullBlock(int x, int y, int z) { - return BlockTypes.states[get(x, y, z)].toBaseBlock(); + return BlockTypesCache.states[get(x, y, z)].toBaseBlock(); } @Override public BlockState getBlock(int x, int y, int z) { - return BlockTypes.states[get(x, y, z)]; + return BlockTypesCache.states[get(x, y, z)]; } @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharSetBlocks.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharSetBlocks.java index 7ce8c822f..d33cee71e 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharSetBlocks.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharSetBlocks.java @@ -13,6 +13,7 @@ import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import java.util.Collections; import java.util.HashSet; @@ -74,7 +75,7 @@ public class CharSetBlocks extends CharBlocks implements IChunkSet { @Override public BlockState getBlock(int x, int y, int z) { - return BlockTypes.states[get(x, y, z)]; + return BlockTypesCache.states[get(x, y, z)]; } @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/DistrFilter.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/DistrFilter.java index 82d169b4c..581a3554a 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/DistrFilter.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/DistrFilter.java @@ -7,6 +7,8 @@ import com.sk89q.worldedit.util.Countable; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -14,7 +16,7 @@ import java.util.List; public class DistrFilter extends ForkedFilter { - private final int[] counter = new int[BlockTypes.states.length]; + private final int[] counter = new int[BlockTypesCache.states.length]; public DistrFilter() { super(null); @@ -45,7 +47,7 @@ public class DistrFilter extends ForkedFilter { int total = 0; for (int i = 0; i < counter.length; i++) { int value = counter[i]; - if (value != 0 && mask.test(BlockTypes.states[i])) { + if (value != 0 && mask.test(BlockTypesCache.states[i])) { total += value; } } @@ -61,7 +63,7 @@ public class DistrFilter extends ForkedFilter { for (int i = 0; i < counter.length; i++) { final int count = counter[i]; if (count != 0) { - distribution.add(new Countable<>(BlockTypes.states[i], count)); + distribution.add(new Countable<>(BlockTypesCache.states[i], count)); } } Collections.sort(distribution); @@ -70,18 +72,18 @@ public class DistrFilter extends ForkedFilter { public List> getTypeDistribution() { final List> distribution = new ArrayList<>(); - int[] typeCounter = new int[BlockTypes.values.length]; + int[] typeCounter = new int[BlockTypesCache.values.length]; for (int i = 0; i < counter.length; i++) { final int count = counter[i]; if (count != 0) { - BlockState state = BlockTypes.states[i]; + BlockState state = BlockTypesCache.states[i]; typeCounter[state.getBlockType().getInternalId()] += count; } } for (int i = 0; i < typeCounter.length; i++) { final int count = typeCounter[i]; if (count != 0) { - distribution.add(new Countable<>(BlockTypes.values[i], count)); + distribution.add(new Countable<>(BlockTypesCache.values[i], count)); } } Collections.sort(distribution); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/block/ArrayFilterBlock.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/block/ArrayFilterBlock.java index ad7ca5da0..851a4ec92 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/block/ArrayFilterBlock.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/block/ArrayFilterBlock.java @@ -9,6 +9,8 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; + import javax.annotation.Nullable; public class ArrayFilterBlock extends SimpleFilterBlock { @@ -51,7 +53,7 @@ public class ArrayFilterBlock extends SimpleFilterBlock { @Override public BlockState getBlock() { - return BlockTypes.states[ordinal]; + return BlockTypesCache.states[ordinal]; } @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/block/CharFilterBlock.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/block/CharFilterBlock.java index d010ad3d9..2dbd271c5 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/block/CharFilterBlock.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/filter/block/CharFilterBlock.java @@ -1,6 +1,6 @@ package com.boydti.fawe.beta.implementation.filter.block; -import static com.sk89q.worldedit.world.block.BlockTypes.states; +import static com.sk89q.worldedit.world.block.BlockTypesCache.states; import com.boydti.fawe.beta.Filter; import com.boydti.fawe.beta.FilterBlockMask; @@ -19,6 +19,7 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import com.sk89q.worldedit.world.registry.BlockMaterial; import javax.annotation.Nullable; @@ -231,7 +232,7 @@ public class CharFilterBlock extends ChunkFilterBlock { @Override public final BlockState getBlock() { final int ordinal = getArr[index]; - return BlockTypes.states[ordinal]; + return BlockTypesCache.states[ordinal]; } @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAChunk.java b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAChunk.java index f37801ba4..e1bed5e96 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAChunk.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAChunk.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import java.io.IOException; import java.util.ArrayList; @@ -251,7 +252,7 @@ public class MCAChunk implements IChunkSet { int ordinal = blocks[i]; int palette = blockToPalette[ordinal]; if (palette == Integer.MAX_VALUE) { -// BlockState state = BlockTypes.states[ordinal]; +// BlockState state = BlockTypesCache.states[ordinal]; blockToPalette[ordinal] = palette = num_palette; paletteToBlock[num_palette] = ordinal; num_palette++; @@ -269,7 +270,7 @@ public class MCAChunk implements IChunkSet { for (int i = 0; i < num_palette; i++) { int ordinal = paletteToBlock[i]; - BlockState state = BlockTypes.states[ordinal]; + BlockState state = BlockTypesCache.states[ordinal]; BlockType type = state.getBlockType(); out.writeNamedTag("Name", type.getId()); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/HeightMapMCAGenerator.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/HeightMapMCAGenerator.java index dea7f5b2a..cd980c54f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/HeightMapMCAGenerator.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/HeightMapMCAGenerator.java @@ -56,6 +56,8 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; + import java.awt.image.BufferedImage; import java.io.File; import java.io.FileNotFoundException; @@ -438,7 +440,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr for (int x = minX; x <= maxX; x++, index++, localIndex++) { int combined = floor[index]; if (BlockTypes.getFromStateOrdinal(combined) == BlockTypes.SNOW) { - layers[localIndex] = (char) (((heights[index] & 0xFF) << 3) + (floor[index] >> BlockTypes.BIT_OFFSET) - 7); + layers[localIndex] = (char) (((heights[index] & 0xFF) << 3) + (floor[index] >> BlockTypesCache.BIT_OFFSET) - 7); } else { layers[localIndex] = (char) ((heights[index] & 0xFF) << 3); } @@ -526,7 +528,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr for (int i = 0; i < heights.length; i++) { int combined = floor[i]; if (BlockTypes.getFromStateOrdinal(combined) == BlockTypes.SNOW) { - layers[i] = (char) (((heights[i] & 0xFF) << 3) + (floor[i] >> BlockTypes.BIT_OFFSET) - 7); + layers[i] = (char) (((heights[i] & 0xFF) << 3) + (floor[i] >> BlockTypesCache.BIT_OFFSET) - 7); } else { layers[i] = (char) ((heights[i] & 0xFF) << 3); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/DiskStorageHistory.java b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/DiskStorageHistory.java index 125f43f34..d594d07d4 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/DiskStorageHistory.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/DiskStorageHistory.java @@ -17,6 +17,8 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; + import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -457,7 +459,7 @@ public class DiskStorageHistory extends FaweStreamChangeSet { public int maxZ; public DiskStorageSummary(int x, int z) { - blocks = new int[BlockTypes.states.length]; + blocks = new int[BlockTypesCache.states.length]; minX = x; maxX = x; minZ = z; @@ -482,7 +484,7 @@ public class DiskStorageHistory extends FaweStreamChangeSet { HashMap map = new HashMap<>(); for (int i = 0; i < blocks.length; i++) { if (blocks[i] != 0) { - BlockState state = BlockTypes.states[i]; + BlockState state = BlockTypesCache.states[i]; map.put(state, blocks[i]); } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/PropertyPattern.java b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/PropertyPattern.java index 1aac6b20a..e350617a2 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/PropertyPattern.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/PropertyPattern.java @@ -15,6 +15,8 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; + import java.util.ArrayList; import java.util.List; @@ -28,7 +30,7 @@ public class PropertyPattern extends AbstractExtentPattern { public PropertyPattern(Extent extent) { super(extent); - this.transformed = new int[BlockTypes.states.length]; + this.transformed = new int[BlockTypesCache.states.length]; for (int i = 0; i < transformed.length; i++) { transformed[i] = i; } @@ -107,13 +109,13 @@ public class PropertyPattern extends AbstractExtentPattern { } } else { for (int i = 0; i < values.size(); i++) { - int statesIndex = current.modifyIndex(stateId, i) >> BlockTypes.BIT_OFFSET; + int statesIndex = current.modifyIndex(stateId, i) >> BlockTypesCache.BIT_OFFSET; BlockState state = type.withPropertyId(statesIndex); int existingOrdinal = transformed[state.getOrdinal()]; - int existing = BlockTypes.states[existingOrdinal].getInternalId(); - //states[statesIndex] << BlockTypes.BIT_OFFSET; - BlockState newState = state.withPropertyId(property.modifyIndex(existing, index) >> BlockTypes.BIT_OFFSET); + int existing = BlockTypesCache.states[existingOrdinal].getInternalId(); + //states[statesIndex] << BlockTypesCache.BIT_OFFSET; + BlockState newState = state.withPropertyId(property.modifyIndex(existing, index) >> BlockTypesCache.BIT_OFFSET); transformed[state.getOrdinal()] = newState.getOrdinal(); } } @@ -135,7 +137,7 @@ public class PropertyPattern extends AbstractExtentPattern { } else { String regex = charSequence.toString(); blockTypeList = new ArrayList<>(); - for (BlockType myType : BlockTypes.values) { + for (BlockType myType : BlockTypesCache.values) { if (myType.getId().matches(regex)) { blockTypeList.add(myType); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/SolidRandomOffsetPattern.java b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/SolidRandomOffsetPattern.java index d17295c68..a6283fd65 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/SolidRandomOffsetPattern.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/SolidRandomOffsetPattern.java @@ -9,6 +9,8 @@ import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; + import java.util.SplittableRandom; public class SolidRandomOffsetPattern extends AbstractPattern { @@ -21,7 +23,7 @@ public class SolidRandomOffsetPattern extends AbstractPattern { public static boolean[] getTypes() { boolean[] types = new boolean[BlockTypes.size()]; - for (BlockType type : BlockTypes.values) { + for (BlockType type : BlockTypesCache.values) { types[type.getInternalId()] = type.getMaterial().isSolid(); } return types; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/string/JoinedCharSequence.java b/worldedit-core/src/main/java/com/boydti/fawe/object/string/JoinedCharSequence.java new file mode 100644 index 000000000..5b134a468 --- /dev/null +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/string/JoinedCharSequence.java @@ -0,0 +1,70 @@ +package com.boydti.fawe.object.string; + +public class JoinedCharSequence implements CharSequence { + private char join; + private int len2; + private int len1; + private int length; + private String a; + private String b; + + public JoinedCharSequence init(String a, char join, String b) { + this.len1 = a.length(); + this.len2 = b.length(); + this.length = len1 + len2 + 1; + this.join = join; + this.a = a; + this.b = b; + return this; + } + @Override + public int length() { + return length; + } + + @Override + public char charAt(int index) { + if (index < len1) { + return a.charAt(index); + } + if (index == len1) { + return join; + } + return b.charAt(index - len1 - 1); + } + + @Override + public CharSequence subSequence(int start, int end) { + char[] chars = new char[end - start]; + for (int i = start, j = 0; i < end; i++, j++) { + chars[j] = charAt(i); + } + return new String(chars); + } + + @Override + public int hashCode() { + int h = 0; + for (int i = 0; i < length; i++) { + h = 31 * h + charAt(i); + } + return h; + } + + @Override + public String toString() { + return (String) subSequence(0, length); + } + + @Override + public boolean equals(Object obj) { + CharSequence anotherString = (CharSequence) obj; + if (length == anotherString.length()) { + for (int i = length - 1; i >= 0; i--) { + if (charAt(i) != anotherString.charAt(i)) return false; + } + return true; + } + return false; + } +} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/TextureUtil.java b/worldedit-core/src/main/java/com/boydti/fawe/util/TextureUtil.java index 63424cc74..bb9fdf171 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/TextureUtil.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/TextureUtil.java @@ -12,6 +12,7 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import com.sk89q.worldedit.world.registry.BlockMaterial; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; @@ -593,7 +594,7 @@ public class TextureUtil implements TextureHolder { if (folder.exists()) { // Get all the jar files File[] files = folder.listFiles((dir, name) -> name.endsWith(".jar")); - for (BlockType blockType : BlockTypes.values) { + for (BlockType blockType : BlockTypesCache.values) { BlockMaterial material = blockType.getMaterial(); if (!material.isSolid() || !material.isFullCube()) { continue; @@ -635,7 +636,7 @@ public class TextureUtil implements TextureHolder { Type typeToken = new TypeToken>() { }.getType(); - for (BlockType blockType : BlockTypes.values) { + for (BlockType blockType : BlockTypesCache.values) { if (!blockType.getMaterial().isFullCube()) { continue; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java index cc666ae93..a5a7a263b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java @@ -53,6 +53,7 @@ import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeTypes; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import net.jpountz.lz4.LZ4BlockInputStream; @@ -198,7 +199,7 @@ public class SpongeSchematicReader extends NBTSchematicReader { } private BlockState getBlockState(int id) { - return BlockTypes.states[palette[id]]; + return BlockTypesCache.states[palette[id]]; } private BiomeType getBiomeType(FaweInputStream fis) throws IOException { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicWriter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicWriter.java index 9676955d1..34f0bd1ec 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicWriter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicWriter.java @@ -42,6 +42,7 @@ import com.sk89q.worldedit.world.biome.BiomeTypes; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import net.jpountz.lz4.LZ4BlockInputStream; import net.jpountz.lz4.LZ4BlockOutputStream; @@ -138,7 +139,7 @@ public class SpongeSchematicWriter implements ClipboardWriter { NBTOutputStream tilesOut = new NBTOutputStream(new LZ4BlockOutputStream(tilesCompressed)); List paletteList = new ArrayList<>(); - char[] palette = new char[BlockTypes.states.length]; + char[] palette = new char[BlockTypesCache.states.length]; Arrays.fill(palette, Character.MAX_VALUE); int[] paletteMax = {0}; int numTiles = 0; @@ -175,7 +176,7 @@ public class SpongeSchematicWriter implements ClipboardWriter { out.writeLazyCompoundTag("Palette", out12 -> { for (int i = 0; i < paletteList.size(); i++) { int stateOrdinal = paletteList.get(i); - BlockState state = BlockTypes.states[stateOrdinal]; + BlockState state = BlockTypesCache.states[stateOrdinal]; out12.writeNamedTag(state.getAsString(), i); } }); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java index e79c0ade6..739b19da9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java @@ -67,6 +67,8 @@ import java.util.List; import java.util.Locale; import java.util.Map; import javax.annotation.Nullable; + +import com.sk89q.worldedit.world.block.BlockTypesCache; import org.jetbrains.annotations.NotNull; /** @@ -468,14 +470,14 @@ public class BlockTransformExtent extends ResettableExtent { int internalId = state.getInternalId(); int maskedId = internalId & mask; - int newMaskedId = arr[maskedId >> BlockTypes.BIT_OFFSET]; + int newMaskedId = arr[maskedId >> BlockTypesCache.BIT_OFFSET]; if (newMaskedId != -1) { return BlockState.getFromInternalId(newMaskedId | (internalId & (~mask))); } newMaskedId = transformState(state, transform); - arr[maskedId >> BlockTypes.BIT_OFFSET] = newMaskedId & mask; + arr[maskedId >> BlockTypesCache.BIT_OFFSET] = newMaskedId & mask; return BlockState.getFromInternalId(newMaskedId); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ABlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ABlockMask.java index 0dcc944b4..9b5ea1aca 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ABlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ABlockMask.java @@ -5,6 +5,7 @@ import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import java.util.ArrayList; import java.util.List; @@ -19,7 +20,7 @@ public abstract class ABlockMask extends AbstractExtentMask { @Override public String toString() { List strings = new ArrayList<>(); - for (BlockType type : BlockTypes.values) { + for (BlockType type : BlockTypesCache.values) { if (type != null) { boolean hasAll; List all = type.getAllStates(); @@ -43,7 +44,7 @@ public abstract class ABlockMask extends AbstractExtentMask { if (mask instanceof ABlockMask) { ABlockMask other = (ABlockMask) mask; BlockMask newMask = new BlockMask(getExtent()); - for (BlockState state : BlockTypes.states) { + for (BlockState state : BlockTypesCache.states) { if (state != null) { if (test(state) && other.test(state)) { newMask.add(state); @@ -62,7 +63,7 @@ public abstract class ABlockMask extends AbstractExtentMask { if (mask instanceof ABlockMask) { ABlockMask other = (ABlockMask) mask; BlockMask newMask = new BlockMask(getExtent()); - for (BlockState state : BlockTypes.states) { + for (BlockState state : BlockTypesCache.states) { if (state != null) { if (test(state) || other.test(state)) { newMask.add(state); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java index 3920fd644..c36c5fb82 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java @@ -28,6 +28,7 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import java.util.Arrays; import java.util.Collection; @@ -51,7 +52,7 @@ public class BlockMask extends ABlockMask { } public BlockMask(Extent extent) { - this(extent, new boolean[BlockTypes.states.length]); + this(extent, new boolean[BlockTypesCache.states.length]); } public BlockMask(Extent extent, boolean[] ordinals) { @@ -86,7 +87,7 @@ public class BlockMask extends ABlockMask { public BlockMask add(Predicate predicate) { for (int i = 0; i < ordinals.length; i++) { if (!ordinals[i]) { - BlockState state = BlockTypes.states[i]; + BlockState state = BlockTypesCache.states[i]; if (state != null) { ordinals[i] = predicate.test(state); } @@ -221,7 +222,7 @@ public class BlockMask extends ABlockMask { BlockType unsetType = null; int totalTypes = 0; - for (BlockType type : BlockTypes.values) { + for (BlockType type : BlockTypesCache.values) { if (type != null) { totalTypes++; boolean hasAll = true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMaskBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMaskBuilder.java index 3fd433e89..c84af2122 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMaskBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMaskBuilder.java @@ -14,6 +14,7 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import java.util.*; import java.util.function.BiPredicate; @@ -102,7 +103,7 @@ public class BlockMaskBuilder { } else { String regex = charSequence.toString(); blockTypeList = new ArrayList<>(); - for (BlockType myType : BlockTypes.values) { + for (BlockType myType : BlockTypesCache.values) { if (myType.getId().matches(regex)) { blockTypeList.add(myType); add(myType); @@ -209,7 +210,7 @@ public class BlockMaskBuilder { if (StringMan.isAlphanumericUnd(input)) { add(BlockTypes.parse(input)); } else { - for (BlockType myType : BlockTypes.values) { + for (BlockType myType : BlockTypesCache.values) { if (myType.getId().matches(input)) { add(myType); } @@ -223,7 +224,7 @@ public class BlockMaskBuilder { AbstractProperty prop = (AbstractProperty) property; long[] states = bitSets[type.getInternalId()]; if (states == null) return false; - int localI = index << prop.getBitOffset() >> BlockTypes.BIT_OFFSET; + int localI = index << prop.getBitOffset() >> BlockTypesCache.BIT_OFFSET; return (states == ALL || FastBitSet.get(states, localI)); } @@ -357,7 +358,7 @@ public class BlockMaskBuilder { for (AbstractProperty prop : properties) { List values = prop.getValues(); for (int j = 0; j < values.size(); j++) { - int localI = j << prop.getBitOffset() >> BlockTypes.BIT_OFFSET; + int localI = j << prop.getBitOffset() >> BlockTypesCache.BIT_OFFSET; if (states == ALL || FastBitSet.get(states, localI)) { if (!allowed.test(type, new AbstractMap.SimpleEntry(prop, values.get(j)))) { if (states == ALL) { @@ -435,7 +436,7 @@ public class BlockMaskBuilder { for (AbstractProperty prop : (List>) type.getProperties()) { List values = prop.getValues(); for (int j = 0; j < values.size(); j++) { - int localI = j << prop.getBitOffset() >> BlockTypes.BIT_OFFSET; + int localI = j << prop.getBitOffset() >> BlockTypesCache.BIT_OFFSET; if (states == null || !FastBitSet.get(states, localI)) { if (propPredicate.test(type, new AbstractMap.SimpleEntry(prop, values.get(j)))) { if (states == null) { @@ -457,7 +458,7 @@ public class BlockMaskBuilder { if (states == ALL) return this; List values = property.getValues(); - int localI = index << prop.getBitOffset() >> BlockTypes.BIT_OFFSET; + int localI = index << prop.getBitOffset() >> BlockTypesCache.BIT_OFFSET; if (states == null || !FastBitSet.get(states, localI)) { if (states == null) { bitSets[type.getInternalId()] = states = FastBitSet.create(type.getMaxStateId() + 1); @@ -473,7 +474,7 @@ public class BlockMaskBuilder { long[] states = bitSets[type.getInternalId()]; if (states == null) return this; List values = property.getValues(); - int localI = index << prop.getBitOffset() >> BlockTypes.BIT_OFFSET; + int localI = index << prop.getBitOffset() >> BlockTypesCache.BIT_OFFSET; if (states == ALL || FastBitSet.get(states, localI)) { if (states == ALL) { bitSets[type.getInternalId()] = states = FastBitSet.create(type.getMaxStateId() + 1); @@ -495,7 +496,7 @@ public class BlockMaskBuilder { } } else { for (int i = 0; i < values.size(); i++) { - int index = current.modifyIndex(state, i) >> BlockTypes.BIT_OFFSET; + int index = current.modifyIndex(state, i) >> BlockTypesCache.BIT_OFFSET; if (set) FastBitSet.set(states, index); else FastBitSet.clear(states, index); } @@ -543,7 +544,7 @@ public class BlockMaskBuilder { for (AbstractProperty prop : (List>) type.getProperties()) { List values = prop.getValues(); for (int j = 0; j < values.size(); j++) { - int localI = j << prop.getBitOffset() >> BlockTypes.BIT_OFFSET; + int localI = j << prop.getBitOffset() >> BlockTypesCache.BIT_OFFSET; if (FastBitSet.get(bitSet, localI)) set++; else clear++; } @@ -558,11 +559,11 @@ public class BlockMaskBuilder { private boolean[] getOrdinals() { if (ordinals == null) { - ordinals = new boolean[BlockTypes.states.length]; - for (int i = 0; i < BlockTypes.values.length; i++) { + ordinals = new boolean[BlockTypesCache.states.length]; + for (int i = 0; i < BlockTypesCache.values.length; i++) { long[] bitSet = bitSets[i]; if (bitSet == null) continue; - BlockType type = BlockTypes.values[i]; + BlockType type = BlockTypesCache.values[i]; if (bitSet == ALL) { for (BlockState state : type.getAllStates()) { ordinals[state.getOrdinal()] = true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/InverseSingleBlockTypeMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/InverseSingleBlockTypeMask.java index c52de0587..ba327b84a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/InverseSingleBlockTypeMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/InverseSingleBlockTypeMask.java @@ -5,6 +5,7 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; public class InverseSingleBlockTypeMask extends ABlockMask { private final int internalId; @@ -26,7 +27,7 @@ public class InverseSingleBlockTypeMask extends ABlockMask { @Override public Mask inverse() { - return new SingleBlockTypeMask(getExtent(), BlockTypes.values[internalId]); + return new SingleBlockTypeMask(getExtent(), BlockTypesCache.values[internalId]); } public BlockType getBlockType() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SingleBlockTypeMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SingleBlockTypeMask.java index d493960bf..2ab4f2add 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SingleBlockTypeMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SingleBlockTypeMask.java @@ -5,6 +5,7 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; public class SingleBlockTypeMask extends ABlockMask { private final int internalId; @@ -26,7 +27,7 @@ public class SingleBlockTypeMask extends ABlockMask { @Override public Mask inverse() { - return new InverseSingleBlockTypeMask(getExtent(), BlockTypes.values[internalId]); + return new InverseSingleBlockTypeMask(getExtent(), BlockTypesCache.values[internalId]); } public BlockType getBlockType() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/WaterloggedRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/WaterloggedRemover.java index 3ff8c65ac..886706f08 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/WaterloggedRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/WaterloggedRemover.java @@ -27,6 +27,8 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; + import java.lang.ref.SoftReference; /** @@ -39,7 +41,7 @@ public class WaterloggedRemover extends AbstractExtentPattern { private synchronized BlockState[] getRemap() { BlockState[] remap = cache.get(); if (remap != null) return remap; - cache = new SoftReference<>(remap = new BlockState[BlockTypes.states.length]); + cache = new SoftReference<>(remap = new BlockState[BlockTypesCache.states.length]); // init for (int i = 0; i < remap.length; i++) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java index 4c1028b5a..777e8afc9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java @@ -23,6 +23,7 @@ import com.boydti.fawe.util.MathMan; import static com.google.common.base.Preconditions.checkState; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import javax.annotation.Nullable; import java.util.List; @@ -46,7 +47,7 @@ public abstract class AbstractProperty implements Property { this.name = name; this.values = values; this.numBits = MathMan.log2nlz(values.size()); - this.bitOffset = bitOffset + BlockTypes.BIT_OFFSET; + this.bitOffset = bitOffset + BlockTypesCache.BIT_OFFSET; this.bitMask = (((1 << numBits) - 1)) << this.bitOffset; this.bitMaskInverse = ~this.bitMask; this.key = PropertyKey.getOrCreate(name); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/PropertyGroup.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/PropertyGroup.java index 9079d8498..2441771b1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/PropertyGroup.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/PropertyGroup.java @@ -4,6 +4,7 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypesCache; import java.util.ArrayList; import java.util.Arrays; @@ -57,7 +58,7 @@ public class PropertyGroup { public PropertyGroup build() { PropertyFunction[] states = new PropertyFunction[BlockTypes.size()]; Property prop; - for (BlockType type : BlockTypes.values) { + for (BlockType type : BlockTypesCache.values) { for (Object[] func : funcs) { if ((prop = type.getProperty((PropertyKey) func[0])) != null) { PropertyFunction pf = new PropertyFunction(prop, (Function) func[1], (Function) func[2]); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java index ce313ae80..7d50e0739 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java @@ -77,7 +77,7 @@ public class BlockState implements BlockStateHolder, FawePattern { @Deprecated public static BlockState getFromOrdinal(int ordinal) { - return BlockTypes.states[ordinal]; + return BlockTypesCache.states[ordinal]; } /** @@ -122,7 +122,7 @@ public class BlockState implements BlockStateHolder, FawePattern { type = BlockTypes.get(key); if (type == null) { String input = key.toString(); - throw new SuggestInputParseException("Does not match a valid block type: " + input, input, () -> Stream.of(BlockTypes.values) + throw new SuggestInputParseException("Does not match a valid block type: " + input, input, () -> Stream.of(BlockTypesCache.values) .filter(b -> StringMan.blockStateMatches(input, b.getId())) .map(BlockType::getId) .sorted(StringMan.blockStateComparator(input)) @@ -203,7 +203,7 @@ public class BlockState implements BlockStateHolder, FawePattern { continue; } } - return type.withPropertyId(stateId >> BlockTypes.BIT_OFFSET); + return type.withPropertyId(stateId >> BlockTypesCache.BIT_OFFSET); } @Override @@ -237,13 +237,13 @@ public class BlockState implements BlockStateHolder, FawePattern { @Deprecated @Override public final int getInternalPropertiesId() { - return this.getInternalId() >> BlockTypes.BIT_OFFSET; + return this.getInternalId() >> BlockTypesCache.BIT_OFFSET; } @Deprecated @Override public final int getInternalBlockTypeId() { - return this.getInternalId() & BlockTypes.BIT_MASK; + return this.getInternalId() & BlockTypesCache.BIT_MASK; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java index 421238f17..df3ba9827 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java @@ -51,7 +51,7 @@ public class BlockType implements FawePattern, Keyed { public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("block type"); private final String id; - private final BlockTypes.Settings settings; + private final BlockTypesCache.Settings settings; private boolean initItemType; private ItemType itemType; @@ -59,7 +59,7 @@ public class BlockType implements FawePattern, Keyed { protected BlockType(String id, int internalId, List states) { int i = id.indexOf("["); this.id = i == -1 ? id : id.substring(0, i); - this.settings = new BlockTypes.Settings(this, id, internalId, states); + this.settings = new BlockTypesCache.Settings(this, id, internalId, states); } @Deprecated @@ -105,12 +105,12 @@ public class BlockType implements FawePattern, Keyed { @Deprecated public BlockState withPropertyId(int propertyId) { if (settings.stateOrdinals == null) return settings.defaultState; - return BlockTypes.states[settings.stateOrdinals[propertyId]]; + return BlockTypesCache.states[settings.stateOrdinals[propertyId]]; } @Deprecated public BlockState withStateId(int internalStateId) { // - return this.withPropertyId(internalStateId >> BlockTypes.BIT_OFFSET); + return this.withPropertyId(internalStateId >> BlockTypesCache.BIT_OFFSET); } /** @@ -180,7 +180,7 @@ public class BlockType implements FawePattern, Keyed { */ public List getAllStates() { if (settings.stateOrdinals == null) return Collections.singletonList(getDefaultState()); - return IntStream.of(settings.stateOrdinals).filter(i -> i != -1).mapToObj(i -> BlockTypes.states[i]).collect(Collectors.toList()); + return IntStream.of(settings.stateOrdinals).filter(i -> i != -1).mapToObj(i -> BlockTypesCache.states[i]).collect(Collectors.toList()); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypeSwitchBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypeSwitchBuilder.java index 4d385e0b3..e31885305 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypeSwitchBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypeSwitchBuilder.java @@ -17,7 +17,7 @@ public class BlockTypeSwitchBuilder { } public BlockTypeSwitchBuilder add(Predicate predicate, T task) { - for (BlockType type : BlockTypes.values) { + for (BlockType type : BlockTypesCache.values) { if (predicate.test(type)) { this.runnables[type.getInternalId()] = task; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java index 7d1be652a..2a43e629b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.world.block; import com.boydti.fawe.command.SuggestInputParseException; +import com.boydti.fawe.object.string.JoinedCharSequence; import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.ReflectionUtils; import com.boydti.fawe.util.StringMan; @@ -55,918 +56,706 @@ import java.util.stream.Stream; */ public final class BlockTypes { // Doesn't really matter what the hardcoded values are, as FAWE will update it on load - @Nullable public static final BlockType __RESERVED__ = null; // Placeholder for null index (i.e. when block types are represented as primitives) - @Nullable public static final BlockType ACACIA_BUTTON = null; - @Nullable public static final BlockType ACACIA_DOOR = null; - @Nullable public static final BlockType ACACIA_FENCE = null; - @Nullable public static final BlockType ACACIA_FENCE_GATE = null; - @Nullable public static final BlockType ACACIA_LEAVES = null; - @Nullable public static final BlockType ACACIA_LOG = null; - @Nullable public static final BlockType ACACIA_PLANKS = null; - @Nullable public static final BlockType ACACIA_PRESSURE_PLATE = null; - @Nullable public static final BlockType ACACIA_SAPLING = null; - @Nullable public static final BlockType ACACIA_SIGN = null; - @Nullable public static final BlockType ACACIA_SLAB = null; - @Nullable public static final BlockType ACACIA_STAIRS = null; - @Nullable public static final BlockType ACACIA_TRAPDOOR = null; - @Nullable public static final BlockType ACACIA_WALL_SIGN = null; - @Nullable public static final BlockType ACACIA_WOOD = null; - @Nullable public static final BlockType ACTIVATOR_RAIL = null; - @Nullable public static final BlockType AIR = null; - @Nullable public static final BlockType ALLIUM = null; - @Nullable public static final BlockType ANDESITE = null; - @Nullable public static final BlockType ANDESITE_SLAB = null; - @Nullable public static final BlockType ANDESITE_STAIRS = null; - @Nullable public static final BlockType ANDESITE_WALL = null; - @Nullable public static final BlockType ANVIL = null; - @Nullable public static final BlockType ATTACHED_MELON_STEM = null; - @Nullable public static final BlockType ATTACHED_PUMPKIN_STEM = null; - @Nullable public static final BlockType AZURE_BLUET = null; - @Nullable public static final BlockType BAMBOO = null; - @Nullable public static final BlockType BAMBOO_SAPLING = null; - @Nullable public static final BlockType BARREL = null; - @Nullable public static final BlockType BARRIER = null; - @Nullable public static final BlockType BEACON = null; - @Nullable public static final BlockType BEDROCK = null; - @Nullable public static final BlockType BEETROOTS = null; - @Nullable public static final BlockType BELL = null; - @Nullable public static final BlockType BIRCH_BUTTON = null; - @Nullable public static final BlockType BIRCH_DOOR = null; - @Nullable public static final BlockType BIRCH_FENCE = null; - @Nullable public static final BlockType BIRCH_FENCE_GATE = null; - @Nullable public static final BlockType BIRCH_LEAVES = null; - @Nullable public static final BlockType BIRCH_LOG = null; - @Nullable public static final BlockType BIRCH_PLANKS = null; - @Nullable public static final BlockType BIRCH_PRESSURE_PLATE = null; - @Nullable public static final BlockType BIRCH_SAPLING = null; - @Nullable public static final BlockType BIRCH_SIGN = null; - @Nullable public static final BlockType BIRCH_SLAB = null; - @Nullable public static final BlockType BIRCH_STAIRS = null; - @Nullable public static final BlockType BIRCH_TRAPDOOR = null; - @Nullable public static final BlockType BIRCH_WALL_SIGN = null; - @Nullable public static final BlockType BIRCH_WOOD = null; - @Nullable public static final BlockType BLACK_BANNER = null; - @Nullable public static final BlockType BLACK_BED = null; - @Nullable public static final BlockType BLACK_CARPET = null; - @Nullable public static final BlockType BLACK_CONCRETE = null; - @Nullable public static final BlockType BLACK_CONCRETE_POWDER = null; - @Nullable public static final BlockType BLACK_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType BLACK_SHULKER_BOX = null; - @Nullable public static final BlockType BLACK_STAINED_GLASS = null; - @Nullable public static final BlockType BLACK_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType BLACK_TERRACOTTA = null; - @Nullable public static final BlockType BLACK_WALL_BANNER = null; - @Nullable public static final BlockType BLACK_WOOL = null; - @Nullable public static final BlockType BLAST_FURNACE = null; - @Nullable public static final BlockType BLUE_BANNER = null; - @Nullable public static final BlockType BLUE_BED = null; - @Nullable public static final BlockType BLUE_CARPET = null; - @Nullable public static final BlockType BLUE_CONCRETE = null; - @Nullable public static final BlockType BLUE_CONCRETE_POWDER = null; - @Nullable public static final BlockType BLUE_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType BLUE_ICE = null; - @Nullable public static final BlockType BLUE_ORCHID = null; - @Nullable public static final BlockType BLUE_SHULKER_BOX = null; - @Nullable public static final BlockType BLUE_STAINED_GLASS = null; - @Nullable public static final BlockType BLUE_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType BLUE_TERRACOTTA = null; - @Nullable public static final BlockType BLUE_WALL_BANNER = null; - @Nullable public static final BlockType BLUE_WOOL = null; - @Nullable public static final BlockType BONE_BLOCK = null; - @Nullable public static final BlockType BOOKSHELF = null; - @Nullable public static final BlockType BRAIN_CORAL = null; - @Nullable public static final BlockType BRAIN_CORAL_BLOCK = null; - @Nullable public static final BlockType BRAIN_CORAL_FAN = null; - @Nullable public static final BlockType BRAIN_CORAL_WALL_FAN = null; - @Nullable public static final BlockType BREWING_STAND = null; - @Nullable public static final BlockType BRICK_SLAB = null; - @Nullable public static final BlockType BRICK_STAIRS = null; - @Nullable public static final BlockType BRICK_WALL = null; - @Nullable public static final BlockType BRICKS = null; - @Nullable public static final BlockType BROWN_BANNER = null; - @Nullable public static final BlockType BROWN_BED = null; - @Nullable public static final BlockType BROWN_CARPET = null; - @Nullable public static final BlockType BROWN_CONCRETE = null; - @Nullable public static final BlockType BROWN_CONCRETE_POWDER = null; - @Nullable public static final BlockType BROWN_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType BROWN_MUSHROOM = null; - @Nullable public static final BlockType BROWN_MUSHROOM_BLOCK = null; - @Nullable public static final BlockType BROWN_SHULKER_BOX = null; - @Nullable public static final BlockType BROWN_STAINED_GLASS = null; - @Nullable public static final BlockType BROWN_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType BROWN_TERRACOTTA = null; - @Nullable public static final BlockType BROWN_WALL_BANNER = null; - @Nullable public static final BlockType BROWN_WOOL = null; - @Nullable public static final BlockType BUBBLE_COLUMN = null; - @Nullable public static final BlockType BUBBLE_CORAL = null; - @Nullable public static final BlockType BUBBLE_CORAL_BLOCK = null; - @Nullable public static final BlockType BUBBLE_CORAL_FAN = null; - @Nullable public static final BlockType BUBBLE_CORAL_WALL_FAN = null; - @Nullable public static final BlockType CACTUS = null; - @Nullable public static final BlockType CAKE = null; - @Nullable public static final BlockType CAMPFIRE = null; - @Nullable public static final BlockType CARROTS = null; - @Nullable public static final BlockType CARTOGRAPHY_TABLE = null; - @Nullable public static final BlockType CARVED_PUMPKIN = null; - @Nullable public static final BlockType CAULDRON = null; - @Nullable public static final BlockType CAVE_AIR = null; - @Nullable public static final BlockType CHAIN_COMMAND_BLOCK = null; - @Nullable public static final BlockType CHEST = null; - @Nullable public static final BlockType CHIPPED_ANVIL = null; - @Nullable public static final BlockType CHISELED_QUARTZ_BLOCK = null; - @Nullable public static final BlockType CHISELED_RED_SANDSTONE = null; - @Nullable public static final BlockType CHISELED_SANDSTONE = null; - @Nullable public static final BlockType CHISELED_STONE_BRICKS = null; - @Nullable public static final BlockType CHORUS_FLOWER = null; - @Nullable public static final BlockType CHORUS_PLANT = null; - @Nullable public static final BlockType CLAY = null; - @Nullable public static final BlockType COAL_BLOCK = null; - @Nullable public static final BlockType COAL_ORE = null; - @Nullable public static final BlockType COARSE_DIRT = null; - @Nullable public static final BlockType COBBLESTONE = null; - @Nullable public static final BlockType COBBLESTONE_SLAB = null; - @Nullable public static final BlockType COBBLESTONE_STAIRS = null; - @Nullable public static final BlockType COBBLESTONE_WALL = null; - @Nullable public static final BlockType COBWEB = null; - @Nullable public static final BlockType COCOA = null; - @Nullable public static final BlockType COMMAND_BLOCK = null; - @Nullable public static final BlockType COMPARATOR = null; - @Nullable public static final BlockType COMPOSTER = null; - @Nullable public static final BlockType CONDUIT = null; - @Nullable public static final BlockType CORNFLOWER = null; - @Nullable public static final BlockType CRACKED_STONE_BRICKS = null; - @Nullable public static final BlockType CRAFTING_TABLE = null; - @Nullable public static final BlockType CREEPER_HEAD = null; - @Nullable public static final BlockType CREEPER_WALL_HEAD = null; - @Nullable public static final BlockType CUT_RED_SANDSTONE = null; - @Nullable public static final BlockType CUT_RED_SANDSTONE_SLAB = null; - @Nullable public static final BlockType CUT_SANDSTONE = null; - @Nullable public static final BlockType CUT_SANDSTONE_SLAB = null; - @Nullable public static final BlockType CYAN_BANNER = null; - @Nullable public static final BlockType CYAN_BED = null; - @Nullable public static final BlockType CYAN_CARPET = null; - @Nullable public static final BlockType CYAN_CONCRETE = null; - @Nullable public static final BlockType CYAN_CONCRETE_POWDER = null; - @Nullable public static final BlockType CYAN_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType CYAN_SHULKER_BOX = null; - @Nullable public static final BlockType CYAN_STAINED_GLASS = null; - @Nullable public static final BlockType CYAN_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType CYAN_TERRACOTTA = null; - @Nullable public static final BlockType CYAN_WALL_BANNER = null; - @Nullable public static final BlockType CYAN_WOOL = null; - @Nullable public static final BlockType DAMAGED_ANVIL = null; - @Nullable public static final BlockType DANDELION = null; - @Nullable public static final BlockType DARK_OAK_BUTTON = null; - @Nullable public static final BlockType DARK_OAK_DOOR = null; - @Nullable public static final BlockType DARK_OAK_FENCE = null; - @Nullable public static final BlockType DARK_OAK_FENCE_GATE = null; - @Nullable public static final BlockType DARK_OAK_LEAVES = null; - @Nullable public static final BlockType DARK_OAK_LOG = null; - @Nullable public static final BlockType DARK_OAK_PLANKS = null; - @Nullable public static final BlockType DARK_OAK_PRESSURE_PLATE = null; - @Nullable public static final BlockType DARK_OAK_SAPLING = null; - @Nullable public static final BlockType DARK_OAK_SIGN = null; - @Nullable public static final BlockType DARK_OAK_SLAB = null; - @Nullable public static final BlockType DARK_OAK_STAIRS = null; - @Nullable public static final BlockType DARK_OAK_TRAPDOOR = null; - @Nullable public static final BlockType DARK_OAK_WALL_SIGN = null; - @Nullable public static final BlockType DARK_OAK_WOOD = null; - @Nullable public static final BlockType DARK_PRISMARINE = null; - @Nullable public static final BlockType DARK_PRISMARINE_SLAB = null; - @Nullable public static final BlockType DARK_PRISMARINE_STAIRS = null; - @Nullable public static final BlockType DAYLIGHT_DETECTOR = null; - @Nullable public static final BlockType DEAD_BRAIN_CORAL = null; - @Nullable public static final BlockType DEAD_BRAIN_CORAL_BLOCK = null; - @Nullable public static final BlockType DEAD_BRAIN_CORAL_FAN = null; - @Nullable public static final BlockType DEAD_BRAIN_CORAL_WALL_FAN = null; - @Nullable public static final BlockType DEAD_BUBBLE_CORAL = null; - @Nullable public static final BlockType DEAD_BUBBLE_CORAL_BLOCK = null; - @Nullable public static final BlockType DEAD_BUBBLE_CORAL_FAN = null; - @Nullable public static final BlockType DEAD_BUBBLE_CORAL_WALL_FAN = null; - @Nullable public static final BlockType DEAD_BUSH = null; - @Nullable public static final BlockType DEAD_FIRE_CORAL = null; - @Nullable public static final BlockType DEAD_FIRE_CORAL_BLOCK = null; - @Nullable public static final BlockType DEAD_FIRE_CORAL_FAN = null; - @Nullable public static final BlockType DEAD_FIRE_CORAL_WALL_FAN = null; - @Nullable public static final BlockType DEAD_HORN_CORAL = null; - @Nullable public static final BlockType DEAD_HORN_CORAL_BLOCK = null; - @Nullable public static final BlockType DEAD_HORN_CORAL_FAN = null; - @Nullable public static final BlockType DEAD_HORN_CORAL_WALL_FAN = null; - @Nullable public static final BlockType DEAD_TUBE_CORAL = null; - @Nullable public static final BlockType DEAD_TUBE_CORAL_BLOCK = null; - @Nullable public static final BlockType DEAD_TUBE_CORAL_FAN = null; - @Nullable public static final BlockType DEAD_TUBE_CORAL_WALL_FAN = null; - @Nullable public static final BlockType DETECTOR_RAIL = null; - @Nullable public static final BlockType DIAMOND_BLOCK = null; - @Nullable public static final BlockType DIAMOND_ORE = null; - @Nullable public static final BlockType DIORITE = null; - @Nullable public static final BlockType DIORITE_SLAB = null; - @Nullable public static final BlockType DIORITE_STAIRS = null; - @Nullable public static final BlockType DIORITE_WALL = null; - @Nullable public static final BlockType DIRT = null; - @Nullable public static final BlockType DISPENSER = null; - @Nullable public static final BlockType DRAGON_EGG = null; - @Nullable public static final BlockType DRAGON_HEAD = null; - @Nullable public static final BlockType DRAGON_WALL_HEAD = null; - @Nullable public static final BlockType DRIED_KELP_BLOCK = null; - @Nullable public static final BlockType DROPPER = null; - @Nullable public static final BlockType EMERALD_BLOCK = null; - @Nullable public static final BlockType EMERALD_ORE = null; - @Nullable public static final BlockType ENCHANTING_TABLE = null; - @Nullable public static final BlockType END_GATEWAY = null; - @Nullable public static final BlockType END_PORTAL = null; - @Nullable public static final BlockType END_PORTAL_FRAME = null; - @Nullable public static final BlockType END_ROD = null; - @Nullable public static final BlockType END_STONE = null; - @Nullable public static final BlockType END_STONE_BRICK_SLAB = null; - @Nullable public static final BlockType END_STONE_BRICK_STAIRS = null; - @Nullable public static final BlockType END_STONE_BRICK_WALL = null; - @Nullable public static final BlockType END_STONE_BRICKS = null; - @Nullable public static final BlockType ENDER_CHEST = null; - @Nullable public static final BlockType FARMLAND = null; - @Nullable public static final BlockType FERN = null; - @Nullable public static final BlockType FIRE = null; - @Nullable public static final BlockType FIRE_CORAL = null; - @Nullable public static final BlockType FIRE_CORAL_BLOCK = null; - @Nullable public static final BlockType FIRE_CORAL_FAN = null; - @Nullable public static final BlockType FIRE_CORAL_WALL_FAN = null; - @Nullable public static final BlockType FLETCHING_TABLE = null; - @Nullable public static final BlockType FLOWER_POT = null; - @Nullable public static final BlockType FROSTED_ICE = null; - @Nullable public static final BlockType FURNACE = null; - @Nullable public static final BlockType GLASS = null; - @Nullable public static final BlockType GLASS_PANE = null; - @Nullable public static final BlockType GLOWSTONE = null; - @Nullable public static final BlockType GOLD_BLOCK = null; - @Nullable public static final BlockType GOLD_ORE = null; - @Nullable public static final BlockType GRANITE = null; - @Nullable public static final BlockType GRANITE_SLAB = null; - @Nullable public static final BlockType GRANITE_STAIRS = null; - @Nullable public static final BlockType GRANITE_WALL = null; - @Nullable public static final BlockType GRASS = null; - @Nullable public static final BlockType GRASS_BLOCK = null; - @Nullable public static final BlockType GRASS_PATH = null; - @Nullable public static final BlockType GRAVEL = null; - @Nullable public static final BlockType GRAY_BANNER = null; - @Nullable public static final BlockType GRAY_BED = null; - @Nullable public static final BlockType GRAY_CARPET = null; - @Nullable public static final BlockType GRAY_CONCRETE = null; - @Nullable public static final BlockType GRAY_CONCRETE_POWDER = null; - @Nullable public static final BlockType GRAY_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType GRAY_SHULKER_BOX = null; - @Nullable public static final BlockType GRAY_STAINED_GLASS = null; - @Nullable public static final BlockType GRAY_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType GRAY_TERRACOTTA = null; - @Nullable public static final BlockType GRAY_WALL_BANNER = null; - @Nullable public static final BlockType GRAY_WOOL = null; - @Nullable public static final BlockType GREEN_BANNER = null; - @Nullable public static final BlockType GREEN_BED = null; - @Nullable public static final BlockType GREEN_CARPET = null; - @Nullable public static final BlockType GREEN_CONCRETE = null; - @Nullable public static final BlockType GREEN_CONCRETE_POWDER = null; - @Nullable public static final BlockType GREEN_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType GREEN_SHULKER_BOX = null; - @Nullable public static final BlockType GREEN_STAINED_GLASS = null; - @Nullable public static final BlockType GREEN_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType GREEN_TERRACOTTA = null; - @Nullable public static final BlockType GREEN_WALL_BANNER = null; - @Nullable public static final BlockType GREEN_WOOL = null; - @Nullable public static final BlockType GRINDSTONE = null; - @Nullable public static final BlockType HAY_BLOCK = null; - @Nullable public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = null; - @Nullable public static final BlockType HOPPER = null; - @Nullable public static final BlockType HORN_CORAL = null; - @Nullable public static final BlockType HORN_CORAL_BLOCK = null; - @Nullable public static final BlockType HORN_CORAL_FAN = null; - @Nullable public static final BlockType HORN_CORAL_WALL_FAN = null; - @Nullable public static final BlockType ICE = null; - @Nullable public static final BlockType INFESTED_CHISELED_STONE_BRICKS = null; - @Nullable public static final BlockType INFESTED_COBBLESTONE = null; - @Nullable public static final BlockType INFESTED_CRACKED_STONE_BRICKS = null; - @Nullable public static final BlockType INFESTED_MOSSY_STONE_BRICKS = null; - @Nullable public static final BlockType INFESTED_STONE = null; - @Nullable public static final BlockType INFESTED_STONE_BRICKS = null; - @Nullable public static final BlockType IRON_BARS = null; - @Nullable public static final BlockType IRON_BLOCK = null; - @Nullable public static final BlockType IRON_DOOR = null; - @Nullable public static final BlockType IRON_ORE = null; - @Nullable public static final BlockType IRON_TRAPDOOR = null; - @Nullable public static final BlockType JACK_O_LANTERN = null; - @Nullable public static final BlockType JIGSAW = null; - @Nullable public static final BlockType JUKEBOX = null; - @Nullable public static final BlockType JUNGLE_BUTTON = null; - @Nullable public static final BlockType JUNGLE_DOOR = null; - @Nullable public static final BlockType JUNGLE_FENCE = null; - @Nullable public static final BlockType JUNGLE_FENCE_GATE = null; - @Nullable public static final BlockType JUNGLE_LEAVES = null; - @Nullable public static final BlockType JUNGLE_LOG = null; - @Nullable public static final BlockType JUNGLE_PLANKS = null; - @Nullable public static final BlockType JUNGLE_PRESSURE_PLATE = null; - @Nullable public static final BlockType JUNGLE_SAPLING = null; - @Nullable public static final BlockType JUNGLE_SIGN = null; - @Nullable public static final BlockType JUNGLE_SLAB = null; - @Nullable public static final BlockType JUNGLE_STAIRS = null; - @Nullable public static final BlockType JUNGLE_TRAPDOOR = null; - @Nullable public static final BlockType JUNGLE_WALL_SIGN = null; - @Nullable public static final BlockType JUNGLE_WOOD = null; - @Nullable public static final BlockType KELP = null; - @Nullable public static final BlockType KELP_PLANT = null; - @Nullable public static final BlockType LADDER = null; - @Nullable public static final BlockType LANTERN = null; - @Nullable public static final BlockType LAPIS_BLOCK = null; - @Nullable public static final BlockType LAPIS_ORE = null; - @Nullable public static final BlockType LARGE_FERN = null; - @Nullable public static final BlockType LAVA = null; - @Nullable public static final BlockType LECTERN = null; - @Nullable public static final BlockType LEVER = null; - @Nullable public static final BlockType LIGHT_BLUE_BANNER = null; - @Nullable public static final BlockType LIGHT_BLUE_BED = null; - @Nullable public static final BlockType LIGHT_BLUE_CARPET = null; - @Nullable public static final BlockType LIGHT_BLUE_CONCRETE = null; - @Nullable public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = null; - @Nullable public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType LIGHT_BLUE_SHULKER_BOX = null; - @Nullable public static final BlockType LIGHT_BLUE_STAINED_GLASS = null; - @Nullable public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType LIGHT_BLUE_TERRACOTTA = null; - @Nullable public static final BlockType LIGHT_BLUE_WALL_BANNER = null; - @Nullable public static final BlockType LIGHT_BLUE_WOOL = null; - @Nullable public static final BlockType LIGHT_GRAY_BANNER = null; - @Nullable public static final BlockType LIGHT_GRAY_BED = null; - @Nullable public static final BlockType LIGHT_GRAY_CARPET = null; - @Nullable public static final BlockType LIGHT_GRAY_CONCRETE = null; - @Nullable public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = null; - @Nullable public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType LIGHT_GRAY_SHULKER_BOX = null; - @Nullable public static final BlockType LIGHT_GRAY_STAINED_GLASS = null; - @Nullable public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType LIGHT_GRAY_TERRACOTTA = null; - @Nullable public static final BlockType LIGHT_GRAY_WALL_BANNER = null; - @Nullable public static final BlockType LIGHT_GRAY_WOOL = null; - @Nullable public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = null; - @Nullable public static final BlockType LILAC = null; - @Nullable public static final BlockType LILY_OF_THE_VALLEY = null; - @Nullable public static final BlockType LILY_PAD = null; - @Nullable public static final BlockType LIME_BANNER = null; - @Nullable public static final BlockType LIME_BED = null; - @Nullable public static final BlockType LIME_CARPET = null; - @Nullable public static final BlockType LIME_CONCRETE = null; - @Nullable public static final BlockType LIME_CONCRETE_POWDER = null; - @Nullable public static final BlockType LIME_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType LIME_SHULKER_BOX = null; - @Nullable public static final BlockType LIME_STAINED_GLASS = null; - @Nullable public static final BlockType LIME_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType LIME_TERRACOTTA = null; - @Nullable public static final BlockType LIME_WALL_BANNER = null; - @Nullable public static final BlockType LIME_WOOL = null; - @Nullable public static final BlockType LOOM = null; - @Nullable public static final BlockType MAGENTA_BANNER = null; - @Nullable public static final BlockType MAGENTA_BED = null; - @Nullable public static final BlockType MAGENTA_CARPET = null; - @Nullable public static final BlockType MAGENTA_CONCRETE = null; - @Nullable public static final BlockType MAGENTA_CONCRETE_POWDER = null; - @Nullable public static final BlockType MAGENTA_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType MAGENTA_SHULKER_BOX = null; - @Nullable public static final BlockType MAGENTA_STAINED_GLASS = null; - @Nullable public static final BlockType MAGENTA_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType MAGENTA_TERRACOTTA = null; - @Nullable public static final BlockType MAGENTA_WALL_BANNER = null; - @Nullable public static final BlockType MAGENTA_WOOL = null; - @Nullable public static final BlockType MAGMA_BLOCK = null; - @Nullable public static final BlockType MELON = null; - @Nullable public static final BlockType MELON_STEM = null; - @Nullable public static final BlockType MOSSY_COBBLESTONE = null; - @Nullable public static final BlockType MOSSY_COBBLESTONE_SLAB = null; - @Nullable public static final BlockType MOSSY_COBBLESTONE_STAIRS = null; - @Nullable public static final BlockType MOSSY_COBBLESTONE_WALL = null; - @Nullable public static final BlockType MOSSY_STONE_BRICK_SLAB = null; - @Nullable public static final BlockType MOSSY_STONE_BRICK_STAIRS = null; - @Nullable public static final BlockType MOSSY_STONE_BRICK_WALL = null; - @Nullable public static final BlockType MOSSY_STONE_BRICKS = null; - @Nullable public static final BlockType MOVING_PISTON = null; - @Nullable public static final BlockType MUSHROOM_STEM = null; - @Nullable public static final BlockType MYCELIUM = null; - @Nullable public static final BlockType NETHER_BRICK_FENCE = null; - @Nullable public static final BlockType NETHER_BRICK_SLAB = null; - @Nullable public static final BlockType NETHER_BRICK_STAIRS = null; - @Nullable public static final BlockType NETHER_BRICK_WALL = null; - @Nullable public static final BlockType NETHER_BRICKS = null; - @Nullable public static final BlockType NETHER_PORTAL = null; - @Nullable public static final BlockType NETHER_QUARTZ_ORE = null; - @Nullable public static final BlockType NETHER_WART = null; - @Nullable public static final BlockType NETHER_WART_BLOCK = null; - @Nullable public static final BlockType NETHERRACK = null; - @Nullable public static final BlockType NOTE_BLOCK = null; - @Nullable public static final BlockType OAK_BUTTON = null; - @Nullable public static final BlockType OAK_DOOR = null; - @Nullable public static final BlockType OAK_FENCE = null; - @Nullable public static final BlockType OAK_FENCE_GATE = null; - @Nullable public static final BlockType OAK_LEAVES = null; - @Nullable public static final BlockType OAK_LOG = null; - @Nullable public static final BlockType OAK_PLANKS = null; - @Nullable public static final BlockType OAK_PRESSURE_PLATE = null; - @Nullable public static final BlockType OAK_SAPLING = null; - @Nullable public static final BlockType OAK_SIGN = null; - @Nullable public static final BlockType OAK_SLAB = null; - @Nullable public static final BlockType OAK_STAIRS = null; - @Nullable public static final BlockType OAK_TRAPDOOR = null; - @Nullable public static final BlockType OAK_WALL_SIGN = null; - @Nullable public static final BlockType OAK_WOOD = null; - @Nullable public static final BlockType OBSERVER = null; - @Nullable public static final BlockType OBSIDIAN = null; - @Nullable public static final BlockType ORANGE_BANNER = null; - @Nullable public static final BlockType ORANGE_BED = null; - @Nullable public static final BlockType ORANGE_CARPET = null; - @Nullable public static final BlockType ORANGE_CONCRETE = null; - @Nullable public static final BlockType ORANGE_CONCRETE_POWDER = null; - @Nullable public static final BlockType ORANGE_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType ORANGE_SHULKER_BOX = null; - @Nullable public static final BlockType ORANGE_STAINED_GLASS = null; - @Nullable public static final BlockType ORANGE_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType ORANGE_TERRACOTTA = null; - @Nullable public static final BlockType ORANGE_TULIP = null; - @Nullable public static final BlockType ORANGE_WALL_BANNER = null; - @Nullable public static final BlockType ORANGE_WOOL = null; - @Nullable public static final BlockType OXEYE_DAISY = null; - @Nullable public static final BlockType PACKED_ICE = null; - @Nullable public static final BlockType PEONY = null; - @Nullable public static final BlockType PETRIFIED_OAK_SLAB = null; - @Nullable public static final BlockType PINK_BANNER = null; - @Nullable public static final BlockType PINK_BED = null; - @Nullable public static final BlockType PINK_CARPET = null; - @Nullable public static final BlockType PINK_CONCRETE = null; - @Nullable public static final BlockType PINK_CONCRETE_POWDER = null; - @Nullable public static final BlockType PINK_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType PINK_SHULKER_BOX = null; - @Nullable public static final BlockType PINK_STAINED_GLASS = null; - @Nullable public static final BlockType PINK_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType PINK_TERRACOTTA = null; - @Nullable public static final BlockType PINK_TULIP = null; - @Nullable public static final BlockType PINK_WALL_BANNER = null; - @Nullable public static final BlockType PINK_WOOL = null; - @Nullable public static final BlockType PISTON = null; - @Nullable public static final BlockType PISTON_HEAD = null; - @Nullable public static final BlockType PLAYER_HEAD = null; - @Nullable public static final BlockType PLAYER_WALL_HEAD = null; - @Nullable public static final BlockType PODZOL = null; - @Nullable public static final BlockType POLISHED_ANDESITE = null; - @Nullable public static final BlockType POLISHED_ANDESITE_SLAB = null; - @Nullable public static final BlockType POLISHED_ANDESITE_STAIRS = null; - @Nullable public static final BlockType POLISHED_DIORITE = null; - @Nullable public static final BlockType POLISHED_DIORITE_SLAB = null; - @Nullable public static final BlockType POLISHED_DIORITE_STAIRS = null; - @Nullable public static final BlockType POLISHED_GRANITE = null; - @Nullable public static final BlockType POLISHED_GRANITE_SLAB = null; - @Nullable public static final BlockType POLISHED_GRANITE_STAIRS = null; - @Nullable public static final BlockType POPPY = null; - @Nullable public static final BlockType POTATOES = null; - @Nullable public static final BlockType POTTED_ACACIA_SAPLING = null; - @Nullable public static final BlockType POTTED_ALLIUM = null; - @Nullable public static final BlockType POTTED_AZURE_BLUET = null; - @Nullable public static final BlockType POTTED_BAMBOO = null; - @Nullable public static final BlockType POTTED_BIRCH_SAPLING = null; - @Nullable public static final BlockType POTTED_BLUE_ORCHID = null; - @Nullable public static final BlockType POTTED_BROWN_MUSHROOM = null; - @Nullable public static final BlockType POTTED_CACTUS = null; - @Nullable public static final BlockType POTTED_CORNFLOWER = null; - @Nullable public static final BlockType POTTED_DANDELION = null; - @Nullable public static final BlockType POTTED_DARK_OAK_SAPLING = null; - @Nullable public static final BlockType POTTED_DEAD_BUSH = null; - @Nullable public static final BlockType POTTED_FERN = null; - @Nullable public static final BlockType POTTED_JUNGLE_SAPLING = null; - @Nullable public static final BlockType POTTED_LILY_OF_THE_VALLEY = null; - @Nullable public static final BlockType POTTED_OAK_SAPLING = null; - @Nullable public static final BlockType POTTED_ORANGE_TULIP = null; - @Nullable public static final BlockType POTTED_OXEYE_DAISY = null; - @Nullable public static final BlockType POTTED_PINK_TULIP = null; - @Nullable public static final BlockType POTTED_POPPY = null; - @Nullable public static final BlockType POTTED_RED_MUSHROOM = null; - @Nullable public static final BlockType POTTED_RED_TULIP = null; - @Nullable public static final BlockType POTTED_SPRUCE_SAPLING = null; - @Nullable public static final BlockType POTTED_WHITE_TULIP = null; - @Nullable public static final BlockType POTTED_WITHER_ROSE = null; - @Nullable public static final BlockType POWERED_RAIL = null; - @Nullable public static final BlockType PRISMARINE = null; - @Nullable public static final BlockType PRISMARINE_BRICK_SLAB = null; - @Nullable public static final BlockType PRISMARINE_BRICK_STAIRS = null; - @Nullable public static final BlockType PRISMARINE_BRICKS = null; - @Nullable public static final BlockType PRISMARINE_SLAB = null; - @Nullable public static final BlockType PRISMARINE_STAIRS = null; - @Nullable public static final BlockType PRISMARINE_WALL = null; - @Nullable public static final BlockType PUMPKIN = null; - @Nullable public static final BlockType PUMPKIN_STEM = null; - @Nullable public static final BlockType PURPLE_BANNER = null; - @Nullable public static final BlockType PURPLE_BED = null; - @Nullable public static final BlockType PURPLE_CARPET = null; - @Nullable public static final BlockType PURPLE_CONCRETE = null; - @Nullable public static final BlockType PURPLE_CONCRETE_POWDER = null; - @Nullable public static final BlockType PURPLE_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType PURPLE_SHULKER_BOX = null; - @Nullable public static final BlockType PURPLE_STAINED_GLASS = null; - @Nullable public static final BlockType PURPLE_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType PURPLE_TERRACOTTA = null; - @Nullable public static final BlockType PURPLE_WALL_BANNER = null; - @Nullable public static final BlockType PURPLE_WOOL = null; - @Nullable public static final BlockType PURPUR_BLOCK = null; - @Nullable public static final BlockType PURPUR_PILLAR = null; - @Nullable public static final BlockType PURPUR_SLAB = null; - @Nullable public static final BlockType PURPUR_STAIRS = null; - @Nullable public static final BlockType QUARTZ_BLOCK = null; - @Nullable public static final BlockType QUARTZ_PILLAR = null; - @Nullable public static final BlockType QUARTZ_SLAB = null; - @Nullable public static final BlockType QUARTZ_STAIRS = null; - @Nullable public static final BlockType RAIL = null; - @Nullable public static final BlockType RED_BANNER = null; - @Nullable public static final BlockType RED_BED = null; - @Nullable public static final BlockType RED_CARPET = null; - @Nullable public static final BlockType RED_CONCRETE = null; - @Nullable public static final BlockType RED_CONCRETE_POWDER = null; - @Nullable public static final BlockType RED_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType RED_MUSHROOM = null; - @Nullable public static final BlockType RED_MUSHROOM_BLOCK = null; - @Nullable public static final BlockType RED_NETHER_BRICK_SLAB = null; - @Nullable public static final BlockType RED_NETHER_BRICK_STAIRS = null; - @Nullable public static final BlockType RED_NETHER_BRICK_WALL = null; - @Nullable public static final BlockType RED_NETHER_BRICKS = null; - @Nullable public static final BlockType RED_SAND = null; - @Nullable public static final BlockType RED_SANDSTONE = null; - @Nullable public static final BlockType RED_SANDSTONE_SLAB = null; - @Nullable public static final BlockType RED_SANDSTONE_STAIRS = null; - @Nullable public static final BlockType RED_SANDSTONE_WALL = null; - @Nullable public static final BlockType RED_SHULKER_BOX = null; - @Nullable public static final BlockType RED_STAINED_GLASS = null; - @Nullable public static final BlockType RED_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType RED_TERRACOTTA = null; - @Nullable public static final BlockType RED_TULIP = null; - @Nullable public static final BlockType RED_WALL_BANNER = null; - @Nullable public static final BlockType RED_WOOL = null; - @Nullable public static final BlockType REDSTONE_BLOCK = null; - @Nullable public static final BlockType REDSTONE_LAMP = null; - @Nullable public static final BlockType REDSTONE_ORE = null; - @Nullable public static final BlockType REDSTONE_TORCH = null; - @Nullable public static final BlockType REDSTONE_WALL_TORCH = null; - @Nullable public static final BlockType REDSTONE_WIRE = null; - @Nullable public static final BlockType REPEATER = null; - @Nullable public static final BlockType REPEATING_COMMAND_BLOCK = null; - @Nullable public static final BlockType ROSE_BUSH = null; - @Nullable public static final BlockType SAND = null; - @Nullable public static final BlockType SANDSTONE = null; - @Nullable public static final BlockType SANDSTONE_SLAB = null; - @Nullable public static final BlockType SANDSTONE_STAIRS = null; - @Nullable public static final BlockType SANDSTONE_WALL = null; - @Nullable public static final BlockType SCAFFOLDING = null; - @Nullable public static final BlockType SEA_LANTERN = null; - @Nullable public static final BlockType SEA_PICKLE = null; - @Nullable public static final BlockType SEAGRASS = null; - @Nullable public static final BlockType SHULKER_BOX = null; - @Nullable public static final BlockType SKELETON_SKULL = null; - @Nullable public static final BlockType SKELETON_WALL_SKULL = null; - @Nullable public static final BlockType SLIME_BLOCK = null; - @Nullable public static final BlockType SMITHING_TABLE = null; - @Nullable public static final BlockType SMOKER = null; - @Nullable public static final BlockType SMOOTH_QUARTZ = null; - @Nullable public static final BlockType SMOOTH_QUARTZ_SLAB = null; - @Nullable public static final BlockType SMOOTH_QUARTZ_STAIRS = null; - @Nullable public static final BlockType SMOOTH_RED_SANDSTONE = null; - @Nullable public static final BlockType SMOOTH_RED_SANDSTONE_SLAB = null; - @Nullable public static final BlockType SMOOTH_RED_SANDSTONE_STAIRS = null; - @Nullable public static final BlockType SMOOTH_SANDSTONE = null; - @Nullable public static final BlockType SMOOTH_SANDSTONE_SLAB = null; - @Nullable public static final BlockType SMOOTH_SANDSTONE_STAIRS = null; - @Nullable public static final BlockType SMOOTH_STONE = null; - @Nullable public static final BlockType SMOOTH_STONE_SLAB = null; - @Nullable public static final BlockType SNOW = null; - @Nullable public static final BlockType SNOW_BLOCK = null; - @Nullable public static final BlockType SOUL_SAND = null; - @Nullable public static final BlockType SPAWNER = null; - @Nullable public static final BlockType SPONGE = null; - @Nullable public static final BlockType SPRUCE_BUTTON = null; - @Nullable public static final BlockType SPRUCE_DOOR = null; - @Nullable public static final BlockType SPRUCE_FENCE = null; - @Nullable public static final BlockType SPRUCE_FENCE_GATE = null; - @Nullable public static final BlockType SPRUCE_LEAVES = null; - @Nullable public static final BlockType SPRUCE_LOG = null; - @Nullable public static final BlockType SPRUCE_PLANKS = null; - @Nullable public static final BlockType SPRUCE_PRESSURE_PLATE = null; - @Nullable public static final BlockType SPRUCE_SAPLING = null; - @Nullable public static final BlockType SPRUCE_SIGN = null; - @Nullable public static final BlockType SPRUCE_SLAB = null; - @Nullable public static final BlockType SPRUCE_STAIRS = null; - @Nullable public static final BlockType SPRUCE_TRAPDOOR = null; - @Nullable public static final BlockType SPRUCE_WALL_SIGN = null; - @Nullable public static final BlockType SPRUCE_WOOD = null; - @Nullable public static final BlockType STICKY_PISTON = null; - @Nullable public static final BlockType STONE = null; - @Nullable public static final BlockType STONE_BRICK_SLAB = null; - @Nullable public static final BlockType STONE_BRICK_STAIRS = null; - @Nullable public static final BlockType STONE_BRICK_WALL = null; - @Nullable public static final BlockType STONE_BRICKS = null; - @Nullable public static final BlockType STONE_BUTTON = null; - @Nullable public static final BlockType STONE_PRESSURE_PLATE = null; - @Nullable public static final BlockType STONE_SLAB = null; - @Nullable public static final BlockType STONE_STAIRS = null; - @Nullable public static final BlockType STONECUTTER = null; - @Nullable public static final BlockType STRIPPED_ACACIA_LOG = null; - @Nullable public static final BlockType STRIPPED_ACACIA_WOOD = null; - @Nullable public static final BlockType STRIPPED_BIRCH_LOG = null; - @Nullable public static final BlockType STRIPPED_BIRCH_WOOD = null; - @Nullable public static final BlockType STRIPPED_DARK_OAK_LOG = null; - @Nullable public static final BlockType STRIPPED_DARK_OAK_WOOD = null; - @Nullable public static final BlockType STRIPPED_JUNGLE_LOG = null; - @Nullable public static final BlockType STRIPPED_JUNGLE_WOOD = null; - @Nullable public static final BlockType STRIPPED_OAK_LOG = null; - @Nullable public static final BlockType STRIPPED_OAK_WOOD = null; - @Nullable public static final BlockType STRIPPED_SPRUCE_LOG = null; - @Nullable public static final BlockType STRIPPED_SPRUCE_WOOD = null; - @Nullable public static final BlockType STRUCTURE_BLOCK = null; - @Nullable public static final BlockType STRUCTURE_VOID = null; - @Nullable public static final BlockType SUGAR_CANE = null; - @Nullable public static final BlockType SUNFLOWER = null; - @Nullable public static final BlockType SWEET_BERRY_BUSH = null; - @Nullable public static final BlockType TALL_GRASS = null; - @Nullable public static final BlockType TALL_SEAGRASS = null; - @Nullable public static final BlockType TERRACOTTA = null; - @Nullable public static final BlockType TNT = null; - @Nullable public static final BlockType TORCH = null; - @Nullable public static final BlockType TRAPPED_CHEST = null; - @Nullable public static final BlockType TRIPWIRE = null; - @Nullable public static final BlockType TRIPWIRE_HOOK = null; - @Nullable public static final BlockType TUBE_CORAL = null; - @Nullable public static final BlockType TUBE_CORAL_BLOCK = null; - @Nullable public static final BlockType TUBE_CORAL_FAN = null; - @Nullable public static final BlockType TUBE_CORAL_WALL_FAN = null; - @Nullable public static final BlockType TURTLE_EGG = null; - @Nullable public static final BlockType VINE = null; - @Nullable public static final BlockType VOID_AIR = null; - @Nullable public static final BlockType WALL_TORCH = null; - @Nullable public static final BlockType WATER = null; - @Nullable public static final BlockType WET_SPONGE = null; - @Nullable public static final BlockType WHEAT = null; - @Nullable public static final BlockType WHITE_BANNER = null; - @Nullable public static final BlockType WHITE_BED = null; - @Nullable public static final BlockType WHITE_CARPET = null; - @Nullable public static final BlockType WHITE_CONCRETE = null; - @Nullable public static final BlockType WHITE_CONCRETE_POWDER = null; - @Nullable public static final BlockType WHITE_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType WHITE_SHULKER_BOX = null; - @Nullable public static final BlockType WHITE_STAINED_GLASS = null; - @Nullable public static final BlockType WHITE_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType WHITE_TERRACOTTA = null; - @Nullable public static final BlockType WHITE_TULIP = null; - @Nullable public static final BlockType WHITE_WALL_BANNER = null; - @Nullable public static final BlockType WHITE_WOOL = null; - @Nullable public static final BlockType WITHER_ROSE = null; - @Nullable public static final BlockType WITHER_SKELETON_SKULL = null; - @Nullable public static final BlockType WITHER_SKELETON_WALL_SKULL = null; - @Nullable public static final BlockType YELLOW_BANNER = null; - @Nullable public static final BlockType YELLOW_BED = null; - @Nullable public static final BlockType YELLOW_CARPET = null; - @Nullable public static final BlockType YELLOW_CONCRETE = null; - @Nullable public static final BlockType YELLOW_CONCRETE_POWDER = null; - @Nullable public static final BlockType YELLOW_GLAZED_TERRACOTTA = null; - @Nullable public static final BlockType YELLOW_SHULKER_BOX = null; - @Nullable public static final BlockType YELLOW_STAINED_GLASS = null; - @Nullable public static final BlockType YELLOW_STAINED_GLASS_PANE = null; - @Nullable public static final BlockType YELLOW_TERRACOTTA = null; - @Nullable public static final BlockType YELLOW_WALL_BANNER = null; - @Nullable public static final BlockType YELLOW_WOOL = null; - @Nullable public static final BlockType ZOMBIE_HEAD = null; - @Nullable public static final BlockType ZOMBIE_WALL_HEAD = null; + @Nullable public static final BlockType __RESERVED__ = init(); // Placeholder for null index (i.e. when block types are represented as primitives) + @Nullable public static final BlockType ACACIA_BUTTON = init(); + @Nullable public static final BlockType ACACIA_DOOR = init(); + @Nullable public static final BlockType ACACIA_FENCE = init(); + @Nullable public static final BlockType ACACIA_FENCE_GATE = init(); + @Nullable public static final BlockType ACACIA_LEAVES = init(); + @Nullable public static final BlockType ACACIA_LOG = init(); + @Nullable public static final BlockType ACACIA_PLANKS = init(); + @Nullable public static final BlockType ACACIA_PRESSURE_PLATE = init(); + @Nullable public static final BlockType ACACIA_SAPLING = init(); + @Nullable public static final BlockType ACACIA_SIGN = init(); + @Nullable public static final BlockType ACACIA_SLAB = init(); + @Nullable public static final BlockType ACACIA_STAIRS = init(); + @Nullable public static final BlockType ACACIA_TRAPDOOR = init(); + @Nullable public static final BlockType ACACIA_WALL_SIGN = init(); + @Nullable public static final BlockType ACACIA_WOOD = init(); + @Nullable public static final BlockType ACTIVATOR_RAIL = init(); + @Nullable public static final BlockType AIR = init(); + @Nullable public static final BlockType ALLIUM = init(); + @Nullable public static final BlockType ANDESITE = init(); + @Nullable public static final BlockType ANDESITE_SLAB = init(); + @Nullable public static final BlockType ANDESITE_STAIRS = init(); + @Nullable public static final BlockType ANDESITE_WALL = init(); + @Nullable public static final BlockType ANVIL = init(); + @Nullable public static final BlockType ATTACHED_MELON_STEM = init(); + @Nullable public static final BlockType ATTACHED_PUMPKIN_STEM = init(); + @Nullable public static final BlockType AZURE_BLUET = init(); + @Nullable public static final BlockType BAMBOO = init(); + @Nullable public static final BlockType BAMBOO_SAPLING = init(); + @Nullable public static final BlockType BARREL = init(); + @Nullable public static final BlockType BARRIER = init(); + @Nullable public static final BlockType BEACON = init(); + @Nullable public static final BlockType BEDROCK = init(); + @Nullable public static final BlockType BEETROOTS = init(); + @Nullable public static final BlockType BELL = init(); + @Nullable public static final BlockType BIRCH_BUTTON = init(); + @Nullable public static final BlockType BIRCH_DOOR = init(); + @Nullable public static final BlockType BIRCH_FENCE = init(); + @Nullable public static final BlockType BIRCH_FENCE_GATE = init(); + @Nullable public static final BlockType BIRCH_LEAVES = init(); + @Nullable public static final BlockType BIRCH_LOG = init(); + @Nullable public static final BlockType BIRCH_PLANKS = init(); + @Nullable public static final BlockType BIRCH_PRESSURE_PLATE = init(); + @Nullable public static final BlockType BIRCH_SAPLING = init(); + @Nullable public static final BlockType BIRCH_SIGN = init(); + @Nullable public static final BlockType BIRCH_SLAB = init(); + @Nullable public static final BlockType BIRCH_STAIRS = init(); + @Nullable public static final BlockType BIRCH_TRAPDOOR = init(); + @Nullable public static final BlockType BIRCH_WALL_SIGN = init(); + @Nullable public static final BlockType BIRCH_WOOD = init(); + @Nullable public static final BlockType BLACK_BANNER = init(); + @Nullable public static final BlockType BLACK_BED = init(); + @Nullable public static final BlockType BLACK_CARPET = init(); + @Nullable public static final BlockType BLACK_CONCRETE = init(); + @Nullable public static final BlockType BLACK_CONCRETE_POWDER = init(); + @Nullable public static final BlockType BLACK_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType BLACK_SHULKER_BOX = init(); + @Nullable public static final BlockType BLACK_STAINED_GLASS = init(); + @Nullable public static final BlockType BLACK_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType BLACK_TERRACOTTA = init(); + @Nullable public static final BlockType BLACK_WALL_BANNER = init(); + @Nullable public static final BlockType BLACK_WOOL = init(); + @Nullable public static final BlockType BLAST_FURNACE = init(); + @Nullable public static final BlockType BLUE_BANNER = init(); + @Nullable public static final BlockType BLUE_BED = init(); + @Nullable public static final BlockType BLUE_CARPET = init(); + @Nullable public static final BlockType BLUE_CONCRETE = init(); + @Nullable public static final BlockType BLUE_CONCRETE_POWDER = init(); + @Nullable public static final BlockType BLUE_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType BLUE_ICE = init(); + @Nullable public static final BlockType BLUE_ORCHID = init(); + @Nullable public static final BlockType BLUE_SHULKER_BOX = init(); + @Nullable public static final BlockType BLUE_STAINED_GLASS = init(); + @Nullable public static final BlockType BLUE_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType BLUE_TERRACOTTA = init(); + @Nullable public static final BlockType BLUE_WALL_BANNER = init(); + @Nullable public static final BlockType BLUE_WOOL = init(); + @Nullable public static final BlockType BONE_BLOCK = init(); + @Nullable public static final BlockType BOOKSHELF = init(); + @Nullable public static final BlockType BRAIN_CORAL = init(); + @Nullable public static final BlockType BRAIN_CORAL_BLOCK = init(); + @Nullable public static final BlockType BRAIN_CORAL_FAN = init(); + @Nullable public static final BlockType BRAIN_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType BREWING_STAND = init(); + @Nullable public static final BlockType BRICK_SLAB = init(); + @Nullable public static final BlockType BRICK_STAIRS = init(); + @Nullable public static final BlockType BRICK_WALL = init(); + @Nullable public static final BlockType BRICKS = init(); + @Nullable public static final BlockType BROWN_BANNER = init(); + @Nullable public static final BlockType BROWN_BED = init(); + @Nullable public static final BlockType BROWN_CARPET = init(); + @Nullable public static final BlockType BROWN_CONCRETE = init(); + @Nullable public static final BlockType BROWN_CONCRETE_POWDER = init(); + @Nullable public static final BlockType BROWN_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType BROWN_MUSHROOM = init(); + @Nullable public static final BlockType BROWN_MUSHROOM_BLOCK = init(); + @Nullable public static final BlockType BROWN_SHULKER_BOX = init(); + @Nullable public static final BlockType BROWN_STAINED_GLASS = init(); + @Nullable public static final BlockType BROWN_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType BROWN_TERRACOTTA = init(); + @Nullable public static final BlockType BROWN_WALL_BANNER = init(); + @Nullable public static final BlockType BROWN_WOOL = init(); + @Nullable public static final BlockType BUBBLE_COLUMN = init(); + @Nullable public static final BlockType BUBBLE_CORAL = init(); + @Nullable public static final BlockType BUBBLE_CORAL_BLOCK = init(); + @Nullable public static final BlockType BUBBLE_CORAL_FAN = init(); + @Nullable public static final BlockType BUBBLE_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType CACTUS = init(); + @Nullable public static final BlockType CAKE = init(); + @Nullable public static final BlockType CAMPFIRE = init(); + @Nullable public static final BlockType CARROTS = init(); + @Nullable public static final BlockType CARTOGRAPHY_TABLE = init(); + @Nullable public static final BlockType CARVED_PUMPKIN = init(); + @Nullable public static final BlockType CAULDRON = init(); + @Nullable public static final BlockType CAVE_AIR = init(); + @Nullable public static final BlockType CHAIN_COMMAND_BLOCK = init(); + @Nullable public static final BlockType CHEST = init(); + @Nullable public static final BlockType CHIPPED_ANVIL = init(); + @Nullable public static final BlockType CHISELED_QUARTZ_BLOCK = init(); + @Nullable public static final BlockType CHISELED_RED_SANDSTONE = init(); + @Nullable public static final BlockType CHISELED_SANDSTONE = init(); + @Nullable public static final BlockType CHISELED_STONE_BRICKS = init(); + @Nullable public static final BlockType CHORUS_FLOWER = init(); + @Nullable public static final BlockType CHORUS_PLANT = init(); + @Nullable public static final BlockType CLAY = init(); + @Nullable public static final BlockType COAL_BLOCK = init(); + @Nullable public static final BlockType COAL_ORE = init(); + @Nullable public static final BlockType COARSE_DIRT = init(); + @Nullable public static final BlockType COBBLESTONE = init(); + @Nullable public static final BlockType COBBLESTONE_SLAB = init(); + @Nullable public static final BlockType COBBLESTONE_STAIRS = init(); + @Nullable public static final BlockType COBBLESTONE_WALL = init(); + @Nullable public static final BlockType COBWEB = init(); + @Nullable public static final BlockType COCOA = init(); + @Nullable public static final BlockType COMMAND_BLOCK = init(); + @Nullable public static final BlockType COMPARATOR = init(); + @Nullable public static final BlockType COMPOSTER = init(); + @Nullable public static final BlockType CONDUIT = init(); + @Nullable public static final BlockType CORNFLOWER = init(); + @Nullable public static final BlockType CRACKED_STONE_BRICKS = init(); + @Nullable public static final BlockType CRAFTING_TABLE = init(); + @Nullable public static final BlockType CREEPER_HEAD = init(); + @Nullable public static final BlockType CREEPER_WALL_HEAD = init(); + @Nullable public static final BlockType CUT_RED_SANDSTONE = init(); + @Nullable public static final BlockType CUT_RED_SANDSTONE_SLAB = init(); + @Nullable public static final BlockType CUT_SANDSTONE = init(); + @Nullable public static final BlockType CUT_SANDSTONE_SLAB = init(); + @Nullable public static final BlockType CYAN_BANNER = init(); + @Nullable public static final BlockType CYAN_BED = init(); + @Nullable public static final BlockType CYAN_CARPET = init(); + @Nullable public static final BlockType CYAN_CONCRETE = init(); + @Nullable public static final BlockType CYAN_CONCRETE_POWDER = init(); + @Nullable public static final BlockType CYAN_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType CYAN_SHULKER_BOX = init(); + @Nullable public static final BlockType CYAN_STAINED_GLASS = init(); + @Nullable public static final BlockType CYAN_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType CYAN_TERRACOTTA = init(); + @Nullable public static final BlockType CYAN_WALL_BANNER = init(); + @Nullable public static final BlockType CYAN_WOOL = init(); + @Nullable public static final BlockType DAMAGED_ANVIL = init(); + @Nullable public static final BlockType DANDELION = init(); + @Nullable public static final BlockType DARK_OAK_BUTTON = init(); + @Nullable public static final BlockType DARK_OAK_DOOR = init(); + @Nullable public static final BlockType DARK_OAK_FENCE = init(); + @Nullable public static final BlockType DARK_OAK_FENCE_GATE = init(); + @Nullable public static final BlockType DARK_OAK_LEAVES = init(); + @Nullable public static final BlockType DARK_OAK_LOG = init(); + @Nullable public static final BlockType DARK_OAK_PLANKS = init(); + @Nullable public static final BlockType DARK_OAK_PRESSURE_PLATE = init(); + @Nullable public static final BlockType DARK_OAK_SAPLING = init(); + @Nullable public static final BlockType DARK_OAK_SIGN = init(); + @Nullable public static final BlockType DARK_OAK_SLAB = init(); + @Nullable public static final BlockType DARK_OAK_STAIRS = init(); + @Nullable public static final BlockType DARK_OAK_TRAPDOOR = init(); + @Nullable public static final BlockType DARK_OAK_WALL_SIGN = init(); + @Nullable public static final BlockType DARK_OAK_WOOD = init(); + @Nullable public static final BlockType DARK_PRISMARINE = init(); + @Nullable public static final BlockType DARK_PRISMARINE_SLAB = init(); + @Nullable public static final BlockType DARK_PRISMARINE_STAIRS = init(); + @Nullable public static final BlockType DAYLIGHT_DETECTOR = init(); + @Nullable public static final BlockType DEAD_BRAIN_CORAL = init(); + @Nullable public static final BlockType DEAD_BRAIN_CORAL_BLOCK = init(); + @Nullable public static final BlockType DEAD_BRAIN_CORAL_FAN = init(); + @Nullable public static final BlockType DEAD_BRAIN_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType DEAD_BUBBLE_CORAL = init(); + @Nullable public static final BlockType DEAD_BUBBLE_CORAL_BLOCK = init(); + @Nullable public static final BlockType DEAD_BUBBLE_CORAL_FAN = init(); + @Nullable public static final BlockType DEAD_BUBBLE_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType DEAD_BUSH = init(); + @Nullable public static final BlockType DEAD_FIRE_CORAL = init(); + @Nullable public static final BlockType DEAD_FIRE_CORAL_BLOCK = init(); + @Nullable public static final BlockType DEAD_FIRE_CORAL_FAN = init(); + @Nullable public static final BlockType DEAD_FIRE_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType DEAD_HORN_CORAL = init(); + @Nullable public static final BlockType DEAD_HORN_CORAL_BLOCK = init(); + @Nullable public static final BlockType DEAD_HORN_CORAL_FAN = init(); + @Nullable public static final BlockType DEAD_HORN_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType DEAD_TUBE_CORAL = init(); + @Nullable public static final BlockType DEAD_TUBE_CORAL_BLOCK = init(); + @Nullable public static final BlockType DEAD_TUBE_CORAL_FAN = init(); + @Nullable public static final BlockType DEAD_TUBE_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType DETECTOR_RAIL = init(); + @Nullable public static final BlockType DIAMOND_BLOCK = init(); + @Nullable public static final BlockType DIAMOND_ORE = init(); + @Nullable public static final BlockType DIORITE = init(); + @Nullable public static final BlockType DIORITE_SLAB = init(); + @Nullable public static final BlockType DIORITE_STAIRS = init(); + @Nullable public static final BlockType DIORITE_WALL = init(); + @Nullable public static final BlockType DIRT = init(); + @Nullable public static final BlockType DISPENSER = init(); + @Nullable public static final BlockType DRAGON_EGG = init(); + @Nullable public static final BlockType DRAGON_HEAD = init(); + @Nullable public static final BlockType DRAGON_WALL_HEAD = init(); + @Nullable public static final BlockType DRIED_KELP_BLOCK = init(); + @Nullable public static final BlockType DROPPER = init(); + @Nullable public static final BlockType EMERALD_BLOCK = init(); + @Nullable public static final BlockType EMERALD_ORE = init(); + @Nullable public static final BlockType ENCHANTING_TABLE = init(); + @Nullable public static final BlockType END_GATEWAY = init(); + @Nullable public static final BlockType END_PORTAL = init(); + @Nullable public static final BlockType END_PORTAL_FRAME = init(); + @Nullable public static final BlockType END_ROD = init(); + @Nullable public static final BlockType END_STONE = init(); + @Nullable public static final BlockType END_STONE_BRICK_SLAB = init(); + @Nullable public static final BlockType END_STONE_BRICK_STAIRS = init(); + @Nullable public static final BlockType END_STONE_BRICK_WALL = init(); + @Nullable public static final BlockType END_STONE_BRICKS = init(); + @Nullable public static final BlockType ENDER_CHEST = init(); + @Nullable public static final BlockType FARMLAND = init(); + @Nullable public static final BlockType FERN = init(); + @Nullable public static final BlockType FIRE = init(); + @Nullable public static final BlockType FIRE_CORAL = init(); + @Nullable public static final BlockType FIRE_CORAL_BLOCK = init(); + @Nullable public static final BlockType FIRE_CORAL_FAN = init(); + @Nullable public static final BlockType FIRE_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType FLETCHING_TABLE = init(); + @Nullable public static final BlockType FLOWER_POT = init(); + @Nullable public static final BlockType FROSTED_ICE = init(); + @Nullable public static final BlockType FURNACE = init(); + @Nullable public static final BlockType GLASS = init(); + @Nullable public static final BlockType GLASS_PANE = init(); + @Nullable public static final BlockType GLOWSTONE = init(); + @Nullable public static final BlockType GOLD_BLOCK = init(); + @Nullable public static final BlockType GOLD_ORE = init(); + @Nullable public static final BlockType GRANITE = init(); + @Nullable public static final BlockType GRANITE_SLAB = init(); + @Nullable public static final BlockType GRANITE_STAIRS = init(); + @Nullable public static final BlockType GRANITE_WALL = init(); + @Nullable public static final BlockType GRASS = init(); + @Nullable public static final BlockType GRASS_BLOCK = init(); + @Nullable public static final BlockType GRASS_PATH = init(); + @Nullable public static final BlockType GRAVEL = init(); + @Nullable public static final BlockType GRAY_BANNER = init(); + @Nullable public static final BlockType GRAY_BED = init(); + @Nullable public static final BlockType GRAY_CARPET = init(); + @Nullable public static final BlockType GRAY_CONCRETE = init(); + @Nullable public static final BlockType GRAY_CONCRETE_POWDER = init(); + @Nullable public static final BlockType GRAY_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType GRAY_SHULKER_BOX = init(); + @Nullable public static final BlockType GRAY_STAINED_GLASS = init(); + @Nullable public static final BlockType GRAY_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType GRAY_TERRACOTTA = init(); + @Nullable public static final BlockType GRAY_WALL_BANNER = init(); + @Nullable public static final BlockType GRAY_WOOL = init(); + @Nullable public static final BlockType GREEN_BANNER = init(); + @Nullable public static final BlockType GREEN_BED = init(); + @Nullable public static final BlockType GREEN_CARPET = init(); + @Nullable public static final BlockType GREEN_CONCRETE = init(); + @Nullable public static final BlockType GREEN_CONCRETE_POWDER = init(); + @Nullable public static final BlockType GREEN_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType GREEN_SHULKER_BOX = init(); + @Nullable public static final BlockType GREEN_STAINED_GLASS = init(); + @Nullable public static final BlockType GREEN_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType GREEN_TERRACOTTA = init(); + @Nullable public static final BlockType GREEN_WALL_BANNER = init(); + @Nullable public static final BlockType GREEN_WOOL = init(); + @Nullable public static final BlockType GRINDSTONE = init(); + @Nullable public static final BlockType HAY_BLOCK = init(); + @Nullable public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = init(); + @Nullable public static final BlockType HOPPER = init(); + @Nullable public static final BlockType HORN_CORAL = init(); + @Nullable public static final BlockType HORN_CORAL_BLOCK = init(); + @Nullable public static final BlockType HORN_CORAL_FAN = init(); + @Nullable public static final BlockType HORN_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType ICE = init(); + @Nullable public static final BlockType INFESTED_CHISELED_STONE_BRICKS = init(); + @Nullable public static final BlockType INFESTED_COBBLESTONE = init(); + @Nullable public static final BlockType INFESTED_CRACKED_STONE_BRICKS = init(); + @Nullable public static final BlockType INFESTED_MOSSY_STONE_BRICKS = init(); + @Nullable public static final BlockType INFESTED_STONE = init(); + @Nullable public static final BlockType INFESTED_STONE_BRICKS = init(); + @Nullable public static final BlockType IRON_BARS = init(); + @Nullable public static final BlockType IRON_BLOCK = init(); + @Nullable public static final BlockType IRON_DOOR = init(); + @Nullable public static final BlockType IRON_ORE = init(); + @Nullable public static final BlockType IRON_TRAPDOOR = init(); + @Nullable public static final BlockType JACK_O_LANTERN = init(); + @Nullable public static final BlockType JIGSAW = init(); + @Nullable public static final BlockType JUKEBOX = init(); + @Nullable public static final BlockType JUNGLE_BUTTON = init(); + @Nullable public static final BlockType JUNGLE_DOOR = init(); + @Nullable public static final BlockType JUNGLE_FENCE = init(); + @Nullable public static final BlockType JUNGLE_FENCE_GATE = init(); + @Nullable public static final BlockType JUNGLE_LEAVES = init(); + @Nullable public static final BlockType JUNGLE_LOG = init(); + @Nullable public static final BlockType JUNGLE_PLANKS = init(); + @Nullable public static final BlockType JUNGLE_PRESSURE_PLATE = init(); + @Nullable public static final BlockType JUNGLE_SAPLING = init(); + @Nullable public static final BlockType JUNGLE_SIGN = init(); + @Nullable public static final BlockType JUNGLE_SLAB = init(); + @Nullable public static final BlockType JUNGLE_STAIRS = init(); + @Nullable public static final BlockType JUNGLE_TRAPDOOR = init(); + @Nullable public static final BlockType JUNGLE_WALL_SIGN = init(); + @Nullable public static final BlockType JUNGLE_WOOD = init(); + @Nullable public static final BlockType KELP = init(); + @Nullable public static final BlockType KELP_PLANT = init(); + @Nullable public static final BlockType LADDER = init(); + @Nullable public static final BlockType LANTERN = init(); + @Nullable public static final BlockType LAPIS_BLOCK = init(); + @Nullable public static final BlockType LAPIS_ORE = init(); + @Nullable public static final BlockType LARGE_FERN = init(); + @Nullable public static final BlockType LAVA = init(); + @Nullable public static final BlockType LECTERN = init(); + @Nullable public static final BlockType LEVER = init(); + @Nullable public static final BlockType LIGHT_BLUE_BANNER = init(); + @Nullable public static final BlockType LIGHT_BLUE_BED = init(); + @Nullable public static final BlockType LIGHT_BLUE_CARPET = init(); + @Nullable public static final BlockType LIGHT_BLUE_CONCRETE = init(); + @Nullable public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = init(); + @Nullable public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType LIGHT_BLUE_SHULKER_BOX = init(); + @Nullable public static final BlockType LIGHT_BLUE_STAINED_GLASS = init(); + @Nullable public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType LIGHT_BLUE_TERRACOTTA = init(); + @Nullable public static final BlockType LIGHT_BLUE_WALL_BANNER = init(); + @Nullable public static final BlockType LIGHT_BLUE_WOOL = init(); + @Nullable public static final BlockType LIGHT_GRAY_BANNER = init(); + @Nullable public static final BlockType LIGHT_GRAY_BED = init(); + @Nullable public static final BlockType LIGHT_GRAY_CARPET = init(); + @Nullable public static final BlockType LIGHT_GRAY_CONCRETE = init(); + @Nullable public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = init(); + @Nullable public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType LIGHT_GRAY_SHULKER_BOX = init(); + @Nullable public static final BlockType LIGHT_GRAY_STAINED_GLASS = init(); + @Nullable public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType LIGHT_GRAY_TERRACOTTA = init(); + @Nullable public static final BlockType LIGHT_GRAY_WALL_BANNER = init(); + @Nullable public static final BlockType LIGHT_GRAY_WOOL = init(); + @Nullable public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = init(); + @Nullable public static final BlockType LILAC = init(); + @Nullable public static final BlockType LILY_OF_THE_VALLEY = init(); + @Nullable public static final BlockType LILY_PAD = init(); + @Nullable public static final BlockType LIME_BANNER = init(); + @Nullable public static final BlockType LIME_BED = init(); + @Nullable public static final BlockType LIME_CARPET = init(); + @Nullable public static final BlockType LIME_CONCRETE = init(); + @Nullable public static final BlockType LIME_CONCRETE_POWDER = init(); + @Nullable public static final BlockType LIME_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType LIME_SHULKER_BOX = init(); + @Nullable public static final BlockType LIME_STAINED_GLASS = init(); + @Nullable public static final BlockType LIME_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType LIME_TERRACOTTA = init(); + @Nullable public static final BlockType LIME_WALL_BANNER = init(); + @Nullable public static final BlockType LIME_WOOL = init(); + @Nullable public static final BlockType LOOM = init(); + @Nullable public static final BlockType MAGENTA_BANNER = init(); + @Nullable public static final BlockType MAGENTA_BED = init(); + @Nullable public static final BlockType MAGENTA_CARPET = init(); + @Nullable public static final BlockType MAGENTA_CONCRETE = init(); + @Nullable public static final BlockType MAGENTA_CONCRETE_POWDER = init(); + @Nullable public static final BlockType MAGENTA_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType MAGENTA_SHULKER_BOX = init(); + @Nullable public static final BlockType MAGENTA_STAINED_GLASS = init(); + @Nullable public static final BlockType MAGENTA_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType MAGENTA_TERRACOTTA = init(); + @Nullable public static final BlockType MAGENTA_WALL_BANNER = init(); + @Nullable public static final BlockType MAGENTA_WOOL = init(); + @Nullable public static final BlockType MAGMA_BLOCK = init(); + @Nullable public static final BlockType MELON = init(); + @Nullable public static final BlockType MELON_STEM = init(); + @Nullable public static final BlockType MOSSY_COBBLESTONE = init(); + @Nullable public static final BlockType MOSSY_COBBLESTONE_SLAB = init(); + @Nullable public static final BlockType MOSSY_COBBLESTONE_STAIRS = init(); + @Nullable public static final BlockType MOSSY_COBBLESTONE_WALL = init(); + @Nullable public static final BlockType MOSSY_STONE_BRICK_SLAB = init(); + @Nullable public static final BlockType MOSSY_STONE_BRICK_STAIRS = init(); + @Nullable public static final BlockType MOSSY_STONE_BRICK_WALL = init(); + @Nullable public static final BlockType MOSSY_STONE_BRICKS = init(); + @Nullable public static final BlockType MOVING_PISTON = init(); + @Nullable public static final BlockType MUSHROOM_STEM = init(); + @Nullable public static final BlockType MYCELIUM = init(); + @Nullable public static final BlockType NETHER_BRICK_FENCE = init(); + @Nullable public static final BlockType NETHER_BRICK_SLAB = init(); + @Nullable public static final BlockType NETHER_BRICK_STAIRS = init(); + @Nullable public static final BlockType NETHER_BRICK_WALL = init(); + @Nullable public static final BlockType NETHER_BRICKS = init(); + @Nullable public static final BlockType NETHER_PORTAL = init(); + @Nullable public static final BlockType NETHER_QUARTZ_ORE = init(); + @Nullable public static final BlockType NETHER_WART = init(); + @Nullable public static final BlockType NETHER_WART_BLOCK = init(); + @Nullable public static final BlockType NETHERRACK = init(); + @Nullable public static final BlockType NOTE_BLOCK = init(); + @Nullable public static final BlockType OAK_BUTTON = init(); + @Nullable public static final BlockType OAK_DOOR = init(); + @Nullable public static final BlockType OAK_FENCE = init(); + @Nullable public static final BlockType OAK_FENCE_GATE = init(); + @Nullable public static final BlockType OAK_LEAVES = init(); + @Nullable public static final BlockType OAK_LOG = init(); + @Nullable public static final BlockType OAK_PLANKS = init(); + @Nullable public static final BlockType OAK_PRESSURE_PLATE = init(); + @Nullable public static final BlockType OAK_SAPLING = init(); + @Nullable public static final BlockType OAK_SIGN = init(); + @Nullable public static final BlockType OAK_SLAB = init(); + @Nullable public static final BlockType OAK_STAIRS = init(); + @Nullable public static final BlockType OAK_TRAPDOOR = init(); + @Nullable public static final BlockType OAK_WALL_SIGN = init(); + @Nullable public static final BlockType OAK_WOOD = init(); + @Nullable public static final BlockType OBSERVER = init(); + @Nullable public static final BlockType OBSIDIAN = init(); + @Nullable public static final BlockType ORANGE_BANNER = init(); + @Nullable public static final BlockType ORANGE_BED = init(); + @Nullable public static final BlockType ORANGE_CARPET = init(); + @Nullable public static final BlockType ORANGE_CONCRETE = init(); + @Nullable public static final BlockType ORANGE_CONCRETE_POWDER = init(); + @Nullable public static final BlockType ORANGE_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType ORANGE_SHULKER_BOX = init(); + @Nullable public static final BlockType ORANGE_STAINED_GLASS = init(); + @Nullable public static final BlockType ORANGE_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType ORANGE_TERRACOTTA = init(); + @Nullable public static final BlockType ORANGE_TULIP = init(); + @Nullable public static final BlockType ORANGE_WALL_BANNER = init(); + @Nullable public static final BlockType ORANGE_WOOL = init(); + @Nullable public static final BlockType OXEYE_DAISY = init(); + @Nullable public static final BlockType PACKED_ICE = init(); + @Nullable public static final BlockType PEONY = init(); + @Nullable public static final BlockType PETRIFIED_OAK_SLAB = init(); + @Nullable public static final BlockType PINK_BANNER = init(); + @Nullable public static final BlockType PINK_BED = init(); + @Nullable public static final BlockType PINK_CARPET = init(); + @Nullable public static final BlockType PINK_CONCRETE = init(); + @Nullable public static final BlockType PINK_CONCRETE_POWDER = init(); + @Nullable public static final BlockType PINK_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType PINK_SHULKER_BOX = init(); + @Nullable public static final BlockType PINK_STAINED_GLASS = init(); + @Nullable public static final BlockType PINK_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType PINK_TERRACOTTA = init(); + @Nullable public static final BlockType PINK_TULIP = init(); + @Nullable public static final BlockType PINK_WALL_BANNER = init(); + @Nullable public static final BlockType PINK_WOOL = init(); + @Nullable public static final BlockType PISTON = init(); + @Nullable public static final BlockType PISTON_HEAD = init(); + @Nullable public static final BlockType PLAYER_HEAD = init(); + @Nullable public static final BlockType PLAYER_WALL_HEAD = init(); + @Nullable public static final BlockType PODZOL = init(); + @Nullable public static final BlockType POLISHED_ANDESITE = init(); + @Nullable public static final BlockType POLISHED_ANDESITE_SLAB = init(); + @Nullable public static final BlockType POLISHED_ANDESITE_STAIRS = init(); + @Nullable public static final BlockType POLISHED_DIORITE = init(); + @Nullable public static final BlockType POLISHED_DIORITE_SLAB = init(); + @Nullable public static final BlockType POLISHED_DIORITE_STAIRS = init(); + @Nullable public static final BlockType POLISHED_GRANITE = init(); + @Nullable public static final BlockType POLISHED_GRANITE_SLAB = init(); + @Nullable public static final BlockType POLISHED_GRANITE_STAIRS = init(); + @Nullable public static final BlockType POPPY = init(); + @Nullable public static final BlockType POTATOES = init(); + @Nullable public static final BlockType POTTED_ACACIA_SAPLING = init(); + @Nullable public static final BlockType POTTED_ALLIUM = init(); + @Nullable public static final BlockType POTTED_AZURE_BLUET = init(); + @Nullable public static final BlockType POTTED_BAMBOO = init(); + @Nullable public static final BlockType POTTED_BIRCH_SAPLING = init(); + @Nullable public static final BlockType POTTED_BLUE_ORCHID = init(); + @Nullable public static final BlockType POTTED_BROWN_MUSHROOM = init(); + @Nullable public static final BlockType POTTED_CACTUS = init(); + @Nullable public static final BlockType POTTED_CORNFLOWER = init(); + @Nullable public static final BlockType POTTED_DANDELION = init(); + @Nullable public static final BlockType POTTED_DARK_OAK_SAPLING = init(); + @Nullable public static final BlockType POTTED_DEAD_BUSH = init(); + @Nullable public static final BlockType POTTED_FERN = init(); + @Nullable public static final BlockType POTTED_JUNGLE_SAPLING = init(); + @Nullable public static final BlockType POTTED_LILY_OF_THE_VALLEY = init(); + @Nullable public static final BlockType POTTED_OAK_SAPLING = init(); + @Nullable public static final BlockType POTTED_ORANGE_TULIP = init(); + @Nullable public static final BlockType POTTED_OXEYE_DAISY = init(); + @Nullable public static final BlockType POTTED_PINK_TULIP = init(); + @Nullable public static final BlockType POTTED_POPPY = init(); + @Nullable public static final BlockType POTTED_RED_MUSHROOM = init(); + @Nullable public static final BlockType POTTED_RED_TULIP = init(); + @Nullable public static final BlockType POTTED_SPRUCE_SAPLING = init(); + @Nullable public static final BlockType POTTED_WHITE_TULIP = init(); + @Nullable public static final BlockType POTTED_WITHER_ROSE = init(); + @Nullable public static final BlockType POWERED_RAIL = init(); + @Nullable public static final BlockType PRISMARINE = init(); + @Nullable public static final BlockType PRISMARINE_BRICK_SLAB = init(); + @Nullable public static final BlockType PRISMARINE_BRICK_STAIRS = init(); + @Nullable public static final BlockType PRISMARINE_BRICKS = init(); + @Nullable public static final BlockType PRISMARINE_SLAB = init(); + @Nullable public static final BlockType PRISMARINE_STAIRS = init(); + @Nullable public static final BlockType PRISMARINE_WALL = init(); + @Nullable public static final BlockType PUMPKIN = init(); + @Nullable public static final BlockType PUMPKIN_STEM = init(); + @Nullable public static final BlockType PURPLE_BANNER = init(); + @Nullable public static final BlockType PURPLE_BED = init(); + @Nullable public static final BlockType PURPLE_CARPET = init(); + @Nullable public static final BlockType PURPLE_CONCRETE = init(); + @Nullable public static final BlockType PURPLE_CONCRETE_POWDER = init(); + @Nullable public static final BlockType PURPLE_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType PURPLE_SHULKER_BOX = init(); + @Nullable public static final BlockType PURPLE_STAINED_GLASS = init(); + @Nullable public static final BlockType PURPLE_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType PURPLE_TERRACOTTA = init(); + @Nullable public static final BlockType PURPLE_WALL_BANNER = init(); + @Nullable public static final BlockType PURPLE_WOOL = init(); + @Nullable public static final BlockType PURPUR_BLOCK = init(); + @Nullable public static final BlockType PURPUR_PILLAR = init(); + @Nullable public static final BlockType PURPUR_SLAB = init(); + @Nullable public static final BlockType PURPUR_STAIRS = init(); + @Nullable public static final BlockType QUARTZ_BLOCK = init(); + @Nullable public static final BlockType QUARTZ_PILLAR = init(); + @Nullable public static final BlockType QUARTZ_SLAB = init(); + @Nullable public static final BlockType QUARTZ_STAIRS = init(); + @Nullable public static final BlockType RAIL = init(); + @Nullable public static final BlockType RED_BANNER = init(); + @Nullable public static final BlockType RED_BED = init(); + @Nullable public static final BlockType RED_CARPET = init(); + @Nullable public static final BlockType RED_CONCRETE = init(); + @Nullable public static final BlockType RED_CONCRETE_POWDER = init(); + @Nullable public static final BlockType RED_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType RED_MUSHROOM = init(); + @Nullable public static final BlockType RED_MUSHROOM_BLOCK = init(); + @Nullable public static final BlockType RED_NETHER_BRICK_SLAB = init(); + @Nullable public static final BlockType RED_NETHER_BRICK_STAIRS = init(); + @Nullable public static final BlockType RED_NETHER_BRICK_WALL = init(); + @Nullable public static final BlockType RED_NETHER_BRICKS = init(); + @Nullable public static final BlockType RED_SAND = init(); + @Nullable public static final BlockType RED_SANDSTONE = init(); + @Nullable public static final BlockType RED_SANDSTONE_SLAB = init(); + @Nullable public static final BlockType RED_SANDSTONE_STAIRS = init(); + @Nullable public static final BlockType RED_SANDSTONE_WALL = init(); + @Nullable public static final BlockType RED_SHULKER_BOX = init(); + @Nullable public static final BlockType RED_STAINED_GLASS = init(); + @Nullable public static final BlockType RED_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType RED_TERRACOTTA = init(); + @Nullable public static final BlockType RED_TULIP = init(); + @Nullable public static final BlockType RED_WALL_BANNER = init(); + @Nullable public static final BlockType RED_WOOL = init(); + @Nullable public static final BlockType REDSTONE_BLOCK = init(); + @Nullable public static final BlockType REDSTONE_LAMP = init(); + @Nullable public static final BlockType REDSTONE_ORE = init(); + @Nullable public static final BlockType REDSTONE_TORCH = init(); + @Nullable public static final BlockType REDSTONE_WALL_TORCH = init(); + @Nullable public static final BlockType REDSTONE_WIRE = init(); + @Nullable public static final BlockType REPEATER = init(); + @Nullable public static final BlockType REPEATING_COMMAND_BLOCK = init(); + @Nullable public static final BlockType ROSE_BUSH = init(); + @Nullable public static final BlockType SAND = init(); + @Nullable public static final BlockType SANDSTONE = init(); + @Nullable public static final BlockType SANDSTONE_SLAB = init(); + @Nullable public static final BlockType SANDSTONE_STAIRS = init(); + @Nullable public static final BlockType SANDSTONE_WALL = init(); + @Nullable public static final BlockType SCAFFOLDING = init(); + @Nullable public static final BlockType SEA_LANTERN = init(); + @Nullable public static final BlockType SEA_PICKLE = init(); + @Nullable public static final BlockType SEAGRASS = init(); + @Nullable public static final BlockType SHULKER_BOX = init(); + @Nullable public static final BlockType SKELETON_SKULL = init(); + @Nullable public static final BlockType SKELETON_WALL_SKULL = init(); + @Nullable public static final BlockType SLIME_BLOCK = init(); + @Nullable public static final BlockType SMITHING_TABLE = init(); + @Nullable public static final BlockType SMOKER = init(); + @Nullable public static final BlockType SMOOTH_QUARTZ = init(); + @Nullable public static final BlockType SMOOTH_QUARTZ_SLAB = init(); + @Nullable public static final BlockType SMOOTH_QUARTZ_STAIRS = init(); + @Nullable public static final BlockType SMOOTH_RED_SANDSTONE = init(); + @Nullable public static final BlockType SMOOTH_RED_SANDSTONE_SLAB = init(); + @Nullable public static final BlockType SMOOTH_RED_SANDSTONE_STAIRS = init(); + @Nullable public static final BlockType SMOOTH_SANDSTONE = init(); + @Nullable public static final BlockType SMOOTH_SANDSTONE_SLAB = init(); + @Nullable public static final BlockType SMOOTH_SANDSTONE_STAIRS = init(); + @Nullable public static final BlockType SMOOTH_STONE = init(); + @Nullable public static final BlockType SMOOTH_STONE_SLAB = init(); + @Nullable public static final BlockType SNOW = init(); + @Nullable public static final BlockType SNOW_BLOCK = init(); + @Nullable public static final BlockType SOUL_SAND = init(); + @Nullable public static final BlockType SPAWNER = init(); + @Nullable public static final BlockType SPONGE = init(); + @Nullable public static final BlockType SPRUCE_BUTTON = init(); + @Nullable public static final BlockType SPRUCE_DOOR = init(); + @Nullable public static final BlockType SPRUCE_FENCE = init(); + @Nullable public static final BlockType SPRUCE_FENCE_GATE = init(); + @Nullable public static final BlockType SPRUCE_LEAVES = init(); + @Nullable public static final BlockType SPRUCE_LOG = init(); + @Nullable public static final BlockType SPRUCE_PLANKS = init(); + @Nullable public static final BlockType SPRUCE_PRESSURE_PLATE = init(); + @Nullable public static final BlockType SPRUCE_SAPLING = init(); + @Nullable public static final BlockType SPRUCE_SIGN = init(); + @Nullable public static final BlockType SPRUCE_SLAB = init(); + @Nullable public static final BlockType SPRUCE_STAIRS = init(); + @Nullable public static final BlockType SPRUCE_TRAPDOOR = init(); + @Nullable public static final BlockType SPRUCE_WALL_SIGN = init(); + @Nullable public static final BlockType SPRUCE_WOOD = init(); + @Nullable public static final BlockType STICKY_PISTON = init(); + @Nullable public static final BlockType STONE = init(); + @Nullable public static final BlockType STONE_BRICK_SLAB = init(); + @Nullable public static final BlockType STONE_BRICK_STAIRS = init(); + @Nullable public static final BlockType STONE_BRICK_WALL = init(); + @Nullable public static final BlockType STONE_BRICKS = init(); + @Nullable public static final BlockType STONE_BUTTON = init(); + @Nullable public static final BlockType STONE_PRESSURE_PLATE = init(); + @Nullable public static final BlockType STONE_SLAB = init(); + @Nullable public static final BlockType STONE_STAIRS = init(); + @Nullable public static final BlockType STONECUTTER = init(); + @Nullable public static final BlockType STRIPPED_ACACIA_LOG = init(); + @Nullable public static final BlockType STRIPPED_ACACIA_WOOD = init(); + @Nullable public static final BlockType STRIPPED_BIRCH_LOG = init(); + @Nullable public static final BlockType STRIPPED_BIRCH_WOOD = init(); + @Nullable public static final BlockType STRIPPED_DARK_OAK_LOG = init(); + @Nullable public static final BlockType STRIPPED_DARK_OAK_WOOD = init(); + @Nullable public static final BlockType STRIPPED_JUNGLE_LOG = init(); + @Nullable public static final BlockType STRIPPED_JUNGLE_WOOD = init(); + @Nullable public static final BlockType STRIPPED_OAK_LOG = init(); + @Nullable public static final BlockType STRIPPED_OAK_WOOD = init(); + @Nullable public static final BlockType STRIPPED_SPRUCE_LOG = init(); + @Nullable public static final BlockType STRIPPED_SPRUCE_WOOD = init(); + @Nullable public static final BlockType STRUCTURE_BLOCK = init(); + @Nullable public static final BlockType STRUCTURE_VOID = init(); + @Nullable public static final BlockType SUGAR_CANE = init(); + @Nullable public static final BlockType SUNFLOWER = init(); + @Nullable public static final BlockType SWEET_BERRY_BUSH = init(); + @Nullable public static final BlockType TALL_GRASS = init(); + @Nullable public static final BlockType TALL_SEAGRASS = init(); + @Nullable public static final BlockType TERRACOTTA = init(); + @Nullable public static final BlockType TNT = init(); + @Nullable public static final BlockType TORCH = init(); + @Nullable public static final BlockType TRAPPED_CHEST = init(); + @Nullable public static final BlockType TRIPWIRE = init(); + @Nullable public static final BlockType TRIPWIRE_HOOK = init(); + @Nullable public static final BlockType TUBE_CORAL = init(); + @Nullable public static final BlockType TUBE_CORAL_BLOCK = init(); + @Nullable public static final BlockType TUBE_CORAL_FAN = init(); + @Nullable public static final BlockType TUBE_CORAL_WALL_FAN = init(); + @Nullable public static final BlockType TURTLE_EGG = init(); + @Nullable public static final BlockType VINE = init(); + @Nullable public static final BlockType VOID_AIR = init(); + @Nullable public static final BlockType WALL_TORCH = init(); + @Nullable public static final BlockType WATER = init(); + @Nullable public static final BlockType WET_SPONGE = init(); + @Nullable public static final BlockType WHEAT = init(); + @Nullable public static final BlockType WHITE_BANNER = init(); + @Nullable public static final BlockType WHITE_BED = init(); + @Nullable public static final BlockType WHITE_CARPET = init(); + @Nullable public static final BlockType WHITE_CONCRETE = init(); + @Nullable public static final BlockType WHITE_CONCRETE_POWDER = init(); + @Nullable public static final BlockType WHITE_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType WHITE_SHULKER_BOX = init(); + @Nullable public static final BlockType WHITE_STAINED_GLASS = init(); + @Nullable public static final BlockType WHITE_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType WHITE_TERRACOTTA = init(); + @Nullable public static final BlockType WHITE_TULIP = init(); + @Nullable public static final BlockType WHITE_WALL_BANNER = init(); + @Nullable public static final BlockType WHITE_WOOL = init(); + @Nullable public static final BlockType WITHER_ROSE = init(); + @Nullable public static final BlockType WITHER_SKELETON_SKULL = init(); + @Nullable public static final BlockType WITHER_SKELETON_WALL_SKULL = init(); + @Nullable public static final BlockType YELLOW_BANNER = init(); + @Nullable public static final BlockType YELLOW_BED = init(); + @Nullable public static final BlockType YELLOW_CARPET = init(); + @Nullable public static final BlockType YELLOW_CONCRETE = init(); + @Nullable public static final BlockType YELLOW_CONCRETE_POWDER = init(); + @Nullable public static final BlockType YELLOW_GLAZED_TERRACOTTA = init(); + @Nullable public static final BlockType YELLOW_SHULKER_BOX = init(); + @Nullable public static final BlockType YELLOW_STAINED_GLASS = init(); + @Nullable public static final BlockType YELLOW_STAINED_GLASS_PANE = init(); + @Nullable public static final BlockType YELLOW_TERRACOTTA = init(); + @Nullable public static final BlockType YELLOW_WALL_BANNER = init(); + @Nullable public static final BlockType YELLOW_WOOL = init(); + @Nullable public static final BlockType ZOMBIE_HEAD = init(); + @Nullable public static final BlockType ZOMBIE_WALL_HEAD = init(); // deprecated - @Deprecated @Nullable public static BlockType SIGN; - @Deprecated @Nullable public static BlockType WALL_SIGN; + @Deprecated @Nullable public static BlockType SIGN = OAK_SIGN; + @Deprecated @Nullable public static BlockType WALL_SIGN = OAK_WALL_SIGN; - /* - ----------------------------------------------------- - Settings - ----------------------------------------------------- - */ - protected final static class Settings { - protected final int internalId; - protected final BlockState defaultState; - protected final AbstractProperty[] propertiesMapArr; - protected final AbstractProperty[] propertiesArr; - protected final List> propertiesList; - protected final Map> propertiesMap; - protected final Set> propertiesSet; - protected final BlockMaterial blockMaterial; - protected final int permutations; - protected int[] stateOrdinals; - - Settings(BlockType type, String id, int internalId, List states) { - this.internalId = internalId; - String propertyString = null; - int propI = id.indexOf('['); - if (propI != -1) { - propertyString = id.substring(propI + 1, id.length() - 1); - } - - int maxInternalStateId = 0; - Map> properties = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getProperties(type); - if (!properties.isEmpty()) { - // Ensure the properties are registered - int maxOrdinal = 0; - for (String key : properties.keySet()) { - maxOrdinal = Math.max(PropertyKey.getOrCreate(key).ordinal(), maxOrdinal); - } - this.propertiesMapArr = new AbstractProperty[maxOrdinal + 1]; - int prop_arr_i = 0; - this.propertiesArr = new AbstractProperty[properties.size()]; - HashMap> propMap = new HashMap<>(); - - int bitOffset = 0; - for (Map.Entry> entry : properties.entrySet()) { - PropertyKey key = PropertyKey.getOrCreate(entry.getKey()); - AbstractProperty property = ((AbstractProperty) entry.getValue()).withOffset(bitOffset); - this.propertiesMapArr[key.ordinal()] = property; - this.propertiesArr[prop_arr_i++] = property; - propMap.put(entry.getKey(), property); - - maxInternalStateId += (property.getValues().size() << bitOffset); - bitOffset += property.getNumBits(); - } - this.propertiesList = Arrays.asList(this.propertiesArr); - this.propertiesMap = Collections.unmodifiableMap(propMap); - this.propertiesSet = new LinkedHashSet<>(this.propertiesMap.values()); - } else { - this.propertiesMapArr = new AbstractProperty[0]; - this.propertiesArr = this.propertiesMapArr; - this.propertiesList = Collections.emptyList(); - this.propertiesMap = Collections.emptyMap(); - this.propertiesSet = Collections.emptySet(); - } - this.permutations = maxInternalStateId; - - this.blockMaterial = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(type); - - if (!propertiesList.isEmpty()) { - this.stateOrdinals = generateStateOrdinals(internalId, states.size(), maxInternalStateId, propertiesList); - - for (int propId = 0; propId < this.stateOrdinals.length; propId++) { - int ordinal = this.stateOrdinals[propId]; - if (ordinal != -1) { - int stateId = internalId + (propId << BlockTypes.BIT_OFFSET); - BlockState state = new BlockState(type, stateId, ordinal); - states.add(state); - } - } - int defaultPropId = parseProperties(propertyString, propertiesMap) >> BlockTypes.BIT_OFFSET; - - this.defaultState = states.get(this.stateOrdinals[defaultPropId]); - } else { - this.defaultState = new BlockState(type, internalId, states.size()); - states.add(this.defaultState); - } - } - - private int parseProperties(String properties, Map> propertyMap) { - int id = internalId; - for (String keyPair : properties.split(",")) { - String[] split = keyPair.split("="); - String name = split[0]; - String value = split[1]; - AbstractProperty btp = propertyMap.get(name); - id = btp.modify(id, btp.getValueFor(value)); - } - return id; + private static Field[] fieldsTmp; + private static JoinedCharSequence joined; + private static int initIndex = 0; + public static BlockType init() { + if (fieldsTmp == null) { + fieldsTmp = BlockTypes.class.getDeclaredFields(); + BlockTypesCache.$NAMESPACES.isEmpty(); // initialize cache + joined = new JoinedCharSequence(); } + String name = fieldsTmp[initIndex++].getName().toLowerCase(Locale.ROOT); + CharSequence fullName = joined.init(BlockType.REGISTRY.getDefaultNamespace(), ':', name); + return BlockType.REGISTRY.getMap().get(fullName); } - - - private static int[] generateStateOrdinals(int internalId, int ordinal, int maxStateId, List> props) { - if (props.isEmpty()) return null; - int[] result = new int[maxStateId]; - Arrays.fill(result, -1); - int[] state = new int[props.size()]; - int[] sizes = new int[props.size()]; - for (int i = 0; i < props.size(); i++) { - sizes[i] = props.get(i).getValues().size(); - } - int index = 0; - outer: - while (true) { - // Create the state - int stateId = internalId; - for (int i = 0; i < state.length; i++) { - stateId = props.get(i).modifyIndex(stateId, state[i]); - } - // Map it to the ordinal - result[stateId >> BlockTypes.BIT_OFFSET] = ordinal++; - // Increment the state - while (++state[index] == sizes[index]) { - state[index] = 0; - index++; - if (index == state.length) break outer; - } - index = 0; - } - return result; - } - - /* - ----------------------------------------------------- - Static Initializer - ----------------------------------------------------- - */ - - public static final int BIT_OFFSET; // Used internally - protected static final int BIT_MASK; // Used internally - -// private static final Map $REGISTRY = new HashMap<>(); -// public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("block type", $REGISTRY); - - public static final BlockType[] values; - public static final BlockState[] states; - - private static final Set $NAMESPACES = new LinkedHashSet<>(); - static { - try { - ArrayList stateList = new ArrayList<>(); - - Platform platform = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS); - Registries registries = platform.getRegistries(); - BlockRegistry blockReg = registries.getBlockRegistry(); - Collection blocks = blockReg.registerBlocks(); - Map blockMap = blocks.stream().collect(Collectors.toMap(item -> item.charAt(item.length() - 1) == ']' ? item.substring(0, item.indexOf('[')) : item, item -> item)); - - int size = blockMap.size(); - for (Field field : BlockID.class.getDeclaredFields()) size = Math.max(field.getInt(null) + 1, size); - BIT_OFFSET = MathMan.log2nlz(size); - BIT_MASK = ((1 << BIT_OFFSET) - 1); - values = new BlockType[size]; - - // Register the statically declared ones first - Field[] oldFields = BlockID.class.getDeclaredFields(); - for (Field field : oldFields) { - if (field.getType() == int.class) { - int internalId = field.getInt(null); - String id = "minecraft:" + field.getName().toLowerCase(Locale.ROOT); - String defaultState = blockMap.remove(id); - if (defaultState == null) { - if (internalId != 0) { - System.out.println("Ignoring invalid block " + id); - continue; - } - defaultState = id; - } - if (values[internalId] != null) { - throw new IllegalStateException("Invalid duplicate id for " + field.getName()); - } - BlockType type = register(defaultState, internalId, stateList); - // Note: Throws IndexOutOfBoundsError if nothing is registered and blocksMap is empty - values[internalId] = type; - } - } - - { // Register new blocks - int internalId = 1; - for (Map.Entry entry : blockMap.entrySet()) { - String defaultState = entry.getValue(); - // Skip already registered ids - for (; values[internalId] != null; internalId++); - BlockType type = register(defaultState, internalId, stateList); - values[internalId] = type; - } - } - - states = stateList.toArray(new BlockState[stateList.size()]); - - - // Init deprecated - SIGN = OAK_SIGN; - WALL_SIGN = OAK_WALL_SIGN; - } catch (Throwable e) { - e.printStackTrace(); - throw new RuntimeException(e); - } + fieldsTmp = null; + joined = null; } - private static BlockType register(final String id, int internalId, List states) { - // Get the enum name (remove namespace if minecraft:) - int propStart = id.indexOf('['); - String typeName = id.substring(0, propStart == -1 ? id.length() : propStart); - String enumName = (typeName.startsWith("minecraft:") ? typeName.substring(10) : typeName).toUpperCase(Locale.ROOT); - BlockType existing = new BlockType(id, internalId, states); - - - // Set field value - try { - Field field = BlockTypes.class.getDeclaredField(enumName); - ReflectionUtils.setFailsafeFieldValue(field, null, existing); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } - - // register states - BlockType.REGISTRY.register(typeName, existing); - String nameSpace = typeName.substring(0, typeName.indexOf(':')); - $NAMESPACES.add(nameSpace); - return existing; - } - - /* ----------------------------------------------------- Parsing @@ -987,7 +776,7 @@ public final class BlockTypes { } catch (NumberFormatException | IndexOutOfBoundsException e) { } - throw new SuggestInputParseException("Does not match a valid block type: " + inputLower, inputLower, () -> Stream.of(BlockTypes.values) + throw new SuggestInputParseException("Does not match a valid block type: " + inputLower, inputLower, () -> Stream.of(BlockTypesCache.values) .filter(b -> StringMan.blockStateMatches(inputLower, b.getId())) .map(BlockType::getId) .sorted(StringMan.blockStateComparator(inputLower)) @@ -996,7 +785,7 @@ public final class BlockTypes { } public static Set getNameSpaces() { - return $NAMESPACES; + return BlockTypesCache.$NAMESPACES; } @Nullable @@ -1011,21 +800,21 @@ public final class BlockTypes { @Deprecated public static BlockType get(final int ordinal) { - return values[ordinal]; + return BlockTypesCache.values[ordinal]; } @Deprecated public static BlockType getFromStateId(final int internalStateId) { - return values[internalStateId & BIT_MASK]; + return BlockTypesCache.values[internalStateId & BlockTypesCache.BIT_MASK]; } @Deprecated public static BlockType getFromStateOrdinal(final int internalStateOrdinal) { - return states[internalStateOrdinal].getBlockType(); + return BlockTypesCache.states[internalStateOrdinal].getBlockType(); } public static int size() { - return values.length; + return BlockTypesCache.values.length; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypesCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypesCache.java new file mode 100644 index 000000000..52d6216f5 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypesCache.java @@ -0,0 +1,243 @@ +package com.sk89q.worldedit.world.block; + +import com.boydti.fawe.util.MathMan; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.extension.platform.Platform; +import com.sk89q.worldedit.registry.state.AbstractProperty; +import com.sk89q.worldedit.registry.state.Property; +import com.sk89q.worldedit.registry.state.PropertyKey; +import com.sk89q.worldedit.world.registry.BlockMaterial; +import com.sk89q.worldedit.world.registry.BlockRegistry; +import com.sk89q.worldedit.world.registry.Registries; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +public class BlockTypesCache { + /* + ----------------------------------------------------- + Settings + ----------------------------------------------------- + */ + protected final static class Settings { + protected final int internalId; + protected final BlockState defaultState; + protected final AbstractProperty[] propertiesMapArr; + protected final AbstractProperty[] propertiesArr; + protected final List> propertiesList; + protected final Map> propertiesMap; + protected final Set> propertiesSet; + protected final BlockMaterial blockMaterial; + protected final int permutations; + protected int[] stateOrdinals; + + Settings(BlockType type, String id, int internalId, List states) { + this.internalId = internalId; + String propertyString = null; + int propI = id.indexOf('['); + if (propI != -1) { + propertyString = id.substring(propI + 1, id.length() - 1); + } + + int maxInternalStateId = 0; + Map> properties = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getProperties(type); + if (!properties.isEmpty()) { + // Ensure the properties are registered + int maxOrdinal = 0; + for (String key : properties.keySet()) { + maxOrdinal = Math.max(PropertyKey.getOrCreate(key).ordinal(), maxOrdinal); + } + this.propertiesMapArr = new AbstractProperty[maxOrdinal + 1]; + int prop_arr_i = 0; + this.propertiesArr = new AbstractProperty[properties.size()]; + HashMap> propMap = new HashMap<>(); + + int bitOffset = 0; + for (Map.Entry> entry : properties.entrySet()) { + PropertyKey key = PropertyKey.getOrCreate(entry.getKey()); + AbstractProperty property = ((AbstractProperty) entry.getValue()).withOffset(bitOffset); + this.propertiesMapArr[key.ordinal()] = property; + this.propertiesArr[prop_arr_i++] = property; + propMap.put(entry.getKey(), property); + + maxInternalStateId += (property.getValues().size() << bitOffset); + bitOffset += property.getNumBits(); + } + this.propertiesList = Arrays.asList(this.propertiesArr); + this.propertiesMap = Collections.unmodifiableMap(propMap); + this.propertiesSet = new LinkedHashSet<>(this.propertiesMap.values()); + } else { + this.propertiesMapArr = new AbstractProperty[0]; + this.propertiesArr = this.propertiesMapArr; + this.propertiesList = Collections.emptyList(); + this.propertiesMap = Collections.emptyMap(); + this.propertiesSet = Collections.emptySet(); + } + this.permutations = maxInternalStateId; + + this.blockMaterial = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(type); + + if (!propertiesList.isEmpty()) { + this.stateOrdinals = generateStateOrdinals(internalId, states.size(), maxInternalStateId, propertiesList); + + for (int propId = 0; propId < this.stateOrdinals.length; propId++) { + int ordinal = this.stateOrdinals[propId]; + if (ordinal != -1) { + int stateId = internalId + (propId << BIT_OFFSET); + BlockState state = new BlockState(type, stateId, ordinal); + states.add(state); + } + } + int defaultPropId = parseProperties(propertyString, propertiesMap) >> BIT_OFFSET; + + this.defaultState = states.get(this.stateOrdinals[defaultPropId]); + } else { + this.defaultState = new BlockState(type, internalId, states.size()); + states.add(this.defaultState); + } + } + + private int parseProperties(String properties, Map> propertyMap) { + int id = internalId; + for (String keyPair : properties.split(",")) { + String[] split = keyPair.split("="); + String name = split[0]; + String value = split[1]; + AbstractProperty btp = propertyMap.get(name); + id = btp.modify(id, btp.getValueFor(value)); + } + return id; + } + } + + + private static int[] generateStateOrdinals(int internalId, int ordinal, int maxStateId, List> props) { + if (props.isEmpty()) return null; + int[] result = new int[maxStateId]; + Arrays.fill(result, -1); + int[] state = new int[props.size()]; + int[] sizes = new int[props.size()]; + for (int i = 0; i < props.size(); i++) { + sizes[i] = props.get(i).getValues().size(); + } + int index = 0; + outer: + while (true) { + // Create the state + int stateId = internalId; + for (int i = 0; i < state.length; i++) { + stateId = props.get(i).modifyIndex(stateId, state[i]); + } + // Map it to the ordinal + result[stateId >> BIT_OFFSET] = ordinal++; + // Increment the state + while (++state[index] == sizes[index]) { + state[index] = 0; + index++; + if (index == state.length) break outer; + } + index = 0; + } + return result; + } + + /* + ----------------------------------------------------- + Static Initializer + ----------------------------------------------------- + */ + + public static final int BIT_OFFSET; // Used internally + protected static final int BIT_MASK; // Used internally + +// private static final Map $REGISTRY = new HashMap<>(); +// public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("block type", $REGISTRY); + + public static final BlockType[] values; + public static final BlockState[] states; + + protected static final Set $NAMESPACES = new LinkedHashSet<>(); + + static { + try { + ArrayList stateList = new ArrayList<>(); + + Platform platform = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS); + Registries registries = platform.getRegistries(); + BlockRegistry blockReg = registries.getBlockRegistry(); + Collection blocks = blockReg.registerBlocks(); + Map blockMap = blocks.stream().collect(Collectors.toMap(item -> item.charAt(item.length() - 1) == ']' ? item.substring(0, item.indexOf('[')) : item, item -> item)); + + int size = blockMap.size(); + Field[] idFields = BlockID.class.getDeclaredFields(); + for (Field field : idFields) size = Math.max(field.getInt(null) + 1, size); + BIT_OFFSET = MathMan.log2nlz(size); + BIT_MASK = ((1 << BIT_OFFSET) - 1); + values = new BlockType[size]; + + // Register the statically declared ones first + for (Field field : idFields) { + if (field.getType() == int.class) { + int internalId = field.getInt(null); + String id = "minecraft:" + field.getName().toLowerCase(Locale.ROOT); + String defaultState = blockMap.remove(id); + if (defaultState == null) { + if (internalId != 0) { + System.out.println("Ignoring invalid block " + id); + continue; + } + defaultState = id; + } + if (values[internalId] != null) { + throw new IllegalStateException("Invalid duplicate id for " + field.getName()); + } + BlockType type = register(defaultState, internalId, stateList); + // Note: Throws IndexOutOfBoundsError if nothing is registered and blocksMap is empty + values[internalId] = type; + } + } + + { // Register new blocks + int internalId = 1; + for (Map.Entry entry : blockMap.entrySet()) { + String defaultState = entry.getValue(); + // Skip already registered ids + for (; values[internalId] != null; internalId++); + BlockType type = register(defaultState, internalId, stateList); + values[internalId] = type; + } + } + + states = stateList.toArray(new BlockState[stateList.size()]); + + + } catch (Throwable e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + + private static BlockType register(final String id, int internalId, List states) { + // Get the enum name (remove namespace if minecraft:) + int propStart = id.indexOf('['); + String typeName = id.substring(0, propStart == -1 ? id.length() : propStart); + String enumName = (typeName.startsWith("minecraft:") ? typeName.substring(10) : typeName).toUpperCase(Locale.ROOT); + BlockType existing = new BlockType(id, internalId, states); + // register states + BlockType.REGISTRY.register(typeName, existing); + String nameSpace = typeName.substring(0, typeName.indexOf(':')); + $NAMESPACES.add(nameSpace); + return existing; + } +}