static blocktype initialization

instead of using hacky reflection
This commit is contained in:
Jesse Boyd
2019-11-02 20:35:51 +01:00
parent 70efdf8c54
commit 32d837414b
35 changed files with 1128 additions and 989 deletions

View File

@ -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<Map<String, Object>>() {
}.getType();
for (BlockType blockType : BlockTypes.values) {
for (BlockType blockType : BlockTypesCache.values) {
if (!blockType.getMaterial().isFullCube()) {
continue;
}