From 41a80064f5b82827889894c8d0d541f48f5081d4 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 3 Jan 2018 15:35:51 +1000 Subject: [PATCH 01/74] I guarantee this is broken. Start some form of string ID for blocks --- .../sk89q/worldedit/bukkit/BukkitWorld.java | 2 +- .../java/com/sk89q/worldedit/EditSession.java | 4 +- .../java/com/sk89q/worldedit/WorldEdit.java | 2 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 129 +++++++++++------- .../com/sk89q/worldedit/blocks/BlockType.java | 4 +- .../worldedit/blocks/type/BlockType.java | 66 +++++++++ .../worldedit/blocks/type/BlockTypes.java | 59 ++++++++ .../sk89q/worldedit/command/ToolCommands.java | 4 +- .../worldedit/command/UtilityCommands.java | 2 +- .../worldedit/command/tool/BlockReplacer.java | 2 +- .../command/tool/FloatingTreeRemover.java | 2 +- .../worldedit/command/tool/FloodFillTool.java | 2 +- .../command/tool/LongRangeBuildTool.java | 4 +- .../worldedit/command/tool/QueryTool.java | 5 +- .../command/tool/RecursivePickaxe.java | 2 +- .../command/tool/brush/GravityBrush.java | 3 +- .../extent/clipboard/io/SchematicWriter.java | 8 +- .../SignCompatibilityHandler.java | 2 +- .../extent/inventory/BlockBagExtent.java | 4 +- .../extent/reorder/MultiStageReorder.java | 8 +- .../validation/DataValidatorExtent.java | 2 +- .../extent/world/BlockQuirkExtent.java | 2 +- .../extent/world/SurvivalModeExtent.java | 2 +- .../function/generator/FloraGenerator.java | 5 +- .../function/generator/ForestGenerator.java | 2 +- .../generator/GardenPatchGenerator.java | 5 +- .../function/mask/ExistingBlockMask.java | 2 +- .../function/mask/SolidBlockMask.java | 2 +- .../worldedit/math/convolution/HeightMap.java | 5 +- .../regions/shape/ArbitraryShape.java | 2 +- .../schematic/MCEditSchematicFormat.java | 8 +- .../sk89q/worldedit/world/AbstractWorld.java | 2 +- .../java/com/sk89q/worldedit/world/World.java | 1 + .../world/registry/BlockRegistry.java | 1 + .../world/registry/BundledBlockData.java | 50 +++++++ .../world/registry/LegacyBlockRegistry.java | 23 ++-- .../sk89q/worldedit/CuboidClipboardTest.java | 30 ++-- .../transform/BlockTransformExtentTest.java | 4 +- .../worldedit/sponge/SpongeWorldEdit.java | 5 + 39 files changed, 349 insertions(+), 118 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index df7714295..64671efde 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -416,7 +416,7 @@ public class BukkitWorld extends LocalWorld { return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight); } else { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - return bukkitBlock.setTypeIdAndData(block.getType(), (byte) block.getData(), notifyAndLight); + return bukkitBlock.setTypeIdAndData(block.getType().getLegacyId(), (byte) block.getData(), notifyAndLight); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index be9ce3bdd..3a3376e81 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -1811,7 +1811,7 @@ public class EditSession implements Extent { for (int y = basePosition.getBlockY(); y >= basePosition.getBlockY() - 10; --y) { // Check if we hit the ground - int t = getBlock(new Vector(x, y, z)).getType(); + int t = getBlock(new Vector(x, y, z)).getType().getLegacyId(); if (t == BlockID.GRASS || t == BlockID.DIRT) { treeGenerator.generate(this, new Vector(x, y + 1, z)); ++affected; @@ -1963,7 +1963,7 @@ public class EditSession implements Extent { final Vector scaled = current.subtract(zero).divide(unit); try { - if (expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ(), defaultMaterial.getType(), defaultMaterial.getData()) <= 0) { + if (expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ(), defaultMaterial.getType().getLegacyId(), defaultMaterial.getData()) <= 0) { return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 3826b19e3..07d00ced6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -308,7 +308,7 @@ public class WorldEdit { String[] items = list.split(","); Set blocks = new HashSet(); for (String s : items) { - blocks.add(getBlock(player, s, allBlocksAllowed).getType()); + blocks.add(getBlock(player, s, allBlocksAllowed).getType().getLegacyId()); } return blocks; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index cc8bcf05c..398cc392b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -23,8 +23,11 @@ import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.CuboidClipboard.FlipDirection; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.foundation.Block; import com.sk89q.worldedit.function.mask.Mask; +import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.WorldData; import javax.annotation.Nullable; @@ -56,15 +59,6 @@ import java.util.Collection; @SuppressWarnings("deprecation") public class BaseBlock extends Block implements TileEntityBlock { - /** - * Indicates the highest possible block ID (inclusive) that can be used. - * This value is subject to change depending on the implementation, but - * internally this class only supports a range of 4096 IDs (for space - * reasons), which coincides with the number of possible IDs that official - * Minecraft supports as of version 1.7. - */ - public static final int MAX_ID = 4095; - /** * Indicates the maximum data value (inclusive) that can be used. A future * version of Minecraft may abolish block data values. @@ -74,7 +68,7 @@ public class BaseBlock extends Block implements TileEntityBlock { // Instances of this class should be _as small as possible_ because there will // be millions of instances of this object. - private short id; + private BlockType blockType; private short data; @Nullable private CompoundTag nbtData; @@ -85,11 +79,21 @@ public class BaseBlock extends Block implements TileEntityBlock { * @param id ID value * @see #setId(int) */ + @Deprecated public BaseBlock(int id) { - internalSetId(id); + setId(id); internalSetData(0); } + /** + * Construct a block with the given type and default data. + * + * @param blockType The block type + */ + public BaseBlock(BlockType blockType) { + internalSetType(blockType); + } + /** * Construct a block with the given ID and data value. * @@ -98,8 +102,25 @@ public class BaseBlock extends Block implements TileEntityBlock { * @see #setId(int) * @see #setData(int) */ + @Deprecated public BaseBlock(int id, int data) { - internalSetId(id); + setId(id); + internalSetData(data); + } + + /** + * Construct a block with the given ID and data value. + * + * THIS WILL GET REMOVED SOON. + * + * @param blockType The block type + * @param data data value + * @see #setId(int) + * @see #setData(int) + */ + @Deprecated + public BaseBlock(BlockType blockType, int data) { + internalSetType(blockType); internalSetData(data); } @@ -110,12 +131,29 @@ public class BaseBlock extends Block implements TileEntityBlock { * @param data data value * @param nbtData NBT data, which may be null */ + @Deprecated public BaseBlock(int id, int data, @Nullable CompoundTag nbtData) { setId(id); setData(data); setNbtData(nbtData); } + /** + * Construct a block with the given ID, data value and NBT data structure. + * + * THIS WILL GET REMOVED SOON. + * + * @param blockType The block type + * @param data data value + * @param nbtData NBT data, which may be null + */ + @Deprecated + public BaseBlock(BlockType blockType, int data, @Nullable CompoundTag nbtData) { + setType(blockType); + setData(data); + setNbtData(nbtData); + } + /** * Create a clone of another block. * @@ -126,41 +164,48 @@ public class BaseBlock extends Block implements TileEntityBlock { } /** - * Get the ID of the block. + * Get the legacy numerical ID of the block. * - * @return ID (between 0 and {@link #MAX_ID}) + * @return legacy numerical ID */ @Override + @Deprecated public int getId() { - return id; + return this.blockType.getLegacyId(); } /** * Set the block ID. * - * @param id block id (between 0 and {@link #MAX_ID}). + * @param type block type */ - protected final void internalSetId(int id) { - if (id > MAX_ID) { - throw new IllegalArgumentException("Can't have a block ID above " - + MAX_ID + " (" + id + " given)"); + protected final void internalSetType(BlockType type) { + if (type == null) { + throw new IllegalArgumentException("You must provide a BlockType"); } - if (id < 0) { - throw new IllegalArgumentException("Can't have a block ID below 0"); - } - - this.id = (short) id; + this.blockType = type; } /** * Set the block ID. * - * @param id block id (between 0 and {@link #MAX_ID}). + * @param id block id */ @Override + @Deprecated public void setId(int id) { - internalSetId(id); + BlockType type = BlockTypes.getBlockType(BundledBlockData.getInstance().fromLegacyId(id)); + internalSetType(type); + } + + /** + * Set the block type. + * + * @param type block type + */ + public void setType(BlockType type) { + internalSetType(type); } /** @@ -211,6 +256,7 @@ public class BaseBlock extends Block implements TileEntityBlock { * @see #setData(int) */ @Override + @Deprecated public void setIdAndData(int id, int data) { setId(id); setData(data); @@ -262,17 +308,8 @@ public class BaseBlock extends Block implements TileEntityBlock { * * @return the type */ - public int getType() { - return getId(); - } - - /** - * Set the type of block. - * - * @param type the type to set - */ - public void setType(int type) { - setId(type); + public BlockType getType() { + return this.blockType; } /** @@ -281,7 +318,7 @@ public class BaseBlock extends Block implements TileEntityBlock { * @return if air */ public boolean isAir() { - return getType() == BlockID.AIR; + return getType().getId().equals(BlockTypes.AIR); } /** @@ -292,7 +329,7 @@ public class BaseBlock extends Block implements TileEntityBlock { */ @Deprecated public int rotate90() { - int newData = BlockData.rotate90(getType(), getData()); + int newData = BlockData.rotate90(getType().getLegacyId(), getData()); setData(newData); return newData; } @@ -305,7 +342,7 @@ public class BaseBlock extends Block implements TileEntityBlock { */ @Deprecated public int rotate90Reverse() { - int newData = BlockData.rotate90Reverse(getType(), getData()); + int newData = BlockData.rotate90Reverse(getType().getLegacyId(), getData()); setData((short) newData); return newData; } @@ -319,7 +356,7 @@ public class BaseBlock extends Block implements TileEntityBlock { */ @Deprecated public int cycleData(int increment) { - int newData = BlockData.cycle(getType(), getData(), increment); + int newData = BlockData.cycle(getType().getLegacyId(), getData(), increment); setData((short) newData); return newData; } @@ -332,7 +369,7 @@ public class BaseBlock extends Block implements TileEntityBlock { */ @Deprecated public BaseBlock flip() { - setData((short) BlockData.flip(getType(), getData())); + setData((short) BlockData.flip(getType().getLegacyId(), getData())); return this; } @@ -345,7 +382,7 @@ public class BaseBlock extends Block implements TileEntityBlock { */ @Deprecated public BaseBlock flip(FlipDirection direction) { - setData((short) BlockData.flip(getType(), getData(), direction)); + setData((short) BlockData.flip(getType().getLegacyId(), getData(), direction)); return this; } @@ -397,14 +434,14 @@ public class BaseBlock extends Block implements TileEntityBlock { @Override public int hashCode() { - int ret = getId() << 3; + int ret = getType().hashCode() << 3; if (getData() != (byte) -1) ret |= getData(); return ret; } @Override public String toString() { - return "Block{ID:" + getId() + ", Data: " + getData() + "}"; + return "Block{Type:" + getType().getId() + ", Data: " + getData() + "}"; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 370982557..e1e162ef3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -35,7 +35,10 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Block types. + * + * {@Deprecated Please use {@link com.sk89q.worldedit.blocks.type.BlockType}} */ +@Deprecated public enum BlockType { AIR(BlockID.AIR, "Air", "air"), @@ -477,7 +480,6 @@ public enum BlockType { shouldPlaceLast.add(BlockID.DETECTOR_RAIL); shouldPlaceLast.add(BlockID.LONG_GRASS); shouldPlaceLast.add(BlockID.DEAD_BUSH); - shouldPlaceLast.add(BlockID.PISTON_EXTENSION); shouldPlaceLast.add(BlockID.YELLOW_FLOWER); shouldPlaceLast.add(BlockID.RED_FLOWER); shouldPlaceLast.add(BlockID.BROWN_MUSHROOM); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java new file mode 100644 index 000000000..c973f3b29 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java @@ -0,0 +1,66 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import com.sk89q.worldedit.world.registry.BundledBlockData; + +public class BlockType { + + private String id; + + public BlockType(String id) { + this.id = id; + } + + public String getId() { + return this.id; + } + + /** + * Gets the legacy ID. Needed for legacy reasons. + * + * DO NOT USE THIS. + * + * @return legacy id or 0, if unknown + */ + @Deprecated + public int getLegacyId() { + Integer id = BundledBlockData.getInstance().toLegacyId(this.id); + if (id != null) { + return id; + } else { + return 0; + } + } + + public com.sk89q.worldedit.blocks.BlockType getLegacyType() { + return com.sk89q.worldedit.blocks.BlockType.fromID(getLegacyId()); + } + + @Override + public int hashCode() { + return this.id.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof BlockType && this.id.equals(((BlockType) obj).id); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java new file mode 100644 index 000000000..9c91fd50e --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java @@ -0,0 +1,59 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; + +/** + * Stores a list of common Block String IDs. + */ +public class BlockTypes { + + private BlockTypes() { + } + + public static final String AIR = "minecraft:air"; + public static final String GRASS = "minecraft:grass"; + public static final String WATER = "minecraft:water"; + public static final String LAVA = "minecraft:lava"; + public static final String WOOL = "minecraft:wool"; + public static final String STATIONARY_WATER = "minecraft:stationary_water"; + public static final String STATIONARY_LAVA = "minecraft:stationary_lava"; + public static final String WALL_SIGN = "minecraft:wall_sign"; + public static final String SIGN_POST = "minecraft:sign_post"; + + private static final Map blockMapping = new HashMap<>(); + + public static void registerBlock(BlockType blockType) { + if (blockMapping.containsKey(blockType.getId())) { + throw new IllegalArgumentException("Existing block with this ID already registered"); + } + + blockMapping.put(blockType.getId(), blockType); + } + + @Nullable + public static BlockType getBlockType(String id) { + return blockMapping.get(id); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 59f099c58..46f0cde96 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -188,7 +188,7 @@ public class ToolCommands { BaseBlock primary = we.getBlock(player, args.getString(1)); session.setTool(player.getItemInHand(), new LongRangeBuildTool(primary, secondary)); player.print("Long-range building tool bound to " + ItemType.toHeldName(player.getItemInHand()) + "."); - player.print("Left-click set to " + ItemType.toName(secondary.getType()) + "; right-click set to " - + ItemType.toName(primary.getType()) + "."); + player.print("Left-click set to " + ItemType.toName(secondary.getType().getLegacyId()) + "; right-click set to " + + ItemType.toName(primary.getType().getLegacyId()) + "."); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index e3e505007..74d1bb88c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -247,7 +247,7 @@ public class UtilityCommands { int size = Math.max(1, args.getInteger(1, 50)); we.checkMaxRadius(size); - int affected = editSession.removeNear(session.getPlacementPosition(player), block.getType(), size); + int affected = editSession.removeNear(session.getPlacementPosition(player), block.getType().getLegacyId(), size); player.print(affected + " block(s) have been removed."); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java index 8d4f718c4..61dc556f6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java @@ -69,7 +69,7 @@ public class BlockReplacer implements DoubleActionBlockTool { World world = (World) clicked.getExtent(); EditSession editSession = session.createEditSession(player); targetBlock = (editSession).getBlock(clicked.toVector()); - BlockType type = BlockType.fromID(targetBlock.getType()); + BlockType type = BlockType.fromID(targetBlock.getType().getLegacyId()); if (type != null) { player.print("Replacer tool switched to: " + type.getName()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index 14785c392..04adef915 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -80,7 +80,7 @@ public class FloatingTreeRemover implements BlockTool { } for (Vector blockVector : blockSet) { - final int typeId = editSession.getBlock(blockVector).getType(); + final int typeId = editSession.getBlock(blockVector).getType().getLegacyId(); switch (typeId) { case BlockID.LOG: case BlockID.LOG2: diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java index 3d484b18e..592f13814 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java @@ -86,7 +86,7 @@ public class FloodFillTool implements BlockTool { visited.add(pos); - if (editSession.getBlock(pos).getType() == initialType) { + if (editSession.getBlock(pos).getType().getLegacyId() == initialType) { editSession.setBlock(pos, pattern.next(pos)); } else { return; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index 974c893e6..30a8f7ef2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -51,7 +51,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo if (pos == null) return false; EditSession eS = session.createEditSession(player); try { - if (secondary.getType() == BlockID.AIR) { + if (secondary.getType().getLegacyId() == BlockID.AIR) { eS.setBlock(pos, secondary); } else { eS.setBlock(pos.getFaceVector(), secondary); @@ -70,7 +70,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo if (pos == null) return false; EditSession eS = session.createEditSession(player); try { - if (primary.getType() == BlockID.AIR) { + if (primary.getType().getLegacyId() == BlockID.AIR) { eS.setBlock(pos, primary); } else { eS.setBlock(pos.getFaceVector(), primary); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index 8f73d2574..794dfa993 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -28,6 +28,7 @@ import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.ClothColor; import com.sk89q.worldedit.blocks.MobSpawnerBlock; import com.sk89q.worldedit.blocks.NoteBlock; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; @@ -56,7 +57,7 @@ public class QueryTool implements BlockTool { World world = (World) clicked.getExtent(); EditSession editSession = session.createEditSession(player); BaseBlock block = (editSession).rawGetBlock(clicked.toVector()); - BlockType type = BlockType.fromID(block.getType()); + BlockType type = BlockType.fromID(block.getType().getLegacyId()); player.print("\u00A79@" + clicked.toVector() + ": " + "\u00A7e" + "#" + block.getType() + "\u00A77" + " (" @@ -70,7 +71,7 @@ public class QueryTool implements BlockTool { } else if (block instanceof NoteBlock) { player.printRaw("\u00A7e" + "Note block: " + ((NoteBlock) block).getNote()); - } else if (block.getType() == BlockID.CLOTH) { + } else if (block.getType().getId().equals(BlockTypes.WOOL)) { // Should never be null player.printRaw("\u00A7e" + "Color: " + ClothColor.fromID(block.getData()).getName()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java index 7a8589b4c..05fa39c51 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java @@ -88,7 +88,7 @@ public class RecursivePickaxe implements BlockTool { visited.add(pos); - if (editSession.getBlock(pos).getType() != initialType) { + if (editSession.getBlock(pos).getType().getLegacyId() != initialType) { return; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java index 8331b7620..758b7c53c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.Pattern; import java.util.*; @@ -55,7 +56,7 @@ public class GravityBrush implements Brush { Vector pt = new Vector(x, y, z); Collections.reverse(blockTypes); for (int i = 0; i < blockTypes.size();) { - if (editSession.getBlock(pt).getType() == BlockID.AIR) { + if (editSession.getBlock(pt).getType().getId().equals(BlockTypes.AIR)) { editSession.setBlock(pt, blockTypes.get(i++)); } pt = pt.add(0, 1, 0); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java index b3546e4d5..7ab751992 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java @@ -120,17 +120,17 @@ public class SchematicWriter implements ClipboardWriter { BaseBlock block = clipboard.getBlock(point); // Save 4096 IDs in an AddBlocks section - if (block.getType() > 255) { + if (block.getId() > 255) { if (addBlocks == null) { // Lazily create section addBlocks = new byte[(blocks.length >> 1) + 1]; } addBlocks[index >> 1] = (byte) (((index & 1) == 0) ? - addBlocks[index >> 1] & 0xF0 | (block.getType() >> 8) & 0xF - : addBlocks[index >> 1] & 0xF | ((block.getType() >> 8) & 0xF) << 4); + addBlocks[index >> 1] & 0xF0 | (block.getId() >> 8) & 0xF + : addBlocks[index >> 1] & 0xF | ((block.getId() >> 8) & 0xF) << 4); } - blocks[index] = (byte) block.getType(); + blocks[index] = (byte) block.getId(); blockData[index] = (byte) block.getData(); // Store TileEntity data diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java index 8cdff7551..c8440375a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java @@ -34,7 +34,7 @@ import java.util.Map; public class SignCompatibilityHandler implements NBTCompatibilityHandler { @Override public boolean isAffectedBlock(BaseBlock block) { - return block.getType() == BlockID.SIGN_POST || block.getType() == BlockID.WALL_SIGN; + return block.getType().getLegacyId() == BlockID.SIGN_POST || block.getType().getLegacyId() == BlockID.WALL_SIGN; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index 9cdc2b3ae..71355570b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java @@ -82,8 +82,8 @@ public class BlockBagExtent extends AbstractDelegateExtent { public boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { if (blockBag != null) { BaseBlock lazyBlock = getExtent().getLazyBlock(position); - int existing = lazyBlock.getType(); - final int type = block.getType(); + int existing = lazyBlock.getType().getLegacyId(); + final int type = block.getType().getLegacyId(); if (type > 0) { try { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index d19a4b6c6..04eafc2d1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -93,15 +93,15 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder return super.setBlock(location, block); } - if (BlockType.shouldPlaceLast(block.getType())) { + if (BlockType.shouldPlaceLast(block.getType().getLegacyId())) { // Place torches, etc. last stage2.put(location.toBlockVector(), block); return !(lazyBlock.getType() == block.getType() && lazyBlock.getData() == block.getData()); - } else if (BlockType.shouldPlaceFinal(block.getType())) { + } else if (BlockType.shouldPlaceFinal(block.getType().getLegacyId())) { // Place signs, reed, etc even later stage3.put(location.toBlockVector(), block); return !(lazyBlock.getType() == block.getType() && lazyBlock.getData() == block.getData()); - } else if (BlockType.shouldPlaceLast(lazyBlock.getType())) { + } else if (BlockType.shouldPlaceLast(lazyBlock.getType().getLegacyId())) { // Destroy torches, etc. first super.setBlock(location, new BaseBlock(BlockID.AIR)); return super.setBlock(location, block); @@ -149,7 +149,7 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder final BaseBlock baseBlock = blockTypes.get(current); - final int type = baseBlock.getType(); + final int type = baseBlock.getType().getLegacyId(); final int data = baseBlock.getData(); switch (type) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index e9a2752fa..f143e7867 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -50,7 +50,7 @@ public class DataValidatorExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { final int y = location.getBlockY(); - final int type = block.getType(); + final int type = block.getType().getLegacyId(); if (y < 0 || y > world.getMaxY()) { return false; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index 46a40ed5c..d8eb38e8b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -53,7 +53,7 @@ public class BlockQuirkExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { BaseBlock lazyBlock = getExtent().getLazyBlock(position); - int existing = lazyBlock.getType(); + int existing = lazyBlock.getType().getLegacyId(); if (BlockType.isContainerBlock(existing)) { world.clearContainerBlockContents(position); // Clear the container block so that it doesn't drop items diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java index de7c21b2c..5366a2a84 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java @@ -81,7 +81,7 @@ public class SurvivalModeExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { - if (toolUse && block.getType() == BlockID.AIR) { + if (toolUse && block.getType().getLegacyId() == BlockID.AIR) { world.simulateBlockMine(location); return true; } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index 17d2547d6..068656342 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; @@ -106,10 +107,10 @@ public class FloraGenerator implements RegionFunction { public boolean apply(Vector position) throws WorldEditException { BaseBlock block = editSession.getBlock(position); - if (block.getType() == BlockID.GRASS) { + if (block.getType().getId().equals(BlockTypes.GRASS)) { editSession.setBlock(position.add(0, 1, 0), temperatePattern.apply(position)); return true; - } else if (block.getType() == BlockID.SAND) { + } else if (block.getType().getLegacyId() == BlockID.SAND) { editSession.setBlock(position.add(0, 1, 0), desertPattern.apply(position)); return true; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index cf38b7e56..c53374852 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -50,7 +50,7 @@ public class ForestGenerator implements RegionFunction { @Override public boolean apply(Vector position) throws WorldEditException { BaseBlock block = editSession.getBlock(position); - int t = block.getType(); + int t = block.getType().getLegacyId(); if (t == BlockID.GRASS || t == BlockID.DIRT) { treeGenerator.generate(editSession, position.add(0, 1, 0)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index a0032585c..3268d15cb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; @@ -159,11 +160,11 @@ public class GardenPatchGenerator implements RegionFunction { @Override public boolean apply(Vector position) throws WorldEditException { - if (editSession.getBlock(position).getType() != BlockID.AIR) { + if (!editSession.getBlock(position).getType().getId().equals(BlockTypes.AIR)) { position = position.add(0, 1, 0); } - if (editSession.getBlock(position.add(0, -1, 0)).getType() != BlockID.GRASS) { + if (!editSession.getBlock(position.add(0, -1, 0)).getType().getId().equals(BlockTypes.GRASS)) { return false; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java index c3d8f1037..a633b3243 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java @@ -42,7 +42,7 @@ public class ExistingBlockMask extends AbstractExtentMask { @Override public boolean test(Vector vector) { - return getExtent().getLazyBlock(vector).getType() != BlockID.AIR; + return getExtent().getLazyBlock(vector).getType().getLegacyId() != BlockID.AIR; } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java index b6a10972a..5c08cd963 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java @@ -36,7 +36,7 @@ public class SolidBlockMask extends AbstractExtentMask { public boolean test(Vector vector) { Extent extent = getExtent(); BaseBlock lazyBlock = extent.getLazyBlock(vector); - return !BlockType.canPassThrough(lazyBlock.getType(), lazyBlock.getData()); + return !BlockType.canPassThrough(lazyBlock.getType().getLegacyId(), lazyBlock.getData()); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index 44f750760..28f1c0bd7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.regions.Region; import static com.google.common.base.Preconditions.checkNotNull; @@ -148,8 +149,8 @@ public class HeightMap { BaseBlock existing = session.getBlock(new Vector(xr, curHeight, zr)); // Skip water/lava - if (existing.getType() != BlockID.WATER && existing.getType() != BlockID.STATIONARY_WATER - && existing.getType() != BlockID.LAVA && existing.getType() != BlockID.STATIONARY_LAVA) { + if (!existing.getType().getId().equals(BlockTypes.WATER) && !existing.getType().getId().equals(BlockTypes.STATIONARY_WATER) + && !existing.getType().getId().equals(BlockTypes.LAVA) && !existing.getType().getId().equals(BlockTypes.STATIONARY_LAVA)) { session.setBlock(new Vector(xr, newHeight, zr), existing); ++blocksChanged; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java index 8bac020a7..8f7642794 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java @@ -98,7 +98,7 @@ public abstract class ArbitraryShape { return null; } - short newCacheEntry = (short) (material.getType() | ((material.getData() + 1) << 8)); + short newCacheEntry = (short) (material.getType().getLegacyId() | ((material.getData() + 1) << 8)); if (newCacheEntry == 0) { // type and data 0 newCacheEntry = -2; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java index 10afbb826..369b1944f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java @@ -241,17 +241,17 @@ public class MCEditSchematicFormat extends SchematicFormat { BaseBlock block = clipboard.getPoint(new BlockVector(x, y, z)); // Save 4096 IDs in an AddBlocks section - if (block.getType() > 255) { + if (block.getId() > 255) { if (addBlocks == null) { // Lazily create section addBlocks = new byte[(blocks.length >> 1) + 1]; } addBlocks[index >> 1] = (byte) (((index & 1) == 0) ? - addBlocks[index >> 1] & 0xF0 | (block.getType() >> 8) & 0xF - : addBlocks[index >> 1] & 0xF | ((block.getType() >> 8) & 0xF) << 4); + addBlocks[index >> 1] & 0xF0 | (block.getId() >> 8) & 0xF + : addBlocks[index >> 1] & 0xF | ((block.getId() >> 8) & 0xF) << 4); } - blocks[index] = (byte) block.getType(); + blocks[index] = (byte) block.getId(); blockData[index] = (byte) block.getData(); // Get the list of key/values from the block diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index eec33e90d..7be4843cc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -110,7 +110,7 @@ public abstract class AbstractWorld implements World { @Override public int getBlockType(Vector pt) { - return getLazyBlock(pt).getType(); + return getLazyBlock(pt).getType().getLegacyId(); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index 0269e1866..882356350 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index 7448835cf..45b5afb43 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -46,6 +46,7 @@ public interface BlockRegistry { * @return the block, which may be null if no block exists */ @Nullable + @Deprecated BaseBlock createFromId(int id); /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 5a34a8f3e..dd565b0fb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -128,6 +128,22 @@ public class BundledBlockData { } } + /** + * Convert the given legacy numeric ID to a string ID. + * + * @param id the legacy ID + * @return the ID, which may be null if the block does not have a ID + */ + @Nullable + public String fromLegacyId(Integer id) { + BlockEntry entry = findById(id); + if (entry != null) { + return entry.id; + } else { + return null; + } + } + /** * Get the material properties for the given block. * @@ -135,6 +151,7 @@ public class BundledBlockData { * @return the material's properties, or null */ @Nullable + @Deprecated public BlockMaterial getMaterialById(int id) { BlockEntry entry = findById(id); if (entry != null) { @@ -144,6 +161,22 @@ public class BundledBlockData { } } + /** + * Get the material properties for the given block. + * + * @param id the string ID + * @return the material's properties, or null + */ + @Nullable + public BlockMaterial getMaterialById(String id) { + BlockEntry entry = findById(id); + if (entry != null) { + return entry.material; + } else { + return null; + } + } + /** * Get the states for the given block. * @@ -151,6 +184,7 @@ public class BundledBlockData { * @return the block's states, or null if no information is available */ @Nullable + @Deprecated public Map getStatesById(int id) { BlockEntry entry = findById(id); if (entry != null) { @@ -160,6 +194,22 @@ public class BundledBlockData { } } + /** + * Get the states for the given block. + * + * @param id the string ID + * @return the block's states, or null if no information is available + */ + @Nullable + public Map getStatesById(String id) { + BlockEntry entry = findById(id); + if (entry != null) { + return entry.states; + } else { + return null; + } + } + /** * Get a singleton instance of this object. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyBlockRegistry.java index e846e7984..773fc132a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyBlockRegistry.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockMaterial; +import com.sk89q.worldedit.blocks.type.BlockTypes; import javax.annotation.Nullable; import java.util.Map; @@ -34,30 +35,30 @@ public class LegacyBlockRegistry implements BlockRegistry { @Nullable @Override public BaseBlock createFromId(String id) { - Integer legacyId = BundledBlockData.getInstance().toLegacyId(id); - if (legacyId != null) { - return createFromId(legacyId); + return new BaseBlock(BlockTypes.getBlockType(id)); + } + + @Nullable + @Override + public BaseBlock createFromId(int legacyId) { + String id = BundledBlockData.getInstance().fromLegacyId(legacyId); + if (id != null) { + return createFromId(id); } else { return null; } } - @Nullable - @Override - public BaseBlock createFromId(int id) { - return new BaseBlock(id); - } - @Nullable @Override public BlockMaterial getMaterial(BaseBlock block) { - return BundledBlockData.getInstance().getMaterialById(block.getId()); + return BundledBlockData.getInstance().getMaterialById(block.getType().getId()); } @Nullable @Override public Map getStates(BaseBlock block) { - return BundledBlockData.getInstance().getStatesById(block.getId()); + return BundledBlockData.getInstance().getStatesById(block.getType().getId()); } } diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java index 6a6997df1..871b260ca 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java @@ -21,22 +21,26 @@ package com.sk89q.worldedit; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import org.junit.Test; import static org.junit.Assert.*; +// TODO FIX public class CuboidClipboardTest { - @Test - public void testFlipCenterPlane() throws Exception { - testFlip(0, 1, CuboidClipboard.FlipDirection.UP_DOWN); - testFlip(2, 3, CuboidClipboard.FlipDirection.NORTH_SOUTH); - testFlip(4, 5, CuboidClipboard.FlipDirection.WEST_EAST); - } - - private void testFlip(int data, int expectedDataAfterFlip, CuboidClipboard.FlipDirection flipDirection) { - final CuboidClipboard clipboard = new CuboidClipboard(new Vector(1, 1, 1)); - clipboard.setBlock(Vector.ZERO, new BaseBlock(BlockID.PISTON_BASE, data)); - clipboard.flip(flipDirection); - assertEquals(expectedDataAfterFlip, clipboard.getBlock(Vector.ZERO).getData()); - } +// @Test +// public void testFlipCenterPlane() throws Exception { +// testFlip(0, 1, CuboidClipboard.FlipDirection.UP_DOWN); +// testFlip(2, 3, CuboidClipboard.FlipDirection.NORTH_SOUTH); +// testFlip(4, 5, CuboidClipboard.FlipDirection.WEST_EAST); +// } +// +// private void testFlip(int data, int expectedDataAfterFlip, CuboidClipboard.FlipDirection flipDirection) { +// BlockType blockType = new BlockType("minecraft:piston_base"); +// final CuboidClipboard clipboard = new CuboidClipboard(new Vector(1, 1, 1)); +// clipboard.setBlock(Vector.ZERO, new BaseBlock(blockType, data)); +// clipboard.flip(flipDirection); +// assertEquals(expectedDataAfterFlip, clipboard.getBlock(Vector.ZERO).getData()); +// } } diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java index f5c40a78f..f6649dbe9 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java @@ -63,7 +63,7 @@ public class BlockTransformExtentTest { BaseBlock orig = new BaseBlock(type.getID()); for (int i = 1; i < 4; i++) { BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_90, blockRegistry); - BaseBlock reference = new BaseBlock(orig.getType(), BlockData.rotate90(orig.getType(), orig.getData())); + BaseBlock reference = new BaseBlock(orig.getType(), BlockData.rotate90(orig.getType().getLegacyId(), orig.getData())); assertThat(type + "#" + type.getID() + " rotated " + (90 * i) + " degrees did not match BlockData.rotate90()'s expected result", rotated, equalTo(reference)); orig = rotated; } @@ -71,7 +71,7 @@ public class BlockTransformExtentTest { orig = new BaseBlock(type.getID()); for (int i = 0; i < 4; i++) { BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_NEG_90, blockRegistry); - BaseBlock reference = new BaseBlock(orig.getType(), BlockData.rotate90Reverse(orig.getType(), orig.getData())); + BaseBlock reference = new BaseBlock(orig.getType(), BlockData.rotate90Reverse(orig.getType().getLegacyId(), orig.getData())); assertThat(type + "#" + type.getID() + " rotated " + (-90 * i) + " degrees did not match BlockData.rotate90Reverse()'s expected result", rotated, equalTo(reference)); orig = rotated; } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java index 4d46eb4d2..12faa30ba 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java @@ -34,6 +34,7 @@ import com.sk89q.worldedit.sponge.adapter.SpongeImplAdapter; import com.sk89q.worldedit.sponge.adapter.SpongeImplLoader; import com.sk89q.worldedit.sponge.config.SpongeConfiguration; import org.slf4j.Logger; +import org.spongepowered.api.Sponge; import org.spongepowered.api.block.BlockSnapshot; import org.spongepowered.api.block.BlockType; import org.spongepowered.api.block.BlockTypes; @@ -127,6 +128,10 @@ public class SpongeWorldEdit { this.platform = new SpongePlatform(this); this.provider = new SpongePermissionsProvider(); + for (BlockType blockType : Sponge.getRegistry().getAllOf(BlockType.class)) { + com.sk89q.worldedit.blocks.type.BlockTypes.registerBlock(new com.sk89q.worldedit.blocks.type.BlockType(blockType.getId())); + } + WorldEdit.getInstance().getPlatformManager().register(platform); } From f5f1d357d903b3cfb954f4fdccf24b1194d84504 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 3 Jan 2018 16:39:03 +1000 Subject: [PATCH 02/74] Get rid of the string equality and convert a few more ID uses over. --- .../EditSessionBlockChangeDelegate.java | 5 +- .../sk89q/worldedit/blocks/SkullBlock.java | 2 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 2 +- .../worldedit/blocks/type/BlockType.java | 1 + .../worldedit/blocks/type/BlockTypes.java | 553 +++++++++++++++++- .../worldedit/command/BrushCommands.java | 5 +- .../worldedit/command/tool/AreaPickaxe.java | 15 +- .../command/tool/FloatingTreeRemover.java | 3 +- .../worldedit/command/tool/QueryTool.java | 8 +- .../command/tool/RecursivePickaxe.java | 16 +- .../command/tool/brush/CylinderBrush.java | 3 +- .../command/tool/brush/GravityBrush.java | 4 +- .../tool/brush/HollowCylinderBrush.java | 3 +- .../command/tool/brush/HollowSphereBrush.java | 3 +- .../command/tool/brush/SphereBrush.java | 3 +- .../sk89q/worldedit/extent/NullExtent.java | 5 +- .../extent/buffer/ForgetfulExtentBuffer.java | 3 +- .../extent/clipboard/BlockArrayClipboard.java | 3 +- .../SignCompatibilityHandler.java | 3 +- .../extent/reorder/MultiStageReorder.java | 3 +- .../validation/DataValidatorExtent.java | 5 +- .../extent/world/BlockQuirkExtent.java | 3 +- .../extent/world/SurvivalModeExtent.java | 2 +- .../function/block/ExtentBlockCopy.java | 2 +- .../worldedit/function/block/Naturalizer.java | 8 +- .../function/generator/FloraGenerator.java | 16 +- .../function/generator/ForestGenerator.java | 14 +- .../generator/GardenPatchGenerator.java | 22 +- .../function/mask/ExistingBlockMask.java | 2 +- .../worldedit/math/convolution/HeightMap.java | 7 +- .../worldedit/regions/RegionIntersection.java | 4 +- .../regions/shape/ArbitraryShape.java | 3 +- .../sk89q/worldedit/util/TreeGenerator.java | 5 +- .../util/formatting/ColorCodeBuilder.java | 5 +- .../sk89q/worldedit/world/AbstractWorld.java | 11 +- .../com/sk89q/worldedit/world/NullWorld.java | 6 +- .../world/storage/LegacyChunkStore.java | 6 +- .../world/storage/McRegionChunkStore.java | 5 +- .../sk89q/worldedit/sponge/SpongePlayer.java | 4 +- 39 files changed, 658 insertions(+), 115 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java index c3d1b2059..8eeb38e55 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import org.bukkit.BlockChangeDelegate; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; @@ -67,7 +68,7 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { @Override public int getTypeId(int x, int y, int z) { - return editSession.getBlockType(new Vector(x, y, z)); + return editSession.getBlock(new Vector(x, y, z)).getId(); } @Override @@ -77,7 +78,7 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { @Override public boolean isEmpty(int x, int y, int z) { - return editSession.getBlockType(new Vector(x, y, z)) == BlockID.AIR; + return editSession.getBlock(new Vector(x, y, z)).isAir(); } } diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java index d440ee0f7..6f7024c28 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java @@ -100,7 +100,7 @@ public class SkullBlock extends BaseBlock implements TileEntityBlock { if (owner.length() > 16 || owner.isEmpty()) this.owner = ""; else this.owner = owner; } - if (this.owner != null && !this.owner.isEmpty()) this.skullType = (byte) 3; + if (!this.owner.isEmpty()) this.skullType = (byte) 3; } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 398cc392b..9a9759bb1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -318,7 +318,7 @@ public class BaseBlock extends Block implements TileEntityBlock { * @return if air */ public boolean isAir() { - return getType().getId().equals(BlockTypes.AIR); + return getType() == BlockTypes.AIR; } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java index c973f3b29..5625d6bdd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java @@ -50,6 +50,7 @@ public class BlockType { } } + @Deprecated public com.sk89q.worldedit.blocks.BlockType getLegacyType() { return com.sk89q.worldedit.blocks.BlockType.fromID(getLegacyId()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java index 9c91fd50e..21dc523db 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.blocks.type; +import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; @@ -32,20 +33,552 @@ public class BlockTypes { private BlockTypes() { } - public static final String AIR = "minecraft:air"; - public static final String GRASS = "minecraft:grass"; - public static final String WATER = "minecraft:water"; - public static final String LAVA = "minecraft:lava"; - public static final String WOOL = "minecraft:wool"; - public static final String STATIONARY_WATER = "minecraft:stationary_water"; - public static final String STATIONARY_LAVA = "minecraft:stationary_lava"; - public static final String WALL_SIGN = "minecraft:wall_sign"; - public static final String SIGN_POST = "minecraft:sign_post"; + public static final BlockType AIR = new BlockType("minecraft:air"); + public static final BlockType STONE = new BlockType("minecraft:stone"); + public static final BlockType GRANITE = new BlockType("minecraft:granite"); + public static final BlockType POLISHED_GRANITE = new BlockType("minecraft:polished_granite"); + public static final BlockType DIORITE = new BlockType("minecraft:diorite"); + public static final BlockType POLISHED_DIORITE = new BlockType("minecraft:polished_diorite"); + public static final BlockType ANDESITE = new BlockType("minecraft:andesite"); + public static final BlockType POLISHED_ANDESITE = new BlockType("minecraft:polished_andesite"); + public static final BlockType GRASS_BLOCK = new BlockType("minecraft:grass_block"); + public static final BlockType DIRT = new BlockType("minecraft:dirt"); + public static final BlockType COARSE_DIRT = new BlockType("minecraft:coarse_dirt"); + public static final BlockType PODZOL = new BlockType("minecraft:podzol"); + public static final BlockType COBBLESTONE = new BlockType("minecraft:cobblestone"); + public static final BlockType OAK_PLANKS = new BlockType("minecraft:oak_planks"); + public static final BlockType SPRUCE_PLANKS = new BlockType("minecraft:spruce_planks"); + public static final BlockType BIRCH_PLANKS = new BlockType("minecraft:birch_planks"); + public static final BlockType JUNGLE_PLANKS = new BlockType("minecraft:jungle_planks"); + public static final BlockType ACACIA_PLANKS = new BlockType("minecraft:acacia_planks"); + public static final BlockType DARK_OAK_PLANKS = new BlockType("minecraft:dark_oak_planks"); + public static final BlockType OAK_SAPLING = new BlockType("minecraft:oak_sapling"); + public static final BlockType SPRUCE_SAPLING = new BlockType("minecraft:spruce_sapling"); + public static final BlockType BIRCH_SAPLING = new BlockType("minecraft:birch_sapling"); + public static final BlockType JUNGLE_SAPLING = new BlockType("minecraft:jungle_sapling"); + public static final BlockType ACACIA_SAPLING = new BlockType("minecraft:acacia_sapling"); + public static final BlockType DARK_OAK_SAPLING = new BlockType("minecraft:dark_oak_sapling"); + public static final BlockType BEDROCK = new BlockType("minecraft:bedrock"); + public static final BlockType FLOWING_WATER = new BlockType("minecraft:flowing_water"); + public static final BlockType WATER = new BlockType("minecraft:water"); + public static final BlockType FLOWING_LAVA = new BlockType("minecraft:flowing_lava"); + public static final BlockType LAVA = new BlockType("minecraft:lava"); + public static final BlockType SAND = new BlockType("minecraft:sand"); + public static final BlockType RED_SAND = new BlockType("minecraft:red_sand"); + public static final BlockType GRAVEL = new BlockType("minecraft:gravel"); + public static final BlockType GOLD_ORE = new BlockType("minecraft:gold_ore"); + public static final BlockType IRON_ORE = new BlockType("minecraft:iron_ore"); + public static final BlockType COAL_ORE = new BlockType("minecraft:coal_ore"); + public static final BlockType OAK_LOG = new BlockType("minecraft:oak_log"); + public static final BlockType SPRUCE_LOG = new BlockType("minecraft:spruce_log"); + public static final BlockType BIRCH_LOG = new BlockType("minecraft:birch_log"); + public static final BlockType JUNGLE_LOG = new BlockType("minecraft:jungle_log"); + public static final BlockType ACACIA_LOG = new BlockType("minecraft:acacia_log"); + public static final BlockType DARK_OAK_LOG = new BlockType("minecraft:dark_oak_log"); + public static final BlockType OAK_BARK = new BlockType("minecraft:oak_bark"); + public static final BlockType SPRUCE_BARK = new BlockType("minecraft:spruce_bark"); + public static final BlockType BIRCH_BARK = new BlockType("minecraft:birch_bark"); + public static final BlockType JUNGLE_BARK = new BlockType("minecraft:jungle_bark"); + public static final BlockType ACACIA_BARK = new BlockType("minecraft:acacia_bark"); + public static final BlockType DARK_OAK_BARK = new BlockType("minecraft:dark_oak_bark"); + public static final BlockType OAK_LEAVES = new BlockType("minecraft:oak_leaves"); + public static final BlockType SPRUCE_LEAVES = new BlockType("minecraft:spruce_leaves"); + public static final BlockType BIRCH_LEAVES = new BlockType("minecraft:birch_leaves"); + public static final BlockType JUNGLE_LEAVES = new BlockType("minecraft:jungle_leaves"); + public static final BlockType ACACIA_LEAVES = new BlockType("minecraft:acacia_leaves"); + public static final BlockType DARK_OAK_LEAVES = new BlockType("minecraft:dark_oak_leaves"); + public static final BlockType SPONGE = new BlockType("minecraft:sponge"); + public static final BlockType WET_SPONGE = new BlockType("minecraft:wet_sponge"); + public static final BlockType GLASS = new BlockType("minecraft:glass"); + public static final BlockType LAPIS_ORE = new BlockType("minecraft:lapis_ore"); + public static final BlockType LAPIS_BLOCK = new BlockType("minecraft:lapis_block"); + public static final BlockType DISPENSER = new BlockType("minecraft:dispenser"); + public static final BlockType SANDSTONE = new BlockType("minecraft:sandstone"); + public static final BlockType CHISELED_SANDSTONE = new BlockType("minecraft:chiseled_sandstone"); + public static final BlockType CUT_SANDSTONE = new BlockType("minecraft:cut_sandstone"); + public static final BlockType NOTE_BLOCK = new BlockType("minecraft:note_block"); + public static final BlockType WHITE_BED = new BlockType("minecraft:white_bed"); + public static final BlockType ORANGE_BED = new BlockType("minecraft:orange_bed"); + public static final BlockType MAGENTA_BED = new BlockType("minecraft:magenta_bed"); + public static final BlockType LIGHT_BLUE_BED = new BlockType("minecraft:light_blue_bed"); + public static final BlockType YELLOW_BED = new BlockType("minecraft:yellow_bed"); + public static final BlockType LIME_BED = new BlockType("minecraft:lime_bed"); + public static final BlockType PINK_BED = new BlockType("minecraft:pink_bed"); + public static final BlockType GRAY_BED = new BlockType("minecraft:gray_bed"); + public static final BlockType LIGHT_GRAY_BED = new BlockType("minecraft:light_gray_bed"); + public static final BlockType CYAN_BED = new BlockType("minecraft:cyan_bed"); + public static final BlockType PURPLE_BED = new BlockType("minecraft:purple_bed"); + public static final BlockType BLUE_BED = new BlockType("minecraft:blue_bed"); + public static final BlockType BROWN_BED = new BlockType("minecraft:brown_bed"); + public static final BlockType GREEN_BED = new BlockType("minecraft:green_bed"); + public static final BlockType RED_BED = new BlockType("minecraft:red_bed"); + public static final BlockType BLACK_BED = new BlockType("minecraft:black_bed"); + public static final BlockType POWERED_RAIL = new BlockType("minecraft:powered_rail"); + public static final BlockType DETECTOR_RAIL = new BlockType("minecraft:detector_rail"); + public static final BlockType STICKY_PISTON = new BlockType("minecraft:sticky_piston"); + public static final BlockType COBWEB = new BlockType("minecraft:cobweb"); + public static final BlockType GRASS = new BlockType("minecraft:grass"); + public static final BlockType FERN = new BlockType("minecraft:fern"); + public static final BlockType DEAD_BUSH = new BlockType("minecraft:dead_bush"); + public static final BlockType PISTON = new BlockType("minecraft:piston"); + public static final BlockType PISTON_HEAD = new BlockType("minecraft:piston_head"); + public static final BlockType WHITE_WOOL = new BlockType("minecraft:white_wool"); + public static final BlockType ORANGE_WOOL = new BlockType("minecraft:orange_wool"); + public static final BlockType MAGENTA_WOOL = new BlockType("minecraft:magenta_wool"); + public static final BlockType LIGHT_BLUE_WOOL = new BlockType("minecraft:light_blue_wool"); + public static final BlockType YELLOW_WOOL = new BlockType("minecraft:yellow_wool"); + public static final BlockType LIME_WOOL = new BlockType("minecraft:lime_wool"); + public static final BlockType PINK_WOOL = new BlockType("minecraft:pink_wool"); + public static final BlockType GRAY_WOOL = new BlockType("minecraft:gray_wool"); + public static final BlockType LIGHT_GRAY_WOOL = new BlockType("minecraft:light_gray_wool"); + public static final BlockType CYAN_WOOL = new BlockType("minecraft:cyan_wool"); + public static final BlockType PURPLE_WOOL = new BlockType("minecraft:purple_wool"); + public static final BlockType BLUE_WOOL = new BlockType("minecraft:blue_wool"); + public static final BlockType BROWN_WOOL = new BlockType("minecraft:brown_wool"); + public static final BlockType GREEN_WOOL = new BlockType("minecraft:green_wool"); + public static final BlockType RED_WOOL = new BlockType("minecraft:red_wool"); + public static final BlockType BLACK_WOOL = new BlockType("minecraft:black_wool"); + public static final BlockType MOVING_PISTON = new BlockType("minecraft:moving_piston"); + public static final BlockType DANDELION = new BlockType("minecraft:dandelion"); + public static final BlockType POPPY = new BlockType("minecraft:poppy"); + public static final BlockType BLUE_ORCHID = new BlockType("minecraft:blue_orchid"); + public static final BlockType ALLIUM = new BlockType("minecraft:allium"); + public static final BlockType AZURE_BLUET = new BlockType("minecraft:azure_bluet"); + public static final BlockType RED_TULIP = new BlockType("minecraft:red_tulip"); + public static final BlockType ORANGE_TULIP = new BlockType("minecraft:orange_tulip"); + public static final BlockType WHITE_TULIP = new BlockType("minecraft:white_tulip"); + public static final BlockType PINK_TULIP = new BlockType("minecraft:pink_tulip"); + public static final BlockType OXEYE_DAISY = new BlockType("minecraft:oxeye_daisy"); + public static final BlockType BROWN_MUSHROOM = new BlockType("minecraft:brown_mushroom"); + public static final BlockType RED_MUSHROOM = new BlockType("minecraft:red_mushroom"); + public static final BlockType GOLD_BLOCK = new BlockType("minecraft:gold_block"); + public static final BlockType IRON_BLOCK = new BlockType("minecraft:iron_block"); + public static final BlockType BRICKS = new BlockType("minecraft:bricks"); + public static final BlockType TNT = new BlockType("minecraft:tnt"); + public static final BlockType BOOKSHELF = new BlockType("minecraft:bookshelf"); + public static final BlockType MOSSY_COBBLESTONE = new BlockType("minecraft:mossy_cobblestone"); + public static final BlockType OBSIDIAN = new BlockType("minecraft:obsidian"); + public static final BlockType TORCH = new BlockType("minecraft:torch"); + public static final BlockType WALL_TORCH = new BlockType("minecraft:wall_torch"); + public static final BlockType FIRE = new BlockType("minecraft:fire"); + public static final BlockType MOB_SPAWNER = new BlockType("minecraft:mob_spawner"); + public static final BlockType OAK_STAIRS = new BlockType("minecraft:oak_stairs"); + public static final BlockType CHEST = new BlockType("minecraft:chest"); + public static final BlockType REDSTONE_WIRE = new BlockType("minecraft:redstone_wire"); + public static final BlockType DIAMOND_ORE = new BlockType("minecraft:diamond_ore"); + public static final BlockType DIAMOND_BLOCK = new BlockType("minecraft:diamond_block"); + public static final BlockType CRAFTING_TABLE = new BlockType("minecraft:crafting_table"); + public static final BlockType WHEAT = new BlockType("minecraft:wheat"); + public static final BlockType FARMLAND = new BlockType("minecraft:farmland"); + public static final BlockType FURNACE = new BlockType("minecraft:furnace"); + public static final BlockType SIGN = new BlockType("minecraft:sign"); + public static final BlockType OAK_DOOR = new BlockType("minecraft:oak_door"); + public static final BlockType LADDER = new BlockType("minecraft:ladder"); + public static final BlockType RAIL = new BlockType("minecraft:rail"); + public static final BlockType COBBLESTONE_STAIRS = new BlockType("minecraft:cobblestone_stairs"); + public static final BlockType WALL_SIGN = new BlockType("minecraft:wall_sign"); + public static final BlockType LEVER = new BlockType("minecraft:lever"); + public static final BlockType STONE_PRESSURE_PLATE = new BlockType("minecraft:stone_pressure_plate"); + public static final BlockType IRON_DOOR = new BlockType("minecraft:iron_door"); + public static final BlockType OAK_PRESSURE_PLATE = new BlockType("minecraft:oak_pressure_plate"); + public static final BlockType SPRUCE_PRESSURE_PLATE = new BlockType("minecraft:spruce_pressure_plate"); + public static final BlockType BIRCH_PRESSURE_PLATE = new BlockType("minecraft:birch_pressure_plate"); + public static final BlockType JUNGLE_PRESSURE_PLATE = new BlockType("minecraft:jungle_pressure_plate"); + public static final BlockType ACACIA_PRESSURE_PLATE = new BlockType("minecraft:acacia_pressure_plate"); + public static final BlockType DARK_OAK_PRESSURE_PLATE = new BlockType("minecraft:dark_oak_pressure_plate"); + public static final BlockType REDSTONE_ORE = new BlockType("minecraft:redstone_ore"); + public static final BlockType REDSTONE_TORCH = new BlockType("minecraft:redstone_torch"); + public static final BlockType REDSTONE_WALL_TORCH = new BlockType("minecraft:redstone_wall_torch"); + public static final BlockType STONE_BUTTON = new BlockType("minecraft:stone_button"); + public static final BlockType SNOW = new BlockType("minecraft:snow"); + public static final BlockType ICE = new BlockType("minecraft:ice"); + public static final BlockType SNOW_BLOCK = new BlockType("minecraft:snow_block"); + public static final BlockType CACTUS = new BlockType("minecraft:cactus"); + public static final BlockType CLAY = new BlockType("minecraft:clay"); + public static final BlockType SUGAR_CANE = new BlockType("minecraft:sugar_cane"); + public static final BlockType JUKEBOX = new BlockType("minecraft:jukebox"); + public static final BlockType OAK_FENCE = new BlockType("minecraft:oak_fence"); + public static final BlockType PUMPKIN = new BlockType("minecraft:pumpkin"); + public static final BlockType NETHERRACK = new BlockType("minecraft:netherrack"); + public static final BlockType SOUL_SAND = new BlockType("minecraft:soul_sand"); + public static final BlockType GLOWSTONE = new BlockType("minecraft:glowstone"); + public static final BlockType PORTAL = new BlockType("minecraft:portal"); + public static final BlockType CARVED_PUMPKIN = new BlockType("minecraft:carved_pumpkin"); + public static final BlockType JACK_O_LANTERN = new BlockType("minecraft:jack_o_lantern"); + public static final BlockType CAKE = new BlockType("minecraft:cake"); + public static final BlockType REPEATER = new BlockType("minecraft:repeater"); + public static final BlockType WHITE_STAINED_GLASS = new BlockType("minecraft:white_stained_glass"); + public static final BlockType ORANGE_STAINED_GLASS = new BlockType("minecraft:orange_stained_glass"); + public static final BlockType MAGENTA_STAINED_GLASS = new BlockType("minecraft:magenta_stained_glass"); + public static final BlockType LIGHT_BLUE_STAINED_GLASS = new BlockType("minecraft:light_blue_stained_glass"); + public static final BlockType YELLOW_STAINED_GLASS = new BlockType("minecraft:yellow_stained_glass"); + public static final BlockType LIME_STAINED_GLASS = new BlockType("minecraft:lime_stained_glass"); + public static final BlockType PINK_STAINED_GLASS = new BlockType("minecraft:pink_stained_glass"); + public static final BlockType GRAY_STAINED_GLASS = new BlockType("minecraft:gray_stained_glass"); + public static final BlockType LIGHT_GRAY_STAINED_GLASS = new BlockType("minecraft:light_gray_stained_glass"); + public static final BlockType CYAN_STAINED_GLASS = new BlockType("minecraft:cyan_stained_glass"); + public static final BlockType PURPLE_STAINED_GLASS = new BlockType("minecraft:purple_stained_glass"); + public static final BlockType BLUE_STAINED_GLASS = new BlockType("minecraft:blue_stained_glass"); + public static final BlockType BROWN_STAINED_GLASS = new BlockType("minecraft:brown_stained_glass"); + public static final BlockType GREEN_STAINED_GLASS = new BlockType("minecraft:green_stained_glass"); + public static final BlockType RED_STAINED_GLASS = new BlockType("minecraft:red_stained_glass"); + public static final BlockType BLACK_STAINED_GLASS = new BlockType("minecraft:black_stained_glass"); + public static final BlockType OAK_TRAPDOOR = new BlockType("minecraft:oak_trapdoor"); + public static final BlockType SPRUCE_TRAPDOOR = new BlockType("minecraft:spruce_trapdoor"); + public static final BlockType BIRCH_TRAPDOOR = new BlockType("minecraft:birch_trapdoor"); + public static final BlockType JUNGLE_TRAPDOOR = new BlockType("minecraft:jungle_trapdoor"); + public static final BlockType ACACIA_TRAPDOOR = new BlockType("minecraft:acacia_trapdoor"); + public static final BlockType DARK_OAK_TRAPDOOR = new BlockType("minecraft:dark_oak_trapdoor"); + public static final BlockType INFESTED_STONE = new BlockType("minecraft:infested_stone"); + public static final BlockType INFESTED_COBBLESTONE = new BlockType("minecraft:infested_cobblestone"); + public static final BlockType INFESTED_STONE_BRICKS = new BlockType("minecraft:infested_stone_bricks"); + public static final BlockType INFESTED_MOSSY_STONE_BRICKS = new BlockType("minecraft:infested_mossy_stone_bricks"); + public static final BlockType INFESTED_CRACKED_STONE_BRICKS = new BlockType("minecraft:infested_cracked_stone_bricks"); + public static final BlockType INFESTED_CHISELED_STONE_BRICKS = new BlockType("minecraft:infested_chiseled_stone_bricks"); + public static final BlockType STONE_BRICKS = new BlockType("minecraft:stone_bricks"); + public static final BlockType MOSSY_STONE_BRICKS = new BlockType("minecraft:mossy_stone_bricks"); + public static final BlockType CRACKED_STONE_BRICKS = new BlockType("minecraft:cracked_stone_bricks"); + public static final BlockType CHISELED_STONE_BRICKS = new BlockType("minecraft:chiseled_stone_bricks"); + public static final BlockType BROWN_MUSHROOM_BLOCK = new BlockType("minecraft:brown_mushroom_block"); + public static final BlockType RED_MUSHROOM_BLOCK = new BlockType("minecraft:red_mushroom_block"); + public static final BlockType MUSHROOM_STEM = new BlockType("minecraft:mushroom_stem"); + public static final BlockType IRON_BARS = new BlockType("minecraft:iron_bars"); + public static final BlockType GLASS_PANE = new BlockType("minecraft:glass_pane"); + public static final BlockType MELON_BLOCK = new BlockType("minecraft:melon_block"); + public static final BlockType ATTACHED_PUMPKIN_STEM = new BlockType("minecraft:attached_pumpkin_stem"); + public static final BlockType ATTACHED_MELON_STEM = new BlockType("minecraft:attached_melon_stem"); + public static final BlockType PUMPKIN_STEM = new BlockType("minecraft:pumpkin_stem"); + public static final BlockType MELON_STEM = new BlockType("minecraft:melon_stem"); + public static final BlockType VINE = new BlockType("minecraft:vine"); + public static final BlockType OAK_FENCE_GATE = new BlockType("minecraft:oak_fence_gate"); + public static final BlockType BRICK_STAIRS = new BlockType("minecraft:brick_stairs"); + public static final BlockType STONE_BRICK_STAIRS = new BlockType("minecraft:stone_brick_stairs"); + public static final BlockType MYCELIUM = new BlockType("minecraft:mycelium"); + public static final BlockType LILY_PAD = new BlockType("minecraft:lily_pad"); + public static final BlockType NETHER_BRICKS = new BlockType("minecraft:nether_bricks"); + public static final BlockType NETHER_BRICK_FENCE = new BlockType("minecraft:nether_brick_fence"); + public static final BlockType NETHER_BRICK_STAIRS = new BlockType("minecraft:nether_brick_stairs"); + public static final BlockType NETHER_WART = new BlockType("minecraft:nether_wart"); + public static final BlockType ENCHANTING_TABLE = new BlockType("minecraft:enchanting_table"); + public static final BlockType BREWING_STAND = new BlockType("minecraft:brewing_stand"); + public static final BlockType CAULDRON = new BlockType("minecraft:cauldron"); + public static final BlockType END_PORTAL = new BlockType("minecraft:end_portal"); + public static final BlockType END_PORTAL_FRAME = new BlockType("minecraft:end_portal_frame"); + public static final BlockType END_STONE = new BlockType("minecraft:end_stone"); + public static final BlockType DRAGON_EGG = new BlockType("minecraft:dragon_egg"); + public static final BlockType REDSTONE_LAMP = new BlockType("minecraft:redstone_lamp"); + public static final BlockType COCOA = new BlockType("minecraft:cocoa"); + public static final BlockType SANDSTONE_STAIRS = new BlockType("minecraft:sandstone_stairs"); + public static final BlockType EMERALD_ORE = new BlockType("minecraft:emerald_ore"); + public static final BlockType ENDER_CHEST = new BlockType("minecraft:ender_chest"); + public static final BlockType TRIPWIRE_HOOK = new BlockType("minecraft:tripwire_hook"); + public static final BlockType TRIPWIRE = new BlockType("minecraft:tripwire"); + public static final BlockType EMERALD_BLOCK = new BlockType("minecraft:emerald_block"); + public static final BlockType SPRUCE_STAIRS = new BlockType("minecraft:spruce_stairs"); + public static final BlockType BIRCH_STAIRS = new BlockType("minecraft:birch_stairs"); + public static final BlockType JUNGLE_STAIRS = new BlockType("minecraft:jungle_stairs"); + public static final BlockType COMMAND_BLOCK = new BlockType("minecraft:command_block"); + public static final BlockType BEACON = new BlockType("minecraft:beacon"); + public static final BlockType COBBLESTONE_WALL = new BlockType("minecraft:cobblestone_wall"); + public static final BlockType MOSSY_COBBLESTONE_WALL = new BlockType("minecraft:mossy_cobblestone_wall"); + public static final BlockType FLOWER_POT = new BlockType("minecraft:flower_pot"); + public static final BlockType POTTED_OAK_SAPLING = new BlockType("minecraft:potted_oak_sapling"); + public static final BlockType POTTED_SPRUCE_SAPLING = new BlockType("minecraft:potted_spruce_sapling"); + public static final BlockType POTTED_BIRCH_SAPLING = new BlockType("minecraft:potted_birch_sapling"); + public static final BlockType POTTED_JUNGLE_SAPLING = new BlockType("minecraft:potted_jungle_sapling"); + public static final BlockType POTTED_ACACIA_SAPLING = new BlockType("minecraft:potted_acacia_sapling"); + public static final BlockType POTTED_DARK_OAK_SAPLING = new BlockType("minecraft:potted_dark_oak_sapling"); + public static final BlockType POTTED_FERN = new BlockType("minecraft:potted_fern"); + public static final BlockType POTTED_DANDELION = new BlockType("minecraft:potted_dandelion"); + public static final BlockType POTTED_POPPY = new BlockType("minecraft:potted_poppy"); + public static final BlockType POTTED_BLUE_ORCHID = new BlockType("minecraft:potted_blue_orchid"); + public static final BlockType POTTED_ALLIUM = new BlockType("minecraft:potted_allium"); + public static final BlockType POTTED_AZURE_BLUET = new BlockType("minecraft:potted_azure_bluet"); + public static final BlockType POTTED_RED_TULIP = new BlockType("minecraft:potted_red_tulip"); + public static final BlockType POTTED_ORANGE_TULIP = new BlockType("minecraft:potted_orange_tulip"); + public static final BlockType POTTED_WHITE_TULIP = new BlockType("minecraft:potted_white_tulip"); + public static final BlockType POTTED_PINK_TULIP = new BlockType("minecraft:potted_pink_tulip"); + public static final BlockType POTTED_OXEYE_DAISY = new BlockType("minecraft:potted_oxeye_daisy"); + public static final BlockType POTTED_RED_MUSHROOM = new BlockType("minecraft:potted_red_mushroom"); + public static final BlockType POTTED_BROWN_MUSHROOM = new BlockType("minecraft:potted_brown_mushroom"); + public static final BlockType POTTED_DEAD_BUSH = new BlockType("minecraft:potted_dead_bush"); + public static final BlockType POTTED_CACTUS = new BlockType("minecraft:potted_cactus"); + public static final BlockType CARROTS = new BlockType("minecraft:carrots"); + public static final BlockType POTATOES = new BlockType("minecraft:potatoes"); + public static final BlockType OAK_BUTTON = new BlockType("minecraft:oak_button"); + public static final BlockType SPRUCE_BUTTON = new BlockType("minecraft:spruce_button"); + public static final BlockType BIRCH_BUTTON = new BlockType("minecraft:birch_button"); + public static final BlockType JUNGLE_BUTTON = new BlockType("minecraft:jungle_button"); + public static final BlockType ACACIA_BUTTON = new BlockType("minecraft:acacia_button"); + public static final BlockType DARK_OAK_BUTTON = new BlockType("minecraft:dark_oak_button"); + public static final BlockType SKELETON_WALL_SKULL = new BlockType("minecraft:skeleton_wall_skull"); + public static final BlockType SKELETON_SKULL = new BlockType("minecraft:skeleton_skull"); + public static final BlockType WITHER_SKELETON_WALL_SKULL = new BlockType("minecraft:wither_skeleton_wall_skull"); + public static final BlockType WITHER_SKELETON_SKULL = new BlockType("minecraft:wither_skeleton_skull"); + public static final BlockType ZOMBIE_WALL_HEAD = new BlockType("minecraft:zombie_wall_head"); + public static final BlockType ZOMBIE_HEAD = new BlockType("minecraft:zombie_head"); + public static final BlockType PLAYER_WALL_HEAD = new BlockType("minecraft:player_wall_head"); + public static final BlockType PLAYER_HEAD = new BlockType("minecraft:player_head"); + public static final BlockType CREEPER_WALL_HEAD = new BlockType("minecraft:creeper_wall_head"); + public static final BlockType CREEPER_HEAD = new BlockType("minecraft:creeper_head"); + public static final BlockType DRAGON_WALL_HEAD = new BlockType("minecraft:dragon_wall_head"); + public static final BlockType DRAGON_HEAD = new BlockType("minecraft:dragon_head"); + public static final BlockType ANVIL = new BlockType("minecraft:anvil"); + public static final BlockType CHIPPED_ANVIL = new BlockType("minecraft:chipped_anvil"); + public static final BlockType DAMAGED_ANVIL = new BlockType("minecraft:damaged_anvil"); + public static final BlockType TRAPPED_CHEST = new BlockType("minecraft:trapped_chest"); + public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = new BlockType("minecraft:light_weighted_pressure_plate"); + public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = new BlockType("minecraft:heavy_weighted_pressure_plate"); + public static final BlockType COMPARATOR = new BlockType("minecraft:comparator"); + public static final BlockType DAYLIGHT_DETECTOR = new BlockType("minecraft:daylight_detector"); + public static final BlockType REDSTONE_BLOCK = new BlockType("minecraft:redstone_block"); + public static final BlockType NETHER_QUARTZ_ORE = new BlockType("minecraft:nether_quartz_ore"); + public static final BlockType HOPPER = new BlockType("minecraft:hopper"); + public static final BlockType QUARTZ_BLOCK = new BlockType("minecraft:quartz_block"); + public static final BlockType CHISELED_QUARTZ_BLOCK = new BlockType("minecraft:chiseled_quartz_block"); + public static final BlockType QUARTZ_PILLAR = new BlockType("minecraft:quartz_pillar"); + public static final BlockType QUARTZ_STAIRS = new BlockType("minecraft:quartz_stairs"); + public static final BlockType ACTIVATOR_RAIL = new BlockType("minecraft:activator_rail"); + public static final BlockType DROPPER = new BlockType("minecraft:dropper"); + public static final BlockType WHITE_TERRACOTTA = new BlockType("minecraft:white_terracotta"); + public static final BlockType ORANGE_TERRACOTTA = new BlockType("minecraft:orange_terracotta"); + public static final BlockType MAGENTA_TERRACOTTA = new BlockType("minecraft:magenta_terracotta"); + public static final BlockType LIGHT_BLUE_TERRACOTTA = new BlockType("minecraft:light_blue_terracotta"); + public static final BlockType YELLOW_TERRACOTTA = new BlockType("minecraft:yellow_terracotta"); + public static final BlockType LIME_TERRACOTTA = new BlockType("minecraft:lime_terracotta"); + public static final BlockType PINK_TERRACOTTA = new BlockType("minecraft:pink_terracotta"); + public static final BlockType GRAY_TERRACOTTA = new BlockType("minecraft:gray_terracotta"); + public static final BlockType LIGHT_GRAY_TERRACOTTA = new BlockType("minecraft:light_gray_terracotta"); + public static final BlockType CYAN_TERRACOTTA = new BlockType("minecraft:cyan_terracotta"); + public static final BlockType PURPLE_TERRACOTTA = new BlockType("minecraft:purple_terracotta"); + public static final BlockType BLUE_TERRACOTTA = new BlockType("minecraft:blue_terracotta"); + public static final BlockType BROWN_TERRACOTTA = new BlockType("minecraft:brown_terracotta"); + public static final BlockType GREEN_TERRACOTTA = new BlockType("minecraft:green_terracotta"); + public static final BlockType RED_TERRACOTTA = new BlockType("minecraft:red_terracotta"); + public static final BlockType BLACK_TERRACOTTA = new BlockType("minecraft:black_terracotta"); + public static final BlockType WHITE_STAINED_GLASS_PANE = new BlockType("minecraft:white_stained_glass_pane"); + public static final BlockType ORANGE_STAINED_GLASS_PANE = new BlockType("minecraft:orange_stained_glass_pane"); + public static final BlockType MAGENTA_STAINED_GLASS_PANE = new BlockType("minecraft:magenta_stained_glass_pane"); + public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = new BlockType("minecraft:light_blue_stained_glass_pane"); + public static final BlockType YELLOW_STAINED_GLASS_PANE = new BlockType("minecraft:yellow_stained_glass_pane"); + public static final BlockType LIME_STAINED_GLASS_PANE = new BlockType("minecraft:lime_stained_glass_pane"); + public static final BlockType PINK_STAINED_GLASS_PANE = new BlockType("minecraft:pink_stained_glass_pane"); + public static final BlockType GRAY_STAINED_GLASS_PANE = new BlockType("minecraft:gray_stained_glass_pane"); + public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = new BlockType("minecraft:light_gray_stained_glass_pane"); + public static final BlockType CYAN_STAINED_GLASS_PANE = new BlockType("minecraft:cyan_stained_glass_pane"); + public static final BlockType PURPLE_STAINED_GLASS_PANE = new BlockType("minecraft:purple_stained_glass_pane"); + public static final BlockType BLUE_STAINED_GLASS_PANE = new BlockType("minecraft:blue_stained_glass_pane"); + public static final BlockType BROWN_STAINED_GLASS_PANE = new BlockType("minecraft:brown_stained_glass_pane"); + public static final BlockType GREEN_STAINED_GLASS_PANE = new BlockType("minecraft:green_stained_glass_pane"); + public static final BlockType RED_STAINED_GLASS_PANE = new BlockType("minecraft:red_stained_glass_pane"); + public static final BlockType BLACK_STAINED_GLASS_PANE = new BlockType("minecraft:black_stained_glass_pane"); + public static final BlockType ACACIA_STAIRS = new BlockType("minecraft:acacia_stairs"); + public static final BlockType DARK_OAK_STAIRS = new BlockType("minecraft:dark_oak_stairs"); + public static final BlockType SLIME_BLOCK = new BlockType("minecraft:slime_block"); + public static final BlockType BARRIER = new BlockType("minecraft:barrier"); + public static final BlockType IRON_TRAPDOOR = new BlockType("minecraft:iron_trapdoor"); + public static final BlockType PRISMARINE = new BlockType("minecraft:prismarine"); + public static final BlockType PRISMARINE_BRICKS = new BlockType("minecraft:prismarine_bricks"); + public static final BlockType DARK_PRISMARINE = new BlockType("minecraft:dark_prismarine"); + public static final BlockType SEA_LANTERN = new BlockType("minecraft:sea_lantern"); + public static final BlockType HAY_BLOCK = new BlockType("minecraft:hay_block"); + public static final BlockType WHITE_CARPET = new BlockType("minecraft:white_carpet"); + public static final BlockType ORANGE_CARPET = new BlockType("minecraft:orange_carpet"); + public static final BlockType MAGENTA_CARPET = new BlockType("minecraft:magenta_carpet"); + public static final BlockType LIGHT_BLUE_CARPET = new BlockType("minecraft:light_blue_carpet"); + public static final BlockType YELLOW_CARPET = new BlockType("minecraft:yellow_carpet"); + public static final BlockType LIME_CARPET = new BlockType("minecraft:lime_carpet"); + public static final BlockType PINK_CARPET = new BlockType("minecraft:pink_carpet"); + public static final BlockType GRAY_CARPET = new BlockType("minecraft:gray_carpet"); + public static final BlockType LIGHT_GRAY_CARPET = new BlockType("minecraft:light_gray_carpet"); + public static final BlockType CYAN_CARPET = new BlockType("minecraft:cyan_carpet"); + public static final BlockType PURPLE_CARPET = new BlockType("minecraft:purple_carpet"); + public static final BlockType BLUE_CARPET = new BlockType("minecraft:blue_carpet"); + public static final BlockType BROWN_CARPET = new BlockType("minecraft:brown_carpet"); + public static final BlockType GREEN_CARPET = new BlockType("minecraft:green_carpet"); + public static final BlockType RED_CARPET = new BlockType("minecraft:red_carpet"); + public static final BlockType BLACK_CARPET = new BlockType("minecraft:black_carpet"); + public static final BlockType TERRACOTTA = new BlockType("minecraft:terracotta"); + public static final BlockType COAL_BLOCK = new BlockType("minecraft:coal_block"); + public static final BlockType PACKED_ICE = new BlockType("minecraft:packed_ice"); + public static final BlockType SUNFLOWER = new BlockType("minecraft:sunflower"); + public static final BlockType LILAC = new BlockType("minecraft:lilac"); + public static final BlockType ROSE_BUSH = new BlockType("minecraft:rose_bush"); + public static final BlockType PEONY = new BlockType("minecraft:peony"); + public static final BlockType TALL_GRASS = new BlockType("minecraft:tall_grass"); + public static final BlockType LARGE_FERN = new BlockType("minecraft:large_fern"); + public static final BlockType WHITE_BANNER = new BlockType("minecraft:white_banner"); + public static final BlockType ORANGE_BANNER = new BlockType("minecraft:orange_banner"); + public static final BlockType MAGENTA_BANNER = new BlockType("minecraft:magenta_banner"); + public static final BlockType LIGHT_BLUE_BANNER = new BlockType("minecraft:light_blue_banner"); + public static final BlockType YELLOW_BANNER = new BlockType("minecraft:yellow_banner"); + public static final BlockType LIME_BANNER = new BlockType("minecraft:lime_banner"); + public static final BlockType PINK_BANNER = new BlockType("minecraft:pink_banner"); + public static final BlockType GRAY_BANNER = new BlockType("minecraft:gray_banner"); + public static final BlockType LIGHT_GRAY_BANNER = new BlockType("minecraft:light_gray_banner"); + public static final BlockType CYAN_BANNER = new BlockType("minecraft:cyan_banner"); + public static final BlockType PURPLE_BANNER = new BlockType("minecraft:purple_banner"); + public static final BlockType BLUE_BANNER = new BlockType("minecraft:blue_banner"); + public static final BlockType BROWN_BANNER = new BlockType("minecraft:brown_banner"); + public static final BlockType GREEN_BANNER = new BlockType("minecraft:green_banner"); + public static final BlockType RED_BANNER = new BlockType("minecraft:red_banner"); + public static final BlockType BLACK_BANNER = new BlockType("minecraft:black_banner"); + public static final BlockType WHITE_WALL_BANNER = new BlockType("minecraft:white_wall_banner"); + public static final BlockType ORANGE_WALL_BANNER = new BlockType("minecraft:orange_wall_banner"); + public static final BlockType MAGENTA_WALL_BANNER = new BlockType("minecraft:magenta_wall_banner"); + public static final BlockType LIGHT_BLUE_WALL_BANNER = new BlockType("minecraft:light_blue_wall_banner"); + public static final BlockType YELLOW_WALL_BANNER = new BlockType("minecraft:yellow_wall_banner"); + public static final BlockType LIME_WALL_BANNER = new BlockType("minecraft:lime_wall_banner"); + public static final BlockType PINK_WALL_BANNER = new BlockType("minecraft:pink_wall_banner"); + public static final BlockType GRAY_WALL_BANNER = new BlockType("minecraft:gray_wall_banner"); + public static final BlockType LIGHT_GRAY_WALL_BANNER = new BlockType("minecraft:light_gray_wall_banner"); + public static final BlockType CYAN_WALL_BANNER = new BlockType("minecraft:cyan_wall_banner"); + public static final BlockType PURPLE_WALL_BANNER = new BlockType("minecraft:purple_wall_banner"); + public static final BlockType BLUE_WALL_BANNER = new BlockType("minecraft:blue_wall_banner"); + public static final BlockType BROWN_WALL_BANNER = new BlockType("minecraft:brown_wall_banner"); + public static final BlockType GREEN_WALL_BANNER = new BlockType("minecraft:green_wall_banner"); + public static final BlockType RED_WALL_BANNER = new BlockType("minecraft:red_wall_banner"); + public static final BlockType BLACK_WALL_BANNER = new BlockType("minecraft:black_wall_banner"); + public static final BlockType RED_SANDSTONE = new BlockType("minecraft:red_sandstone"); + public static final BlockType CHISELED_RED_SANDSTONE = new BlockType("minecraft:chiseled_red_sandstone"); + public static final BlockType CUT_RED_SANDSTONE = new BlockType("minecraft:cut_red_sandstone"); + public static final BlockType RED_SANDSTONE_STAIRS = new BlockType("minecraft:red_sandstone_stairs"); + public static final BlockType OAK_SLAB = new BlockType("minecraft:oak_slab"); + public static final BlockType SPRUCE_SLAB = new BlockType("minecraft:spruce_slab"); + public static final BlockType BIRCH_SLAB = new BlockType("minecraft:birch_slab"); + public static final BlockType JUNGLE_SLAB = new BlockType("minecraft:jungle_slab"); + public static final BlockType ACACIA_SLAB = new BlockType("minecraft:acacia_slab"); + public static final BlockType DARK_OAK_SLAB = new BlockType("minecraft:dark_oak_slab"); + public static final BlockType STONE_SLAB = new BlockType("minecraft:stone_slab"); + public static final BlockType SANDSTONE_SLAB = new BlockType("minecraft:sandstone_slab"); + public static final BlockType PETRIFIED_OAK_SLAB = new BlockType("minecraft:petrified_oak_slab"); + public static final BlockType COBBLESTONE_SLAB = new BlockType("minecraft:cobblestone_slab"); + public static final BlockType BRICK_SLAB = new BlockType("minecraft:brick_slab"); + public static final BlockType STONE_BRICK_SLAB = new BlockType("minecraft:stone_brick_slab"); + public static final BlockType NETHER_BRICK_SLAB = new BlockType("minecraft:nether_brick_slab"); + public static final BlockType QUARTZ_SLAB = new BlockType("minecraft:quartz_slab"); + public static final BlockType RED_SANDSTONE_SLAB = new BlockType("minecraft:red_sandstone_slab"); + public static final BlockType PURPUR_SLAB = new BlockType("minecraft:purpur_slab"); + public static final BlockType SMOOTH_STONE = new BlockType("minecraft:smooth_stone"); + public static final BlockType SMOOTH_SANDSTONE = new BlockType("minecraft:smooth_sandstone"); + public static final BlockType SMOOTH_QUARTZ = new BlockType("minecraft:smooth_quartz"); + public static final BlockType SMOOTH_RED_SANDSTONE = new BlockType("minecraft:smooth_red_sandstone"); + public static final BlockType SPRUCE_FENCE_GATE = new BlockType("minecraft:spruce_fence_gate"); + public static final BlockType BIRCH_FENCE_GATE = new BlockType("minecraft:birch_fence_gate"); + public static final BlockType JUNGLE_FENCE_GATE = new BlockType("minecraft:jungle_fence_gate"); + public static final BlockType ACACIA_FENCE_GATE = new BlockType("minecraft:acacia_fence_gate"); + public static final BlockType DARK_OAK_FENCE_GATE = new BlockType("minecraft:dark_oak_fence_gate"); + public static final BlockType SPRUCE_FENCE = new BlockType("minecraft:spruce_fence"); + public static final BlockType BIRCH_FENCE = new BlockType("minecraft:birch_fence"); + public static final BlockType JUNGLE_FENCE = new BlockType("minecraft:jungle_fence"); + public static final BlockType ACACIA_FENCE = new BlockType("minecraft:acacia_fence"); + public static final BlockType DARK_OAK_FENCE = new BlockType("minecraft:dark_oak_fence"); + public static final BlockType SPRUCE_DOOR = new BlockType("minecraft:spruce_door"); + public static final BlockType BIRCH_DOOR = new BlockType("minecraft:birch_door"); + public static final BlockType JUNGLE_DOOR = new BlockType("minecraft:jungle_door"); + public static final BlockType ACACIA_DOOR = new BlockType("minecraft:acacia_door"); + public static final BlockType DARK_OAK_DOOR = new BlockType("minecraft:dark_oak_door"); + public static final BlockType END_ROD = new BlockType("minecraft:end_rod"); + public static final BlockType CHORUS_PLANT = new BlockType("minecraft:chorus_plant"); + public static final BlockType CHORUS_FLOWER = new BlockType("minecraft:chorus_flower"); + public static final BlockType PURPUR_BLOCK = new BlockType("minecraft:purpur_block"); + public static final BlockType PURPUR_PILLAR = new BlockType("minecraft:purpur_pillar"); + public static final BlockType PURPUR_STAIRS = new BlockType("minecraft:purpur_stairs"); + public static final BlockType END_STONE_BRICKS = new BlockType("minecraft:end_stone_bricks"); + public static final BlockType BEETROOTS = new BlockType("minecraft:beetroots"); + public static final BlockType GRASS_PATH = new BlockType("minecraft:grass_path"); + public static final BlockType END_GATEWAY = new BlockType("minecraft:end_gateway"); + public static final BlockType REPEATING_COMMAND_BLOCK = new BlockType("minecraft:repeating_command_block"); + public static final BlockType CHAIN_COMMAND_BLOCK = new BlockType("minecraft:chain_command_block"); + public static final BlockType FROSTED_ICE = new BlockType("minecraft:frosted_ice"); + public static final BlockType MAGMA_BLOCK = new BlockType("minecraft:magma_block"); + public static final BlockType NETHER_WART_BLOCK = new BlockType("minecraft:nether_wart_block"); + public static final BlockType RED_NETHER_BRICKS = new BlockType("minecraft:red_nether_bricks"); + public static final BlockType BONE_BLOCK = new BlockType("minecraft:bone_block"); + public static final BlockType STRUCTURE_VOID = new BlockType("minecraft:structure_void"); + public static final BlockType OBSERVER = new BlockType("minecraft:observer"); + public static final BlockType WHITE_SHULKER_BOX = new BlockType("minecraft:white_shulker_box"); + public static final BlockType ORANGE_SHULKER_BOX = new BlockType("minecraft:orange_shulker_box"); + public static final BlockType MAGENTA_SHULKER_BOX = new BlockType("minecraft:magenta_shulker_box"); + public static final BlockType LIGHT_BLUE_SHULKER_BOX = new BlockType("minecraft:light_blue_shulker_box"); + public static final BlockType YELLOW_SHULKER_BOX = new BlockType("minecraft:yellow_shulker_box"); + public static final BlockType LIME_SHULKER_BOX = new BlockType("minecraft:lime_shulker_box"); + public static final BlockType PINK_SHULKER_BOX = new BlockType("minecraft:pink_shulker_box"); + public static final BlockType GRAY_SHULKER_BOX = new BlockType("minecraft:gray_shulker_box"); + public static final BlockType LIGHT_GRAY_SHULKER_BOX = new BlockType("minecraft:light_gray_shulker_box"); + public static final BlockType CYAN_SHULKER_BOX = new BlockType("minecraft:cyan_shulker_box"); + public static final BlockType PURPLE_SHULKER_BOX = new BlockType("minecraft:purple_shulker_box"); + public static final BlockType BLUE_SHULKER_BOX = new BlockType("minecraft:blue_shulker_box"); + public static final BlockType BROWN_SHULKER_BOX = new BlockType("minecraft:brown_shulker_box"); + public static final BlockType GREEN_SHULKER_BOX = new BlockType("minecraft:green_shulker_box"); + public static final BlockType RED_SHULKER_BOX = new BlockType("minecraft:red_shulker_box"); + public static final BlockType BLACK_SHULKER_BOX = new BlockType("minecraft:black_shulker_box"); + public static final BlockType WHITE_GLAZED_TERRACOTTA = new BlockType("minecraft:white_glazed_terracotta"); + public static final BlockType ORANGE_GLAZED_TERRACOTTA = new BlockType("minecraft:orange_glazed_terracotta"); + public static final BlockType MAGENTA_GLAZED_TERRACOTTA = new BlockType("minecraft:magenta_glazed_terracotta"); + public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = new BlockType("minecraft:light_blue_glazed_terracotta"); + public static final BlockType YELLOW_GLAZED_TERRACOTTA = new BlockType("minecraft:yellow_glazed_terracotta"); + public static final BlockType LIME_GLAZED_TERRACOTTA = new BlockType("minecraft:lime_glazed_terracotta"); + public static final BlockType PINK_GLAZED_TERRACOTTA = new BlockType("minecraft:pink_glazed_terracotta"); + public static final BlockType GRAY_GLAZED_TERRACOTTA = new BlockType("minecraft:gray_glazed_terracotta"); + public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = new BlockType("minecraft:light_gray_glazed_terracotta"); + public static final BlockType CYAN_GLAZED_TERRACOTTA = new BlockType("minecraft:cyan_glazed_terracotta"); + public static final BlockType PURPLE_GLAZED_TERRACOTTA = new BlockType("minecraft:purple_glazed_terracotta"); + public static final BlockType BLUE_GLAZED_TERRACOTTA = new BlockType("minecraft:blue_glazed_terracotta"); + public static final BlockType BROWN_GLAZED_TERRACOTTA = new BlockType("minecraft:brown_glazed_terracotta"); + public static final BlockType GREEN_GLAZED_TERRACOTTA = new BlockType("minecraft:green_glazed_terracotta"); + public static final BlockType RED_GLAZED_TERRACOTTA = new BlockType("minecraft:red_glazed_terracotta"); + public static final BlockType BLACK_GLAZED_TERRACOTTA = new BlockType("minecraft:black_glazed_terracotta"); + public static final BlockType WHITE_CONCRETE = new BlockType("minecraft:white_concrete"); + public static final BlockType ORANGE_CONCRETE = new BlockType("minecraft:orange_concrete"); + public static final BlockType MAGENTA_CONCRETE = new BlockType("minecraft:magenta_concrete"); + public static final BlockType LIGHT_BLUE_CONCRETE = new BlockType("minecraft:light_blue_concrete"); + public static final BlockType YELLOW_CONCRETE = new BlockType("minecraft:yellow_concrete"); + public static final BlockType LIME_CONCRETE = new BlockType("minecraft:lime_concrete"); + public static final BlockType PINK_CONCRETE = new BlockType("minecraft:pink_concrete"); + public static final BlockType GRAY_CONCRETE = new BlockType("minecraft:gray_concrete"); + public static final BlockType LIGHT_GRAY_CONCRETE = new BlockType("minecraft:light_gray_concrete"); + public static final BlockType CYAN_CONCRETE = new BlockType("minecraft:cyan_concrete"); + public static final BlockType PURPLE_CONCRETE = new BlockType("minecraft:purple_concrete"); + public static final BlockType BLUE_CONCRETE = new BlockType("minecraft:blue_concrete"); + public static final BlockType BROWN_CONCRETE = new BlockType("minecraft:brown_concrete"); + public static final BlockType GREEN_CONCRETE = new BlockType("minecraft:green_concrete"); + public static final BlockType RED_CONCRETE = new BlockType("minecraft:red_concrete"); + public static final BlockType BLACK_CONCRETE = new BlockType("minecraft:black_concrete"); + public static final BlockType WHITE_CONCRETE_POWDER = new BlockType("minecraft:white_concrete_powder"); + public static final BlockType ORANGE_CONCRETE_POWDER = new BlockType("minecraft:orange_concrete_powder"); + public static final BlockType MAGENTA_CONCRETE_POWDER = new BlockType("minecraft:magenta_concrete_powder"); + public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = new BlockType("minecraft:light_blue_concrete_powder"); + public static final BlockType YELLOW_CONCRETE_POWDER = new BlockType("minecraft:yellow_concrete_powder"); + public static final BlockType LIME_CONCRETE_POWDER = new BlockType("minecraft:lime_concrete_powder"); + public static final BlockType PINK_CONCRETE_POWDER = new BlockType("minecraft:pink_concrete_powder"); + public static final BlockType GRAY_CONCRETE_POWDER = new BlockType("minecraft:gray_concrete_powder"); + public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = new BlockType("minecraft:light_gray_concrete_powder"); + public static final BlockType CYAN_CONCRETE_POWDER = new BlockType("minecraft:cyan_concrete_powder"); + public static final BlockType PURPLE_CONCRETE_POWDER = new BlockType("minecraft:purple_concrete_powder"); + public static final BlockType BLUE_CONCRETE_POWDER = new BlockType("minecraft:blue_concrete_powder"); + public static final BlockType BROWN_CONCRETE_POWDER = new BlockType("minecraft:brown_concrete_powder"); + public static final BlockType GREEN_CONCRETE_POWDER = new BlockType("minecraft:green_concrete_powder"); + public static final BlockType RED_CONCRETE_POWDER = new BlockType("minecraft:red_concrete_powder"); + public static final BlockType BLACK_CONCRETE_POWDER = new BlockType("minecraft:black_concrete_powder"); + public static final BlockType STRUCTURE_BLOCK = new BlockType("minecraft:structure_block"); private static final Map blockMapping = new HashMap<>(); + static { + for (Field field : BlockTypes.class.getFields()) { + if (field.getType() == BlockType.class) { + try { + registerBlock((BlockType) field.get(null)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + } + public static void registerBlock(BlockType blockType) { - if (blockMapping.containsKey(blockType.getId())) { + if (blockMapping.containsKey(blockType.getId()) && !blockType.getId().startsWith("minecraft:")) { throw new IllegalArgumentException("Existing block with this ID already registered"); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index 67efbd716..631f17ae9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -30,6 +30,7 @@ import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.brush.ButcherBrush; import com.sk89q.worldedit.command.tool.brush.ClipboardBrush; @@ -193,10 +194,10 @@ public class BrushCommands { worldEdit.checkMaxBrushRadius(radius); BrushTool tool = session.getBrushTool(player.getItemInHand()); - Pattern fill = new BlockPattern(new BaseBlock(0)); + Pattern fill = new BlockPattern(new BaseBlock(BlockTypes.AIR)); tool.setFill(fill); tool.setSize(radius); - tool.setMask(new BlockMask(editSession, new BaseBlock(BlockID.FIRE))); + tool.setMask(new BlockMask(editSession, new BaseBlock(BlockTypes.FIRE))); tool.setBrush(new SphereBrush(), "worldedit.brush.ex"); player.print(String.format("Extinguisher equipped (%.0f).", radius)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java index 04a25443a..f33ffbbbe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java @@ -21,7 +21,8 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; @@ -32,7 +33,7 @@ import com.sk89q.worldedit.world.World; */ public class AreaPickaxe implements BlockTool { - private static final BaseBlock air = new BaseBlock(0); + private static final BaseBlock air = new BaseBlock(BlockTypes.AIR); private int range; public AreaPickaxe(int range) { @@ -49,13 +50,13 @@ public class AreaPickaxe implements BlockTool { int ox = clicked.getBlockX(); int oy = clicked.getBlockY(); int oz = clicked.getBlockZ(); - int initialType = ((World) clicked.getExtent()).getBlockType(clicked.toVector()); + BlockType initialType = ((World) clicked.getExtent()).getBlock(clicked.toVector()).getType(); - if (initialType == 0) { + if (initialType == BlockTypes.AIR) { return true; } - if (initialType == BlockID.BEDROCK && !player.canDestroyBedrock()) { + if (initialType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; } @@ -67,11 +68,11 @@ public class AreaPickaxe implements BlockTool { for (int y = oy - range; y <= oy + range; ++y) { for (int z = oz - range; z <= oz + range; ++z) { Vector pos = new Vector(x, y, z); - if (editSession.getBlockType(pos) != initialType) { + if (editSession.getBlock(pos).getType() != initialType) { continue; } - ((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType, clicked.toVector().distanceSq(pos)); + ((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType.getLegacyId(), clicked.toVector().distanceSq(pos)); editSession.setBlock(pos, air); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index 04adef915..8a375e376 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; @@ -37,7 +38,7 @@ import java.util.Set; * to anything else) */ public class FloatingTreeRemover implements BlockTool { - private static final BaseBlock AIR = new BaseBlock(BlockID.AIR); + private static final BaseBlock AIR = new BaseBlock(BlockTypes.AIR); private int rangeSq; public FloatingTreeRemover() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index 794dfa993..a0ed140b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -56,7 +56,7 @@ public class QueryTool implements BlockTool { World world = (World) clicked.getExtent(); EditSession editSession = session.createEditSession(player); - BaseBlock block = (editSession).rawGetBlock(clicked.toVector()); + BaseBlock block = editSession.getBlock(clicked.toVector()); BlockType type = BlockType.fromID(block.getType().getLegacyId()); player.print("\u00A79@" + clicked.toVector() + ": " + "\u00A7e" @@ -71,13 +71,9 @@ public class QueryTool implements BlockTool { } else if (block instanceof NoteBlock) { player.printRaw("\u00A7e" + "Note block: " + ((NoteBlock) block).getNote()); - } else if (block.getType().getId().equals(BlockTypes.WOOL)) { - // Should never be null - player.printRaw("\u00A7e" + "Color: " - + ClothColor.fromID(block.getData()).getName()); } - Map states = BundledBlockData.getInstance().getStatesById(block.getId()); + Map states = BundledBlockData.getInstance().getStatesById(block.getType().getId()); if (states == null || states.isEmpty()) return true; StringBuilder builder = new StringBuilder(); builder.append("States: "); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java index 05fa39c51..25348565a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java @@ -22,6 +22,8 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; @@ -36,7 +38,7 @@ import java.util.Set; */ public class RecursivePickaxe implements BlockTool { - private static final BaseBlock air = new BaseBlock(0); + private static final BaseBlock air = new BaseBlock(BlockTypes.AIR); private double range; public RecursivePickaxe(double range) { @@ -52,13 +54,13 @@ public class RecursivePickaxe implements BlockTool { public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { World world = (World) clicked.getExtent(); - int initialType = world.getBlockType(clicked.toVector()); + BlockType initialType = world.getBlock(clicked.toVector()).getType(); - if (initialType == BlockID.AIR) { + if (initialType == BlockTypes.AIR) { return true; } - if (initialType == BlockID.BEDROCK && !player.canDestroyBedrock()) { + if (initialType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; } @@ -79,7 +81,7 @@ public class RecursivePickaxe implements BlockTool { } private static void recurse(Platform server, EditSession editSession, World world, BlockVector pos, - Vector origin, double size, int initialType, Set visited) throws MaxChangedBlocksException { + Vector origin, double size, BlockType initialType, Set visited) throws MaxChangedBlocksException { final double distanceSq = origin.distanceSq(pos); if (distanceSq > size*size || visited.contains(pos)) { @@ -88,11 +90,11 @@ public class RecursivePickaxe implements BlockTool { visited.add(pos); - if (editSession.getBlock(pos).getType().getLegacyId() != initialType) { + if (editSession.getBlock(pos).getType() != initialType) { return; } - world.queueBlockBreakEffect(server, pos, initialType, distanceSq); + world.queueBlockBreakEffect(server, pos, initialType.getLegacyId(), distanceSq); editSession.setBlock(pos, air); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java index 2df64da79..ca4d4c145 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Patterns; @@ -39,7 +40,7 @@ public class CylinderBrush implements Brush { @Override public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { if (pattern == null) { - pattern = new BlockPattern(new BaseBlock(BlockID.COBBLESTONE)); + pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); } editSession.makeCylinder(position, Patterns.wrap(pattern), size, size, height, true); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java index 758b7c53c..904cc8b89 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java @@ -39,7 +39,7 @@ public class GravityBrush implements Brush { @Override public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { - final BaseBlock air = new BaseBlock(BlockID.AIR, 0); + final BaseBlock air = new BaseBlock(BlockTypes.AIR); final double startY = fullHeight ? editSession.getWorld().getMaxY() : position.getBlockY() + size; for (double x = position.getBlockX() + size; x > position.getBlockX() - size; --x) { for (double z = position.getBlockZ() + size; z > position.getBlockZ() - size; --z) { @@ -56,7 +56,7 @@ public class GravityBrush implements Brush { Vector pt = new Vector(x, y, z); Collections.reverse(blockTypes); for (int i = 0; i < blockTypes.size();) { - if (editSession.getBlock(pt).getType().getId().equals(BlockTypes.AIR)) { + if (editSession.getBlock(pt).isAir()) { editSession.setBlock(pt, blockTypes.get(i++)); } pt = pt.add(0, 1, 0); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java index 0f468d666..0fe74aa47 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Patterns; @@ -39,7 +40,7 @@ public class HollowCylinderBrush implements Brush { @Override public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { if (pattern == null) { - pattern = new BlockPattern(new BaseBlock(BlockID.COBBLESTONE)); + pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); } editSession.makeCylinder(position, Patterns.wrap(pattern), size, size, height, false); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java index 14813fd99..b28dc08a5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Patterns; @@ -33,7 +34,7 @@ public class HollowSphereBrush implements Brush { @Override public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { if (pattern == null) { - pattern = new BlockPattern(new BaseBlock(BlockID.COBBLESTONE)); + pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); } editSession.makeSphere(position, Patterns.wrap(pattern), size, size, size, false); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java index 6c783a0da..23a3eddb3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Patterns; @@ -33,7 +34,7 @@ public class SphereBrush implements Brush { @Override public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { if (pattern == null) { - pattern = new BlockPattern(new BaseBlock(BlockID.COBBLESTONE)); + pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); } editSession.makeSphere(position, Patterns.wrap(pattern), size, size, size, true); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java index 1979bdaaf..20a3b1556 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; @@ -70,12 +71,12 @@ public class NullExtent implements Extent { @Override public BaseBlock getBlock(Vector position) { - return new BaseBlock(0); + return new BaseBlock(BlockTypes.AIR); } @Override public BaseBlock getLazyBlock(Vector position) { - return new BaseBlock(0); + return new BaseBlock(BlockTypes.AIR); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java index abdef5478..aed9e356d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; @@ -48,7 +49,7 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pattern { - private static final BaseBlock AIR = new BaseBlock(BlockID.AIR); + private static final BaseBlock AIR = new BaseBlock(BlockTypes.AIR); private final Map buffer = new LinkedHashMap(); private final Mask mask; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index 15c9b7345..a48d8499f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; @@ -129,7 +130,7 @@ public class BlockArrayClipboard implements Clipboard { } } - return new BaseBlock(BlockID.AIR); + return new BaseBlock(BlockTypes.AIR); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java index c8440375a..410059aba 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java @@ -28,13 +28,14 @@ import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import java.util.Map; public class SignCompatibilityHandler implements NBTCompatibilityHandler { @Override public boolean isAffectedBlock(BaseBlock block) { - return block.getType().getLegacyId() == BlockID.SIGN_POST || block.getType().getLegacyId() == BlockID.WALL_SIGN; + return block.getType() == BlockTypes.SIGN || block.getType() == BlockTypes.WALL_SIGN; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index 04eafc2d1..86595f3df 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.operation.BlockMapEntryPlacer; @@ -103,7 +104,7 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder return !(lazyBlock.getType() == block.getType() && lazyBlock.getData() == block.getData()); } else if (BlockType.shouldPlaceLast(lazyBlock.getType().getLegacyId())) { // Destroy torches, etc. first - super.setBlock(location, new BaseBlock(BlockID.AIR)); + super.setBlock(location, new BaseBlock(BlockTypes.AIR)); return super.setBlock(location, block); } else { stage1.put(location.toBlockVector(), block); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index f143e7867..10b09a313 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.extent.validation; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; @@ -50,13 +51,13 @@ public class DataValidatorExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { final int y = location.getBlockY(); - final int type = block.getType().getLegacyId(); + final BlockType type = block.getType(); if (y < 0 || y > world.getMaxY()) { return false; } // No invalid blocks - if (!world.isValidBlockType(type)) { + if (type == null) { return false; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index d8eb38e8b..8e44947c6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; @@ -58,7 +59,7 @@ public class BlockQuirkExtent extends AbstractDelegateExtent { if (BlockType.isContainerBlock(existing)) { world.clearContainerBlockContents(position); // Clear the container block so that it doesn't drop items } else if (existing == BlockID.ICE) { - world.setBlock(position, new BaseBlock(BlockID.AIR)); // Ice turns until water so this has to be done first + world.setBlock(position, new BaseBlock(BlockTypes.AIR)); // Ice turns until water so this has to be done first } return super.setBlock(position, block); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java index 5366a2a84..aaed000d3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java @@ -81,7 +81,7 @@ public class SurvivalModeExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { - if (toolUse && block.getType().getLegacyId() == BlockID.AIR) { + if (toolUse && block.isAir()) { world.simulateBlockMine(location); return true; } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java index 94e39cd0c..c72990a1b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java @@ -104,7 +104,7 @@ public class ExtentBlockCopy implements RegionFunction { builder.putByte("Rot", (byte) MCDirections.toRotation(newDirection)); - return new BaseBlock(state.getId(), state.getData(), builder.build()); + return new BaseBlock(state.getType(), state.getData(), builder.build()); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java index 5817e67ad..4b0f1c802 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.LayerFunction; import com.sk89q.worldedit.masks.BlockMask; import com.sk89q.worldedit.masks.Mask; @@ -38,9 +38,9 @@ import static com.google.common.base.Preconditions.checkNotNull; public class Naturalizer implements LayerFunction { private final EditSession editSession; - private final BaseBlock grass = new BaseBlock(BlockID.GRASS); - private final BaseBlock dirt = new BaseBlock(BlockID.DIRT); - private final BaseBlock stone = new BaseBlock(BlockID.STONE); + private final BaseBlock grass = new BaseBlock(BlockTypes.GRASS_BLOCK); + private final BaseBlock dirt = new BaseBlock(BlockTypes.DIRT); + private final BaseBlock stone = new BaseBlock(BlockTypes.STONE); private final Mask mask = new BlockMask(grass, dirt, stone); private int affected = 0; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index 068656342..a5d68d8f1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -84,9 +84,9 @@ public class FloraGenerator implements RegionFunction { */ public static Pattern getDesertPattern() { RandomPattern pattern = new RandomPattern(); - pattern.add(new BlockPattern(new BaseBlock(BlockID.DEAD_BUSH)), 30); - pattern.add(new BlockPattern(new BaseBlock(BlockID.CACTUS)), 20); - pattern.add(new BlockPattern(new BaseBlock(BlockID.AIR)), 300); + pattern.add(new BlockPattern(new BaseBlock(BlockTypes.DEAD_BUSH)), 30); + pattern.add(new BlockPattern(new BaseBlock(BlockTypes.CACTUS)), 20); + pattern.add(new BlockPattern(new BaseBlock(BlockTypes.AIR)), 300); return pattern; } @@ -97,9 +97,9 @@ public class FloraGenerator implements RegionFunction { */ public static Pattern getTemperatePattern() { RandomPattern pattern = new RandomPattern(); - pattern.add(new BlockPattern(new BaseBlock(BlockID.LONG_GRASS, 1)), 300); - pattern.add(new BlockPattern(new BaseBlock(BlockID.RED_FLOWER)), 5); - pattern.add(new BlockPattern(new BaseBlock(BlockID.YELLOW_FLOWER)), 5); + pattern.add(new BlockPattern(new BaseBlock(BlockTypes.TALL_GRASS, 1)), 300); + pattern.add(new BlockPattern(new BaseBlock(BlockTypes.POPPY)), 5); + pattern.add(new BlockPattern(new BaseBlock(BlockTypes.DANDELION)), 5); return pattern; } @@ -107,10 +107,10 @@ public class FloraGenerator implements RegionFunction { public boolean apply(Vector position) throws WorldEditException { BaseBlock block = editSession.getBlock(position); - if (block.getType().getId().equals(BlockTypes.GRASS)) { + if (block.getType() == BlockTypes.GRASS) { editSession.setBlock(position.add(0, 1, 0), temperatePattern.apply(position)); return true; - } else if (block.getType().getLegacyId() == BlockID.SAND) { + } else if (block.getType() == BlockTypes.SAND) { editSession.setBlock(position.add(0, 1, 0), desertPattern.apply(position)); return true; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index c53374852..b5fdc60a7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -24,6 +24,8 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.util.TreeGenerator; @@ -50,17 +52,17 @@ public class ForestGenerator implements RegionFunction { @Override public boolean apply(Vector position) throws WorldEditException { BaseBlock block = editSession.getBlock(position); - int t = block.getType().getLegacyId(); + BlockType t = block.getType(); - if (t == BlockID.GRASS || t == BlockID.DIRT) { + if (t == BlockTypes.GRASS || t == BlockTypes.DIRT) { treeGenerator.generate(editSession, position.add(0, 1, 0)); return true; - } else if (t == BlockID.LONG_GRASS || t == BlockID.DEAD_BUSH || t == BlockID.RED_FLOWER || t == BlockID.YELLOW_FLOWER) { // TODO: This list needs to be moved - editSession.setBlock(position, new BaseBlock(0)); + } else if (t == BlockTypes.TALL_GRASS || t == BlockTypes.DEAD_BUSH || t == BlockTypes.POPPY || t == BlockTypes.DANDELION) { // TODO: This list needs to be moved + editSession.setBlock(position, new BaseBlock(BlockTypes.AIR)); treeGenerator.generate(editSession, position); return true; - } else if (t == BlockID.SNOW) { - editSession.setBlock(position, new BaseBlock(BlockID.AIR)); + } else if (t == BlockTypes.SNOW) { + editSession.setBlock(position, new BaseBlock(BlockTypes.AIR)); return false; } else { // Trees won't grow on this! return false; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index 3268d15cb..e0da9361b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -87,25 +87,25 @@ public class GardenPatchGenerator implements RegionFunction { */ private void placeVine(Vector basePos, Vector pos) throws MaxChangedBlocksException { if (pos.distance(basePos) > 4) return; - if (editSession.getBlockType(pos) != 0) return; + if (!editSession.getBlock(pos).isAir()) return; for (int i = -1; i > -3; --i) { Vector testPos = pos.add(0, i, 0); - if (editSession.getBlockType(testPos) == BlockID.AIR) { + if (editSession.getBlock(testPos).isAir()) { pos = testPos; } else { break; } } - editSession.setBlockIfAir(pos, new BaseBlock(BlockID.LEAVES)); + editSession.setBlockIfAir(pos, new BaseBlock(BlockTypes.OAK_LEAVES)); affected++; int t = random.nextInt(4); int h = random.nextInt(3) - 1; Vector p; - BaseBlock log = new BaseBlock(BlockID.LOG); + BaseBlock log = new BaseBlock(BlockTypes.OAK_LOG); switch (t) { case 0: @@ -160,17 +160,19 @@ public class GardenPatchGenerator implements RegionFunction { @Override public boolean apply(Vector position) throws WorldEditException { - if (!editSession.getBlock(position).getType().getId().equals(BlockTypes.AIR)) { + if (!editSession.getBlock(position).isAir()) { position = position.add(0, 1, 0); } - if (!editSession.getBlock(position.add(0, -1, 0)).getType().getId().equals(BlockTypes.GRASS)) { + if (editSession.getBlock(position.add(0, -1, 0)).getType() != BlockTypes.GRASS) { return false; } - BaseBlock leavesBlock = new BaseBlock(BlockID.LEAVES); + BaseBlock leavesBlock = new BaseBlock(BlockTypes.OAK_LEAVES); - editSession.setBlockIfAir(position, leavesBlock); + if (editSession.getBlock(position).isAir()) { + editSession.setBlock(position, leavesBlock); + } placeVine(position, position.add(0, 0, 1)); placeVine(position, position.add(0, 0, -1)); @@ -188,7 +190,7 @@ public class GardenPatchGenerator implements RegionFunction { public static Pattern getPumpkinPattern() { RandomPattern pattern = new RandomPattern(); for (int i = 0; i < 4; i++) { - pattern.add(new BlockPattern(new BaseBlock(BlockID.PUMPKIN, i)), 100); + pattern.add(new BlockPattern(new BaseBlock(BlockTypes.PUMPKIN, i)), 100); } return pattern; } @@ -199,6 +201,6 @@ public class GardenPatchGenerator implements RegionFunction { * @return a melon pattern */ public static Pattern getMelonPattern() { - return new BlockPattern(new BaseBlock(BlockID.MELON_BLOCK)); + return new BlockPattern(new BaseBlock(BlockTypes.MELON_BLOCK)); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java index a633b3243..fd98c1a64 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java @@ -42,7 +42,7 @@ public class ExistingBlockMask extends AbstractExtentMask { @Override public boolean test(Vector vector) { - return getExtent().getLazyBlock(vector).getType().getLegacyId() != BlockID.AIR; + return !getExtent().getLazyBlock(vector).isAir(); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index 28f1c0bd7..45c85a99a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.regions.Region; @@ -123,7 +122,7 @@ public class HeightMap { int originZ = minY.getBlockZ(); int maxY = region.getMaximumPoint().getBlockY(); - BaseBlock fillerAir = new BaseBlock(BlockID.AIR); + BaseBlock fillerAir = new BaseBlock(BlockTypes.AIR); int blocksChanged = 0; @@ -149,8 +148,8 @@ public class HeightMap { BaseBlock existing = session.getBlock(new Vector(xr, curHeight, zr)); // Skip water/lava - if (!existing.getType().getId().equals(BlockTypes.WATER) && !existing.getType().getId().equals(BlockTypes.STATIONARY_WATER) - && !existing.getType().getId().equals(BlockTypes.LAVA) && !existing.getType().getId().equals(BlockTypes.STATIONARY_LAVA)) { + if (existing.getType() != BlockTypes.WATER && existing.getType() != BlockTypes.FLOWING_WATER + && existing.getType() != BlockTypes.LAVA && existing.getType() != BlockTypes.FLOWING_LAVA) { session.setBlock(new Vector(xr, newHeight, zr), existing); ++blocksChanged; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java index 070a3527f..dc80c5345 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java @@ -73,9 +73,7 @@ public class RegionIntersection extends AbstractRegion { super(world); checkNotNull(regions); checkArgument(!regions.isEmpty(), "empty region list is not supported"); - for (Region region : regions) { - this.regions.add(region); - } + this.regions.addAll(regions); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java index 8f7642794..e630555b6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.regions.Region; @@ -113,7 +114,7 @@ public abstract class ArbitraryShape { case -2: // type and data 0 - return new BaseBlock(0, 0); + return new BaseBlock(BlockTypes.AIR); } return new BaseBlock(cacheEntry & 255, ((cacheEntry >> 8) - 1) & 15); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java index 18c9b0702..504d02b77 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import javax.annotation.Nullable; import java.util.Collections; @@ -198,8 +199,8 @@ public class TreeGenerator { int trunkHeight = (int) Math.floor(Math.random() * 2) + 3; int height = (int) Math.floor(Math.random() * 5) + 8; - BaseBlock logBlock = new BaseBlock(BlockID.LOG); - BaseBlock leavesBlock = new BaseBlock(BlockID.LEAVES); + BaseBlock logBlock = new BaseBlock(BlockTypes.OAK_LOG); + BaseBlock leavesBlock = new BaseBlock(BlockTypes.OAK_LEAVES); // Create trunk for (int i = 0; i < trunkHeight; ++i) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java index c6bb755bd..08cf70e18 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.util.formatting; import com.google.common.base.Joiner; +import java.util.Arrays; import java.util.LinkedList; import java.util.List; @@ -183,9 +184,7 @@ public class ColorCodeBuilder { if ((transformed = transform(wordStr)) != null) { line.append(transformed); } else { - for (String partialWord : word.toString().split("(?<=\\G.{" + lineLength + "})")) { - lines.add(partialWord); - } + lines.addAll(Arrays.asList(word.toString().split("(?<=\\G.{" + lineLength + "})"))); } } else if (line.length() + word.length() - lineColorChars == lineLength) { // Line exactly the correct length...newline line.append(' '); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index 7be4843cc..fea1e00da 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -29,6 +29,7 @@ import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.Mask; @@ -102,10 +103,10 @@ public abstract class AbstractWorld implements World { @Override public Mask createLiquidMask() { return new BlockMask(this, - new BaseBlock(BlockID.STATIONARY_LAVA, -1), - new BaseBlock(BlockID.LAVA, -1), - new BaseBlock(BlockID.STATIONARY_WATER, -1), - new BaseBlock(BlockID.WATER, -1)); + new BaseBlock(BlockTypes.LAVA, -1), + new BaseBlock(BlockTypes.FLOWING_LAVA, -1), + new BaseBlock(BlockTypes.WATER, -1), + new BaseBlock(BlockTypes.FLOWING_WATER, -1)); } @Override @@ -140,7 +141,7 @@ public abstract class AbstractWorld implements World { } try { - setBlock(pt, new BaseBlock(BlockID.AIR)); + setBlock(pt, new BaseBlock(BlockTypes.AIR)); } catch (WorldEditException e) { throw new RuntimeException(e); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java index 1edfaadb3..3a13ae21b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -26,7 +26,7 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.regions.Region; @@ -102,12 +102,12 @@ public class NullWorld extends AbstractWorld { @Override public BaseBlock getBlock(Vector position) { - return new BaseBlock(BlockID.AIR); + return new BaseBlock(BlockTypes.AIR); } @Override public BaseBlock getLazyBlock(Vector position) { - return new BaseBlock(BlockID.AIR); + return new BaseBlock(BlockTypes.AIR); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java index b46467ea4..12c8f6d63 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java @@ -80,11 +80,9 @@ public abstract class LegacyChunkStore extends ChunkStore { + "." + Integer.toString(z, 36) + ".dat"; InputStream stream = getInputStream(folder1, folder2, filename); - NBTInputStream nbt = new NBTInputStream( - new GZIPInputStream(stream)); Tag tag; - try { + try (NBTInputStream nbt = new NBTInputStream(new GZIPInputStream(stream))) { tag = nbt.readNamedTag().getTag(); if (!(tag instanceof CompoundTag)) { throw new ChunkStoreException("CompoundTag expected for chunk; got " @@ -112,8 +110,6 @@ public abstract class LegacyChunkStore extends ChunkStore { } return rootTag; - } finally { - nbt.close(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/McRegionChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/McRegionChunkStore.java index f7c5fd691..30b2b42ff 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/McRegionChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/McRegionChunkStore.java @@ -71,10 +71,9 @@ public abstract class McRegionChunkStore extends ChunkStore { McRegionReader reader = getReader(position, world.getName()); InputStream stream = reader.getChunkInputStream(position); - NBTInputStream nbt = new NBTInputStream(stream); Tag tag; - try { + try (NBTInputStream nbt = new NBTInputStream(stream)) { tag = nbt.readNamedTag().getTag(); if (!(tag instanceof CompoundTag)) { throw new ChunkStoreException("CompoundTag expected for chunk; got " + tag.getClass().getName()); @@ -100,8 +99,6 @@ public abstract class McRegionChunkStore extends ChunkStore { } return rootTag; - } finally { - nbt.close(); } } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index 8cf24040d..0d3577575 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -123,7 +123,7 @@ public class SpongePlayer extends AbstractPlayerActor { @Override public void printRaw(String msg) { for (String part : msg.split("\n")) { - this.player.sendMessage(TextSerializers.LEGACY_FORMATTING_CODE.deserialize(part)); + this.player.sendMessage(TextSerializers.FORMATTING_CODE.deserialize(part)); } } @@ -144,7 +144,7 @@ public class SpongePlayer extends AbstractPlayerActor { private void sendColorized(String msg, TextColor formatting) { for (String part : msg.split("\n")) { - this.player.sendMessage(Text.of(formatting, TextSerializers.LEGACY_FORMATTING_CODE.deserialize(part))); + this.player.sendMessage(Text.of(formatting, TextSerializers.FORMATTING_CODE.deserialize(part))); } } From d5012bb07216b14543f5dd4f8ab1ecceb0486031 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 3 Jan 2018 16:49:57 +1000 Subject: [PATCH 03/74] Rename legacy things to bundled things. --- .../worldedit/bukkit/BukkitWorldData.java | 4 +-- .../com/sk89q/worldedit/world/NullWorld.java | 4 +-- .../world/registry/BundledBlockData.java | 34 ------------------- ...egistry.java => BundledBlockRegistry.java} | 2 +- ...cyWorldData.java => BundledWorldData.java} | 14 ++++---- .../transform/BlockTransformExtentTest.java | 4 +-- .../sk89q/worldedit/forge/ForgeWorldData.java | 4 +-- .../worldedit/sponge/SpongeWorldData.java | 4 +-- 8 files changed, 18 insertions(+), 52 deletions(-) rename worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/{LegacyBlockRegistry.java => BundledBlockRegistry.java} (96%) rename worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/{LegacyWorldData.java => BundledWorldData.java} (79%) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorldData.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorldData.java index 6d747f4aa..c6bd94a54 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorldData.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorldData.java @@ -20,12 +20,12 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.world.registry.BiomeRegistry; -import com.sk89q.worldedit.world.registry.LegacyWorldData; +import com.sk89q.worldedit.world.registry.BundledWorldData; /** * World data for the Bukkit platform. */ -class BukkitWorldData extends LegacyWorldData { +class BukkitWorldData extends BundledWorldData { private static final BukkitWorldData INSTANCE = new BukkitWorldData(); private final BiomeRegistry biomeRegistry = new BukkitBiomeRegistry(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java index 3a13ae21b..049fecfbe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -33,7 +33,7 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.LegacyWorldData; +import com.sk89q.worldedit.world.registry.BundledWorldData; import com.sk89q.worldedit.world.registry.WorldData; import javax.annotation.Nullable; @@ -97,7 +97,7 @@ public class NullWorld extends AbstractWorld { @Override public WorldData getWorldData() { - return LegacyWorldData.getInstance(); + return BundledWorldData.getInstance(); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index dd565b0fb..7cf8491be 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -144,23 +144,6 @@ public class BundledBlockData { } } - /** - * Get the material properties for the given block. - * - * @param id the legacy numeric ID - * @return the material's properties, or null - */ - @Nullable - @Deprecated - public BlockMaterial getMaterialById(int id) { - BlockEntry entry = findById(id); - if (entry != null) { - return entry.material; - } else { - return null; - } - } - /** * Get the material properties for the given block. * @@ -177,23 +160,6 @@ public class BundledBlockData { } } - /** - * Get the states for the given block. - * - * @param id the legacy numeric ID - * @return the block's states, or null if no information is available - */ - @Nullable - @Deprecated - public Map getStatesById(int id) { - BlockEntry entry = findById(id); - if (entry != null) { - return entry.states; - } else { - return null; - } - } - /** * Get the states for the given block. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java similarity index 96% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyBlockRegistry.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 773fc132a..6e0606ef9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -30,7 +30,7 @@ import java.util.Map; * A block registry that uses {@link BundledBlockData} to serve information * about blocks. */ -public class LegacyBlockRegistry implements BlockRegistry { +public class BundledBlockRegistry implements BlockRegistry { @Nullable @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyWorldData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java similarity index 79% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyWorldData.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java index c5e116c66..fdf3c9b71 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyWorldData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java @@ -20,13 +20,13 @@ package com.sk89q.worldedit.world.registry; /** - * An implementation of {@link WorldData} that uses legacy numeric IDs and - * a built-in block database. + * An implementation of {@link WorldData} that converts legacy numeric IDs and + * a contains a built-in block database. */ -public class LegacyWorldData implements WorldData { +public class BundledWorldData implements WorldData { - private static final LegacyWorldData INSTANCE = new LegacyWorldData(); - private final LegacyBlockRegistry blockRegistry = new LegacyBlockRegistry(); + private static final BundledWorldData INSTANCE = new BundledWorldData(); + private final BundledBlockRegistry blockRegistry = new BundledBlockRegistry(); private final NullItemRegistry itemRegistry = new NullItemRegistry(); private final NullEntityRegistry entityRegistry = new NullEntityRegistry(); private final NullBiomeRegistry biomeRegistry = new NullBiomeRegistry(); @@ -34,7 +34,7 @@ public class LegacyWorldData implements WorldData { /** * Create a new instance. */ - protected LegacyWorldData() { + protected BundledWorldData() { } @Override @@ -62,7 +62,7 @@ public class LegacyWorldData implements WorldData { * * @return an instance */ - public static LegacyWorldData getInstance() { + public static BundledWorldData getInstance() { return INSTANCE; } diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java index f6649dbe9..1b3c56824 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java @@ -25,7 +25,7 @@ import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.world.registry.BlockRegistry; -import com.sk89q.worldedit.world.registry.LegacyBlockRegistry; +import com.sk89q.worldedit.world.registry.BundledBlockRegistry; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -54,7 +54,7 @@ public class BlockTransformExtentTest { @Test public void testTransform() throws Exception { - BlockRegistry blockRegistry = new LegacyBlockRegistry(); + BlockRegistry blockRegistry = new BundledBlockRegistry(); for (BlockType type : BlockType.values()) { if (ignored.contains(type)) { continue; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldData.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldData.java index de23b9a85..0a6784727 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldData.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldData.java @@ -21,12 +21,12 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.world.registry.BiomeRegistry; import com.sk89q.worldedit.world.registry.ItemRegistry; -import com.sk89q.worldedit.world.registry.LegacyWorldData; +import com.sk89q.worldedit.world.registry.BundledWorldData; /** * World data for the Forge platform. */ -class ForgeWorldData extends LegacyWorldData { +class ForgeWorldData extends BundledWorldData { private static final ForgeWorldData INSTANCE = new ForgeWorldData(); private final BiomeRegistry biomeRegistry = new ForgeBiomeRegistry(); diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldData.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldData.java index 789dfc0c3..752342c1e 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldData.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldData.java @@ -20,12 +20,12 @@ package com.sk89q.worldedit.sponge; import com.sk89q.worldedit.world.registry.BiomeRegistry; -import com.sk89q.worldedit.world.registry.LegacyWorldData; +import com.sk89q.worldedit.world.registry.BundledWorldData; /** * World data for the Sponge platform. */ -class SpongeWorldData extends LegacyWorldData { +class SpongeWorldData extends BundledWorldData { private static final SpongeWorldData INSTANCE = new SpongeWorldData(); private final BiomeRegistry biomeRegistry = new SpongeBiomeRegistry(); From 3aff57d071a2d5c5d2bd747f8eec9993df5bd3f4 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 3 Jan 2018 17:06:58 +1000 Subject: [PATCH 04/74] Bumped version and fixed LazyBlock issue. --- build.gradle | 2 +- .../java/com/sk89q/worldedit/blocks/BaseBlock.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 6544aace1..000fd44ee 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ buildscript { allprojects { group = 'com.sk89q.worldedit' - version = '6.1.10-SNAPSHOT' + version = '7.0.0-SNAPSHOT' } if (!project.hasProperty("artifactory_contextUrl")) ext.artifactory_contextUrl = "http://localhost" diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 9a9759bb1..40f3c0f30 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -81,7 +81,7 @@ public class BaseBlock extends Block implements TileEntityBlock { */ @Deprecated public BaseBlock(int id) { - setId(id); + internalSetId(id); internalSetData(0); } @@ -104,7 +104,7 @@ public class BaseBlock extends Block implements TileEntityBlock { */ @Deprecated public BaseBlock(int id, int data) { - setId(id); + internalSetId(id); internalSetData(data); } @@ -133,7 +133,7 @@ public class BaseBlock extends Block implements TileEntityBlock { */ @Deprecated public BaseBlock(int id, int data, @Nullable CompoundTag nbtData) { - setId(id); + internalSetId(id); setData(data); setNbtData(nbtData); } @@ -195,6 +195,11 @@ public class BaseBlock extends Block implements TileEntityBlock { @Override @Deprecated public void setId(int id) { + internalSetId(id); + } + + @Deprecated + private void internalSetId(int id) { BlockType type = BlockTypes.getBlockType(BundledBlockData.getInstance().fromLegacyId(id)); internalSetType(type); } From d12ad2548a138e839da4a638d2a5fdaa17b10319 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 3 Jan 2018 17:18:43 +1000 Subject: [PATCH 05/74] Add block registration to Forge WorldEdit. --- .../com/sk89q/worldedit/blocks/LazyBlock.java | 40 +++++++++++++++++++ .../sk89q/worldedit/forge/ForgeWorldEdit.java | 9 +++++ 2 files changed, 49 insertions(+) diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java index cb34a71d3..2a55ba4d8 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.extent.Extent; import static com.google.common.base.Preconditions.checkNotNull; @@ -49,6 +50,22 @@ public class LazyBlock extends BaseBlock { * @param extent the extent to later load the full block data from * @param position the position to later load the full block data from */ + public LazyBlock(BlockType type, Extent extent, Vector position) { + super(type); + checkNotNull(extent); + checkNotNull(position); + this.extent = extent; + this.position = position; + } + + /** + * Create a new lazy block. + * + * @param type the block type + * @param extent the extent to later load the full block data from + * @param position the position to later load the full block data from + */ + @Deprecated public LazyBlock(int type, Extent extent, Vector position) { super(type); checkNotNull(extent); @@ -65,6 +82,24 @@ public class LazyBlock extends BaseBlock { * @param extent the extent to later load the full block data from * @param position the position to later load the full block data from */ + @Deprecated + public LazyBlock(BlockType type, int data, Extent extent, Vector position) { + super(type, data); + checkNotNull(extent); + checkNotNull(position); + this.extent = extent; + this.position = position; + } + + /** + * Create a new lazy block. + * + * @param type the block type + * @param data the data value + * @param extent the extent to later load the full block data from + * @param position the position to later load the full block data from + */ + @Deprecated public LazyBlock(int type, int data, Extent extent, Vector position) { super(type, data); checkNotNull(extent); @@ -83,6 +118,11 @@ public class LazyBlock extends BaseBlock { throw new UnsupportedOperationException("This object is immutable"); } + @Override + public void setType(BlockType type) { + throw new UnsupportedOperationException("This object is immutable"); + } + @Override public CompoundTag getNbtData() { if (!loaded) { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index 11d20c2f4..de09c5f64 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.forge; +import net.minecraft.block.Block; +import net.minecraftforge.fml.common.registry.ForgeRegistries; import org.apache.logging.log4j.Logger; import com.google.common.base.Joiner; @@ -54,8 +56,11 @@ import net.minecraftforge.fml.common.event.FMLServerStartedEvent; import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; import net.minecraftforge.fml.common.eventhandler.Event.Result; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.spongepowered.api.Sponge; +import org.spongepowered.api.block.BlockType; import static com.google.common.base.Preconditions.checkNotNull; +import static net.minecraft.block.Block.REGISTRY; /** * The Forge implementation of WorldEdit. @@ -121,6 +126,10 @@ public class ForgeWorldEdit { } else { this.provider = new ForgePermissionsProvider.VanillaPermissionsProvider(platform); } + + for (Block block : REGISTRY) { + com.sk89q.worldedit.blocks.type.BlockTypes.registerBlock(new com.sk89q.worldedit.blocks.type.BlockType(REGISTRY.getNameForObject(block).toString())); + } } @EventHandler From 07ade0b083741a08101da840517ac5572983f235 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 11 Jun 2018 23:45:19 +1000 Subject: [PATCH 06/74] Phase 1 of Item conversion --- worldedit-bukkit/build.gradle | 3 + .../com/sk89q/worldedit/blocks/ItemType.java | 3 + .../sk89q/worldedit/blocks/type/ItemType.java | 67 + .../worldedit/blocks/type/ItemTypes.java | 61 + .../world/registry/BundledItemData.java | 167 + .../world/registry/BundledItemRegistry.java | 50 + .../world/registry/BundledWorldData.java | 4 +- .../sk89q/worldedit/world/registry/items.json | 5798 +++++++++++++++++ 8 files changed, 6151 insertions(+), 2 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java create mode 100644 worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 2413532e3..d396a2574 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -1,13 +1,16 @@ apply plugin: 'eclipse' apply plugin: 'idea' +apply plugin: 'maven' repositories { + mavenLocal() maven { url "https://hub.spigotmc.org/nexus/content/groups/public" } } dependencies { compile project(':worldedit-core') compile 'com.sk89q:dummypermscompat:1.8' +// compile 'org.bukkit:bukkit:18w15a-R0.1-SNAPSHOT' // zzz compile 'org.bukkit:bukkit:1.9.4-R0.1-SNAPSHOT' // zzz testCompile 'org.mockito:mockito-core:1.9.0-rc1' } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java index 0e15aca7c..97e95e86b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java @@ -31,7 +31,10 @@ import java.util.Set; /** * An enum of types of items. + * + * {@Deprecated Please use {@link com.sk89q.worldedit.blocks.type.ItemType}} */ +@Deprecated public enum ItemType { // Blocks diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java new file mode 100644 index 000000000..d83034bf6 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java @@ -0,0 +1,67 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import com.sk89q.worldedit.world.registry.BundledItemData; + +public class ItemType { + + private String id; + + public ItemType(String id) { + this.id = id; + } + + public String getId() { + return this.id; + } + + /** + * Gets the legacy ID. Needed for legacy reasons. + * + * DO NOT USE THIS. + * + * @return legacy id or 0, if unknown + */ + @Deprecated + public int getLegacyId() { + Integer id = BundledItemData.getInstance().toLegacyId(this.id); + if (id != null) { + return id; + } else { + return 0; + } + } + + @Deprecated + public com.sk89q.worldedit.blocks.ItemType getLegacyType() { + return com.sk89q.worldedit.blocks.ItemType.fromID(getLegacyId()); + } + + @Override + public int hashCode() { + return this.id.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof ItemType && this.id.equals(((ItemType) obj).id); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java new file mode 100644 index 000000000..c9c671b4e --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java @@ -0,0 +1,61 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; + +public class ItemTypes { + + private ItemTypes() { + } + + // TODO Add items. + + private static final Map itemMapping = new HashMap<>(); + + static { + for (Field field : ItemTypes.class.getFields()) { + if (field.getType() == ItemType.class) { + try { + registerItem((ItemType) field.get(null)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + } + + public static void registerItem(ItemType itemType) { + if (itemMapping.containsKey(itemType.getId()) && !itemType.getId().startsWith("minecraft:")) { + throw new IllegalArgumentException("Existing item with this ID already registered"); + } + + itemMapping.put(itemType.getId(), itemType); + } + + @Nullable + public static ItemType getItemType(String id) { + return itemMapping.get(id); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java new file mode 100644 index 000000000..c8a238409 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java @@ -0,0 +1,167 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry; + +import com.google.common.io.Resources; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.util.gson.VectorAdapter; + +import java.io.IOException; +import java.net.URL; +import java.nio.charset.Charset; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.annotation.Nullable; + +/** + * Provides item data based on the built-in item database that is bundled + * with WorldEdit. + * + *

A new instance cannot be created. Use {@link #getInstance()} to get + * an instance.

+ * + *

The data is read from a JSON file that is bundled with WorldEdit. If + * reading fails (which occurs when this class is first instantiated), then + * the methods will return {@code null}s for all items.

+ */ +public class BundledItemData { + + private static final Logger log = Logger.getLogger(BundledItemData.class.getCanonicalName()); + private static final BundledItemData INSTANCE = new BundledItemData(); + + private final Map idMap = new HashMap<>(); + private final Map legacyMap = new HashMap<>(); // Trove usage removed temporarily + + /** + * Create a new instance. + */ + private BundledItemData() { + try { + loadFromResource(); + } catch (IOException e) { + log.log(Level.WARNING, "Failed to load the built-in item registry", e); + } + } + + /** + * Attempt to load the data from file. + * + * @throws IOException thrown on I/O error + */ + private void loadFromResource() throws IOException { + GsonBuilder gsonBuilder = new GsonBuilder(); + gsonBuilder.registerTypeAdapter(Vector.class, new VectorAdapter()); + Gson gson = gsonBuilder.create(); + URL url = BundledItemData.class.getResource("items.json"); + if (url == null) { + throw new IOException("Could not find items.json"); + } + String data = Resources.toString(url, Charset.defaultCharset()); + List entries = gson.fromJson(data, new TypeToken>() {}.getType()); + + for (ItemEntry entry : entries) { + idMap.put(entry.id, entry); + if (entry.legacyId >= 0) { + legacyMap.put(entry.legacyId, entry); + } + } + } + + /** + * Return the entry for the given item ID. + * + * @param id the ID + * @return the entry, or null + */ + @Nullable + private ItemEntry findById(String id) { + return idMap.get(id); + } + + /** + * Return the entry for the given item legacy numeric ID. + * + * @param id the ID + * @return the entry, or null + */ + @Nullable + private ItemEntry findById(int id) { + return legacyMap.get(id); + } + + /** + * Convert the given string ID to a legacy numeric ID. + * + * @param id the ID + * @return the legacy ID, which may be null if the item does not have a legacy ID + */ + @Nullable + public Integer toLegacyId(String id) { + ItemEntry entry = findById(id); + if (entry != null) { + return entry.legacyId; + } else { + return null; + } + } + + /** + * Convert the given legacy numeric ID to a string ID. + * + * @param id the legacy ID + * @return the ID, which may be null if the item does not have a ID + */ + @Nullable + public String fromLegacyId(Integer id) { + ItemEntry entry = findById(id); + if (entry != null) { + return entry.id; + } else { + return null; + } + } + + /** + * Get a singleton instance of this object. + * + * @return the instance + */ + public static BundledItemData getInstance() { + return INSTANCE; + } + + private static class ItemEntry { + private int legacyId; // -1 for items without legacy IDs. + private short legacyData; + private String id; + private String unlocalizedName; + private String localizedName; + private int maxDamage; + private int maxStackSize; + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java new file mode 100644 index 000000000..d0474ec4d --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java @@ -0,0 +1,50 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry; + +import com.sk89q.worldedit.blocks.BaseItem; +import com.sk89q.worldedit.blocks.type.ItemTypes; + +import javax.annotation.Nullable; + +/** + * A item registry that uses {@link BundledItemRegistry} to serve information + * about items. + */ +public class BundledItemRegistry implements ItemRegistry { + + @Nullable + @Override + public BaseItem createFromId(String id) { + // TODO Fix legacy ID usage + return new BaseItem(ItemTypes.getItemType(id).getLegacyId()); + } + + @Nullable + @Override + public BaseItem createFromId(int legacyId) { + String id = BundledItemData.getInstance().fromLegacyId(legacyId); + if (id != null) { + return createFromId(id); + } else { + return null; + } + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java index fdf3c9b71..27147e2b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java @@ -21,13 +21,13 @@ package com.sk89q.worldedit.world.registry; /** * An implementation of {@link WorldData} that converts legacy numeric IDs and - * a contains a built-in block database. + * a contains a built-in block and item database. */ public class BundledWorldData implements WorldData { private static final BundledWorldData INSTANCE = new BundledWorldData(); private final BundledBlockRegistry blockRegistry = new BundledBlockRegistry(); - private final NullItemRegistry itemRegistry = new NullItemRegistry(); + private final BundledItemRegistry itemRegistry = new BundledItemRegistry(); private final NullEntityRegistry entityRegistry = new NullEntityRegistry(); private final NullBiomeRegistry biomeRegistry = new NullBiomeRegistry(); diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json new file mode 100644 index 000000000..f1b94a1cc --- /dev/null +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json @@ -0,0 +1,5798 @@ +[ + { + "legacyId": 0, + "legacyData": 0, + "id": "minecraft:air", + "unlocalizedName": "tile.air", + "localizedName": "Air", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 1, + "legacyData": 0, + "id": "minecraft:stone", + "unlocalizedName": "tile.stone.stone", + "localizedName": "Stone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 1, + "legacyData": 1, + "id": "minecraft:stone", + "unlocalizedName": "tile.stone.granite", + "localizedName": "Granite", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 1, + "legacyData": 2, + "id": "minecraft:stone", + "unlocalizedName": "tile.stone.graniteSmooth", + "localizedName": "Polished Granite", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 1, + "legacyData": 3, + "id": "minecraft:stone", + "unlocalizedName": "tile.stone.diorite", + "localizedName": "Diorite", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 1, + "legacyData": 4, + "id": "minecraft:stone", + "unlocalizedName": "tile.stone.dioriteSmooth", + "localizedName": "Polished Diorite", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 1, + "legacyData": 5, + "id": "minecraft:stone", + "unlocalizedName": "tile.stone.andesite", + "localizedName": "Andesite", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 1, + "legacyData": 6, + "id": "minecraft:stone", + "unlocalizedName": "tile.stone.andesiteSmooth", + "localizedName": "Polished Andesite", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 2, + "legacyData": 0, + "id": "minecraft:grass", + "unlocalizedName": "tile.grass", + "localizedName": "Grass Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 3, + "legacyData": 0, + "id": "minecraft:dirt", + "unlocalizedName": "tile.dirt.default", + "localizedName": "Dirt", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 3, + "legacyData": 1, + "id": "minecraft:dirt", + "unlocalizedName": "tile.dirt.coarse", + "localizedName": "Coarse Dirt", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 3, + "legacyData": 2, + "id": "minecraft:dirt", + "unlocalizedName": "tile.dirt.podzol", + "localizedName": "Podzol", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 4, + "legacyData": 0, + "id": "minecraft:cobblestone", + "unlocalizedName": "tile.stonebrick", + "localizedName": "Cobblestone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 5, + "legacyData": 0, + "id": "minecraft:planks", + "unlocalizedName": "tile.wood.oak", + "localizedName": "Oak Wood Planks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 5, + "legacyData": 1, + "id": "minecraft:planks", + "unlocalizedName": "tile.wood.spruce", + "localizedName": "Spruce Wood Planks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 5, + "legacyData": 2, + "id": "minecraft:planks", + "unlocalizedName": "tile.wood.birch", + "localizedName": "Birch Wood Planks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 5, + "legacyData": 3, + "id": "minecraft:planks", + "unlocalizedName": "tile.wood.jungle", + "localizedName": "Jungle Wood Planks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 5, + "legacyData": 4, + "id": "minecraft:planks", + "unlocalizedName": "tile.wood.acacia", + "localizedName": "Acacia Wood Planks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 5, + "legacyData": 5, + "id": "minecraft:planks", + "unlocalizedName": "tile.wood.big_oak", + "localizedName": "Dark Oak Wood Planks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 6, + "legacyData": 0, + "id": "minecraft:sapling", + "unlocalizedName": "tile.sapling.oak", + "localizedName": "Oak Sapling", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 6, + "legacyData": 1, + "id": "minecraft:sapling", + "unlocalizedName": "tile.sapling.spruce", + "localizedName": "Spruce Sapling", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 6, + "legacyData": 2, + "id": "minecraft:sapling", + "unlocalizedName": "tile.sapling.birch", + "localizedName": "Birch Sapling", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 6, + "legacyData": 3, + "id": "minecraft:sapling", + "unlocalizedName": "tile.sapling.jungle", + "localizedName": "Jungle Sapling", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 6, + "legacyData": 4, + "id": "minecraft:sapling", + "unlocalizedName": "tile.sapling.acacia", + "localizedName": "Acacia Sapling", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 6, + "legacyData": 5, + "id": "minecraft:sapling", + "unlocalizedName": "tile.sapling.big_oak", + "localizedName": "Dark Oak Sapling", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 7, + "legacyData": 0, + "id": "minecraft:bedrock", + "unlocalizedName": "tile.bedrock", + "localizedName": "Bedrock", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 12, + "legacyData": 0, + "id": "minecraft:sand", + "unlocalizedName": "tile.sand.default", + "localizedName": "Sand", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 12, + "legacyData": 1, + "id": "minecraft:sand", + "unlocalizedName": "tile.sand.red", + "localizedName": "Red Sand", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 13, + "legacyData": 0, + "id": "minecraft:gravel", + "unlocalizedName": "tile.gravel", + "localizedName": "Gravel", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 14, + "legacyData": 0, + "id": "minecraft:gold_ore", + "unlocalizedName": "tile.oreGold", + "localizedName": "Gold Ore", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 15, + "legacyData": 0, + "id": "minecraft:iron_ore", + "unlocalizedName": "tile.oreIron", + "localizedName": "Iron Ore", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 16, + "legacyData": 0, + "id": "minecraft:coal_ore", + "unlocalizedName": "tile.oreCoal", + "localizedName": "Coal Ore", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 17, + "legacyData": 0, + "id": "minecraft:log", + "unlocalizedName": "tile.log.oak", + "localizedName": "Oak Wood", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 17, + "legacyData": 1, + "id": "minecraft:log", + "unlocalizedName": "tile.log.spruce", + "localizedName": "Spruce Wood", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 17, + "legacyData": 2, + "id": "minecraft:log", + "unlocalizedName": "tile.log.birch", + "localizedName": "Birch Wood", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 17, + "legacyData": 3, + "id": "minecraft:log", + "unlocalizedName": "tile.log.jungle", + "localizedName": "Jungle Wood", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 18, + "legacyData": 0, + "id": "minecraft:leaves", + "unlocalizedName": "tile.leaves.oak", + "localizedName": "Oak Leaves", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 18, + "legacyData": 1, + "id": "minecraft:leaves", + "unlocalizedName": "tile.leaves.spruce", + "localizedName": "Spruce Leaves", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 18, + "legacyData": 2, + "id": "minecraft:leaves", + "unlocalizedName": "tile.leaves.birch", + "localizedName": "Birch Leaves", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 18, + "legacyData": 3, + "id": "minecraft:leaves", + "unlocalizedName": "tile.leaves.jungle", + "localizedName": "Jungle Leaves", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 19, + "legacyData": 0, + "id": "minecraft:sponge", + "unlocalizedName": "tile.sponge.dry", + "localizedName": "Sponge", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 19, + "legacyData": 1, + "id": "minecraft:sponge", + "unlocalizedName": "tile.sponge.wet", + "localizedName": "Wet Sponge", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 20, + "legacyData": 0, + "id": "minecraft:glass", + "unlocalizedName": "tile.glass", + "localizedName": "Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 21, + "legacyData": 0, + "id": "minecraft:lapis_ore", + "unlocalizedName": "tile.oreLapis", + "localizedName": "Lapis Lazuli Ore", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 22, + "legacyData": 0, + "id": "minecraft:lapis_block", + "unlocalizedName": "tile.blockLapis", + "localizedName": "Lapis Lazuli Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 23, + "legacyData": 0, + "id": "minecraft:dispenser", + "unlocalizedName": "tile.dispenser", + "localizedName": "Dispenser", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 24, + "legacyData": 0, + "id": "minecraft:sandstone", + "unlocalizedName": "tile.sandStone.default", + "localizedName": "Sandstone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 24, + "legacyData": 1, + "id": "minecraft:sandstone", + "unlocalizedName": "tile.sandStone.chiseled", + "localizedName": "Chiseled Sandstone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 24, + "legacyData": 2, + "id": "minecraft:sandstone", + "unlocalizedName": "tile.sandStone.smooth", + "localizedName": "Smooth Sandstone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 25, + "legacyData": 0, + "id": "minecraft:noteblock", + "unlocalizedName": "tile.musicBlock", + "localizedName": "Note Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 27, + "legacyData": 0, + "id": "minecraft:golden_rail", + "unlocalizedName": "tile.goldenRail", + "localizedName": "Powered Rail", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 28, + "legacyData": 0, + "id": "minecraft:detector_rail", + "unlocalizedName": "tile.detectorRail", + "localizedName": "Detector Rail", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 29, + "legacyData": 0, + "id": "minecraft:sticky_piston", + "unlocalizedName": "tile.pistonStickyBase", + "localizedName": "Sticky Piston", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 30, + "legacyData": 0, + "id": "minecraft:web", + "unlocalizedName": "tile.web", + "localizedName": "Cobweb", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 31, + "legacyData": 1, + "id": "minecraft:tallgrass", + "unlocalizedName": "tile.tallgrass.grass", + "localizedName": "Grass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 31, + "legacyData": 2, + "id": "minecraft:tallgrass", + "unlocalizedName": "tile.tallgrass.fern", + "localizedName": "Fern", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 32, + "legacyData": 0, + "id": "minecraft:deadbush", + "unlocalizedName": "tile.deadbush", + "localizedName": "Dead Bush", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 33, + "legacyData": 0, + "id": "minecraft:piston", + "unlocalizedName": "tile.pistonBase", + "localizedName": "Piston", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 0, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.white", + "localizedName": "White Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 1, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.orange", + "localizedName": "Orange Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 2, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.magenta", + "localizedName": "Magenta Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 3, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.lightBlue", + "localizedName": "Light Blue Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 4, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.yellow", + "localizedName": "Yellow Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 5, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.lime", + "localizedName": "Lime Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 6, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.pink", + "localizedName": "Pink Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 7, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.gray", + "localizedName": "Gray Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 8, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.silver", + "localizedName": "Light Gray Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 9, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.cyan", + "localizedName": "Cyan Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 10, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.purple", + "localizedName": "Purple Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 11, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.blue", + "localizedName": "Blue Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 12, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.brown", + "localizedName": "Brown Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 13, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.green", + "localizedName": "Green Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 14, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.red", + "localizedName": "Red Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 35, + "legacyData": 15, + "id": "minecraft:wool", + "unlocalizedName": "tile.cloth.black", + "localizedName": "Black Wool", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 37, + "legacyData": 0, + "id": "minecraft:yellow_flower", + "unlocalizedName": "tile.flower1.dandelion", + "localizedName": "Dandelion", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 38, + "legacyData": 0, + "id": "minecraft:red_flower", + "unlocalizedName": "tile.flower2.poppy", + "localizedName": "Poppy", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 38, + "legacyData": 1, + "id": "minecraft:red_flower", + "unlocalizedName": "tile.flower2.blueOrchid", + "localizedName": "Blue Orchid", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 38, + "legacyData": 2, + "id": "minecraft:red_flower", + "unlocalizedName": "tile.flower2.allium", + "localizedName": "Allium", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 38, + "legacyData": 3, + "id": "minecraft:red_flower", + "unlocalizedName": "tile.flower2.houstonia", + "localizedName": "Azure Bluet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 38, + "legacyData": 4, + "id": "minecraft:red_flower", + "unlocalizedName": "tile.flower2.tulipRed", + "localizedName": "Red Tulip", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 38, + "legacyData": 5, + "id": "minecraft:red_flower", + "unlocalizedName": "tile.flower2.tulipOrange", + "localizedName": "Orange Tulip", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 38, + "legacyData": 6, + "id": "minecraft:red_flower", + "unlocalizedName": "tile.flower2.tulipWhite", + "localizedName": "White Tulip", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 38, + "legacyData": 7, + "id": "minecraft:red_flower", + "unlocalizedName": "tile.flower2.tulipPink", + "localizedName": "Pink Tulip", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 38, + "legacyData": 8, + "id": "minecraft:red_flower", + "unlocalizedName": "tile.flower2.oxeyeDaisy", + "localizedName": "Oxeye Daisy", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 39, + "legacyData": 0, + "id": "minecraft:brown_mushroom", + "unlocalizedName": "tile.mushroom", + "localizedName": "Mushroom", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 40, + "legacyData": 0, + "id": "minecraft:red_mushroom", + "unlocalizedName": "tile.mushroom", + "localizedName": "Mushroom", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 41, + "legacyData": 0, + "id": "minecraft:gold_block", + "unlocalizedName": "tile.blockGold", + "localizedName": "Block of Gold", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 42, + "legacyData": 0, + "id": "minecraft:iron_block", + "unlocalizedName": "tile.blockIron", + "localizedName": "Block of Iron", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 44, + "legacyData": 0, + "id": "minecraft:stone_slab", + "unlocalizedName": "tile.stoneSlab.stone", + "localizedName": "Stone Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 44, + "legacyData": 1, + "id": "minecraft:stone_slab", + "unlocalizedName": "tile.stoneSlab.sand", + "localizedName": "Sandstone Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 44, + "legacyData": 3, + "id": "minecraft:stone_slab", + "unlocalizedName": "tile.stoneSlab.cobble", + "localizedName": "Cobblestone Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 44, + "legacyData": 4, + "id": "minecraft:stone_slab", + "unlocalizedName": "tile.stoneSlab.brick", + "localizedName": "Bricks Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 44, + "legacyData": 5, + "id": "minecraft:stone_slab", + "unlocalizedName": "tile.stoneSlab.smoothStoneBrick", + "localizedName": "Stone Bricks Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 44, + "legacyData": 6, + "id": "minecraft:stone_slab", + "unlocalizedName": "tile.stoneSlab.netherBrick", + "localizedName": "Nether Brick Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 44, + "legacyData": 7, + "id": "minecraft:stone_slab", + "unlocalizedName": "tile.stoneSlab.quartz", + "localizedName": "Quartz Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 45, + "legacyData": 0, + "id": "minecraft:brick_block", + "unlocalizedName": "tile.brick", + "localizedName": "Bricks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 46, + "legacyData": 0, + "id": "minecraft:tnt", + "unlocalizedName": "tile.tnt", + "localizedName": "TNT", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 47, + "legacyData": 0, + "id": "minecraft:bookshelf", + "unlocalizedName": "tile.bookshelf", + "localizedName": "Bookshelf", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 48, + "legacyData": 0, + "id": "minecraft:mossy_cobblestone", + "unlocalizedName": "tile.stoneMoss", + "localizedName": "Moss Stone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 49, + "legacyData": 0, + "id": "minecraft:obsidian", + "unlocalizedName": "tile.obsidian", + "localizedName": "Obsidian", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 50, + "legacyData": 0, + "id": "minecraft:torch", + "unlocalizedName": "tile.torch", + "localizedName": "Torch", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 52, + "legacyData": 0, + "id": "minecraft:mob_spawner", + "unlocalizedName": "tile.mobSpawner", + "localizedName": "Monster Spawner", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 53, + "legacyData": 0, + "id": "minecraft:oak_stairs", + "unlocalizedName": "tile.stairsWood", + "localizedName": "Oak Wood Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 54, + "legacyData": 0, + "id": "minecraft:chest", + "unlocalizedName": "tile.chest", + "localizedName": "Chest", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 56, + "legacyData": 0, + "id": "minecraft:diamond_ore", + "unlocalizedName": "tile.oreDiamond", + "localizedName": "Diamond Ore", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 57, + "legacyData": 0, + "id": "minecraft:diamond_block", + "unlocalizedName": "tile.blockDiamond", + "localizedName": "Block of Diamond", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 58, + "legacyData": 0, + "id": "minecraft:crafting_table", + "unlocalizedName": "tile.workbench", + "localizedName": "Crafting Table", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 60, + "legacyData": 0, + "id": "minecraft:farmland", + "unlocalizedName": "tile.farmland", + "localizedName": "Farmland", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 61, + "legacyData": 0, + "id": "minecraft:furnace", + "unlocalizedName": "tile.furnace", + "localizedName": "Furnace", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 65, + "legacyData": 0, + "id": "minecraft:ladder", + "unlocalizedName": "tile.ladder", + "localizedName": "Ladder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 66, + "legacyData": 0, + "id": "minecraft:rail", + "unlocalizedName": "tile.rail", + "localizedName": "Rail", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 67, + "legacyData": 0, + "id": "minecraft:stone_stairs", + "unlocalizedName": "tile.stairsStone", + "localizedName": "Cobblestone Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 69, + "legacyData": 0, + "id": "minecraft:lever", + "unlocalizedName": "tile.lever", + "localizedName": "Lever", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 70, + "legacyData": 0, + "id": "minecraft:stone_pressure_plate", + "unlocalizedName": "tile.pressurePlateStone", + "localizedName": "Stone Pressure Plate", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 72, + "legacyData": 0, + "id": "minecraft:wooden_pressure_plate", + "unlocalizedName": "tile.pressurePlateWood", + "localizedName": "Wooden Pressure Plate", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 73, + "legacyData": 0, + "id": "minecraft:redstone_ore", + "unlocalizedName": "tile.oreRedstone", + "localizedName": "Redstone Ore", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 76, + "legacyData": 0, + "id": "minecraft:redstone_torch", + "unlocalizedName": "tile.notGate", + "localizedName": "Redstone Torch", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 77, + "legacyData": 0, + "id": "minecraft:stone_button", + "unlocalizedName": "tile.button", + "localizedName": "Button", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 78, + "legacyData": 0, + "id": "minecraft:snow_layer", + "unlocalizedName": "tile.snow", + "localizedName": "Snow", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 79, + "legacyData": 0, + "id": "minecraft:ice", + "unlocalizedName": "tile.ice", + "localizedName": "Ice", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 80, + "legacyData": 0, + "id": "minecraft:snow", + "unlocalizedName": "tile.snow", + "localizedName": "Snow", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 81, + "legacyData": 0, + "id": "minecraft:cactus", + "unlocalizedName": "tile.cactus", + "localizedName": "Cactus", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 82, + "legacyData": 0, + "id": "minecraft:clay", + "unlocalizedName": "tile.clay", + "localizedName": "Clay", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 84, + "legacyData": 0, + "id": "minecraft:jukebox", + "unlocalizedName": "tile.jukebox", + "localizedName": "Jukebox", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 85, + "legacyData": 0, + "id": "minecraft:fence", + "unlocalizedName": "tile.fence", + "localizedName": "Oak Fence", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 86, + "legacyData": 0, + "id": "minecraft:pumpkin", + "unlocalizedName": "tile.pumpkin", + "localizedName": "Pumpkin", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 87, + "legacyData": 0, + "id": "minecraft:netherrack", + "unlocalizedName": "tile.hellrock", + "localizedName": "Netherrack", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 88, + "legacyData": 0, + "id": "minecraft:soul_sand", + "unlocalizedName": "tile.hellsand", + "localizedName": "Soul Sand", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 89, + "legacyData": 0, + "id": "minecraft:glowstone", + "unlocalizedName": "tile.lightgem", + "localizedName": "Glowstone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 91, + "legacyData": 0, + "id": "minecraft:lit_pumpkin", + "unlocalizedName": "tile.litpumpkin", + "localizedName": "Jack o\u0027Lantern", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 0, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.white", + "localizedName": "White Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 1, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.orange", + "localizedName": "Orange Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 2, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.magenta", + "localizedName": "Magenta Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 3, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.lightBlue", + "localizedName": "Light Blue Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 4, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.yellow", + "localizedName": "Yellow Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 5, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.lime", + "localizedName": "Lime Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 6, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.pink", + "localizedName": "Pink Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 7, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.gray", + "localizedName": "Gray Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 8, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.silver", + "localizedName": "Light Gray Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 9, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.cyan", + "localizedName": "Cyan Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 10, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.purple", + "localizedName": "Purple Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 11, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.blue", + "localizedName": "Blue Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 12, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.brown", + "localizedName": "Brown Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 13, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.green", + "localizedName": "Green Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 14, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.red", + "localizedName": "Red Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 95, + "legacyData": 15, + "id": "minecraft:stained_glass", + "unlocalizedName": "tile.stainedGlass.black", + "localizedName": "Black Stained Glass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 96, + "legacyData": 0, + "id": "minecraft:trapdoor", + "unlocalizedName": "tile.trapdoor", + "localizedName": "Wooden Trapdoor", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 97, + "legacyData": 0, + "id": "minecraft:monster_egg", + "unlocalizedName": "tile.monsterStoneEgg.stone", + "localizedName": "Stone Monster Egg", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 97, + "legacyData": 1, + "id": "minecraft:monster_egg", + "unlocalizedName": "tile.monsterStoneEgg.cobble", + "localizedName": "Cobblestone Monster Egg", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 97, + "legacyData": 2, + "id": "minecraft:monster_egg", + "unlocalizedName": "tile.monsterStoneEgg.brick", + "localizedName": "Stone Brick Monster Egg", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 97, + "legacyData": 3, + "id": "minecraft:monster_egg", + "unlocalizedName": "tile.monsterStoneEgg.mossybrick", + "localizedName": "Mossy Stone Brick Monster Egg", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 97, + "legacyData": 4, + "id": "minecraft:monster_egg", + "unlocalizedName": "tile.monsterStoneEgg.crackedbrick", + "localizedName": "Cracked Stone Brick Monster Egg", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 97, + "legacyData": 5, + "id": "minecraft:monster_egg", + "unlocalizedName": "tile.monsterStoneEgg.chiseledbrick", + "localizedName": "Chiseled Stone Brick Monster Egg", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 98, + "legacyData": 0, + "id": "minecraft:stonebrick", + "unlocalizedName": "tile.stonebricksmooth.default", + "localizedName": "Stone Bricks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 98, + "legacyData": 1, + "id": "minecraft:stonebrick", + "unlocalizedName": "tile.stonebricksmooth.mossy", + "localizedName": "Mossy Stone Bricks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 98, + "legacyData": 2, + "id": "minecraft:stonebrick", + "unlocalizedName": "tile.stonebricksmooth.cracked", + "localizedName": "Cracked Stone Bricks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 98, + "legacyData": 3, + "id": "minecraft:stonebrick", + "unlocalizedName": "tile.stonebricksmooth.chiseled", + "localizedName": "Chiseled Stone Bricks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 99, + "legacyData": 0, + "id": "minecraft:brown_mushroom_block", + "unlocalizedName": "tile.mushroom", + "localizedName": "Mushroom", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 100, + "legacyData": 0, + "id": "minecraft:red_mushroom_block", + "unlocalizedName": "tile.mushroom", + "localizedName": "Mushroom", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 101, + "legacyData": 0, + "id": "minecraft:iron_bars", + "unlocalizedName": "tile.fenceIron", + "localizedName": "Iron Bars", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 102, + "legacyData": 0, + "id": "minecraft:glass_pane", + "unlocalizedName": "tile.thinGlass", + "localizedName": "Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 103, + "legacyData": 0, + "id": "minecraft:melon_block", + "unlocalizedName": "tile.melon", + "localizedName": "Melon", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 106, + "legacyData": 0, + "id": "minecraft:vine", + "unlocalizedName": "tile.vine", + "localizedName": "Vines", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 107, + "legacyData": 0, + "id": "minecraft:fence_gate", + "unlocalizedName": "tile.fenceGate", + "localizedName": "Oak Fence Gate", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 108, + "legacyData": 0, + "id": "minecraft:brick_stairs", + "unlocalizedName": "tile.stairsBrick", + "localizedName": "Brick Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 109, + "legacyData": 0, + "id": "minecraft:stone_brick_stairs", + "unlocalizedName": "tile.stairsStoneBrickSmooth", + "localizedName": "Stone Brick Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 110, + "legacyData": 0, + "id": "minecraft:mycelium", + "unlocalizedName": "tile.mycel", + "localizedName": "Mycelium", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 111, + "legacyData": 0, + "id": "minecraft:waterlily", + "unlocalizedName": "tile.waterlily", + "localizedName": "Lily Pad", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 112, + "legacyData": 0, + "id": "minecraft:nether_brick", + "unlocalizedName": "tile.netherBrick", + "localizedName": "Nether Brick", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 113, + "legacyData": 0, + "id": "minecraft:nether_brick_fence", + "unlocalizedName": "tile.netherFence", + "localizedName": "Nether Brick Fence", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 114, + "legacyData": 0, + "id": "minecraft:nether_brick_stairs", + "unlocalizedName": "tile.stairsNetherBrick", + "localizedName": "Nether Brick Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 116, + "legacyData": 0, + "id": "minecraft:enchanting_table", + "unlocalizedName": "tile.enchantmentTable", + "localizedName": "Enchantment Table", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 120, + "legacyData": 0, + "id": "minecraft:end_portal_frame", + "unlocalizedName": "tile.endPortalFrame", + "localizedName": "End Portal", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 121, + "legacyData": 0, + "id": "minecraft:end_stone", + "unlocalizedName": "tile.whiteStone", + "localizedName": "End Stone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 122, + "legacyData": 0, + "id": "minecraft:dragon_egg", + "unlocalizedName": "tile.dragonEgg", + "localizedName": "Dragon Egg", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 123, + "legacyData": 0, + "id": "minecraft:redstone_lamp", + "unlocalizedName": "tile.redstoneLight", + "localizedName": "Redstone Lamp", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 126, + "legacyData": 0, + "id": "minecraft:wooden_slab", + "unlocalizedName": "tile.woodSlab.oak", + "localizedName": "Oak Wood Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 126, + "legacyData": 1, + "id": "minecraft:wooden_slab", + "unlocalizedName": "tile.woodSlab.spruce", + "localizedName": "Spruce Wood Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 126, + "legacyData": 2, + "id": "minecraft:wooden_slab", + "unlocalizedName": "tile.woodSlab.birch", + "localizedName": "Birch Wood Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 126, + "legacyData": 3, + "id": "minecraft:wooden_slab", + "unlocalizedName": "tile.woodSlab.jungle", + "localizedName": "Jungle Wood Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 126, + "legacyData": 4, + "id": "minecraft:wooden_slab", + "unlocalizedName": "tile.woodSlab.acacia", + "localizedName": "Acacia Wood Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 126, + "legacyData": 5, + "id": "minecraft:wooden_slab", + "unlocalizedName": "tile.woodSlab.big_oak", + "localizedName": "Dark Oak Wood Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 128, + "legacyData": 0, + "id": "minecraft:sandstone_stairs", + "unlocalizedName": "tile.stairsSandStone", + "localizedName": "Sandstone Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 129, + "legacyData": 0, + "id": "minecraft:emerald_ore", + "unlocalizedName": "tile.oreEmerald", + "localizedName": "Emerald Ore", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 130, + "legacyData": 0, + "id": "minecraft:ender_chest", + "unlocalizedName": "tile.enderChest", + "localizedName": "Ender Chest", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 131, + "legacyData": 0, + "id": "minecraft:tripwire_hook", + "unlocalizedName": "tile.tripWireSource", + "localizedName": "Tripwire Hook", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 133, + "legacyData": 0, + "id": "minecraft:emerald_block", + "unlocalizedName": "tile.blockEmerald", + "localizedName": "Block of Emerald", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 134, + "legacyData": 0, + "id": "minecraft:spruce_stairs", + "unlocalizedName": "tile.stairsWoodSpruce", + "localizedName": "Spruce Wood Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 135, + "legacyData": 0, + "id": "minecraft:birch_stairs", + "unlocalizedName": "tile.stairsWoodBirch", + "localizedName": "Birch Wood Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 136, + "legacyData": 0, + "id": "minecraft:jungle_stairs", + "unlocalizedName": "tile.stairsWoodJungle", + "localizedName": "Jungle Wood Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 137, + "legacyData": 0, + "id": "minecraft:command_block", + "unlocalizedName": "tile.commandBlock", + "localizedName": "Command Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 138, + "legacyData": 0, + "id": "minecraft:beacon", + "unlocalizedName": "tile.beacon", + "localizedName": "Beacon", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 139, + "legacyData": 0, + "id": "minecraft:cobblestone_wall", + "unlocalizedName": "tile.cobbleWall.normal", + "localizedName": "Cobblestone Wall", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 139, + "legacyData": 1, + "id": "minecraft:cobblestone_wall", + "unlocalizedName": "tile.cobbleWall.mossy", + "localizedName": "Mossy Cobblestone Wall", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 143, + "legacyData": 0, + "id": "minecraft:wooden_button", + "unlocalizedName": "tile.button", + "localizedName": "Button", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 145, + "legacyData": 0, + "id": "minecraft:anvil", + "unlocalizedName": "tile.anvil.intact", + "localizedName": "Anvil", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 145, + "legacyData": 1, + "id": "minecraft:anvil", + "unlocalizedName": "tile.anvil.slightlyDamaged", + "localizedName": "Slightly Damaged Anvil", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 145, + "legacyData": 2, + "id": "minecraft:anvil", + "unlocalizedName": "tile.anvil.veryDamaged", + "localizedName": "Very Damaged Anvil", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 146, + "legacyData": 0, + "id": "minecraft:trapped_chest", + "unlocalizedName": "tile.chestTrap", + "localizedName": "Trapped Chest", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 147, + "legacyData": 0, + "id": "minecraft:light_weighted_pressure_plate", + "unlocalizedName": "tile.weightedPlate_light", + "localizedName": "Weighted Pressure Plate (Light)", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 148, + "legacyData": 0, + "id": "minecraft:heavy_weighted_pressure_plate", + "unlocalizedName": "tile.weightedPlate_heavy", + "localizedName": "Weighted Pressure Plate (Heavy)", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 151, + "legacyData": 0, + "id": "minecraft:daylight_detector", + "unlocalizedName": "tile.daylightDetector", + "localizedName": "Daylight Sensor", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 152, + "legacyData": 0, + "id": "minecraft:redstone_block", + "unlocalizedName": "tile.blockRedstone", + "localizedName": "Block of Redstone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 153, + "legacyData": 0, + "id": "minecraft:quartz_ore", + "unlocalizedName": "tile.netherquartz", + "localizedName": "Nether Quartz Ore", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 154, + "legacyData": 0, + "id": "minecraft:hopper", + "unlocalizedName": "tile.hopper", + "localizedName": "Hopper", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 155, + "legacyData": 0, + "id": "minecraft:quartz_block", + "unlocalizedName": "tile.quartzBlock.default", + "localizedName": "Block of Quartz", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 155, + "legacyData": 1, + "id": "minecraft:quartz_block", + "unlocalizedName": "tile.quartzBlock.chiseled", + "localizedName": "Chiseled Quartz Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 155, + "legacyData": 2, + "id": "minecraft:quartz_block", + "unlocalizedName": "tile.quartzBlock.lines", + "localizedName": "Pillar Quartz Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 156, + "legacyData": 0, + "id": "minecraft:quartz_stairs", + "unlocalizedName": "tile.stairsQuartz", + "localizedName": "Quartz Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 157, + "legacyData": 0, + "id": "minecraft:activator_rail", + "unlocalizedName": "tile.activatorRail", + "localizedName": "Activator Rail", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 158, + "legacyData": 0, + "id": "minecraft:dropper", + "unlocalizedName": "tile.dropper", + "localizedName": "Dropper", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 0, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.white", + "localizedName": "White Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 1, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.orange", + "localizedName": "Orange Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 2, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.magenta", + "localizedName": "Magenta Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 3, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.lightBlue", + "localizedName": "Light Blue Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 4, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.yellow", + "localizedName": "Yellow Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 5, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.lime", + "localizedName": "Lime Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 6, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.pink", + "localizedName": "Pink Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 7, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.gray", + "localizedName": "Gray Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 8, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.silver", + "localizedName": "Light Gray Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 9, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.cyan", + "localizedName": "Cyan Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 10, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.purple", + "localizedName": "Purple Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 11, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.blue", + "localizedName": "Blue Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 12, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.brown", + "localizedName": "Brown Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 13, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.green", + "localizedName": "Green Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 14, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.red", + "localizedName": "Red Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 159, + "legacyData": 15, + "id": "minecraft:stained_hardened_clay", + "unlocalizedName": "tile.clayHardenedStained.black", + "localizedName": "Black Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 0, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.white", + "localizedName": "White Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 1, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.orange", + "localizedName": "Orange Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 2, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.magenta", + "localizedName": "Magenta Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 3, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.lightBlue", + "localizedName": "Light Blue Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 4, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.yellow", + "localizedName": "Yellow Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 5, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.lime", + "localizedName": "Lime Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 6, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.pink", + "localizedName": "Pink Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 7, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.gray", + "localizedName": "Gray Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 8, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.silver", + "localizedName": "Light Gray Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 9, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.cyan", + "localizedName": "Cyan Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 10, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.purple", + "localizedName": "Purple Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 11, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.blue", + "localizedName": "Blue Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 12, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.brown", + "localizedName": "Brown Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 13, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.green", + "localizedName": "Green Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 14, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.red", + "localizedName": "Red Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 160, + "legacyData": 15, + "id": "minecraft:stained_glass_pane", + "unlocalizedName": "tile.thinStainedGlass.black", + "localizedName": "Black Stained Glass Pane", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 161, + "legacyData": 0, + "id": "minecraft:leaves2", + "unlocalizedName": "tile.leaves.acacia", + "localizedName": "Acacia Leaves", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 161, + "legacyData": 1, + "id": "minecraft:leaves2", + "unlocalizedName": "tile.leaves.big_oak", + "localizedName": "Dark Oak Leaves", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 162, + "legacyData": 0, + "id": "minecraft:log2", + "unlocalizedName": "tile.log.acacia", + "localizedName": "Acacia Wood", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 162, + "legacyData": 1, + "id": "minecraft:log2", + "unlocalizedName": "tile.log.big_oak", + "localizedName": "Dark Oak Wood", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 163, + "legacyData": 0, + "id": "minecraft:acacia_stairs", + "unlocalizedName": "tile.stairsWoodAcacia", + "localizedName": "Acacia Wood Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 164, + "legacyData": 0, + "id": "minecraft:dark_oak_stairs", + "unlocalizedName": "tile.stairsWoodDarkOak", + "localizedName": "Dark Oak Wood Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 165, + "legacyData": 0, + "id": "minecraft:slime", + "unlocalizedName": "tile.slime", + "localizedName": "Slime Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 166, + "legacyData": 0, + "id": "minecraft:barrier", + "unlocalizedName": "tile.barrier", + "localizedName": "Barrier", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 167, + "legacyData": 0, + "id": "minecraft:iron_trapdoor", + "unlocalizedName": "tile.ironTrapdoor", + "localizedName": "Iron Trapdoor", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 168, + "legacyData": 0, + "id": "minecraft:prismarine", + "unlocalizedName": "tile.prismarine.rough", + "localizedName": "Prismarine", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 168, + "legacyData": 1, + "id": "minecraft:prismarine", + "unlocalizedName": "tile.prismarine.bricks", + "localizedName": "Prismarine Bricks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 168, + "legacyData": 2, + "id": "minecraft:prismarine", + "unlocalizedName": "tile.prismarine.dark", + "localizedName": "Dark Prismarine", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 169, + "legacyData": 0, + "id": "minecraft:sea_lantern", + "unlocalizedName": "tile.seaLantern", + "localizedName": "Sea Lantern", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 170, + "legacyData": 0, + "id": "minecraft:hay_block", + "unlocalizedName": "tile.hayBlock", + "localizedName": "Hay Bale", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 0, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.white", + "localizedName": "White Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 1, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.orange", + "localizedName": "Orange Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 2, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.magenta", + "localizedName": "Magenta Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 3, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.lightBlue", + "localizedName": "Light Blue Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 4, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.yellow", + "localizedName": "Yellow Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 5, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.lime", + "localizedName": "Lime Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 6, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.pink", + "localizedName": "Pink Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 7, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.gray", + "localizedName": "Gray Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 8, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.silver", + "localizedName": "Light Gray Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 9, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.cyan", + "localizedName": "Cyan Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 10, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.purple", + "localizedName": "Purple Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 11, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.blue", + "localizedName": "Blue Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 12, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.brown", + "localizedName": "Brown Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 13, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.green", + "localizedName": "Green Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 14, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.red", + "localizedName": "Red Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 171, + "legacyData": 15, + "id": "minecraft:carpet", + "unlocalizedName": "tile.woolCarpet.black", + "localizedName": "Black Carpet", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 172, + "legacyData": 0, + "id": "minecraft:hardened_clay", + "unlocalizedName": "tile.clayHardened", + "localizedName": "Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 173, + "legacyData": 0, + "id": "minecraft:coal_block", + "unlocalizedName": "tile.blockCoal", + "localizedName": "Block of Coal", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 174, + "legacyData": 0, + "id": "minecraft:packed_ice", + "unlocalizedName": "tile.icePacked", + "localizedName": "Packed Ice", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 175, + "legacyData": 0, + "id": "minecraft:double_plant", + "unlocalizedName": "tile.doublePlant.sunflower", + "localizedName": "Sunflower", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 175, + "legacyData": 1, + "id": "minecraft:double_plant", + "unlocalizedName": "tile.doublePlant.syringa", + "localizedName": "Lilac", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 175, + "legacyData": 2, + "id": "minecraft:double_plant", + "unlocalizedName": "tile.doublePlant.grass", + "localizedName": "Double Tallgrass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 175, + "legacyData": 3, + "id": "minecraft:double_plant", + "unlocalizedName": "tile.doublePlant.fern", + "localizedName": "Large Fern", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 175, + "legacyData": 4, + "id": "minecraft:double_plant", + "unlocalizedName": "tile.doublePlant.rose", + "localizedName": "Rose Bush", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 175, + "legacyData": 5, + "id": "minecraft:double_plant", + "unlocalizedName": "tile.doublePlant.paeonia", + "localizedName": "Peony", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 179, + "legacyData": 0, + "id": "minecraft:red_sandstone", + "unlocalizedName": "tile.redSandStone.default", + "localizedName": "Red Sandstone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 179, + "legacyData": 1, + "id": "minecraft:red_sandstone", + "unlocalizedName": "tile.redSandStone.chiseled", + "localizedName": "Chiseled Red Sandstone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 179, + "legacyData": 2, + "id": "minecraft:red_sandstone", + "unlocalizedName": "tile.redSandStone.smooth", + "localizedName": "Smooth Red Sandstone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 180, + "legacyData": 0, + "id": "minecraft:red_sandstone_stairs", + "unlocalizedName": "tile.stairsRedSandStone", + "localizedName": "Red Sandstone Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 182, + "legacyData": 0, + "id": "minecraft:stone_slab2", + "unlocalizedName": "tile.stoneSlab2.red_sandstone", + "localizedName": "Red Sandstone Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 183, + "legacyData": 0, + "id": "minecraft:spruce_fence_gate", + "unlocalizedName": "tile.spruceFenceGate", + "localizedName": "Spruce Fence Gate", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 184, + "legacyData": 0, + "id": "minecraft:birch_fence_gate", + "unlocalizedName": "tile.birchFenceGate", + "localizedName": "Birch Fence Gate", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 185, + "legacyData": 0, + "id": "minecraft:jungle_fence_gate", + "unlocalizedName": "tile.jungleFenceGate", + "localizedName": "Jungle Fence Gate", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 186, + "legacyData": 0, + "id": "minecraft:dark_oak_fence_gate", + "unlocalizedName": "tile.darkOakFenceGate", + "localizedName": "Dark Oak Fence Gate", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 187, + "legacyData": 0, + "id": "minecraft:acacia_fence_gate", + "unlocalizedName": "tile.acaciaFenceGate", + "localizedName": "Acacia Fence Gate", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 188, + "legacyData": 0, + "id": "minecraft:spruce_fence", + "unlocalizedName": "tile.spruceFence", + "localizedName": "Spruce Fence", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 189, + "legacyData": 0, + "id": "minecraft:birch_fence", + "unlocalizedName": "tile.birchFence", + "localizedName": "Birch Fence", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 190, + "legacyData": 0, + "id": "minecraft:jungle_fence", + "unlocalizedName": "tile.jungleFence", + "localizedName": "Jungle Fence", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 191, + "legacyData": 0, + "id": "minecraft:dark_oak_fence", + "unlocalizedName": "tile.darkOakFence", + "localizedName": "Dark Oak Fence", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 192, + "legacyData": 0, + "id": "minecraft:acacia_fence", + "unlocalizedName": "tile.acaciaFence", + "localizedName": "Acacia Fence", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 198, + "legacyData": 0, + "id": "minecraft:end_rod", + "unlocalizedName": "tile.endRod", + "localizedName": "End Rod", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 199, + "legacyData": 0, + "id": "minecraft:chorus_plant", + "unlocalizedName": "tile.chorusPlant", + "localizedName": "Chorus Plant", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 200, + "legacyData": 0, + "id": "minecraft:chorus_flower", + "unlocalizedName": "tile.chorusFlower", + "localizedName": "Chorus Flower", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 201, + "legacyData": 0, + "id": "minecraft:purpur_block", + "unlocalizedName": "tile.purpurBlock", + "localizedName": "Purpur Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 202, + "legacyData": 0, + "id": "minecraft:purpur_pillar", + "unlocalizedName": "tile.purpurPillar", + "localizedName": "Purpur Pillar", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 203, + "legacyData": 0, + "id": "minecraft:purpur_stairs", + "unlocalizedName": "tile.stairsPurpur", + "localizedName": "Purpur Stairs", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 205, + "legacyData": 0, + "id": "minecraft:purpur_slab", + "unlocalizedName": "tile.purpurSlab", + "localizedName": "Purpur Slab", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 206, + "legacyData": 0, + "id": "minecraft:end_bricks", + "unlocalizedName": "tile.endBricks", + "localizedName": "End Stone Bricks", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 208, + "legacyData": 0, + "id": "minecraft:grass_path", + "unlocalizedName": "tile.grassPath", + "localizedName": "Grass Path", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 210, + "legacyData": 0, + "id": "minecraft:repeating_command_block", + "unlocalizedName": "tile.repeatingCommandBlock", + "localizedName": "Repeating Command Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 211, + "legacyData": 0, + "id": "minecraft:chain_command_block", + "unlocalizedName": "tile.chainCommandBlock", + "localizedName": "Chain Command Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 213, + "legacyData": 0, + "id": "minecraft:magma", + "unlocalizedName": "tile.magma", + "localizedName": "Magma Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 214, + "legacyData": 0, + "id": "minecraft:nether_wart_block", + "unlocalizedName": "tile.netherWartBlock", + "localizedName": "Nether Wart Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 215, + "legacyData": 0, + "id": "minecraft:red_nether_brick", + "unlocalizedName": "tile.redNetherBrick", + "localizedName": "Red Nether Brick", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 216, + "legacyData": 0, + "id": "minecraft:bone_block", + "unlocalizedName": "tile.boneBlock", + "localizedName": "Bone Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 217, + "legacyData": 0, + "id": "minecraft:structure_void", + "unlocalizedName": "tile.structureVoid", + "localizedName": "Structure Void", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 218, + "legacyData": 0, + "id": "minecraft:observer", + "unlocalizedName": "tile.observer", + "localizedName": "Observer", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 219, + "legacyData": 0, + "id": "minecraft:white_shulker_box", + "unlocalizedName": "tile.shulkerBoxWhite", + "localizedName": "White Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 220, + "legacyData": 0, + "id": "minecraft:orange_shulker_box", + "unlocalizedName": "tile.shulkerBoxOrange", + "localizedName": "Orange Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 221, + "legacyData": 0, + "id": "minecraft:magenta_shulker_box", + "unlocalizedName": "tile.shulkerBoxMagenta", + "localizedName": "Magenta Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 222, + "legacyData": 0, + "id": "minecraft:light_blue_shulker_box", + "unlocalizedName": "tile.shulkerBoxLightBlue", + "localizedName": "Light Blue Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 223, + "legacyData": 0, + "id": "minecraft:yellow_shulker_box", + "unlocalizedName": "tile.shulkerBoxYellow", + "localizedName": "Yellow Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 224, + "legacyData": 0, + "id": "minecraft:lime_shulker_box", + "unlocalizedName": "tile.shulkerBoxLime", + "localizedName": "Lime Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 225, + "legacyData": 0, + "id": "minecraft:pink_shulker_box", + "unlocalizedName": "tile.shulkerBoxPink", + "localizedName": "Pink Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 226, + "legacyData": 0, + "id": "minecraft:gray_shulker_box", + "unlocalizedName": "tile.shulkerBoxGray", + "localizedName": "Gray Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 227, + "legacyData": 0, + "id": "minecraft:silver_shulker_box", + "unlocalizedName": "tile.shulkerBoxSilver", + "localizedName": "Light Gray Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 228, + "legacyData": 0, + "id": "minecraft:cyan_shulker_box", + "unlocalizedName": "tile.shulkerBoxCyan", + "localizedName": "Cyan Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 229, + "legacyData": 0, + "id": "minecraft:purple_shulker_box", + "unlocalizedName": "tile.shulkerBoxPurple", + "localizedName": "Purple Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 230, + "legacyData": 0, + "id": "minecraft:blue_shulker_box", + "unlocalizedName": "tile.shulkerBoxBlue", + "localizedName": "Blue Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 231, + "legacyData": 0, + "id": "minecraft:brown_shulker_box", + "unlocalizedName": "tile.shulkerBoxBrown", + "localizedName": "Brown Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 232, + "legacyData": 0, + "id": "minecraft:green_shulker_box", + "unlocalizedName": "tile.shulkerBoxGreen", + "localizedName": "Green Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 233, + "legacyData": 0, + "id": "minecraft:red_shulker_box", + "unlocalizedName": "tile.shulkerBoxRed", + "localizedName": "Red Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 234, + "legacyData": 0, + "id": "minecraft:black_shulker_box", + "unlocalizedName": "tile.shulkerBoxBlack", + "localizedName": "Black Shulker Box", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 235, + "legacyData": 0, + "id": "minecraft:white_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaWhite", + "localizedName": "White Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 236, + "legacyData": 0, + "id": "minecraft:orange_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaOrange", + "localizedName": "Orange Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 237, + "legacyData": 0, + "id": "minecraft:magenta_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaMagenta", + "localizedName": "Magenta Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 238, + "legacyData": 0, + "id": "minecraft:light_blue_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaLightBlue", + "localizedName": "Light Blue Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 239, + "legacyData": 0, + "id": "minecraft:yellow_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaYellow", + "localizedName": "Yellow Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 240, + "legacyData": 0, + "id": "minecraft:lime_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaLime", + "localizedName": "Lime Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 241, + "legacyData": 0, + "id": "minecraft:pink_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaPink", + "localizedName": "Pink Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 242, + "legacyData": 0, + "id": "minecraft:gray_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaGray", + "localizedName": "Gray Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 243, + "legacyData": 0, + "id": "minecraft:silver_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaSilver", + "localizedName": "Light Gray Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 244, + "legacyData": 0, + "id": "minecraft:cyan_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaCyan", + "localizedName": "Cyan Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 245, + "legacyData": 0, + "id": "minecraft:purple_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaPurple", + "localizedName": "Purple Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 246, + "legacyData": 0, + "id": "minecraft:blue_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaBlue", + "localizedName": "Blue Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 247, + "legacyData": 0, + "id": "minecraft:brown_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaBrown", + "localizedName": "Brown Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 248, + "legacyData": 0, + "id": "minecraft:green_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaGreen", + "localizedName": "Green Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 249, + "legacyData": 0, + "id": "minecraft:red_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaRed", + "localizedName": "Red Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 250, + "legacyData": 0, + "id": "minecraft:black_glazed_terracotta", + "unlocalizedName": "tile.glazedTerracottaBlack", + "localizedName": "Black Glazed Terracotta", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 0, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.white", + "localizedName": "White Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 1, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.orange", + "localizedName": "Orange Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 2, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.magenta", + "localizedName": "Magenta Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 3, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.lightBlue", + "localizedName": "Light Blue Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 4, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.yellow", + "localizedName": "Yellow Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 5, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.lime", + "localizedName": "Lime Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 6, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.pink", + "localizedName": "Pink Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 7, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.gray", + "localizedName": "Gray Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 8, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.silver", + "localizedName": "Light Gray Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 9, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.cyan", + "localizedName": "Cyan Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 10, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.purple", + "localizedName": "Purple Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 11, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.blue", + "localizedName": "Blue Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 12, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.brown", + "localizedName": "Brown Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 13, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.green", + "localizedName": "Green Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 14, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.red", + "localizedName": "Red Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 251, + "legacyData": 15, + "id": "minecraft:concrete", + "unlocalizedName": "tile.concrete.black", + "localizedName": "Black Concrete", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 0, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.white", + "localizedName": "White Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 1, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.orange", + "localizedName": "Orange Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 2, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.magenta", + "localizedName": "Magenta Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 3, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.lightBlue", + "localizedName": "Light Blue Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 4, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.yellow", + "localizedName": "Yellow Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 5, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.lime", + "localizedName": "Lime Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 6, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.pink", + "localizedName": "Pink Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 7, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.gray", + "localizedName": "Gray Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 8, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.silver", + "localizedName": "Light Gray Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 9, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.cyan", + "localizedName": "Cyan Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 10, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.purple", + "localizedName": "Purple Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 11, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.blue", + "localizedName": "Blue Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 12, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.brown", + "localizedName": "Brown Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 13, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.green", + "localizedName": "Green Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 14, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.red", + "localizedName": "Red Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 252, + "legacyData": 15, + "id": "minecraft:concrete_powder", + "unlocalizedName": "tile.concretePowder.black", + "localizedName": "Black Concrete Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 255, + "legacyData": 0, + "id": "minecraft:structure_block", + "unlocalizedName": "tile.structureBlock", + "localizedName": "Structure Block", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 256, + "legacyData": 0, + "id": "minecraft:iron_shovel", + "unlocalizedName": "item.shovelIron", + "localizedName": "Iron Shovel", + "maxDamage": 250, + "maxStackSize": 1 + }, + { + "legacyId": 257, + "legacyData": 0, + "id": "minecraft:iron_pickaxe", + "unlocalizedName": "item.pickaxeIron", + "localizedName": "Iron Pickaxe", + "maxDamage": 250, + "maxStackSize": 1 + }, + { + "legacyId": 258, + "legacyData": 0, + "id": "minecraft:iron_axe", + "unlocalizedName": "item.hatchetIron", + "localizedName": "Iron Axe", + "maxDamage": 250, + "maxStackSize": 1 + }, + { + "legacyId": 259, + "legacyData": 0, + "id": "minecraft:flint_and_steel", + "unlocalizedName": "item.flintAndSteel", + "localizedName": "Flint and Steel", + "maxDamage": 64, + "maxStackSize": 1 + }, + { + "legacyId": 260, + "legacyData": 0, + "id": "minecraft:apple", + "unlocalizedName": "item.apple", + "localizedName": "Apple", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 261, + "legacyData": 0, + "id": "minecraft:bow", + "unlocalizedName": "item.bow", + "localizedName": "Bow", + "maxDamage": 384, + "maxStackSize": 1 + }, + { + "legacyId": 262, + "legacyData": 0, + "id": "minecraft:arrow", + "unlocalizedName": "item.arrow", + "localizedName": "Arrow", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 263, + "legacyData": 0, + "id": "minecraft:coal", + "unlocalizedName": "item.coal", + "localizedName": "Coal", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 263, + "legacyData": 1, + "id": "minecraft:coal", + "unlocalizedName": "item.charcoal", + "localizedName": "Charcoal", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 264, + "legacyData": 0, + "id": "minecraft:diamond", + "unlocalizedName": "item.diamond", + "localizedName": "Diamond", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 265, + "legacyData": 0, + "id": "minecraft:iron_ingot", + "unlocalizedName": "item.ingotIron", + "localizedName": "Iron Ingot", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 266, + "legacyData": 0, + "id": "minecraft:gold_ingot", + "unlocalizedName": "item.ingotGold", + "localizedName": "Gold Ingot", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 267, + "legacyData": 0, + "id": "minecraft:iron_sword", + "unlocalizedName": "item.swordIron", + "localizedName": "Iron Sword", + "maxDamage": 250, + "maxStackSize": 1 + }, + { + "legacyId": 268, + "legacyData": 0, + "id": "minecraft:wooden_sword", + "unlocalizedName": "item.swordWood", + "localizedName": "Wooden Sword", + "maxDamage": 59, + "maxStackSize": 1 + }, + { + "legacyId": 269, + "legacyData": 0, + "id": "minecraft:wooden_shovel", + "unlocalizedName": "item.shovelWood", + "localizedName": "Wooden Shovel", + "maxDamage": 59, + "maxStackSize": 1 + }, + { + "legacyId": 270, + "legacyData": 0, + "id": "minecraft:wooden_pickaxe", + "unlocalizedName": "item.pickaxeWood", + "localizedName": "Wooden Pickaxe", + "maxDamage": 59, + "maxStackSize": 1 + }, + { + "legacyId": 271, + "legacyData": 0, + "id": "minecraft:wooden_axe", + "unlocalizedName": "item.hatchetWood", + "localizedName": "Wooden Axe", + "maxDamage": 59, + "maxStackSize": 1 + }, + { + "legacyId": 272, + "legacyData": 0, + "id": "minecraft:stone_sword", + "unlocalizedName": "item.swordStone", + "localizedName": "Stone Sword", + "maxDamage": 131, + "maxStackSize": 1 + }, + { + "legacyId": 273, + "legacyData": 0, + "id": "minecraft:stone_shovel", + "unlocalizedName": "item.shovelStone", + "localizedName": "Stone Shovel", + "maxDamage": 131, + "maxStackSize": 1 + }, + { + "legacyId": 274, + "legacyData": 0, + "id": "minecraft:stone_pickaxe", + "unlocalizedName": "item.pickaxeStone", + "localizedName": "Stone Pickaxe", + "maxDamage": 131, + "maxStackSize": 1 + }, + { + "legacyId": 275, + "legacyData": 0, + "id": "minecraft:stone_axe", + "unlocalizedName": "item.hatchetStone", + "localizedName": "Stone Axe", + "maxDamage": 131, + "maxStackSize": 1 + }, + { + "legacyId": 276, + "legacyData": 0, + "id": "minecraft:diamond_sword", + "unlocalizedName": "item.swordDiamond", + "localizedName": "Diamond Sword", + "maxDamage": 1561, + "maxStackSize": 1 + }, + { + "legacyId": 277, + "legacyData": 0, + "id": "minecraft:diamond_shovel", + "unlocalizedName": "item.shovelDiamond", + "localizedName": "Diamond Shovel", + "maxDamage": 1561, + "maxStackSize": 1 + }, + { + "legacyId": 278, + "legacyData": 0, + "id": "minecraft:diamond_pickaxe", + "unlocalizedName": "item.pickaxeDiamond", + "localizedName": "Diamond Pickaxe", + "maxDamage": 1561, + "maxStackSize": 1 + }, + { + "legacyId": 279, + "legacyData": 0, + "id": "minecraft:diamond_axe", + "unlocalizedName": "item.hatchetDiamond", + "localizedName": "Diamond Axe", + "maxDamage": 1561, + "maxStackSize": 1 + }, + { + "legacyId": 280, + "legacyData": 0, + "id": "minecraft:stick", + "unlocalizedName": "item.stick", + "localizedName": "Stick", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 281, + "legacyData": 0, + "id": "minecraft:bowl", + "unlocalizedName": "item.bowl", + "localizedName": "Bowl", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 282, + "legacyData": 0, + "id": "minecraft:mushroom_stew", + "unlocalizedName": "item.mushroomStew", + "localizedName": "Mushroom Stew", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 283, + "legacyData": 0, + "id": "minecraft:golden_sword", + "unlocalizedName": "item.swordGold", + "localizedName": "Golden Sword", + "maxDamage": 32, + "maxStackSize": 1 + }, + { + "legacyId": 284, + "legacyData": 0, + "id": "minecraft:golden_shovel", + "unlocalizedName": "item.shovelGold", + "localizedName": "Golden Shovel", + "maxDamage": 32, + "maxStackSize": 1 + }, + { + "legacyId": 285, + "legacyData": 0, + "id": "minecraft:golden_pickaxe", + "unlocalizedName": "item.pickaxeGold", + "localizedName": "Golden Pickaxe", + "maxDamage": 32, + "maxStackSize": 1 + }, + { + "legacyId": 286, + "legacyData": 0, + "id": "minecraft:golden_axe", + "unlocalizedName": "item.hatchetGold", + "localizedName": "Golden Axe", + "maxDamage": 32, + "maxStackSize": 1 + }, + { + "legacyId": 287, + "legacyData": 0, + "id": "minecraft:string", + "unlocalizedName": "item.string", + "localizedName": "String", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 288, + "legacyData": 0, + "id": "minecraft:feather", + "unlocalizedName": "item.feather", + "localizedName": "Feather", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 289, + "legacyData": 0, + "id": "minecraft:gunpowder", + "unlocalizedName": "item.sulphur", + "localizedName": "Gunpowder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 290, + "legacyData": 0, + "id": "minecraft:wooden_hoe", + "unlocalizedName": "item.hoeWood", + "localizedName": "Wooden Hoe", + "maxDamage": 59, + "maxStackSize": 1 + }, + { + "legacyId": 291, + "legacyData": 0, + "id": "minecraft:stone_hoe", + "unlocalizedName": "item.hoeStone", + "localizedName": "Stone Hoe", + "maxDamage": 131, + "maxStackSize": 1 + }, + { + "legacyId": 292, + "legacyData": 0, + "id": "minecraft:iron_hoe", + "unlocalizedName": "item.hoeIron", + "localizedName": "Iron Hoe", + "maxDamage": 250, + "maxStackSize": 1 + }, + { + "legacyId": 293, + "legacyData": 0, + "id": "minecraft:diamond_hoe", + "unlocalizedName": "item.hoeDiamond", + "localizedName": "Diamond Hoe", + "maxDamage": 1561, + "maxStackSize": 1 + }, + { + "legacyId": 294, + "legacyData": 0, + "id": "minecraft:golden_hoe", + "unlocalizedName": "item.hoeGold", + "localizedName": "Golden Hoe", + "maxDamage": 32, + "maxStackSize": 1 + }, + { + "legacyId": 295, + "legacyData": 0, + "id": "minecraft:wheat_seeds", + "unlocalizedName": "item.seeds", + "localizedName": "Seeds", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 296, + "legacyData": 0, + "id": "minecraft:wheat", + "unlocalizedName": "item.wheat", + "localizedName": "Wheat", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 297, + "legacyData": 0, + "id": "minecraft:bread", + "unlocalizedName": "item.bread", + "localizedName": "Bread", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 298, + "legacyData": 0, + "id": "minecraft:leather_helmet", + "unlocalizedName": "item.helmetCloth", + "localizedName": "Leather Cap", + "maxDamage": 55, + "maxStackSize": 1 + }, + { + "legacyId": 299, + "legacyData": 0, + "id": "minecraft:leather_chestplate", + "unlocalizedName": "item.chestplateCloth", + "localizedName": "Leather Tunic", + "maxDamage": 80, + "maxStackSize": 1 + }, + { + "legacyId": 300, + "legacyData": 0, + "id": "minecraft:leather_leggings", + "unlocalizedName": "item.leggingsCloth", + "localizedName": "Leather Pants", + "maxDamage": 75, + "maxStackSize": 1 + }, + { + "legacyId": 301, + "legacyData": 0, + "id": "minecraft:leather_boots", + "unlocalizedName": "item.bootsCloth", + "localizedName": "Leather Boots", + "maxDamage": 65, + "maxStackSize": 1 + }, + { + "legacyId": 302, + "legacyData": 0, + "id": "minecraft:chainmail_helmet", + "unlocalizedName": "item.helmetChain", + "localizedName": "Chain Helmet", + "maxDamage": 165, + "maxStackSize": 1 + }, + { + "legacyId": 303, + "legacyData": 0, + "id": "minecraft:chainmail_chestplate", + "unlocalizedName": "item.chestplateChain", + "localizedName": "Chain Chestplate", + "maxDamage": 240, + "maxStackSize": 1 + }, + { + "legacyId": 304, + "legacyData": 0, + "id": "minecraft:chainmail_leggings", + "unlocalizedName": "item.leggingsChain", + "localizedName": "Chain Leggings", + "maxDamage": 225, + "maxStackSize": 1 + }, + { + "legacyId": 305, + "legacyData": 0, + "id": "minecraft:chainmail_boots", + "unlocalizedName": "item.bootsChain", + "localizedName": "Chain Boots", + "maxDamage": 195, + "maxStackSize": 1 + }, + { + "legacyId": 306, + "legacyData": 0, + "id": "minecraft:iron_helmet", + "unlocalizedName": "item.helmetIron", + "localizedName": "Iron Helmet", + "maxDamage": 165, + "maxStackSize": 1 + }, + { + "legacyId": 307, + "legacyData": 0, + "id": "minecraft:iron_chestplate", + "unlocalizedName": "item.chestplateIron", + "localizedName": "Iron Chestplate", + "maxDamage": 240, + "maxStackSize": 1 + }, + { + "legacyId": 308, + "legacyData": 0, + "id": "minecraft:iron_leggings", + "unlocalizedName": "item.leggingsIron", + "localizedName": "Iron Leggings", + "maxDamage": 225, + "maxStackSize": 1 + }, + { + "legacyId": 309, + "legacyData": 0, + "id": "minecraft:iron_boots", + "unlocalizedName": "item.bootsIron", + "localizedName": "Iron Boots", + "maxDamage": 195, + "maxStackSize": 1 + }, + { + "legacyId": 310, + "legacyData": 0, + "id": "minecraft:diamond_helmet", + "unlocalizedName": "item.helmetDiamond", + "localizedName": "Diamond Helmet", + "maxDamage": 363, + "maxStackSize": 1 + }, + { + "legacyId": 311, + "legacyData": 0, + "id": "minecraft:diamond_chestplate", + "unlocalizedName": "item.chestplateDiamond", + "localizedName": "Diamond Chestplate", + "maxDamage": 528, + "maxStackSize": 1 + }, + { + "legacyId": 312, + "legacyData": 0, + "id": "minecraft:diamond_leggings", + "unlocalizedName": "item.leggingsDiamond", + "localizedName": "Diamond Leggings", + "maxDamage": 495, + "maxStackSize": 1 + }, + { + "legacyId": 313, + "legacyData": 0, + "id": "minecraft:diamond_boots", + "unlocalizedName": "item.bootsDiamond", + "localizedName": "Diamond Boots", + "maxDamage": 429, + "maxStackSize": 1 + }, + { + "legacyId": 314, + "legacyData": 0, + "id": "minecraft:golden_helmet", + "unlocalizedName": "item.helmetGold", + "localizedName": "Golden Helmet", + "maxDamage": 77, + "maxStackSize": 1 + }, + { + "legacyId": 315, + "legacyData": 0, + "id": "minecraft:golden_chestplate", + "unlocalizedName": "item.chestplateGold", + "localizedName": "Golden Chestplate", + "maxDamage": 112, + "maxStackSize": 1 + }, + { + "legacyId": 316, + "legacyData": 0, + "id": "minecraft:golden_leggings", + "unlocalizedName": "item.leggingsGold", + "localizedName": "Golden Leggings", + "maxDamage": 105, + "maxStackSize": 1 + }, + { + "legacyId": 317, + "legacyData": 0, + "id": "minecraft:golden_boots", + "unlocalizedName": "item.bootsGold", + "localizedName": "Golden Boots", + "maxDamage": 91, + "maxStackSize": 1 + }, + { + "legacyId": 318, + "legacyData": 0, + "id": "minecraft:flint", + "unlocalizedName": "item.flint", + "localizedName": "Flint", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 319, + "legacyData": 0, + "id": "minecraft:porkchop", + "unlocalizedName": "item.porkchopRaw", + "localizedName": "Raw Porkchop", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 320, + "legacyData": 0, + "id": "minecraft:cooked_porkchop", + "unlocalizedName": "item.porkchopCooked", + "localizedName": "Cooked Porkchop", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 321, + "legacyData": 0, + "id": "minecraft:painting", + "unlocalizedName": "item.painting", + "localizedName": "Painting", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 322, + "legacyData": 0, + "id": "minecraft:golden_apple", + "unlocalizedName": "item.appleGold", + "localizedName": "Golden Apple", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 322, + "legacyData": 1, + "id": "minecraft:golden_apple", + "unlocalizedName": "item.appleGold", + "localizedName": "Golden Apple", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 323, + "legacyData": 0, + "id": "minecraft:sign", + "unlocalizedName": "item.sign", + "localizedName": "Sign", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 324, + "legacyData": 0, + "id": "minecraft:wooden_door", + "unlocalizedName": "item.doorOak", + "localizedName": "Oak Door", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 325, + "legacyData": 0, + "id": "minecraft:bucket", + "unlocalizedName": "item.bucket", + "localizedName": "Bucket", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 326, + "legacyData": 0, + "id": "minecraft:water_bucket", + "unlocalizedName": "item.bucketWater", + "localizedName": "Water Bucket", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 327, + "legacyData": 0, + "id": "minecraft:lava_bucket", + "unlocalizedName": "item.bucketLava", + "localizedName": "Lava Bucket", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 328, + "legacyData": 0, + "id": "minecraft:minecart", + "unlocalizedName": "item.minecart", + "localizedName": "Minecart", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 329, + "legacyData": 0, + "id": "minecraft:saddle", + "unlocalizedName": "item.saddle", + "localizedName": "Saddle", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 330, + "legacyData": 0, + "id": "minecraft:iron_door", + "unlocalizedName": "item.doorIron", + "localizedName": "Iron Door", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 331, + "legacyData": 0, + "id": "minecraft:redstone", + "unlocalizedName": "item.redstone", + "localizedName": "Redstone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 332, + "legacyData": 0, + "id": "minecraft:snowball", + "unlocalizedName": "item.snowball", + "localizedName": "Snowball", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 333, + "legacyData": 0, + "id": "minecraft:boat", + "unlocalizedName": "item.boat.oak", + "localizedName": "Oak Boat", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 334, + "legacyData": 0, + "id": "minecraft:leather", + "unlocalizedName": "item.leather", + "localizedName": "Leather", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 335, + "legacyData": 0, + "id": "minecraft:milk_bucket", + "unlocalizedName": "item.milk", + "localizedName": "Milk", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 336, + "legacyData": 0, + "id": "minecraft:brick", + "unlocalizedName": "item.brick", + "localizedName": "Brick", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 337, + "legacyData": 0, + "id": "minecraft:clay_ball", + "unlocalizedName": "item.clay", + "localizedName": "Clay", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 338, + "legacyData": 0, + "id": "minecraft:reeds", + "unlocalizedName": "item.reeds", + "localizedName": "Sugar Canes", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 339, + "legacyData": 0, + "id": "minecraft:paper", + "unlocalizedName": "item.paper", + "localizedName": "Paper", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 340, + "legacyData": 0, + "id": "minecraft:book", + "unlocalizedName": "item.book", + "localizedName": "Book", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 341, + "legacyData": 0, + "id": "minecraft:slime_ball", + "unlocalizedName": "item.slimeball", + "localizedName": "Slimeball", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 342, + "legacyData": 0, + "id": "minecraft:chest_minecart", + "unlocalizedName": "item.minecartChest", + "localizedName": "Minecart with Chest", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 343, + "legacyData": 0, + "id": "minecraft:furnace_minecart", + "unlocalizedName": "item.minecartFurnace", + "localizedName": "Minecart with Furnace", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 344, + "legacyData": 0, + "id": "minecraft:egg", + "unlocalizedName": "item.egg", + "localizedName": "Egg", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 345, + "legacyData": 0, + "id": "minecraft:compass", + "unlocalizedName": "item.compass", + "localizedName": "Compass", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 346, + "legacyData": 0, + "id": "minecraft:fishing_rod", + "unlocalizedName": "item.fishingRod", + "localizedName": "Fishing Rod", + "maxDamage": 64, + "maxStackSize": 1 + }, + { + "legacyId": 347, + "legacyData": 0, + "id": "minecraft:clock", + "unlocalizedName": "item.clock", + "localizedName": "Clock", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 348, + "legacyData": 0, + "id": "minecraft:glowstone_dust", + "unlocalizedName": "item.yellowDust", + "localizedName": "Glowstone Dust", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 349, + "legacyData": 0, + "id": "minecraft:fish", + "unlocalizedName": "item.fish.cod.raw", + "localizedName": "Raw Fish", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 349, + "legacyData": 1, + "id": "minecraft:fish", + "unlocalizedName": "item.fish.salmon.raw", + "localizedName": "Raw Salmon", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 349, + "legacyData": 2, + "id": "minecraft:fish", + "unlocalizedName": "item.fish.clownfish.raw", + "localizedName": "Clownfish", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 349, + "legacyData": 3, + "id": "minecraft:fish", + "unlocalizedName": "item.fish.pufferfish.raw", + "localizedName": "Pufferfish", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 350, + "legacyData": 0, + "id": "minecraft:cooked_fish", + "unlocalizedName": "item.fish.cod.cooked", + "localizedName": "Cooked Fish", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 350, + "legacyData": 1, + "id": "minecraft:cooked_fish", + "unlocalizedName": "item.fish.salmon.cooked", + "localizedName": "Cooked Salmon", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 0, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.black", + "localizedName": "Ink Sac", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 1, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.red", + "localizedName": "Rose Red", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 2, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.green", + "localizedName": "Cactus Green", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 3, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.brown", + "localizedName": "Cocoa Beans", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 4, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.blue", + "localizedName": "Lapis Lazuli", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 5, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.purple", + "localizedName": "Purple Dye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 6, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.cyan", + "localizedName": "Cyan Dye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 7, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.silver", + "localizedName": "Light Gray Dye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 8, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.gray", + "localizedName": "Gray Dye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 9, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.pink", + "localizedName": "Pink Dye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 10, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.lime", + "localizedName": "Lime Dye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 11, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.yellow", + "localizedName": "Dandelion Yellow", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 12, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.lightBlue", + "localizedName": "Light Blue Dye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 13, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.magenta", + "localizedName": "Magenta Dye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 14, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.orange", + "localizedName": "Orange Dye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 351, + "legacyData": 15, + "id": "minecraft:dye", + "unlocalizedName": "item.dyePowder.white", + "localizedName": "Bone Meal", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 352, + "legacyData": 0, + "id": "minecraft:bone", + "unlocalizedName": "item.bone", + "localizedName": "Bone", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 353, + "legacyData": 0, + "id": "minecraft:sugar", + "unlocalizedName": "item.sugar", + "localizedName": "Sugar", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 354, + "legacyData": 0, + "id": "minecraft:cake", + "unlocalizedName": "item.cake", + "localizedName": "Cake", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 0, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.white", + "localizedName": "White Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 1, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.orange", + "localizedName": "Orange Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 2, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.magenta", + "localizedName": "Magenta Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 3, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.lightBlue", + "localizedName": "Light Blue Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 4, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.yellow", + "localizedName": "Yellow Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 5, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.lime", + "localizedName": "Lime Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 6, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.pink", + "localizedName": "Pink Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 7, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.gray", + "localizedName": "Gray Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 8, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.silver", + "localizedName": "Light Gray Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 9, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.cyan", + "localizedName": "Cyan Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 10, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.purple", + "localizedName": "Purple Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 11, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.blue", + "localizedName": "Blue Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 12, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.brown", + "localizedName": "Brown Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 13, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.green", + "localizedName": "Green Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 14, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.red", + "localizedName": "Red Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 355, + "legacyData": 15, + "id": "minecraft:bed", + "unlocalizedName": "item.bed.black", + "localizedName": "Black Bed", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 356, + "legacyData": 0, + "id": "minecraft:repeater", + "unlocalizedName": "item.diode", + "localizedName": "Redstone Repeater", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 357, + "legacyData": 0, + "id": "minecraft:cookie", + "unlocalizedName": "item.cookie", + "localizedName": "Cookie", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 358, + "legacyData": 0, + "id": "minecraft:filled_map", + "unlocalizedName": "item.map", + "localizedName": "Map", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 359, + "legacyData": 0, + "id": "minecraft:shears", + "unlocalizedName": "item.shears", + "localizedName": "Shears", + "maxDamage": 238, + "maxStackSize": 1 + }, + { + "legacyId": 360, + "legacyData": 0, + "id": "minecraft:melon", + "unlocalizedName": "item.melon", + "localizedName": "Melon", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 361, + "legacyData": 0, + "id": "minecraft:pumpkin_seeds", + "unlocalizedName": "item.seeds_pumpkin", + "localizedName": "Pumpkin Seeds", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 362, + "legacyData": 0, + "id": "minecraft:melon_seeds", + "unlocalizedName": "item.seeds_melon", + "localizedName": "Melon Seeds", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 363, + "legacyData": 0, + "id": "minecraft:beef", + "unlocalizedName": "item.beefRaw", + "localizedName": "Raw Beef", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 364, + "legacyData": 0, + "id": "minecraft:cooked_beef", + "unlocalizedName": "item.beefCooked", + "localizedName": "Steak", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 365, + "legacyData": 0, + "id": "minecraft:chicken", + "unlocalizedName": "item.chickenRaw", + "localizedName": "Raw Chicken", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 366, + "legacyData": 0, + "id": "minecraft:cooked_chicken", + "unlocalizedName": "item.chickenCooked", + "localizedName": "Cooked Chicken", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 367, + "legacyData": 0, + "id": "minecraft:rotten_flesh", + "unlocalizedName": "item.rottenFlesh", + "localizedName": "Rotten Flesh", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 368, + "legacyData": 0, + "id": "minecraft:ender_pearl", + "unlocalizedName": "item.enderPearl", + "localizedName": "Ender Pearl", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 369, + "legacyData": 0, + "id": "minecraft:blaze_rod", + "unlocalizedName": "item.blazeRod", + "localizedName": "Blaze Rod", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 370, + "legacyData": 0, + "id": "minecraft:ghast_tear", + "unlocalizedName": "item.ghastTear", + "localizedName": "Ghast Tear", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 371, + "legacyData": 0, + "id": "minecraft:gold_nugget", + "unlocalizedName": "item.goldNugget", + "localizedName": "Gold Nugget", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 372, + "legacyData": 0, + "id": "minecraft:nether_wart", + "unlocalizedName": "item.netherStalkSeeds", + "localizedName": "Nether Wart", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 373, + "legacyData": 0, + "id": "minecraft:potion", + "unlocalizedName": "item.potion", + "localizedName": "Uncraftable Potion", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 374, + "legacyData": 0, + "id": "minecraft:glass_bottle", + "unlocalizedName": "item.glassBottle", + "localizedName": "Glass Bottle", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 375, + "legacyData": 0, + "id": "minecraft:spider_eye", + "unlocalizedName": "item.spiderEye", + "localizedName": "Spider Eye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 376, + "legacyData": 0, + "id": "minecraft:fermented_spider_eye", + "unlocalizedName": "item.fermentedSpiderEye", + "localizedName": "Fermented Spider Eye", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 377, + "legacyData": 0, + "id": "minecraft:blaze_powder", + "unlocalizedName": "item.blazePowder", + "localizedName": "Blaze Powder", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 378, + "legacyData": 0, + "id": "minecraft:magma_cream", + "unlocalizedName": "item.magmaCream", + "localizedName": "Magma Cream", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 379, + "legacyData": 0, + "id": "minecraft:brewing_stand", + "unlocalizedName": "item.brewingStand", + "localizedName": "Brewing Stand", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 380, + "legacyData": 0, + "id": "minecraft:cauldron", + "unlocalizedName": "item.cauldron", + "localizedName": "Cauldron", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 381, + "legacyData": 0, + "id": "minecraft:ender_eye", + "unlocalizedName": "item.eyeOfEnder", + "localizedName": "Eye of Ender", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 382, + "legacyData": 0, + "id": "minecraft:speckled_melon", + "unlocalizedName": "item.speckledMelon", + "localizedName": "Glistering Melon", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 383, + "legacyData": 0, + "id": "minecraft:spawn_egg", + "unlocalizedName": "item.monsterPlacer", + "localizedName": "Spawn", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 384, + "legacyData": 0, + "id": "minecraft:experience_bottle", + "unlocalizedName": "item.expBottle", + "localizedName": "Bottle o\u0027 Enchanting", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 385, + "legacyData": 0, + "id": "minecraft:fire_charge", + "unlocalizedName": "item.fireball", + "localizedName": "Fire Charge", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 386, + "legacyData": 0, + "id": "minecraft:writable_book", + "unlocalizedName": "item.writingBook", + "localizedName": "Book and Quill", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 387, + "legacyData": 0, + "id": "minecraft:written_book", + "unlocalizedName": "item.writtenBook", + "localizedName": "Written Book", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 388, + "legacyData": 0, + "id": "minecraft:emerald", + "unlocalizedName": "item.emerald", + "localizedName": "Emerald", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 389, + "legacyData": 0, + "id": "minecraft:item_frame", + "unlocalizedName": "item.frame", + "localizedName": "Item Frame", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 390, + "legacyData": 0, + "id": "minecraft:flower_pot", + "unlocalizedName": "item.flowerPot", + "localizedName": "Flower Pot", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 391, + "legacyData": 0, + "id": "minecraft:carrot", + "unlocalizedName": "item.carrots", + "localizedName": "Carrot", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 392, + "legacyData": 0, + "id": "minecraft:potato", + "unlocalizedName": "item.potato", + "localizedName": "Potato", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 393, + "legacyData": 0, + "id": "minecraft:baked_potato", + "unlocalizedName": "item.potatoBaked", + "localizedName": "Baked Potato", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 394, + "legacyData": 0, + "id": "minecraft:poisonous_potato", + "unlocalizedName": "item.potatoPoisonous", + "localizedName": "Poisonous Potato", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 395, + "legacyData": 0, + "id": "minecraft:map", + "unlocalizedName": "item.emptyMap", + "localizedName": "Empty Map", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 396, + "legacyData": 0, + "id": "minecraft:golden_carrot", + "unlocalizedName": "item.carrotGolden", + "localizedName": "Golden Carrot", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 397, + "legacyData": 0, + "id": "minecraft:skull", + "unlocalizedName": "item.skull.skeleton", + "localizedName": "Skeleton Skull", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 397, + "legacyData": 1, + "id": "minecraft:skull", + "unlocalizedName": "item.skull.wither", + "localizedName": "Wither Skeleton Skull", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 397, + "legacyData": 2, + "id": "minecraft:skull", + "unlocalizedName": "item.skull.zombie", + "localizedName": "Zombie Head", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 397, + "legacyData": 3, + "id": "minecraft:skull", + "unlocalizedName": "item.skull.char", + "localizedName": "Head", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 397, + "legacyData": 4, + "id": "minecraft:skull", + "unlocalizedName": "item.skull.creeper", + "localizedName": "Creeper Head", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 397, + "legacyData": 5, + "id": "minecraft:skull", + "unlocalizedName": "item.skull.dragon", + "localizedName": "Dragon Head", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 398, + "legacyData": 0, + "id": "minecraft:carrot_on_a_stick", + "unlocalizedName": "item.carrotOnAStick", + "localizedName": "Carrot on a Stick", + "maxDamage": 25, + "maxStackSize": 1 + }, + { + "legacyId": 399, + "legacyData": 0, + "id": "minecraft:nether_star", + "unlocalizedName": "item.netherStar", + "localizedName": "Nether Star", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 400, + "legacyData": 0, + "id": "minecraft:pumpkin_pie", + "unlocalizedName": "item.pumpkinPie", + "localizedName": "Pumpkin Pie", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 401, + "legacyData": 0, + "id": "minecraft:fireworks", + "unlocalizedName": "item.fireworks", + "localizedName": "Firework Rocket", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 402, + "legacyData": 0, + "id": "minecraft:firework_charge", + "unlocalizedName": "item.fireworksCharge", + "localizedName": "Firework Star", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 403, + "legacyData": 0, + "id": "minecraft:enchanted_book", + "unlocalizedName": "item.enchantedBook", + "localizedName": "Enchanted Book", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 404, + "legacyData": 0, + "id": "minecraft:comparator", + "unlocalizedName": "item.comparator", + "localizedName": "Redstone Comparator", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 405, + "legacyData": 0, + "id": "minecraft:netherbrick", + "unlocalizedName": "item.netherbrick", + "localizedName": "Nether Brick", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 406, + "legacyData": 0, + "id": "minecraft:quartz", + "unlocalizedName": "item.netherquartz", + "localizedName": "Nether Quartz", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 407, + "legacyData": 0, + "id": "minecraft:tnt_minecart", + "unlocalizedName": "item.minecartTnt", + "localizedName": "Minecart with TNT", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 408, + "legacyData": 0, + "id": "minecraft:hopper_minecart", + "unlocalizedName": "item.minecartHopper", + "localizedName": "Minecart with Hopper", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 409, + "legacyData": 0, + "id": "minecraft:prismarine_shard", + "unlocalizedName": "item.prismarineShard", + "localizedName": "Prismarine Shard", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 410, + "legacyData": 0, + "id": "minecraft:prismarine_crystals", + "unlocalizedName": "item.prismarineCrystals", + "localizedName": "Prismarine Crystals", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 411, + "legacyData": 0, + "id": "minecraft:rabbit", + "unlocalizedName": "item.rabbitRaw", + "localizedName": "Raw Rabbit", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 412, + "legacyData": 0, + "id": "minecraft:cooked_rabbit", + "unlocalizedName": "item.rabbitCooked", + "localizedName": "Cooked Rabbit", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 413, + "legacyData": 0, + "id": "minecraft:rabbit_stew", + "unlocalizedName": "item.rabbitStew", + "localizedName": "Rabbit Stew", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 414, + "legacyData": 0, + "id": "minecraft:rabbit_foot", + "unlocalizedName": "item.rabbitFoot", + "localizedName": "Rabbit\u0027s Foot", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 415, + "legacyData": 0, + "id": "minecraft:rabbit_hide", + "unlocalizedName": "item.rabbitHide", + "localizedName": "Rabbit Hide", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 416, + "legacyData": 0, + "id": "minecraft:armor_stand", + "unlocalizedName": "item.armorStand", + "localizedName": "Armor Stand", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 417, + "legacyData": 0, + "id": "minecraft:iron_horse_armor", + "unlocalizedName": "item.horsearmormetal", + "localizedName": "Iron Horse Armor", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 418, + "legacyData": 0, + "id": "minecraft:golden_horse_armor", + "unlocalizedName": "item.horsearmorgold", + "localizedName": "Gold Horse Armor", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 419, + "legacyData": 0, + "id": "minecraft:diamond_horse_armor", + "unlocalizedName": "item.horsearmordiamond", + "localizedName": "Diamond Horse Armor", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 420, + "legacyData": 0, + "id": "minecraft:lead", + "unlocalizedName": "item.leash", + "localizedName": "Lead", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 421, + "legacyData": 0, + "id": "minecraft:name_tag", + "unlocalizedName": "item.nameTag", + "localizedName": "Name Tag", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 422, + "legacyData": 0, + "id": "minecraft:command_block_minecart", + "unlocalizedName": "item.minecartCommandBlock", + "localizedName": "Minecart with Command Block", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 423, + "legacyData": 0, + "id": "minecraft:mutton", + "unlocalizedName": "item.muttonRaw", + "localizedName": "Raw Mutton", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 424, + "legacyData": 0, + "id": "minecraft:cooked_mutton", + "unlocalizedName": "item.muttonCooked", + "localizedName": "Cooked Mutton", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 425, + "legacyData": 15, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "White Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 14, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Orange Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 13, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Magenta Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 12, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Light Blue Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 11, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Yellow Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 10, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Lime Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 9, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Pink Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 8, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Gray Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 7, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Light Gray Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 6, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Cyan Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 5, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Purple Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 4, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Blue Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 3, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Brown Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 2, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Green Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 1, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Red Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 425, + "legacyData": 0, + "id": "minecraft:banner", + "unlocalizedName": "tile.banner", + "localizedName": "Black Banner", + "maxDamage": 0, + "maxStackSize": 16 + }, + { + "legacyId": 426, + "legacyData": 0, + "id": "minecraft:end_crystal", + "unlocalizedName": "item.end_crystal", + "localizedName": "End Crystal", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 427, + "legacyData": 0, + "id": "minecraft:spruce_door", + "unlocalizedName": "item.doorSpruce", + "localizedName": "Spruce Door", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 428, + "legacyData": 0, + "id": "minecraft:birch_door", + "unlocalizedName": "item.doorBirch", + "localizedName": "Birch Door", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 429, + "legacyData": 0, + "id": "minecraft:jungle_door", + "unlocalizedName": "item.doorJungle", + "localizedName": "Jungle Door", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 430, + "legacyData": 0, + "id": "minecraft:acacia_door", + "unlocalizedName": "item.doorAcacia", + "localizedName": "Acacia Door", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 431, + "legacyData": 0, + "id": "minecraft:dark_oak_door", + "unlocalizedName": "item.doorDarkOak", + "localizedName": "Dark Oak Door", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 432, + "legacyData": 0, + "id": "minecraft:chorus_fruit", + "unlocalizedName": "item.chorusFruit", + "localizedName": "Chorus Fruit", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 433, + "legacyData": 0, + "id": "minecraft:chorus_fruit_popped", + "unlocalizedName": "item.chorusFruitPopped", + "localizedName": "Popped Chorus Fruit", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 434, + "legacyData": 0, + "id": "minecraft:beetroot", + "unlocalizedName": "item.beetroot", + "localizedName": "Beetroot", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 435, + "legacyData": 0, + "id": "minecraft:beetroot_seeds", + "unlocalizedName": "item.beetroot_seeds", + "localizedName": "Beetroot Seeds", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 436, + "legacyData": 0, + "id": "minecraft:beetroot_soup", + "unlocalizedName": "item.beetroot_soup", + "localizedName": "Beetroot Soup", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 437, + "legacyData": 0, + "id": "minecraft:dragon_breath", + "unlocalizedName": "item.dragon_breath", + "localizedName": "Dragon\u0027s Breath", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 438, + "legacyData": 0, + "id": "minecraft:splash_potion", + "unlocalizedName": "item.splash_potion", + "localizedName": "Splash Uncraftable Potion", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 439, + "legacyData": 0, + "id": "minecraft:spectral_arrow", + "unlocalizedName": "item.spectral_arrow", + "localizedName": "Spectral Arrow", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 440, + "legacyData": 0, + "id": "minecraft:tipped_arrow", + "unlocalizedName": "item.tipped_arrow", + "localizedName": "Uncraftable Tipped Arrow", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 441, + "legacyData": 0, + "id": "minecraft:lingering_potion", + "unlocalizedName": "item.lingering_potion", + "localizedName": "Lingering Uncraftable Potion", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 442, + "legacyData": 0, + "id": "minecraft:shield", + "unlocalizedName": "item.shield", + "localizedName": "Shield", + "maxDamage": 336, + "maxStackSize": 1 + }, + { + "legacyId": 443, + "legacyData": 0, + "id": "minecraft:elytra", + "unlocalizedName": "item.elytra", + "localizedName": "Elytra", + "maxDamage": 432, + "maxStackSize": 1 + }, + { + "legacyId": 444, + "legacyData": 0, + "id": "minecraft:spruce_boat", + "unlocalizedName": "item.boat.spruce", + "localizedName": "Spruce Boat", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 445, + "legacyData": 0, + "id": "minecraft:birch_boat", + "unlocalizedName": "item.boat.birch", + "localizedName": "Birch Boat", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 446, + "legacyData": 0, + "id": "minecraft:jungle_boat", + "unlocalizedName": "item.boat.jungle", + "localizedName": "Jungle Boat", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 447, + "legacyData": 0, + "id": "minecraft:acacia_boat", + "unlocalizedName": "item.boat.acacia", + "localizedName": "Acacia Boat", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 448, + "legacyData": 0, + "id": "minecraft:dark_oak_boat", + "unlocalizedName": "item.boat.dark_oak", + "localizedName": "Dark Oak Boat", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 449, + "legacyData": 0, + "id": "minecraft:totem_of_undying", + "unlocalizedName": "item.totem", + "localizedName": "Totem of Undying", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 450, + "legacyData": 0, + "id": "minecraft:shulker_shell", + "unlocalizedName": "item.shulkerShell", + "localizedName": "Shulker Shell", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 452, + "legacyData": 0, + "id": "minecraft:iron_nugget", + "unlocalizedName": "item.ironNugget", + "localizedName": "Iron Nugget", + "maxDamage": 0, + "maxStackSize": 64 + }, + { + "legacyId": 453, + "legacyData": 0, + "id": "minecraft:knowledge_book", + "unlocalizedName": "item.knowledgeBook", + "localizedName": "Knowledge Book", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2256, + "legacyData": 0, + "id": "minecraft:record_13", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2257, + "legacyData": 0, + "id": "minecraft:record_cat", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2258, + "legacyData": 0, + "id": "minecraft:record_blocks", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2259, + "legacyData": 0, + "id": "minecraft:record_chirp", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2260, + "legacyData": 0, + "id": "minecraft:record_far", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2261, + "legacyData": 0, + "id": "minecraft:record_mall", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2262, + "legacyData": 0, + "id": "minecraft:record_mellohi", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2263, + "legacyData": 0, + "id": "minecraft:record_stal", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2264, + "legacyData": 0, + "id": "minecraft:record_strad", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2265, + "legacyData": 0, + "id": "minecraft:record_ward", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2266, + "legacyData": 0, + "id": "minecraft:record_11", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + }, + { + "legacyId": 2267, + "legacyData": 0, + "id": "minecraft:record_wait", + "unlocalizedName": "item.record", + "localizedName": "Music Disc", + "maxDamage": 0, + "maxStackSize": 1 + } +] \ No newline at end of file From 001a3544fbbb0f84f9ea35f238424e77c852ef10 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 12 Jun 2018 22:03:48 +1000 Subject: [PATCH 07/74] Update the BaseItem classes --- .../com/sk89q/worldedit/blocks/BaseItem.java | 83 +- .../sk89q/worldedit/blocks/BaseItemStack.java | 37 + .../com/sk89q/worldedit/blocks/BlockID.java | 3 + .../com/sk89q/worldedit/blocks/ItemID.java | 3 + .../worldedit/blocks/type/ItemTypes.java | 712 +++++++++++++++++- 5 files changed, 814 insertions(+), 24 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java index 24a2f5be1..1427332de 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java @@ -19,6 +19,10 @@ package com.sk89q.worldedit.blocks; +import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.registry.BundledItemData; + import java.util.HashMap; import java.util.Map; @@ -30,18 +34,27 @@ import java.util.Map; */ public class BaseItem { - private int id; - private short data; - private final Map enchantments = new HashMap(); + private ItemType itemType; + private short damage; + private final Map enchantments = new HashMap<>(); /** * Construct the object. * * @param id ID of the item */ + @Deprecated public BaseItem(int id) { - this.id = id; - this.data = 0; + this(id, (short) 0); + } + + /** + * Construct the object. + * + * @param itemType Type of the item + */ + public BaseItem(ItemType itemType) { + this.itemType = itemType; } /** @@ -50,9 +63,21 @@ public class BaseItem { * @param id ID of the item * @param data data value of the item */ + @Deprecated public BaseItem(int id, short data) { - this.id = id; - this.data = data; + setType(id); + this.damage = data; + } + + /** + * Construct the object. + * + * @param itemType Type of the item + * @param damage Damage value of the item + */ + public BaseItem(ItemType itemType, short damage) { + this.itemType = itemType; + this.damage = damage; } /** @@ -60,17 +85,29 @@ public class BaseItem { * * @return the id */ + @Deprecated public int getType() { - return id; + return this.itemType.getLegacyId(); } /** - * Get the type of item. + * Set the type of item. * * @param id the id to set */ + @Deprecated public void setType(int id) { - this.id = id; + ItemType type = ItemTypes.getItemType(BundledItemData.getInstance().fromLegacyId(id)); + setItemType(type); + } + + /** + * Set the type of the item. + * + * @param itemType The type to set + */ + public void setItemType(ItemType itemType) { + this.itemType = itemType; } /** @@ -78,9 +115,8 @@ public class BaseItem { * * @return the damage */ - @Deprecated public short getDamage() { - return data; + return this.damage; } /** @@ -88,8 +124,18 @@ public class BaseItem { * * @return the data */ + @Deprecated public short getData() { - return data; + return this.damage; + } + + /** + * Set the data value. + * + * @param damage the damage to set + */ + public void setDamage(short damage) { + this.damage = damage; } /** @@ -98,17 +144,8 @@ public class BaseItem { * @param data the damage to set */ @Deprecated - public void setDamage(short data) { - this.data = data; - } - - /** - * Set the data value. - * - * @param data the damage to set - */ public void setData(short data) { - this.data = data; + this.damage = data; } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java index 320fc1b40..93c876b8c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.blocks; +import com.sk89q.worldedit.blocks.type.ItemType; + /** * Represents a stack of BaseItems. * @@ -33,21 +35,43 @@ public class BaseItemStack extends BaseItem { * * @param id with data value of 0. */ + @Deprecated public BaseItemStack(int id) { super(id); } + /** + * Construct the object with default stack size of one, with damage value of 0. + * + * @param itemType The item type + */ + public BaseItemStack(ItemType itemType) { + super(itemType); + } + /** * Construct the object. * * @param id type ID * @param amount amount in the stack */ + @Deprecated public BaseItemStack(int id, int amount) { super(id); this.amount = amount; } + /** + * Construct the object. + * + * @param itemType The item type + * @param amount amount in the stack + */ + public BaseItemStack(ItemType itemType, int amount) { + super(itemType); + this.amount = amount; + } + /** * Construct the object. * @@ -55,11 +79,24 @@ public class BaseItemStack extends BaseItem { * @param amount amount in the stack * @param data data value */ + @Deprecated public BaseItemStack(int id, int amount, short data) { super(id, data); this.amount = amount; } + /** + * Construct the object. + * + * @param id The item type + * @param amount amount in the stack + * @param damage Damage value + */ + public BaseItemStack(ItemType id, int amount, short damage) { + super(id, damage); + this.amount = amount; + } + /** * Get the number of items in the stack. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index e37952270..5e54d6272 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -21,7 +21,10 @@ package com.sk89q.worldedit.blocks; /** * List of block IDs. + * + * {@Deprecated Please use {@link com.sk89q.worldedit.blocks.type.BlockTypes}} */ +@Deprecated public final class BlockID { public static final int AIR = 0; public static final int STONE = 1; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java index e22c0693d..f412753dc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java @@ -21,7 +21,10 @@ package com.sk89q.worldedit.blocks; /** * List of item IDs. + * + * {@Deprecated Please use {@link com.sk89q.worldedit.blocks.type.ItemTypes}} */ +@Deprecated public final class ItemID { public static final int IRON_SHOVEL = 256; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java index c9c671b4e..51464763a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java @@ -30,7 +30,717 @@ public class ItemTypes { private ItemTypes() { } - // TODO Add items. + public static final ItemType ACACIA_BARK = new ItemType("minecraft:acacia_bark"); + public static final ItemType ACACIA_BOAT = new ItemType("minecraft:acacia_boat"); + public static final ItemType ACACIA_BUTTON = new ItemType("minecraft:acacia_button"); + public static final ItemType ACACIA_FENCE = new ItemType("minecraft:acacia_fence"); + public static final ItemType ACACIA_FENCE_GATE = new ItemType("minecraft:acacia_fence_gate"); + public static final ItemType ACACIA_LEAVES = new ItemType("minecraft:acacia_leaves"); + public static final ItemType ACACIA_LOG = new ItemType("minecraft:acacia_log"); + public static final ItemType ACACIA_PLANKS = new ItemType("minecraft:acacia_planks"); + public static final ItemType ACACIA_PRESSURE_PLATE = new ItemType("minecraft:acacia_pressure_plate"); + public static final ItemType ACACIA_SAPLING = new ItemType("minecraft:acacia_sapling"); + public static final ItemType ACACIA_SLAB = new ItemType("minecraft:acacia_slab"); + public static final ItemType ACACIA_STAIRS = new ItemType("minecraft:acacia_stairs"); + public static final ItemType ACACIA_TRAPDOOR = new ItemType("minecraft:acacia_trapdoor"); + public static final ItemType ACTIVATOR_RAIL = new ItemType("minecraft:activator_rail"); + public static final ItemType AIR = new ItemType("minecraft:air"); + public static final ItemType ALLIUM = new ItemType("minecraft:allium"); + public static final ItemType ANDESITE = new ItemType("minecraft:andesite"); + public static final ItemType ANVIL = new ItemType("minecraft:anvil"); + public static final ItemType APPLE = new ItemType("minecraft:apple"); + public static final ItemType ARMOR_STAND = new ItemType("minecraft:armor_stand"); + public static final ItemType ARROW = new ItemType("minecraft:arrow"); + public static final ItemType AZURE_BLUET = new ItemType("minecraft:azure_bluet"); + public static final ItemType BAKED_POTATO = new ItemType("minecraft:baked_potato"); + public static final ItemType BARRIER = new ItemType("minecraft:barrier"); + public static final ItemType BAT_SPAWN_EGG = new ItemType("minecraft:bat_spawn_egg"); + public static final ItemType BEDROCK = new ItemType("minecraft:bedrock"); + public static final ItemType BEEF = new ItemType("minecraft:beef"); + public static final ItemType BEETROOT = new ItemType("minecraft:beetroot"); + public static final ItemType BEETROOT_SEEDS = new ItemType("minecraft:beetroot_seeds"); + public static final ItemType BEETROOT_SOUP = new ItemType("minecraft:beetroot_soup"); + public static final ItemType BIRCH_BARK = new ItemType("minecraft:birch_bark"); + public static final ItemType BIRCH_BOAT = new ItemType("minecraft:birch_boat"); + public static final ItemType BIRCH_BUTTON = new ItemType("minecraft:birch_button"); + public static final ItemType BIRCH_FENCE = new ItemType("minecraft:birch_fence"); + public static final ItemType BIRCH_FENCE_GATE = new ItemType("minecraft:birch_fence_gate"); + public static final ItemType BIRCH_LEAVES = new ItemType("minecraft:birch_leaves"); + public static final ItemType BIRCH_LOG = new ItemType("minecraft:birch_log"); + public static final ItemType BIRCH_PLANKS = new ItemType("minecraft:birch_planks"); + public static final ItemType BIRCH_PRESSURE_PLATE = new ItemType("minecraft:birch_pressure_plate"); + public static final ItemType BIRCH_SAPLING = new ItemType("minecraft:birch_sapling"); + public static final ItemType BIRCH_SLAB = new ItemType("minecraft:birch_slab"); + public static final ItemType BIRCH_STAIRS = new ItemType("minecraft:birch_stairs"); + public static final ItemType BIRCH_TRAPDOOR = new ItemType("minecraft:birch_trapdoor"); + public static final ItemType BLACK_BANNER = new ItemType("minecraft:black_banner"); + public static final ItemType BLACK_CARPET = new ItemType("minecraft:black_carpet"); + public static final ItemType BLACK_CONCRETE = new ItemType("minecraft:black_concrete"); + public static final ItemType BLACK_CONCRETE_POWDER = new ItemType("minecraft:black_concrete_powder"); + public static final ItemType BLACK_GLAZED_TERRACOTTA = new ItemType("minecraft:black_glazed_terracotta"); + public static final ItemType BLACK_STAINED_GLASS = new ItemType("minecraft:black_stained_glass"); + public static final ItemType BLACK_STAINED_GLASS_PANE = new ItemType("minecraft:black_stained_glass_pane"); + public static final ItemType BLACK_TERRACOTTA = new ItemType("minecraft:black_terracotta"); + public static final ItemType BLACK_WOOL = new ItemType("minecraft:black_wool"); + public static final ItemType BLAZE_POWDER = new ItemType("minecraft:blaze_powder"); + public static final ItemType BLAZE_ROD = new ItemType("minecraft:blaze_rod"); + public static final ItemType BLAZE_SPAWN_EGG = new ItemType("minecraft:blaze_spawn_egg"); + public static final ItemType BLUE_BANNER = new ItemType("minecraft:blue_banner"); + public static final ItemType BLUE_CARPET = new ItemType("minecraft:blue_carpet"); + public static final ItemType BLUE_CONCRETE = new ItemType("minecraft:blue_concrete"); + public static final ItemType BLUE_CONCRETE_POWDER = new ItemType("minecraft:blue_concrete_powder"); + public static final ItemType BLUE_GLAZED_TERRACOTTA = new ItemType("minecraft:blue_glazed_terracotta"); + public static final ItemType BLUE_ICE = new ItemType("minecraft:blue_ice"); + public static final ItemType BLUE_ORCHID = new ItemType("minecraft:blue_orchid"); + public static final ItemType BLUE_STAINED_GLASS = new ItemType("minecraft:blue_stained_glass"); + public static final ItemType BLUE_STAINED_GLASS_PANE = new ItemType("minecraft:blue_stained_glass_pane"); + public static final ItemType BLUE_TERRACOTTA = new ItemType("minecraft:blue_terracotta"); + public static final ItemType BLUE_WOOL = new ItemType("minecraft:blue_wool"); + public static final ItemType BONE = new ItemType("minecraft:bone"); + public static final ItemType BONE_BLOCK = new ItemType("minecraft:bone_block"); + public static final ItemType BONE_MEAL = new ItemType("minecraft:bone_meal"); + public static final ItemType BOOK = new ItemType("minecraft:book"); + public static final ItemType BOOKSHELF = new ItemType("minecraft:bookshelf"); + public static final ItemType BOW = new ItemType("minecraft:bow"); + public static final ItemType BOWL = new ItemType("minecraft:bowl"); + public static final ItemType BRAIN_CORAL = new ItemType("minecraft:brain_coral"); + public static final ItemType BRAIN_CORAL_BLOCK = new ItemType("minecraft:brain_coral_block"); + public static final ItemType BRAIN_CORAL_FAN = new ItemType("minecraft:brain_coral_fan"); + public static final ItemType BREAD = new ItemType("minecraft:bread"); + public static final ItemType BREWING_STAND = new ItemType("minecraft:brewing_stand"); + public static final ItemType BRICK = new ItemType("minecraft:brick"); + public static final ItemType BRICK_SLAB = new ItemType("minecraft:brick_slab"); + public static final ItemType BRICK_STAIRS = new ItemType("minecraft:brick_stairs"); + public static final ItemType BRICKS = new ItemType("minecraft:bricks"); + public static final ItemType BROWN_BANNER = new ItemType("minecraft:brown_banner"); + public static final ItemType BROWN_CARPET = new ItemType("minecraft:brown_carpet"); + public static final ItemType BROWN_CONCRETE = new ItemType("minecraft:brown_concrete"); + public static final ItemType BROWN_CONCRETE_POWDER = new ItemType("minecraft:brown_concrete_powder"); + public static final ItemType BROWN_GLAZED_TERRACOTTA = new ItemType("minecraft:brown_glazed_terracotta"); + public static final ItemType BROWN_MUSHROOM = new ItemType("minecraft:brown_mushroom"); + public static final ItemType BROWN_MUSHROOM_BLOCK = new ItemType("minecraft:brown_mushroom_block"); + public static final ItemType BROWN_STAINED_GLASS = new ItemType("minecraft:brown_stained_glass"); + public static final ItemType BROWN_STAINED_GLASS_PANE = new ItemType("minecraft:brown_stained_glass_pane"); + public static final ItemType BROWN_TERRACOTTA = new ItemType("minecraft:brown_terracotta"); + public static final ItemType BROWN_WOOL = new ItemType("minecraft:brown_wool"); + public static final ItemType BUBBLE_CORAL = new ItemType("minecraft:bubble_coral"); + public static final ItemType BUBBLE_CORAL_BLOCK = new ItemType("minecraft:bubble_coral_block"); + public static final ItemType BUBBLE_CORAL_FAN = new ItemType("minecraft:bubble_coral_fan"); + public static final ItemType BUCKET = new ItemType("minecraft:bucket"); + public static final ItemType CACTUS = new ItemType("minecraft:cactus"); + public static final ItemType CACTUS_GREEN = new ItemType("minecraft:cactus_green"); + public static final ItemType CARROT = new ItemType("minecraft:carrot"); + public static final ItemType CARROT_ON_A_STICK = new ItemType("minecraft:carrot_on_a_stick"); + public static final ItemType CARVED_PUMPKIN = new ItemType("minecraft:carved_pumpkin"); + public static final ItemType CAULDRON = new ItemType("minecraft:cauldron"); + public static final ItemType CAVE_SPIDER_SPAWN_EGG = new ItemType("minecraft:cave_spider_spawn_egg"); + public static final ItemType CHAINMAIL_BOOTS = new ItemType("minecraft:chainmail_boots"); + public static final ItemType CHAINMAIL_CHESTPLATE = new ItemType("minecraft:chainmail_chestplate"); + public static final ItemType CHAINMAIL_HELMET = new ItemType("minecraft:chainmail_helmet"); + public static final ItemType CHAINMAIL_LEGGINGS = new ItemType("minecraft:chainmail_leggings"); + public static final ItemType CHARCOAL = new ItemType("minecraft:charcoal"); + public static final ItemType CHEST = new ItemType("minecraft:chest"); + public static final ItemType CHEST_MINECART = new ItemType("minecraft:chest_minecart"); + public static final ItemType CHICKEN = new ItemType("minecraft:chicken"); + public static final ItemType CHICKEN_SPAWN_EGG = new ItemType("minecraft:chicken_spawn_egg"); + public static final ItemType CHIPPED_ANVIL = new ItemType("minecraft:chipped_anvil"); + public static final ItemType CHISELED_QUARTZ_BLOCK = new ItemType("minecraft:chiseled_quartz_block"); + public static final ItemType CHISELED_RED_SANDSTONE = new ItemType("minecraft:chiseled_red_sandstone"); + public static final ItemType CHISELED_SANDSTONE = new ItemType("minecraft:chiseled_sandstone"); + public static final ItemType CHISELED_STONE_BRICKS = new ItemType("minecraft:chiseled_stone_bricks"); + public static final ItemType CHORUS_FLOWER = new ItemType("minecraft:chorus_flower"); + public static final ItemType CHORUS_FRUIT = new ItemType("minecraft:chorus_fruit"); + public static final ItemType CHORUS_FRUIT_POPPED = new ItemType("minecraft:chorus_fruit_popped"); + public static final ItemType CHORUS_PLANT = new ItemType("minecraft:chorus_plant"); + public static final ItemType CLAY = new ItemType("minecraft:clay"); + public static final ItemType CLAY_BALL = new ItemType("minecraft:clay_ball"); + public static final ItemType CLOCK = new ItemType("minecraft:clock"); + public static final ItemType CLOWNFISH = new ItemType("minecraft:clownfish"); + public static final ItemType CLOWNFISH_BUCKET = new ItemType("minecraft:clownfish_bucket"); + public static final ItemType COAL = new ItemType("minecraft:coal"); + public static final ItemType COAL_BLOCK = new ItemType("minecraft:coal_block"); + public static final ItemType COAL_ORE = new ItemType("minecraft:coal_ore"); + public static final ItemType COARSE_DIRT = new ItemType("minecraft:coarse_dirt"); + public static final ItemType COBBLESTONE = new ItemType("minecraft:cobblestone"); + public static final ItemType COBBLESTONE_SLAB = new ItemType("minecraft:cobblestone_slab"); + public static final ItemType COBBLESTONE_STAIRS = new ItemType("minecraft:cobblestone_stairs"); + public static final ItemType COBBLESTONE_WALL = new ItemType("minecraft:cobblestone_wall"); + public static final ItemType COBWEB = new ItemType("minecraft:cobweb"); + public static final ItemType COCOA_BEANS = new ItemType("minecraft:cocoa_beans"); + public static final ItemType COD = new ItemType("minecraft:cod"); + public static final ItemType COD_BUCKET = new ItemType("minecraft:cod_bucket"); + public static final ItemType COD_SPAWN_EGG = new ItemType("minecraft:cod_spawn_egg"); + public static final ItemType COMMAND_BLOCK_MINECART = new ItemType("minecraft:command_block_minecart"); + public static final ItemType COMPARATOR = new ItemType("minecraft:comparator"); + public static final ItemType COMPASS = new ItemType("minecraft:compass"); + public static final ItemType COOKED_BEEF = new ItemType("minecraft:cooked_beef"); + public static final ItemType COOKED_CHICKEN = new ItemType("minecraft:cooked_chicken"); + public static final ItemType COOKED_COD = new ItemType("minecraft:cooked_cod"); + public static final ItemType COOKED_MUTTON = new ItemType("minecraft:cooked_mutton"); + public static final ItemType COOKED_PORKCHOP = new ItemType("minecraft:cooked_porkchop"); + public static final ItemType COOKED_RABBIT = new ItemType("minecraft:cooked_rabbit"); + public static final ItemType COOKED_SALMON = new ItemType("minecraft:cooked_salmon"); + public static final ItemType COOKIE = new ItemType("minecraft:cookie"); + public static final ItemType COW_SPAWN_EGG = new ItemType("minecraft:cow_spawn_egg"); + public static final ItemType CRACKED_STONE_BRICKS = new ItemType("minecraft:cracked_stone_bricks"); + public static final ItemType CRAFTING_TABLE = new ItemType("minecraft:crafting_table"); + public static final ItemType CREEPER_SPAWN_EGG = new ItemType("minecraft:creeper_spawn_egg"); + public static final ItemType CUT_RED_SANDSTONE = new ItemType("minecraft:cut_red_sandstone"); + public static final ItemType CUT_SANDSTONE = new ItemType("minecraft:cut_sandstone"); + public static final ItemType CYAN_BANNER = new ItemType("minecraft:cyan_banner"); + public static final ItemType CYAN_CARPET = new ItemType("minecraft:cyan_carpet"); + public static final ItemType CYAN_CONCRETE = new ItemType("minecraft:cyan_concrete"); + public static final ItemType CYAN_CONCRETE_POWDER = new ItemType("minecraft:cyan_concrete_powder"); + public static final ItemType CYAN_DYE = new ItemType("minecraft:cyan_dye"); + public static final ItemType CYAN_GLAZED_TERRACOTTA = new ItemType("minecraft:cyan_glazed_terracotta"); + public static final ItemType CYAN_STAINED_GLASS = new ItemType("minecraft:cyan_stained_glass"); + public static final ItemType CYAN_STAINED_GLASS_PANE = new ItemType("minecraft:cyan_stained_glass_pane"); + public static final ItemType CYAN_TERRACOTTA = new ItemType("minecraft:cyan_terracotta"); + public static final ItemType CYAN_WOOL = new ItemType("minecraft:cyan_wool"); + public static final ItemType DAMAGED_ANVIL = new ItemType("minecraft:damaged_anvil"); + public static final ItemType DANDELION = new ItemType("minecraft:dandelion"); + public static final ItemType DANDELION_YELLOW = new ItemType("minecraft:dandelion_yellow"); + public static final ItemType DARK_OAK_BARK = new ItemType("minecraft:dark_oak_bark"); + public static final ItemType DARK_OAK_BOAT = new ItemType("minecraft:dark_oak_boat"); + public static final ItemType DARK_OAK_BUTTON = new ItemType("minecraft:dark_oak_button"); + public static final ItemType DARK_OAK_FENCE = new ItemType("minecraft:dark_oak_fence"); + public static final ItemType DARK_OAK_FENCE_GATE = new ItemType("minecraft:dark_oak_fence_gate"); + public static final ItemType DARK_OAK_LEAVES = new ItemType("minecraft:dark_oak_leaves"); + public static final ItemType DARK_OAK_LOG = new ItemType("minecraft:dark_oak_log"); + public static final ItemType DARK_OAK_PLANKS = new ItemType("minecraft:dark_oak_planks"); + public static final ItemType DARK_OAK_PRESSURE_PLATE = new ItemType("minecraft:dark_oak_pressure_plate"); + public static final ItemType DARK_OAK_SAPLING = new ItemType("minecraft:dark_oak_sapling"); + public static final ItemType DARK_OAK_SLAB = new ItemType("minecraft:dark_oak_slab"); + public static final ItemType DARK_OAK_STAIRS = new ItemType("minecraft:dark_oak_stairs"); + public static final ItemType DARK_OAK_TRAPDOOR = new ItemType("minecraft:dark_oak_trapdoor"); + public static final ItemType DARK_PRISMARINE = new ItemType("minecraft:dark_prismarine"); + public static final ItemType DARK_PRISMARINE_SLAB = new ItemType("minecraft:dark_prismarine_slab"); + public static final ItemType DARK_PRISMARINE_STAIRS = new ItemType("minecraft:dark_prismarine_stairs"); + public static final ItemType DAYLIGHT_DETECTOR = new ItemType("minecraft:daylight_detector"); + public static final ItemType DEAD_BRAIN_CORAL_BLOCK = new ItemType("minecraft:dead_brain_coral_block"); + public static final ItemType DEAD_BUBBLE_CORAL_BLOCK = new ItemType("minecraft:dead_bubble_coral_block"); + public static final ItemType DEAD_BUSH = new ItemType("minecraft:dead_bush"); + public static final ItemType DEAD_FIRE_CORAL_BLOCK = new ItemType("minecraft:dead_fire_coral_block"); + public static final ItemType DEAD_HORN_CORAL_BLOCK = new ItemType("minecraft:dead_horn_coral_block"); + public static final ItemType DEAD_TUBE_CORAL_BLOCK = new ItemType("minecraft:dead_tube_coral_block"); + public static final ItemType DEBUG_STICK = new ItemType("minecraft:debug_stick"); + public static final ItemType DETECTOR_RAIL = new ItemType("minecraft:detector_rail"); + public static final ItemType DIAMOND = new ItemType("minecraft:diamond"); + public static final ItemType DIAMOND_AXE = new ItemType("minecraft:diamond_axe"); + public static final ItemType DIAMOND_BLOCK = new ItemType("minecraft:diamond_block"); + public static final ItemType DIAMOND_BOOTS = new ItemType("minecraft:diamond_boots"); + public static final ItemType DIAMOND_CHESTPLATE = new ItemType("minecraft:diamond_chestplate"); + public static final ItemType DIAMOND_HELMET = new ItemType("minecraft:diamond_helmet"); + public static final ItemType DIAMOND_HOE = new ItemType("minecraft:diamond_hoe"); + public static final ItemType DIAMOND_HORSE_ARMOR = new ItemType("minecraft:diamond_horse_armor"); + public static final ItemType DIAMOND_LEGGINGS = new ItemType("minecraft:diamond_leggings"); + public static final ItemType DIAMOND_ORE = new ItemType("minecraft:diamond_ore"); + public static final ItemType DIAMOND_PICKAXE = new ItemType("minecraft:diamond_pickaxe"); + public static final ItemType DIAMOND_SHOVEL = new ItemType("minecraft:diamond_shovel"); + public static final ItemType DIAMOND_SWORD = new ItemType("minecraft:diamond_sword"); + public static final ItemType DIORITE = new ItemType("minecraft:diorite"); + public static final ItemType DIRT = new ItemType("minecraft:dirt"); + public static final ItemType DISPENSER = new ItemType("minecraft:dispenser"); + public static final ItemType DOLPHIN_SPAWN_EGG = new ItemType("minecraft:dolphin_spawn_egg"); + public static final ItemType DONKEY_SPAWN_EGG = new ItemType("minecraft:donkey_spawn_egg"); + public static final ItemType DRAGON_BREATH = new ItemType("minecraft:dragon_breath"); + public static final ItemType DRIED_KELP = new ItemType("minecraft:dried_kelp"); + public static final ItemType DRIED_KELP_BLOCK = new ItemType("minecraft:dried_kelp_block"); + public static final ItemType DROPPER = new ItemType("minecraft:dropper"); + public static final ItemType DROWNED_SPAWN_EGG = new ItemType("minecraft:drowned_spawn_egg"); + public static final ItemType EGG = new ItemType("minecraft:egg"); + public static final ItemType ELDER_GUARDIAN_SPAWN_EGG = new ItemType("minecraft:elder_guardian_spawn_egg"); + public static final ItemType ELYTRA = new ItemType("minecraft:elytra"); + public static final ItemType EMERALD = new ItemType("minecraft:emerald"); + public static final ItemType EMERALD_BLOCK = new ItemType("minecraft:emerald_block"); + public static final ItemType EMERALD_ORE = new ItemType("minecraft:emerald_ore"); + public static final ItemType ENCHANTED_BOOK = new ItemType("minecraft:enchanted_book"); + public static final ItemType ENCHANTED_GOLDEN_APPLE = new ItemType("minecraft:enchanted_golden_apple"); + public static final ItemType ENCHANTING_TABLE = new ItemType("minecraft:enchanting_table"); + public static final ItemType END_CRYSTAL = new ItemType("minecraft:end_crystal"); + public static final ItemType END_PORTAL_FRAME = new ItemType("minecraft:end_portal_frame"); + public static final ItemType END_ROD = new ItemType("minecraft:end_rod"); + public static final ItemType END_STONE = new ItemType("minecraft:end_stone"); + public static final ItemType END_STONE_BRICKS = new ItemType("minecraft:end_stone_bricks"); + public static final ItemType ENDER_CHEST = new ItemType("minecraft:ender_chest"); + public static final ItemType ENDER_EYE = new ItemType("minecraft:ender_eye"); + public static final ItemType ENDER_PEARL = new ItemType("minecraft:ender_pearl"); + public static final ItemType ENDERMAN_SPAWN_EGG = new ItemType("minecraft:enderman_spawn_egg"); + public static final ItemType ENDERMITE_SPAWN_EGG = new ItemType("minecraft:endermite_spawn_egg"); + public static final ItemType EVOCATION_ILLAGER_SPAWN_EGG = new ItemType("minecraft:evocation_illager_spawn_egg"); + public static final ItemType EXPERIENCE_BOTTLE = new ItemType("minecraft:experience_bottle"); + public static final ItemType FARMLAND = new ItemType("minecraft:farmland"); + public static final ItemType FEATHER = new ItemType("minecraft:feather"); + public static final ItemType FERMENTED_SPIDER_EYE = new ItemType("minecraft:fermented_spider_eye"); + public static final ItemType FERN = new ItemType("minecraft:fern"); + public static final ItemType FILLED_MAP = new ItemType("minecraft:filled_map"); + public static final ItemType FIRE_CHARGE = new ItemType("minecraft:fire_charge"); + public static final ItemType FIRE_CORAL = new ItemType("minecraft:fire_coral"); + public static final ItemType FIRE_CORAL_BLOCK = new ItemType("minecraft:fire_coral_block"); + public static final ItemType FIRE_CORAL_FAN = new ItemType("minecraft:fire_coral_fan"); + public static final ItemType FIREWORK_ROCKET = new ItemType("minecraft:firework_rocket"); + public static final ItemType FIREWORK_STAR = new ItemType("minecraft:firework_star"); + public static final ItemType FISHING_ROD = new ItemType("minecraft:fishing_rod"); + public static final ItemType FLINT = new ItemType("minecraft:flint"); + public static final ItemType FLINT_AND_STEEL = new ItemType("minecraft:flint_and_steel"); + public static final ItemType FLOWER_POT = new ItemType("minecraft:flower_pot"); + public static final ItemType FURNACE = new ItemType("minecraft:furnace"); + public static final ItemType FURNACE_MINECART = new ItemType("minecraft:furnace_minecart"); + public static final ItemType GHAST_SPAWN_EGG = new ItemType("minecraft:ghast_spawn_egg"); + public static final ItemType GHAST_TEAR = new ItemType("minecraft:ghast_tear"); + public static final ItemType GLASS = new ItemType("minecraft:glass"); + public static final ItemType GLASS_BOTTLE = new ItemType("minecraft:glass_bottle"); + public static final ItemType GLASS_PANE = new ItemType("minecraft:glass_pane"); + public static final ItemType GLISTERING_MELON_SLICE = new ItemType("minecraft:glistering_melon_slice"); + public static final ItemType GLOWSTONE = new ItemType("minecraft:glowstone"); + public static final ItemType GLOWSTONE_DUST = new ItemType("minecraft:glowstone_dust"); + public static final ItemType GOLD_BLOCK = new ItemType("minecraft:gold_block"); + public static final ItemType GOLD_INGOT = new ItemType("minecraft:gold_ingot"); + public static final ItemType GOLD_NUGGET = new ItemType("minecraft:gold_nugget"); + public static final ItemType GOLD_ORE = new ItemType("minecraft:gold_ore"); + public static final ItemType GOLDEN_APPLE = new ItemType("minecraft:golden_apple"); + public static final ItemType GOLDEN_AXE = new ItemType("minecraft:golden_axe"); + public static final ItemType GOLDEN_BOOTS = new ItemType("minecraft:golden_boots"); + public static final ItemType GOLDEN_CARROT = new ItemType("minecraft:golden_carrot"); + public static final ItemType GOLDEN_CHESTPLATE = new ItemType("minecraft:golden_chestplate"); + public static final ItemType GOLDEN_HELMET = new ItemType("minecraft:golden_helmet"); + public static final ItemType GOLDEN_HOE = new ItemType("minecraft:golden_hoe"); + public static final ItemType GOLDEN_HORSE_ARMOR = new ItemType("minecraft:golden_horse_armor"); + public static final ItemType GOLDEN_LEGGINGS = new ItemType("minecraft:golden_leggings"); + public static final ItemType GOLDEN_PICKAXE = new ItemType("minecraft:golden_pickaxe"); + public static final ItemType GOLDEN_SHOVEL = new ItemType("minecraft:golden_shovel"); + public static final ItemType GOLDEN_SWORD = new ItemType("minecraft:golden_sword"); + public static final ItemType GRANITE = new ItemType("minecraft:granite"); + public static final ItemType GRASS = new ItemType("minecraft:grass"); + public static final ItemType GRASS_BLOCK = new ItemType("minecraft:grass_block"); + public static final ItemType GRASS_PATH = new ItemType("minecraft:grass_path"); + public static final ItemType GRAVEL = new ItemType("minecraft:gravel"); + public static final ItemType GRAY_BANNER = new ItemType("minecraft:gray_banner"); + public static final ItemType GRAY_CARPET = new ItemType("minecraft:gray_carpet"); + public static final ItemType GRAY_CONCRETE = new ItemType("minecraft:gray_concrete"); + public static final ItemType GRAY_CONCRETE_POWDER = new ItemType("minecraft:gray_concrete_powder"); + public static final ItemType GRAY_DYE = new ItemType("minecraft:gray_dye"); + public static final ItemType GRAY_GLAZED_TERRACOTTA = new ItemType("minecraft:gray_glazed_terracotta"); + public static final ItemType GRAY_STAINED_GLASS = new ItemType("minecraft:gray_stained_glass"); + public static final ItemType GRAY_STAINED_GLASS_PANE = new ItemType("minecraft:gray_stained_glass_pane"); + public static final ItemType GRAY_TERRACOTTA = new ItemType("minecraft:gray_terracotta"); + public static final ItemType GRAY_WOOL = new ItemType("minecraft:gray_wool"); + public static final ItemType GREEN_BANNER = new ItemType("minecraft:green_banner"); + public static final ItemType GREEN_CARPET = new ItemType("minecraft:green_carpet"); + public static final ItemType GREEN_CONCRETE = new ItemType("minecraft:green_concrete"); + public static final ItemType GREEN_CONCRETE_POWDER = new ItemType("minecraft:green_concrete_powder"); + public static final ItemType GREEN_GLAZED_TERRACOTTA = new ItemType("minecraft:green_glazed_terracotta"); + public static final ItemType GREEN_STAINED_GLASS = new ItemType("minecraft:green_stained_glass"); + public static final ItemType GREEN_STAINED_GLASS_PANE = new ItemType("minecraft:green_stained_glass_pane"); + public static final ItemType GREEN_TERRACOTTA = new ItemType("minecraft:green_terracotta"); + public static final ItemType GREEN_WOOL = new ItemType("minecraft:green_wool"); + public static final ItemType GUARDIAN_SPAWN_EGG = new ItemType("minecraft:guardian_spawn_egg"); + public static final ItemType GUNPOWDER = new ItemType("minecraft:gunpowder"); + public static final ItemType HAY_BLOCK = new ItemType("minecraft:hay_block"); + public static final ItemType HEART_OF_THE_SEA = new ItemType("minecraft:heart_of_the_sea"); + public static final ItemType HEAVY_WEIGHTED_PRESSURE_PLATE = new ItemType("minecraft:heavy_weighted_pressure_plate"); + public static final ItemType HOPPER = new ItemType("minecraft:hopper"); + public static final ItemType HOPPER_MINECART = new ItemType("minecraft:hopper_minecart"); + public static final ItemType HORN_CORAL = new ItemType("minecraft:horn_coral"); + public static final ItemType HORN_CORAL_BLOCK = new ItemType("minecraft:horn_coral_block"); + public static final ItemType HORN_CORAL_FAN = new ItemType("minecraft:horn_coral_fan"); + public static final ItemType HORSE_SPAWN_EGG = new ItemType("minecraft:horse_spawn_egg"); + public static final ItemType HUSK_SPAWN_EGG = new ItemType("minecraft:husk_spawn_egg"); + public static final ItemType ICE = new ItemType("minecraft:ice"); + public static final ItemType INFESTED_CHISELED_STONE_BRICKS = new ItemType("minecraft:infested_chiseled_stone_bricks"); + public static final ItemType INFESTED_COBBLESTONE = new ItemType("minecraft:infested_cobblestone"); + public static final ItemType INFESTED_CRACKED_STONE_BRICKS = new ItemType("minecraft:infested_cracked_stone_bricks"); + public static final ItemType INFESTED_MOSSY_STONE_BRICKS = new ItemType("minecraft:infested_mossy_stone_bricks"); + public static final ItemType INFESTED_STONE = new ItemType("minecraft:infested_stone"); + public static final ItemType INFESTED_STONE_BRICKS = new ItemType("minecraft:infested_stone_bricks"); + public static final ItemType INK_SAC = new ItemType("minecraft:ink_sac"); + public static final ItemType IRON_AXE = new ItemType("minecraft:iron_axe"); + public static final ItemType IRON_BARS = new ItemType("minecraft:iron_bars"); + public static final ItemType IRON_BLOCK = new ItemType("minecraft:iron_block"); + public static final ItemType IRON_BOOTS = new ItemType("minecraft:iron_boots"); + public static final ItemType IRON_CHESTPLATE = new ItemType("minecraft:iron_chestplate"); + public static final ItemType IRON_HELMET = new ItemType("minecraft:iron_helmet"); + public static final ItemType IRON_HOE = new ItemType("minecraft:iron_hoe"); + public static final ItemType IRON_HORSE_ARMOR = new ItemType("minecraft:iron_horse_armor"); + public static final ItemType IRON_INGOT = new ItemType("minecraft:iron_ingot"); + public static final ItemType IRON_LEGGINGS = new ItemType("minecraft:iron_leggings"); + public static final ItemType IRON_NUGGET = new ItemType("minecraft:iron_nugget"); + public static final ItemType IRON_ORE = new ItemType("minecraft:iron_ore"); + public static final ItemType IRON_PICKAXE = new ItemType("minecraft:iron_pickaxe"); + public static final ItemType IRON_SHOVEL = new ItemType("minecraft:iron_shovel"); + public static final ItemType IRON_SWORD = new ItemType("minecraft:iron_sword"); + public static final ItemType IRON_TRAPDOOR = new ItemType("minecraft:iron_trapdoor"); + public static final ItemType ITEM_FRAME = new ItemType("minecraft:item_frame"); + public static final ItemType JACK_O_LANTERN = new ItemType("minecraft:jack_o_lantern"); + public static final ItemType JUKEBOX = new ItemType("minecraft:jukebox"); + public static final ItemType JUNGLE_BARK = new ItemType("minecraft:jungle_bark"); + public static final ItemType JUNGLE_BOAT = new ItemType("minecraft:jungle_boat"); + public static final ItemType JUNGLE_BUTTON = new ItemType("minecraft:jungle_button"); + public static final ItemType JUNGLE_FENCE = new ItemType("minecraft:jungle_fence"); + public static final ItemType JUNGLE_FENCE_GATE = new ItemType("minecraft:jungle_fence_gate"); + public static final ItemType JUNGLE_LEAVES = new ItemType("minecraft:jungle_leaves"); + public static final ItemType JUNGLE_LOG = new ItemType("minecraft:jungle_log"); + public static final ItemType JUNGLE_PLANKS = new ItemType("minecraft:jungle_planks"); + public static final ItemType JUNGLE_PRESSURE_PLATE = new ItemType("minecraft:jungle_pressure_plate"); + public static final ItemType JUNGLE_SAPLING = new ItemType("minecraft:jungle_sapling"); + public static final ItemType JUNGLE_SLAB = new ItemType("minecraft:jungle_slab"); + public static final ItemType JUNGLE_STAIRS = new ItemType("minecraft:jungle_stairs"); + public static final ItemType JUNGLE_TRAPDOOR = new ItemType("minecraft:jungle_trapdoor"); + public static final ItemType KELP = new ItemType("minecraft:kelp"); + public static final ItemType KNOWLEDGE_BOOK = new ItemType("minecraft:knowledge_book"); + public static final ItemType LADDER = new ItemType("minecraft:ladder"); + public static final ItemType LAPIS_BLOCK = new ItemType("minecraft:lapis_block"); + public static final ItemType LAPIS_LAZULI = new ItemType("minecraft:lapis_lazuli"); + public static final ItemType LAPIS_ORE = new ItemType("minecraft:lapis_ore"); + public static final ItemType LAVA_BUCKET = new ItemType("minecraft:lava_bucket"); + public static final ItemType LEAD = new ItemType("minecraft:lead"); + public static final ItemType LEATHER = new ItemType("minecraft:leather"); + public static final ItemType LEATHER_BOOTS = new ItemType("minecraft:leather_boots"); + public static final ItemType LEATHER_CHESTPLATE = new ItemType("minecraft:leather_chestplate"); + public static final ItemType LEATHER_HELMET = new ItemType("minecraft:leather_helmet"); + public static final ItemType LEATHER_LEGGINGS = new ItemType("minecraft:leather_leggings"); + public static final ItemType LEVER = new ItemType("minecraft:lever"); + public static final ItemType LIGHT_BLUE_BANNER = new ItemType("minecraft:light_blue_banner"); + public static final ItemType LIGHT_BLUE_CARPET = new ItemType("minecraft:light_blue_carpet"); + public static final ItemType LIGHT_BLUE_CONCRETE = new ItemType("minecraft:light_blue_concrete"); + public static final ItemType LIGHT_BLUE_CONCRETE_POWDER = new ItemType("minecraft:light_blue_concrete_powder"); + public static final ItemType LIGHT_BLUE_DYE = new ItemType("minecraft:light_blue_dye"); + public static final ItemType LIGHT_BLUE_GLAZED_TERRACOTTA = new ItemType("minecraft:light_blue_glazed_terracotta"); + public static final ItemType LIGHT_BLUE_STAINED_GLASS = new ItemType("minecraft:light_blue_stained_glass"); + public static final ItemType LIGHT_BLUE_STAINED_GLASS_PANE = new ItemType("minecraft:light_blue_stained_glass_pane"); + public static final ItemType LIGHT_BLUE_TERRACOTTA = new ItemType("minecraft:light_blue_terracotta"); + public static final ItemType LIGHT_BLUE_WOOL = new ItemType("minecraft:light_blue_wool"); + public static final ItemType LIGHT_GRAY_BANNER = new ItemType("minecraft:light_gray_banner"); + public static final ItemType LIGHT_GRAY_CARPET = new ItemType("minecraft:light_gray_carpet"); + public static final ItemType LIGHT_GRAY_CONCRETE = new ItemType("minecraft:light_gray_concrete"); + public static final ItemType LIGHT_GRAY_CONCRETE_POWDER = new ItemType("minecraft:light_gray_concrete_powder"); + public static final ItemType LIGHT_GRAY_DYE = new ItemType("minecraft:light_gray_dye"); + public static final ItemType LIGHT_GRAY_GLAZED_TERRACOTTA = new ItemType("minecraft:light_gray_glazed_terracotta"); + public static final ItemType LIGHT_GRAY_STAINED_GLASS = new ItemType("minecraft:light_gray_stained_glass"); + public static final ItemType LIGHT_GRAY_STAINED_GLASS_PANE = new ItemType("minecraft:light_gray_stained_glass_pane"); + public static final ItemType LIGHT_GRAY_TERRACOTTA = new ItemType("minecraft:light_gray_terracotta"); + public static final ItemType LIGHT_GRAY_WOOL = new ItemType("minecraft:light_gray_wool"); + public static final ItemType LIGHT_WEIGHTED_PRESSURE_PLATE = new ItemType("minecraft:light_weighted_pressure_plate"); + public static final ItemType LIME_BANNER = new ItemType("minecraft:lime_banner"); + public static final ItemType LIME_CARPET = new ItemType("minecraft:lime_carpet"); + public static final ItemType LIME_CONCRETE = new ItemType("minecraft:lime_concrete"); + public static final ItemType LIME_CONCRETE_POWDER = new ItemType("minecraft:lime_concrete_powder"); + public static final ItemType LIME_DYE = new ItemType("minecraft:lime_dye"); + public static final ItemType LIME_GLAZED_TERRACOTTA = new ItemType("minecraft:lime_glazed_terracotta"); + public static final ItemType LIME_STAINED_GLASS = new ItemType("minecraft:lime_stained_glass"); + public static final ItemType LIME_STAINED_GLASS_PANE = new ItemType("minecraft:lime_stained_glass_pane"); + public static final ItemType LIME_TERRACOTTA = new ItemType("minecraft:lime_terracotta"); + public static final ItemType LIME_WOOL = new ItemType("minecraft:lime_wool"); + public static final ItemType LINGERING_POTION = new ItemType("minecraft:lingering_potion"); + public static final ItemType LLAMA_SPAWN_EGG = new ItemType("minecraft:llama_spawn_egg"); + public static final ItemType MAGENTA_BANNER = new ItemType("minecraft:magenta_banner"); + public static final ItemType MAGENTA_CARPET = new ItemType("minecraft:magenta_carpet"); + public static final ItemType MAGENTA_CONCRETE = new ItemType("minecraft:magenta_concrete"); + public static final ItemType MAGENTA_CONCRETE_POWDER = new ItemType("minecraft:magenta_concrete_powder"); + public static final ItemType MAGENTA_DYE = new ItemType("minecraft:magenta_dye"); + public static final ItemType MAGENTA_GLAZED_TERRACOTTA = new ItemType("minecraft:magenta_glazed_terracotta"); + public static final ItemType MAGENTA_STAINED_GLASS = new ItemType("minecraft:magenta_stained_glass"); + public static final ItemType MAGENTA_STAINED_GLASS_PANE = new ItemType("minecraft:magenta_stained_glass_pane"); + public static final ItemType MAGENTA_TERRACOTTA = new ItemType("minecraft:magenta_terracotta"); + public static final ItemType MAGENTA_WOOL = new ItemType("minecraft:magenta_wool"); + public static final ItemType MAGMA_BLOCK = new ItemType("minecraft:magma_block"); + public static final ItemType MAGMA_CREAM = new ItemType("minecraft:magma_cream"); + public static final ItemType MAGMA_CUBE_SPAWN_EGG = new ItemType("minecraft:magma_cube_spawn_egg"); + public static final ItemType MAP = new ItemType("minecraft:map"); + public static final ItemType MELON = new ItemType("minecraft:melon"); + public static final ItemType MELON_SEEDS = new ItemType("minecraft:melon_seeds"); + public static final ItemType MELON_SLICE = new ItemType("minecraft:melon_slice"); + public static final ItemType MILK_BUCKET = new ItemType("minecraft:milk_bucket"); + public static final ItemType MINECART = new ItemType("minecraft:minecart"); + public static final ItemType MOB_SPAWNER = new ItemType("minecraft:mob_spawner"); + public static final ItemType MOOSHROOM_SPAWN_EGG = new ItemType("minecraft:mooshroom_spawn_egg"); + public static final ItemType MOSSY_COBBLESTONE = new ItemType("minecraft:mossy_cobblestone"); + public static final ItemType MOSSY_COBBLESTONE_WALL = new ItemType("minecraft:mossy_cobblestone_wall"); + public static final ItemType MOSSY_STONE_BRICKS = new ItemType("minecraft:mossy_stone_bricks"); + public static final ItemType MULE_SPAWN_EGG = new ItemType("minecraft:mule_spawn_egg"); + public static final ItemType MUSHROOM_STEM = new ItemType("minecraft:mushroom_stem"); + public static final ItemType MUSHROOM_STEW = new ItemType("minecraft:mushroom_stew"); + public static final ItemType MUSIC_DISC_11 = new ItemType("minecraft:music_disc_11"); + public static final ItemType MUSIC_DISC_13 = new ItemType("minecraft:music_disc_13"); + public static final ItemType MUSIC_DISC_BLOCKS = new ItemType("minecraft:music_disc_blocks"); + public static final ItemType MUSIC_DISC_CAT = new ItemType("minecraft:music_disc_cat"); + public static final ItemType MUSIC_DISC_CHIRP = new ItemType("minecraft:music_disc_chirp"); + public static final ItemType MUSIC_DISC_FAR = new ItemType("minecraft:music_disc_far"); + public static final ItemType MUSIC_DISC_MALL = new ItemType("minecraft:music_disc_mall"); + public static final ItemType MUSIC_DISC_MELLOHI = new ItemType("minecraft:music_disc_mellohi"); + public static final ItemType MUSIC_DISC_STAL = new ItemType("minecraft:music_disc_stal"); + public static final ItemType MUSIC_DISC_STRAD = new ItemType("minecraft:music_disc_strad"); + public static final ItemType MUSIC_DISC_WAIT = new ItemType("minecraft:music_disc_wait"); + public static final ItemType MUSIC_DISC_WARD = new ItemType("minecraft:music_disc_ward"); + public static final ItemType MUTTON = new ItemType("minecraft:mutton"); + public static final ItemType MYCELIUM = new ItemType("minecraft:mycelium"); + public static final ItemType NAME_TAG = new ItemType("minecraft:name_tag"); + public static final ItemType NAUTILUS_SHELL = new ItemType("minecraft:nautilus_shell"); + public static final ItemType NETHER_BRICK = new ItemType("minecraft:nether_brick"); + public static final ItemType NETHER_BRICK_FENCE = new ItemType("minecraft:nether_brick_fence"); + public static final ItemType NETHER_BRICK_SLAB = new ItemType("minecraft:nether_brick_slab"); + public static final ItemType NETHER_BRICK_STAIRS = new ItemType("minecraft:nether_brick_stairs"); + public static final ItemType NETHER_BRICKS = new ItemType("minecraft:nether_bricks"); + public static final ItemType NETHER_QUARTZ_ORE = new ItemType("minecraft:nether_quartz_ore"); + public static final ItemType NETHER_STAR = new ItemType("minecraft:nether_star"); + public static final ItemType NETHER_WART = new ItemType("minecraft:nether_wart"); + public static final ItemType NETHER_WART_BLOCK = new ItemType("minecraft:nether_wart_block"); + public static final ItemType NETHERRACK = new ItemType("minecraft:netherrack"); + public static final ItemType NOTE_BLOCK = new ItemType("minecraft:note_block"); + public static final ItemType OAK_BARK = new ItemType("minecraft:oak_bark"); + public static final ItemType OAK_BOAT = new ItemType("minecraft:oak_boat"); + public static final ItemType OAK_BUTTON = new ItemType("minecraft:oak_button"); + public static final ItemType OAK_FENCE = new ItemType("minecraft:oak_fence"); + public static final ItemType OAK_FENCE_GATE = new ItemType("minecraft:oak_fence_gate"); + public static final ItemType OAK_LEAVES = new ItemType("minecraft:oak_leaves"); + public static final ItemType OAK_LOG = new ItemType("minecraft:oak_log"); + public static final ItemType OAK_PLANKS = new ItemType("minecraft:oak_planks"); + public static final ItemType OAK_PRESSURE_PLATE = new ItemType("minecraft:oak_pressure_plate"); + public static final ItemType OAK_SAPLING = new ItemType("minecraft:oak_sapling"); + public static final ItemType OAK_SLAB = new ItemType("minecraft:oak_slab"); + public static final ItemType OAK_STAIRS = new ItemType("minecraft:oak_stairs"); + public static final ItemType OAK_TRAPDOOR = new ItemType("minecraft:oak_trapdoor"); + public static final ItemType OBSERVER = new ItemType("minecraft:observer"); + public static final ItemType OBSIDIAN = new ItemType("minecraft:obsidian"); + public static final ItemType OCELOT_SPAWN_EGG = new ItemType("minecraft:ocelot_spawn_egg"); + public static final ItemType ORANGE_BANNER = new ItemType("minecraft:orange_banner"); + public static final ItemType ORANGE_CARPET = new ItemType("minecraft:orange_carpet"); + public static final ItemType ORANGE_CONCRETE = new ItemType("minecraft:orange_concrete"); + public static final ItemType ORANGE_CONCRETE_POWDER = new ItemType("minecraft:orange_concrete_powder"); + public static final ItemType ORANGE_DYE = new ItemType("minecraft:orange_dye"); + public static final ItemType ORANGE_GLAZED_TERRACOTTA = new ItemType("minecraft:orange_glazed_terracotta"); + public static final ItemType ORANGE_STAINED_GLASS = new ItemType("minecraft:orange_stained_glass"); + public static final ItemType ORANGE_STAINED_GLASS_PANE = new ItemType("minecraft:orange_stained_glass_pane"); + public static final ItemType ORANGE_TERRACOTTA = new ItemType("minecraft:orange_terracotta"); + public static final ItemType ORANGE_TULIP = new ItemType("minecraft:orange_tulip"); + public static final ItemType ORANGE_WOOL = new ItemType("minecraft:orange_wool"); + public static final ItemType OXEYE_DAISY = new ItemType("minecraft:oxeye_daisy"); + public static final ItemType PACKED_ICE = new ItemType("minecraft:packed_ice"); + public static final ItemType PAINTING = new ItemType("minecraft:painting"); + public static final ItemType PAPER = new ItemType("minecraft:paper"); + public static final ItemType PARROT_SPAWN_EGG = new ItemType("minecraft:parrot_spawn_egg"); + public static final ItemType PETRIFIED_OAK_SLAB = new ItemType("minecraft:petrified_oak_slab"); + public static final ItemType PHANTOM_MEMBRANE = new ItemType("minecraft:phantom_membrane"); + public static final ItemType PHANTOM_SPAWN_EGG = new ItemType("minecraft:phantom_spawn_egg"); + public static final ItemType PIG_SPAWN_EGG = new ItemType("minecraft:pig_spawn_egg"); + public static final ItemType PINK_BANNER = new ItemType("minecraft:pink_banner"); + public static final ItemType PINK_CARPET = new ItemType("minecraft:pink_carpet"); + public static final ItemType PINK_CONCRETE = new ItemType("minecraft:pink_concrete"); + public static final ItemType PINK_CONCRETE_POWDER = new ItemType("minecraft:pink_concrete_powder"); + public static final ItemType PINK_DYE = new ItemType("minecraft:pink_dye"); + public static final ItemType PINK_GLAZED_TERRACOTTA = new ItemType("minecraft:pink_glazed_terracotta"); + public static final ItemType PINK_STAINED_GLASS = new ItemType("minecraft:pink_stained_glass"); + public static final ItemType PINK_STAINED_GLASS_PANE = new ItemType("minecraft:pink_stained_glass_pane"); + public static final ItemType PINK_TERRACOTTA = new ItemType("minecraft:pink_terracotta"); + public static final ItemType PINK_TULIP = new ItemType("minecraft:pink_tulip"); + public static final ItemType PINK_WOOL = new ItemType("minecraft:pink_wool"); + public static final ItemType PISTON = new ItemType("minecraft:piston"); + public static final ItemType PODZOL = new ItemType("minecraft:podzol"); + public static final ItemType POISONOUS_POTATO = new ItemType("minecraft:poisonous_potato"); + public static final ItemType POLAR_BEAR_SPAWN_EGG = new ItemType("minecraft:polar_bear_spawn_egg"); + public static final ItemType POLISHED_ANDESITE = new ItemType("minecraft:polished_andesite"); + public static final ItemType POLISHED_DIORITE = new ItemType("minecraft:polished_diorite"); + public static final ItemType POLISHED_GRANITE = new ItemType("minecraft:polished_granite"); + public static final ItemType POPPY = new ItemType("minecraft:poppy"); + public static final ItemType PORKCHOP = new ItemType("minecraft:porkchop"); + public static final ItemType POTATO = new ItemType("minecraft:potato"); + public static final ItemType POTION = new ItemType("minecraft:potion"); + public static final ItemType POWERED_RAIL = new ItemType("minecraft:powered_rail"); + public static final ItemType PRISMARINE = new ItemType("minecraft:prismarine"); + public static final ItemType PRISMARINE_BRICK_SLAB = new ItemType("minecraft:prismarine_brick_slab"); + public static final ItemType PRISMARINE_BRICK_STAIRS = new ItemType("minecraft:prismarine_brick_stairs"); + public static final ItemType PRISMARINE_BRICKS = new ItemType("minecraft:prismarine_bricks"); + public static final ItemType PRISMARINE_CRYSTALS = new ItemType("minecraft:prismarine_crystals"); + public static final ItemType PRISMARINE_SHARD = new ItemType("minecraft:prismarine_shard"); + public static final ItemType PRISMARINE_SLAB = new ItemType("minecraft:prismarine_slab"); + public static final ItemType PRISMARINE_STAIRS = new ItemType("minecraft:prismarine_stairs"); + public static final ItemType PUFFERFISH = new ItemType("minecraft:pufferfish"); + public static final ItemType PUFFERFISH_BUCKET = new ItemType("minecraft:pufferfish_bucket"); + public static final ItemType PUFFERFISH_SPAWN_EGG = new ItemType("minecraft:pufferfish_spawn_egg"); + public static final ItemType PUMPKIN = new ItemType("minecraft:pumpkin"); + public static final ItemType PUMPKIN_PIE = new ItemType("minecraft:pumpkin_pie"); + public static final ItemType PUMPKIN_SEEDS = new ItemType("minecraft:pumpkin_seeds"); + public static final ItemType PURPLE_BANNER = new ItemType("minecraft:purple_banner"); + public static final ItemType PURPLE_CARPET = new ItemType("minecraft:purple_carpet"); + public static final ItemType PURPLE_CONCRETE = new ItemType("minecraft:purple_concrete"); + public static final ItemType PURPLE_CONCRETE_POWDER = new ItemType("minecraft:purple_concrete_powder"); + public static final ItemType PURPLE_DYE = new ItemType("minecraft:purple_dye"); + public static final ItemType PURPLE_GLAZED_TERRACOTTA = new ItemType("minecraft:purple_glazed_terracotta"); + public static final ItemType PURPLE_STAINED_GLASS = new ItemType("minecraft:purple_stained_glass"); + public static final ItemType PURPLE_STAINED_GLASS_PANE = new ItemType("minecraft:purple_stained_glass_pane"); + public static final ItemType PURPLE_TERRACOTTA = new ItemType("minecraft:purple_terracotta"); + public static final ItemType PURPLE_WOOL = new ItemType("minecraft:purple_wool"); + public static final ItemType PURPUR_BLOCK = new ItemType("minecraft:purpur_block"); + public static final ItemType PURPUR_PILLAR = new ItemType("minecraft:purpur_pillar"); + public static final ItemType PURPUR_SLAB = new ItemType("minecraft:purpur_slab"); + public static final ItemType PURPUR_STAIRS = new ItemType("minecraft:purpur_stairs"); + public static final ItemType QUARTZ = new ItemType("minecraft:quartz"); + public static final ItemType QUARTZ_BLOCK = new ItemType("minecraft:quartz_block"); + public static final ItemType QUARTZ_PILLAR = new ItemType("minecraft:quartz_pillar"); + public static final ItemType QUARTZ_SLAB = new ItemType("minecraft:quartz_slab"); + public static final ItemType QUARTZ_STAIRS = new ItemType("minecraft:quartz_stairs"); + public static final ItemType RABBIT = new ItemType("minecraft:rabbit"); + public static final ItemType RABBIT_FOOT = new ItemType("minecraft:rabbit_foot"); + public static final ItemType RABBIT_HIDE = new ItemType("minecraft:rabbit_hide"); + public static final ItemType RABBIT_SPAWN_EGG = new ItemType("minecraft:rabbit_spawn_egg"); + public static final ItemType RABBIT_STEW = new ItemType("minecraft:rabbit_stew"); + public static final ItemType RAIL = new ItemType("minecraft:rail"); + public static final ItemType RED_BANNER = new ItemType("minecraft:red_banner"); + public static final ItemType RED_CARPET = new ItemType("minecraft:red_carpet"); + public static final ItemType RED_CONCRETE = new ItemType("minecraft:red_concrete"); + public static final ItemType RED_CONCRETE_POWDER = new ItemType("minecraft:red_concrete_powder"); + public static final ItemType RED_GLAZED_TERRACOTTA = new ItemType("minecraft:red_glazed_terracotta"); + public static final ItemType RED_MUSHROOM = new ItemType("minecraft:red_mushroom"); + public static final ItemType RED_MUSHROOM_BLOCK = new ItemType("minecraft:red_mushroom_block"); + public static final ItemType RED_NETHER_BRICKS = new ItemType("minecraft:red_nether_bricks"); + public static final ItemType RED_SAND = new ItemType("minecraft:red_sand"); + public static final ItemType RED_SANDSTONE = new ItemType("minecraft:red_sandstone"); + public static final ItemType RED_SANDSTONE_SLAB = new ItemType("minecraft:red_sandstone_slab"); + public static final ItemType RED_SANDSTONE_STAIRS = new ItemType("minecraft:red_sandstone_stairs"); + public static final ItemType RED_STAINED_GLASS = new ItemType("minecraft:red_stained_glass"); + public static final ItemType RED_STAINED_GLASS_PANE = new ItemType("minecraft:red_stained_glass_pane"); + public static final ItemType RED_TERRACOTTA = new ItemType("minecraft:red_terracotta"); + public static final ItemType RED_TULIP = new ItemType("minecraft:red_tulip"); + public static final ItemType RED_WOOL = new ItemType("minecraft:red_wool"); + public static final ItemType REDSTONE = new ItemType("minecraft:redstone"); + public static final ItemType REDSTONE_BLOCK = new ItemType("minecraft:redstone_block"); + public static final ItemType REDSTONE_LAMP = new ItemType("minecraft:redstone_lamp"); + public static final ItemType REDSTONE_ORE = new ItemType("minecraft:redstone_ore"); + public static final ItemType REPEATER = new ItemType("minecraft:repeater"); + public static final ItemType ROSE_RED = new ItemType("minecraft:rose_red"); + public static final ItemType ROTTEN_FLESH = new ItemType("minecraft:rotten_flesh"); + public static final ItemType SADDLE = new ItemType("minecraft:saddle"); + public static final ItemType SALMON = new ItemType("minecraft:salmon"); + public static final ItemType SALMON_BUCKET = new ItemType("minecraft:salmon_bucket"); + public static final ItemType SALMON_SPAWN_EGG = new ItemType("minecraft:salmon_spawn_egg"); + public static final ItemType SAND = new ItemType("minecraft:sand"); + public static final ItemType SANDSTONE = new ItemType("minecraft:sandstone"); + public static final ItemType SANDSTONE_SLAB = new ItemType("minecraft:sandstone_slab"); + public static final ItemType SANDSTONE_STAIRS = new ItemType("minecraft:sandstone_stairs"); + public static final ItemType SCUTE = new ItemType("minecraft:scute"); + public static final ItemType SEA_LANTERN = new ItemType("minecraft:sea_lantern"); + public static final ItemType SEA_PICKLE = new ItemType("minecraft:sea_pickle"); + public static final ItemType SEAGRASS = new ItemType("minecraft:seagrass"); + public static final ItemType SHEARS = new ItemType("minecraft:shears"); + public static final ItemType SHEEP_SPAWN_EGG = new ItemType("minecraft:sheep_spawn_egg"); + public static final ItemType SHIELD = new ItemType("minecraft:shield"); + public static final ItemType SHULKER_SHELL = new ItemType("minecraft:shulker_shell"); + public static final ItemType SHULKER_SPAWN_EGG = new ItemType("minecraft:shulker_spawn_egg"); + public static final ItemType SIGN = new ItemType("minecraft:sign"); + public static final ItemType SILVERFISH_SPAWN_EGG = new ItemType("minecraft:silverfish_spawn_egg"); + public static final ItemType SKELETON_HORSE_SPAWN_EGG = new ItemType("minecraft:skeleton_horse_spawn_egg"); + public static final ItemType SKELETON_SPAWN_EGG = new ItemType("minecraft:skeleton_spawn_egg"); + public static final ItemType SLIME_BALL = new ItemType("minecraft:slime_ball"); + public static final ItemType SLIME_BLOCK = new ItemType("minecraft:slime_block"); + public static final ItemType SLIME_SPAWN_EGG = new ItemType("minecraft:slime_spawn_egg"); + public static final ItemType SMOOTH_QUARTZ = new ItemType("minecraft:smooth_quartz"); + public static final ItemType SMOOTH_RED_SANDSTONE = new ItemType("minecraft:smooth_red_sandstone"); + public static final ItemType SMOOTH_SANDSTONE = new ItemType("minecraft:smooth_sandstone"); + public static final ItemType SMOOTH_STONE = new ItemType("minecraft:smooth_stone"); + public static final ItemType SNOW = new ItemType("minecraft:snow"); + public static final ItemType SNOW_BLOCK = new ItemType("minecraft:snow_block"); + public static final ItemType SNOWBALL = new ItemType("minecraft:snowball"); + public static final ItemType SOUL_SAND = new ItemType("minecraft:soul_sand"); + public static final ItemType SPECTRAL_ARROW = new ItemType("minecraft:spectral_arrow"); + public static final ItemType SPIDER_EYE = new ItemType("minecraft:spider_eye"); + public static final ItemType SPIDER_SPAWN_EGG = new ItemType("minecraft:spider_spawn_egg"); + public static final ItemType SPLASH_POTION = new ItemType("minecraft:splash_potion"); + public static final ItemType SPONGE = new ItemType("minecraft:sponge"); + public static final ItemType SPRUCE_BARK = new ItemType("minecraft:spruce_bark"); + public static final ItemType SPRUCE_BOAT = new ItemType("minecraft:spruce_boat"); + public static final ItemType SPRUCE_BUTTON = new ItemType("minecraft:spruce_button"); + public static final ItemType SPRUCE_FENCE = new ItemType("minecraft:spruce_fence"); + public static final ItemType SPRUCE_FENCE_GATE = new ItemType("minecraft:spruce_fence_gate"); + public static final ItemType SPRUCE_LEAVES = new ItemType("minecraft:spruce_leaves"); + public static final ItemType SPRUCE_LOG = new ItemType("minecraft:spruce_log"); + public static final ItemType SPRUCE_PLANKS = new ItemType("minecraft:spruce_planks"); + public static final ItemType SPRUCE_PRESSURE_PLATE = new ItemType("minecraft:spruce_pressure_plate"); + public static final ItemType SPRUCE_SAPLING = new ItemType("minecraft:spruce_sapling"); + public static final ItemType SPRUCE_SLAB = new ItemType("minecraft:spruce_slab"); + public static final ItemType SPRUCE_STAIRS = new ItemType("minecraft:spruce_stairs"); + public static final ItemType SPRUCE_TRAPDOOR = new ItemType("minecraft:spruce_trapdoor"); + public static final ItemType SQUID_SPAWN_EGG = new ItemType("minecraft:squid_spawn_egg"); + public static final ItemType STICK = new ItemType("minecraft:stick"); + public static final ItemType STICKY_PISTON = new ItemType("minecraft:sticky_piston"); + public static final ItemType STONE = new ItemType("minecraft:stone"); + public static final ItemType STONE_AXE = new ItemType("minecraft:stone_axe"); + public static final ItemType STONE_BRICK_SLAB = new ItemType("minecraft:stone_brick_slab"); + public static final ItemType STONE_BRICK_STAIRS = new ItemType("minecraft:stone_brick_stairs"); + public static final ItemType STONE_BRICKS = new ItemType("minecraft:stone_bricks"); + public static final ItemType STONE_BUTTON = new ItemType("minecraft:stone_button"); + public static final ItemType STONE_HOE = new ItemType("minecraft:stone_hoe"); + public static final ItemType STONE_PICKAXE = new ItemType("minecraft:stone_pickaxe"); + public static final ItemType STONE_PRESSURE_PLATE = new ItemType("minecraft:stone_pressure_plate"); + public static final ItemType STONE_SHOVEL = new ItemType("minecraft:stone_shovel"); + public static final ItemType STONE_SLAB = new ItemType("minecraft:stone_slab"); + public static final ItemType STONE_SWORD = new ItemType("minecraft:stone_sword"); + public static final ItemType STRAY_SPAWN_EGG = new ItemType("minecraft:stray_spawn_egg"); + public static final ItemType STRING = new ItemType("minecraft:string"); + public static final ItemType STRIPPED_ACACIA_LOG = new ItemType("minecraft:stripped_acacia_log"); + public static final ItemType STRIPPED_BIRCH_LOG = new ItemType("minecraft:stripped_birch_log"); + public static final ItemType STRIPPED_DARK_OAK_LOG = new ItemType("minecraft:stripped_dark_oak_log"); + public static final ItemType STRIPPED_JUNGLE_LOG = new ItemType("minecraft:stripped_jungle_log"); + public static final ItemType STRIPPED_OAK_LOG = new ItemType("minecraft:stripped_oak_log"); + public static final ItemType STRIPPED_SPRUCE_LOG = new ItemType("minecraft:stripped_spruce_log"); + public static final ItemType STRUCTURE_VOID = new ItemType("minecraft:structure_void"); + public static final ItemType SUGAR = new ItemType("minecraft:sugar"); + public static final ItemType SUGAR_CANE = new ItemType("minecraft:sugar_cane"); + public static final ItemType TERRACOTTA = new ItemType("minecraft:terracotta"); + public static final ItemType TIPPED_ARROW = new ItemType("minecraft:tipped_arrow"); + public static final ItemType TNT = new ItemType("minecraft:tnt"); + public static final ItemType TNT_MINECART = new ItemType("minecraft:tnt_minecart"); + public static final ItemType TOTEM_OF_UNDYING = new ItemType("minecraft:totem_of_undying"); + public static final ItemType TRAPPED_CHEST = new ItemType("minecraft:trapped_chest"); + public static final ItemType TRIDENT = new ItemType("minecraft:trident"); + public static final ItemType TRIPWIRE_HOOK = new ItemType("minecraft:tripwire_hook"); + public static final ItemType TROPICAL_FISH_SPAWN_EGG = new ItemType("minecraft:tropical_fish_spawn_egg"); + public static final ItemType TUBE_CORAL = new ItemType("minecraft:tube_coral"); + public static final ItemType TUBE_CORAL_BLOCK = new ItemType("minecraft:tube_coral_block"); + public static final ItemType TUBE_CORAL_FAN = new ItemType("minecraft:tube_coral_fan"); + public static final ItemType TURTLE_EGG = new ItemType("minecraft:turtle_egg"); + public static final ItemType TURTLE_HELMET = new ItemType("minecraft:turtle_helmet"); + public static final ItemType TURTLE_SPAWN_EGG = new ItemType("minecraft:turtle_spawn_egg"); + public static final ItemType VEX_SPAWN_EGG = new ItemType("minecraft:vex_spawn_egg"); + public static final ItemType VILLAGER_SPAWN_EGG = new ItemType("minecraft:villager_spawn_egg"); + public static final ItemType VINDICATION_ILLAGER_SPAWN_EGG = new ItemType("minecraft:vindication_illager_spawn_egg"); + public static final ItemType VINE = new ItemType("minecraft:vine"); + public static final ItemType WATER_BUCKET = new ItemType("minecraft:water_bucket"); + public static final ItemType WET_SPONGE = new ItemType("minecraft:wet_sponge"); + public static final ItemType WHEAT = new ItemType("minecraft:wheat"); + public static final ItemType WHEAT_SEEDS = new ItemType("minecraft:wheat_seeds"); + public static final ItemType WHITE_BANNER = new ItemType("minecraft:white_banner"); + public static final ItemType WHITE_CARPET = new ItemType("minecraft:white_carpet"); + public static final ItemType WHITE_CONCRETE = new ItemType("minecraft:white_concrete"); + public static final ItemType WHITE_CONCRETE_POWDER = new ItemType("minecraft:white_concrete_powder"); + public static final ItemType WHITE_GLAZED_TERRACOTTA = new ItemType("minecraft:white_glazed_terracotta"); + public static final ItemType WHITE_STAINED_GLASS = new ItemType("minecraft:white_stained_glass"); + public static final ItemType WHITE_STAINED_GLASS_PANE = new ItemType("minecraft:white_stained_glass_pane"); + public static final ItemType WHITE_TERRACOTTA = new ItemType("minecraft:white_terracotta"); + public static final ItemType WHITE_TULIP = new ItemType("minecraft:white_tulip"); + public static final ItemType WHITE_WOOL = new ItemType("minecraft:white_wool"); + public static final ItemType WITCH_SPAWN_EGG = new ItemType("minecraft:witch_spawn_egg"); + public static final ItemType WITHER_SKELETON_SPAWN_EGG = new ItemType("minecraft:wither_skeleton_spawn_egg"); + public static final ItemType WOLF_SPAWN_EGG = new ItemType("minecraft:wolf_spawn_egg"); + public static final ItemType WOODEN_AXE = new ItemType("minecraft:wooden_axe"); + public static final ItemType WOODEN_HOE = new ItemType("minecraft:wooden_hoe"); + public static final ItemType WOODEN_PICKAXE = new ItemType("minecraft:wooden_pickaxe"); + public static final ItemType WOODEN_SHOVEL = new ItemType("minecraft:wooden_shovel"); + public static final ItemType WOODEN_SWORD = new ItemType("minecraft:wooden_sword"); + public static final ItemType WRITABLE_BOOK = new ItemType("minecraft:writable_book"); + public static final ItemType WRITTEN_BOOK = new ItemType("minecraft:written_book"); + public static final ItemType YELLOW_BANNER = new ItemType("minecraft:yellow_banner"); + public static final ItemType YELLOW_CARPET = new ItemType("minecraft:yellow_carpet"); + public static final ItemType YELLOW_CONCRETE = new ItemType("minecraft:yellow_concrete"); + public static final ItemType YELLOW_CONCRETE_POWDER = new ItemType("minecraft:yellow_concrete_powder"); + public static final ItemType YELLOW_GLAZED_TERRACOTTA = new ItemType("minecraft:yellow_glazed_terracotta"); + public static final ItemType YELLOW_STAINED_GLASS = new ItemType("minecraft:yellow_stained_glass"); + public static final ItemType YELLOW_STAINED_GLASS_PANE = new ItemType("minecraft:yellow_stained_glass_pane"); + public static final ItemType YELLOW_TERRACOTTA = new ItemType("minecraft:yellow_terracotta"); + public static final ItemType YELLOW_WOOL = new ItemType("minecraft:yellow_wool"); + public static final ItemType ZOMBIE_HORSE_SPAWN_EGG = new ItemType("minecraft:zombie_horse_spawn_egg"); + public static final ItemType ZOMBIE_PIGMAN_SPAWN_EGG = new ItemType("minecraft:zombie_pigman_spawn_egg"); + public static final ItemType ZOMBIE_SPAWN_EGG = new ItemType("minecraft:zombie_spawn_egg"); + public static final ItemType ZOMBIE_VILLAGER_SPAWN_EGG = new ItemType("minecraft:zombie_villager_spawn_egg"); private static final Map itemMapping = new HashMap<>(); From 1cc735e359cd691f803f25327d2872dd9fc2d0af Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 14 Jun 2018 11:55:02 +1000 Subject: [PATCH 08/74] Further work on items --- .../com/sk89q/worldedit/blocks/BaseBlock.java | 4 +- .../worldedit/blocks/type/BlockType.java | 4 ++ .../worldedit/blocks/type/BlockTypes.java | 4 ++ .../sk89q/worldedit/blocks/type/ItemType.java | 4 ++ .../worldedit/blocks/type/ItemTypes.java | 4 ++ .../command/argument/ItemParser.java | 3 -- .../extension/factory/DefaultItemParser.java | 17 ++++---- .../world/registry/BundledBlockData.java | 6 ++- .../world/registry/BundledItemData.java | 4 ++ .../world/registry/BundledItemRegistry.java | 3 +- .../world/registry/NullItemRegistry.java | 40 ------------------- 11 files changed, 36 insertions(+), 57 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemRegistry.java diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 40f3c0f30..87b790191 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -290,7 +290,7 @@ public class BaseBlock extends Block implements TileEntityBlock { return ""; } Tag idTag = nbtData.getValue().get("id"); - if (idTag != null && idTag instanceof StringTag) { + if (idTag instanceof StringTag) { return ((StringTag) idTag).getValue(); } else { return ""; @@ -413,7 +413,7 @@ public class BaseBlock extends Block implements TileEntityBlock { * @return true if equal */ public boolean equalsFuzzy(BaseBlock o) { - return (getType() == o.getType()) && (getData() == o.getData() || getData() == -1 || o.getData() == -1); + return (getType().equals(o.getType())) && (getData() == o.getData() || getData() == -1 || o.getData() == -1); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java index 5625d6bdd..a61bf0317 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java @@ -26,6 +26,10 @@ public class BlockType { private String id; public BlockType(String id) { + // If it has no namespace, assume minecraft. + if (!id.contains(":")) { + id = "minecraft:" + id; + } this.id = id; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java index 21dc523db..bbe1e58bb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java @@ -587,6 +587,10 @@ public class BlockTypes { @Nullable public static BlockType getBlockType(String id) { + // If it has no namespace, assume minecraft. + if (id != null && !id.contains(":")) { + id = "minecraft:" + id; + } return blockMapping.get(id); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java index d83034bf6..ddd9d4271 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java @@ -26,6 +26,10 @@ public class ItemType { private String id; public ItemType(String id) { + // If it has no namespace, assume minecraft. + if (!id.contains(":")) { + id = "minecraft:" + id; + } this.id = id; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java index 51464763a..1810a67e7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java @@ -766,6 +766,10 @@ public class ItemTypes { @Nullable public static ItemType getItemType(String id) { + // If it has no namespace, assume minecraft. + if (id != null && !id.contains(":")) { + id = "minecraft:" + id; + } return itemMapping.get(id); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java index 3f548fb06..878fc013c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java @@ -27,7 +27,6 @@ import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extension.input.InputParseException; -import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; @@ -65,8 +64,6 @@ public class ItemParser extends SimpleCommand { try { return WorldEdit.getInstance().getItemFactory().parseFromInput(itemString, parserContext); - } catch (NoMatchException e) { - throw new CommandException(e.getMessage(), e); } catch (InputParseException e) { throw new CommandException(e.getMessage(), e); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java index ee7fc917a..b837f6d4b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java @@ -35,7 +35,7 @@ public class DefaultItemParser extends InputParser { public BaseItem parseFromInput(String input, ParserContext context) throws InputParseException { String[] tokens = input.split(":", 3); BaseItem item; - short meta = 0; + short damage = 0; try { int id = Integer.parseInt(tokens[0]); @@ -43,24 +43,23 @@ public class DefaultItemParser extends InputParser { // Parse metadata if (tokens.length == 2) { try { - meta = Short.parseShort(tokens[1]); + damage = Short.parseShort(tokens[1]); } catch (NumberFormatException ignored) { - throw new InputParseException("Expected '" + tokens[1] + "' to be a metadata value but it's not a number"); + throw new InputParseException("Expected '" + tokens[1] + "' to be a damage value but it's not a number"); } } item = context.requireWorld().getWorldData().getItemRegistry().createFromId(id); } catch (NumberFormatException e) { - if (input.length() < 2) { - throw new InputParseException("'" + input + "' isn't a known item name format"); + String name = tokens[0]; + if (input.length() >= 2) { + name += ":" + tokens[1]; } - String name = tokens[0] + ":" + tokens[1]; - // Parse metadata if (tokens.length == 3) { try { - meta = Short.parseShort(tokens[2]); + damage = Short.parseShort(tokens[2]); } catch (NumberFormatException ignored) { throw new InputParseException("Expected '" + tokens[2] + "' to be a metadata value but it's not a number"); } @@ -72,7 +71,7 @@ public class DefaultItemParser extends InputParser { if (item == null) { throw new InputParseException("'" + input + "' did not match any item"); } else { - item.setData(meta); + item.setDamage(damage); return item; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 7cf8491be..b79465de3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -98,6 +98,10 @@ public class BundledBlockData { */ @Nullable private BlockEntry findById(String id) { + // If it has no namespace, assume minecraft. + if (!id.contains(":")) { + id = "minecraft:" + id; + } return idMap.get(id); } @@ -190,7 +194,7 @@ public class BundledBlockData { private String id; private String unlocalizedName; private List aliases; - private Map states = new HashMap(); + private Map states = new HashMap<>(); private SimpleBlockMaterial material = new SimpleBlockMaterial(); void postDeserialization() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java index c8a238409..4b2e4f434 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java @@ -99,6 +99,10 @@ public class BundledItemData { */ @Nullable private ItemEntry findById(String id) { + // If it has no namespace, assume minecraft. + if (!id.contains(":")) { + id = "minecraft:" + id; + } return idMap.get(id); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java index d0474ec4d..ab864ae29 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java @@ -33,8 +33,7 @@ public class BundledItemRegistry implements ItemRegistry { @Nullable @Override public BaseItem createFromId(String id) { - // TODO Fix legacy ID usage - return new BaseItem(ItemTypes.getItemType(id).getLegacyId()); + return new BaseItem(ItemTypes.getItemType(id)); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemRegistry.java deleted file mode 100644 index bcaf3698d..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemRegistry.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.world.registry; - -import com.sk89q.worldedit.blocks.BaseItem; - -import javax.annotation.Nullable; - -public class NullItemRegistry implements ItemRegistry { - - @Nullable - @Override - public BaseItem createFromId(String id) { - return null; - } - - @Nullable - @Override - public BaseItem createFromId(int id) { - return null; - } - -} From a71e39d777b85dca23b0423f305746e1b5962045 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 14 Jun 2018 16:35:56 +1000 Subject: [PATCH 09/74] Convert the data system to a state system. This doesn't work, needs new data --- .../com/sk89q/worldedit/blocks/LazyBlock.java | 15 ++- .../com/sk89q/worldedit/masks/BlockMask.java | 2 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 113 +++++++++++------- .../worldedit/command/tool/QueryTool.java | 46 +------ .../transform/BlockTransformExtent.java | 26 ++-- .../function/block/ExtentBlockCopy.java | 2 +- .../function/generator/FloraGenerator.java | 3 +- .../generator/GardenPatchGenerator.java | 2 +- .../worldedit/function/mask/BlockMask.java | 2 +- .../function/mask/FuzzyBlockMask.java | 2 +- .../sk89q/worldedit/world/AbstractWorld.java | 16 +-- .../world/registry/BlockRegistry.java | 1 + .../world/registry/BundledBlockData.java | 13 +- .../world/registry/BundledBlockRegistry.java | 1 + .../worldedit/world/registry/SimpleState.java | 71 ----------- .../registry/state/DirectionalState.java | 26 ++++ .../world/registry/state/SimpleState.java | 37 ++++++ .../world/registry/{ => state}/State.java | 34 ++---- .../value/DirectionalStateValue.java} | 32 +---- .../state/value/SimpleStateValue.java | 41 +++++++ .../{ => state/value}/StateValue.java | 21 ++-- 21 files changed, 236 insertions(+), 270 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleState.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java rename worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/{ => state}/State.java (55%) rename worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/{SimpleStateValue.java => state/value/DirectionalStateValue.java} (55%) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java rename worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/{ => state/value}/StateValue.java (68%) diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java index 2a55ba4d8..6e3a7e9b4 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java @@ -23,9 +23,13 @@ import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.registry.state.State; +import com.sk89q.worldedit.world.registry.state.value.StateValue; import static com.google.common.base.Preconditions.checkNotNull; +import java.util.Map; + /** * A implementation of a lazy block for {@link Extent#getLazyBlock(Vector)} * that takes the block's ID and metadata, but will defer loading of NBT @@ -78,13 +82,13 @@ public class LazyBlock extends BaseBlock { * Create a new lazy block. * * @param type the block type - * @param data the data value + * @param states the block states * @param extent the extent to later load the full block data from * @param position the position to later load the full block data from */ @Deprecated - public LazyBlock(BlockType type, int data, Extent extent, Vector position) { - super(type, data); + public LazyBlock(BlockType type, Map states, Extent extent, Vector position) { + super(type, states); checkNotNull(extent); checkNotNull(position); this.extent = extent; @@ -123,6 +127,11 @@ public class LazyBlock extends BaseBlock { throw new UnsupportedOperationException("This object is immutable"); } + @Override + public void setState(State state, StateValue stateValue) { + throw new UnsupportedOperationException("This object is immutable"); + } + @Override public CompoundTag getNbtData() { if (!loaded) { diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockMask.java index a6dd9ab97..f50b76de2 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockMask.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockMask.java @@ -67,7 +67,7 @@ public class BlockMask extends AbstractMask { public boolean matches(EditSession editSession, Vector position) { BaseBlock block = editSession.getBlock(position); return blocks.contains(block) - || blocks.contains(new BaseBlock(block.getType(), -1)); + || blocks.contains(new BaseBlock(block.getType())); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 87b790191..dd1ead2c4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -28,10 +28,15 @@ import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.foundation.Block; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.world.registry.BundledBlockData; -import com.sk89q.worldedit.world.registry.WorldData; +import com.sk89q.worldedit.world.registry.state.State; +import com.sk89q.worldedit.world.registry.state.value.StateValue; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import javax.annotation.Nullable; -import java.util.Collection; /** * Represents a mutable "snapshot" of a block. @@ -42,15 +47,6 @@ import java.util.Collection; * snapshot of blocks correctly, so, for example, the NBT data for a block * may be missing.

* - *

This class identifies blocks using an integer ID. However, IDs for - * a given block may differ between worlds so it is important that users of - * this class convert the ID from one "world space" to another "world space," - * a task that that is assisted with by working with the source and - * destination {@link WorldData} instances. Numeric IDs are utilized because - * they are more space efficient to store, and it also implies that internal - * uses of this class (i.e. history, etc.) do not need to worry about - * interning block string IDs.

- * *

A peculiar detail of this class is that it accepts {@code -1} as a * valid data value. This is due to legacy reasons: WorldEdit uses -1 * as a "wildcard" block value, even though a {@link Mask} would be @@ -59,17 +55,11 @@ import java.util.Collection; @SuppressWarnings("deprecation") public class BaseBlock extends Block implements TileEntityBlock { - /** - * Indicates the maximum data value (inclusive) that can be used. A future - * version of Minecraft may abolish block data values. - */ - public static final int MAX_DATA = 15; - // Instances of this class should be _as small as possible_ because there will // be millions of instances of this object. private BlockType blockType; - private short data; + private Map states; @Nullable private CompoundTag nbtData; @@ -83,6 +73,7 @@ public class BaseBlock extends Block implements TileEntityBlock { public BaseBlock(int id) { internalSetId(id); internalSetData(0); + this.states = new HashMap<>(); } /** @@ -92,6 +83,7 @@ public class BaseBlock extends Block implements TileEntityBlock { */ public BaseBlock(BlockType blockType) { internalSetType(blockType); + this.states = new HashMap<>(); } /** @@ -106,22 +98,20 @@ public class BaseBlock extends Block implements TileEntityBlock { public BaseBlock(int id, int data) { internalSetId(id); internalSetData(data); + this.states = new HashMap<>(); } /** * Construct a block with the given ID and data value. * - * THIS WILL GET REMOVED SOON. - * * @param blockType The block type - * @param data data value + * @param states The states * @see #setId(int) * @see #setData(int) */ - @Deprecated - public BaseBlock(BlockType blockType, int data) { + public BaseBlock(BlockType blockType, Map states) { internalSetType(blockType); - internalSetData(data); + setStates(states); } /** @@ -136,21 +126,19 @@ public class BaseBlock extends Block implements TileEntityBlock { internalSetId(id); setData(data); setNbtData(nbtData); + this.states = new HashMap<>(); } /** * Construct a block with the given ID, data value and NBT data structure. * - * THIS WILL GET REMOVED SOON. - * * @param blockType The block type - * @param data data value + * @param states The states * @param nbtData NBT data, which may be null */ - @Deprecated - public BaseBlock(BlockType blockType, int data, @Nullable CompoundTag nbtData) { + public BaseBlock(BlockType blockType, Map states, @Nullable CompoundTag nbtData) { setType(blockType); - setData(data); + setStates(states); setNbtData(nbtData); } @@ -160,7 +148,7 @@ public class BaseBlock extends Block implements TileEntityBlock { * @param other the other block */ public BaseBlock(BaseBlock other) { - this(other.getId(), other.getData(), other.getNbtData()); + this(other.getType(), other.getStates(), other.getNbtData()); } /** @@ -216,38 +204,70 @@ public class BaseBlock extends Block implements TileEntityBlock { /** * Get the block's data value. * + * Broken - do not use + * * @return data value (0-15) */ @Override + @Deprecated public int getData() { - return data; + return 0; } /** - * Set the block's data value. + * Gets a map of state to statevalue * - * @param data block data value (between 0 and {@link #MAX_DATA}). + * @return The state map */ - protected final void internalSetData(int data) { - if (data > MAX_DATA) { - throw new IllegalArgumentException( - "Can't have a block data value above " + MAX_DATA + " (" - + data + " given)"); - } + public Map getStates() { + return Collections.unmodifiableMap(states); + } - if (data < -1) { - throw new IllegalArgumentException("Can't have a block data value below -1"); - } + /** + * Sets the states of this block. + * + * @param states The states + */ + private void setStates(Map states) { + this.states = states; + } - this.data = (short) data; + /** + * Gets the State for this Block. + * + * @param state The state to get the value for + * @return The state value + */ + public StateValue getState(State state) { + return states.get(state); + } + + /** + * Sets a state to a specific value + * + * @param state The state + * @param stateValue The value + */ + public void setState(State state, StateValue stateValue) { + this.states.put(state, stateValue); } /** * Set the block's data value. * - * @param data block data value (between 0 and {@link #MAX_DATA}). + * @param data block data value + */ + @Deprecated + protected final void internalSetData(int data) { + } + + /** + * Set the block's data value. + * + * @param data block data value */ @Override + @Deprecated public void setData(int data) { internalSetData(data); } @@ -274,6 +294,7 @@ public class BaseBlock extends Block implements TileEntityBlock { * @return true if the data value is -1 */ @Override + @Deprecated public boolean hasWildcardData() { return getData() == -1; } @@ -446,7 +467,7 @@ public class BaseBlock extends Block implements TileEntityBlock { @Override public String toString() { - return "Block{Type:" + getType().getId() + ", Data: " + getData() + "}"; + return "Block{Type:" + getType().getId() + ", States: " + getStates().toString() + "}"; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index a0ed140b5..9a12f7891 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -23,23 +23,12 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; -import com.sk89q.worldedit.blocks.BlockType; -import com.sk89q.worldedit.blocks.ClothColor; import com.sk89q.worldedit.blocks.MobSpawnerBlock; import com.sk89q.worldedit.blocks.NoteBlock; -import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; -import com.sk89q.worldedit.world.registry.BundledBlockData; -import com.sk89q.worldedit.world.registry.SimpleState; -import com.sk89q.worldedit.world.registry.State; -import com.sk89q.worldedit.world.registry.StateValue; - -import java.util.Map; -import java.util.Map.Entry; /** * Looks up information about a block. @@ -57,13 +46,12 @@ public class QueryTool implements BlockTool { World world = (World) clicked.getExtent(); EditSession editSession = session.createEditSession(player); BaseBlock block = editSession.getBlock(clicked.toVector()); - BlockType type = BlockType.fromID(block.getType().getLegacyId()); player.print("\u00A79@" + clicked.toVector() + ": " + "\u00A7e" + "#" + block.getType() + "\u00A77" + " (" - + (type == null ? "Unknown" : type.getName()) + ") " + + block.getType().getId() + ") " + "\u00A7f" - + "[" + block.getData() + "]" + " (" + world.getBlockLightLevel(clicked.toVector()) + "/" + world.getBlockLightLevel(clicked.toVector().add(0, 1, 0)) + ")"); + + "[" + block.getStates().toString() + "]" + " (" + world.getBlockLightLevel(clicked.toVector()) + "/" + world.getBlockLightLevel(clicked.toVector().add(0, 1, 0)) + ")"); if (block instanceof MobSpawnerBlock) { player.printRaw("\u00A7e" + "Mob Type: " @@ -73,36 +61,6 @@ public class QueryTool implements BlockTool { + ((NoteBlock) block).getNote()); } - Map states = BundledBlockData.getInstance().getStatesById(block.getType().getId()); - if (states == null || states.isEmpty()) return true; - StringBuilder builder = new StringBuilder(); - builder.append("States: "); - boolean first = true; - boolean hasVisibleStates = false; - for (Entry e : states.entrySet()) { - String name = e.getKey(); - State state = e.getValue(); - if (state instanceof SimpleState && ((SimpleState) state).getDataMask() == 0) { - continue; // don't try to determine states that aren't reflected in their data value - } - hasVisibleStates = true; - if (!first) { - builder.append(", "); - } - first = false; - String valName = ""; - for (Entry entry : state.valueMap().entrySet()) { - if (entry.getValue().isSet(block)) { - valName = entry.getKey(); - break; - } - } - builder.append("\u00A79").append(name).append(": \u00A7f").append(valName != null ? valName : "set"); - } - if (hasVisibleStates) { - player.printRaw(builder.toString()); - } - return true; } 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 dc634ed2f..abe9a8c7b 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 @@ -19,6 +19,8 @@ package com.sk89q.worldedit.extent.transform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; @@ -26,13 +28,13 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.world.registry.BlockRegistry; -import com.sk89q.worldedit.world.registry.State; -import com.sk89q.worldedit.world.registry.StateValue; +import com.sk89q.worldedit.world.registry.state.DirectionalState; +import com.sk89q.worldedit.world.registry.state.State; +import com.sk89q.worldedit.world.registry.state.value.DirectionalStateValue; -import javax.annotation.Nullable; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Transforms blocks themselves (but not their position) according to a @@ -131,12 +133,12 @@ public class BlockTransformExtent extends AbstractDelegateExtent { } for (State state : states.values()) { - if (state.hasDirection()) { - StateValue value = state.getValue(block); - if (value != null && value.getDirection() != null) { - StateValue newValue = getNewStateValue(state, transform, value.getDirection()); + if (state instanceof DirectionalState) { + DirectionalStateValue value = (DirectionalStateValue) block.getState(state); + if (value != null && value.getData() != null) { + DirectionalStateValue newValue = getNewStateValue((DirectionalState) state, transform, value.getDirection()); if (newValue != null) { - newValue.set(changedBlock); + changedBlock.setState(state, newValue); } } } @@ -154,13 +156,13 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * @return a new state or null if none could be found */ @Nullable - private static StateValue getNewStateValue(State state, Transform transform, Vector oldDirection) { + private static DirectionalStateValue getNewStateValue(DirectionalState state, Transform transform, Vector oldDirection) { Vector newDirection = transform.apply(oldDirection).subtract(transform.apply(Vector.ZERO)).normalize(); - StateValue newValue = null; + DirectionalStateValue newValue = null; double closest = -2; boolean found = false; - for (StateValue v : state.valueMap().values()) { + for (DirectionalStateValue v : state.getValues()) { if (v.getDirection() != null) { double dot = v.getDirection().normalize().dot(newDirection); if (dot >= closest) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java index c72990a1b..576882ded 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java @@ -104,7 +104,7 @@ public class ExtentBlockCopy implements RegionFunction { builder.putByte("Rot", (byte) MCDirections.toRotation(newDirection)); - return new BaseBlock(state.getType(), state.getData(), builder.build()); + return new BaseBlock(state.getType(), state.getStates(), builder.build()); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index a5d68d8f1..068c075a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; @@ -97,7 +96,7 @@ public class FloraGenerator implements RegionFunction { */ public static Pattern getTemperatePattern() { RandomPattern pattern = new RandomPattern(); - pattern.add(new BlockPattern(new BaseBlock(BlockTypes.TALL_GRASS, 1)), 300); + pattern.add(new BlockPattern(new BaseBlock(BlockTypes.GRASS)), 300); pattern.add(new BlockPattern(new BaseBlock(BlockTypes.POPPY)), 5); pattern.add(new BlockPattern(new BaseBlock(BlockTypes.DANDELION)), 5); return pattern; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index e0da9361b..c9b1294a1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -190,7 +190,7 @@ public class GardenPatchGenerator implements RegionFunction { public static Pattern getPumpkinPattern() { RandomPattern pattern = new RandomPattern(); for (int i = 0; i < 4; i++) { - pattern.add(new BlockPattern(new BaseBlock(BlockTypes.PUMPKIN, i)), 100); +// TODO pattern.add(new BlockPattern(new BaseBlock(BlockTypes.CARVED_PUMPKIN, i)), 100); } return pattern; } 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 bd2e1c831..15fe2705e 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 @@ -95,7 +95,7 @@ public class BlockMask extends AbstractExtentMask { @Override public boolean test(Vector vector) { BaseBlock block = getExtent().getBlock(vector); - return blocks.contains(block) || blocks.contains(new BaseBlock(block.getType(), -1)); + return blocks.contains(block) || blocks.contains(new BaseBlock(block.getType())); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java index 19a0b7590..0b0fc603f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java @@ -41,7 +41,7 @@ public class FuzzyBlockMask extends BlockMask { Extent extent = getExtent(); Collection blocks = getBlocks(); BaseBlock lazyBlock = extent.getLazyBlock(vector); - BaseBlock compare = new BaseBlock(lazyBlock.getType(), lazyBlock.getData()); + BaseBlock compare = new BaseBlock(lazyBlock.getType(), lazyBlock.getStates()); return Blocks.containsFuzzy(blocks, compare); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index fea1e00da..3f2d0e9b7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -27,7 +27,6 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extension.platform.Platform; @@ -37,15 +36,16 @@ import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.TreeGenerator.TreeType; -import javax.annotation.Nullable; import java.util.PriorityQueue; +import javax.annotation.Nullable; + /** * An abstract implementation of {@link World}. */ public abstract class AbstractWorld implements World { - private final PriorityQueue effectQueue = new PriorityQueue(); + private final PriorityQueue effectQueue = new PriorityQueue<>(); private int taskId = -1; @Override @@ -65,7 +65,7 @@ public abstract class AbstractWorld implements World { @Override public final void setBlockData(Vector position, int data) { try { - setBlock(position, new BaseBlock(getLazyBlock(position).getType(), data)); + setBlock(position, new BaseBlock(getLazyBlock(position).getType().getLegacyId(), data)); } catch (WorldEditException ignored) { } } @@ -103,10 +103,10 @@ public abstract class AbstractWorld implements World { @Override public Mask createLiquidMask() { return new BlockMask(this, - new BaseBlock(BlockTypes.LAVA, -1), - new BaseBlock(BlockTypes.FLOWING_LAVA, -1), - new BaseBlock(BlockTypes.WATER, -1), - new BaseBlock(BlockTypes.FLOWING_WATER, -1)); + new BaseBlock(BlockTypes.LAVA), + new BaseBlock(BlockTypes.FLOWING_LAVA), + new BaseBlock(BlockTypes.WATER), + new BaseBlock(BlockTypes.FLOWING_WATER)); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index 45b5afb43..12e35a040 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockMaterial; +import com.sk89q.worldedit.world.registry.state.State; import javax.annotation.Nullable; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index b79465de3..846eba25c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -26,6 +26,8 @@ import com.google.gson.reflect.TypeToken; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.util.gson.VectorAdapter; +import com.sk89q.worldedit.world.registry.state.SimpleState; +import com.sk89q.worldedit.world.registry.state.State; import javax.annotation.Nullable; import java.io.IOException; @@ -53,8 +55,8 @@ public class BundledBlockData { private static final Logger log = Logger.getLogger(BundledBlockData.class.getCanonicalName()); private static final BundledBlockData INSTANCE = new BundledBlockData(); - private final Map idMap = new HashMap(); - private final Map legacyMap = new HashMap(); // Trove usage removed temporarily + private final Map idMap = new HashMap<>(); + private final Map legacyMap = new HashMap<>(); // Trove usage removed temporarily /** * Create a new instance. @@ -84,7 +86,6 @@ public class BundledBlockData { List entries = gson.fromJson(data, new TypeToken>() {}.getType()); for (BlockEntry entry : entries) { - entry.postDeserialization(); idMap.put(entry.id, entry); legacyMap.put(entry.legacyId, entry); } @@ -196,12 +197,6 @@ public class BundledBlockData { private List aliases; private Map states = new HashMap<>(); private SimpleBlockMaterial material = new SimpleBlockMaterial(); - - void postDeserialization() { - for (SimpleState state : states.values()) { - state.postDeserialization(); - } - } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 6e0606ef9..5979a164b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.registry.state.State; import javax.annotation.Nullable; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleState.java deleted file mode 100644 index cdf55f11b..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleState.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.world.registry; - -import com.sk89q.worldedit.blocks.BaseBlock; - -import javax.annotation.Nullable; -import java.util.Collections; -import java.util.Map; - -public class SimpleState implements State { - - private Byte dataMask; - private Map values; - - @Override - public Map valueMap() { - return Collections.unmodifiableMap(values); - } - - @Nullable - @Override - public StateValue getValue(BaseBlock block) { - for (StateValue value : values.values()) { - if (value.isSet(block)) { - return value; - } - } - - return null; - } - - public byte getDataMask() { - return dataMask != null ? dataMask : 0xF; - } - - @Override - public boolean hasDirection() { - for (SimpleStateValue value : values.values()) { - if (value.getDirection() != null) { - return true; - } - } - - return false; - } - - void postDeserialization() { - for (SimpleStateValue v : values.values()) { - v.setState(this); - } - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java new file mode 100644 index 000000000..d4a578a67 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java @@ -0,0 +1,26 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry.state; + +import com.sk89q.worldedit.world.registry.state.value.DirectionalStateValue; + +public class DirectionalState extends SimpleState { + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java new file mode 100644 index 000000000..a6c66bf1d --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java @@ -0,0 +1,37 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry.state; + +import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class SimpleState implements State { + + private List values = new ArrayList<>(); + + @Override + public List getValues() { + return Collections.unmodifiableList(values); + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/State.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java similarity index 55% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/State.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java index a8cbfde3c..49d77a1c0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/State.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java @@ -17,12 +17,11 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.world.registry; +package com.sk89q.worldedit.world.registry.state; -import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue; -import javax.annotation.Nullable; -import java.util.Map; +import java.util.List; /** * Describes a state property of a block. @@ -30,32 +29,13 @@ import java.util.Map; *

Example states include "variant" (indicating material or type) and * "facing" (indicating orientation).

*/ -public interface State { +public interface State { /** - * Return a map of available values for this state. + * Return a list of available values for this state. * - *

Keys are the value of state and map values describe that - * particular state value.

- * - * @return the map of state values + * @return the list of state values */ - Map valueMap(); - - /** - * Get the value that the block is set to. - * - * @param block the block - * @return the state, otherwise null if the block isn't set to any of the values - */ - @Nullable - StateValue getValue(BaseBlock block); - - /** - * Returns whether this state contains directional data. - * - * @return true if directional data is available - */ - boolean hasDirection(); + List getValues(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleStateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/DirectionalStateValue.java similarity index 55% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleStateValue.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/DirectionalStateValue.java index 791bc684a..f440dd2ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleStateValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/DirectionalStateValue.java @@ -17,39 +17,13 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.world.registry; +package com.sk89q.worldedit.world.registry.state.value; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -class SimpleStateValue implements StateValue { +public class DirectionalStateValue extends SimpleStateValue { - private SimpleState state; - private Byte data; - private Vector direction; - - void setState(SimpleState state) { - this.state = state; - } - - @Override - public boolean isSet(BaseBlock block) { - return data != null && (block.getData() & state.getDataMask()) == data; - } - - @Override - public boolean set(BaseBlock block) { - if (data != null) { - block.setData((block.getData() & ~state.getDataMask()) | data); - return true; - } else { - return false; - } - } - - @Override public Vector getDirection() { - return direction; + return new Vector(); // TODO } - } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java new file mode 100644 index 000000000..7f1731f48 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java @@ -0,0 +1,41 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry.state.value; + +public class SimpleStateValue implements StateValue { + + private String data; + + @Override + public boolean isSet() { + return data != null; + } + + @Override + public void set(String data) { + this.data = data; + } + + @Override + public String getData() { + return this.data; + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/StateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/StateValue.java similarity index 68% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/StateValue.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/StateValue.java index 4e565cb19..c6dcf902d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/StateValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/StateValue.java @@ -17,10 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.world.registry; - -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; +package com.sk89q.worldedit.world.registry.state.value; import javax.annotation.Nullable; @@ -32,25 +29,21 @@ public interface StateValue { /** * Return whether this state is set on the given block. * - * @param block the block * @return true if this value is set */ - boolean isSet(BaseBlock block); + boolean isSet(); /** - * Set the state to this value on the given block. - * - * @param block the block to change - * @return true if the value was set successfully + * Set the state to the given value. */ - boolean set(BaseBlock block); + void set(String data); /** - * Return the direction associated with this value. + * Returns the data associated with this value. * - * @return the direction, otherwise null + * @return The data, otherwise null */ @Nullable - Vector getDirection(); + String getData(); } From b292a397658319344648ac24f7cd1b0f8b7ee3e6 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 14 Jun 2018 17:14:54 +1000 Subject: [PATCH 10/74] Fixed the fuzzy matcher --- .../worldedit/bukkit/BukkitWorldTest.java | 7 ++-- .../com/sk89q/worldedit/blocks/BaseBlock.java | 42 +++++++++++++++---- .../worldedit/blocks/type/BlockTypes.java | 6 +++ .../state/value/SimpleStateValue.java | 11 +++++ .../transform/BlockTransformExtentTest.java | 36 ++++++++++------ 5 files changed, 78 insertions(+), 24 deletions(-) diff --git a/worldedit-bukkit/src/test/java/com/sk89q/worldedit/bukkit/BukkitWorldTest.java b/worldedit-bukkit/src/test/java/com/sk89q/worldedit/bukkit/BukkitWorldTest.java index cf627e393..6ad440d8f 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/worldedit/bukkit/BukkitWorldTest.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/worldedit/bukkit/BukkitWorldTest.java @@ -27,9 +27,10 @@ public class BukkitWorldTest { @Test public void testTreeTypeMapping() { - for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) { - Assert.assertFalse("No mapping for: " + type, BukkitWorld.toBukkitTreeType(type) == null); - } + // TODO + // for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) { +// Assert.assertFalse("No mapping for: " + type, BukkitWorld.toBukkitTreeType(type) == null); +// } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index dd1ead2c4..4e5cd07f8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -31,9 +31,11 @@ import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.state.State; import com.sk89q.worldedit.world.registry.state.value.StateValue; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -288,15 +290,17 @@ public class BaseBlock extends Block implements TileEntityBlock { } /** - * Returns whether the data value is -1, indicating that this block is to be - * used as a wildcard matching block. + * Returns whether there are no matched states. * - * @return true if the data value is -1 + * @return true if there are no matched states */ @Override - @Deprecated public boolean hasWildcardData() { - return getData() == -1; + return getStates().isEmpty(); + } + + public boolean hasWildcardDataFor(State state) { + return getState(state) == null; } @Override @@ -428,13 +432,35 @@ public class BaseBlock extends Block implements TileEntityBlock { } /** - * Checks if the type is the same, and if data is the same if only data != -1. + * Checks if the type is the same, and if the matched states are the same. * * @param o other block * @return true if equal */ public boolean equalsFuzzy(BaseBlock o) { - return (getType().equals(o.getType())) && (getData() == o.getData() || getData() == -1 || o.getData() == -1); + if (!getType().equals(o.getType())) { + return false; + } + + List differingStates = new ArrayList<>(); + for (State state : o.getStates().keySet()) { + if (getState(state) == null) { + differingStates.add(state); + } + } + for (State state : getStates().keySet()) { + if (o.getState(state) == null) { + differingStates.add(state); + } + } + + for (State state : differingStates) { + if (!getState(state).equals(o.getState(state))) { + return false; + } + } + + return true; } /** @@ -461,7 +487,7 @@ public class BaseBlock extends Block implements TileEntityBlock { @Override public int hashCode() { int ret = getType().hashCode() << 3; - if (getData() != (byte) -1) ret |= getData(); + ret += getStates().hashCode(); return ret; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java index bbe1e58bb..b3b237601 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java @@ -20,7 +20,9 @@ package com.sk89q.worldedit.blocks.type; import java.lang.reflect.Field; +import java.util.Collection; import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -593,4 +595,8 @@ public class BlockTypes { } return blockMapping.get(id); } + + public static Collection values() { + return blockMapping.values(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java index 7f1731f48..e0e87c7b6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.world.registry.state.value; +import java.util.Objects; + public class SimpleStateValue implements StateValue { private String data; @@ -38,4 +40,13 @@ public class SimpleStateValue implements StateValue { return this.data; } + @Override + public boolean equals(Object obj) { + return obj instanceof StateValue && Objects.equals(((StateValue) obj).getData(), getData()); + } + + @Override + public int hashCode() { + return this.data.hashCode(); + } } diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java index 1b3c56824..83000503c 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java @@ -21,7 +21,8 @@ package com.sk89q.worldedit.extent.transform; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockData; -import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.world.registry.BlockRegistry; @@ -42,37 +43,46 @@ public class BlockTransformExtentTest { private static final Transform ROTATE_90 = new AffineTransform().rotateY(-90); private static final Transform ROTATE_NEG_90 = new AffineTransform().rotateY(90); - private final Set ignored = new HashSet(); + private final Set ignored = new HashSet<>(); @Before public void setUp() throws Exception { - ignored.add(BlockType.BED); // Broken in existing rotation code? - ignored.add(BlockType.WOODEN_DOOR); // Complicated - ignored.add(BlockType.IRON_DOOR); // Complicated - ignored.add(BlockType.END_PORTAL); // Not supported in existing rotation code + ignored.add(BlockTypes.BLACK_BED); // Broken in existing rotation code? + ignored.add(BlockTypes.BLUE_BED); // Complicated + ignored.add(BlockTypes.BROWN_BED); // Complicated + ignored.add(BlockTypes.CYAN_BED); // Complicated + ignored.add(BlockTypes.GRAY_BED); // Complicated + ignored.add(BlockTypes.GREEN_BED); // Complicated + ignored.add(BlockTypes.LIGHT_BLUE_BED); // Complicated + ignored.add(BlockTypes.LIGHT_GRAY_BED); // Complicated + ignored.add(BlockTypes.LIME_BED); // Complicated + ignored.add(BlockTypes.OAK_DOOR); // Complicated + ignored.add(BlockTypes.IRON_DOOR); // Complicated + ignored.add(BlockTypes.END_PORTAL); // Not supported in existing rotation code } @Test public void testTransform() throws Exception { BlockRegistry blockRegistry = new BundledBlockRegistry(); - for (BlockType type : BlockType.values()) { + for (BlockType type : BlockTypes.values()) { if (ignored.contains(type)) { continue; } - BaseBlock orig = new BaseBlock(type.getID()); + BaseBlock orig = new BaseBlock(type); for (int i = 1; i < 4; i++) { BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_90, blockRegistry); - BaseBlock reference = new BaseBlock(orig.getType(), BlockData.rotate90(orig.getType().getLegacyId(), orig.getData())); - assertThat(type + "#" + type.getID() + " rotated " + (90 * i) + " degrees did not match BlockData.rotate90()'s expected result", rotated, equalTo(reference)); + BaseBlock reference = new BaseBlock(orig.getType().getLegacyId(), BlockData.rotate90(orig.getType().getLegacyId(), orig.getData())); + assertThat(type + "#" + type.getId() + " rotated " + (90 * i) + " degrees did not match BlockData.rotate90()'s expected result", rotated, + equalTo(reference)); orig = rotated; } - orig = new BaseBlock(type.getID()); + orig = new BaseBlock(type); for (int i = 0; i < 4; i++) { BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_NEG_90, blockRegistry); - BaseBlock reference = new BaseBlock(orig.getType(), BlockData.rotate90Reverse(orig.getType().getLegacyId(), orig.getData())); - assertThat(type + "#" + type.getID() + " rotated " + (-90 * i) + " degrees did not match BlockData.rotate90Reverse()'s expected result", rotated, equalTo(reference)); + BaseBlock reference = new BaseBlock(orig.getType().getLegacyId(), BlockData.rotate90Reverse(orig.getType().getLegacyId(), orig.getData())); + assertThat(type + "#" + type.getId() + " rotated " + (-90 * i) + " degrees did not match BlockData.rotate90Reverse()'s expected result", rotated, equalTo(reference)); orig = rotated; } } From c537a2e948bb0d0e9abcf44a6ce4d014b43428c9 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 15 Jun 2018 15:41:37 +1000 Subject: [PATCH 11/74] Remove a tonne of code from WorldEdit. This breaks backwards compatibility. More will be removed. Sorry :) --- .../sk89q/worldedit/bukkit/BukkitWorld.java | 8 - .../com/sk89q/worldedit/bags/BlockBag.java | 202 ------------------ .../worldedit/bags/BlockBagException.java | 29 --- .../worldedit/bags/OutOfBlocksException.java | 29 --- .../worldedit/bags/OutOfSpaceException.java | 46 ---- .../bags/UnplaceableBlockException.java | 29 --- .../sk89q/worldedit/blocks/ChestBlock.java | 111 ---------- .../worldedit/blocks/ContainerBlock.java | 141 ------------ .../worldedit/blocks/DispenserBlock.java | 107 ---------- .../sk89q/worldedit/blocks/FurnaceBlock.java | 165 -------------- .../sk89q/worldedit/data/DataException.java | 34 --- .../com/sk89q/worldedit/foundation/Block.java | 42 ---- .../sk89q/worldedit/masks/AbstractMask.java | 35 --- .../com/sk89q/worldedit/masks/BlockMask.java | 73 ------- .../sk89q/worldedit/masks/BlockTypeMask.java | 54 ----- .../sk89q/worldedit/masks/CombinedMask.java | 84 -------- .../worldedit/masks/DynamicRegionMask.java | 46 ---- .../worldedit/masks/ExistingBlockMask.java | 35 --- .../sk89q/worldedit/masks/FuzzyBlockMask.java | 64 ------ .../masks/InvertedBlockTypeMask.java | 49 ----- .../sk89q/worldedit/masks/InvertedMask.java | 52 ----- .../java/com/sk89q/worldedit/masks/Mask.java | 54 ----- .../com/sk89q/worldedit/masks/RandomMask.java | 41 ---- .../com/sk89q/worldedit/masks/RegionMask.java | 41 ---- .../sk89q/worldedit/masks/SolidBlockMask.java | 35 --- .../worldedit/masks/UnderOverlayMask.java | 76 ------- .../sk89q/worldedit/patterns/BlockChance.java | 58 ----- .../worldedit/patterns/ClipboardPattern.java | 57 ----- .../com/sk89q/worldedit/patterns/Pattern.java | 51 ----- .../worldedit/patterns/RandomFillPattern.java | 82 ------- .../patterns/SingleBlockPattern.java | 62 ------ .../regions/AbstractLegacyRegionSelector.java | 44 ---- .../ConvexPolyhedralRegionSelector.java | 29 --- .../regions/CuboidRegionSelector.java | 29 --- .../regions/CylinderRegionSelector.java | 29 --- .../regions/EllipsoidRegionSelector.java | 29 --- .../ExtendingCuboidRegionSelector.java | 29 --- .../regions/Polygonal2DRegionSelector.java | 37 ---- .../regions/SphereRegionSelector.java | 29 --- .../java/com/sk89q/worldedit/EditSession.java | 119 ++++------- .../com/sk89q/worldedit/LocalSession.java | 10 - .../java/com/sk89q/worldedit/WorldEdit.java | 30 --- .../java/com/sk89q/worldedit/WorldVector.java | 3 +- .../com/sk89q/worldedit/WorldVectorFace.java | 1 - .../com/sk89q/worldedit/blocks/BaseBlock.java | 10 +- .../worldedit/command/GenerationCommands.java | 9 +- .../worldedit/command/RegionCommands.java | 19 +- .../sk89q/worldedit/command/ToolCommands.java | 10 +- .../worldedit/command/UtilityCommands.java | 51 +++-- .../worldedit/command/tool/FloodFillTool.java | 4 +- .../command/tool/brush/CylinderBrush.java | 4 +- .../tool/brush/HollowCylinderBrush.java | 4 +- .../command/tool/brush/HollowSphereBrush.java | 4 +- .../command/tool/brush/SphereBrush.java | 4 +- .../worldedit/function/block/Naturalizer.java | 19 +- .../sk89q/worldedit/function/mask/Masks.java | 76 ------- .../worldedit/function/pattern/Patterns.java | 72 ------- .../sk89q/worldedit/regions/CuboidRegion.java | 8 - .../ConvexPolyhedralRegionSelector.java | 2 +- .../selector/CuboidRegionSelector.java | 2 +- .../selector/CylinderRegionSelector.java | 2 +- .../selector/EllipsoidRegionSelector.java | 2 +- .../selector/Polygonal2DRegionSelector.java | 3 +- .../regions/shape/ArbitraryShape.java | 6 +- .../schematic/MCEditSchematicFormat.java | 12 +- .../worldedit/schematic/SchematicFormat.java | 9 +- .../scripting/CraftScriptContext.java | 12 +- 67 files changed, 139 insertions(+), 2615 deletions(-) delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/BlockBag.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/BlockBagException.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/OutOfBlocksException.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/OutOfSpaceException.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/UnplaceableBlockException.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/ChestBlock.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/ContainerBlock.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/DispenserBlock.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/FurnaceBlock.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/data/DataException.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/foundation/Block.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/AbstractMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockTypeMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/CombinedMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/DynamicRegionMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/ExistingBlockMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/FuzzyBlockMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/InvertedBlockTypeMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/InvertedMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/Mask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/RandomMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/RegionMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/SolidBlockMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/UnderOverlayMask.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/BlockChance.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/ClipboardPattern.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/Pattern.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/RandomFillPattern.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/SingleBlockPattern.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/AbstractLegacyRegionSelector.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegionSelector.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/CuboidRegionSelector.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/CylinderRegionSelector.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/EllipsoidRegionSelector.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/ExtendingCuboidRegionSelector.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/SphereRegionSelector.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Patterns.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 64671efde..fba678660 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -450,12 +450,4 @@ public class BukkitWorld extends LocalWorld { return false; } } - - /** - * @deprecated Use {@link #setBlock(Vector, BaseBlock, boolean)} - */ - @Deprecated - public boolean setBlock(Vector pt, com.sk89q.worldedit.foundation.Block block, boolean notifyAdjacent) throws WorldEditException { - return setBlock(pt, (BaseBlock) block, notifyAdjacent); - } } diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/BlockBag.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/BlockBag.java deleted file mode 100644 index c8842ccb2..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/BlockBag.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bags; - -import com.sk89q.worldedit.WorldVector; -import com.sk89q.worldedit.blocks.*; - -/** - * @deprecated Block bags are currently not a supported feature of WorldEdit - */ -@SuppressWarnings("deprecation") -@Deprecated - -public abstract class BlockBag { - - /** - * Stores a block as if it was mined. - * - * @param id the ID of the block - * @throws BlockBagException thrown on a error - * @deprecated Use {@link BlockBag#storeDroppedBlock(int, int)} instead - */ - @Deprecated - public void storeDroppedBlock(int id) throws BlockBagException { - storeDroppedBlock(id, 0); - } - - /** - * Stores a block as if it was mined. - * - * @param id the ID of the block - * @param data the data value of the block - * @throws BlockBagException thrown on a error - */ - public void storeDroppedBlock(int id, int data) throws BlockBagException { - BaseItem dropped = BlockType.getBlockBagItem(id, data); - if (dropped == null) return; - if (dropped.getType() == BlockID.AIR) return; - - storeItem(dropped); - } - - /** - * Sets a block as if it was placed by hand. - * - * @param id the ID of the block - * @throws BlockBagException - * @deprecated Use {@link #fetchPlacedBlock(int,int)} instead - */ - @Deprecated - public void fetchPlacedBlock(int id) throws BlockBagException { - fetchPlacedBlock(id, 0); - } - - /** - * Sets a block as if it was placed by hand. - * - * @param id the ID of the block - * @param data the data value of the block - * @throws BlockBagException - */ - public void fetchPlacedBlock(int id, int data) throws BlockBagException { - try { - // Blocks that can't be fetched... - switch (id) { - case BlockID.BEDROCK: - case BlockID.GOLD_ORE: - case BlockID.IRON_ORE: - case BlockID.COAL_ORE: - case BlockID.DIAMOND_ORE: - case BlockID.TNT: - case BlockID.MOB_SPAWNER: - case BlockID.CROPS: - case BlockID.REDSTONE_ORE: - case BlockID.GLOWING_REDSTONE_ORE: - case BlockID.SNOW: - case BlockID.LIGHTSTONE: - case BlockID.PORTAL: - throw new UnplaceableBlockException(); - - case BlockID.WATER: - case BlockID.STATIONARY_WATER: - case BlockID.LAVA: - case BlockID.STATIONARY_LAVA: - // Override liquids - return; - - default: - fetchBlock(id); - break; - } - - } catch (OutOfBlocksException e) { - BaseItem placed = BlockType.getBlockBagItem(id, data); - if (placed == null) throw e; // TODO: check - if (placed.getType() == BlockID.AIR) throw e; // TODO: check - - fetchItem(placed); - } - } - - /** - * Get a block. - * - * Either this method or fetchItem needs to be overridden - * - * @param id the ID of the block - * @throws BlockBagException - */ - public void fetchBlock(int id) throws BlockBagException { - fetchItem(new BaseItem(id)); - } - - /** - * Get a block. - * - * Either this method or fetchBlock needs to be overridden - * - * @param item the item - * @throws BlockBagException - */ - public void fetchItem(BaseItem item) throws BlockBagException { - fetchBlock(item.getType()); - } - - /** - * Store a block. - * - * Either this method or storeItem needs to be overridden - * - * @param id the ID of the block - * @throws BlockBagException - */ - public void storeBlock(int id) throws BlockBagException { - storeItem(new BaseItem(id)); - } - - /** - * Store a block. - * - * Either this method or storeBlock needs to be overridden - * - * @param item the item - * @throws BlockBagException - */ - public void storeItem(BaseItem item) throws BlockBagException { - storeBlock(item.getType()); - } - - /** - * Checks to see if a block exists without removing it. - * - * @param id the ID of the block - * @return whether the block exists - */ - public boolean peekBlock(int id) { - try { - fetchBlock(id); - storeBlock(id); - return true; - } catch (BlockBagException e) { - return false; - } - } - - /** - * Flush any changes. This is called at the end. - */ - public abstract void flushChanges(); - - /** - * Adds a position to be used a source. - * - * @param position the position of the source - */ - public abstract void addSourcePosition(WorldVector position); - - /** - * Adds a position to be used a source. - * - * @param position the position of the source - */ - public abstract void addSingleSourcePosition(WorldVector position); - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/BlockBagException.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/BlockBagException.java deleted file mode 100644 index 8b3ace06f..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/BlockBagException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bags; - - -/** - * @deprecated Block bags are currently not a supported feature of WorldEdit - */ -@Deprecated -public class BlockBagException extends Exception { - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/OutOfBlocksException.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/OutOfBlocksException.java deleted file mode 100644 index 197d9c241..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/OutOfBlocksException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bags; - - -/** - * @deprecated Block bags are currently not a supported feature of WorldEdit - */ -@Deprecated -public class OutOfBlocksException extends BlockBagException { - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/OutOfSpaceException.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/OutOfSpaceException.java deleted file mode 100644 index c5379db5d..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/OutOfSpaceException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bags; - - -/** - * @deprecated Block bags are currently not a supported feature of WorldEdit - */ -@Deprecated -public class OutOfSpaceException extends BlockBagException { - - private int id; - - /** - * Construct the object. - * - * @param id the type ID - */ - public OutOfSpaceException(int id) { - this.id = id; - } - - /** - * @return the id - */ - public int getID() { - return id; - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/UnplaceableBlockException.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/UnplaceableBlockException.java deleted file mode 100644 index b1ab13802..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/bags/UnplaceableBlockException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bags; - - -/** - * @deprecated Block bags are currently not a supported feature of WorldEdit - */ -@Deprecated -public class UnplaceableBlockException extends BlockBagException { - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/ChestBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/ChestBlock.java deleted file mode 100644 index 9c62e7f6d..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/ChestBlock.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.ListTag; -import com.sk89q.jnbt.NBTUtils; -import com.sk89q.jnbt.StringTag; -import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.world.DataException; -import com.sk89q.worldedit.world.storage.InvalidFormatException; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Represents a chest block. - */ -public class ChestBlock extends ContainerBlock { - - /** - * Construct an empty chest block with the default orientation (data value). - */ - public ChestBlock() { - super(BlockID.CHEST, 27); - } - - /** - * Construct an empty chest block with a custom data value. - * - * @param data data indicating the position of the chest - */ - public ChestBlock(int data) { - super(BlockID.CHEST, data, 27); - } - - /** - * Construct the chest block with a custom data value and a list of items. - * - * @param data data indicating the position of the chest - * @param items array of items - */ - public ChestBlock(int data, BaseItemStack[] items) { - super(BlockID.CHEST, data, 27); - setItems(items); - } - - @Override - public String getNbtId() { - return "Chest"; - } - - @Override - public CompoundTag getNbtData() { - Map values = new HashMap(); - values.put("Items", new ListTag(CompoundTag.class, serializeInventory(getItems()))); - return new CompoundTag(values); - } - - @Override - public void setNbtData(CompoundTag rootTag) { - if (rootTag == null) { - return; - } - - Map values = rootTag.getValue(); - - Tag t = values.get("id"); - if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Chest")) { - throw new RuntimeException("'Chest' tile entity expected"); - } - - List items = new ArrayList(); - - try { - for (Tag tag : NBTUtils.getChildTag(values, "Items", ListTag.class).getValue()) { - if (!(tag instanceof CompoundTag)) { - throw new RuntimeException("CompoundTag expected as child tag of Chest's Items"); - } - - items.add((CompoundTag) tag); - } - - setItems(deserializeInventory(items)); - } catch (InvalidFormatException e) { - throw new RuntimeException(e); - } catch (DataException e) { - throw new RuntimeException(e); - } - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/ContainerBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/ContainerBlock.java deleted file mode 100644 index 05709cd0b..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/ContainerBlock.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import com.sk89q.jnbt.ByteTag; -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.ListTag; -import com.sk89q.jnbt.NBTUtils; -import com.sk89q.jnbt.ShortTag; -import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.world.DataException; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Represents a block that stores items. - */ -public abstract class ContainerBlock extends BaseBlock implements TileEntityBlock { - - private BaseItemStack[] items; - - public ContainerBlock(int type, int inventorySize) { - super(type); - this.items = new BaseItemStack[inventorySize]; - } - - public ContainerBlock(int type, int data, int inventorySize) { - super(type, data); - this.items = new BaseItemStack[inventorySize]; - } - - /** - * Get the list of items. - * - * @return an array of stored items - */ - public BaseItemStack[] getItems() { - return this.items; - } - - /** - * Set the list of items. - * - * @param items an array of stored items - */ - public void setItems(BaseItemStack[] items) { - this.items = items; - } - - @Override - public boolean hasNbtData() { - return true; - } - - public Map serializeItem(BaseItemStack item) { - Map data = new HashMap(); - data.put("id", new ShortTag((short) item.getType())); - data.put("Damage", new ShortTag(item.getData())); - data.put("Count", new ByteTag((byte) item.getAmount())); - if (!item.getEnchantments().isEmpty()) { - List enchantmentList = new ArrayList(); - for(Map.Entry entry : item.getEnchantments().entrySet()) { - Map enchantment = new HashMap(); - enchantment.put("id", new ShortTag(entry.getKey().shortValue())); - enchantment.put("lvl", new ShortTag(entry.getValue().shortValue())); - enchantmentList.add(new CompoundTag(enchantment)); - } - - Map auxData = new HashMap(); - auxData.put("ench", new ListTag(CompoundTag.class, enchantmentList)); - data.put("tag", new CompoundTag(auxData)); - } - return data; - } - - public BaseItemStack deserializeItem(Map data) throws DataException { - short id = NBTUtils.getChildTag(data, "id", ShortTag.class).getValue(); - short damage = NBTUtils.getChildTag(data, "Damage", ShortTag.class).getValue(); - byte count = NBTUtils.getChildTag(data, "Count", ByteTag.class).getValue(); - - BaseItemStack stack = new BaseItemStack(id, count, damage); - - if (data.containsKey("tag")) { - Map auxData = NBTUtils.getChildTag(data, "tag", CompoundTag.class).getValue(); - ListTag ench = (ListTag)auxData.get("ench"); - for(Tag e : ench.getValue()) { - Map vars = ((CompoundTag) e).getValue(); - short enchId = NBTUtils.getChildTag(vars, "id", ShortTag.class).getValue(); - short enchLevel = NBTUtils.getChildTag(vars, "lvl", ShortTag.class).getValue(); - stack.getEnchantments().put((int) enchId, (int) enchLevel); - } - } - return stack; - } - - public BaseItemStack[] deserializeInventory(List items) throws DataException { - BaseItemStack[] stacks = new BaseItemStack[items.size()]; - for (CompoundTag tag : items) { - Map item = tag.getValue(); - BaseItemStack stack = deserializeItem(item); - byte slot = NBTUtils.getChildTag(item, "Slot", ByteTag.class).getValue(); - if (slot >= 0 && slot < stacks.length) { - stacks[slot] = stack; - } - } - return stacks; - } - - public List serializeInventory(BaseItemStack[] items) { - List tags = new ArrayList(); - for (int i = 0; i < items.length; ++i) { - if (items[i] != null) { - Map tagData = serializeItem(items[i]); - tagData.put("Slot", new ByteTag((byte) i)); - tags.add(new CompoundTag(tagData)); - } - } - return tags; - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/DispenserBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/DispenserBlock.java deleted file mode 100644 index 4140ee88a..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/DispenserBlock.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.ListTag; -import com.sk89q.jnbt.NBTUtils; -import com.sk89q.jnbt.StringTag; -import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.world.DataException; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Represents dispensers. - */ -public class DispenserBlock extends ContainerBlock { - - /** - * Construct an empty dispenser block. - */ - public DispenserBlock() { - super(BlockID.DISPENSER, 9); - } - - /** - * Construct an empty dispenser block. - * - * @param data data value (orientation) - */ - public DispenserBlock(int data) { - super(BlockID.DISPENSER, data, 9); - } - - /** - * Construct a dispenser block with the given orientation and inventory. - * - * @param data data value (orientation) - * @param items array of items in the inventory - */ - public DispenserBlock(int data, BaseItemStack[] items) { - super(BlockID.DISPENSER, data, 9); - this.setItems(items); - } - - @Override - public String getNbtId() { - return "Trap"; - } - - @Override - public CompoundTag getNbtData() { - Map values = new HashMap(); - values.put("Items", new ListTag(CompoundTag.class, serializeInventory(getItems()))); - return new CompoundTag(values); - } - - @Override - public void setNbtData(CompoundTag rootTag) { - try { - if (rootTag == null) { - return; - } - - Map values = rootTag.getValue(); - - Tag t = values.get("id"); - if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Trap")) { - throw new DataException("'Trap' tile entity expected"); - } - - List items = new ArrayList(); - for (Tag tag : NBTUtils.getChildTag(values, "Items", ListTag.class).getValue()) { - if (!(tag instanceof CompoundTag)) { - throw new DataException("CompoundTag expected as child tag of Trap Items"); - } - - items.add((CompoundTag) tag); - } - - setItems(deserializeInventory(items)); - } catch (DataException e) { - throw new RuntimeException(e); - } - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/FurnaceBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/FurnaceBlock.java deleted file mode 100644 index f2001d754..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/FurnaceBlock.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.ListTag; -import com.sk89q.jnbt.NBTUtils; -import com.sk89q.jnbt.ShortTag; -import com.sk89q.jnbt.StringTag; -import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.world.DataException; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Represents a furnace block. - */ -public class FurnaceBlock extends ContainerBlock { - - private short burnTime; - private short cookTime; - - /** - * Construct an empty furnace block with the default orientation. - * - * @param type type ID - */ - public FurnaceBlock(int type) { - super(type, 2); - } - - /** - * Construct an empty furnace block with a given orientation. - * - * @param type type ID - * @param data orientation - */ - public FurnaceBlock(int type, int data) { - super(type, data, 2); - } - - /** - * Construct an furnace block with a given orientation and inventory. - * - * @param type type ID - * @param data orientation - * @param items inventory items - */ - public FurnaceBlock(int type, int data, BaseItemStack[] items) { - super(type, data, 2); - setItems(items); - } - - /** - * Get the burn time. - * - * @return the burn time - */ - public short getBurnTime() { - return burnTime; - } - - /** - * Set the burn time. - * - * @param burnTime the burn time - */ - public void setBurnTime(short burnTime) { - this.burnTime = burnTime; - } - - /** - * Get the cook time. - * - * @return the cook time - */ - public short getCookTime() { - return cookTime; - } - - /** - * Set the cook time. - * - * @param cookTime the cook time to set - */ - public void setCookTime(short cookTime) { - this.cookTime = cookTime; - } - - @Override - public String getNbtId() { - return "Furnace"; - } - - @Override - public CompoundTag getNbtData() { - Map values = new HashMap(); - values.put("Items", new ListTag(CompoundTag.class, serializeInventory(getItems()))); - values.put("BurnTime", new ShortTag(burnTime)); - values.put("CookTime", new ShortTag(cookTime)); - return new CompoundTag(values); - } - - @Override - public void setNbtData(CompoundTag rootTag) { - if (rootTag == null) { - return; - } - - try { - Map values = rootTag.getValue(); - - Tag t = values.get("id"); - if (!(t instanceof StringTag) - || !((StringTag) t).getValue().equals("Furnace")) { - throw new RuntimeException("'Furnace' tile entity expected"); - } - - ListTag items = NBTUtils.getChildTag(values, "Items", ListTag.class); - - List compound = new ArrayList(); - - for (Tag tag : items.getValue()) { - if (!(tag instanceof CompoundTag)) { - throw new RuntimeException("CompoundTag expected as child tag of Furnace Items"); - } - compound.add((CompoundTag) tag); - } - setItems(deserializeInventory(compound)); - - t = values.get("BurnTime"); - if (t instanceof ShortTag) { - burnTime = ((ShortTag) t).getValue(); - } - - t = values.get("CookTime"); - if (t instanceof ShortTag) { - cookTime = ((ShortTag) t).getValue(); - } - } catch (DataException e) { - throw new RuntimeException(e); - } - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/data/DataException.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/data/DataException.java deleted file mode 100644 index 442ffc35f..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/data/DataException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.data; - -/** - * @deprecated Switch to {@link com.sk89q.worldedit.world.DataException} - */ -@Deprecated -public class DataException extends com.sk89q.worldedit.world.DataException { - - public DataException(String msg) { - super(msg); - } - - public DataException() { - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/foundation/Block.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/foundation/Block.java deleted file mode 100644 index c39c51e57..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/foundation/Block.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.foundation; - -import com.sk89q.worldedit.blocks.BaseBlock; - -/** - * @deprecated Use {@link BaseBlock} - */ -@Deprecated -public abstract class Block { - - public abstract int getId(); - - public abstract void setId(int id); - - public abstract int getData(); - - public abstract void setData(int data); - - public abstract void setIdAndData(int id, int data); - - public abstract boolean hasWildcardData(); - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/AbstractMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/AbstractMask.java deleted file mode 100644 index 704ce4035..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/AbstractMask.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.LocalPlayer; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.Vector; - -/** - * @deprecated Switch to {@link com.sk89q.worldedit.function.mask.AbstractMask} - */ -@Deprecated -public abstract class AbstractMask implements Mask { - @Override - public void prepare(LocalSession session, LocalPlayer player, Vector target) { - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockMask.java deleted file mode 100644 index f50b76de2..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockMask.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -/** - * @deprecated Use {@link com.sk89q.worldedit.function.mask.BlockMask} - */ -@Deprecated -public class BlockMask extends AbstractMask { - - private final Set blocks; - - public BlockMask() { - blocks = new HashSet(); - } - - public BlockMask(Set types) { - this.blocks = types; - } - - public BlockMask(BaseBlock... block) { - blocks = new HashSet(); - for (BaseBlock b : block) { - add(b); - } - } - - public BlockMask(BaseBlock block) { - this(); - add(block); - } - - public void add(BaseBlock block) { - blocks.add(block); - } - - public void addAll(Collection blocks) { - blocks.addAll(blocks); - } - - @Override - public boolean matches(EditSession editSession, Vector position) { - BaseBlock block = editSession.getBlock(position); - return blocks.contains(block) - || blocks.contains(new BaseBlock(block.getType())); - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockTypeMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockTypeMask.java deleted file mode 100644 index 5d195c4fc..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/BlockTypeMask.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.blocks.BaseBlock; - -import java.util.Set; - -/** - * A filter that matches blocks based on block types. - * - * @deprecated replaced by {@link #BlockMask} - */ -@Deprecated -public class BlockTypeMask extends BlockMask { - - public BlockTypeMask() { - super(); - } - - public BlockTypeMask(Set types) { - super(); - for (int type : types) { - add(type); - } - } - - public BlockTypeMask(int type) { - this(); - add(type); - } - - public void add(int type) { - add(new BaseBlock(type)); - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/CombinedMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/CombinedMask.java deleted file mode 100644 index 3f7a6690e..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/CombinedMask.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalPlayer; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.function.mask.MaskIntersection; - -import java.util.ArrayList; -import java.util.List; - -/** - * @deprecated See {@link MaskIntersection} - */ -@Deprecated -public class CombinedMask extends AbstractMask { - private final List masks = new ArrayList(); - - public CombinedMask() { - } - - public CombinedMask(Mask mask) { - add(mask); - } - - public CombinedMask(Mask ...mask) { - for (Mask m : mask) { - add(m); - } - } - - public CombinedMask(List masks) { - this.masks.addAll(masks); - } - - public void add(Mask mask) { - masks.add(mask); - } - - public boolean remove(Mask mask) { - return masks.remove(mask); - } - - public boolean has(Mask mask) { - return masks.contains(mask); - } - - @Override - public void prepare(LocalSession session, LocalPlayer player, Vector target) { - for (Mask mask : masks) { - mask.prepare(session, player, target); - } - } - - @Override - public boolean matches(EditSession editSession, Vector position) { - for (Mask mask : masks) { - if (!mask.matches(editSession, position)) { - return false; - } - } - - return true; - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/DynamicRegionMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/DynamicRegionMask.java deleted file mode 100644 index ebe866f57..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/DynamicRegionMask.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.session.request.RequestSelection; - -/** - * @deprecated Use {@link RequestSelection} with {@link com.sk89q.worldedit.function.mask.RegionMask} - */ -@Deprecated -public class DynamicRegionMask extends AbstractMask { - private Region region; - - @Override - public void prepare(LocalSession session, LocalPlayer player, Vector target) { - try { - region = session.getSelection(player.getWorld()); - } catch (IncompleteRegionException exc) { - region = null; - } - } - - @Override - public boolean matches(EditSession editSession, Vector position) { - return region == null || region.contains(position); - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/ExistingBlockMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/ExistingBlockMask.java deleted file mode 100644 index 487786d06..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/ExistingBlockMask.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BlockID; - -/** - * @deprecated See {@link com.sk89q.worldedit.function.mask.ExistingBlockMask} - */ -@Deprecated -public class ExistingBlockMask extends AbstractMask { - @Override - public boolean matches(EditSession editSession, Vector position) { - return editSession.getBlockType(position) != BlockID.AIR; - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/FuzzyBlockMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/FuzzyBlockMask.java deleted file mode 100644 index 63093624c..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/FuzzyBlockMask.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.Blocks; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -/** - * @deprecated See {@link com.sk89q.worldedit.function.mask.FuzzyBlockMask} - */ -@Deprecated -public class FuzzyBlockMask extends AbstractMask { - - private final Set filter; - - /** - * Create a new fuzzy block mask. - * - * @param filter a list of block types to match - */ - public FuzzyBlockMask(Set filter) { - this.filter = filter; - } - - /** - * Create a new fuzzy block mask. - * - * @param block a list of block types to match - */ - public FuzzyBlockMask(BaseBlock... block) { - Set filter = new HashSet(); - Collections.addAll(filter, block); - this.filter = filter; - } - - @Override - public boolean matches(EditSession editSession, Vector position) { - BaseBlock compare = new BaseBlock(editSession.getBlockType(position), editSession.getBlockData(position)); - return Blocks.containsFuzzy(filter, compare); - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/InvertedBlockTypeMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/InvertedBlockTypeMask.java deleted file mode 100644 index 61ae5a9a5..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/InvertedBlockTypeMask.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.Vector; - -import java.util.Set; - -/** - * A block type mask that only matches blocks that are not in the list. - */ -@Deprecated -public class InvertedBlockTypeMask extends BlockTypeMask { - - public InvertedBlockTypeMask() { - } - - public InvertedBlockTypeMask(Set types) { - super(types); - } - - public InvertedBlockTypeMask(int type) { - super(type); - } - - @Override - public boolean matches(EditSession editSession, Vector position) { - return !super.matches(editSession, position); - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/InvertedMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/InvertedMask.java deleted file mode 100644 index d86ac89b3..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/InvertedMask.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalPlayer; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.function.mask.Masks; - -/** - * @deprecated See {@link Masks#negate(com.sk89q.worldedit.function.mask.Mask)} - */ -@Deprecated -public class InvertedMask extends AbstractMask { - private final Mask mask; - - public InvertedMask(Mask mask) { - this.mask = mask; - } - - @Override - public void prepare(LocalSession session, LocalPlayer player, Vector target) { - mask.prepare(session, player, target); - } - - @Override - public boolean matches(EditSession editSession, Vector position) { - return !mask.matches(editSession, position); - } - - public Mask getInvertedMask() { - return mask; - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/Mask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/Mask.java deleted file mode 100644 index cf0a04c89..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/Mask.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalPlayer; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.Vector; - -/** - * @deprecated Use {@link com.sk89q.worldedit.function.mask.Mask} - */ -@Deprecated -public interface Mask { - - /** - * Called one time before each edit session. - * - * @param session a session - * @param player a player - * @param target target of the brush, null if not a brush mask - */ - void prepare(LocalSession session, LocalPlayer player, Vector target); - - /** - * Given a block position, this method returns true if the block at - * that position matches the filter. Block information is not provided - * as getting a BaseBlock has unneeded overhead in most block querying - * situations (enumerating a chest's contents is a waste, for example). - * - * @param editSession an instance - * @param position the position to check - * @return true if it matches - */ - boolean matches(EditSession editSession, Vector position); - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/RandomMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/RandomMask.java deleted file mode 100644 index a9e657ca6..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/RandomMask.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.function.mask.NoiseFilter; - -/** - * @deprecated See {@link NoiseFilter} - */ -@Deprecated -public class RandomMask extends AbstractMask { - private final double ratio; - - public RandomMask(double ratio) { - this.ratio = ratio; - } - - @Override - public boolean matches(EditSession editSession, Vector position) { - return Math.random() < ratio; - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/RegionMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/RegionMask.java deleted file mode 100644 index 220aaf4b9..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/RegionMask.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.regions.Region; - -/** - * @deprecated See {@link com.sk89q.worldedit.function.mask.RegionMask} - */ -@Deprecated -public class RegionMask extends AbstractMask { - private final Region region; - - public RegionMask(Region region) { - this.region = region.clone(); - } - - @Override - public boolean matches(EditSession editSession, Vector position) { - return region.contains(position); - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/SolidBlockMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/SolidBlockMask.java deleted file mode 100644 index dd5403441..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/SolidBlockMask.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BlockType; - -/** - * @deprecated See {@link com.sk89q.worldedit.function.mask.SolidBlockMask} - */ -@Deprecated -public class SolidBlockMask extends AbstractMask { - @Override - public boolean matches(EditSession editSession, Vector position) { - return !BlockType.canPassThrough(editSession.getBlockType(position), editSession.getBlockData(position)); - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/UnderOverlayMask.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/UnderOverlayMask.java deleted file mode 100644 index 39fe3dc8e..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/masks/UnderOverlayMask.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.masks; - -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalPlayer; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.function.mask.MaskIntersection; -import com.sk89q.worldedit.function.mask.Masks; -import com.sk89q.worldedit.function.mask.OffsetMask; - -import java.util.Set; - -/** - * @deprecated Use {@link OffsetMask} with {@link MaskIntersection} and {@link Masks#negate(com.sk89q.worldedit.function.mask.Mask)} - */ -@Deprecated -public class UnderOverlayMask extends AbstractMask { - private final int yMod; - private Mask mask; - - @Deprecated - public UnderOverlayMask(Set ids, boolean overlay) { - this(new BlockTypeMask(ids), overlay); - } - - public UnderOverlayMask(Mask mask, boolean overlay) { - this.yMod = overlay ? -1 : 1; - this.mask = mask; - } - - @Deprecated - public void addAll(Set ids) { - if (mask instanceof BlockMask) { - final BlockMask blockTypeMask = (BlockMask) mask; - for (Integer id : ids) { - blockTypeMask.add(new BaseBlock(id)); - } - } else if (mask instanceof ExistingBlockMask) { - final BlockMask blockMask = new BlockMask(); - for (int type : ids) { - blockMask.add(new BaseBlock(type)); - } - mask = blockMask; - } - } - - @Override - public void prepare(LocalSession session, LocalPlayer player, Vector target) { - mask.prepare(session, player, target); - } - - @Override - public boolean matches(EditSession editSession, Vector position) { - return !mask.matches(editSession, position) && mask.matches(editSession, position.add(0, yMod, 0)); - } -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/BlockChance.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/BlockChance.java deleted file mode 100644 index 35c45a132..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/BlockChance.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.patterns; - -import com.sk89q.worldedit.blocks.BaseBlock; - -/** - * @deprecated Will be removed in the future -- there is no replacement - */ -@Deprecated -public class BlockChance { - - private BaseBlock block; - private double chance; - - /** - * Construct the object. - * - * @param block the block - * @param chance the probability of the block - */ - public BlockChance(BaseBlock block, double chance) { - this.block = block; - this.chance = chance; - } - - /** - * @return the block - */ - public BaseBlock getBlock() { - return block; - } - - /** - * @return the chance - */ - public double getChance() { - return chance; - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/ClipboardPattern.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/ClipboardPattern.java deleted file mode 100644 index 8808a0684..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/ClipboardPattern.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.patterns; - -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BaseBlock; - -/** - * Pattern that repeats the clipboard. - */ -public class ClipboardPattern implements Pattern { - - private CuboidClipboard clipboard; - private Vector size; - - /** - * Construct the object. - * - * @param clipboard the clipboard - */ - public ClipboardPattern(CuboidClipboard clipboard) { - this.clipboard = clipboard; - this.size = clipboard.getSize(); - } - - @Override - public BaseBlock next(Vector position) { - return next(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - } - - @Override - public BaseBlock next(int x, int y, int z) { - int xp = Math.abs(x) % size.getBlockX(); - int yp = Math.abs(y) % size.getBlockY(); - int zp = Math.abs(z) % size.getBlockZ(); - - return clipboard.getPoint(new Vector(xp, yp, zp)); - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/Pattern.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/Pattern.java deleted file mode 100644 index b27e8e0fc..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/Pattern.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.patterns; - -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BaseBlock; - -/** - * @deprecated See {@link com.sk89q.worldedit.function.pattern.Pattern} - */ -@Deprecated -public interface Pattern { - - /** - * Get a block for a position. This return value of this method does - * not have to be consistent for the same position. - * - * @param position the position where a block is needed - * @return a block - */ - public BaseBlock next(Vector position); - - /** - * Get a block for a position. This return value of this method does - * not have to be consistent for the same position. - * - * @param x the X coordinate - * @param y the Y coordinate - * @param z the Z coordinate - * @return a block - */ - public BaseBlock next(int x, int y, int z); - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/RandomFillPattern.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/RandomFillPattern.java deleted file mode 100644 index 6014eec36..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/RandomFillPattern.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.patterns; - -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.function.pattern.RandomPattern; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -/** - * @deprecated See {@link RandomPattern} - */ -@Deprecated -public class RandomFillPattern implements Pattern { - - private static final Random random = new Random(); - private List blocks; - - /** - * Construct the object. - * - * @param blocks a list of blocks - */ - public RandomFillPattern(List blocks) { - double max = 0; - - for (BlockChance block : blocks) { - max += block.getChance(); - } - - List finalBlocks = new ArrayList(); - - double i = 0; - - for (BlockChance block : blocks) { - double v = block.getChance() / max; - i += v; - finalBlocks.add(new BlockChance(block.getBlock(), i)); - } - - this.blocks = finalBlocks; - } - - @Override - public BaseBlock next(Vector position) { - double r = random.nextDouble(); - - for (BlockChance block : blocks) { - if (r <= block.getChance()) { - return block.getBlock(); - } - } - - throw new RuntimeException("ProportionalFillPattern"); - } - - @Override - public BaseBlock next(int x, int y, int z) { - return next(null); - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/SingleBlockPattern.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/SingleBlockPattern.java deleted file mode 100644 index 325b85112..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/patterns/SingleBlockPattern.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.patterns; - -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.function.pattern.BlockPattern; - -/** - * @deprecated See {@link BlockPattern} - */ -@Deprecated -public class SingleBlockPattern implements Pattern { - - private BaseBlock block; - - /** - * Construct the object. - * - * @param block the block - */ - public SingleBlockPattern(BaseBlock block) { - this.block = block; - } - - /** - * Get the block. - * - * @return the block - */ - public BaseBlock getBlock() { - return block; - } - - @Override - public BaseBlock next(Vector position) { - return block; - } - - @Override - public BaseBlock next(int x, int y, int z) { - return block; - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/AbstractLegacyRegionSelector.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/AbstractLegacyRegionSelector.java deleted file mode 100644 index 1930e3b9f..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/AbstractLegacyRegionSelector.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.regions; - -import com.sk89q.worldedit.LocalPlayer; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.extension.platform.Actor; - -abstract class AbstractLegacyRegionSelector implements RegionSelector { - - @Deprecated - public final void explainPrimarySelection(LocalPlayer player, LocalSession session, Vector position) { - explainPrimarySelection((Actor) player, session, position); - } - - @Deprecated - public final void explainSecondarySelection(LocalPlayer player, LocalSession session, Vector position) { - explainSecondarySelection((Actor) player, session, position); - } - - @Deprecated - public final void explainRegionAdjust(LocalPlayer player, LocalSession session) { - explainRegionAdjust((Actor) player, session); - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegionSelector.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegionSelector.java deleted file mode 100644 index f264546dd..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegionSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.regions; - -import com.sk89q.worldedit.internal.cui.CUIRegion; - -/** - * @deprecated This class only exists as to not break binary compatibility - */ -@Deprecated -public abstract class ConvexPolyhedralRegionSelector extends AbstractLegacyRegionSelector implements CUIRegion { -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/CuboidRegionSelector.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/CuboidRegionSelector.java deleted file mode 100644 index 458d75cb3..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/CuboidRegionSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.regions; - -import com.sk89q.worldedit.internal.cui.CUIRegion; - -/** - * @deprecated This class only exists as to not break binary compatibility - */ -@Deprecated -public abstract class CuboidRegionSelector extends AbstractLegacyRegionSelector implements CUIRegion { -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/CylinderRegionSelector.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/CylinderRegionSelector.java deleted file mode 100644 index b54709e7d..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/CylinderRegionSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.regions; - -import com.sk89q.worldedit.internal.cui.CUIRegion; - -/** - * @deprecated This class only exists as to not break binary compatibility - */ -@Deprecated -public abstract class CylinderRegionSelector extends AbstractLegacyRegionSelector implements CUIRegion { -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/EllipsoidRegionSelector.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/EllipsoidRegionSelector.java deleted file mode 100644 index 69bf5ba2b..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/EllipsoidRegionSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.regions; - -import com.sk89q.worldedit.internal.cui.CUIRegion; - -/** - * @deprecated This class only exists as to not break binary compatibility - */ -@Deprecated -public abstract class EllipsoidRegionSelector extends AbstractLegacyRegionSelector implements CUIRegion { -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/ExtendingCuboidRegionSelector.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/ExtendingCuboidRegionSelector.java deleted file mode 100644 index d9888a447..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/ExtendingCuboidRegionSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.regions; - -import com.sk89q.worldedit.internal.cui.CUIRegion; - -/** - * @deprecated This class only exists as to not break binary compatibility - */ -@Deprecated -public abstract class ExtendingCuboidRegionSelector extends AbstractLegacyRegionSelector implements CUIRegion { -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java deleted file mode 100644 index f3b8a9cbd..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.regions; - -import com.sk89q.worldedit.internal.cui.CUIRegion; - -/** - * @deprecated This class only exists as to not break binary compatibility - */ -@Deprecated -public abstract class Polygonal2DRegionSelector extends AbstractLegacyRegionSelector implements CUIRegion { - - /** - * Get the number of points. - * - * @return the number of points - */ - public abstract int getPointCount(); - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/SphereRegionSelector.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/SphereRegionSelector.java deleted file mode 100644 index 8a3057dc0..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/regions/SphereRegionSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.regions; - -import com.sk89q.worldedit.internal.cui.CUIRegion; - -/** - * @deprecated This class only exists as to not break binary compatibility - */ -@Deprecated -public abstract class SphereRegionSelector extends AbstractLegacyRegionSelector implements CUIRegion { -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 3a3376e81..8d91548fc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.event.extent.EditSessionEvent; @@ -49,7 +50,7 @@ import com.sk89q.worldedit.function.generator.GardenPatchGenerator; import com.sk89q.worldedit.function.mask.*; import com.sk89q.worldedit.function.operation.*; import com.sk89q.worldedit.function.pattern.BlockPattern; -import com.sk89q.worldedit.function.pattern.Patterns; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.util.RegionOffset; import com.sk89q.worldedit.function.visitor.*; import com.sk89q.worldedit.history.UndoContext; @@ -65,8 +66,6 @@ import com.sk89q.worldedit.math.interpolation.KochanekBartelsInterpolation; import com.sk89q.worldedit.math.interpolation.Node; import com.sk89q.worldedit.math.noise.RandomNoise; import com.sk89q.worldedit.math.transform.AffineTransform; -import com.sk89q.worldedit.patterns.Pattern; -import com.sk89q.worldedit.patterns.SingleBlockPattern; import com.sk89q.worldedit.regions.*; import com.sk89q.worldedit.regions.shape.ArbitraryBiomeShape; import com.sk89q.worldedit.regions.shape.ArbitraryShape; @@ -96,7 +95,7 @@ import static com.sk89q.worldedit.regions.Regions.*; * {@link Extent}s that are chained together. For example, history is logged * using the {@link ChangeSetExtent}.

*/ -@SuppressWarnings({"FieldCanBeLocal", "deprecation"}) +@SuppressWarnings({"FieldCanBeLocal"}) public class EditSession implements Extent { private static final Logger log = Logger.getLogger(EditSession.class.getCanonicalName()); @@ -131,7 +130,6 @@ public class EditSession implements Extent { private final Extent bypassHistory; private final Extent bypassNone; - @SuppressWarnings("deprecation") private Mask oldMask; /** @@ -141,7 +139,6 @@ public class EditSession implements Extent { * @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit * @deprecated use {@link WorldEdit#getEditSessionFactory()} to create {@link EditSession}s */ - @SuppressWarnings("deprecation") @Deprecated public EditSession(LocalWorld world, int maxBlocks) { this(world, maxBlocks, null); @@ -308,21 +305,6 @@ public class EditSession implements Extent { } } - /** - * Set the mask. - * - * @param mask the mask - * @deprecated Use {@link #setMask(Mask)} - */ - @Deprecated - public void setMask(com.sk89q.worldedit.masks.Mask mask) { - if (mask == null) { - setMask((Mask) null); - } else { - setMask(Masks.wrap(mask)); - } - } - /** * Get the {@link SurvivalModeExtent}. * @@ -560,9 +542,8 @@ public class EditSession implements Extent { * @return Whether the block changed -- not entirely dependable * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public boolean setBlock(Vector position, Pattern pattern) throws MaxChangedBlocksException { - return setBlock(position, pattern.next(position)); + return setBlock(position, pattern.apply(position)); } /** @@ -574,7 +555,6 @@ public class EditSession implements Extent { * @return the number of changed blocks * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") private int setBlocks(Set vset, Pattern pattern) throws MaxChangedBlocksException { int affected = 0; for (Vector v : vset) { @@ -593,7 +573,6 @@ public class EditSession implements Extent { * @return whether a block was changed * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public boolean setChanceBlockIfAir(Vector position, BaseBlock block, double probability) throws MaxChangedBlocksException { return Math.random() <= probability && setBlockIfAir(position, block); @@ -705,7 +684,7 @@ public class EditSession implements Extent { * @return the number of found blocks */ public int countBlock(Region region, Set searchIDs) { - Set passOn = new HashSet(); + Set passOn = new HashSet<>(); for (Integer i : searchIDs) { passOn.add(new BaseBlock(i, -1)); } @@ -739,10 +718,8 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") - public int fillXZ(Vector origin, BaseBlock block, double radius, int depth, boolean recursive) - throws MaxChangedBlocksException { - return fillXZ(origin, new SingleBlockPattern(block), radius, depth, recursive); + public int fillXZ(Vector origin, BaseBlock block, double radius, int depth, boolean recursive) throws MaxChangedBlocksException { + return fillXZ(origin, new BlockPattern(block), radius, depth, recursive); } /** @@ -756,7 +733,6 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int fillXZ(Vector origin, Pattern pattern, double radius, int depth, boolean recursive) throws MaxChangedBlocksException { checkNotNull(origin); checkNotNull(pattern); @@ -771,7 +747,7 @@ public class EditSession implements Extent { Masks.negate(new ExistingBlockMask(this))); // Want to replace blocks - BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern)); + BlockReplace replace = new BlockReplace(this, pattern); // Pick how we're going to visit blocks RecursiveVisitor visitor; @@ -799,7 +775,6 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int removeAbove(Vector position, int apothem, int height) throws MaxChangedBlocksException { checkNotNull(position); checkArgument(apothem >= 1, "apothem >= 1"); @@ -809,7 +784,7 @@ public class EditSession implements Extent { getWorld(), // Causes clamping of Y range position.add(-apothem + 1, 0, -apothem + 1), position.add(apothem - 1, height - 1, apothem - 1)); - Pattern pattern = new SingleBlockPattern(new BaseBlock(BlockID.AIR)); + Pattern pattern = new BlockPattern(new BaseBlock(BlockTypes.AIR)); return setBlocks(region, pattern); } @@ -822,7 +797,6 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int removeBelow(Vector position, int apothem, int height) throws MaxChangedBlocksException { checkNotNull(position); checkArgument(apothem >= 1, "apothem >= 1"); @@ -832,7 +806,7 @@ public class EditSession implements Extent { getWorld(), // Causes clamping of Y range position.add(-apothem + 1, 0, -apothem + 1), position.add(apothem - 1, -height + 1, apothem - 1)); - Pattern pattern = new SingleBlockPattern(new BaseBlock(BlockID.AIR)); + Pattern pattern = new BlockPattern(new BaseBlock(BlockTypes.AIR)); return setBlocks(region, pattern); } @@ -845,7 +819,6 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int removeNear(Vector position, int blockType, int apothem) throws MaxChangedBlocksException { checkNotNull(position); checkArgument(apothem >= 1, "apothem >= 1"); @@ -856,7 +829,7 @@ public class EditSession implements Extent { getWorld(), // Causes clamping of Y range position.add(adjustment.multiply(-1)), position.add(adjustment)); - Pattern pattern = new SingleBlockPattern(new BaseBlock(BlockID.AIR)); + Pattern pattern = new BlockPattern(new BaseBlock(BlockTypes.AIR)); return replaceBlocks(region, mask, pattern); } @@ -868,9 +841,8 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int setBlocks(Region region, BaseBlock block) throws MaxChangedBlocksException { - return setBlocks(region, new SingleBlockPattern(block)); + return setBlocks(region, new BlockPattern(block)); } /** @@ -881,12 +853,11 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int setBlocks(Region region, Pattern pattern) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(pattern); - BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern)); + BlockReplace replace = new BlockReplace(this, pattern); RegionVisitor visitor = new RegionVisitor(region, replace); Operations.completeLegacy(visitor); return visitor.getAffected(); @@ -897,14 +868,13 @@ public class EditSession implements Extent { * returned by a given pattern. * * @param region the region to replace the blocks within - * @param filter a list of block types to match, or null to use {@link com.sk89q.worldedit.masks.ExistingBlockMask} + * @param filter a list of block types to match, or null to use {@link com.sk89q.worldedit.function.mask.ExistingBlockMask} * @param replacement the replacement block * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int replaceBlocks(Region region, Set filter, BaseBlock replacement) throws MaxChangedBlocksException { - return replaceBlocks(region, filter, new SingleBlockPattern(replacement)); + return replaceBlocks(region, filter, new BlockPattern(replacement)); } /** @@ -912,12 +882,11 @@ public class EditSession implements Extent { * returned by a given pattern. * * @param region the region to replace the blocks within - * @param filter a list of block types to match, or null to use {@link com.sk89q.worldedit.masks.ExistingBlockMask} + * @param filter a list of block types to match, or null to use {@link com.sk89q.worldedit.function.mask.ExistingBlockMask} * @param pattern the pattern that provides the new blocks * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int replaceBlocks(Region region, Set filter, Pattern pattern) throws MaxChangedBlocksException { Mask mask = filter == null ? new ExistingBlockMask(this) : new FuzzyBlockMask(this, filter); return replaceBlocks(region, mask, pattern); @@ -933,13 +902,12 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int replaceBlocks(Region region, Mask mask, Pattern pattern) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(mask); checkNotNull(pattern); - BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern)); + BlockReplace replace = new BlockReplace(this, pattern); RegionMaskingFilter filter = new RegionMaskingFilter(mask, replace); RegionVisitor visitor = new RegionVisitor(region, filter); Operations.completeLegacy(visitor); @@ -956,7 +924,6 @@ public class EditSession implements Extent { * @return the number of blocks placed * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int center(Region region, Pattern pattern) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(pattern); @@ -978,9 +945,8 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int makeCuboidFaces(Region region, BaseBlock block) throws MaxChangedBlocksException { - return makeCuboidFaces(region, new SingleBlockPattern(block)); + return makeCuboidFaces(region, new BlockPattern(block)); } /** @@ -991,7 +957,6 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int makeCuboidFaces(Region region, Pattern pattern) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(pattern); @@ -1011,7 +976,6 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int makeFaces(final Region region, Pattern pattern) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(pattern); @@ -1033,9 +997,8 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int makeCuboidWalls(Region region, BaseBlock block) throws MaxChangedBlocksException { - return makeCuboidWalls(region, new SingleBlockPattern(block)); + return makeCuboidWalls(region, new BlockPattern(block)); } /** @@ -1047,7 +1010,6 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int makeCuboidWalls(Region region, Pattern pattern) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(pattern); @@ -1067,7 +1029,6 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int makeWalls(final Region region, Pattern pattern) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(pattern); @@ -1101,11 +1062,10 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int overlayCuboidBlocks(Region region, BaseBlock block) throws MaxChangedBlocksException { checkNotNull(block); - return overlayCuboidBlocks(region, new SingleBlockPattern(block)); + return overlayCuboidBlocks(region, new BlockPattern(block)); } /** @@ -1117,12 +1077,11 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") public int overlayCuboidBlocks(Region region, Pattern pattern) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(pattern); - BlockReplace replace = new BlockReplace(this, Patterns.wrap(pattern)); + BlockReplace replace = new BlockReplace(this, pattern); RegionOffset offset = new RegionOffset(new Vector(0, 1, 0), replace); GroundFunction ground = new GroundFunction(new ExistingBlockMask(this), offset); LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground); @@ -1835,8 +1794,8 @@ public class EditSession implements Extent { * @return the results */ public List> getBlockDistribution(Region region) { - List> distribution = new ArrayList>(); - Map> map = new HashMap>(); + List> distribution = new ArrayList<>(); + Map> map = new HashMap<>(); if (region instanceof CuboidRegion) { // Doing this for speed @@ -1860,7 +1819,7 @@ public class EditSession implements Extent { if (map.containsKey(id)) { map.get(id).increment(); } else { - Countable c = new Countable(id, 1); + Countable c = new Countable<>(id, 1); map.put(id, c); distribution.add(c); } @@ -1874,7 +1833,7 @@ public class EditSession implements Extent { if (map.containsKey(id)) { map.get(id).increment(); } else { - Countable c = new Countable(id, 1); + Countable c = new Countable<>(id, 1); map.put(id, c); } } @@ -1894,8 +1853,8 @@ public class EditSession implements Extent { */ // TODO reduce code duplication - probably during ops-redux public List> getBlockDistributionWithData(Region region) { - List> distribution = new ArrayList>(); - Map> map = new HashMap>(); + List> distribution = new ArrayList<>(); + Map> map = new HashMap<>(); if (region instanceof CuboidRegion) { // Doing this for speed @@ -1919,7 +1878,7 @@ public class EditSession implements Extent { if (map.containsKey(blk)) { map.get(blk).increment(); } else { - Countable c = new Countable(blk, 1); + Countable c = new Countable<>(blk, 1); map.put(blk, c); distribution.add(c); } @@ -1933,7 +1892,7 @@ public class EditSession implements Extent { if (map.containsKey(blk)) { map.get(blk).increment(); } else { - Countable c = new Countable(blk, 1); + Countable c = new Countable<>(blk, 1); map.put(blk, c); } } @@ -1989,7 +1948,7 @@ public class EditSession implements Extent { final WorldEditExpressionEnvironment environment = new WorldEditExpressionEnvironment(this, unit, zero); expression.setEnvironment(environment); - final DoubleArrayList queue = new DoubleArrayList(false); + final DoubleArrayList queue = new DoubleArrayList<>(false); for (BlockVector position : region) { // offset, scale @@ -2035,7 +1994,7 @@ public class EditSession implements Extent { public int hollowOutRegion(Region region, int thickness, Pattern pattern) throws MaxChangedBlocksException { int affected = 0; - final Set outside = new HashSet(); + final Set outside = new HashSet<>(); final Vector min = region.getMinimumPoint(); final Vector max = region.getMaximumPoint(); @@ -2069,7 +2028,7 @@ public class EditSession implements Extent { } for (int i = 1; i < thickness; ++i) { - final Set newOutside = new HashSet(); + final Set newOutside = new HashSet<>(); outer: for (BlockVector position : region) { for (Vector recurseDirection: recurseDirections) { BlockVector neighbor = position.add(recurseDirection).toBlockVector(); @@ -2093,7 +2052,7 @@ public class EditSession implements Extent { } } - if (setBlock(position, pattern.next(position))) { + if (setBlock(position, pattern.apply(position))) { ++affected; } } @@ -2116,7 +2075,7 @@ public class EditSession implements Extent { public int drawLine(Pattern pattern, Vector pos1, Vector pos2, double radius, boolean filled) throws MaxChangedBlocksException { - Set vset = new HashSet(); + Set vset = new HashSet<>(); boolean notdrawn = true; int x1 = pos1.getBlockX(), y1 = pos1.getBlockY(), z1 = pos1.getBlockZ(); @@ -2187,8 +2146,8 @@ public class EditSession implements Extent { public int drawSpline(Pattern pattern, List nodevectors, double tension, double bias, double continuity, double quality, double radius, boolean filled) throws MaxChangedBlocksException { - Set vset = new HashSet(); - List nodes = new ArrayList(nodevectors.size()); + Set vset = new HashSet<>(); + List nodes = new ArrayList<>(nodevectors.size()); Interpolation interpol = new KochanekBartelsInterpolation(); @@ -2227,7 +2186,7 @@ public class EditSession implements Extent { } private static Set getBallooned(Set vset, double radius) { - Set returnset = new HashSet(); + Set returnset = new HashSet<>(); int ceilrad = (int) Math.ceil(radius); for (Vector v : vset) { @@ -2247,7 +2206,7 @@ public class EditSession implements Extent { } private static Set getHollowed(Set vset) { - Set returnset = new HashSet(); + Set returnset = new HashSet<>(); for (Vector v : vset) { double x = v.getX(), y = v.getY(), z = v.getZ(); if (!(vset.contains(new Vector(x + 1, y, z)) && @@ -2263,7 +2222,7 @@ public class EditSession implements Extent { } private void recurseHollow(Region region, BlockVector origin, Set outside) { - final LinkedList queue = new LinkedList(); + final LinkedList queue = new LinkedList<>(); queue.addLast(origin); while (!queue.isEmpty()) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index 9c04626ae..d59811fb7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -917,14 +917,4 @@ public class LocalSession { this.mask = mask; } - /** - * Set a mask. - * - * @param mask mask or null - */ - @SuppressWarnings("deprecation") - public void setMask(com.sk89q.worldedit.masks.Mask mask) { - setMask(mask != null ? Masks.wrap(mask) : null); - } - } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 07d00ced6..6a665127e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -37,10 +37,6 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.PlatformManager; import com.sk89q.worldedit.extent.inventory.BlockBag; -import com.sk89q.worldedit.function.mask.Masks; -import com.sk89q.worldedit.function.pattern.Patterns; -import com.sk89q.worldedit.masks.Mask; -import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.scripting.CraftScriptContext; import com.sk89q.worldedit.scripting.CraftScriptEngine; import com.sk89q.worldedit.scripting.RhinoCraftScriptEngine; @@ -313,32 +309,6 @@ public class WorldEdit { return blocks; } - /** - * @deprecated Use {@link #getPatternFactory()} and {@link BlockFactory#parseFromInput(String, ParserContext)} - */ - @Deprecated - @SuppressWarnings("deprecation") - public Pattern getBlockPattern(Player player, String input) throws WorldEditException { - ParserContext context = new ParserContext(); - context.setActor(player); - context.setWorld(player.getWorld()); - context.setSession(getSession(player)); - return Patterns.wrap(getPatternFactory().parseFromInput(input, context)); - } - - /** - * @deprecated Use {@link #getMaskFactory()} ()} and {@link MaskFactory#parseFromInput(String, ParserContext)} - */ - @Deprecated - @SuppressWarnings("deprecation") - public Mask getBlockMask(Player player, LocalSession session, String input) throws WorldEditException { - ParserContext context = new ParserContext(); - context.setActor(player); - context.setWorld(player.getWorld()); - context.setSession(session); - return Masks.wrap(getMaskFactory().parseFromInput(input, context)); - } - /** * Gets the path to a file. This method will check to see if the filename * has valid characters and has an extension. It also prevents directory diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector.java index c45b53ef8..db9407b26 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector.java @@ -25,7 +25,6 @@ import com.sk89q.worldedit.world.World; /** * @deprecated Use {@link com.sk89q.worldedit.util.Location} wherever possible */ -@SuppressWarnings("deprecation") @Deprecated public class WorldVector extends Vector { @@ -127,7 +126,7 @@ public class WorldVector extends Vector { /** * Gets a BlockVector version. - * + * * @return BlockWorldVector */ public BlockWorldVector toWorldBlockVector() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVectorFace.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVectorFace.java index 306b2ea34..9bd1b3a27 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVectorFace.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVectorFace.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit; /** * @deprecated Use {@link com.sk89q.worldedit.util.Location} wherever possible */ -@SuppressWarnings("deprecation") @Deprecated public class WorldVectorFace extends WorldVector { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 4e5cd07f8..2846de359 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -25,7 +25,6 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.CuboidClipboard.FlipDirection; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; -import com.sk89q.worldedit.foundation.Block; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.state.State; @@ -54,8 +53,7 @@ import javax.annotation.Nullable; * as a "wildcard" block value, even though a {@link Mask} would be * more appropriate.

*/ -@SuppressWarnings("deprecation") -public class BaseBlock extends Block implements TileEntityBlock { +public class BaseBlock implements TileEntityBlock { // Instances of this class should be _as small as possible_ because there will // be millions of instances of this object. @@ -158,7 +156,6 @@ public class BaseBlock extends Block implements TileEntityBlock { * * @return legacy numerical ID */ - @Override @Deprecated public int getId() { return this.blockType.getLegacyId(); @@ -182,7 +179,6 @@ public class BaseBlock extends Block implements TileEntityBlock { * * @param id block id */ - @Override @Deprecated public void setId(int id) { internalSetId(id); @@ -210,7 +206,6 @@ public class BaseBlock extends Block implements TileEntityBlock { * * @return data value (0-15) */ - @Override @Deprecated public int getData() { return 0; @@ -268,7 +263,6 @@ public class BaseBlock extends Block implements TileEntityBlock { * * @param data block data value */ - @Override @Deprecated public void setData(int data) { internalSetData(data); @@ -282,7 +276,6 @@ public class BaseBlock extends Block implements TileEntityBlock { * @see #setId(int) * @see #setData(int) */ - @Override @Deprecated public void setIdAndData(int id, int data) { setId(id); @@ -294,7 +287,6 @@ public class BaseBlock extends Block implements TileEntityBlock { * * @return true if there are no matched states */ - @Override public boolean hasWildcardData() { return getStates().isEmpty(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java index edda882a8..5c1e47150 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java @@ -29,7 +29,6 @@ import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.function.pattern.Patterns; import com.sk89q.worldedit.internal.annotation.Selection; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.regions.Region; @@ -117,7 +116,7 @@ public class GenerationCommands { worldEdit.checkMaxRadius(height); Vector pos = session.getPlacementPosition(player); - int affected = editSession.makeCylinder(pos, Patterns.wrap(pattern), radiusX, radiusZ, height, !hollow); + int affected = editSession.makeCylinder(pos, pattern, radiusX, radiusZ, height, !hollow); player.print(affected + " block(s) have been created."); } @@ -182,7 +181,7 @@ public class GenerationCommands { pos = pos.add(0, radiusY, 0); } - int affected = editSession.makeSphere(pos, Patterns.wrap(pattern), radiusX, radiusY, radiusZ, !hollow); + int affected = editSession.makeSphere(pos, pattern, radiusX, radiusY, radiusZ, !hollow); player.findFreePosition(); player.print(affected + " block(s) have been created."); } @@ -243,7 +242,7 @@ public class GenerationCommands { public void pyramid(Player player, LocalSession session, EditSession editSession, Pattern pattern, @Range(min = 1) int size, @Switch('h') boolean hollow) throws WorldEditException { Vector pos = session.getPlacementPosition(player); worldEdit.checkMaxRadius(size); - int affected = editSession.makePyramid(pos, Patterns.wrap(pattern), size, !hollow); + int affected = editSession.makePyramid(pos, pattern, size, !hollow); player.findFreePosition(); player.print(affected + " block(s) have been created."); } @@ -306,7 +305,7 @@ public class GenerationCommands { } try { - final int affected = editSession.makeShape(region, zero, unit, Patterns.wrap(pattern), expression, hollow); + final int affected = editSession.makeShape(region, zero, unit, pattern, expression, hollow); player.findFreePosition(); player.print(affected + " block(s) have been created."); } catch (ExpressionException e) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 174fe08de..8751c3453 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -33,7 +33,6 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.NoiseFilter2D; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.function.pattern.Patterns; import com.sk89q.worldedit.function.visitor.LayerVisitor; import com.sk89q.worldedit.internal.annotation.Direction; import com.sk89q.worldedit.internal.annotation.Selection; @@ -106,7 +105,7 @@ public class RegionCommands { CuboidRegion cuboidregion = (CuboidRegion) region; Vector pos1 = cuboidregion.getPos1(); Vector pos2 = cuboidregion.getPos2(); - int blocksChanged = editSession.drawLine(Patterns.wrap(pattern), pos1, pos2, thickness, !shell); + int blocksChanged = editSession.drawLine(pattern, pos1, pos2, thickness, !shell); player.print(blocksChanged + " block(s) have been changed."); } @@ -137,9 +136,9 @@ public class RegionCommands { } ConvexPolyhedralRegion cpregion = (ConvexPolyhedralRegion) region; - List vectors = new ArrayList(cpregion.getVertices()); + List vectors = new ArrayList<>(cpregion.getVertices()); - int blocksChanged = editSession.drawSpline(Patterns.wrap(pattern), vectors, 0, 0, 0, 10, thickness, !shell); + int blocksChanged = editSession.drawSpline(pattern, vectors, 0, 0, 0, 10, thickness, !shell); player.print(blocksChanged + " block(s) have been changed."); } @@ -158,7 +157,7 @@ public class RegionCommands { if (from == null) { from = new ExistingBlockMask(editSession); } - int affected = editSession.replaceBlocks(region, from, Patterns.wrap(to)); + int affected = editSession.replaceBlocks(region, from, to); player.print(affected + " block(s) have been replaced."); } @@ -172,7 +171,7 @@ public class RegionCommands { @CommandPermissions("worldedit.region.overlay") @Logging(REGION) public void overlay(Player player, EditSession editSession, @Selection Region region, Pattern pattern) throws WorldEditException { - int affected = editSession.overlayCuboidBlocks(region, Patterns.wrap(pattern)); + int affected = editSession.overlayCuboidBlocks(region, pattern); player.print(affected + " block(s) have been overlaid."); } @@ -186,7 +185,7 @@ public class RegionCommands { @Logging(REGION) @CommandPermissions("worldedit.region.center") public void center(Player player, EditSession editSession, @Selection Region region, Pattern pattern) throws WorldEditException { - int affected = editSession.center(region, Patterns.wrap(pattern)); + int affected = editSession.center(region, pattern); player.print("Center set ("+ affected + " blocks changed)"); } @@ -214,7 +213,7 @@ public class RegionCommands { @CommandPermissions("worldedit.region.walls") @Logging(REGION) public void walls(Player player, EditSession editSession, @Selection Region region, Pattern pattern) throws WorldEditException { - int affected = editSession.makeCuboidWalls(region, Patterns.wrap(pattern)); + int affected = editSession.makeCuboidWalls(region, pattern); player.print(affected + " block(s) have been changed."); } @@ -228,7 +227,7 @@ public class RegionCommands { @CommandPermissions("worldedit.region.faces") @Logging(REGION) public void faces(Player player, EditSession editSession, @Selection Region region, Pattern pattern) throws WorldEditException { - int affected = editSession.makeCuboidFaces(region, Patterns.wrap(pattern)); + int affected = editSession.makeCuboidFaces(region, pattern); player.print(affected + " block(s) have been changed."); } @@ -422,7 +421,7 @@ public class RegionCommands { @Optional("0") @Range(min = 0) int thickness, @Optional("air") Pattern pattern) throws WorldEditException { - int affected = editSession.hollowOutRegion(region, thickness, Patterns.wrap(pattern)); + int affected = editSession.hollowOutRegion(region, thickness, pattern); player.print(affected + " block(s) have been changed."); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 46f0cde96..0e4734ecf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -26,8 +26,9 @@ import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.ItemType; import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.patterns.Pattern; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.command.tool.*; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.TreeGenerator; public class ToolCommands { @@ -139,7 +140,12 @@ public class ToolCommands { return; } - Pattern pattern = we.getBlockPattern(player, args.getString(0)); + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + Pattern pattern = we.getPatternFactory().parseFromInput(args.getString(0), context); + session.setTool(player.getItemInHand(), new FloodFillTool(range, pattern)); player.print("Block flood fill tool bound to " + ItemType.toHeldName(player.getItemInHand()) + "."); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 74d1bb88c..5da53420c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -36,17 +36,18 @@ import com.sk89q.worldedit.command.util.CreatureButcher; import com.sk89q.worldedit.command.util.EntityRemover; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.CommandManager; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.operation.Operations; +import com.sk89q.worldedit.function.pattern.BlockPattern; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.visitor.EntityVisitor; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.internal.expression.runtime.EvaluationException; -import com.sk89q.worldedit.patterns.Pattern; -import com.sk89q.worldedit.patterns.SingleBlockPattern; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CylinderRegion; import com.sk89q.worldedit.regions.Region; @@ -92,17 +93,20 @@ public class UtilityCommands { @Logging(PLACEMENT) public void fill(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - Pattern pattern = we.getBlockPattern(player, args.getString(0)); + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + Pattern pattern = we.getPatternFactory().parseFromInput(args.getString(0), context); + double radius = Math.max(1, args.getDouble(1)); we.checkMaxRadius(radius); int depth = args.argsLength() > 2 ? Math.max(1, args.getInteger(2)) : 1; Vector pos = session.getPlacementPosition(player); - int affected = 0; - if (pattern instanceof SingleBlockPattern) { - affected = editSession.fillXZ(pos, - ((SingleBlockPattern) pattern).getBlock(), - radius, depth, false); + int affected; + if (pattern instanceof BlockPattern) { + affected = editSession.fillXZ(pos, ((BlockPattern) pattern).getBlock(), radius, depth, false); } else { affected = editSession.fillXZ(pos, pattern, radius, depth, false); } @@ -120,17 +124,20 @@ public class UtilityCommands { @Logging(PLACEMENT) public void fillr(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - Pattern pattern = we.getBlockPattern(player, args.getString(0)); + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + Pattern pattern = we.getPatternFactory().parseFromInput(args.getString(0), context); + double radius = Math.max(1, args.getDouble(1)); we.checkMaxRadius(radius); int depth = args.argsLength() > 2 ? Math.max(1, args.getInteger(2)) : Integer.MAX_VALUE; Vector pos = session.getPlacementPosition(player); int affected = 0; - if (pattern instanceof SingleBlockPattern) { - affected = editSession.fillXZ(pos, - ((SingleBlockPattern) pattern).getBlock(), - radius, depth, true); + if (pattern instanceof BlockPattern) { + affected = editSession.fillXZ(pos, ((BlockPattern) pattern).getBlock(), radius, depth, true); } else { affected = editSession.fillXZ(pos, pattern, radius, depth, true); } @@ -267,12 +274,20 @@ public class UtilityCommands { int affected; Set from; Pattern to; + + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + context.setRestricted(false); + context.setPreferringWildcard(!args.hasFlag('f')); + if (args.argsLength() == 2) { from = null; - to = we.getBlockPattern(player, args.getString(1)); + to = we.getPatternFactory().parseFromInput(args.getString(1), context); } else { - from = we.getBlocks(player, args.getString(1), true, !args.hasFlag('f')); - to = we.getBlockPattern(player, args.getString(2)); + from = we.getBlockFactory().parseFromListInput(args.getString(1), context); + to = we.getPatternFactory().parseFromInput(args.getString(2), context); } Vector base = session.getPlacementPosition(player); @@ -280,8 +295,8 @@ public class UtilityCommands { Vector max = base.add(size, size, size); Region region = new CuboidRegion(player.getWorld(), min, max); - if (to instanceof SingleBlockPattern) { - affected = editSession.replaceBlocks(region, from, ((SingleBlockPattern) to).getBlock()); + if (to instanceof BlockPattern) { + affected = editSession.replaceBlocks(region, from, ((BlockPattern) to).getBlock()); } else { affected = editSession.replaceBlocks(region, from, to); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java index 592f13814..1db0ac5e5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java @@ -24,7 +24,7 @@ import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; -import com.sk89q.worldedit.patterns.Pattern; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; @@ -87,7 +87,7 @@ public class FloodFillTool implements BlockTool { visited.add(pos); if (editSession.getBlock(pos).getType().getLegacyId() == initialType) { - editSession.setBlock(pos, pattern.next(pos)); + editSession.setBlock(pos, pattern.apply(pos)); } else { return; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java index ca4d4c145..6f1eb3540 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java @@ -23,11 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.function.pattern.Patterns; public class CylinderBrush implements Brush { @@ -42,7 +40,7 @@ public class CylinderBrush implements Brush { if (pattern == null) { pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); } - editSession.makeCylinder(position, Patterns.wrap(pattern), size, size, height, true); + editSession.makeCylinder(position, pattern, size, size, height, true); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java index 0fe74aa47..4c032eb28 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java @@ -23,11 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.function.pattern.Patterns; public class HollowCylinderBrush implements Brush { @@ -42,7 +40,7 @@ public class HollowCylinderBrush implements Brush { if (pattern == null) { pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); } - editSession.makeCylinder(position, Patterns.wrap(pattern), size, size, height, false); + editSession.makeCylinder(position, pattern, size, size, height, false); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java index b28dc08a5..d3ed19ff8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java @@ -23,11 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.function.pattern.Patterns; public class HollowSphereBrush implements Brush { @@ -36,6 +34,6 @@ public class HollowSphereBrush implements Brush { if (pattern == null) { pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); } - editSession.makeSphere(position, Patterns.wrap(pattern), size, size, size, false); + editSession.makeSphere(position, pattern, size, size, size, false); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java index 23a3eddb3..988c0c5bd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java @@ -23,11 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.function.pattern.Patterns; public class SphereBrush implements Brush { @@ -36,6 +34,6 @@ public class SphereBrush implements Brush { if (pattern == null) { pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); } - editSession.makeSphere(position, Patterns.wrap(pattern), size, size, size, true); + editSession.makeSphere(position, pattern, size, size, size, true); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java index 4b0f1c802..6b9967250 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java @@ -19,14 +19,15 @@ package com.sk89q.worldedit.function.block; +import com.google.common.collect.Sets; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.LayerFunction; -import com.sk89q.worldedit.masks.BlockMask; -import com.sk89q.worldedit.masks.Mask; +import com.sk89q.worldedit.function.mask.BlockMask; +import com.sk89q.worldedit.function.mask.Mask; import static com.google.common.base.Preconditions.checkNotNull; @@ -37,11 +38,12 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class Naturalizer implements LayerFunction { + private static final BaseBlock grass = new BaseBlock(BlockTypes.GRASS_BLOCK); + private static final BaseBlock dirt = new BaseBlock(BlockTypes.DIRT); + private static final BaseBlock stone = new BaseBlock(BlockTypes.STONE); + private final EditSession editSession; - private final BaseBlock grass = new BaseBlock(BlockTypes.GRASS_BLOCK); - private final BaseBlock dirt = new BaseBlock(BlockTypes.DIRT); - private final BaseBlock stone = new BaseBlock(BlockTypes.STONE); - private final Mask mask = new BlockMask(grass, dirt, stone); + private final Mask mask; private int affected = 0; /** @@ -52,6 +54,7 @@ public class Naturalizer implements LayerFunction { public Naturalizer(EditSession editSession) { checkNotNull(editSession); this.editSession = editSession; + this.mask = new BlockMask(editSession, Sets.newHashSet(grass, dirt, stone)); } /** @@ -65,12 +68,12 @@ public class Naturalizer implements LayerFunction { @Override public boolean isGround(Vector position) { - return mask.matches(editSession, position); + return mask.test(position); } @Override public boolean apply(Vector position, int depth) throws WorldEditException { - if (mask.matches(editSession, position)) { + if (mask.test(position)) { affected++; switch (depth) { case 0: diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java index b6e94adc2..7c0a8f53f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java @@ -131,82 +131,6 @@ public final class Masks { }; } - /** - * Wrap an old-style mask and convert it to a new mask. - * - *

Note, however, that this is strongly not recommended because - * {@link com.sk89q.worldedit.masks.Mask#prepare(LocalSession, LocalPlayer, Vector)} - * is not called.

- * - * @param mask the old-style mask - * @param editSession the edit session to bind to - * @return a new-style mask - * @deprecated Please avoid if possible - */ - @Deprecated - @SuppressWarnings("deprecation") - public static Mask wrap(final com.sk89q.worldedit.masks.Mask mask, final EditSession editSession) { - checkNotNull(mask); - return new AbstractMask() { - @Override - public boolean test(Vector vector) { - return mask.matches(editSession, vector); - } - - @Nullable - @Override - public Mask2D toMask2D() { - return null; - } - }; - } - - /** - * Wrap an old-style mask and convert it to a new mask. - * - *

As an {@link EditSession} is not provided in this case, one will be - * taken from the {@link Request}, if possible. If not possible, then the - * mask will return false.

- * - * @param mask the old-style mask - * @return a new-style mask - */ - @SuppressWarnings("deprecation") - public static Mask wrap(final com.sk89q.worldedit.masks.Mask mask) { - checkNotNull(mask); - return new AbstractMask() { - @Override - public boolean test(Vector vector) { - EditSession editSession = Request.request().getEditSession(); - return editSession != null && mask.matches(editSession, vector); - } - - @Nullable - @Override - public Mask2D toMask2D() { - return null; - } - }; - } - - /** - * Convert a new-style mask to an old-style mask. - * - * @param mask the new-style mask - * @return an old-style mask - */ - @SuppressWarnings("deprecation") - public static com.sk89q.worldedit.masks.Mask wrap(final Mask mask) { - checkNotNull(mask); - return new com.sk89q.worldedit.masks.AbstractMask() { - @Override - public boolean matches(EditSession editSession, Vector position) { - Request.request().setEditSession(editSession); - return mask.test(position); - } - }; - } - private static class AlwaysTrue implements Mask, Mask2D { @Override public boolean test(Vector vector) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Patterns.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Patterns.java deleted file mode 100644 index 4bb67c610..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Patterns.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.function.pattern; - -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Utility methods related to {@link Pattern}s. - */ -public final class Patterns { - - private Patterns() { - } - - /** - * Wrap an old-style pattern and return a new pattern. - * - * @param pattern the pattern - * @return a new-style pattern - */ - public static Pattern wrap(final com.sk89q.worldedit.patterns.Pattern pattern) { - checkNotNull(pattern); - return new Pattern() { - @Override - public BaseBlock apply(Vector position) { - return pattern.next(position); - } - }; - } - - /** - * Wrap a new-style pattern and return an old-style pattern. - * - * @param pattern the pattern - * @return an old-style pattern - */ - public static com.sk89q.worldedit.patterns.Pattern wrap(final Pattern pattern) { - checkNotNull(pattern); - return new com.sk89q.worldedit.patterns.Pattern() { - @Override - public BaseBlock next(Vector position) { - return pattern.apply(position); - } - - @Override - public BaseBlock next(int x, int y, int z) { - return next(new Vector(x, y, z)); - } - }; - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java index 258be2c6f..7777517c2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java @@ -48,14 +48,6 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion { this(null, pos1, pos2); } - /** - * @deprecated cast {@code world} to {@link World} - */ - @Deprecated - public CuboidRegion(LocalWorld world, Vector pos1, Vector pos2) { - this((World) world, pos1, pos2); - } - /** * Construct a new instance of this cuboid using two corners of the cuboid. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java index 5dc3af057..f7cac803e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java @@ -48,7 +48,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Creates a {@code ConvexPolyhedralRegion} from a user's selections. */ -public class ConvexPolyhedralRegionSelector extends com.sk89q.worldedit.regions.ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion { +public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion { private final transient ConvexPolyhedralRegion region; private transient BlockVector pos1; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java index 4265490f1..4b2f89705 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java @@ -38,7 +38,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Creates a {@code CuboidRegion} from a user's selections. */ -public class CuboidRegionSelector extends com.sk89q.worldedit.regions.CuboidRegionSelector implements RegionSelector, CUIRegion { +public class CuboidRegionSelector implements RegionSelector, CUIRegion { protected transient BlockVector position1; protected transient BlockVector position2; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java index b2d3002c2..2ff239b93 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java @@ -38,7 +38,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Creates a {@code CylinderRegionSelector} from a user's selections. */ -public class CylinderRegionSelector extends com.sk89q.worldedit.regions.CylinderRegionSelector implements RegionSelector, CUIRegion { +public class CylinderRegionSelector implements RegionSelector, CUIRegion { protected static transient final NumberFormat NUMBER_FORMAT; protected transient CylinderRegion region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java index 5f3a956d4..ce330cb6b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java @@ -39,7 +39,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Creates a {@code EllipsoidRegionSelector} from a user's selections. */ -public class EllipsoidRegionSelector extends com.sk89q.worldedit.regions.EllipsoidRegionSelector implements RegionSelector, CUIRegion { +public class EllipsoidRegionSelector implements RegionSelector, CUIRegion { protected transient EllipsoidRegion region; protected transient boolean started = false; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java index c9611c05f..cb6d03974 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java @@ -41,7 +41,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Creates a {@code Polygonal2DRegion} from a user's selections. */ -public class Polygonal2DRegionSelector extends com.sk89q.worldedit.regions.Polygonal2DRegionSelector implements RegionSelector, CUIRegion { +public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion { private transient BlockVector pos1; private transient Polygonal2DRegion region; @@ -248,7 +248,6 @@ public class Polygonal2DRegionSelector extends com.sk89q.worldedit.regions.Polyg * * @return the number of points */ - @Override public int getPointCount() { return region.getPoints().size(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java index e630555b6..e9da33d08 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java @@ -25,7 +25,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockTypes; -import com.sk89q.worldedit.patterns.Pattern; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.Region; /** @@ -92,7 +92,7 @@ public abstract class ArbitraryShape { switch (cacheEntry) { case 0: // unknown, fetch material - final BaseBlock material = getMaterial(x, y, z, pattern.next(new BlockVector(x, y, z))); + final BaseBlock material = getMaterial(x, y, z, pattern.apply(new BlockVector(x, y, z))); if (material == null) { // outside cache[index] = -1; @@ -156,7 +156,7 @@ public abstract class ArbitraryShape { int z = position.getBlockZ(); if (!hollow) { - final BaseBlock material = getMaterial(x, y, z, pattern.next(position)); + final BaseBlock material = getMaterial(x, y, z, pattern.apply(position)); if (material != null && editSession.setBlock(position, material)) { ++affected; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java index 369b1944f..613f13a6c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java @@ -34,7 +34,7 @@ import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.CuboidClipboard; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.data.DataException; +import com.sk89q.worldedit.world.DataException; import java.io.DataInputStream; import java.io.File; @@ -138,7 +138,7 @@ public class MCEditSchematicFormat extends SchematicFormat { List tileEntities = getChildTag(schematic, "TileEntities", ListTag.class) .getValue(); Map> tileEntitiesMap = - new HashMap>(); + new HashMap<>(); for (Tag tag : tileEntities) { if (!(tag instanceof CompoundTag)) continue; @@ -148,7 +148,7 @@ public class MCEditSchematicFormat extends SchematicFormat { int y = 0; int z = 0; - Map values = new HashMap(); + Map values = new HashMap<>(); for (Map.Entry entry : t.getValue().entrySet()) { if (entry.getKey().equals("x")) { @@ -216,7 +216,7 @@ public class MCEditSchematicFormat extends SchematicFormat { throw new DataException("Length of region too large for a .schematic"); } - HashMap schematic = new HashMap(); + HashMap schematic = new HashMap<>(); schematic.put("Width", new ShortTag((short) width)); schematic.put("Length", new ShortTag((short) length)); schematic.put("Height", new ShortTag((short) height)); @@ -232,7 +232,7 @@ public class MCEditSchematicFormat extends SchematicFormat { byte[] blocks = new byte[width * height * length]; byte[] addBlocks = null; byte[] blockData = new byte[width * height * length]; - ArrayList tileEntities = new ArrayList(); + ArrayList tileEntities = new ArrayList<>(); for (int x = 0; x < width; ++x) { for (int y = 0; y < height; ++y) { @@ -257,7 +257,7 @@ public class MCEditSchematicFormat extends SchematicFormat { // Get the list of key/values from the block CompoundTag rawTag = block.getNbtData(); if (rawTag != null) { - Map values = new HashMap(); + Map values = new HashMap<>(); for (Entry entry : rawTag.getValue().entrySet()) { values.put(entry.getKey(), entry.getValue()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java index 1de675822..7ecbe0181 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java @@ -21,7 +21,8 @@ package com.sk89q.worldedit.schematic; import com.sk89q.worldedit.CuboidClipboard; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.data.DataException; +import com.sk89q.worldedit.extent.clipboard.Clipboard; +import com.sk89q.worldedit.world.DataException; import java.io.File; import java.io.IOException; @@ -29,13 +30,13 @@ import java.util.*; public abstract class SchematicFormat { - private static final Map SCHEMATIC_FORMATS = new HashMap(); + private static final Map SCHEMATIC_FORMATS = new HashMap<>(); // Built-in schematic formats public static final SchematicFormat MCEDIT = new MCEditSchematicFormat(); public static Set getFormats() { - return Collections.unmodifiableSet(new HashSet(SCHEMATIC_FORMATS.values())); + return Collections.unmodifiableSet(new HashSet<>(SCHEMATIC_FORMATS.values())); } public static SchematicFormat getFormat(String lookupName) { @@ -60,7 +61,7 @@ public abstract class SchematicFormat { protected SchematicFormat(String name, String... lookupNames) { this.name = name; - List registeredLookupNames = new ArrayList(lookupNames.length); + List registeredLookupNames = new ArrayList<>(lookupNames.length); for (int i = 0; i < lookupNames.length; ++i) { if (i == 0 || !SCHEMATIC_FORMATS.containsKey(lookupNames[i].toLowerCase())) { SCHEMATIC_FORMATS.put(lookupNames[i].toLowerCase(), this); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java index bca3f641a..0c5753d6d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java @@ -23,8 +23,9 @@ import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.command.InsufficientArgumentsException; import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Platform; -import com.sk89q.worldedit.patterns.Pattern; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.io.file.FilenameException; import java.io.File; @@ -36,10 +37,9 @@ import java.util.Set; /** * The context given to scripts. */ -@SuppressWarnings("deprecation") public class CraftScriptContext extends CraftScriptEnvironment { - private List editSessions = new ArrayList(); + private List editSessions = new ArrayList<>(); private String[] args; public CraftScriptContext(WorldEdit controller, @@ -176,7 +176,11 @@ public class CraftScriptContext extends CraftScriptEnvironment { * @throws DisallowedItemException */ public Pattern getBlockPattern(String list) throws WorldEditException { - return controller.getBlockPattern(player, list); + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + return controller.getPatternFactory().parseFromInput(list, context); } /** From 20bf6e079bd88d9b589e79b1dd950499edb2e22d Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sat, 16 Jun 2018 15:29:48 +1000 Subject: [PATCH 12/74] Continue the great purge --- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 21 +- .../bukkit/BukkitPlayerBlockBag.java | 15 +- .../bukkit/BukkitServerInterface.java | 17 +- .../sk89q/worldedit/bukkit/BukkitUtil.java | 65 +---- .../sk89q/worldedit/bukkit/BukkitWorld.java | 19 +- .../sk89q/worldedit/bukkit/WorldEditAPI.java | 48 ---- .../worldedit/bukkit/WorldEditListener.java | 15 +- .../worldedit/bukkit/WorldEditPlugin.java | 68 +---- .../worldedit/bukkit/entity/BukkitEntity.java | 50 ---- .../worldedit/bukkit/entity/BukkitExpOrb.java | 49 ---- .../worldedit/bukkit/entity/BukkitItem.java | 43 --- .../bukkit/entity/BukkitPainting.java | 110 -------- .../bukkit/selections/CuboidSelection.java | 2 +- .../bukkit/selections/CylinderSelection.java | 3 +- .../selections/Polygonal2DSelection.java | 3 +- .../com/sk89q/worldedit/BlockWorldVector.java | 124 -------- .../sk89q/worldedit/BlockWorldVector2D.java | 105 ------- .../com/sk89q/worldedit/CuboidClipboard.java | 20 +- .../java/com/sk89q/worldedit/EditSession.java | 25 -- .../sk89q/worldedit/EditSessionFactory.java | 60 ---- .../java/com/sk89q/worldedit/LocalEntity.java | 49 ---- .../java/com/sk89q/worldedit/LocalPlayer.java | 34 --- .../com/sk89q/worldedit/LocalSession.java | 101 +------ .../java/com/sk89q/worldedit/LocalWorld.java | 83 ------ .../java/com/sk89q/worldedit/Location.java | 129 --------- .../java/com/sk89q/worldedit/VectorFace.java | 90 ------ .../java/com/sk89q/worldedit/WorldEdit.java | 9 +- .../sk89q/worldedit/WorldEditOperation.java | 33 --- .../java/com/sk89q/worldedit/WorldVector.java | 146 ---------- .../com/sk89q/worldedit/WorldVector2D.java | 81 ------ .../com/sk89q/worldedit/WorldVectorFace.java | 107 ------- .../sk89q/worldedit/blocks/type/ItemType.java | 5 - .../worldedit/command/BiomeCommands.java | 11 +- .../worldedit/command/ChunkCommands.java | 3 +- .../worldedit/command/NavigationCommands.java | 4 +- .../worldedit/command/SelectionCommands.java | 35 +-- .../worldedit/command/tool/BrushTool.java | 10 +- .../worldedit/command/tool/DistanceWand.java | 17 +- .../command/tool/LongRangeBuildTool.java | 33 ++- .../command/tool/brush/SmoothBrush.java | 7 +- .../com/sk89q/worldedit/entity/Player.java | 22 +- .../platform/AbstractPlayerActor.java | 87 +++--- .../extension/platform/PlatformManager.java | 10 +- .../extension/platform/PlayerProxy.java | 3 +- .../worldedit/extent/inventory/BlockBag.java | 6 +- .../worldedit/internal/LocalWorldAdapter.java | 264 ------------------ .../command/CommandLoggingHandler.java | 2 +- .../worldedit/regions/AbstractRegion.java | 11 +- .../regions/ConvexPolyhedralRegion.java | 28 +- .../worldedit/regions/CylinderRegion.java | 17 +- .../worldedit/regions/EllipsoidRegion.java | 9 +- .../sk89q/worldedit/regions/NullRegion.java | 5 - .../worldedit/regions/Polygonal2DRegion.java | 11 - .../com/sk89q/worldedit/regions/Region.java | 9 - .../worldedit/regions/RegionIntersection.java | 12 +- .../selector/Polygonal2DRegionSelector.java | 8 - .../session/request/RequestSelection.java | 7 +- .../com/sk89q/worldedit/util/Location.java | 19 ++ .../com/sk89q/worldedit/util/TargetBlock.java | 66 ++--- .../sk89q/worldedit/forge/ForgePlayer.java | 16 +- .../sk89q/worldedit/forge/ForgeWorldEdit.java | 14 +- .../sk89q/worldedit/sponge/SpongePlayer.java | 9 +- .../worldedit/sponge/SpongeWorldEdit.java | 19 +- 63 files changed, 313 insertions(+), 2190 deletions(-) delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditAPI.java delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitEntity.java delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitExpOrb.java delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitItem.java delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitPainting.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/BlockWorldVector.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/BlockWorldVector2D.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/LocalEntity.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/LocalPlayer.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/LocalWorld.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/Location.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/VectorFace.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/WorldEditOperation.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector2D.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/WorldVectorFace.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/internal/LocalWorldAdapter.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index 25f02915b..5bfba060a 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -20,32 +20,31 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.util.StringUtil; -import com.sk89q.worldedit.LocalPlayer; -import com.sk89q.worldedit.LocalWorld; -import com.sk89q.worldedit.ServerInterface; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.entity.BaseEntity; +import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; +import com.sk89q.worldedit.world.World; import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import javax.annotation.Nullable; import java.util.UUID; -public class BukkitPlayer extends LocalPlayer { +import javax.annotation.Nullable; + +public class BukkitPlayer extends AbstractPlayerActor { private Player player; private WorldEditPlugin plugin; - public BukkitPlayer(WorldEditPlugin plugin, ServerInterface server, Player player) { + public BukkitPlayer(WorldEditPlugin plugin, Player player) { this.plugin = plugin; this.player = player; } @@ -73,9 +72,9 @@ public class BukkitPlayer extends LocalPlayer { } @Override - public WorldVector getPosition() { + public com.sk89q.worldedit.util.Location getPosition() { Location loc = player.getLocation(); - return new WorldVector(BukkitUtil.getLocalWorld(loc.getWorld()), + return new com.sk89q.worldedit.util.Location(BukkitUtil.getWorld(loc.getWorld()), loc.getX(), loc.getY(), loc.getZ()); } @@ -146,8 +145,8 @@ public class BukkitPlayer extends LocalPlayer { } @Override - public LocalWorld getWorld() { - return BukkitUtil.getLocalWorld(player.getWorld()); + public World getWorld() { + return BukkitUtil.getWorld(player.getWorld()); } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index acacad5e8..1f392fdc3 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -19,14 +19,17 @@ package com.sk89q.worldedit.bukkit; -import com.sk89q.worldedit.WorldVector; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import com.sk89q.worldedit.extent.inventory.*; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.ItemType; +import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.extent.inventory.BlockBagException; +import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; +import com.sk89q.worldedit.extent.inventory.OutOfSpaceException; +import com.sk89q.worldedit.util.Location; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; public class BukkitPlayerBlockBag extends BlockBag { @@ -191,11 +194,11 @@ public class BukkitPlayerBlockBag extends BlockBag { } @Override - public void addSourcePosition(WorldVector pos) { + public void addSourcePosition(Location pos) { } @Override - public void addSingleSourcePosition(WorldVector pos) { + public void addSingleSourcePosition(Location pos) { } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java index 3681aff06..91db498b7 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java @@ -22,8 +22,6 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.bukkit.util.CommandInfo; import com.sk89q.bukkit.util.CommandRegistration; import com.sk89q.worldedit.LocalConfiguration; -import com.sk89q.worldedit.LocalWorld; -import com.sk89q.worldedit.ServerInterface; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Capability; @@ -38,14 +36,15 @@ import org.bukkit.Server; import org.bukkit.World; import org.bukkit.entity.EntityType; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; import java.util.EnumMap; import java.util.List; import java.util.Map; -public class BukkitServerInterface extends ServerInterface implements MultiUserPlatform { +import javax.annotation.Nullable; + +public class BukkitServerInterface implements MultiUserPlatform { public Server server; public WorldEditPlugin plugin; private CommandRegistration dynamicCommands; @@ -86,12 +85,12 @@ public class BukkitServerInterface extends ServerInterface implements MultiUserP } @Override - public List getWorlds() { + public List getWorlds() { List worlds = server.getWorlds(); - List ret = new ArrayList(worlds.size()); + List ret = new ArrayList<>(worlds.size()); for (World world : worlds) { - ret.add(BukkitUtil.getLocalWorld(world)); + ret.add(BukkitUtil.getWorld(world)); } return ret; @@ -104,7 +103,7 @@ public class BukkitServerInterface extends ServerInterface implements MultiUserP return player; } else { org.bukkit.entity.Player bukkitPlayer = server.getPlayerExact(player.getName()); - return bukkitPlayer != null ? new BukkitPlayer(plugin, this, bukkitPlayer) : null; + return bukkitPlayer != null ? new BukkitPlayer(plugin, bukkitPlayer) : null; } } @@ -181,7 +180,7 @@ public class BukkitServerInterface extends ServerInterface implements MultiUserP public Collection getConnectedUsers() { List users = new ArrayList(); for (org.bukkit.entity.Player player : Bukkit.getServer().getOnlinePlayers()) { - users.add(new BukkitPlayer(plugin, this, player)); + users.add(new BukkitPlayer(plugin, player)); } return users; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index d4cb72a6d..c0f7c5852 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -19,45 +19,34 @@ package com.sk89q.worldedit.bukkit; -import java.util.List; - +import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.NotABlockException; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.ItemID; import com.sk89q.worldedit.blocks.SkullBlock; +import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.util.Location; import org.bukkit.DyeColor; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.entity.Entity; -import org.bukkit.entity.ExperienceOrb; -import org.bukkit.entity.Item; -import org.bukkit.entity.Painting; import org.bukkit.entity.Player; - -import com.sk89q.worldedit.BlockVector; -import com.sk89q.worldedit.BlockWorldVector; -import com.sk89q.worldedit.LocalWorld; -import com.sk89q.worldedit.Location; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldVector; -import com.sk89q.worldedit.bukkit.entity.BukkitEntity; -import com.sk89q.worldedit.bukkit.entity.BukkitExpOrb; -import com.sk89q.worldedit.bukkit.entity.BukkitItem; -import com.sk89q.worldedit.bukkit.entity.BukkitPainting; import org.bukkit.inventory.ItemStack; import org.bukkit.material.Dye; +import java.util.List; + public final class BukkitUtil { private BukkitUtil() { } - public static LocalWorld getLocalWorld(World w) { + public static com.sk89q.worldedit.world.World getWorld(World w) { return new BukkitWorld(w); } @@ -69,17 +58,13 @@ public final class BukkitUtil { return new BlockVector(face.getModX(), face.getModY(), face.getModZ()); } - public static BlockWorldVector toWorldVector(Block block) { - return new BlockWorldVector(getLocalWorld(block.getWorld()), block.getX(), block.getY(), block.getZ()); - } - public static Vector toVector(org.bukkit.Location loc) { return new Vector(loc.getX(), loc.getY(), loc.getZ()); } public static Location toLocation(org.bukkit.Location loc) { return new Location( - getLocalWorld(loc.getWorld()), + getWorld(loc.getWorld()), new Vector(loc.getX(), loc.getY(), loc.getZ()), loc.getYaw(), loc.getPitch() ); @@ -89,10 +74,6 @@ public final class BukkitUtil { return new Vector(vector.getX(), vector.getY(), vector.getZ()); } - public static org.bukkit.Location toLocation(WorldVector pt) { - return new org.bukkit.Location(toWorld(pt), pt.getX(), pt.getY(), pt.getZ()); - } - public static org.bukkit.Location toLocation(World world, Vector pt) { return new org.bukkit.Location(world, pt.getX(), pt.getY(), pt.getZ()); } @@ -116,14 +97,6 @@ public final class BukkitUtil { return players.get(0); } - public static Block toBlock(BlockWorldVector pt) { - return toWorld(pt).getBlockAt(toLocation(pt)); - } - - public static World toWorld(WorldVector pt) { - return ((BukkitWorld) pt.getWorld()).getWorld(); - } - /** * Bukkit's Location class has serious problems with floating point * precision. @@ -139,33 +112,19 @@ public final class BukkitUtil { public static final double EQUALS_PRECISION = 0.0001; public static org.bukkit.Location toLocation(Location location) { - Vector pt = location.getPosition(); + Vector pt = location.toVector(); return new org.bukkit.Location( - toWorld(location.getWorld()), + toWorld(location.getExtent()), pt.getX(), pt.getY(), pt.getZ(), location.getYaw(), location.getPitch() ); } - public static World toWorld(final LocalWorld world) { + public static World toWorld(final Extent world) { return ((BukkitWorld) world).getWorld(); } - public static BukkitEntity toLocalEntity(Entity e) { - switch (e.getType()) { - case EXPERIENCE_ORB: - return new BukkitExpOrb(toLocation(e.getLocation()), e.getUniqueId(), ((ExperienceOrb)e).getExperience()); - case PAINTING: - Painting paint = (Painting) e; - return new BukkitPainting(toLocation(e.getLocation()), paint.getArt(), paint.getFacing(), e.getUniqueId()); - case DROPPED_ITEM: - return new BukkitItem(toLocation(e.getLocation()), ((Item)e).getItemStack(), e.getUniqueId()); - default: - return new BukkitEntity(toLocation(e.getLocation()), e.getType(), e.getUniqueId()); - } - } - - public static BaseBlock toBlock(LocalWorld world, ItemStack itemStack) throws WorldEditException { + public static BaseBlock toBlock(com.sk89q.worldedit.world.World world, ItemStack itemStack) throws WorldEditException { final int typeId = itemStack.getTypeId(); switch (typeId) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index fba678660..4c9fc09e5 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -19,9 +19,10 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEdit; @@ -33,6 +34,7 @@ import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.TreeGenerator; +import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.registry.WorldData; import org.bukkit.Effect; @@ -48,7 +50,6 @@ import org.bukkit.inventory.DoubleChestInventory; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import javax.annotation.Nullable; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.EnumMap; @@ -58,13 +59,13 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; -public class BukkitWorld extends LocalWorld { +public class BukkitWorld extends AbstractWorld { private static final Logger logger = WorldEdit.logger; - private static final Map effects = new HashMap(); + private static final Map effects = new HashMap<>(); static { for (Effect effect : Effect.values()) { effects.put(effect.getId(), effect); @@ -80,7 +81,7 @@ public class BukkitWorld extends LocalWorld { */ @SuppressWarnings("unchecked") public BukkitWorld(World world) { - this.worldRef = new WeakReference(world); + this.worldRef = new WeakReference<>(world); } @Override @@ -88,7 +89,7 @@ public class BukkitWorld extends LocalWorld { World world = getWorld(); List ents = world.getEntities(); - List entities = new ArrayList(); + List entities = new ArrayList<>(); for (Entity ent : ents) { if (region.contains(BukkitUtil.toVector(ent.getLocation()))) { entities.add(BukkitAdapter.adapt(ent)); @@ -99,7 +100,7 @@ public class BukkitWorld extends LocalWorld { @Override public List getEntities() { - List list = new ArrayList(); + List list = new ArrayList<>(); for (Entity entity : getWorld().getEntities()) { list.add(BukkitAdapter.adapt(entity)); } @@ -282,7 +283,7 @@ public class BukkitWorld extends LocalWorld { * An EnumMap that stores which WorldEdit TreeTypes apply to which Bukkit TreeTypes */ private static final EnumMap treeTypeMapping = - new EnumMap(TreeGenerator.TreeType.class); + new EnumMap<>(TreeGenerator.TreeType.class); static { for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditAPI.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditAPI.java deleted file mode 100644 index 85a38ac9b..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditAPI.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit; - -import org.bukkit.entity.Player; -import com.sk89q.worldedit.LocalSession; - -/** - * @deprecated use the regular API - */ -@Deprecated -public class WorldEditAPI { - - private WorldEditPlugin plugin; - - public WorldEditAPI(WorldEditPlugin plugin) { - this.plugin = plugin; - } - - /** - * Get the session for a player. - * - * @param player the player - * @return a session - */ - public LocalSession getSession(Player player) { - return plugin.getWorldEdit().getSession( - new BukkitPlayer(plugin, plugin.getServerInterface(), player)); - } - -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java index bd9a92b09..b5ab6c75a 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java @@ -22,10 +22,9 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.util.StringUtil; -import com.sk89q.worldedit.LocalPlayer; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldVector; -import com.sk89q.worldedit.internal.LocalWorldAdapter; +import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; import org.bukkit.block.Block; import org.bukkit.event.Event.Result; @@ -120,18 +119,17 @@ public class WorldEditListener implements Listener { return; // TODO api needs to be able to get either hand depending on event // for now just ignore all off hand interacts } - } catch (NoSuchMethodError ignored) { - } catch (NoSuchFieldError ignored) { + } catch (NoSuchMethodError | NoSuchFieldError ignored) { } - final LocalPlayer player = plugin.wrapPlayer(event.getPlayer()); + final Player player = plugin.wrapPlayer(event.getPlayer()); final World world = player.getWorld(); final WorldEdit we = plugin.getWorldEdit(); Action action = event.getAction(); if (action == Action.LEFT_CLICK_BLOCK) { final Block clickedBlock = event.getClickedBlock(); - final WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), clickedBlock.getX(), clickedBlock.getY(), clickedBlock.getZ()); + final Location pos = new Location(world, clickedBlock.getX(), clickedBlock.getY(), clickedBlock.getZ()); if (we.handleBlockLeftClick(player, pos)) { event.setCancelled(true); @@ -150,8 +148,7 @@ public class WorldEditListener implements Listener { } else if (action == Action.RIGHT_CLICK_BLOCK) { final Block clickedBlock = event.getClickedBlock(); - final WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), clickedBlock.getX(), - clickedBlock.getY(), clickedBlock.getZ()); + final Location pos = new Location(world, clickedBlock.getX(), clickedBlock.getY(), clickedBlock.getZ()); if (we.handleBlockRightClick(player, pos)) { event.setCancelled(true); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index a432bcc4c..cb79b34c1 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -19,16 +19,15 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Joiner; import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.wepif.PermissionsResolverManager; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.IncompleteRegionException; -import com.sk89q.worldedit.LocalPlayer; import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.ServerInterface; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldEditOperation; import com.sk89q.worldedit.bukkit.adapter.AdapterLoadException; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.bukkit.adapter.BukkitImplLoader; @@ -49,7 +48,6 @@ import com.sk89q.worldedit.regions.Polygonal2DRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.util.Java7Detector; - import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -57,7 +55,6 @@ import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import javax.annotation.Nullable; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -69,12 +66,11 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.ZipEntry; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Plugin for Bukkit. */ -@SuppressWarnings("deprecation") public class WorldEditPlugin extends JavaPlugin implements TabCompleter { private static final Logger log = Logger.getLogger(WorldEditPlugin.class.getCanonicalName()); @@ -83,7 +79,6 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { private BukkitImplAdapter bukkitAdapter; private BukkitServerInterface server; - private final WorldEditAPI api = new WorldEditAPI(this); private BukkitConfiguration config; /** @@ -279,8 +274,8 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { * @return a session */ public EditSession createEditSession(Player player) { - LocalPlayer wePlayer = wrapPlayer(player); - LocalSession session = WorldEdit.getInstance().getSession(wePlayer); + com.sk89q.worldedit.entity.Player wePlayer = wrapPlayer(player); + LocalSession session = WorldEdit.getInstance().getSessionManager().get(wePlayer); BlockBag blockBag = session.getBlockBag(wePlayer); EditSession editSession = WorldEdit.getInstance().getEditSessionFactory() @@ -297,8 +292,8 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { * @param editSession an edit session */ public void remember(Player player, EditSession editSession) { - LocalPlayer wePlayer = wrapPlayer(player); - LocalSession session = WorldEdit.getInstance().getSession(wePlayer); + com.sk89q.worldedit.entity.Player wePlayer = wrapPlayer(player); + LocalSession session = WorldEdit.getInstance().getSessionManager().get(wePlayer); session.remember(editSession); editSession.flushQueue(); @@ -306,38 +301,6 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { WorldEdit.getInstance().flushBlockBag(wePlayer, editSession); } - /** - * Wrap an operation into an EditSession. - * - * @param player a player - * @param op the operation - * @throws Throwable on any error - * @deprecated use the regular API - */ - @Deprecated - public void perform(Player player, WorldEditOperation op) throws Throwable { - LocalPlayer wePlayer = wrapPlayer(player); - LocalSession session = WorldEdit.getInstance().getSession(wePlayer); - - EditSession editSession = createEditSession(player); - try { - op.run(session, wePlayer, editSession); - } finally { - remember(player, editSession); - } - } - - /** - * Get the API. - * - * @return the API - * @deprecated use the regular API - */ - @Deprecated - public WorldEditAPI getAPI() { - return api; - } - /** * Returns the configuration used by WorldEdit. * @@ -357,13 +320,13 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { } /** - * Used to wrap a Bukkit Player as a LocalPlayer. + * Used to wrap a Bukkit Player as a WorldEdit Player. * * @param player a player * @return a wrapped player */ public BukkitPlayer wrapPlayer(Player player) { - return new BukkitPlayer(this, this.server, player); + return new BukkitPlayer(this, player); } public Actor wrapCommandSender(CommandSender sender) { @@ -374,15 +337,6 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { return new BukkitCommandSender(this, sender); } - /** - * Get the server interface. - * - * @return the server interface - */ - public ServerInterface getServerInterface() { - return server; - } - BukkitServerInterface getInternalPlatform() { return server; } @@ -411,7 +365,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { } LocalSession session = WorldEdit.getInstance().getSession(wrapPlayer(player)); - RegionSelector selector = session.getRegionSelector(BukkitUtil.getLocalWorld(player.getWorld())); + RegionSelector selector = session.getRegionSelector(BukkitUtil.getWorld(player.getWorld())); try { Region region = selector.getRegion(); @@ -450,7 +404,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { LocalSession session = WorldEdit.getInstance().getSession(wrapPlayer(player)); RegionSelector sel = selection.getRegionSelector(); - session.setRegionSelector(BukkitUtil.getLocalWorld(player.getWorld()), sel); + session.setRegionSelector(BukkitUtil.getWorld(player.getWorld()), sel); session.dispatchCUISelection(wrapPlayer(player)); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitEntity.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitEntity.java deleted file mode 100644 index e138b5cd1..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitEntity.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit.entity; - -import com.sk89q.worldedit.LocalEntity; -import com.sk89q.worldedit.Location; -import com.sk89q.worldedit.bukkit.BukkitUtil; -import org.bukkit.entity.EntityType; - -import java.util.UUID; - -public class BukkitEntity extends LocalEntity { - - private final EntityType type; - private final UUID entityId; - - public BukkitEntity(Location loc, EntityType type, UUID entityId) { - super(loc); - this.type = type; - this.entityId = entityId; - } - - public UUID getEntityId() { - return entityId; - } - - @Override - public boolean spawn(Location weLoc) { - org.bukkit.Location loc = BukkitUtil.toLocation(weLoc); - return loc.getWorld().spawn(loc, type.getEntityClass()) != null; - } - -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitExpOrb.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitExpOrb.java deleted file mode 100644 index 1b57f8143..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitExpOrb.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit.entity; - -import com.sk89q.worldedit.Location; -import com.sk89q.worldedit.bukkit.BukkitUtil; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.ExperienceOrb; - -import java.util.UUID; - -public class BukkitExpOrb extends BukkitEntity { - - private final int amount; - - public BukkitExpOrb(Location loc, UUID entityId, int amount) { - super(loc, EntityType.EXPERIENCE_ORB, entityId); - this.amount = amount; - } - - @Override - public boolean spawn(Location weLoc) { - org.bukkit.Location loc = BukkitUtil.toLocation(weLoc); - ExperienceOrb orb = loc.getWorld().spawn(loc, ExperienceOrb.class); - if (orb != null) { - orb.setExperience(amount); - return true; - } - return false; - } - -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitItem.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitItem.java deleted file mode 100644 index 01ea7ad50..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitItem.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit.entity; - -import com.sk89q.worldedit.Location; -import com.sk89q.worldedit.bukkit.BukkitUtil; -import org.bukkit.entity.EntityType; -import org.bukkit.inventory.ItemStack; - -import java.util.UUID; - -public class BukkitItem extends BukkitEntity { - - private final ItemStack stack; - public BukkitItem(Location loc, ItemStack stack, UUID entityId) { - super(loc, EntityType.DROPPED_ITEM, entityId); - this.stack = stack; - } - - @Override - public boolean spawn(Location weLoc) { - org.bukkit.Location loc = BukkitUtil.toLocation(weLoc); - return loc.getWorld().dropItem(loc, stack) != null; - } - -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitPainting.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitPainting.java deleted file mode 100644 index 57f7eb4f5..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/entity/BukkitPainting.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit.entity; - -import com.sk89q.worldedit.Location; -import com.sk89q.worldedit.bukkit.BukkitUtil; -import org.bukkit.Art; -import org.bukkit.Bukkit; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Painting; - -import java.util.ArrayDeque; -import java.util.Deque; -import java.util.UUID; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class BukkitPainting extends BukkitEntity { - - private static final Logger log = Logger.getLogger(BukkitPainting.class.getCanonicalName()); - - private static int spawnTask = -1; - private static final Deque spawnQueue = new ArrayDeque(); - - private class QueuedPaintingSpawn { - private final Location weLoc; - - private QueuedPaintingSpawn(Location weLoc) { - this.weLoc = weLoc; - } - - public void spawn() { - spawnRaw(weLoc); - } - } - - private static class PaintingSpawnRunnable implements Runnable { - @Override - public void run() { - synchronized (spawnQueue) { - QueuedPaintingSpawn spawn; - while ((spawn = spawnQueue.poll()) != null) { - try { - spawn.spawn(); - } catch (Throwable t) { - log.log(Level.WARNING, "Failed to spawn painting", t); - continue; - } - } - spawnTask = -1; - } - } - } - - private final Art art; - private final BlockFace facingDirection; - public BukkitPainting(Location loc, Art art, BlockFace facingDirection, UUID entityId) { - super(loc, EntityType.PAINTING, entityId); - this.art = art; - this.facingDirection = facingDirection; - } - - /** - * Queue the painting to be spawned at the specified location. - * This operation is delayed so that the block changes that may be applied can be applied before the painting spawn is attempted. - * - * @param weLoc The WorldEdit location - * @return Whether the spawn as successful - */ - @Override - public boolean spawn(Location weLoc) { - synchronized (spawnQueue) { - spawnQueue.add(new QueuedPaintingSpawn(weLoc)); - if (spawnTask == -1) { - spawnTask = Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getServer().getPluginManager().getPlugin("WorldEdit"), new PaintingSpawnRunnable(), 1L); - } - } - return true; - } - - public boolean spawnRaw(Location weLoc) { - org.bukkit.Location loc = BukkitUtil.toLocation(weLoc); - Painting paint = loc.getWorld().spawn(loc, Painting.class); - if (paint != null) { - paint.setFacingDirection(facingDirection, true); - paint.setArt(art, true); - return true; - } - return false; - } - -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java index 5ecd74956..9f1783dde 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java @@ -49,7 +49,7 @@ public class CuboidSelection extends RegionSelection { } // Create new selector - CuboidRegionSelector sel = new CuboidRegionSelector(BukkitUtil.getLocalWorld(world)); + CuboidRegionSelector sel = new CuboidRegionSelector(BukkitUtil.getWorld(world)); // set up selector sel.selectPrimary(pt1, PermissiveSelectorLimits.getInstance()); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CylinderSelection.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CylinderSelection.java index c7dee7c79..2a5282146 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CylinderSelection.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CylinderSelection.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.regions.selector.CylinderRegionSelector; import org.bukkit.World; import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.bukkit.BukkitUtil; import com.sk89q.worldedit.regions.CylinderRegion; import com.sk89q.worldedit.regions.RegionSelector; @@ -42,7 +41,7 @@ public class CylinderSelection extends RegionSelection { public CylinderSelection(World world, BlockVector2D center, BlockVector2D radius, int minY, int maxY) { super(world); - LocalWorld lWorld = BukkitUtil.getLocalWorld(world); + com.sk89q.worldedit.world.World lWorld = BukkitUtil.getWorld(world); // Validate input minY = Math.min(Math.max(0, minY), world.getMaxHeight()); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java index 387bcf6de..a7034a842 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.bukkit.selections; import java.util.Collections; import java.util.List; -import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector; import org.bukkit.World; import com.sk89q.worldedit.BlockVector2D; @@ -40,7 +39,7 @@ public class Polygonal2DSelection extends RegionSelection { public Polygonal2DSelection(World world, List points, int minY, int maxY) { super(world); - LocalWorld lWorld = BukkitUtil.getLocalWorld(world); + com.sk89q.worldedit.world.World lWorld = BukkitUtil.getWorld(world); // Validate input minY = Math.min(Math.max(0, minY), world.getMaxHeight()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockWorldVector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockWorldVector.java deleted file mode 100644 index 4fcc70624..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockWorldVector.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -/** - * @deprecated Replace all uses of {@link WorldVector}s with {@link Location}s - */ -@SuppressWarnings("deprecation") -@Deprecated -public class BlockWorldVector extends WorldVector { - - /** - * Construct an instance from another instance. - * - * @param position the position to copy - */ - public BlockWorldVector(WorldVector position) { - super(position.getWorld(), position); - } - - /** - * Construct an instance from another instance. - * - * @param world the world - * @param position the position to copy - */ - public BlockWorldVector(LocalWorld world, Vector position) { - super(world, position); - } - - /** - * Construct a new instance. - * - * @param world another instance - * @param x the X coordinate - * @param y the Y coordinate - * @param z the Z coordinate - */ - public BlockWorldVector(WorldVector world, int x, int y, int z) { - super(world.getWorld(), x, y, z); - } - - /** - * Construct a new instance. - * - * @param world another instance - * @param v the other vector - */ - public BlockWorldVector(WorldVector world, Vector v) { - super(world.getWorld(), v.getX(), v.getY(), v.getZ()); - } - - /** - * Construct a new instance. - * - * @param world a world - * @param x the X coordinate - * @param y the Y coordinate - * @param z the Z coordinate - */ - public BlockWorldVector(LocalWorld world, int x, int y, int z) { - super(world, x, y, z); - } - - /** - * Construct a new instance. - * - * @param world a world - * @param x the X coordinate - * @param y the Y coordinate - * @param z the Z coordinate - */ - public BlockWorldVector(LocalWorld world, float x, float y, float z) { - super(world, x, y, z); - } - - /** - * Construct a new instance. - * - * @param world a world - * @param x the X coordinate - * @param y the Y coordinate - * @param z the Z coordinate - */ - public BlockWorldVector(LocalWorld world, double x, double y, double z) { - super(world, x, y, z); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof Vector)) { - return false; - } - Vector other = (Vector) obj; - return (int) other.getX() == (int) this.x && (int) other.getY() == (int) this.y - && (int) other.getZ() == (int) this.z; - - } - - @Override - public int hashCode() { - return (Integer.valueOf((int) x).hashCode() << 19) ^ - (Integer.valueOf((int) y).hashCode() << 12) ^ - Integer.valueOf((int) z).hashCode(); - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockWorldVector2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockWorldVector2D.java deleted file mode 100644 index 70289f8f2..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockWorldVector2D.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -/** - * @deprecated Replace all uses of {@link WorldVector}s with {@link Location}s - */ -@SuppressWarnings("deprecation") -@Deprecated -public class BlockWorldVector2D extends WorldVector2D { - - /** - * Construct a new instance. - * - * @param world the world - * @param x the X coordinate - * @param z the Z coordinate - */ - public BlockWorldVector2D(LocalWorld world, double x, double z) { - super(world, x, z); - } - - /** - * Construct a new instance. - * - * @param world the world - * @param x the X coordinate - * @param z the Z coordinate - */ - public BlockWorldVector2D(LocalWorld world, float x, float z) { - super(world, x, z); - } - - /** - * Construct a new instance. - * - * @param world the world - * @param x the X coordinate - * @param z the Z coordinate - */ - public BlockWorldVector2D(LocalWorld world, int x, int z) { - super(world, x, z); - } - - /** - * Construct a new instance. - * - * @param world the world - * @param position a position - */ - public BlockWorldVector2D(LocalWorld world, Vector2D position) { - super(world, position); - } - - /** - * Construct a new instance with X and Z set to (0, 0). - * - * @param world the world - */ - public BlockWorldVector2D(LocalWorld world) { - super(world); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof WorldVector2D)) { - return false; - } - WorldVector2D other = (WorldVector2D) obj; - return other.getWorld().equals(world) - && (int) other.getX() == (int) this.x - && (int) other.getZ() == (int) this.z; - - } - - @Override - public int hashCode() { - int result = super.hashCode(); - long temp; - result = 31 * result + world.hashCode(); - temp = Double.doubleToLongBits(x); - result = 31 * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(z); - result = 31 * result + (int) (temp ^ (temp >>> 32)); - return result; - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java index 17c5149d3..5acdccd48 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.command.ClipboardCommands; import com.sk89q.worldedit.command.SchematicCommands; +import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.function.operation.ForwardExtentCopy; @@ -74,7 +75,7 @@ public class CuboidClipboard { private Vector offset; private Vector origin; private Vector size; - private List entities = new ArrayList(); + private List entities = new ArrayList<>(); /** * Constructs the clipboard. @@ -448,11 +449,14 @@ public class CuboidClipboard { * @param newOrigin the new origin * @return a list of entities that were pasted */ - public LocalEntity[] pasteEntities(Vector newOrigin) { - LocalEntity[] entities = new LocalEntity[this.entities.size()]; + public Entity[] pasteEntities(Vector newOrigin) { + Entity[] entities = new Entity[this.entities.size()]; for (int i = 0; i < this.entities.size(); ++i) { CopiedEntity copied = this.entities.get(i); - if (copied.entity.spawn(copied.entity.getPosition().setPosition(copied.relativePosition.add(newOrigin)))) { + if (copied.entity.getExtent().createEntity( + copied.entity.getLocation().setPosition(copied.relativePosition.add(newOrigin)), + copied.entity.getState() + ) != null) { entities[i] = copied.entity; } } @@ -464,7 +468,7 @@ public class CuboidClipboard { * * @param entity the entity */ - public void storeEntity(LocalEntity entity) { + public void storeEntity(Entity entity) { this.entities.add(new CopiedEntity(entity)); } @@ -683,12 +687,12 @@ public class CuboidClipboard { * Stores a copied entity. */ private class CopiedEntity { - private final LocalEntity entity; + private final Entity entity; private final Vector relativePosition; - private CopiedEntity(LocalEntity entity) { + private CopiedEntity(Entity entity) { this.entity = entity; - this.relativePosition = entity.getPosition().getPosition().subtract(getOrigin()); + this.relativePosition = entity.getLocation().toVector().subtract(getOrigin()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 8d91548fc..e24caa27d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -132,31 +132,6 @@ public class EditSession implements Extent { private Mask oldMask; - /** - * Create a new instance. - * - * @param world a world - * @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit - * @deprecated use {@link WorldEdit#getEditSessionFactory()} to create {@link EditSession}s - */ - @Deprecated - public EditSession(LocalWorld world, int maxBlocks) { - this(world, maxBlocks, null); - } - - /** - * Create a new instance. - * - * @param world a world - * @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit - * @param blockBag the block bag to set, or null to use none - * @deprecated use {@link WorldEdit#getEditSessionFactory()} to create {@link EditSession}s - */ - @Deprecated - public EditSession(LocalWorld world, int maxBlocks, @Nullable BlockBag blockBag) { - this(WorldEdit.getInstance().getEventBus(), world, maxBlocks, blockBag, new EditSessionEvent(world, null, maxBlocks, null)); - } - /** * Construct the object with a maximum number of blocks and a block bag. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java index b5ce151b9..8af5071c6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java @@ -133,66 +133,6 @@ public class EditSessionFactory { throw new RuntimeException("Method needs to be implemented"); } - // ------------------------------------------------------------------------ - // Methods being deprecated - // ------------------------------------------------------------------------ - - /** - * Construct an edit session. - * - * @param world the world - * @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit - * @return an instance - * @deprecated We are replacing {@link LocalWorld} with {@link World}, so use {@link #getEditSession(World, int)} instead - */ - @Deprecated - public EditSession getEditSession(LocalWorld world, int maxBlocks) { - return getEditSession((World) world, maxBlocks); - } - - /** - * Construct an edit session. - * - * @param world the world - * @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit - * @param player the player that the {@link EditSession} is for - * @return an instance - * @deprecated We are replacing {@link LocalWorld} with {@link World}, so use {@link #getEditSession(World, int, Player)} instead - */ - @Deprecated - public EditSession getEditSession(LocalWorld world, int maxBlocks, LocalPlayer player) { - return getEditSession((World) world, maxBlocks, player); - } - - /** - * Construct an edit session. - * - * @param world the world - * @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit - * @param blockBag an optional {@link BlockBag} to use, otherwise null - * @return an instance - * @deprecated We are replacing {@link LocalWorld} with {@link World}, so use {@link #getEditSession(World, int, BlockBag)} instead - */ - @Deprecated - public EditSession getEditSession(LocalWorld world, int maxBlocks, BlockBag blockBag) { - return getEditSession((World) world, maxBlocks, blockBag); - } - - /** - * Construct an edit session. - * - * @param world the world - * @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit - * @param blockBag an optional {@link BlockBag} to use, otherwise null - * @param player the player that the {@link EditSession} is for - * @return an instance - * @deprecated We are replacing {@link LocalWorld} with {@link World}, so use {@link #getEditSession(World, int, BlockBag, Player)} instead - */ - @Deprecated - public EditSession getEditSession(LocalWorld world, int maxBlocks, BlockBag blockBag, LocalPlayer player) { - return getEditSession((World) world, maxBlocks, blockBag, player); - } - /** * Internal factory for {@link EditSession}s. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalEntity.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalEntity.java deleted file mode 100644 index dcddfde2a..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalEntity.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -import com.sk89q.worldedit.entity.BaseEntity; -import com.sk89q.worldedit.entity.Entity; - -/** - * Holds an entity. - * - * @deprecated replaced with the new entity API using {@link Entity} and {@link BaseEntity} - */ -@Deprecated -public abstract class LocalEntity { - - private final Location position; - - protected LocalEntity(Location position) { - this.position = position; - } - - public Location getPosition() { - return position; - } - - public boolean spawn() { - return spawn(getPosition()); - } - - public abstract boolean spawn(Location loc); - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalPlayer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalPlayer.java deleted file mode 100644 index b7df2ed9b..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalPlayer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; -import com.sk89q.worldedit.extension.platform.Actor; - -/** - * Represents a player that uses WorldEdit. - * - * @deprecated use {@link Actor} (or {@link Player}, etc.) instead (and {@link AbstractPlayerActor} to extend) - */ -@Deprecated -public abstract class LocalPlayer extends AbstractPlayerActor { - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index d59811fb7..1d7a0e7fb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jchronic.Chronic; import com.sk89q.jchronic.Options; import com.sk89q.jchronic.utils.Span; @@ -32,7 +34,6 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.function.mask.Mask; -import com.sk89q.worldedit.function.mask.Masks; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.internal.cui.CUIRegion; import com.sk89q.worldedit.internal.cui.SelectionShapeEvent; @@ -45,7 +46,6 @@ import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.snapshot.Snapshot; -import javax.annotation.Nullable; import java.util.Calendar; import java.util.HashMap; import java.util.LinkedList; @@ -53,7 +53,7 @@ import java.util.Map; import java.util.TimeZone; import java.util.concurrent.atomic.AtomicBoolean; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Stores session information. @@ -70,13 +70,13 @@ public class LocalSession { // Session related private transient RegionSelector selector = new CuboidRegionSelector(); private transient boolean placeAtPos1 = false; - private transient LinkedList history = new LinkedList(); + private transient LinkedList history = new LinkedList<>(); private transient int historyPointer = 0; private transient ClipboardHolder clipboard; private transient boolean toolControl = true; private transient boolean superPickaxe = false; private transient BlockTool pickaxeMode = new SinglePickaxe(); - private transient Map tools = new HashMap(); + private transient Map tools = new HashMap<>(); private transient int maxBlocksChanged = -1; private transient boolean useInventory; private transient Snapshot snapshot; @@ -204,17 +204,6 @@ public class LocalSession { historyPointer = history.size(); } - /** - * Performs an undo. - * - * @param newBlockBag a new block bag - * @param player the player - * @return whether anything was undone - */ - public EditSession undo(@Nullable BlockBag newBlockBag, LocalPlayer player) { - return undo(newBlockBag, (Player) player); - } - /** * Performs an undo. * @@ -239,17 +228,6 @@ public class LocalSession { } } - /** - * Performs a redo - * - * @param newBlockBag a new block bag - * @param player the player - * @return whether anything was redone - */ - public EditSession redo(@Nullable BlockBag newBlockBag, LocalPlayer player) { - return redo(newBlockBag, (Player) player); - } - /** * Performs a redo * @@ -293,14 +271,6 @@ public class LocalSession { setDirty(); } - /** - * @deprecated Use {@link #getRegionSelector(World)} - */ - @Deprecated - public RegionSelector getRegionSelector(LocalWorld world) { - return getRegionSelector((World) world); - } - /** * Get the region selector for defining the selection. If the selection * was defined for a different world, the old selection will be discarded. @@ -317,22 +287,6 @@ public class LocalSession { return selector; } - /** - * @deprecated use {@link #getRegionSelector(World)} - */ - @Deprecated - public RegionSelector getRegionSelector() { - return selector; - } - - /** - * @deprecated use {@link #setRegionSelector(World, RegionSelector)} - */ - @Deprecated - public void setRegionSelector(LocalWorld world, RegionSelector selector) { - setRegionSelector((World) world, selector); - } - /** * Set the region selector. * @@ -346,24 +300,6 @@ public class LocalSession { this.selector = selector; } - /** - * Returns true if the region is fully defined. - * - * @return true if a region selection is defined - */ - @Deprecated - public boolean isRegionDefined() { - return selector.isDefined(); - } - - /** - * @deprecated use {@link #isSelectionDefined(World)} - */ - @Deprecated - public boolean isSelectionDefined(LocalWorld world) { - return isSelectionDefined((World) world); - } - /** * Returns true if the region is fully defined for the specified world. * @@ -378,22 +314,6 @@ public class LocalSession { return selector.isDefined(); } - /** - * @deprecated use {@link #getSelection(World)} - */ - @Deprecated - public Region getRegion() throws IncompleteRegionException { - return selector.getRegion(); - } - - /** - * @deprecated use {@link #getSelection(World)} - */ - @Deprecated - public Region getSelection(LocalWorld world) throws IncompleteRegionException { - return getSelection((World) world); - } - /** * Get the selection region. If you change the region, you should * call learnRegionChanges(). If the selection is defined in @@ -525,7 +445,7 @@ public class LocalSession { public Vector getPlacementPosition(Player player) throws IncompleteRegionException { checkNotNull(player); if (!placeAtPos1) { - return player.getBlockIn(); + return player.getBlockIn().toVector(); } return selector.getPrimaryPosition(); @@ -850,21 +770,12 @@ public class LocalSession { } } - /** - * @deprecated use {@link #createEditSession(Player)} - */ - @Deprecated - public EditSession createEditSession(LocalPlayer player) { - return createEditSession((Player) player); - } - /** * Construct a new edit session. * * @param player the player * @return an edit session */ - @SuppressWarnings("deprecation") public EditSession createEditSession(Player player) { checkNotNull(player); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalWorld.java deleted file mode 100644 index ae1112b95..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalWorld.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.util.TreeGenerator; -import com.sk89q.worldedit.world.AbstractWorld; -import com.sk89q.worldedit.world.World; - -/** - * A legacy abstract implementation of {@link World}. New implementations - * should use {@link AbstractWorld} when possible. - * - * @deprecated Replace with {@link World} wherever appropriate - */ -@Deprecated -public abstract class LocalWorld extends AbstractWorld { - - @Override - public BaseBlock getLazyBlock(Vector position) { - return getBlock(position); - } - - @Override - public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Vector pt) throws MaxChangedBlocksException { - switch (type) { - case BIG_TREE: - return generateBigTree(editSession, pt); - case BIRCH: - return generateBirchTree(editSession, pt); - case REDWOOD: - return generateRedwoodTree(editSession, pt); - case TALL_REDWOOD: - return generateTallRedwoodTree(editSession, pt); - default: - case TREE: - return generateTree(editSession, pt); - } - } - - @Override - public boolean generateTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return false; - } - - @Override - public boolean generateBigTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return false; - } - - @Override - public boolean generateBirchTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return false; - } - - @Override - public boolean generateRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return false; - } - - @Override - public boolean generateTallRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return false; - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/Location.java b/worldedit-core/src/main/java/com/sk89q/worldedit/Location.java deleted file mode 100644 index 6674af51d..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/Location.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -/** - * @deprecated Use {@link com.sk89q.worldedit.util.Location} wherever possible - */ -@Deprecated -public class Location { - private final LocalWorld world; - private final Vector position; - private final float yaw; - private final float pitch; - - public Location(LocalWorld world, Vector position) { - this(world, position, 0, 0); - } - - public Location(LocalWorld world, Vector position, float yaw, float pitch) { - this.world = world; - this.position = position; - this.yaw = yaw; - this.pitch = pitch; - } - - public LocalWorld getWorld() { - return world; - } - - public Vector getPosition() { - return position; - } - - public float getYaw() { - return yaw; - } - - public float getPitch() { - return pitch; - } - - public Location setAngles(float yaw, float pitch) { - return new Location(world, position, yaw, pitch); - } - - public Location setPosition(Vector position) { - return new Location(world, position, yaw, pitch); - } - - public Location add(Vector other) { - return setPosition(position.add(other)); - } - - public Location add(double x, double y, double z) { - return setPosition(position.add(x, y, z)); - } - - public Vector getDirection() { - final double yawRadians = Math.toRadians(yaw); - final double pitchRadians = Math.toRadians(pitch); - final double y = -Math.sin(pitchRadians); - - final double h = Math.cos(pitchRadians); - - final double x = -h * Math.sin(yawRadians); - final double z = h * Math.cos(yawRadians); - - return new Vector(x, y, z); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof Location)) - return false; - - Location location = (Location) obj; - if (!world.equals(location.world)) - return false; - - if (!position.equals(location.position)) - return false; - - return true; - } - - @Override - public int hashCode() { - return position.hashCode() + 19 * world.hashCode(); - } - - @Override - public String toString() { - return "World: " + world.getName() + ", Coordinates: " + position - + ", Yaw: " + yaw + ", Pitch: " + pitch; - } - - public static Location fromLookAt(LocalWorld world, Vector start, Vector lookAt) { - final Vector diff = lookAt.subtract(start); - - return fromEye(world, start, diff); - } - - public static Location fromEye(LocalWorld world, Vector start, Vector eye) { - final double eyeX = eye.getX(); - final double eyeZ = eye.getZ(); - final float yaw = (float) Math.toDegrees(Math.atan2(-eyeX, eyeZ)); - final double length = Math.sqrt(eyeX * eyeX + eyeZ * eyeZ); - final float pitch = (float) Math.toDegrees(Math.atan2(-eye.getY(), length)); - - return new Location(world, start, yaw, pitch); - } -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/VectorFace.java b/worldedit-core/src/main/java/com/sk89q/worldedit/VectorFace.java deleted file mode 100644 index 4b900ec6a..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/VectorFace.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -import com.sk89q.worldedit.util.Direction; - -/** - * Represents the adjacency of one vector to another. Works similarly to - * Bukkit's BlockFace class. - * - * @deprecated to be replaced with {@link Direction} - */ -@Deprecated -public enum VectorFace { - NORTH(-1, 0, 0), - EAST(0, 0, -1), - SOUTH(1, 0, 0), - WEST(0, 0, 1), - UP(0, 1, 0), - DOWN(0, -1, 0), - NORTH_EAST(NORTH, EAST), - NORTH_WEST(NORTH, WEST), - SOUTH_EAST(SOUTH, EAST), - SOUTH_WEST(SOUTH, WEST), - ABOVE_NORTH(UP, NORTH), - BELOW_NORTH(DOWN, NORTH), - ABOVE_SOUTH(UP, SOUTH), - BELOW_SOUTH(DOWN, SOUTH), - ABOVE_WEST(UP, WEST), - BELOW_WEST(DOWN, WEST), - ABOVE_EAST(UP, EAST), - BELOW_EAST(DOWN, EAST), - SELF(0, 0, 0); - - private final int modX; - private final int modY; - private final int modZ; - - private VectorFace(final int modX, final int modY, final int modZ) { - this.modX = modX; - this.modY = modY; - this.modZ = modZ; - } - - private VectorFace(VectorFace face1, VectorFace face2) { - this.modX = face1.getModX() + face2.getModX(); - this.modY = face1.getModY() + face2.getModY(); - this.modZ = face1.getModZ() + face2.getModZ(); - } - - public int getModX() { - return modX; - } - - public int getModZ() { - return modZ; - } - - public int getModY() { - return modY; - } - - public static VectorFace fromMods(int modX2, int modY2, int modZ2) { - for (VectorFace face : values()) { - if (face.getModX() == modX2 - && face.getModY() == modY2 - && face.getModZ() == modZ2) { - return face; - } - } - return VectorFace.SELF; - } -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 6a665127e..7114db65a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -42,6 +42,7 @@ import com.sk89q.worldedit.scripting.CraftScriptEngine; import com.sk89q.worldedit.scripting.RhinoCraftScriptEngine; import com.sk89q.worldedit.session.SessionManager; import com.sk89q.worldedit.session.request.Request; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.util.io.file.FileSelectionAbortedException; import com.sk89q.worldedit.util.io.file.FilenameException; @@ -655,8 +656,8 @@ public class WorldEdit { * @param clicked the clicked block * @return false if you want the action to go through */ - public boolean handleBlockRightClick(Player player, WorldVector clicked) { - BlockInteractEvent event = new BlockInteractEvent(player, clicked.toLocation(), OPEN); + public boolean handleBlockRightClick(Player player, Location clicked) { + BlockInteractEvent event = new BlockInteractEvent(player, clicked, OPEN); getEventBus().post(event); return event.isCancelled(); } @@ -668,8 +669,8 @@ public class WorldEdit { * @param clicked the clicked block * @return false if you want the action to go through */ - public boolean handleBlockLeftClick(Player player, WorldVector clicked) { - BlockInteractEvent event = new BlockInteractEvent(player, clicked.toLocation(), HIT); + public boolean handleBlockLeftClick(Player player, Location clicked) { + BlockInteractEvent event = new BlockInteractEvent(player, clicked, HIT); getEventBus().post(event); return event.isCancelled(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEditOperation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEditOperation.java deleted file mode 100644 index 26628f017..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEditOperation.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -/** - * Represents a WorldEdit operation. - * - * @deprecated This will be removed with no direct replacement. Please use the - * WorldEdit API. - */ -@Deprecated -public abstract class WorldEditOperation { - - public abstract void run(LocalSession session, LocalPlayer player, EditSession editSession) throws Throwable; - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector.java deleted file mode 100644 index db9407b26..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -import com.sk89q.worldedit.internal.LocalWorldAdapter; -import com.sk89q.worldedit.world.World; - -/** - * @deprecated Use {@link com.sk89q.worldedit.util.Location} wherever possible - */ -@Deprecated -public class WorldVector extends Vector { - - private LocalWorld world; - - /** - * Construct the Vector object. - * - * @param world a world - * @param x the X coordinate - * @param y the Y coordinate - * @param z the Z coordinate - */ - public WorldVector(LocalWorld world, double x, double y, double z) { - super(x, y, z); - this.world = world; - } - - /** - * Construct the Vector object. - * - * @param world a world - * @param x the X coordinate - * @param y the Y coordinate - * @param z the Z coordinate - */ - public WorldVector(LocalWorld world, int x, int y, int z) { - super(x, y, z); - this.world = world; - } - - /** - * Construct the Vector object. - * - * @param world a world - * @param x the X coordinate - * @param y the Y coordinate - * @param z the Z coordinate - */ - public WorldVector(LocalWorld world, float x, float y, float z) { - super(x, y, z); - this.world = world; - } - - /** - * Construct the Vector object. - * - * @param world a world - * @param other the position to copy - */ - public WorldVector(LocalWorld world, Vector other) { - super(other); - this.world = world; - } - - /** - * Construct the Vector object. - * - * @param world a world - */ - public WorldVector(LocalWorld world) { - super(); - this.world = world; - } - - /** - * Construct the Vector object. - * - * @param location the location - */ - public WorldVector(com.sk89q.worldedit.util.Location location) { - this(LocalWorldAdapter.adapt((World) location.getExtent()), location.getX(), location.getY(), location.getZ()); - } - - /** - * Get the world. - * - * @return the world - */ - public LocalWorld getWorld() { - return world; - } - - /** - * Get a block point from a point. - * - * @param world a world - * @param x the X coordinate - * @param y the Y coordinate - * @param z the Z coordinate - * @return point - */ - public static WorldVector toBlockPoint(LocalWorld world, double x, double y, - double z) { - return new WorldVector(world, (int) Math.floor(x), - (int) Math.floor(y), - (int) Math.floor(z)); - } - - /** - * Gets a BlockVector version. - * - * @return BlockWorldVector - */ - public BlockWorldVector toWorldBlockVector() { - return new BlockWorldVector(this); - } - - /** - * Return this object as a new preferred {@code Location} - * object. - * - * @return a new location object - */ - public com.sk89q.worldedit.util.Location toLocation() { - return new com.sk89q.worldedit.util.Location(getWorld(), this); - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector2D.java deleted file mode 100644 index 35a261b2a..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVector2D.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -/** - * @deprecated Use {@link com.sk89q.worldedit.util.Location} wherever possible - */ -@Deprecated -public class WorldVector2D extends Vector2D { - - protected LocalWorld world; - - public WorldVector2D(LocalWorld world) { - super(); - this.world = world; - } - - public WorldVector2D(LocalWorld world, double x, double z) { - super(x, z); - this.world = world; - } - - public WorldVector2D(LocalWorld world, float x, float z) { - super(x, z); - this.world = world; - } - - public WorldVector2D(LocalWorld world, int x, int z) { - super(x, z); - this.world = world; - } - - public WorldVector2D(LocalWorld world, Vector2D pt) { - super(pt); - this.world = world; - } - - public LocalWorld getWorld() { - return world; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof WorldVector2D)) { - return false; - } - WorldVector2D other = (WorldVector2D) obj; - return other.world.equals(world) && other.x == this.x - && other.z == this.z; - - } - - /** - * Gets the hash code. - * - * @return hash code - */ - @Override - public int hashCode() { - return (world.hashCode() >> 7) ^ - ((int) (Double.doubleToLongBits(x) ^ (Double.doubleToLongBits(x) >>> 32)) >> 13) ^ - (int) (Double.doubleToLongBits(z) ^ (Double.doubleToLongBits(z) >>> 32)); - } -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVectorFace.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVectorFace.java deleted file mode 100644 index 9bd1b3a27..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldVectorFace.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -/** - * @deprecated Use {@link com.sk89q.worldedit.util.Location} wherever possible - */ -@Deprecated -public class WorldVectorFace extends WorldVector { - - private VectorFace face; - - public WorldVectorFace(LocalWorld world, double x, double y, double z, VectorFace face) { - super(world, x, y, z); - this.face = face; - } - - public WorldVectorFace(LocalWorld world, int x, int y, int z, VectorFace face) { - super(world, x, y, z); - this.face = face; - } - - public WorldVectorFace(LocalWorld world, float x, float y, float z, VectorFace face) { - super(world, x, y, z); - this.face = face; - } - - public WorldVectorFace(LocalWorld world, Vector pt, VectorFace face) { - super(world, pt); - this.face = face; - } - - public WorldVectorFace(LocalWorld world, VectorFace face) { - super(world); - this.face = face; - } - - /** - * Get the face. - * - * @return the face - */ - public VectorFace getFace() { - return face; - } - - /** - * Get the WorldVector adjacent to this WorldVectorFace. - * - * @return the face vector - */ - public WorldVector getFaceVector() { - return new WorldVector(getWorld(), - getBlockX() - face.getModX(), - getBlockY() - face.getModY(), - getBlockZ() - face.getModZ()); - } - - /** - * Get a WorldVectorFace by comparing two vectors. Note that they need not be - * adjacent, as only the directions, not distance, will be taken into account. - * - * @param world the world in which the resulting vector should lie - * @param vector the original vector - * @param face the direction in which the face should lie - * @return a face - */ - public static WorldVectorFace getWorldVectorFace(LocalWorld world, Vector vector, Vector face) { - if (vector == null || face == null) return null; - // check which direction the face is from the vector - final int x1 = vector.getBlockX(); - final int y1 = vector.getBlockY(); - final int z1 = vector.getBlockZ(); - int modX = x1 - face.getBlockX(); - int modY = y1 - face.getBlockY(); - int modZ = z1 - face.getBlockZ(); - if (modX > 0) modX = 1; - else if (modX < 0) modX = -1; - else modX = 0; - if (modY > 0) modY = 1; - else if (modY < 0) modY = -1; - else modY = 0; - if (modZ > 0) modZ = 1; - else if (modZ < 0) modZ = -1; - else modZ = 0; - // construct new vector - return new WorldVectorFace(world, x1, y1, z1, VectorFace.fromMods(modX, modY, modZ)); - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java index ddd9d4271..f903a268b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java @@ -54,11 +54,6 @@ public class ItemType { } } - @Deprecated - public com.sk89q.worldedit.blocks.ItemType getLegacyType() { - return com.sk89q.worldedit.blocks.ItemType.fromID(getLegacyId()); - } - @Override public int hashCode() { return this.id.hashCode(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java index 953168c3b..848540dd6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java @@ -41,6 +41,7 @@ import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.FlatRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Regions; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; @@ -125,22 +126,22 @@ public class BiomeCommands { @CommandPermissions("worldedit.biome.info") public void biomeInfo(Player player, LocalSession session, CommandContext args) throws WorldEditException { BiomeRegistry biomeRegistry = player.getWorld().getWorldData().getBiomeRegistry(); - Set biomes = new HashSet(); + Set biomes = new HashSet<>(); String qualifier; if (args.hasFlag('t')) { - Vector blockPosition = player.getBlockTrace(300); + Location blockPosition = player.getBlockTrace(300); if (blockPosition == null) { player.printError("No block in sight!"); return; } - BaseBiome biome = player.getWorld().getBiome(blockPosition.toVector2D()); + BaseBiome biome = player.getWorld().getBiome(blockPosition.toVector().toVector2D()); biomes.add(biome); qualifier = "at line of sight point"; } else if (args.hasFlag('p')) { - BaseBiome biome = player.getWorld().getBiome(player.getPosition().toVector2D()); + BaseBiome biome = player.getWorld().getBiome(player.getPosition().toVector().toVector2D()); biomes.add(biome); qualifier = "at your position"; @@ -191,7 +192,7 @@ public class BiomeCommands { Mask2D mask2d = mask != null ? mask.toMask2D() : null; if (atPosition) { - region = new CuboidRegion(player.getPosition(), player.getPosition()); + region = new CuboidRegion(player.getPosition().toVector(), player.getPosition().toVector()); } else { region = session.getSelection(world); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java index 0330c58bc..dfa646400 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java @@ -26,6 +26,7 @@ import com.sk89q.minecraft.util.commands.Logging; import com.sk89q.worldedit.*; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.math.MathUtils; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.storage.LegacyChunkStore; import com.sk89q.worldedit.world.storage.McRegionChunkStore; @@ -58,7 +59,7 @@ public class ChunkCommands { ) @CommandPermissions("worldedit.chunkinfo") public void chunkInfo(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - Vector pos = player.getBlockIn(); + Location pos = player.getBlockIn(); int chunkX = (int) Math.floor(pos.getBlockX() / 16.0); int chunkZ = (int) Math.floor(pos.getBlockZ() / 16.0); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java index ba891026c..6a7e72f53 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java @@ -28,8 +28,8 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.command.parametric.Optional; import static com.google.common.base.Preconditions.checkNotNull; @@ -161,7 +161,7 @@ public class NavigationCommands { @CommandPermissions("worldedit.navigation.jumpto.command") public void jumpTo(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - WorldVector pos = player.getSolidBlockTrace(300); + Location pos = player.getSolidBlockTrace(300); if (pos != null) { player.findFreePosition(pos); player.print("Poof!"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 41799e8a0..2e2be7bb4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -49,6 +49,7 @@ import com.sk89q.worldedit.regions.selector.RegionSelectorType; import com.sk89q.worldedit.regions.selector.SphereRegionSelector; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.Countable; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.formatting.ColorCodeBuilder; import com.sk89q.worldedit.util.formatting.Style; import com.sk89q.worldedit.util.formatting.StyledFragment; @@ -85,12 +86,12 @@ public class SelectionCommands { @CommandPermissions("worldedit.selection.pos") public void pos1(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - Vector pos; + Location pos; if (args.argsLength() == 1) { if (args.getString(0).matches("-?\\d+,-?\\d+,-?\\d+")) { String[] coords = args.getString(0).split(","); - pos = new Vector(Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2])); + pos = new Location(player.getWorld(), Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2])); } else { player.printError("Invalid coordinates " + args.getString(0)); return; @@ -99,13 +100,13 @@ public class SelectionCommands { pos = player.getBlockIn(); } - if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos, ActorSelectorLimits.forActor(player))) { + if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos.toVector(), ActorSelectorLimits.forActor(player))) { player.printError("Position already set."); return; } session.getRegionSelector(player.getWorld()) - .explainPrimarySelection(player, session, pos); + .explainPrimarySelection(player, session, pos.toVector()); } @Command( @@ -119,11 +120,11 @@ public class SelectionCommands { @CommandPermissions("worldedit.selection.pos") public void pos2(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - Vector pos; + Location pos; if (args.argsLength() == 1) { if (args.getString(0).matches("-?\\d+,-?\\d+,-?\\d+")) { String[] coords = args.getString(0).split(","); - pos = new Vector(Integer.parseInt(coords[0]), + pos = new Location(player.getWorld(), Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2])); } else { @@ -134,13 +135,13 @@ public class SelectionCommands { pos = player.getBlockIn(); } - if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos, ActorSelectorLimits.forActor(player))) { + if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos.toVector(), ActorSelectorLimits.forActor(player))) { player.printError("Position already set."); return; } session.getRegionSelector(player.getWorld()) - .explainSecondarySelection(player, session, pos); + .explainSecondarySelection(player, session, pos.toVector()); } @Command( @@ -152,17 +153,17 @@ public class SelectionCommands { ) @CommandPermissions("worldedit.selection.hpos") public void hpos1(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - - Vector pos = player.getBlockTrace(300); + + Location pos = player.getBlockTrace(300); if (pos != null) { - if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos, ActorSelectorLimits.forActor(player))) { + if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos.toVector(), ActorSelectorLimits.forActor(player))) { player.printError("Position already set."); return; } session.getRegionSelector(player.getWorld()) - .explainPrimarySelection(player, session, pos); + .explainPrimarySelection(player, session, pos.toVector()); } else { player.printError("No block in sight!"); } @@ -177,17 +178,17 @@ public class SelectionCommands { ) @CommandPermissions("worldedit.selection.hpos") public void hpos2(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - - Vector pos = player.getBlockTrace(300); + + Location pos = player.getBlockTrace(300); if (pos != null) { - if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos, ActorSelectorLimits.forActor(player))) { + if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos.toVector(), ActorSelectorLimits.forActor(player))) { player.printError("Position already set."); return; } session.getRegionSelector(player.getWorld()) - .explainSecondarySelection(player, session, pos); + .explainSecondarySelection(player, session, pos.toVector()); } else { player.printError("No block in sight!"); } @@ -241,7 +242,7 @@ public class SelectionCommands { min2D = (args.hasFlag('c')) ? pos : ChunkStore.toChunk(pos.toVector()); } else { // use player loc - min2D = ChunkStore.toChunk(player.getBlockIn()); + min2D = ChunkStore.toChunk(player.getBlockIn().toVector()); } min = new Vector(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java index 2e7fbc24a..9096a4d19 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java @@ -19,11 +19,12 @@ package com.sk89q.worldedit.command.tool; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.command.tool.brush.Brush; import com.sk89q.worldedit.command.tool.brush.SphereBrush; import com.sk89q.worldedit.entity.Player; @@ -34,11 +35,10 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.MaskIntersection; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.session.request.Request; +import com.sk89q.worldedit.util.Location; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Builds a shape at the place being looked at. */ @@ -162,7 +162,7 @@ public class BrushTool implements TraceTool { @Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session) { - WorldVector target = null; + Location target = null; target = player.getBlockTrace(getRange(), true); if (target == null) { @@ -189,7 +189,7 @@ public class BrushTool implements TraceTool { } try { - brush.build(editSession, target, material, size); + brush.build(editSession, target.toVector(), material, size); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java index a4cb1151f..a1b51e256 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits; import com.sk89q.worldedit.regions.RegionSelector; +import com.sk89q.worldedit.util.Location; /** * A wand that can be used at a distance. @@ -43,12 +44,12 @@ public class DistanceWand extends BrushTool implements DoubleActionTraceTool { @Override public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session) { if (session.isToolControlEnabled() && player.hasPermission("worldedit.selection.pos")) { - WorldVector target = getTarget(player); + Location target = getTarget(player); if (target == null) return true; RegionSelector selector = session.getRegionSelector(player.getWorld()); - if (selector.selectPrimary(target, ActorSelectorLimits.forActor(player))) { - selector.explainPrimarySelection(player, session, target); + if (selector.selectPrimary(target.toVector(), ActorSelectorLimits.forActor(player))) { + selector.explainPrimarySelection(player, session, target.toVector()); } return true; @@ -60,12 +61,12 @@ public class DistanceWand extends BrushTool implements DoubleActionTraceTool { @Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session) { if (session.isToolControlEnabled() && player.hasPermission("worldedit.selection.pos")) { - WorldVector target = getTarget(player); + Location target = getTarget(player); if (target == null) return true; RegionSelector selector = session.getRegionSelector(player.getWorld()); - if (selector.selectSecondary(target, ActorSelectorLimits.forActor(player))) { - selector.explainSecondarySelection(player, session, target); + if (selector.selectSecondary(target.toVector(), ActorSelectorLimits.forActor(player))) { + selector.explainSecondarySelection(player, session, target.toVector()); } return true; @@ -73,8 +74,8 @@ public class DistanceWand extends BrushTool implements DoubleActionTraceTool { return false; } - public WorldVector getTarget(Player player) { - WorldVector target = null; + public Location getTarget(Player player) { + Location target; if (this.range > -1) { target = player.getBlockTrace(getRange(), true); } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index 30a8f7ef2..d6a64dea8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -19,20 +19,24 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; +import com.sk89q.worldedit.util.Location; /** * A tool that can place (or remove) blocks at a distance. */ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTool { - BaseBlock primary; - BaseBlock secondary; + private BaseBlock primary; + private BaseBlock secondary; public LongRangeBuildTool(BaseBlock primary, BaseBlock secondary) { super("worldedit.tool.lrbuild"); @@ -47,14 +51,14 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo @Override public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session) { - WorldVectorFace pos = getTargetFace(player); + Location pos = getTargetFace(player); if (pos == null) return false; EditSession eS = session.createEditSession(player); try { - if (secondary.getType().getLegacyId() == BlockID.AIR) { - eS.setBlock(pos, secondary); + if (secondary.getType() == BlockTypes.AIR) { + eS.setBlock(pos.toVector(), secondary); } else { - eS.setBlock(pos.getFaceVector(), secondary); + eS.setBlock(pos.getDirection(), secondary); } return true; } catch (MaxChangedBlocksException e) { @@ -66,14 +70,14 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo @Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session) { - WorldVectorFace pos = getTargetFace(player); + Location pos = getTargetFace(player); if (pos == null) return false; EditSession eS = session.createEditSession(player); try { - if (primary.getType().getLegacyId() == BlockID.AIR) { - eS.setBlock(pos, primary); + if (primary.getType() == BlockTypes.AIR) { + eS.setBlock(pos.toVector(), primary); } else { - eS.setBlock(pos.getFaceVector(), primary); + eS.setBlock(pos.getDirection(), primary); } return true; } catch (MaxChangedBlocksException e) { @@ -82,9 +86,8 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo return false; } - public WorldVectorFace getTargetFace(Player player) { - WorldVectorFace target = null; - target = player.getBlockTraceFace(getRange(), true); + public Location getTargetFace(Player player) { + Location target = player.getBlockTraceFace(getRange(), true); if (target == null) { player.printError("No block in sight!"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java index 756f575d4..6e8318889 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java @@ -21,15 +21,14 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.internal.LocalWorldAdapter; import com.sk89q.worldedit.math.convolution.HeightMap; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.math.convolution.GaussianKernel; import com.sk89q.worldedit.math.convolution.HeightMapFilter; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.util.Location; public class SmoothBrush implements Brush { @@ -47,9 +46,9 @@ public class SmoothBrush implements Brush { @Override public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { - WorldVector min = new WorldVector(LocalWorldAdapter.adapt(editSession.getWorld()), position.subtract(size, size, size)); + Location min = new Location(editSession.getWorld(), position.subtract(size, size, size)); Vector max = position.add(size, size + 10, size); - Region region = new CuboidRegion(editSession.getWorld(), min, max); + Region region = new CuboidRegion(editSession.getWorld(), min.toVector(), max); HeightMap heightMap = new HeightMap(editSession, region, naturalOnly); HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0)); heightMap.applyFilter(filter, iterations); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index ebb2e24f8..e60160bbc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -22,11 +22,10 @@ package com.sk89q.worldedit.entity; import com.sk89q.worldedit.PlayerDirection; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.WorldVector; -import com.sk89q.worldedit.WorldVectorFace; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; /** @@ -100,14 +99,14 @@ public interface Player extends Entity, Actor { * * @param searchPos search position */ - void findFreePosition(WorldVector searchPos); + void findFreePosition(Location searchPos); /** * Set the actor on the ground. * * @param searchPos The location to start searching from */ - void setOnGround(WorldVector searchPos); + void setOnGround(Location searchPos); /** * Find a position for the player to stand that is not inside a block. @@ -179,14 +178,14 @@ public interface Player extends Entity, Actor { * * @return point */ - WorldVector getBlockIn(); + Location getBlockIn(); /** * Get the point of the block that is being stood upon. * * @return point */ - WorldVector getBlockOn(); + Location getBlockOn(); /** * Get the point of the block being looked at. May return null. @@ -196,7 +195,7 @@ public interface Player extends Entity, Actor { * @param useLastBlock try to return the last valid air block found * @return point */ - WorldVector getBlockTrace(int range, boolean useLastBlock); + Location getBlockTrace(int range, boolean useLastBlock); /** * Get the face that the player is looking at. @@ -205,7 +204,7 @@ public interface Player extends Entity, Actor { * @param useLastBlock try to return the last valid air block found * @return a face */ - WorldVectorFace getBlockTraceFace(int range, boolean useLastBlock); + Location getBlockTraceFace(int range, boolean useLastBlock); /** * Get the point of the block being looked at. May return null. @@ -213,7 +212,7 @@ public interface Player extends Entity, Actor { * @param range How far to checks for blocks * @return point */ - WorldVector getBlockTrace(int range); + Location getBlockTrace(int range); /** * Get the point of the block being looked at. May return null. @@ -221,7 +220,7 @@ public interface Player extends Entity, Actor { * @param range How far to checks for blocks * @return point */ - WorldVector getSolidBlockTrace(int range); + Location getSolidBlockTrace(int range); /** * Get the player's cardinal direction (N, W, NW, etc.). May return null. @@ -238,8 +237,7 @@ public interface Player extends Entity, Actor { * @return the actor's position * @deprecated use {@link #getLocation()} */ - @Deprecated - WorldVector getPosition(); + Location getPosition(); /** * Get the player's view pitch in degrees. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index 883930915..e7dd15fce 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -19,24 +19,21 @@ package com.sk89q.worldedit.extension.platform; -import com.sk89q.worldedit.util.auth.AuthorizationException; -import com.sk89q.worldedit.BlockWorldVector; -import com.sk89q.worldedit.LocalPlayer; import com.sk89q.worldedit.NotABlockException; import com.sk89q.worldedit.PlayerDirection; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.WorldVector; -import com.sk89q.worldedit.WorldVectorFace; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.ItemID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.internal.cui.CUIEvent; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TargetBlock; -import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.util.auth.AuthorizationException; import java.io.File; @@ -93,8 +90,8 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { } @Override - public void findFreePosition(WorldVector searchPos) { - World world = searchPos.getWorld(); + public void findFreePosition(Location searchPos) { + Extent world = searchPos.getExtent(); int x = searchPos.getBlockX(); int y = Math.max(0, searchPos.getBlockY()); int origY = y; @@ -102,7 +99,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { byte free = 0; - while (y <= world.getMaxY() + 2) { + while (y <= world.getMinimumPoint().getBlockY() + 2) { if (BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { ++free; } else { @@ -112,8 +109,8 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { if (free == 2) { if (y - 1 != origY) { final Vector pos = new Vector(x, y - 2, z); - final int id = world.getBlockType(pos); - final int data = world.getBlockData(pos); + final int id = world.getBlock(pos).getId(); + final int data = world.getBlock(pos).getData(); setPosition(new Vector(x + 0.5, y - 2 + BlockType.centralTopLimit(id, data), z + 0.5)); } @@ -125,16 +122,16 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { } @Override - public void setOnGround(WorldVector searchPos) { - World world = searchPos.getWorld(); + public void setOnGround(Location searchPos) { + Extent world = searchPos.getExtent(); int x = searchPos.getBlockX(); int y = Math.max(0, searchPos.getBlockY()); int z = searchPos.getBlockZ(); while (y >= 0) { final Vector pos = new Vector(x, y, z); - final int id = world.getBlockType(pos); - final int data = world.getBlockData(pos); + final int id = world.getBlock(pos).getId(); + final int data = world.getBlock(pos).getData(); if (!BlockType.canPassThrough(id, data)) { setPosition(new Vector(x + 0.5, y + BlockType.centralTopLimit(id, data), z + 0.5)); return; @@ -151,16 +148,16 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public boolean ascendLevel() { - final WorldVector pos = getBlockIn(); + final Location pos = getBlockIn(); final int x = pos.getBlockX(); int y = Math.max(0, pos.getBlockY()); final int z = pos.getBlockZ(); - final World world = pos.getWorld(); + final Extent world = pos.getExtent(); byte free = 0; byte spots = 0; - while (y <= world.getMaxY() + 2) { + while (y <= world.getMaximumPoint().getY() + 2) { if (BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { ++free; } else { @@ -192,11 +189,11 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public boolean descendLevel() { - final WorldVector pos = getBlockIn(); + final Location pos = getBlockIn(); final int x = pos.getBlockX(); int y = Math.max(0, pos.getBlockY() - 1); final int z = pos.getBlockZ(); - final World world = pos.getWorld(); + final Extent world = pos.getExtent(); byte free = 0; @@ -242,19 +239,19 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public boolean ascendToCeiling(int clearance, boolean alwaysGlass) { - Vector pos = getBlockIn(); + Location pos = getBlockIn(); int x = pos.getBlockX(); int initialY = Math.max(0, pos.getBlockY()); int y = Math.max(0, pos.getBlockY() + 2); int z = pos.getBlockZ(); - World world = getPosition().getWorld(); + Extent world = getPosition().getExtent(); // No free space above - if (world.getBlockType(new Vector(x, y, z)) != 0) { + if (world.getBlock(new Vector(x, y, z)).getId() != 0) { return false; } - while (y <= world.getMaxY()) { + while (y <= world.getMaximumPoint().getY()) { // Found a ceiling! if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { int platformY = Math.max(initialY, y - 3 - clearance); @@ -275,15 +272,15 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public boolean ascendUpwards(int distance, boolean alwaysGlass) { - final Vector pos = getBlockIn(); + final Location pos = getBlockIn(); final int x = pos.getBlockX(); final int initialY = Math.max(0, pos.getBlockY()); int y = Math.max(0, pos.getBlockY() + 1); final int z = pos.getBlockZ(); final int maxY = Math.min(getWorld().getMaxY() + 1, initialY + distance); - final World world = getPosition().getWorld(); + final Extent world = getPosition().getExtent(); - while (y <= world.getMaxY() + 2) { + while (y <= world.getMaximumPoint().getY() + 2) { if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { break; // Hit something } else if (y > maxY + 1) { @@ -301,43 +298,43 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public void floatAt(int x, int y, int z, boolean alwaysGlass) { - getPosition().getWorld().setBlockType(new Vector(x, y - 1, z), BlockID.GLASS); + try { + getPosition().getExtent().setBlock(new Vector(x, y - 1, z), new BaseBlock(BlockTypes.GLASS)); + } catch (WorldEditException e) { + e.printStackTrace(); + } setPosition(new Vector(x + 0.5, y, z + 0.5)); } @Override - public WorldVector getBlockIn() { - WorldVector pos = getPosition(); - return WorldVector.toBlockPoint(pos.getWorld(), pos.getX(), - pos.getY(), pos.getZ()); + public Location getBlockIn() { + return getPosition(); } @Override - public WorldVector getBlockOn() { - WorldVector pos = getPosition(); - return WorldVector.toBlockPoint(pos.getWorld(), pos.getX(), - pos.getY() - 1, pos.getZ()); + public Location getBlockOn() { + return getPosition().setY(getPosition().getY() - 1); } @Override - public WorldVector getBlockTrace(int range, boolean useLastBlock) { + public Location getBlockTrace(int range, boolean useLastBlock) { TargetBlock tb = new TargetBlock(this, range, 0.2); return (useLastBlock ? tb.getAnyTargetBlock() : tb.getTargetBlock()); } @Override - public WorldVectorFace getBlockTraceFace(int range, boolean useLastBlock) { + public Location getBlockTraceFace(int range, boolean useLastBlock) { TargetBlock tb = new TargetBlock(this, range, 0.2); return (useLastBlock ? tb.getAnyTargetBlockFace() : tb.getTargetBlockFace()); } @Override - public WorldVector getBlockTrace(int range) { + public Location getBlockTrace(int range) { return getBlockTrace(range, false); } @Override - public WorldVector getSolidBlockTrace(int range) { + public Location getSolidBlockTrace(int range) { TargetBlock tb = new TargetBlock(this, range, 0.2); return tb.getSolidTargetBlock(); } @@ -383,14 +380,14 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { public boolean passThroughForwardWall(int range) { int searchDist = 0; TargetBlock hitBlox = new TargetBlock(this, range, 0.2); - World world = getPosition().getWorld(); - BlockWorldVector block; + Extent world = getPosition().getExtent(); + Location block; boolean firstBlock = true; int freeToFind = 2; boolean inFree = false; while ((block = hitBlox.getNextBlock()) != null) { - boolean free = BlockType.canPassThrough(world.getBlock(block)); + boolean free = BlockType.canPassThrough(world.getBlock(block.toVector())); if (firstBlock) { firstBlock = false; @@ -451,10 +448,10 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public boolean equals(Object other) { - if (!(other instanceof LocalPlayer)) { + if (!(other instanceof Player)) { return false; } - LocalPlayer other2 = (LocalPlayer) other; + Player other2 = (Player) other; return other2.getName().equals(getName()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index 8f34ab6d1..4335afe66 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -19,12 +19,13 @@ package com.sk89q.worldedit.extension.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.ServerInterface; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.command.tool.BlockTool; import com.sk89q.worldedit.command.tool.DoubleActionBlockTool; import com.sk89q.worldedit.command.tool.DoubleActionTraceTool; @@ -44,7 +45,6 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.eventbus.Subscribe; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.EnumMap; import java.util.Iterator; @@ -55,7 +55,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Manages registered {@link Platform}s for WorldEdit. Platforms are @@ -403,7 +403,7 @@ public class PlatformManager { return; } - WorldVector pos = player.getSolidBlockTrace(getConfiguration().navigationWandMaxDistance); + Location pos = player.getSolidBlockTrace(getConfiguration().navigationWandMaxDistance); if (pos != null) { player.findFreePosition(pos); } else { @@ -417,7 +417,7 @@ public class PlatformManager { LocalSession session = worldEdit.getSessionManager().get(player); Tool tool = session.getTool(player.getItemInHand()); - if (tool != null && tool instanceof DoubleActionTraceTool) { + if (tool instanceof DoubleActionTraceTool) { if (tool.canUse(player)) { ((DoubleActionTraceTool) tool).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session); event.setCancelled(true); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 7ed6d20d1..be4adabb9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.extension.platform; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extent.inventory.BlockBag; @@ -89,7 +88,7 @@ class PlayerProxy extends AbstractPlayerActor { } @Override - public WorldVector getPosition() { + public Location getPosition() { return basePlayer.getPosition(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java index 969ecbd84..79df290c8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.extent.inventory; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.blocks.*; +import com.sk89q.worldedit.util.Location; /** * Represents a source to get blocks from and store removed ones. @@ -187,12 +187,12 @@ public abstract class BlockBag { * * @param pos the position */ - public abstract void addSourcePosition(WorldVector pos); + public abstract void addSourcePosition(Location pos); /** * Adds a position to be used a source. * * @param pos the position */ - public abstract void addSingleSourcePosition(WorldVector pos); + public abstract void addSingleSourcePosition(Location pos); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/LocalWorldAdapter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/LocalWorldAdapter.java deleted file mode 100644 index 2ded7c439..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/LocalWorldAdapter.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.internal; - -import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalWorld; -import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.Vector2D; -import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.entity.BaseEntity; -import com.sk89q.worldedit.entity.Entity; -import com.sk89q.worldedit.extension.platform.Platform; -import com.sk89q.worldedit.function.mask.Mask; -import com.sk89q.worldedit.function.operation.Operation; -import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.util.TreeGenerator.TreeType; -import com.sk89q.worldedit.world.World; -import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.WorldData; - -import javax.annotation.Nullable; -import java.util.List; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps {@link World}s into {@link LocalWorld}. - */ -@SuppressWarnings("deprecation") -public class LocalWorldAdapter extends LocalWorld { - - private final World world; - - private LocalWorldAdapter(World world) { - checkNotNull(world); - this.world = world; - } - - @Override - public String getName() { - return world.getName(); - } - - @Override - public int getMaxY() { - return world.getMaxY(); - } - - @Override - public boolean isValidBlockType(int id) { - return world.isValidBlockType(id); - } - - @Override - public boolean usesBlockData(int id) { - return world.usesBlockData(id); - } - - @Override - public Mask createLiquidMask() { - return world.createLiquidMask(); - } - - @Override - @Deprecated - public int getBlockType(Vector pt) { - return world.getBlockType(pt); - } - - @Override - @Deprecated - public int getBlockData(Vector pt) { - return world.getBlockData(pt); - } - - @Override - public boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException { - return world.setBlock(position, block, notifyAndLight); - } - - @Override - public int getBlockLightLevel(Vector position) { - return world.getBlockLightLevel(position); - } - - @Override - public boolean clearContainerBlockContents(Vector position) { - return world.clearContainerBlockContents(position); - } - - @Override - public BaseBiome getBiome(Vector2D position) { - return world.getBiome(position); - } - - @Override - public boolean setBiome(Vector2D position, BaseBiome biome) { - return world.setBiome(position, biome); - } - - @Override - public void dropItem(Vector position, BaseItemStack item, int count) { - world.dropItem(position, item, count); - } - - @Override - public void dropItem(Vector position, BaseItemStack item) { - world.dropItem(position, item); - } - - @Override - public void simulateBlockMine(Vector position) { - world.simulateBlockMine(position); - } - - @Override - public boolean regenerate(Region region, EditSession editSession) { - return world.regenerate(region, editSession); - } - - @Override - public boolean generateTree(TreeType type, EditSession editSession, Vector position) throws MaxChangedBlocksException { - return world.generateTree(type, editSession, position); - } - - @Override - @Deprecated - public boolean generateTree(EditSession editSession, Vector position) throws MaxChangedBlocksException { - return world.generateTree(editSession, position); - } - - @Override - @Deprecated - public boolean generateBigTree(EditSession editSession, Vector position) throws MaxChangedBlocksException { - return world.generateBigTree(editSession, position); - } - - @Override - @Deprecated - public boolean generateBirchTree(EditSession editSession, Vector position) throws MaxChangedBlocksException { - return world.generateBirchTree(editSession, position); - } - - @Override - @Deprecated - public boolean generateRedwoodTree(EditSession editSession, Vector position) throws MaxChangedBlocksException { - return world.generateRedwoodTree(editSession, position); - } - - @Override - @Deprecated - public boolean generateTallRedwoodTree(EditSession editSession, Vector position) throws MaxChangedBlocksException { - return world.generateTallRedwoodTree(editSession, position); - } - - @Override - public void checkLoadedChunk(Vector position) { - world.checkLoadedChunk(position); - } - - @Override - public void fixAfterFastMode(Iterable chunks) { - world.fixAfterFastMode(chunks); - } - - @Override - public void fixLighting(Iterable chunks) { - world.fixLighting(chunks); - } - - @Override - public boolean playEffect(Vector position, int type, int data) { - return world.playEffect(position, type, data); - } - - @Override - public boolean queueBlockBreakEffect(Platform server, Vector position, int blockId, double priority) { - return world.queueBlockBreakEffect(server, position, blockId, priority); - } - - @Override - public WorldData getWorldData() { - return world.getWorldData(); - } - - @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") - @Override - public boolean equals(Object other) { - return world.equals(other); - } - - @Override - public int hashCode() { - return world.hashCode(); - } - - @Override - public Vector getMinimumPoint() { - return world.getMinimumPoint(); - } - - @Override - public Vector getMaximumPoint() { - return world.getMaximumPoint(); - } - - @Override - public List getEntities(Region region) { - return world.getEntities(region); - } - - @Override - public BaseBlock getBlock(Vector position) { - return world.getBlock(position); - } - - @Override - public BaseBlock getLazyBlock(Vector position) { - return world.getLazyBlock(position); - } - - @Override - @Nullable - public Operation commit() { - return world.commit(); - } - - @Override - @Nullable - public Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) { - return world.createEntity(location, entity); - } - - @Override - public List getEntities() { - return world.getEntities(); - } - - public static LocalWorldAdapter adapt(World world) { - return new LocalWorldAdapter(world); - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java index 4633afc52..9f650bee8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java @@ -99,7 +99,7 @@ public class CommandLoggingHandler extends AbstractInvokeListener implements Inv } if (logMode != null && sender.isPlayer()) { - Vector position = player.getPosition(); + Vector position = player.getPosition().toVector(); LocalSession session = worldEdit.getSessionManager().get(player); switch (logMode) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java index 8005bc7c8..9bc7159f6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java @@ -55,11 +55,6 @@ public abstract class AbstractRegion implements Region { return world; } - @Override - public void setWorld(LocalWorld world) { - setWorld((World) world); - } - @Override public void setWorld(World world) { this.world = world; @@ -89,7 +84,7 @@ public abstract class AbstractRegion implements Region { final BlockVector min = getMinimumPoint().toBlockVector(); final BlockVector max = getMaximumPoint().toBlockVector(); - final List points = new ArrayList(4); + final List points = new ArrayList<>(4); points.add(new BlockVector2D(min.getX(), min.getZ())); points.add(new BlockVector2D(min.getX(), max.getZ())); @@ -160,7 +155,7 @@ public abstract class AbstractRegion implements Region { */ @Override public Set getChunks() { - final Set chunks = new HashSet(); + final Set chunks = new HashSet<>(); final Vector min = getMinimumPoint(); final Vector max = getMaximumPoint(); @@ -185,7 +180,7 @@ public abstract class AbstractRegion implements Region { @Override public Set getChunkCubes() { - final Set chunks = new HashSet(); + final Set chunks = new HashSet<>(); final Vector min = getMinimumPoint(); final Vector max = getMaximumPoint(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegion.java index 2484cf062..fce016e23 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/ConvexPolyhedralRegion.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.regions; -import com.sk89q.worldedit.LocalWorld; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.regions.polyhedron.Edge; import com.sk89q.worldedit.regions.polyhedron.Triangle; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -33,24 +33,24 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; public class ConvexPolyhedralRegion extends AbstractRegion { /** * Vertices that are contained in the convex hull. */ - private final Set vertices = new LinkedHashSet(); + private final Set vertices = new LinkedHashSet<>(); /** * Triangles that form the convex hull. */ - private final List triangles = new ArrayList(); + private final List triangles = new ArrayList<>(); /** * Vertices that are coplanar to the first 3 vertices. */ - private final Set vertexBacklog = new LinkedHashSet(); + private final Set vertexBacklog = new LinkedHashSet<>(); /** * Minimum point of the axis-aligned bounding box. @@ -81,14 +81,6 @@ public class ConvexPolyhedralRegion extends AbstractRegion { super(world); } - /** - * @deprecated cast {@code world} to {@link World} - */ - @Deprecated - public ConvexPolyhedralRegion(LocalWorld world) { - super(world); - } - /** * Constructs an independent copy of the given region. * @@ -174,7 +166,7 @@ public class ConvexPolyhedralRegion extends AbstractRegion { } // Look for triangles that face the vertex and remove them - final Set borderEdges = new LinkedHashSet(); + final Set borderEdges = new LinkedHashSet<>(); for (Iterator it = triangles.iterator(); it.hasNext(); ) { final Triangle triangle = it.next(); @@ -207,7 +199,7 @@ public class ConvexPolyhedralRegion extends AbstractRegion { vertices.remove(vertex); // Clone, clear and work through the backlog - final List vertexBacklog2 = new ArrayList(vertexBacklog); + final List vertexBacklog2 = new ArrayList<>(vertexBacklog); vertexBacklog.clear(); for (Vector vertex2 : vertexBacklog2) { addVertex(vertex2); @@ -269,7 +261,7 @@ public class ConvexPolyhedralRegion extends AbstractRegion { } private static void shiftCollection(Collection collection, Vector change) { - final List tmp = new ArrayList(collection); + final List tmp = new ArrayList<>(collection); collection.clear(); for (Vector vertex : tmp) { collection.add(change.add(vertex)); @@ -323,7 +315,7 @@ public class ConvexPolyhedralRegion extends AbstractRegion { return vertices; } - final List ret = new ArrayList(vertices); + final List ret = new ArrayList<>(vertices); ret.addAll(vertexBacklog); return ret; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java index 0f483be4e..37bd1a21d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java @@ -19,9 +19,10 @@ package com.sk89q.worldedit.regions; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.extent.Extent; @@ -33,8 +34,6 @@ import com.sk89q.worldedit.world.World; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Represents a cylindrical region. */ @@ -53,13 +52,6 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion { this((World) null); } - /** - * @deprecated cast {@code world} to {@link World} - */ - @Deprecated - public CylinderRegion(LocalWorld world) { - this((World) world); - } /** * Construct the region. * @@ -70,11 +62,6 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion { hasY = false; } - @Deprecated - public CylinderRegion(LocalWorld world, Vector center, Vector2D radius, int minY, int maxY) { - this((World) world, center, radius, minY, maxY); - } - /** * Construct the region. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java index 48e0a0609..dc429beb5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java @@ -21,13 +21,13 @@ package com.sk89q.worldedit.regions; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.storage.ChunkStore; -import java.util.Set; + import java.util.HashSet; +import java.util.Set; /** * Represents an ellipsoid region. @@ -54,11 +54,6 @@ public class EllipsoidRegion extends AbstractRegion { this(null, pos1, pos2); } - @Deprecated - public EllipsoidRegion(LocalWorld world, Vector center, Vector radius) { - this((World) world, center, radius); - } - /** * Construct a new instance of this ellipsoid region. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java index 611835550..7730b6756 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java @@ -107,11 +107,6 @@ public class NullRegion implements Region { this.world = world; } - @Override - public void setWorld(LocalWorld world) { - setWorld((World) world); - } - @Override public NullRegion clone() { return new NullRegion(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java index f3e207380..9d7146ed9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.regions; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.regions.iterator.FlatRegion3DIterator; @@ -52,11 +51,6 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { this((World) null); } - @Deprecated - public Polygonal2DRegion(LocalWorld world) { - this((World) world); - } - /** * Construct the region. * @@ -67,11 +61,6 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { hasY = false; } - @Deprecated - public Polygonal2DRegion(LocalWorld world, List points, int minY, int maxY) { - this((World) world, points, minY, maxY); - } - /** * Construct the region. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java index 954296565..a84227075 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.regions; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.World; @@ -147,14 +146,6 @@ public interface Region extends Iterable, Cloneable { */ public void setWorld(@Nullable World world); - /** - * Sets the world that the selection is in. - * - * @param world the world, which may be null - */ - @Deprecated - public void setWorld(@Nullable LocalWorld world); - /** * Make a clone of the region. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java index dc80c5345..dcdcee2cf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java @@ -19,19 +19,19 @@ package com.sk89q.worldedit.regions; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Iterators; import com.sk89q.worldedit.BlockVector; -import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.world.World; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An intersection of several other regions. Any location that is contained in one * of the child regions is considered as contained by this region. @@ -69,7 +69,7 @@ public class RegionIntersection extends AbstractRegion { * @param world the world * @param regions a list of regions, which is copied */ - public RegionIntersection(LocalWorld world, List regions) { + public RegionIntersection(World world, List regions) { super(world); checkNotNull(regions); checkArgument(!regions.isEmpty(), "empty region list is not supported"); @@ -82,7 +82,7 @@ public class RegionIntersection extends AbstractRegion { * @param world the world * @param regions an array of regions, which is copied */ - public RegionIntersection(LocalWorld world, Region... regions) { + public RegionIntersection(World world, Region... regions) { super(world); checkNotNull(regions); checkArgument(regions.length > 0, "empty region list is not supported"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java index cb6d03974..4089be208 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java @@ -93,14 +93,6 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion { } } - /** - * @deprecated cast {@code world} to {@link World} - */ - @Deprecated - public Polygonal2DRegionSelector(@Nullable LocalWorld world, List points, int minY, int maxY) { - this((World) world, points, minY, maxY); - } - /** * Create a new selector. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java index d714508a8..b6392f093 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java @@ -31,7 +31,7 @@ import java.util.Set; /** * A region that mirrors the current selection according to the current - * {@link LocalSession} and {@link LocalWorld} set on the current + * {@link LocalSession} and {@link World} set on the current * {@link Request}. * *

If a selection cannot be taken, then the selection will be assumed to be @@ -128,11 +128,6 @@ public class RequestSelection implements Region { return getRegion().getWorld(); } - @Override - public void setWorld(LocalWorld world) { - setWorld((World) world); - } - @Override public void setWorld(World world) { getRegion().setWorld(world); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java index 4d75c45bd..e48aa77c0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java @@ -217,6 +217,15 @@ public class Location { xz * Math.cos(yaw)); } + /** + * Get the direction as a {@link Direction}. + * + * @return The direction + */ + public Direction getDirectionEnum() { + return Direction.findClosest(getDirection(), Direction.Flag.ALL); + } + /** * Create a clone of this object with the given direction. * @@ -356,6 +365,16 @@ public class Location { return new Location(extent, position.setZ(z), yaw, pitch); } + /** + * Return a copy of this object with the position set to the given value. + * + * @param position The new position + * @return a new immutable instance + */ + public Location setPosition(Vector position) { + return new Location(extent, position, yaw, pitch); + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java index d647ca067..72541f9d8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.internal.LocalWorldAdapter; +import com.sk89q.worldedit.world.World; /** * This class uses an inefficient method to figure out what block a player @@ -34,7 +34,7 @@ import com.sk89q.worldedit.internal.LocalWorldAdapter; */ public class TargetBlock { - private LocalWorld world; + private World world; private int maxDistance; private double checkDistance, curDistance; private Vector targetPos = new Vector(); @@ -47,33 +47,22 @@ public class TargetBlock { * * @param player player to work with */ - public TargetBlock(LocalPlayer player) { - this.world = LocalWorldAdapter.adapt(player.getWorld()); - this.setValues(player.getPosition(), player.getYaw(), player.getPitch(), + public TargetBlock(Player player) { + this.world = player.getWorld(); + this.setValues(player.getPosition().toVector(), player.getYaw(), player.getPitch(), 300, 1.65, 0.2); } /** * Constructor requiring a player, max distance and a checking distance * - * @param player LocalPlayer to work with - * @param maxDistance how far it checks for blocks - * @param checkDistance how often to check for blocks, the smaller the more precise - */ - public TargetBlock(LocalPlayer player, int maxDistance, double checkDistance) { - this((Player) player, maxDistance, checkDistance); - } - - /** - * Constructor requiring a player, max distance and a checking distance - * - * @param player LocalPlayer to work with + * @param player Player to work with * @param maxDistance how far it checks for blocks * @param checkDistance how often to check for blocks, the smaller the more precise */ public TargetBlock(Player player, int maxDistance, double checkDistance) { - this.world = LocalWorldAdapter.adapt(player.getWorld()); - this.setValues(player.getPosition(), player.getYaw(), player.getPitch(), maxDistance, 1.65, checkDistance); + this.world = player.getWorld(); + this.setValues(player.getPosition().toVector(), player.getYaw(), player.getPitch(), maxDistance, 1.65, checkDistance); } /** @@ -86,8 +75,7 @@ public class TargetBlock { * @param viewHeight where the view is positioned in y-axis * @param checkDistance how often to check for blocks, the smaller the more precise */ - private void setValues(Vector loc, double xRotation, double yRotation, - int maxDistance, double viewHeight, double checkDistance) { + private void setValues(Vector loc, double xRotation, double yRotation, int maxDistance, double viewHeight, double checkDistance) { this.maxDistance = maxDistance; this.checkDistance = checkDistance; this.curDistance = 0; @@ -111,11 +99,11 @@ public class TargetBlock { * * @return Block */ - public BlockWorldVector getAnyTargetBlock() { + public Location getAnyTargetBlock() { boolean searchForLastBlock = true; - BlockWorldVector lastBlock = null; + Location lastBlock = null; while (getNextBlock() != null) { - if (world.getBlockType(getCurrentBlock()) == BlockID.AIR) { + if (world.getBlockType(getCurrentBlock().toVector()) == BlockID.AIR) { if (searchForLastBlock) { lastBlock = getCurrentBlock(); if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= world.getMaxY()) { @@ -126,7 +114,7 @@ public class TargetBlock { break; } } - BlockWorldVector currentBlock = getCurrentBlock(); + Location currentBlock = getCurrentBlock(); return (currentBlock != null ? currentBlock : lastBlock); } @@ -136,8 +124,8 @@ public class TargetBlock { * * @return Block */ - public BlockWorldVector getTargetBlock() { - while (getNextBlock() != null && world.getBlockType(getCurrentBlock()) == 0) ; + public Location getTargetBlock() { + while (getNextBlock() != null && world.getBlockType(getCurrentBlock().toVector()) == 0) ; return getCurrentBlock(); } @@ -147,8 +135,8 @@ public class TargetBlock { * * @return Block */ - public BlockWorldVector getSolidTargetBlock() { - while (getNextBlock() != null && BlockType.canPassThrough(world.getBlock(getCurrentBlock()))) ; + public Location getSolidTargetBlock() { + while (getNextBlock() != null && BlockType.canPassThrough(world.getBlock(getCurrentBlock().toVector()))) ; return getCurrentBlock(); } @@ -157,7 +145,7 @@ public class TargetBlock { * * @return next block position */ - public BlockWorldVector getNextBlock() { + public Location getNextBlock() { prevPos = targetPos; do { curDistance += checkDistance; @@ -175,7 +163,7 @@ public class TargetBlock { return null; } - return new BlockWorldVector(world, targetPos); + return new Location(world, targetPos); } /** @@ -183,11 +171,11 @@ public class TargetBlock { * * @return block position */ - public BlockWorldVector getCurrentBlock() { + public Location getCurrentBlock() { if (curDistance > maxDistance) { return null; } else { - return new BlockWorldVector(world, targetPos); + return new Location(world, targetPos); } } @@ -196,18 +184,18 @@ public class TargetBlock { * * @return block position */ - public BlockWorldVector getPreviousBlock() { - return new BlockWorldVector(world, prevPos); + public Location getPreviousBlock() { + return new Location(world, prevPos); } - public WorldVectorFace getAnyTargetBlockFace() { + public Location getAnyTargetBlockFace() { getAnyTargetBlock(); - return WorldVectorFace.getWorldVectorFace(world, getCurrentBlock(), getPreviousBlock()); + return getCurrentBlock().setDirection(getCurrentBlock().toVector().subtract(getPreviousBlock().toVector())); } - public WorldVectorFace getTargetBlockFace() { + public Location getTargetBlockFace() { getAnyTargetBlock(); - return WorldVectorFace.getWorldVectorFace(world, getCurrentBlock(), getPreviousBlock()); + return getCurrentBlock().setDirection(getCurrentBlock().toVector().subtract(getPreviousBlock().toVector())); } } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index c0b1ed7ed..b68cbc3e4 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -21,18 +21,13 @@ package com.sk89q.worldedit.forge; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; -import com.sk89q.worldedit.internal.LocalWorldAdapter; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.Location; - import io.netty.buffer.Unpooled; -import java.util.UUID; -import javax.annotation.Nullable; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -42,6 +37,10 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; +import java.util.UUID; + +import javax.annotation.Nullable; + public class ForgePlayer extends AbstractPlayerActor { private final EntityPlayerMP player; @@ -59,7 +58,7 @@ public class ForgePlayer extends AbstractPlayerActor { @Override public int getItemInHand() { ItemStack is = this.player.getHeldItem(EnumHand.MAIN_HAND); - return is == null ? 0 : Item.getIdFromItem(is.getItem()); + return Item.getIdFromItem(is.getItem()); } @Override @@ -82,10 +81,9 @@ public class ForgePlayer extends AbstractPlayerActor { this.player.rotationPitch); } - @SuppressWarnings("deprecation") @Override - public WorldVector getPosition() { - return new WorldVector(LocalWorldAdapter.adapt(ForgeWorldEdit.inst.getWorld(this.player.world)), this.player.posX, this.player.posY, this.player.posZ); + public Location getPosition() { + return new Location(ForgeWorldEdit.inst.getWorld(this.player.world), this.player.posX, this.player.posY, this.player.posZ); } @Override diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index de09c5f64..16ce2ca3b 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -19,19 +19,17 @@ package com.sk89q.worldedit.forge; +import com.sk89q.worldedit.util.Location; import net.minecraft.block.Block; -import net.minecraftforge.fml.common.registry.ForgeRegistries; import org.apache.logging.log4j.Logger; import com.google.common.base.Joiner; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.event.platform.PlatformReadyEvent; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.forge.net.LeftClickAirEventMessage; -import com.sk89q.worldedit.internal.LocalWorldAdapter; import java.io.File; import java.util.Map; @@ -56,8 +54,6 @@ import net.minecraftforge.fml.common.event.FMLServerStartedEvent; import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; import net.minecraftforge.fml.common.eventhandler.Event.Result; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import org.spongepowered.api.Sponge; -import org.spongepowered.api.block.BlockType; import static com.google.common.base.Preconditions.checkNotNull; import static net.minecraft.block.Block.REGISTRY; @@ -191,9 +187,7 @@ public class ForgeWorldEdit { // event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.LeftClickBlock) { - @SuppressWarnings("deprecation") - WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), - event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); + Location pos = new Location(world, event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockLeftClick(player, pos)) { event.setCanceled(true); @@ -203,9 +197,7 @@ public class ForgeWorldEdit { event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.RightClickBlock) { - @SuppressWarnings("deprecation") - WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), - event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); + Location pos = new Location(world, event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockRightClick(player, pos)) { event.setCanceled(true); diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index 0d3577575..b8f57edda 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -22,11 +22,9 @@ package com.sk89q.worldedit.sponge; import com.flowpowered.math.vector.Vector3d; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; -import com.sk89q.worldedit.internal.LocalWorldAdapter; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.Location; @@ -39,11 +37,12 @@ import org.spongepowered.api.text.format.TextColors; import org.spongepowered.api.text.serializer.TextSerializers; import org.spongepowered.api.world.World; -import javax.annotation.Nullable; import java.nio.charset.StandardCharsets; import java.util.Optional; import java.util.UUID; +import javax.annotation.Nullable; + public class SpongePlayer extends AbstractPlayerActor { private final Player player; @@ -83,9 +82,9 @@ public class SpongePlayer extends AbstractPlayerActor { } @Override - public WorldVector getPosition() { + public Location getPosition() { Vector3d pos = this.player.getLocation().getPosition(); - return new WorldVector(LocalWorldAdapter.adapt(SpongeWorldEdit.inst().getAdapter().getWorld(this.player.getWorld())), pos.getX(), pos.getY(), pos.getZ()); + return new Location(SpongeWorldEdit.inst().getAdapter().getWorld(this.player.getWorld()), pos.getX(), pos.getY(), pos.getZ()); } @Override diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java index 12faa30ba..ae835075d 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java @@ -19,16 +19,16 @@ package com.sk89q.worldedit.sponge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.inject.Inject; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.event.platform.PlatformReadyEvent; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Platform; -import com.sk89q.worldedit.internal.LocalWorldAdapter; import com.sk89q.worldedit.sponge.adapter.AdapterLoadException; import com.sk89q.worldedit.sponge.adapter.SpongeImplAdapter; import com.sk89q.worldedit.sponge.adapter.SpongeImplLoader; @@ -44,7 +44,12 @@ import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.event.Listener; import org.spongepowered.api.event.block.InteractBlockEvent; import org.spongepowered.api.event.filter.cause.Root; -import org.spongepowered.api.event.game.state.*; +import org.spongepowered.api.event.game.state.GameAboutToStartServerEvent; +import org.spongepowered.api.event.game.state.GameInitializationEvent; +import org.spongepowered.api.event.game.state.GamePostInitializationEvent; +import org.spongepowered.api.event.game.state.GamePreInitializationEvent; +import org.spongepowered.api.event.game.state.GameStartedServerEvent; +import org.spongepowered.api.event.game.state.GameStoppingServerEvent; import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.plugin.Plugin; import org.spongepowered.api.plugin.PluginContainer; @@ -57,8 +62,6 @@ import java.io.IOException; import java.util.Optional; import java.util.concurrent.TimeUnit; -import static com.google.common.base.Preconditions.checkNotNull; - /** * The Sponge implementation of WorldEdit. */ @@ -207,7 +210,8 @@ public class SpongeWorldEdit { } Location loc = optLoc.get(); - WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), loc.getX(), loc.getY(), loc.getZ()); + com.sk89q.worldedit.util.Location pos = new com.sk89q.worldedit.util.Location( + world, loc.getX(), loc.getY(), loc.getZ()); if (we.handleBlockLeftClick(player, pos)) { event.setCancelled(true); @@ -228,7 +232,8 @@ public class SpongeWorldEdit { } Location loc = optLoc.get(); - WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), loc.getX(), loc.getY(), loc.getZ()); + com.sk89q.worldedit.util.Location pos = new com.sk89q.worldedit.util.Location( + world, loc.getX(), loc.getY(), loc.getZ()); if (we.handleBlockRightClick(player, pos)) { event.setCancelled(true); From aaaf2d5678ee92e94533f5b0d99e13b94108171d Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sat, 16 Jun 2018 16:36:55 +1000 Subject: [PATCH 13/74] More deprecation removal --- build.gradle | 4 +- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 17 --- .../sk89q/worldedit/bukkit/BukkitWorld.java | 2 - .../worldedit/bukkit/WorldEditListener.java | 2 +- .../worldedit/bukkit/WorldEditPlugin.java | 12 +- .../main/java/com/sk89q/jnbt/CompoundTag.java | 2 +- .../com/sk89q/jnbt/CompoundTagBuilder.java | 4 +- .../java/com/sk89q/jnbt/ListTagBuilder.java | 4 +- .../java/com/sk89q/jnbt/NBTInputStream.java | 4 +- .../util/commands/CommandContext.java | 12 +- .../util/commands/CommandException.java | 2 +- .../util/commands/CommandLocals.java | 2 +- .../util/commands/CommandsManager.java | 28 ++--- .../util/commands/SimpleInjector.java | 11 +- .../java/com/sk89q/util/ReflectionUtil.java | 3 +- .../java/com/sk89q/util/yaml/YAMLNode.java | 36 +++--- .../com/sk89q/util/yaml/YAMLProcessor.java | 53 +++----- .../com/sk89q/worldedit/CuboidClipboard.java | 14 +-- .../java/com/sk89q/worldedit/EditSession.java | 117 ++++-------------- .../sk89q/worldedit/LocalConfiguration.java | 4 +- .../java/com/sk89q/worldedit/WorldEdit.java | 59 +-------- .../com/sk89q/worldedit/blocks/BlockType.java | 42 +++---- .../sk89q/worldedit/blocks/ClothColor.java | 4 +- .../com/sk89q/worldedit/blocks/ItemType.java | 8 +- .../worldedit/blocks/type/BlockTypes.java | 1 - .../worldedit/command/BiomeCommands.java | 4 +- .../worldedit/command/BrushCommands.java | 1 - .../worldedit/command/GenerationCommands.java | 1 - .../worldedit/command/HistoryCommands.java | 4 +- .../worldedit/command/SchematicCommands.java | 54 +++----- .../worldedit/command/SelectionCommands.java | 24 ++-- .../command/SnapshotUtilCommands.java | 5 +- .../sk89q/worldedit/command/ToolCommands.java | 1 - .../worldedit/command/UtilityCommands.java | 10 +- .../command/argument/PatternParser.java | 2 - .../command/argument/RegionFactoryParser.java | 19 +-- .../composition/ShapedBrushCommand.java | 4 +- .../command/tool/BlockDataCyler.java | 11 +- .../command/tool/FloatingTreeRemover.java | 10 +- .../worldedit/command/tool/FloodFillTool.java | 11 +- .../command/tool/RecursivePickaxe.java | 3 +- .../worldedit/command/tool/SinglePickaxe.java | 5 +- .../worldedit/command/tool/TreePlanter.java | 1 - .../command/tool/brush/GravityBrush.java | 3 +- .../command/util/CreatureButcher.java | 103 ++++++++------- .../worldedit/command/util/EntityRemover.java | 21 ++-- .../com/sk89q/worldedit/entity/Player.java | 28 ----- .../extension/factory/BlockFactory.java | 2 +- .../extension/factory/DefaultMaskParser.java | 4 +- .../platform/AbstractPlayerActor.java | 20 +-- .../extension/platform/PlatformManager.java | 9 +- .../extension/platform/PlayerProxy.java | 15 --- .../permission/ActorSelectorLimits.java | 9 +- .../worldedit/extent/ChangeSetExtent.java | 2 +- .../extent/buffer/ForgetfulExtentBuffer.java | 3 +- .../extent/clipboard/BlockArrayClipboard.java | 5 +- .../extent/clipboard/io/ClipboardFormat.java | 15 +-- .../extent/clipboard/io/SchematicReader.java | 32 ++--- .../extent/clipboard/io/SchematicWriter.java | 14 +-- .../SignCompatibilityHandler.java | 1 - .../extent/inventory/BlockBagExtent.java | 4 +- .../extent/reorder/MultiStageReorder.java | 12 +- .../extent/world/FastModeExtent.java | 2 +- .../extent/world/SurvivalModeExtent.java | 1 - .../function/CombinedRegionFunction.java | 2 +- .../function/generator/ForestGenerator.java | 1 - .../generator/GardenPatchGenerator.java | 31 +++-- .../worldedit/function/mask/BiomeMask2D.java | 2 +- .../worldedit/function/mask/BlockMask.java | 2 +- .../function/mask/ExistingBlockMask.java | 1 - .../function/mask/MaskIntersection.java | 4 +- .../function/mask/MaskIntersection2D.java | 2 +- .../worldedit/function/mask/MaskUnion.java | 2 +- .../sk89q/worldedit/function/mask/Masks.java | 1 - .../function/operation/OperationQueue.java | 2 +- .../function/pattern/RandomPattern.java | 2 +- .../function/visitor/BreadthFirstSearch.java | 6 +- .../history/changeset/ArrayListHistory.java | 2 +- .../changeset/BlockOptimizedHistory.java | 11 +- .../internal/ServerInterfaceAdapter.java | 1 - .../command/CommandLoggingHandler.java | 2 +- .../command/UserCommandCompleter.java | 2 +- .../internal/expression/Expression.java | 6 +- .../internal/expression/lexer/Lexer.java | 9 +- .../internal/expression/parser/Parser.java | 10 +- .../expression/parser/ParserProcessors.java | 22 ++-- .../expression/runtime/Functions.java | 32 ++--- .../internal/expression/runtime/Sequence.java | 2 +- .../internal/expression/runtime/Switch.java | 8 +- .../internal/registry/AbstractFactory.java | 2 +- .../internal/util/DocumentationPrinter.java | 18 +-- .../sk89q/worldedit/math/geom/Polygons.java | 2 +- .../ReparametrisingInterpolation.java | 2 +- .../math/transform/CombinedTransform.java | 2 +- .../sk89q/worldedit/regions/CuboidRegion.java | 55 ++++---- .../worldedit/regions/CylinderRegion.java | 7 +- .../worldedit/regions/EllipsoidRegion.java | 2 +- .../worldedit/regions/Polygonal2DRegion.java | 11 +- .../worldedit/regions/RegionIntersection.java | 2 +- .../worldedit/regions/TransformRegion.java | 2 +- .../ConvexPolyhedralRegionSelector.java | 13 +- .../selector/CuboidRegionSelector.java | 2 +- .../selector/CylinderRegionSelector.java | 2 +- .../selector/EllipsoidRegionSelector.java | 2 +- .../selector/Polygonal2DRegionSelector.java | 13 +- .../regions/selector/RegionSelectorType.java | 4 +- .../limit/PermissiveSelectorLimits.java | 6 +- .../selector/limit/SelectorLimits.java | 2 +- .../shape/WorldEditExpressionEnvironment.java | 12 +- .../schematic/MCEditSchematicFormat.java | 43 +++---- .../worldedit/schematic/SchematicFormat.java | 1 - .../java/RhinoScriptEngineFactory.java | 35 +++--- .../worldedit/session/SessionManager.java | 39 +++--- .../worldedit/session/request/Request.java | 7 +- .../session/storage/JsonFileSessionStore.java | 16 +-- .../com/sk89q/worldedit/util/Countable.java | 8 +- .../sk89q/worldedit/util/FileDialogUtil.java | 2 +- .../sk89q/worldedit/util/Java7Detector.java | 46 ------- .../util/PropertiesConfiguration.java | 28 +---- .../com/sk89q/worldedit/util/TargetBlock.java | 10 +- .../sk89q/worldedit/util/TreeGenerator.java | 59 ++++++--- .../sk89q/worldedit/util/WeightedChoice.java | 20 ++- .../worldedit/util/YAMLConfiguration.java | 4 +- .../util/collection/DoubleArrayList.java | 8 +- .../util/collection/FastListIterator.java | 6 +- .../util/collection/TupleArrayList.java | 2 +- .../util/command/SimpleDescription.java | 4 +- .../util/command/SimpleDispatcher.java | 8 +- .../util/command/composition/FlagParser.java | 2 +- .../command/composition/ProvidedValue.java | 2 +- .../command/parametric/BindingHelper.java | 8 +- .../parametric/ExceptionConverterHelper.java | 6 +- .../command/parametric/ParametricBuilder.java | 4 +- .../parametric/ParametricCallable.java | 10 +- .../util/concurrency/EvenMoreExecutors.java | 2 +- .../worldedit/util/eventbus/EventBus.java | 26 ++-- .../util/eventbus/HierarchyCache.java | 2 +- .../util/formatting/ColorCodeBuilder.java | 7 +- .../util/formatting/StyledFragment.java | 2 +- .../formatting/component/CommandUsageBox.java | 4 +- .../com/sk89q/worldedit/util/io/Closer.java | 4 +- .../worldedit/util/logging/LogFormat.java | 1 - .../sk89q/worldedit/world/AbstractWorld.java | 24 +--- .../java/com/sk89q/worldedit/world/World.java | 13 -- .../sk89q/worldedit/world/biome/Biomes.java | 11 +- .../worldedit/world/chunk/AnvilChunk.java | 32 ++--- .../sk89q/worldedit/world/chunk/OldChunk.java | 32 ++--- .../world/snapshot/SnapshotRepository.java | 15 +-- .../world/snapshot/SnapshotRestore.java | 16 +-- .../sk89q/worldedit/forge/ForgePlayer.java | 15 --- .../com/sk89q/worldedit/forge/ForgeWorld.java | 3 +- .../sk89q/worldedit/sponge/SpongePlayer.java | 16 --- 152 files changed, 701 insertions(+), 1150 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/Java7Detector.java diff --git a/build.gradle b/build.gradle index 000fd44ee..496b8987a 100644 --- a/build.gradle +++ b/build.gradle @@ -87,8 +87,8 @@ subprojects { ext.internalVersion = version + ";" + gitCommitHash - sourceCompatibility = 1.7 - targetCompatibility = 1.7 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml") checkstyle.toolVersion = '7.6.1' diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index 5bfba060a..d0224b154 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -71,23 +71,6 @@ public class BukkitPlayer extends AbstractPlayerActor { return player.getName(); } - @Override - public com.sk89q.worldedit.util.Location getPosition() { - Location loc = player.getLocation(); - return new com.sk89q.worldedit.util.Location(BukkitUtil.getWorld(loc.getWorld()), - loc.getX(), loc.getY(), loc.getZ()); - } - - @Override - public double getPitch() { - return player.getLocation().getPitch(); - } - - @Override - public double getYaw() { - return player.getLocation().getYaw(); - } - @Override public void giveItem(int type, int amt) { player.getInventory().addItem(new ItemStack(type, amt)); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 4c9fc09e5..7f3c11aac 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -329,7 +329,6 @@ public class BukkitWorld extends AbstractWorld { world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem); } - @SuppressWarnings("deprecation") @Override public boolean isValidBlockType(int type) { return Material.getMaterial(type) != null && Material.getMaterial(type).isBlock(); @@ -421,7 +420,6 @@ public class BukkitWorld extends AbstractWorld { } } - @SuppressWarnings("deprecation") @Override public BaseBlock getLazyBlock(Vector position) { World world = getWorld(); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java index b5ab6c75a..44dd56b44 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java @@ -66,7 +66,7 @@ public class WorldEditListener implements Listener { } // this will automatically refresh their session, we don't have to do anything - WorldEdit.getInstance().getSession(plugin.wrapPlayer(event.getPlayer())); + WorldEdit.getInstance().getSessionManager().get(plugin.wrapPlayer(event.getPlayer())); } /** diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index cb79b34c1..4910db731 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -47,7 +47,6 @@ import com.sk89q.worldedit.regions.CylinderRegion; import com.sk89q.worldedit.regions.Polygonal2DRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionSelector; -import com.sk89q.worldedit.util.Java7Detector; import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -114,9 +113,6 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent()); loadAdapter(); // Need an adapter to work with special blocks with NBT data - - // Check Java version - Java7Detector.notifyIfNot8(); } private void loadConfig() { @@ -164,7 +160,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { @Override public void onDisable() { WorldEdit worldEdit = WorldEdit.getInstance(); - worldEdit.clearSessions(); + worldEdit.getSessionManager().clear(); worldEdit.getPlatformManager().unregister(server); if (config != null) { config.unload(); @@ -264,7 +260,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { * @return a session */ public LocalSession getSession(Player player) { - return WorldEdit.getInstance().getSession(wrapPlayer(player)); + return WorldEdit.getInstance().getSessionManager().get(wrapPlayer(player)); } /** @@ -364,7 +360,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { throw new IllegalArgumentException("Offline player not allowed"); } - LocalSession session = WorldEdit.getInstance().getSession(wrapPlayer(player)); + LocalSession session = WorldEdit.getInstance().getSessionManager().get(wrapPlayer(player)); RegionSelector selector = session.getRegionSelector(BukkitUtil.getWorld(player.getWorld())); try { @@ -402,7 +398,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { throw new IllegalArgumentException("Null selection not allowed"); } - LocalSession session = WorldEdit.getInstance().getSession(wrapPlayer(player)); + LocalSession session = WorldEdit.getInstance().getSessionManager().get(wrapPlayer(player)); RegionSelector sel = selection.getRegionSelector(); session.setRegionSelector(BukkitUtil.getWorld(player.getWorld()), sel); session.dispatchCUISelection(wrapPlayer(player)); diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java index 6477d2502..8f1a7793c 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java @@ -72,7 +72,7 @@ public final class CompoundTag extends Tag { * @return the builder */ public CompoundTagBuilder createBuilder() { - return new CompoundTagBuilder(new HashMap(value)); + return new CompoundTagBuilder(new HashMap<>(value)); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java index 3d476fa40..0bd661967 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java @@ -35,7 +35,7 @@ public class CompoundTagBuilder { * Create a new instance. */ CompoundTagBuilder() { - this.entries = new HashMap(); + this.entries = new HashMap<>(); } /** @@ -189,7 +189,7 @@ public class CompoundTagBuilder { * @return the new compound tag */ public CompoundTag build() { - return new CompoundTag(new HashMap(entries)); + return new CompoundTag(new HashMap<>(entries)); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java index 9bcbbfd05..cd1f11e25 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java @@ -42,7 +42,7 @@ public class ListTagBuilder { ListTagBuilder(Class type) { checkNotNull(type); this.type = type; - this.entries = new ArrayList(); + this.entries = new ArrayList<>(); } /** @@ -80,7 +80,7 @@ public class ListTagBuilder { * @return the new list tag */ public ListTag build() { - return new ListTag(type, new ArrayList(entries)); + return new ListTag(type, new ArrayList<>(entries)); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java index 223ca2248..bd6a1f9f2 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java @@ -128,7 +128,7 @@ public final class NBTInputStream implements Closeable { int childType = is.readByte(); length = is.readInt(); - List tagList = new ArrayList(); + List tagList = new ArrayList<>(); for (int i = 0; i < length; ++i) { Tag tag = readTagPayload(childType, depth + 1); if (tag instanceof EndTag) { @@ -139,7 +139,7 @@ public final class NBTInputStream implements Closeable { return new ListTag(NBTUtils.getTypeClass(childType), tagList); case NBTConstants.TYPE_COMPOUND: - Map tagMap = new HashMap(); + Map tagMap = new HashMap<>(); while (true) { NamedTag namedTag = readNamedTag(depth + 1); Tag tag = namedTag.getTag(); diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandContext.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandContext.java index d1db70207..9dfc58d6f 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandContext.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandContext.java @@ -34,8 +34,8 @@ public class CommandContext { protected final List originalArgIndices; protected final String[] originalArgs; - protected final Set booleanFlags = new HashSet(); - protected final Map valueFlags = new HashMap(); + protected final Set booleanFlags = new HashSet<>(); + protected final Map valueFlags = new HashMap<>(); protected final SuggestionContext suggestionContext; protected final CommandLocals locals; @@ -103,8 +103,8 @@ public class CommandContext { SuggestionContext suggestionContext = SuggestionContext.hangingValue(); // Eliminate empty args and combine multiword args first - List argIndexList = new ArrayList(args.length); - List argList = new ArrayList(args.length); + List argIndexList = new ArrayList<>(args.length); + List argList = new ArrayList<>(args.length); for (int i = 1; i < args.length; ++i) { isHanging = false; @@ -152,8 +152,8 @@ public class CommandContext { // Then flags - this.originalArgIndices = new ArrayList(argIndexList.size()); - this.parsedArgs = new ArrayList(argList.size()); + this.originalArgIndices = new ArrayList<>(argIndexList.size()); + this.parsedArgs = new ArrayList<>(argList.size()); if (parseFlags) { for (int nextArg = 0; nextArg < argList.size(); ) { diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java index e81344e56..1dcbdde1e 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java @@ -28,7 +28,7 @@ import static com.google.common.base.Preconditions.checkNotNull; public class CommandException extends Exception { - private List commandStack = new ArrayList(); + private List commandStack = new ArrayList<>(); public CommandException() { super(); diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandLocals.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandLocals.java index e0053f0b3..0bc2992a5 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandLocals.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandLocals.java @@ -24,7 +24,7 @@ import java.util.Map; public class CommandLocals { - private final Map locals = new HashMap(); + private final Map locals = new HashMap<>(); public boolean containsKey(Object key) { return locals.containsKey(key); diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java index eec7ced7c..a8f49678b 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java @@ -72,18 +72,18 @@ public abstract class CommandsManager { * the key of the command name (one for each alias) with the * method. */ - protected Map> commands = new HashMap>(); + protected Map> commands = new HashMap<>(); /** * Used to store the instances associated with a method. */ - protected Map instances = new HashMap(); + protected Map instances = new HashMap<>(); /** * Mapping of commands (not including aliases) with a description. This * is only for top level commands. */ - protected Map descs = new HashMap(); + protected Map descs = new HashMap<>(); /** * Stores the injector used to getInstance. @@ -94,7 +94,7 @@ public abstract class CommandsManager { * Mapping of commands (not including aliases) with a description. This * is only for top level commands. */ - protected Map helpMessages = new HashMap(); + protected Map helpMessages = new HashMap<>(); /** * Register an class that contains commands (denoted by {@link Command}. @@ -141,11 +141,7 @@ public abstract class CommandsManager { Object obj = getInjector().getInstance(cls); return registerMethods(cls, parent, obj); } - } catch (InvocationTargetException e) { - logger.log(Level.SEVERE, "Failed to register commands", e); - } catch (IllegalAccessException e) { - logger.log(Level.SEVERE, "Failed to register commands", e); - } catch (InstantiationException e) { + } catch (InvocationTargetException | InstantiationException | IllegalAccessException e) { logger.log(Level.SEVERE, "Failed to register commands", e); } return null; @@ -161,14 +157,14 @@ public abstract class CommandsManager { */ private List registerMethods(Class cls, Method parent, Object obj) { Map map; - List registered = new ArrayList(); + List registered = new ArrayList<>(); // Make a new hash map to cache the commands for this class // as looking up methods via reflection is fairly slow if (commands.containsKey(parent)) { map = commands.get(parent); } else { - map = new HashMap(); + map = new HashMap<>(); commands.put(parent, map); } @@ -359,7 +355,7 @@ public abstract class CommandsManager { command.append("<"); - Set allowedCommands = new HashSet(); + Set allowedCommands = new HashSet<>(); for (Map.Entry entry : map.entrySet()) { Method childMethod = entry.getValue(); @@ -479,10 +475,10 @@ public abstract class CommandsManager { String[] newArgs = new String[args.length - level]; System.arraycopy(args, level, newArgs, 0, args.length - level); - final Set valueFlags = new HashSet(); + final Set valueFlags = new HashSet<>(); char[] flags = cmd.flags().toCharArray(); - Set newFlags = new HashSet(); + Set newFlags = new HashSet<>(); for (int i = 0; i < flags.length; ++i) { if (flags.length > i + 1 && flags[i + 1] == ':') { valueFlags.add(flags[i]); @@ -526,9 +522,7 @@ public abstract class CommandsManager { public void invokeMethod(Method parent, String[] args, T player, Method method, Object instance, Object[] methodArgs, int level) throws CommandException { try { method.invoke(instance, methodArgs); - } catch (IllegalArgumentException e) { - logger.log(Level.SEVERE, "Failed to execute command", e); - } catch (IllegalAccessException e) { + } catch (IllegalArgumentException | IllegalAccessException e) { logger.log(Level.SEVERE, "Failed to execute command", e); } catch (InvocationTargetException e) { if (e.getCause() instanceof CommandException) { diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/SimpleInjector.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/SimpleInjector.java index ca3e82f92..eb6097512 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/SimpleInjector.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/SimpleInjector.java @@ -44,16 +44,7 @@ public class SimpleInjector implements Injector { Constructor ctr = clazz.getConstructor(argClasses); ctr.setAccessible(true); return ctr.newInstance(args); - } catch (NoSuchMethodException e) { - log.log(Level.SEVERE, "Error initializing commands class " + clazz, e); - return null; - } catch (InvocationTargetException e) { - log.log(Level.SEVERE, "Error initializing commands class " + clazz, e); - return null; - } catch (InstantiationException e) { - log.log(Level.SEVERE, "Error initializing commands class " + clazz, e); - return null; - } catch (IllegalAccessException e) { + } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { log.log(Level.SEVERE, "Error initializing commands class " + clazz, e); return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/util/ReflectionUtil.java b/worldedit-core/src/main/java/com/sk89q/util/ReflectionUtil.java index 0b80816f7..81388e619 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/ReflectionUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/util/ReflectionUtil.java @@ -34,8 +34,7 @@ public final class ReflectionUtil { Field field = checkClass.getDeclaredField(name); field.setAccessible(true); return (T) field.get(from); - } catch (NoSuchFieldException ignored) { - } catch (IllegalAccessException ignored) { + } catch (NoSuchFieldException | IllegalAccessException ignored) { } } while (checkClass.getSuperclass() != Object.class && ((checkClass = checkClass.getSuperclass()) != null)); return null; diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java index ff0bda3a4..22b09cd48 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java @@ -111,7 +111,7 @@ public class YAMLNode { */ private Object prepareSerialization(Object value) { if (value instanceof Vector) { - Map out = new LinkedHashMap(); + Map out = new LinkedHashMap<>(); Vector vec = (Vector) value; out.put("x", vec.getX()); out.put("y", vec.getY()); @@ -169,7 +169,7 @@ public class YAMLNode { * @return a node for the path */ public YAMLNode addNode(String path) { - Map map = new LinkedHashMap(); + Map map = new LinkedHashMap<>(); YAMLNode node = new YAMLNode(map, writeDefaults); setProperty(path, map); return node; @@ -398,12 +398,12 @@ public class YAMLNode { */ @SuppressWarnings("unchecked") public List getKeys(String path) { - if (path == null) return new ArrayList(root.keySet()); + if (path == null) return new ArrayList<>(root.keySet()); Object o = getProperty(path); if (o == null) { return null; } else if (o instanceof Map) { - return new ArrayList(((Map) o).keySet()); + return new ArrayList<>(((Map) o).keySet()); } else { return null; } @@ -444,10 +444,10 @@ public class YAMLNode { List raw = getList(path); if (raw == null) { if (writeDefaults && def != null) setProperty(path, def); - return def != null ? def : new ArrayList(); + return def != null ? def : new ArrayList<>(); } - List list = new ArrayList(); + List list = new ArrayList<>(); for (Object o : raw) { if (o == null) { continue; @@ -474,10 +474,10 @@ public class YAMLNode { List raw = getList(path); if (raw == null) { if (writeDefaults && def != null) setProperty(path, def); - return def != null ? def : new ArrayList(); + return def != null ? def : new ArrayList<>(); } - List list = new ArrayList(); + List list = new ArrayList<>(); for (Object o : raw) { Integer i = castInt(o); if (i != null) { @@ -503,10 +503,10 @@ public class YAMLNode { List raw = getList(path); if (raw == null) { if (writeDefaults && def != null) setProperty(path, def); - return def != null ? def : new ArrayList(); + return def != null ? def : new ArrayList<>(); } - List list = new ArrayList(); + List list = new ArrayList<>(); for (Object o : raw) { Double i = castDouble(o); if (i != null) { @@ -532,10 +532,10 @@ public class YAMLNode { List raw = getList(path); if (raw == null) { if (writeDefaults && def != null) setProperty(path, def); - return def != null ? def : new ArrayList(); + return def != null ? def : new ArrayList<>(); } - List list = new ArrayList(); + List list = new ArrayList<>(); for (Object o : raw) { Boolean tetsu = castBoolean(o); if (tetsu != null) { @@ -559,7 +559,7 @@ public class YAMLNode { */ public List getVectorList(String path, List def) { List raw = getNodeList(path, null); - List list = new ArrayList(); + List list = new ArrayList<>(); for (YAMLNode o : raw) { Double x = o.getDouble("x"); @@ -590,7 +590,7 @@ public class YAMLNode { public List getVector2dList(String path, List def) { List raw = getNodeList(path, null); - List list = new ArrayList(); + List list = new ArrayList<>(); for (YAMLNode o : raw) { Double x = o.getDouble("x"); @@ -620,7 +620,7 @@ public class YAMLNode { public List getBlockVector2dList(String path, List def) { List raw = getNodeList(path, null); - List list = new ArrayList(); + List list = new ArrayList<>(); for (YAMLNode o : raw) { Double x = o.getDouble("x"); @@ -652,10 +652,10 @@ public class YAMLNode { List raw = getList(path); if (raw == null) { if (writeDefaults && def != null) setProperty(path, def); - return def != null ? def : new ArrayList(); + return def != null ? def : new ArrayList<>(); } - List list = new ArrayList(); + List list = new ArrayList<>(); for (Object o : raw) { if (o instanceof Map) { list.add(new YAMLNode((Map) o, writeDefaults)); @@ -698,7 +698,7 @@ public class YAMLNode { return null; } else if (o instanceof Map) { Map nodes = - new LinkedHashMap(); + new LinkedHashMap<>(); for (Map.Entry entry : ((Map) o).entrySet()) { if (entry.getValue() instanceof Map) { diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java index e0ecdf33f..0d09fe64f 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java @@ -31,6 +31,7 @@ import org.yaml.snakeyaml.representer.Represent; import org.yaml.snakeyaml.representer.Representer; import java.io.*; +import java.nio.charset.StandardCharsets; import java.util.*; import java.util.Map.Entry; @@ -76,10 +77,10 @@ public class YAMLProcessor extends YAMLNode { * Comments support based on ZerothAngel's AnnotatedYAMLConfiguration * Comments are only supported with YAMLFormat.EXTENDED */ - private final Map comments = new HashMap(); + private final Map comments = new HashMap<>(); public YAMLProcessor(File file, boolean writeDefaults, YAMLFormat format) { - super(new LinkedHashMap(), writeDefaults); + super(new LinkedHashMap<>(), writeDefaults); this.format = format; DumperOptions options = new FancyDumperOptions(); @@ -103,21 +104,13 @@ public class YAMLProcessor extends YAMLNode { * @throws java.io.IOException on load error */ public void load() throws IOException { - InputStream stream = null; - try { - stream = getInputStream(); - if (stream == null) throw new IOException("Stream is null!"); + try (InputStream stream = getInputStream()) { + if (stream == null) + throw new IOException("Stream is null!"); read(yaml.load(new UnicodeReader(stream))); } catch (YAMLProcessorException e) { - root = new LinkedHashMap(); - } finally { - try { - if (stream != null) { - stream.close(); - } - } catch (IOException ignored) { - } + root = new LinkedHashMap<>(); } } @@ -167,18 +160,15 @@ public class YAMLProcessor extends YAMLNode { * @return true if it was successful */ public boolean save() { - OutputStream stream = null; File parent = file.getParentFile(); - if (parent != null) { parent.mkdirs(); } - - try { - stream = getOutputStream(); - if (stream == null) return false; - OutputStreamWriter writer = new OutputStreamWriter(stream, "UTF-8"); + try (OutputStream stream = getOutputStream()) { + if (stream == null) + return false; + OutputStreamWriter writer = new OutputStreamWriter(stream, StandardCharsets.UTF_8); if (header != null) { writer.append(header); writer.append(LINE_BREAK); @@ -187,7 +177,7 @@ public class YAMLProcessor extends YAMLNode { yaml.dump(root, writer); } else { // Iterate over each root-level property and dump - for (Entry entry : root.entrySet()) { + for (Entry entry: root.entrySet()) { // Output comment, if present String comment = comments.get(entry.getKey()); if (comment != null) { @@ -202,12 +192,6 @@ public class YAMLProcessor extends YAMLNode { } return true; } catch (IOException ignored) { - } finally { - try { - if (stream != null) { - stream.close(); - } - } catch (IOException ignored) {} } return false; @@ -217,9 +201,9 @@ public class YAMLProcessor extends YAMLNode { private void read(Object input) throws YAMLProcessorException { try { if (null == input) { - root = new LinkedHashMap(); + root = new LinkedHashMap<>(); } else { - root = new LinkedHashMap((Map) input); + root = new LinkedHashMap<>((Map) input); } } catch (ClassCastException e) { throw new YAMLProcessorException("Root document must be an key-value structure"); @@ -302,7 +286,7 @@ public class YAMLProcessor extends YAMLNode { * @return a node */ public static YAMLNode getEmptyNode(boolean writeDefaults) { - return new YAMLNode(new LinkedHashMap(), writeDefaults); + return new YAMLNode(new LinkedHashMap<>(), writeDefaults); } // This will be included in snakeyaml 1.10, but until then we have to do it manually. @@ -321,12 +305,7 @@ public class YAMLProcessor extends YAMLNode { private static class FancyRepresenter extends Representer { private FancyRepresenter() { - this.nullRepresenter = new Represent() { - @Override - public Node representData(Object o) { - return representScalar(Tag.NULL, ""); - } - }; + this.nullRepresenter = o -> representScalar(Tag.NULL, ""); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java index 5acdccd48..71e3cc370 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java @@ -159,7 +159,6 @@ public class CuboidClipboard { * * @param angle in degrees */ - @SuppressWarnings("deprecation") public void rotate2D(int angle) { angle = angle % 360; if (angle % 90 != 0) { // Can only rotate 90 degrees at the moment @@ -229,7 +228,6 @@ public class CuboidClipboard { * @param dir direction to flip * @param aroundPlayer flip the offset around the player */ - @SuppressWarnings("deprecation") public void flip(FlipDirection dir, boolean aroundPlayer) { checkNotNull(dir); @@ -607,8 +605,8 @@ public class CuboidClipboard { * @return a block distribution */ public List> getBlockDistribution() { - List> distribution = new ArrayList>(); - Map> map = new HashMap>(); + List> distribution = new ArrayList<>(); + Map> map = new HashMap<>(); int maxX = getWidth(); int maxY = getHeight(); @@ -627,7 +625,7 @@ public class CuboidClipboard { if (map.containsKey(id)) { map.get(id).increment(); } else { - Countable c = new Countable(id, 1); + Countable c = new Countable<>(id, 1); map.put(id, c); distribution.add(c); } @@ -648,8 +646,8 @@ public class CuboidClipboard { */ // TODO reduce code duplication public List> getBlockDistributionWithData() { - List> distribution = new ArrayList>(); - Map> map = new HashMap>(); + List> distribution = new ArrayList<>(); + Map> map = new HashMap<>(); int maxX = getWidth(); int maxY = getHeight(); @@ -669,7 +667,7 @@ public class CuboidClipboard { if (map.containsKey(bareBlock)) { map.get(bareBlock).increment(); } else { - Countable c = new Countable(bareBlock, 1); + Countable c = new Countable<>(bareBlock, 1); map.put(bareBlock, c); distribution.add(c); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index e24caa27d..0537110fd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -374,30 +374,6 @@ public class EditSession implements Extent { return world.getBlock(position); } - /** - * Get a block type at the given position. - * - * @param position the position - * @return the block type - * @deprecated Use {@link #getLazyBlock(Vector)} or {@link #getBlock(Vector)} - */ - @Deprecated - public int getBlockType(Vector position) { - return world.getBlockType(position); - } - - /** - * Get a block data at the given position. - * - * @param position the position - * @return the block data - * @deprecated Use {@link #getLazyBlock(Vector)} or {@link #getBlock(Vector)} - */ - @Deprecated - public int getBlockData(Vector position) { - return world.getBlockData(position); - } - /** * Gets the block type at a position. * @@ -436,8 +412,9 @@ public class EditSession implements Extent { public int getHighestTerrainBlock(int x, int z, int minY, int maxY, boolean naturalOnly) { for (int y = maxY; y >= minY; --y) { Vector pt = new Vector(x, y, z); - int id = getBlockType(pt); - int data = getBlockData(pt); + BaseBlock block = getLazyBlock(pt); + int id = block.getId(); + int data = block.getData(); if (naturalOnly ? BlockType.isNaturalTerrainBlock(id, data) : !BlockType.canPassThrough(id, data)) { return y; } @@ -538,35 +515,6 @@ public class EditSession implements Extent { return affected; } - /** - * Set a block (only if a previous block was not there) if {@link Math#random()} - * returns a number less than the given probability. - * - * @param position the position - * @param block the block - * @param probability a probability between 0 and 1, inclusive - * @return whether a block was changed - * @throws MaxChangedBlocksException thrown if too many blocks are changed - */ - public boolean setChanceBlockIfAir(Vector position, BaseBlock block, double probability) - throws MaxChangedBlocksException { - return Math.random() <= probability && setBlockIfAir(position, block); - } - - /** - * Set a block only if there's no block already there. - * - * @param position the position - * @param block the block to set - * @return if block was changed - * @throws MaxChangedBlocksException thrown if too many blocks are changed - * @deprecated Use your own method - */ - @Deprecated - public boolean setBlockIfAir(Vector position, BaseBlock block) throws MaxChangedBlocksException { - return getBlock(position).isAir() && setBlock(position, block); - } - @Override @Nullable public Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) { @@ -1504,8 +1452,8 @@ public class EditSession implements Extent { int oy = position.getBlockY(); int oz = position.getBlockZ(); - BaseBlock air = new BaseBlock(0); - BaseBlock water = new BaseBlock(BlockID.STATIONARY_WATER); + BaseBlock air = new BaseBlock(BlockTypes.AIR); + BaseBlock water = new BaseBlock(BlockTypes.WATER); int ceilRadius = (int) Math.ceil(radius); for (int x = ox - ceilRadius; x <= ox + ceilRadius; ++x) { @@ -1516,26 +1464,18 @@ public class EditSession implements Extent { for (int y = world.getMaxY(); y >= 1; --y) { Vector pt = new Vector(x, y, z); - int id = getBlockType(pt); + com.sk89q.worldedit.blocks.type.BlockType id = getLazyBlock(pt).getType(); - switch (id) { - case BlockID.ICE: + if (id == BlockTypes.ICE) { if (setBlock(pt, water)) { ++affected; } - break; - - case BlockID.SNOW: + } else if (id == BlockTypes.SNOW) { if (setBlock(pt, air)) { ++affected; } - break; - - case BlockID.AIR: + } else if (id == BlockTypes.AIR) { continue; - - default: - break; } break; @@ -1562,8 +1502,8 @@ public class EditSession implements Extent { int oy = position.getBlockY(); int oz = position.getBlockZ(); - BaseBlock ice = new BaseBlock(BlockID.ICE); - BaseBlock snow = new BaseBlock(BlockID.SNOW); + BaseBlock ice = new BaseBlock(BlockTypes.ICE); + BaseBlock snow = new BaseBlock(BlockTypes.SNOW); int ceilRadius = (int) Math.ceil(radius); for (int x = ox - ceilRadius; x <= ox + ceilRadius; ++x) { @@ -1574,7 +1514,7 @@ public class EditSession implements Extent { for (int y = world.getMaxY(); y >= 1; --y) { Vector pt = new Vector(x, y, z); - int id = getBlockType(pt); + int id = getLazyBlock(pt).getId(); if (id == BlockID.AIR) { continue; @@ -1613,20 +1553,6 @@ public class EditSession implements Extent { return affected; } - /** - * Make dirt green. - * - * @param position a position - * @param radius a radius - * @return number of blocks affected - * @throws MaxChangedBlocksException thrown if too many blocks are changed - * @deprecated Use {@link #green(Vector, double, boolean)}. - */ - @Deprecated - public int green(Vector position, double radius) throws MaxChangedBlocksException { - return green(position, radius, true); - } - /** * Make dirt green. * @@ -1656,8 +1582,9 @@ public class EditSession implements Extent { loop: for (int y = world.getMaxY(); y >= 1; --y) { final Vector pt = new Vector(x, y, z); - final int id = getBlockType(pt); - final int data = getBlockData(pt); + final BaseBlock block = getLazyBlock(pt); + final int id = block.getId(); + final int data = block.getData(); switch (id) { case BlockID.DIRT: @@ -1789,7 +1716,7 @@ public class EditSession implements Extent { for (int z = minZ; z <= maxZ; ++z) { Vector pt = new Vector(x, y, z); - int id = getBlockType(pt); + int id = getLazyBlock(pt).getId(); if (map.containsKey(id)) { map.get(id).increment(); @@ -1803,7 +1730,7 @@ public class EditSession implements Extent { } } else { for (Vector pt : region) { - int id = getBlockType(pt); + int id = getLazyBlock(pt).getId(); if (map.containsKey(id)) { map.get(id).increment(); @@ -1848,7 +1775,7 @@ public class EditSession implements Extent { for (int z = minZ; z <= maxZ; ++z) { Vector pt = new Vector(x, y, z); - BaseBlock blk = new BaseBlock(getBlockType(pt), getBlockData(pt)); + BaseBlock blk = getBlock(pt); if (map.containsKey(blk)) { map.get(blk).increment(); @@ -1862,7 +1789,7 @@ public class EditSession implements Extent { } } else { for (Vector pt : region) { - BaseBlock blk = new BaseBlock(getBlockType(pt), getBlockData(pt)); + BaseBlock blk = getBlock(pt); if (map.containsKey(blk)) { map.get(blk).increment(); @@ -1935,8 +1862,7 @@ public class EditSession implements Extent { final BlockVector sourcePosition = environment.toWorld(x.getValue(), y.getValue(), z.getValue()); // read block from world - // TODO: use getBlock here once the reflection is out of the way - final BaseBlock material = new BaseBlock(world.getBlockType(sourcePosition), world.getBlockData(sourcePosition)); + final BaseBlock material = world.getBlock(sourcePosition); // queue operation queue.put(position, material); @@ -2202,7 +2128,8 @@ public class EditSession implements Extent { while (!queue.isEmpty()) { final BlockVector current = queue.removeFirst(); - if (!BlockType.canPassThrough(getBlockType(current), getBlockData(current))) { + final BaseBlock block = getLazyBlock(current); + if (!BlockType.canPassThrough(block.getId(), block.getData())) { continue; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java index 3266671b3..613d60941 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java @@ -79,7 +79,7 @@ public abstract class LocalConfiguration { }; public boolean profile = false; - public Set disallowedBlocks = new HashSet(); + public Set disallowedBlocks = new HashSet<>(); public int defaultChangeLimit = -1; public int maxChangeLimit = -1; public int defaultMaxPolygonalPoints = -1; @@ -106,7 +106,7 @@ public abstract class LocalConfiguration { public int navigationWand = ItemID.COMPASS; public int navigationWandMaxDistance = 50; public int scriptTimeout = 3000; - public Set allowedDataCycleBlocks = new HashSet(); + public Set allowedDataCycleBlocks = new HashSet<>(); public String saveDir = "schematics"; public String scriptsDir = "craftscripts"; public boolean showHelpInfo = true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 7114db65a..43471520d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -191,50 +191,9 @@ public class WorldEdit { return sessions; } - /** - * @deprecated Use {@link #getSessionManager()} - */ - @Deprecated - public LocalSession getSession(String player) { - return sessions.findByName(player); - } - - /** - * @deprecated use {@link #getSessionManager()} - */ - @Deprecated - public LocalSession getSession(Player player) { - return sessions.get(player); - } - - /** - * @deprecated use {@link #getSessionManager()} - */ - @Deprecated - public void removeSession(Player player) { - sessions.remove(player); - } - - /** - * @deprecated use {@link #getSessionManager()} - */ - @Deprecated - public void clearSessions() { - sessions.clear(); - } - - /** - * @deprecated use {@link #getSessionManager()} - */ - @Deprecated - public boolean hasSession(Player player) { - return sessions.contains(player); - } - /** * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromInput(String, ParserContext)} */ - @SuppressWarnings("deprecation") @Deprecated public BaseBlock getBlock(Player player, String arg, boolean allAllowed) throws WorldEditException { return getBlock(player, arg, allAllowed, false); @@ -243,13 +202,12 @@ public class WorldEdit { /** * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromInput(String, ParserContext)} */ - @SuppressWarnings("deprecation") @Deprecated public BaseBlock getBlock(Player player, String arg, boolean allAllowed, boolean allowNoData) throws WorldEditException { ParserContext context = new ParserContext(); context.setActor(player); context.setWorld(player.getWorld()); - context.setSession(getSession(player)); + context.setSession(getSessionManager().get(player)); context.setRestricted(!allAllowed); context.setPreferringWildcard(allowNoData); return getBlockFactory().parseFromInput(arg, context); @@ -258,7 +216,6 @@ public class WorldEdit { /** * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromInput(String, ParserContext)} */ - @SuppressWarnings("deprecation") @Deprecated public BaseBlock getBlock(Player player, String id) throws WorldEditException { return getBlock(player, id, false); @@ -268,10 +225,9 @@ public class WorldEdit { * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromListInput(String, ParserContext)} */ @Deprecated - @SuppressWarnings("deprecation") public Set getBlocks(Player player, String list, boolean allAllowed, boolean allowNoData) throws WorldEditException { String[] items = list.split(","); - Set blocks = new HashSet(); + Set blocks = new HashSet<>(); for (String id : items) { blocks.add(getBlock(player, id, allAllowed, allowNoData)); } @@ -282,7 +238,6 @@ public class WorldEdit { * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromInput(String, ParserContext)} */ @Deprecated - @SuppressWarnings("deprecation") public Set getBlocks(Player player, String list, boolean allAllowed) throws WorldEditException { return getBlocks(player, list, allAllowed, false); } @@ -291,7 +246,6 @@ public class WorldEdit { * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromListInput(String, ParserContext)} */ @Deprecated - @SuppressWarnings("deprecation") public Set getBlocks(Player player, String list) throws WorldEditException { return getBlocks(player, list, false); } @@ -300,10 +254,9 @@ public class WorldEdit { * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromListInput(String, ParserContext)} */ @Deprecated - @SuppressWarnings("deprecation") public Set getBlockIDs(Player player, String list, boolean allBlocksAllowed) throws WorldEditException { String[] items = list.split(","); - Set blocks = new HashSet(); + Set blocks = new HashSet<>(); for (String s : items) { blocks.add(getBlock(player, s, allBlocksAllowed).getType().getLegacyId()); } @@ -736,7 +689,7 @@ public class WorldEdit { engine.setTimeLimit(getConfiguration().scriptTimeout); - Map vars = new HashMap(); + Map vars = new HashMap<>(); vars.put("argv", args); vars.put("context", scriptContext); vars.put("player", player); @@ -747,9 +700,7 @@ public class WorldEdit { player.printError("Failed to execute:"); player.printRaw(e.getMessage()); logger.log(Level.WARNING, "Failed to execute script", e); - } catch (NumberFormatException e) { - throw e; - } catch (WorldEditException e) { + } catch (NumberFormatException | WorldEditException e) { throw e; } catch (Throwable e) { player.printError("Failed to execute (see console):"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index e1e162ef3..e68df4b3f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -299,11 +299,11 @@ public enum BlockType { /** * Stores a map of the IDs for fast access. */ - private static final Map ids = new HashMap(); + private static final Map ids = new HashMap<>(); /** * Stores a map of the names for fast access. */ - private static final Map lookup = new HashMap(); + private static final Map lookup = new HashMap<>(); private final int id; private final String name; @@ -383,8 +383,8 @@ public enum BlockType { } } - private static final Map itemBlockMapping = new HashMap(); - private static final Map dataItemBlockMapping = new HashMap(); + private static final Map itemBlockMapping = new HashMap<>(); + private static final Map dataItemBlockMapping = new HashMap<>(); static { for (int data = 0; data < 16; ++data) { dataItemBlockMapping.put(typeDataKey(BlockID.DIRT, data), new BaseBlock(BlockID.DIRT, data)); @@ -472,7 +472,7 @@ public enum BlockType { /** * HashSet for shouldPlaceLast. */ - private static final Set shouldPlaceLast = new HashSet(); + private static final Set shouldPlaceLast = new HashSet<>(); static { shouldPlaceLast.add(BlockID.SAPLING); shouldPlaceLast.add(BlockID.BED); @@ -551,7 +551,7 @@ public enum BlockType { /** * HashSet for shouldPlaceLast. */ - private static final Set shouldPlaceFinal = new HashSet(); + private static final Set shouldPlaceFinal = new HashSet<>(); static { shouldPlaceFinal.add(BlockID.SIGN_POST); shouldPlaceFinal.add(BlockID.WOODEN_DOOR); @@ -586,7 +586,7 @@ public enum BlockType { /** * HashSet for canPassThrough. */ - private static final Set canPassThrough = new HashSet(); + private static final Set canPassThrough = new HashSet<>(); static { canPassThrough.add(BlockID.AIR); canPassThrough.add(BlockID.WATER); @@ -688,7 +688,7 @@ public enum BlockType { /** * HashSet for centralTopLimit. */ - private static final Map centralTopLimit = new HashMap(); + private static final Map centralTopLimit = new HashMap<>(); static { centralTopLimit.put(BlockID.BED, 0.5625); centralTopLimit.put(BlockID.BREWING_STAND, 0.875); @@ -789,7 +789,7 @@ public enum BlockType { /** * HashSet for usesData. */ - private static final Set usesData = new HashSet(); + private static final Set usesData = new HashSet<>(); static { usesData.add(BlockID.STONE); usesData.add(BlockID.DIRT); @@ -934,7 +934,7 @@ public enum BlockType { /** * HashSet for isContainerBlock. */ - private static final Set isContainerBlock = new HashSet(); + private static final Set isContainerBlock = new HashSet<>(); static { isContainerBlock.add(BlockID.DISPENSER); isContainerBlock.add(BlockID.FURNACE); @@ -969,7 +969,7 @@ public enum BlockType { /** * HashSet for isRedstoneBlock. */ - private static final Set isRedstoneBlock = new HashSet(); + private static final Set isRedstoneBlock = new HashSet<>(); static { isRedstoneBlock.add(BlockID.POWERED_RAIL); isRedstoneBlock.add(BlockID.DETECTOR_RAIL); @@ -1032,7 +1032,7 @@ public enum BlockType { /** * HashSet for canTransferRedstone. */ - private static final Set canTransferRedstone = new HashSet(); + private static final Set canTransferRedstone = new HashSet<>(); static { canTransferRedstone.add(BlockID.REDSTONE_TORCH_OFF); canTransferRedstone.add(BlockID.REDSTONE_TORCH_ON); @@ -1069,7 +1069,7 @@ public enum BlockType { /** * HashSet for isRedstoneSource. */ - private static final Set isRedstoneSource = new HashSet(); + private static final Set isRedstoneSource = new HashSet<>(); static { isRedstoneSource.add(BlockID.DETECTOR_RAIL); isRedstoneSource.add(BlockID.REDSTONE_TORCH_OFF); @@ -1109,7 +1109,7 @@ public enum BlockType { /** * HashSet for isRailBlock. */ - private static final Set isRailBlock = new HashSet(); + private static final Set isRailBlock = new HashSet<>(); static { isRailBlock.add(BlockID.POWERED_RAIL); isRailBlock.add(BlockID.DETECTOR_RAIL); @@ -1139,7 +1139,7 @@ public enum BlockType { /** * HashSet for isNaturalBlock. */ - private static final Set isNaturalTerrainBlock = new HashSet(); + private static final Set isNaturalTerrainBlock = new HashSet<>(); static { isNaturalTerrainBlock.add(BlockID.STONE); isNaturalTerrainBlock.add(BlockID.GRASS); @@ -1215,7 +1215,7 @@ public enum BlockType { /** * HashSet for emitsLight. */ - private static final Set emitsLight = new HashSet(); + private static final Set emitsLight = new HashSet<>(); static { emitsLight.add(BlockID.LAVA); emitsLight.add(BlockID.STATIONARY_LAVA); @@ -1253,7 +1253,7 @@ public enum BlockType { /** * HashSet for isTranslucent. */ - private static final Set isTranslucent = new HashSet(); + private static final Set isTranslucent = new HashSet<>(); static { isTranslucent.add(BlockID.AIR); isTranslucent.add(BlockID.SAPLING); @@ -1395,8 +1395,8 @@ public enum BlockType { /** * HashMap for getBlockBagItem. */ - private static final Map dataBlockBagItems = new HashMap(); - private static final Map nonDataBlockBagItems = new HashMap(); + private static final Map dataBlockBagItems = new HashMap<>(); + private static final Map nonDataBlockBagItems = new HashMap<>(); private static final BaseItem doNotDestroy = new BaseItemStack(BlockID.AIR, 0); static { /* @@ -1886,8 +1886,8 @@ public enum BlockType { } } - private static final Map dataAttachments = new HashMap(); - private static final Map nonDataAttachments = new HashMap(); + private static final Map dataAttachments = new HashMap<>(); + private static final Map nonDataAttachments = new HashMap<>(); static { nonDataAttachments.put(BlockID.SAPLING, PlayerDirection.DOWN); nonDataAttachments.put(BlockID.LONG_GRASS, PlayerDirection.DOWN); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java index 76e362e7f..5cf0a5e3f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java @@ -73,11 +73,11 @@ public enum ClothColor { /** * Stores a map of the IDs for fast access. */ - private static final Map ids = new HashMap(); + private static final Map ids = new HashMap<>(); /** * Stores a map of the names for fast access. */ - private static final Map lookup = new HashMap(); + private static final Map lookup = new HashMap<>(); private final int id; private final String name; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java index 97e95e86b..809162ec6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java @@ -488,11 +488,11 @@ public enum ItemType { /** * Stores a map of the IDs for fast access. */ - private static final Map ids = new HashMap(); + private static final Map ids = new HashMap<>(); /** * Stores a map of the names for fast access. */ - private static final Map lookup = new LinkedHashMap(); + private static final Map lookup = new LinkedHashMap<>(); private final int id; private final String name; @@ -636,7 +636,7 @@ public enum ItemType { return lookupKeys; } - private static final Set shouldNotStack = new HashSet(); + private static final Set shouldNotStack = new HashSet<>(); static { shouldNotStack.add(ItemID.IRON_SHOVEL); shouldNotStack.add(ItemID.IRON_PICK); @@ -735,7 +735,7 @@ public enum ItemType { return shouldNotStack.contains(id); } - private static final Set usesDamageValue = new HashSet(); + private static final Set usesDamageValue = new HashSet<>(); static { usesDamageValue.add(BlockID.DIRT); usesDamageValue.add(BlockID.WOOD); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java index b3b237601..7b6316b01 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.blocks.type; import java.lang.reflect.Field; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java index 848540dd6..fdf4a39f5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java @@ -141,7 +141,7 @@ public class BiomeCommands { qualifier = "at line of sight point"; } else if (args.hasFlag('p')) { - BaseBiome biome = player.getWorld().getBiome(player.getPosition().toVector().toVector2D()); + BaseBiome biome = player.getWorld().getBiome(player.getLocation().toVector().toVector2D()); biomes.add(biome); qualifier = "at your position"; @@ -192,7 +192,7 @@ public class BiomeCommands { Mask2D mask2d = mask != null ? mask.toMask2D() : null; if (atPosition) { - region = new CuboidRegion(player.getPosition().toVector(), player.getPosition().toVector()); + region = new CuboidRegion(player.getLocation().toVector(), player.getLocation().toVector()); } else { region = session.getSelection(world); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index 631f17ae9..d0a5f6577 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -29,7 +29,6 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.brush.ButcherBrush; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java index 5c1e47150..e9121ae39 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java @@ -195,7 +195,6 @@ public class GenerationCommands { ) @CommandPermissions("worldedit.generation.forest") @Logging(POSITION) - @SuppressWarnings("deprecation") public void forestGen(Player player, LocalSession session, EditSession editSession, @Optional("10") int size, @Optional("tree") TreeType type, @Optional("5") double density) throws WorldEditException { density = density / 100; int affected = editSession.makeForest(session.getPlacementPosition(player), size, density, new TreeGenerator(type)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java index eda112bbd..a895e183f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java @@ -60,7 +60,7 @@ public class HistoryCommands { undone = session.undo(session.getBlockBag(player), player); } else { player.checkPermission("worldedit.history.undo.other"); - LocalSession sess = worldEdit.getSession(args.getString(1)); + LocalSession sess = worldEdit.getSessionManager().findByName(args.getString(1)); if (sess == null) { player.printError("Unable to find session for " + args.getString(1)); break; @@ -95,7 +95,7 @@ public class HistoryCommands { redone = session.redo(session.getBlockBag(player), player); } else { player.checkPermission("worldedit.history.redo.other"); - LocalSession sess = worldEdit.getSession(args.getString(1)); + LocalSession sess = worldEdit.getSessionManager().findByName(args.getString(1)); if (sess == null) { player.printError("Unable to find session for " + args.getString(1)); break; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index a72e7b872..9d14467a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandException; @@ -52,14 +54,11 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.Comparator; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Commands that work with schematic files. */ @@ -107,8 +106,7 @@ public class SchematicCommands { return; } - Closer closer = Closer.create(); - try { + try (Closer closer = Closer.create()) { FileInputStream fis = closer.register(new FileInputStream(f)); BufferedInputStream bis = closer.register(new BufferedInputStream(fis)); ClipboardReader reader = format.getReader(bis); @@ -122,11 +120,6 @@ public class SchematicCommands { } catch (IOException e) { player.printError("Schematic could not read or it does not exist: " + e.getMessage()); log.log(Level.WARNING, "Failed to load a saved clipboard", e); - } finally { - try { - closer.close(); - } catch (IOException ignored) { - } } } @@ -165,8 +158,7 @@ public class SchematicCommands { target = clipboard; } - Closer closer = Closer.create(); - try { + try (Closer closer = Closer.create()) { // Create parent directories File parent = f.getParentFile(); if (parent != null && !parent.exists()) { @@ -184,11 +176,6 @@ public class SchematicCommands { } catch (IOException e) { player.printError("Schematic could not written: " + e.getMessage()); log.log(Level.WARNING, "Failed to write a saved clipboard", e); - } finally { - try { - closer.close(); - } catch (IOException ignored) { - } } } @@ -283,24 +270,21 @@ public class SchematicCommands { final int sortType = args.hasFlag('d') ? -1 : args.hasFlag('n') ? 1 : 0; // cleanup file list - Arrays.sort(files, new Comparator(){ - @Override - public int compare(File f1, File f2) { - // http://stackoverflow.com/questions/203030/best-way-to-list-files-in-java-sorted-by-date-modified - int res; - if (sortType == 0) { // use name by default - int p = f1.getParent().compareTo(f2.getParent()); - if (p == 0) { // same parent, compare names - res = f1.getName().compareTo(f2.getName()); - } else { // different parent, sort by that - res = p; - } - } else { - res = Long.valueOf(f1.lastModified()).compareTo(f2.lastModified()); // use date if there is a flag - if (sortType == 1) res = -res; // flip date for newest first instead of oldest first + Arrays.sort(files, (f1, f2) -> { + // http://stackoverflow.com/questions/203030/best-way-to-list-files-in-java-sorted-by-date-modified + int res; + if (sortType == 0) { // use name by default + int p = f1.getParent().compareTo(f2.getParent()); + if (p == 0) { // same parent, compare names + res = f1.getName().compareTo(f2.getName()); + } else { // different parent, sort by that + res = p; } - return res; + } else { + res = Long.compare(f1.lastModified(), f2.lastModified()); // use date if there is a flag + if (sortType == 1) res = -res; // flip date for newest first instead of oldest first } + return res; }); List schematics = listFiles(worldEdit.getConfiguration().saveDir, files); @@ -322,7 +306,7 @@ public class SchematicCommands { private List allFiles(File root) { File[] files = root.listFiles(); if (files == null) return null; - List fileList = new ArrayList(); + List fileList = new ArrayList<>(); for (File f : files) { if (f.isDirectory()) { List subFiles = allFiles(f); @@ -337,7 +321,7 @@ public class SchematicCommands { private List listFiles(String prefix, File[] files) { if (prefix == null) prefix = ""; - List result = new ArrayList(); + List result = new ArrayList<>(); for (File file : files) { StringBuilder build = new StringBuilder(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 2e2be7bb4..8c83bdcac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -19,7 +19,9 @@ package com.sk89q.worldedit.command; -import com.google.common.base.Optional; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandException; @@ -59,11 +61,9 @@ import com.sk89q.worldedit.world.storage.ChunkStore; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.Set; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; - /** * Selection commands. */ @@ -332,7 +332,7 @@ public class SelectionCommands { return; } - List dirs = new ArrayList(); + List dirs = new ArrayList<>(); int change = args.getInteger(0); int reverseChange = 0; @@ -405,7 +405,7 @@ public class SelectionCommands { @CommandPermissions("worldedit.selection.contract") public void contract(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - List dirs = new ArrayList(); + List dirs = new ArrayList<>(); int change = args.getInteger(0); int reverseChange = 0; @@ -480,7 +480,7 @@ public class SelectionCommands { @CommandPermissions("worldedit.selection.shift") public void shift(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - List dirs = new ArrayList(); + List dirs = new ArrayList<>(); int change = args.getInteger(0); if (args.argsLength() == 2) { if (args.getString(1).contains(",")) { @@ -558,7 +558,7 @@ public class SelectionCommands { } private Vector[] getChangesForEachDir(CommandContext args) { - List changes = new ArrayList(6); + List changes = new ArrayList<>(6); int change = args.getInteger(0); if (!args.hasFlag('h')) { @@ -739,9 +739,7 @@ public class SelectionCommands { selector = new Polygonal2DRegionSelector(oldSelector); player.print("2D polygon selector: Left/right click to add a point."); Optional limit = ActorSelectorLimits.forActor(player).getPolygonVertexLimit(); - if (limit.isPresent()) { - player.print(limit.get() + " points maximum."); - } + limit.ifPresent(integer -> player.print(integer + " points maximum.")); } else if (typeName.equalsIgnoreCase("ellipsoid")) { selector = new EllipsoidRegionSelector(oldSelector); player.print("Ellipsoid selector: left click=center, right click to extend"); @@ -755,9 +753,7 @@ public class SelectionCommands { selector = new ConvexPolyhedralRegionSelector(oldSelector); player.print("Convex polyhedral selector: Left click=First vertex, right click to add more."); Optional limit = ActorSelectorLimits.forActor(player).getPolyhedronVertexLimit(); - if (limit.isPresent()) { - player.print(limit.get() + " points maximum."); - } + limit.ifPresent(integer -> player.print(integer + " points maximum.")); } else { CommandListBox box = new CommandListBox("Selection modes"); StyledFragment contents = box.getContents(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java index 9eeacf199..7dc61dba7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java @@ -115,10 +115,7 @@ public class SnapshotUtilCommands { try { chunkStore = snapshot.getChunkStore(); player.print("Snapshot '" + snapshot.getName() + "' loaded; now restoring..."); - } catch (DataException e) { - player.printError("Failed to load snapshot: " + e.getMessage()); - return; - } catch (IOException e) { + } catch (DataException | IOException e) { player.printError("Failed to load snapshot: " + e.getMessage()); return; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 0e4734ecf..1c3a05d23 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -74,7 +74,6 @@ public class ToolCommands { max = 1 ) @CommandPermissions("worldedit.tool.tree") - @SuppressWarnings("deprecation") public void tree(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { TreeGenerator.TreeType type = args.argsLength() > 0 ? diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 5da53420c..08dc0dd6f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -426,7 +426,7 @@ public class UtilityCommands { CreatureButcher flags = new CreatureButcher(actor); flags.fromCommand(args); - List visitors = new ArrayList(); + List visitors = new ArrayList<>(); LocalSession session = null; EditSession editSession = null; @@ -486,7 +486,7 @@ public class UtilityCommands { EntityRemover remover = new EntityRemover(); remover.fromString(typeStr); - List visitors = new ArrayList(); + List visitors = new ArrayList<>(); LocalSession session = null; EditSession editSession = null; @@ -606,7 +606,7 @@ public class UtilityCommands { } boolean isRootLevel = true; - List visited = new ArrayList(); + List visited = new ArrayList<>(); // Drill down to the command for (int i = 0; i < effectiveLength; i++) { @@ -646,8 +646,8 @@ public class UtilityCommands { Dispatcher dispatcher = (Dispatcher) callable; // Get a list of aliases - List aliases = new ArrayList(dispatcher.getCommands()); - Collections.sort(aliases, new PrimaryAliasComparator(CommandManager.COMMAND_CLEAN_PATTERN)); + List aliases = new ArrayList<>(dispatcher.getCommands()); + aliases.sort(new PrimaryAliasComparator(CommandManager.COMMAND_CLEAN_PATTERN)); // Calculate pagination int offset = perPage * page; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java index 7a5f9a928..524da7792 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java @@ -61,8 +61,6 @@ public class PatternParser extends SimpleCommand { try { return WorldEdit.getInstance().getPatternFactory().parseFromInput(patternString, parserContext); - } catch (NoMatchException e) { - throw new CommandException(e.getMessage(), e); } catch (InputParseException e) { throw new CommandException(e.getMessage(), e); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegionFactoryParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegionFactoryParser.java index 25493f363..9ec0ce101 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegionFactoryParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegionFactoryParser.java @@ -40,14 +40,17 @@ public class RegionFactoryParser implements CommandExecutor { try { String type = args.next(); - if (type.equals("cuboid")) { - return new CuboidRegionFactory(); - } else if (type.equals("sphere")) { - return new SphereRegionFactory(); - } else if (type.equals("cyl") || type.equals("cylinder")) { - return new CylinderRegionFactory(1); // TODO: Adjustable height - } else { - throw new CommandException("Unknown shape type: " + type + " (try one of " + getUsage() + ")"); + switch (type) { + case "cuboid": + return new CuboidRegionFactory(); + case "sphere": + return new SphereRegionFactory(); + case "cyl": + case "cylinder": + return new CylinderRegionFactory(1); // TODO: Adjustable height + + default: + throw new CommandException("Unknown shape type: " + type + " (try one of " + getUsage() + ")"); } } catch (MissingArgumentException e) { throw new CommandException("Missing shape type (try one of " + getUsage() + ")"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java index faeb30928..f2e1beb11 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java @@ -74,9 +74,7 @@ public class ShapedBrushCommand extends SimpleCommand { BrushTool tool = session.getBrushTool(player.getItemInHand()); tool.setSize(radius); tool.setBrush(new OperationFactoryBrush(factory, regionFactory), permission); - } catch (MaxBrushRadiusException e) { - WorldEdit.getInstance().getPlatformManager().getCommandManager().getExceptionConverter().convert(e); - } catch (InvalidToolBindException e) { + } catch (MaxBrushRadiusException | InvalidToolBindException e) { WorldEdit.getInstance().getPlatformManager().getCommandManager().getExceptionConverter().convert(e); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java index ec2a05559..85e0c56b1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java @@ -46,8 +46,9 @@ public class BlockDataCyler implements DoubleActionBlockTool { World world = (World) clicked.getExtent(); - int type = world.getBlockType(clicked.toVector()); - int data = world.getBlockData(clicked.toVector()); + BaseBlock block = world.getLazyBlock(clicked.toVector()); + int type = block.getId(); + int data = block.getData(); if (!config.allowedDataCycleBlocks.isEmpty() && !player.hasPermission("worldedit.override.data-cycler") @@ -57,14 +58,14 @@ public class BlockDataCyler implements DoubleActionBlockTool { } int increment = forward ? 1 : -1; - BaseBlock block = new BaseBlock(type, BlockData.cycle(type, data, increment)); + BaseBlock newBlock = new BaseBlock(type, BlockData.cycle(type, data, increment)); EditSession editSession = session.createEditSession(player); - if (block.getData() < 0) { + if (newBlock.getData() < 0) { player.printError("That block's data cannot be cycled!"); } else { try { - editSession.setBlock(clicked.toVector(), block); + editSession.setBlock(clicked.toVector(), newBlock); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index 8a375e376..7d3bc9698 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -56,7 +56,7 @@ public class FloatingTreeRemover implements BlockTool { final World world = (World) clicked.getExtent(); - switch (world.getBlockType(clicked.toVector())) { + switch (world.getLazyBlock(clicked.toVector()).getId()) { case BlockID.LOG: case BlockID.LOG2: case BlockID.LEAVES: @@ -119,8 +119,8 @@ public class FloatingTreeRemover implements BlockTool { * @return a set containing all blocks in the tree/shroom or null if this is not a floating tree/shroom. */ private Set bfs(World world, Vector origin) throws MaxChangedBlocksException { - final Set visited = new HashSet(); - final LinkedList queue = new LinkedList(); + final Set visited = new HashSet<>(); + final LinkedList queue = new LinkedList<>(); queue.addLast(origin); visited.add(origin); @@ -135,7 +135,7 @@ public class FloatingTreeRemover implements BlockTool { } if (visited.add(next)) { - switch (world.getBlockType(next)) { + switch (world.getLazyBlock(next).getId()) { case BlockID.AIR: case BlockID.SNOW: // we hit air or snow => stop walking this route @@ -154,7 +154,7 @@ public class FloatingTreeRemover implements BlockTool { default: // we hit something solid - evaluate where we came from - final int curId = world.getBlockType(current); + final int curId = world.getLazyBlock(current).getId(); if (curId == BlockID.LEAVES || curId == BlockID.LEAVES2 || curId == BlockID.VINE) { // leaves touching a wall/the ground => stop walking this route diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java index 1db0ac5e5..dd2a73d86 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java @@ -20,7 +20,8 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; @@ -53,13 +54,13 @@ public class FloodFillTool implements BlockTool { public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { World world = (World) clicked.getExtent(); - int initialType = world.getBlockType(clicked.toVector()); + BlockType initialType = world.getLazyBlock(clicked.toVector()).getType(); - if (initialType == BlockID.AIR) { + if (initialType == BlockTypes.AIR) { return true; } - if (initialType == BlockID.BEDROCK && !player.canDestroyBedrock()) { + if (initialType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; } @@ -67,7 +68,7 @@ public class FloodFillTool implements BlockTool { try { recurse(server, editSession, world, clicked.toVector().toBlockVector(), - clicked.toVector(), range, initialType, new HashSet()); + clicked.toVector(), range, initialType.getLegacyId(), new HashSet<>()); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java index 25348565a..ee2182c68 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; @@ -69,7 +68,7 @@ public class RecursivePickaxe implements BlockTool { try { recurse(server, editSession, world, clicked.toVector().toBlockVector(), - clicked.toVector(), range, initialType, new HashSet()); + clicked.toVector(), range, initialType, new HashSet<>()); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java index 246a6f633..9b8bdb76d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; @@ -43,7 +44,7 @@ public class SinglePickaxe implements BlockTool { @Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { World world = (World) clicked.getExtent(); - final int blockType = world.getBlockType(clicked.toVector()); + final int blockType = world.getLazyBlock(clicked.toVector()).getId(); if (blockType == BlockID.BEDROCK && !player.canDestroyBedrock()) { return true; @@ -53,7 +54,7 @@ public class SinglePickaxe implements BlockTool { editSession.getSurvivalExtent().setToolUse(config.superPickaxeDrop); try { - editSession.setBlock(clicked.toVector(), new BaseBlock(BlockID.AIR)); + editSession.setBlock(clicked.toVector(), new BaseBlock(BlockTypes.AIR)); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java index 56f4bf5ed..2f8a67463 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java @@ -24,7 +24,6 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.util.*; -import com.sk89q.worldedit.util.Location; /** * Plants a tree. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java index 904cc8b89..0e708e064 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.Pattern; @@ -44,7 +43,7 @@ public class GravityBrush implements Brush { for (double x = position.getBlockX() + size; x > position.getBlockX() - size; --x) { for (double z = position.getBlockZ() + size; z > position.getBlockZ() - size; --z) { double y = startY; - final List blockTypes = new ArrayList(); + final List blockTypes = new ArrayList<>(); for (; y > position.getBlockY() - size; --y) { final Vector pt = new Vector(x, y, z); final BaseBlock block = editSession.getBlock(pt); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java index 7623d338e..96545811a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java @@ -81,62 +81,59 @@ public class CreatureButcher { } public EntityFunction createFunction(final EntityRegistry entityRegistry) { - return new EntityFunction() { - @Override - public boolean apply(Entity entity) throws WorldEditException { - boolean killPets = (flags & Flags.PETS) != 0; - boolean killNPCs = (flags & Flags.NPCS) != 0; - boolean killAnimals = (flags & Flags.ANIMALS) != 0; - boolean killGolems = (flags & Flags.GOLEMS) != 0; - boolean killAmbient = (flags & Flags.AMBIENT) != 0; - boolean killTagged = (flags & Flags.TAGGED) != 0; - boolean killArmorStands = (flags & Flags.ARMOR_STAND) != 0; + return entity -> { + boolean killPets = (flags & Flags.PETS) != 0; + boolean killNPCs = (flags & Flags.NPCS) != 0; + boolean killAnimals = (flags & Flags.ANIMALS) != 0; + boolean killGolems = (flags & Flags.GOLEMS) != 0; + boolean killAmbient = (flags & Flags.AMBIENT) != 0; + boolean killTagged = (flags & Flags.TAGGED) != 0; + boolean killArmorStands = (flags & Flags.ARMOR_STAND) != 0; - EntityType type = entity.getFacet(EntityType.class); + EntityType type = entity.getFacet(EntityType.class); - if (type == null) { - return false; - } - - if (type.isPlayerDerived()) { - return false; - } - - if (!type.isLiving()) { - return false; - } - - if (!killAnimals && type.isAnimal()) { - return false; - } - - if (!killPets && type.isTamed()) { - return false; - } - - if (!killGolems && type.isGolem()) { - return false; - } - - if (!killNPCs && type.isNPC()) { - return false; - } - - if (!killAmbient && type.isAmbient()) { - return false; - } - - if (!killTagged && type.isTagged()) { - return false; - } - - if (!killArmorStands && type.isArmorStand()) { - return false; - } - - entity.remove(); - return true; + if (type == null) { + return false; } + + if (type.isPlayerDerived()) { + return false; + } + + if (!type.isLiving()) { + return false; + } + + if (!killAnimals && type.isAnimal()) { + return false; + } + + if (!killPets && type.isTamed()) { + return false; + } + + if (!killGolems && type.isGolem()) { + return false; + } + + if (!killNPCs && type.isNPC()) { + return false; + } + + if (!killAmbient && type.isAmbient()) { + return false; + } + + if (!killTagged && type.isTagged()) { + return false; + } + + if (!killArmorStands && type.isArmorStand()) { + return false; + } + + entity.remove(); + return true; }; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java index b6459b186..d336eda71 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java @@ -140,20 +140,17 @@ public class EntityRemover { public EntityFunction createFunction(final EntityRegistry entityRegistry) { final Type type = this.type; - checkNotNull("type can't be null", type); - return new EntityFunction() { - @Override - public boolean apply(Entity entity) throws WorldEditException { - EntityType registryType = entity.getFacet(EntityType.class); - if (registryType != null) { - if (type.matches(registryType)) { - entity.remove(); - return true; - } + checkNotNull(type, "type can't be null"); + return entity -> { + EntityType registryType = entity.getFacet(EntityType.class); + if (registryType != null) { + if (type.matches(registryType)) { + entity.remove(); + return true; } - - return false; } + + return false; }; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index e60160bbc..d626b73f4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -229,34 +229,6 @@ public interface Player extends Entity, Actor { */ PlayerDirection getCardinalDirection(); - /** - * Get the actor's position. - * - *

If the actor has no permission, then a dummy location is returned.

- * - * @return the actor's position - * @deprecated use {@link #getLocation()} - */ - Location getPosition(); - - /** - * Get the player's view pitch in degrees. - * - * @return pitch - * @deprecated use {@link #getLocation()} - */ - @Deprecated - double getPitch(); - - /** - * Get the player's view yaw in degrees. - * - * @return yaw - * @deprecated use {@link #getLocation()} - */ - @Deprecated - double getYaw(); - /** * Pass through the wall that you are looking at. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java index 43037ccf5..2cb35aab1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java @@ -57,7 +57,7 @@ public class BlockFactory extends AbstractFactory { * @throws InputParseException thrown in error with the input */ public Set parseFromListInput(String input, ParserContext context) throws InputParseException { - Set blocks = new HashSet(); + Set blocks = new HashSet<>(); for (String token : input.split(",")) { blocks.add(parseFromInput(token, context)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java index 88d4b53ac..bdba0c924 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java @@ -64,7 +64,7 @@ class DefaultMaskParser extends InputParser { @Override public Mask parseFromInput(String input, ParserContext context) throws InputParseException { - List masks = new ArrayList(); + List masks = new ArrayList<>(); for (String component : input.split(" ")) { if (component.isEmpty()) { @@ -126,7 +126,7 @@ class DefaultMaskParser extends InputParser { return new MaskIntersection(offsetMask, Masks.negate(submask)); case '$': - Set biomes = new HashSet(); + Set biomes = new HashSet<>(); String[] biomesList = component.substring(1).split(","); BiomeRegistry biomeRegistry = context.requireWorld().getWorldData().getBiomeRegistry(); List knownBiomes = biomeRegistry.getBiomes(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index e7dd15fce..e9ea78519 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -244,7 +244,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { int initialY = Math.max(0, pos.getBlockY()); int y = Math.max(0, pos.getBlockY() + 2); int z = pos.getBlockZ(); - Extent world = getPosition().getExtent(); + Extent world = getLocation().getExtent(); // No free space above if (world.getBlock(new Vector(x, y, z)).getId() != 0) { @@ -278,7 +278,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { int y = Math.max(0, pos.getBlockY() + 1); final int z = pos.getBlockZ(); final int maxY = Math.min(getWorld().getMaxY() + 1, initialY + distance); - final Extent world = getPosition().getExtent(); + final Extent world = getLocation().getExtent(); while (y <= world.getMaximumPoint().getY() + 2) { if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { @@ -299,7 +299,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public void floatAt(int x, int y, int z, boolean alwaysGlass) { try { - getPosition().getExtent().setBlock(new Vector(x, y - 1, z), new BaseBlock(BlockTypes.GLASS)); + getLocation().getExtent().setBlock(new Vector(x, y - 1, z), new BaseBlock(BlockTypes.GLASS)); } catch (WorldEditException e) { e.printStackTrace(); } @@ -308,12 +308,12 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public Location getBlockIn() { - return getPosition(); + return getLocation(); } @Override public Location getBlockOn() { - return getPosition().setY(getPosition().getY() - 1); + return getLocation().setY(getLocation().getY() - 1); } @Override @@ -346,15 +346,15 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public PlayerDirection getCardinalDirection(int yawOffset) { - if (getPitch() > 67.5) { + if (getLocation().getPitch() > 67.5) { return PlayerDirection.DOWN; } - if (getPitch() < -67.5) { + if (getLocation().getPitch() < -67.5) { return PlayerDirection.UP; } // From hey0's code - double rot = (getYaw() + yawOffset) % 360; //let's use real yaw now + double rot = (getLocation().getYaw() + yawOffset) % 360; //let's use real yaw now if (rot < 0) { rot += 360.0; } @@ -380,7 +380,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { public boolean passThroughForwardWall(int range) { int searchDist = 0; TargetBlock hitBlox = new TargetBlock(this, range, 0.2); - Extent world = getPosition().getExtent(); + Extent world = getLocation().getExtent(); Location block; boolean firstBlock = true; int freeToFind = 2; @@ -422,7 +422,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public void setPosition(Vector pos) { - setPosition(pos, (float) getPitch(), (float) getYaw()); + setPosition(pos, getLocation().getPitch(), getLocation().getYaw()); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index 4335afe66..c4ba1c6d0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -69,8 +69,8 @@ public class PlatformManager { private final WorldEdit worldEdit; private final CommandManager commandManager; - private final List platforms = new ArrayList(); - private final Map preferences = new EnumMap(Capability.class); + private final List platforms = new ArrayList<>(); + private final Map preferences = new EnumMap<>(Capability.class); private @Nullable String firstSeenVersion; private final AtomicBoolean initialized = new AtomicBoolean(); private final AtomicBoolean configured = new AtomicBoolean(); @@ -218,7 +218,7 @@ public class PlatformManager { * @return a list of platforms */ public synchronized List getPlatforms() { - return new ArrayList(platforms); + return new ArrayList<>(platforms); } /** @@ -291,7 +291,6 @@ public class PlatformManager { * @return a {@link ServerInterface} * @throws IllegalStateException if no platform has been registered */ - @SuppressWarnings("deprecation") public ServerInterface getServerInterface() throws IllegalStateException { return ServerInterfaceAdapter.adapt(queryCapability(Capability.USER_COMMANDS)); } @@ -304,7 +303,6 @@ public class PlatformManager { } } - @SuppressWarnings("deprecation") @Subscribe public void handleBlockInteract(BlockInteractEvent event) { // Create a proxy actor with a potentially different world for @@ -385,7 +383,6 @@ public class PlatformManager { } } - @SuppressWarnings("deprecation") @Subscribe public void handlePlayerInput(PlayerInputEvent event) { // Create a proxy actor with a potentially different world for diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index be4adabb9..64278310d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -87,21 +87,6 @@ class PlayerProxy extends AbstractPlayerActor { return basePlayer.getLocation(); } - @Override - public Location getPosition() { - return basePlayer.getPosition(); - } - - @Override - public double getPitch() { - return basePlayer.getPitch(); - } - - @Override - public double getYaw() { - return basePlayer.getYaw(); - } - @Override public void setPosition(Vector pos, float pitch, float yaw) { basePlayer.setPosition(pos, pitch, yaw); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/permission/ActorSelectorLimits.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/permission/ActorSelectorLimits.java index 255dbb406..5712fcb4e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/permission/ActorSelectorLimits.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/permission/ActorSelectorLimits.java @@ -19,13 +19,14 @@ package com.sk89q.worldedit.extension.platform.permission; -import com.google.common.base.Optional; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; -import static com.google.common.base.Preconditions.checkNotNull; +import java.util.Optional; public class ActorSelectorLimits implements SelectorLimits { @@ -55,7 +56,7 @@ public class ActorSelectorLimits implements SelectorLimits { if (limit > 0) { return Optional.of(limit); } else { - return Optional.absent(); + return Optional.empty(); } } @@ -74,7 +75,7 @@ public class ActorSelectorLimits implements SelectorLimits { if (limit > 0) { return Optional.of(limit); } else { - return Optional.absent(); + return Optional.empty(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java index 794183355..e76fa285f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java @@ -85,7 +85,7 @@ public class ChangeSetExtent extends AbstractDelegateExtent { } private List wrapEntities(List entities) { - List newList = new ArrayList(entities.size()); + List newList = new ArrayList<>(entities.size()); for (Entity entity : entities) { newList.add(new TrackedEntity(entity)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java index aed9e356d..eca710dd3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; @@ -51,7 +50,7 @@ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pat private static final BaseBlock AIR = new BaseBlock(BlockTypes.AIR); - private final Map buffer = new LinkedHashMap(); + private final Map buffer = new LinkedHashMap<>(); private final Mask mask; private Vector min = null; private Vector max = null; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index a48d8499f..dd79786f7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -48,7 +47,7 @@ public class BlockArrayClipboard implements Clipboard { private final Region region; private Vector origin = new Vector(); private final BaseBlock[][][] blocks; - private final List entities = new ArrayList(); + private final List entities = new ArrayList<>(); /** * Create a new instance. @@ -98,7 +97,7 @@ public class BlockArrayClipboard implements Clipboard { @Override public List getEntities(Region region) { - List filtered = new ArrayList(); + List filtered = new ArrayList<>(); for (Entity entity : entities) { if (region.contains(entity.getLocation().toVector())) { filtered.add(entity); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java index 460d23662..f170db83d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java @@ -65,9 +65,7 @@ public enum ClipboardFormat { @Override public boolean isFormat(File file) { - DataInputStream str = null; - try { - str = new DataInputStream(new GZIPInputStream(new FileInputStream(file))); + try (DataInputStream str = new DataInputStream(new GZIPInputStream(new FileInputStream(file)))) { if ((str.readByte() & 0xFF) != NBTConstants.TYPE_COMPOUND) { return false; } @@ -77,18 +75,11 @@ public enum ClipboardFormat { return name.equals("Schematic"); } catch (IOException e) { return false; - } finally { - if (str != null) { - try { - str.close(); - } catch (IOException ignored) { - } - } } } }; - private static final Map aliasMap = new HashMap(); + private static final Map aliasMap = new HashMap<>(); private final String[] aliases; @@ -107,7 +98,7 @@ public enum ClipboardFormat { * @return a set of aliases */ public Set getAliases() { - return Collections.unmodifiableSet(new HashSet(Arrays.asList(aliases))); + return Collections.unmodifiableSet(new HashSet<>(Arrays.asList(aliases))); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java index a4f4fbaa6..92f05f9d9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java @@ -160,7 +160,7 @@ public class SchematicReader implements ClipboardReader { // Need to pull out tile entities List tileEntities = requireTag(schematic, "TileEntities", ListTag.class).getValue(); - Map> tileEntitiesMap = new HashMap>(); + Map> tileEntitiesMap = new HashMap<>(); for (Tag tag : tileEntities) { if (!(tag instanceof CompoundTag)) continue; @@ -170,21 +170,25 @@ public class SchematicReader implements ClipboardReader { int y = 0; int z = 0; - Map values = new HashMap(); + Map values = new HashMap<>(); for (Map.Entry entry : t.getValue().entrySet()) { - if (entry.getKey().equals("x")) { - if (entry.getValue() instanceof IntTag) { - x = ((IntTag) entry.getValue()).getValue(); - } - } else if (entry.getKey().equals("y")) { - if (entry.getValue() instanceof IntTag) { - y = ((IntTag) entry.getValue()).getValue(); - } - } else if (entry.getKey().equals("z")) { - if (entry.getValue() instanceof IntTag) { - z = ((IntTag) entry.getValue()).getValue(); - } + switch (entry.getKey()) { + case "x": + if (entry.getValue() instanceof IntTag) { + x = ((IntTag) entry.getValue()).getValue(); + } + break; + case "y": + if (entry.getValue() instanceof IntTag) { + y = ((IntTag) entry.getValue()).getValue(); + } + break; + case "z": + if (entry.getValue() instanceof IntTag) { + z = ((IntTag) entry.getValue()).getValue(); + } + break; } values.put(entry.getKey(), entry.getValue()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java index 7ab751992..98a0324ea 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java @@ -89,7 +89,7 @@ public class SchematicWriter implements ClipboardWriter { // Metadata // ==================================================================== - HashMap schematic = new HashMap(); + HashMap schematic = new HashMap<>(); schematic.put("Width", new ShortTag((short) width)); schematic.put("Length", new ShortTag((short) length)); schematic.put("Height", new ShortTag((short) height)); @@ -108,7 +108,7 @@ public class SchematicWriter implements ClipboardWriter { byte[] blocks = new byte[width * height * length]; byte[] addBlocks = null; byte[] blockData = new byte[width * height * length]; - List tileEntities = new ArrayList(); + List tileEntities = new ArrayList<>(); for (Vector point : region) { Vector relative = point.subtract(min); @@ -136,7 +136,7 @@ public class SchematicWriter implements ClipboardWriter { // Store TileEntity data CompoundTag rawTag = block.getNbtData(); if (rawTag != null) { - Map values = new HashMap(); + Map values = new HashMap<>(); for (Entry entry : rawTag.getValue().entrySet()) { values.put(entry.getKey(), entry.getValue()); } @@ -163,12 +163,12 @@ public class SchematicWriter implements ClipboardWriter { // Entities // ==================================================================== - List entities = new ArrayList(); + List entities = new ArrayList<>(); for (Entity entity : clipboard.getEntities()) { BaseEntity state = entity.getState(); if (state != null) { - Map values = new HashMap(); + Map values = new HashMap<>(); // Put NBT provided data CompoundTag rawTag = state.getNbtData(); @@ -197,7 +197,7 @@ public class SchematicWriter implements ClipboardWriter { } private Tag writeVector(Vector vector, String name) { - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(new DoubleTag(vector.getX())); list.add(new DoubleTag(vector.getY())); list.add(new DoubleTag(vector.getZ())); @@ -205,7 +205,7 @@ public class SchematicWriter implements ClipboardWriter { } private Tag writeRotation(Location location, String name) { - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(new FloatTag(location.getYaw())); list.add(new FloatTag(location.getPitch())); return new ListTag(FloatTag.class, list); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java index 410059aba..11c08c183 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java @@ -27,7 +27,6 @@ import com.google.gson.JsonSyntaxException; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index 71355570b..6063ade33 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java @@ -34,7 +34,7 @@ import java.util.Map; */ public class BlockBagExtent extends AbstractDelegateExtent { - private Map missingBlocks = new HashMap(); + private Map missingBlocks = new HashMap<>(); private BlockBag blockBag; /** @@ -74,7 +74,7 @@ public class BlockBagExtent extends AbstractDelegateExtent { */ public Map popMissing() { Map missingBlocks = this.missingBlocks; - this.missingBlocks = new HashMap(); + this.missingBlocks = new HashMap<>(); return missingBlocks; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index 86595f3df..7b3b93391 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -43,9 +43,9 @@ import java.util.*; */ public class MultiStageReorder extends AbstractDelegateExtent implements ReorderingExtent { - private TupleArrayList stage1 = new TupleArrayList(); - private TupleArrayList stage2 = new TupleArrayList(); - private TupleArrayList stage3 = new TupleArrayList(); + private TupleArrayList stage1 = new TupleArrayList<>(); + private TupleArrayList stage2 = new TupleArrayList<>(); + private TupleArrayList stage3 = new TupleArrayList<>(); private boolean enabled; /** @@ -127,8 +127,8 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder public Operation resume(RunContext run) throws WorldEditException { Extent extent = getExtent(); - final Set blocks = new HashSet(); - final Map blockTypes = new HashMap(); + final Set blocks = new HashSet<>(); + final Map blockTypes = new HashMap<>(); for (Map.Entry entry : stage3) { final BlockVector pt = entry.getKey(); blocks.add(pt); @@ -141,7 +141,7 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder continue; } - final Deque walked = new LinkedList(); + final Deque walked = new LinkedList<>(); while (true) { walked.addFirst(current); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java index 42306a99d..a64b140b8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java @@ -40,7 +40,7 @@ import static com.google.common.base.Preconditions.checkNotNull; public class FastModeExtent extends AbstractDelegateExtent { private final World world; - private final Set dirtyChunks = new HashSet(); + private final Set dirtyChunks = new HashSet<>(); private boolean enabled = true; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java index aaed000d3..a5ceb03c2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.extent.world; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java index 4f6957c5a..2a0a4f992 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java @@ -31,7 +31,7 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class CombinedRegionFunction implements RegionFunction { - private final List functions = new ArrayList(); + private final List functions = new ArrayList<>(); /** * Create a combined region function. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index b5fdc60a7..d0ab03f0a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index c9b1294a1..ce973c195 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -24,7 +24,6 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; @@ -98,7 +97,7 @@ public class GardenPatchGenerator implements RegionFunction { } } - editSession.setBlockIfAir(pos, new BaseBlock(BlockTypes.OAK_LEAVES)); + setBlockIfAir(editSession, pos, new BaseBlock(BlockTypes.OAK_LEAVES)); affected++; int t = random.nextInt(4); @@ -113,10 +112,10 @@ public class GardenPatchGenerator implements RegionFunction { placeVine(basePos, pos.add(1, 0, 0)); } if (random.nextBoolean()) { - editSession.setBlockIfAir(pos.add(1, h, -1), log); + setBlockIfAir(editSession, pos.add(1, h, -1), log); affected++; } - editSession.setBlockIfAir(p = pos.add(0, 0, -1), plant.apply(p)); + setBlockIfAir(editSession, p = pos.add(0, 0, -1), plant.apply(p)); affected++; break; @@ -125,10 +124,10 @@ public class GardenPatchGenerator implements RegionFunction { placeVine(basePos, pos.add(0, 0, 1)); } if (random.nextBoolean()) { - editSession.setBlockIfAir(pos.add(1, h, 0), log); + setBlockIfAir(editSession, pos.add(1, h, 0), log); affected++; } - editSession.setBlockIfAir(p = pos.add(1, 0, 1), plant.apply(p)); + setBlockIfAir(editSession, p = pos.add(1, 0, 1), plant.apply(p)); affected++; break; @@ -137,10 +136,10 @@ public class GardenPatchGenerator implements RegionFunction { placeVine(basePos, pos.add(0, 0, -1)); } if (random.nextBoolean()) { - editSession.setBlockIfAir(pos.add(-1, h, 0), log); + setBlockIfAir(editSession, pos.add(-1, h, 0), log); affected++; } - editSession.setBlockIfAir(p = pos.add(-1, 0, 1), plant.apply(p)); + setBlockIfAir(editSession, p = pos.add(-1, 0, 1), plant.apply(p)); affected++; break; @@ -149,10 +148,10 @@ public class GardenPatchGenerator implements RegionFunction { placeVine(basePos, pos.add(-1, 0, 0)); } if (random.nextBoolean()) { - editSession.setBlockIfAir(pos.add(-1, h, -1), log); + setBlockIfAir(editSession, pos.add(-1, h, -1), log); affected++; } - editSession.setBlockIfAir(p = pos.add(-1, 0, -1), plant.apply(p)); + setBlockIfAir(editSession, p = pos.add(-1, 0, -1), plant.apply(p)); affected++; break; } @@ -195,6 +194,18 @@ public class GardenPatchGenerator implements RegionFunction { return pattern; } + /** + * Set a block only if there's no block already there. + * + * @param position the position + * @param block the block to set + * @return if block was changed + * @throws MaxChangedBlocksException thrown if too many blocks are changed + */ + private static boolean setBlockIfAir(EditSession session, Vector position, BaseBlock block) throws MaxChangedBlocksException { + return session.getBlock(position).isAir() && session.setBlock(position, block); + } + /** * Get a pattern that creates melons. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java index 75240db18..b1d8be833 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java @@ -36,7 +36,7 @@ import static com.google.common.base.Preconditions.checkNotNull; public class BiomeMask2D extends AbstractMask2D { private final Extent extent; - private final Set biomes = new HashSet(); + private final Set biomes = new HashSet<>(); /** * Create a new biome mask. 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 15fe2705e..4ffbea7bf 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 @@ -40,7 +40,7 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class BlockMask extends AbstractExtentMask { - private final Set blocks = new HashSet(); + private final Set blocks = new HashSet<>(); /** * Create a new block mask. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java index fd98c1a64..20c417ca1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BlockID; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java index d98fdadac..2d1fadaaa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java @@ -38,7 +38,7 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class MaskIntersection extends AbstractMask { - private final Set masks = new HashSet(); + private final Set masks = new HashSet<>(); /** * Create a new intersection. @@ -105,7 +105,7 @@ public class MaskIntersection extends AbstractMask { @Nullable @Override public Mask2D toMask2D() { - List mask2dList = new ArrayList(); + List mask2dList = new ArrayList<>(); for (Mask mask : masks) { Mask2D mask2d = mask.toMask2D(); if (mask2d != null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java index 02e605ff9..75905f49f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java @@ -33,7 +33,7 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class MaskIntersection2D implements Mask2D { - private final Set masks = new HashSet(); + private final Set masks = new HashSet<>(); /** * Create a new intersection. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java index 955ab779e..941cf0c14 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java @@ -67,7 +67,7 @@ public class MaskUnion extends MaskIntersection { @Nullable @Override public Mask2D toMask2D() { - List mask2dList = new ArrayList(); + List mask2dList = new ArrayList<>(); for (Mask mask : getMasks()) { Mask2D mask2d = mask.toMask2D(); if (mask2d != null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java index 7c0a8f53f..82b5a5176 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.session.request.Request; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java index 49aa9d637..f4b2a95d7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java @@ -35,7 +35,7 @@ import static com.google.common.base.Preconditions.checkNotNull; public class OperationQueue implements Operation { private final List operations = Lists.newArrayList(); - private final Deque queue = new ArrayDeque(); + private final Deque queue = new ArrayDeque<>(); private Operation current; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java index 992eda5c5..31f58fc31 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java @@ -34,7 +34,7 @@ import static com.google.common.base.Preconditions.checkNotNull; public class RandomPattern extends AbstractPattern { private final Random random = new Random(); - private List patterns = new ArrayList(); + private List patterns = new ArrayList<>(); private double max = 0; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java index b935e0cf6..84d8ab366 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java @@ -44,9 +44,9 @@ import static com.google.common.base.Preconditions.checkNotNull; public abstract class BreadthFirstSearch implements Operation { private final RegionFunction function; - private final Queue queue = new ArrayDeque(); - private final Set visited = new HashSet(); - private final List directions = new ArrayList(); + private final Queue queue = new ArrayDeque<>(); + private final Set visited = new HashSet<>(); + private final List directions = new ArrayList<>(); private int affected = 0; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java index 7e980cdd1..fb871a214 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java @@ -33,7 +33,7 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class ArrayListHistory implements ChangeSet { - private final List changes = new ArrayList(); + private final List changes = new ArrayList<>(); @Override public void add(Change change) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java index d8286ffb5..f6e921263 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java @@ -43,8 +43,8 @@ import static java.util.Map.Entry; */ public class BlockOptimizedHistory extends ArrayListHistory { - private final TupleArrayList previous = new TupleArrayList(); - private final TupleArrayList current = new TupleArrayList(); + private final TupleArrayList previous = new TupleArrayList<>(); + private final TupleArrayList current = new TupleArrayList<>(); @Override public void add(Change change) { @@ -86,12 +86,7 @@ public class BlockOptimizedHistory extends ArrayListHistory { * @return a function */ private Function, Change> createTransform() { - return new Function, Change>() { - @Override - public Change apply(Entry entry) { - return new BlockChange(entry.getKey(), entry.getValue(), entry.getValue()); - } - }; + return entry -> new BlockChange(entry.getKey(), entry.getValue(), entry.getValue()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/ServerInterfaceAdapter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/ServerInterfaceAdapter.java index af49c16f4..32d0922cc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/ServerInterfaceAdapter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/ServerInterfaceAdapter.java @@ -37,7 +37,6 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Adapts {@link Platform}s into the legacy {@link ServerInterface}. */ -@SuppressWarnings("ALL") public class ServerInterfaceAdapter extends ServerInterface { private final Platform platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java index 9f650bee8..71c9751e7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java @@ -99,7 +99,7 @@ public class CommandLoggingHandler extends AbstractInvokeListener implements Inv } if (logMode != null && sender.isPlayer()) { - Vector position = player.getPosition().toVector(); + Vector position = player.getLocation().toVector(); LocalSession session = worldEdit.getSessionManager().get(player); switch (logMode) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java index 63957cbca..5e0bbdbb7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java @@ -56,7 +56,7 @@ public class UserCommandCompleter implements CommandCompleter { public List getSuggestions(String arguments, CommandLocals locals) throws CommandException { Platform platform = platformManager.queryCapability(Capability.USER_COMMANDS); if (platform instanceof MultiUserPlatform) { - List suggestions = new ArrayList(); + List suggestions = new ArrayList<>(); Collection users = ((MultiUserPlatform) platform).getConnectedUsers(); for (Actor user : users) { if (user.getName().toLowerCase().startsWith(arguments.toLowerCase().trim())) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java index 5a61709f3..12190d532 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java @@ -68,9 +68,9 @@ import java.util.Stack; */ public class Expression { - private static final ThreadLocal> instance = new ThreadLocal>(); + private static final ThreadLocal> instance = new ThreadLocal<>(); - private final Map variables = new HashMap(); + private final Map variables = new HashMap<>(); private final String[] variableNames; private RValue root; private final Functions functions = new Functions(); @@ -148,7 +148,7 @@ public class Expression { private void pushInstance() { Stack foo = instance.get(); if (foo == null) { - instance.set(foo = new Stack()); + instance.set(foo = new Stack<>()); } foo.push(this); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/lexer/Lexer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/lexer/Lexer.java index 8a3aa4d05..8e5b3bbec 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/lexer/Lexer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/lexer/Lexer.java @@ -102,7 +102,7 @@ public class Lexer { ) ); - private static final Set characterTokens = new HashSet(); + private static final Set characterTokens = new HashSet<>(); static { characterTokens.add(','); characterTokens.add('('); @@ -114,13 +114,14 @@ public class Lexer { characterTokens.add(':'); } - private static final Set keywords = new HashSet(Arrays.asList("if", "else", "while", "do", "for", "break", "continue", "return", "switch", "case", "default")); + private static final Set keywords = + new HashSet<>(Arrays.asList("if", "else", "while", "do", "for", "break", "continue", "return", "switch", "case", "default")); private static final Pattern numberPattern = Pattern.compile("^([0-9]*(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?)"); private static final Pattern identifierPattern = Pattern.compile("^([A-Za-z][0-9A-Za-z_]*)"); private List tokenize() throws LexerException { - List tokens = new ArrayList(); + List tokens = new ArrayList<>(); do { skipWhitespace(); @@ -189,7 +190,7 @@ public class Lexer { public class DecisionTree { private final String tokenName; - private final Map subTrees = new HashMap(); + private final Map subTrees = new HashMap<>(); private DecisionTree(String tokenName, Object... args) { this.tokenName = tokenName; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/Parser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/Parser.java index 3d6b7c30f..24f3dafa9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/Parser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/Parser.java @@ -92,7 +92,7 @@ public class Parser { } private RValue parseStatements(boolean singleStatement) throws ParserException { - List statements = new ArrayList(); + List statements = new ArrayList<>(); loop: while (position < tokens.size()) { boolean expectSemicolon = false; @@ -227,8 +227,8 @@ public class Parser { case 's': // switch ++position; final RValue parameter = parseBracket(); - final List values = new ArrayList(); - final List caseStatements = new ArrayList(); + final List values = new ArrayList<>(); + final List caseStatements = new ArrayList<>(); RValue defaultCase = null; consumeCharacter('{'); @@ -310,7 +310,7 @@ public class Parser { } private RValue parseExpression(boolean canBeEmpty) throws ParserException { - LinkedList halfProcessed = new LinkedList(); + LinkedList halfProcessed = new LinkedList<>(); // process brackets, numbers, functions, variables and detect prefix operators boolean expressionStart = true; @@ -397,7 +397,7 @@ public class Parser { return Functions.getFunction(identifierToken.getPosition(), identifierToken.value); } - List args = new ArrayList(); + List args = new ArrayList<>(); loop: while (true) { args.add(parseExpression(false)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java index fc29e37d5..d1810bc9f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java @@ -33,7 +33,7 @@ import java.util.*; */ public final class ParserProcessors { - private static final Map unaryOpMap = new HashMap(); + private static final Map unaryOpMap = new HashMap<>(); private static final Map[] binaryOpMapsLA; private static final Map[] binaryOpMapsRA; @@ -111,7 +111,7 @@ public final class ParserProcessors { break; default: - Map m = lBinaryOpMapsLA[i] = new HashMap(); + Map m = lBinaryOpMapsLA[i] = new HashMap<>(); for (final Object[] element : a) { m.put((String) element[0], (String) element[1]); } @@ -133,7 +133,7 @@ public final class ParserProcessors { break; default: - Map m = lBinaryOpMapsRA[i] = new HashMap(); + Map m = lBinaryOpMapsRA[i] = new HashMap<>(); for (final Object[] element : a) { m.put((String) element[0], (String) element[1]); } @@ -153,8 +153,8 @@ public final class ParserProcessors { return processUnaryOps(input); } - LinkedList lhs = new LinkedList(); - LinkedList rhs = new LinkedList(); + LinkedList lhs = new LinkedList<>(); + LinkedList rhs = new LinkedList<>(); String operator = null; for (Iterator it = input.descendingIterator(); it.hasNext();) { @@ -195,8 +195,8 @@ public final class ParserProcessors { return processTernaryOps(input); } - LinkedList lhs = new LinkedList(); - LinkedList rhs = new LinkedList(); + LinkedList lhs = new LinkedList<>(); + LinkedList rhs = new LinkedList<>(); String operator = null; for (Identifiable identifiable : input) { @@ -232,9 +232,9 @@ public final class ParserProcessors { } private static RValue processTernaryOps(LinkedList input) throws ParserException { - LinkedList lhs = new LinkedList(); - LinkedList mhs = new LinkedList(); - LinkedList rhs = new LinkedList(); + LinkedList lhs = new LinkedList<>(); + LinkedList mhs = new LinkedList<>(); + LinkedList rhs = new LinkedList<>(); int partsFound = 0; int conditionalsFound = 0; @@ -290,7 +290,7 @@ public final class ParserProcessors { private static RValue processUnaryOps(LinkedList input) throws ParserException { // Preprocess postfix operators into unary operators final Identifiable center; - LinkedList postfixes = new LinkedList(); + LinkedList postfixes = new LinkedList<>(); do { if (input.isEmpty()) { throw new ParserException(-1, "Expression missing."); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java index a9cf3b684..4b4cbad13 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java @@ -123,7 +123,7 @@ public final class Functions { throw new NoSuchMethodException(); // TODO: return null (check for side-effects first) } - private static final Map> functions = new HashMap>(); + private static final Map> functions = new HashMap<>(); static { for (Method method : Functions.class.getMethods()) { try { @@ -138,10 +138,7 @@ public final class Functions { Overload overload = new Overload(method); - List overloads = functions.get(methodName); - if (overloads == null) { - functions.put(methodName, overloads = new ArrayList()); - } + List overloads = functions.computeIfAbsent(methodName, k -> new ArrayList<>()); overloads.add(overload); } @@ -279,8 +276,8 @@ public final class Functions { } - private static final Map gmegabuf = new HashMap(); - private final Map megabuf = new HashMap(); + private static final Map gmegabuf = new HashMap<>(); + private final Map megabuf = new HashMap<>(); public Map getMegabuf() { return megabuf; @@ -383,12 +380,7 @@ public final class Functions { return random.nextInt((int) Math.floor(max.getValue())); } - private static final ThreadLocal localPerlin = new ThreadLocal() { - @Override - protected PerlinNoise initialValue() { - return new PerlinNoise(); - } - }; + private static final ThreadLocal localPerlin = ThreadLocal.withInitial(PerlinNoise::new); public static double perlin(RValue seed, RValue x, RValue y, RValue z, RValue frequency, RValue octaves, RValue persistence) throws EvaluationException { PerlinNoise perlin = localPerlin.get(); @@ -403,12 +395,7 @@ public final class Functions { return perlin.noise(new Vector(x.getValue(), y.getValue(), z.getValue())); } - private static final ThreadLocal localVoronoi = new ThreadLocal() { - @Override - protected VoronoiNoise initialValue() { - return new VoronoiNoise(); - } - }; + private static final ThreadLocal localVoronoi = ThreadLocal.withInitial(VoronoiNoise::new); public static double voronoi(RValue seed, RValue x, RValue y, RValue z, RValue frequency) throws EvaluationException { VoronoiNoise voronoi = localVoronoi.get(); @@ -421,12 +408,7 @@ public final class Functions { return voronoi.noise(new Vector(x.getValue(), y.getValue(), z.getValue())); } - private static final ThreadLocal localRidgedMulti = new ThreadLocal() { - @Override - protected RidgedMultiFractalNoise initialValue() { - return new RidgedMultiFractalNoise(); - } - }; + private static final ThreadLocal localRidgedMulti = ThreadLocal.withInitial(RidgedMultiFractalNoise::new); public static double ridgedmulti(RValue seed, RValue x, RValue y, RValue z, RValue frequency, RValue octaves) throws EvaluationException { RidgedMultiFractalNoise ridgedMulti = localRidgedMulti.get(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Sequence.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Sequence.java index 0cdd92c51..f6458acce 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Sequence.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Sequence.java @@ -71,7 +71,7 @@ public class Sequence extends Node { @Override public RValue optimize() throws EvaluationException { - final List newSequence = new ArrayList(); + final List newSequence = new ArrayList<>(); RValue droppedLast = null; for (RValue invokable : sequence) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Switch.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Switch.java index 164293ff4..9f2f35764 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Switch.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Switch.java @@ -45,7 +45,7 @@ public class Switch extends Node implements RValue { } private static Map invertList(List values) { - Map valueMap = new HashMap(); + Map valueMap = new HashMap<>(); for (int i = 0; i < values.size(); ++i) { valueMap.put(values.get(i), i); } @@ -124,7 +124,7 @@ public class Switch extends Node implements RValue { @Override public RValue optimize() throws EvaluationException { final RValue optimizedParameter = parameter.optimize(); - final List newSequence = new ArrayList(); + final List newSequence = new ArrayList<>(); if (optimizedParameter instanceof Constant) { final double parameter = optimizedParameter.getValue(); @@ -165,9 +165,9 @@ public class Switch extends Node implements RValue { return new Switch(getPosition(), optimizedParameter, Collections.singletonMap(parameter, 0), newSequence, null); } - final Map newValueMap = new HashMap(); + final Map newValueMap = new HashMap<>(); - Map backMap = new HashMap(); + Map backMap = new HashMap<>(); for (Entry entry : valueMap.entrySet()) { backMap.put(entry.getValue(), entry.getKey()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java index 95563fcc0..4f4f36ea6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java @@ -38,7 +38,7 @@ import static com.google.common.base.Preconditions.checkNotNull; public abstract class AbstractFactory { protected final WorldEdit worldEdit; - protected final List> parsers = new ArrayList>(); + protected final List> parsers = new ArrayList<>(); /** * Create a new factory. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java index d4e38e34d..c82570597 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java @@ -59,7 +59,7 @@ public final class DocumentationPrinter { } private static List> getCommandClasses(File dir) { - List> classes = new ArrayList>(); + List> classes = new ArrayList<>(); classes.add(BiomeCommands.class); classes.add(ChunkCommands.class); @@ -100,15 +100,9 @@ public final class DocumentationPrinter { private static void writePermissionsWikiTable(List> commandClasses) throws IOException { - FileOutputStream stream = null; - try { - stream = new FileOutputStream("wiki_permissions.txt"); + try (FileOutputStream stream = new FileOutputStream("wiki_permissions.txt")) { PrintStream print = new PrintStream(stream); writePermissionsWikiTable(print, commandClasses, "/"); - } finally { - if (stream != null) { - stream.close(); - } } } @@ -180,15 +174,9 @@ public final class DocumentationPrinter { private static void writeBukkitYAML() throws IOException { - FileOutputStream stream = null; - try { - stream = new FileOutputStream("plugin.yml"); + try (FileOutputStream stream = new FileOutputStream("plugin.yml")) { PrintStream print = new PrintStream(stream); writeBukkitYAML(print); - } finally { - if (stream != null) { - stream.close(); - } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/geom/Polygons.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/geom/Polygons.java index c6f011243..007977d58 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/geom/Polygons.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/geom/Polygons.java @@ -50,7 +50,7 @@ public final class Polygons { nPoints = maxPoints - 1; } - final List points = new ArrayList(nPoints); + final List points = new ArrayList<>(nPoints); for (int i = 0; i < nPoints; ++i) { double angle = i * (2.0 * Math.PI) / nPoints; final Vector2D pos = new Vector2D(Math.cos(angle), Math.sin(angle)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java index 8a0df7b9f..7b67c6a86 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java @@ -42,7 +42,7 @@ public class ReparametrisingInterpolation implements Interpolation { private final Interpolation baseInterpolation; private double totalArcLength; - private final TreeMap cache = new TreeMap(); + private final TreeMap cache = new TreeMap<>(); public ReparametrisingInterpolation(Interpolation baseInterpolation) { checkNotNull(baseInterpolation); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java index eab410b99..46cd72177 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java @@ -75,7 +75,7 @@ public class CombinedTransform implements Transform { @Override public Transform inverse() { - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = transforms.length - 1; i >= 0; i--) { list.add(transforms[i].inverse()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java index 7777517c2..711d729d8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java @@ -287,7 +287,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion { @Override public Set getChunks() { - Set chunks = new HashSet(); + Set chunks = new HashSet<>(); Vector min = getMinimumPoint(); Vector max = getMaximumPoint(); @@ -303,7 +303,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion { @Override public Set getChunkCubes() { - Set chunks = new HashSet(); + Set chunks = new HashSet<>(); Vector min = getMinimumPoint(); Vector max = getMaximumPoint(); @@ -372,38 +372,33 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion { @Override public Iterable asFlatRegion() { - return new Iterable() { + return () -> new Iterator() { + private Vector min = getMinimumPoint(); + private Vector max = getMaximumPoint(); + private int nextX = min.getBlockX(); + private int nextZ = min.getBlockZ(); + @Override - public Iterator iterator() { - return new Iterator() { - private Vector min = getMinimumPoint(); - private Vector max = getMaximumPoint(); - private int nextX = min.getBlockX(); - private int nextZ = min.getBlockZ(); + public boolean hasNext() { + return (nextX != Integer.MIN_VALUE); + } - @Override - public boolean hasNext() { - return (nextX != Integer.MIN_VALUE); + @Override + public Vector2D next() { + if (!hasNext()) throw new java.util.NoSuchElementException(); + Vector2D answer = new Vector2D(nextX, nextZ); + if (++nextX > max.getBlockX()) { + nextX = min.getBlockX(); + if (++nextZ > max.getBlockZ()) { + nextX = Integer.MIN_VALUE; } + } + return answer; + } - @Override - public Vector2D next() { - if (!hasNext()) throw new java.util.NoSuchElementException(); - Vector2D answer = new Vector2D(nextX, nextZ); - if (++nextX > max.getBlockX()) { - nextX = min.getBlockX(); - if (++nextZ > max.getBlockZ()) { - nextX = Integer.MIN_VALUE; - } - } - return answer; - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; + @Override + public void remove() { + throw new UnsupportedOperationException(); } }; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java index 37bd1a21d..fd09c57b4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java @@ -331,12 +331,7 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion { @Override public Iterable asFlatRegion() { - return new Iterable() { - @Override - public Iterator iterator() { - return new FlatRegionIterator(CylinderRegion.this); - } - }; + return () -> new FlatRegionIterator(CylinderRegion.this); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java index dc429beb5..069cdaff3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java @@ -178,7 +178,7 @@ public class EllipsoidRegion extends AbstractRegion { @Override public Set getChunks() { - final Set chunks = new HashSet(); + final Set chunks = new HashSet<>(); final Vector min = getMinimumPoint(); final Vector max = getMaximumPoint(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java index 9d7146ed9..62361548e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java @@ -71,7 +71,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { */ public Polygonal2DRegion(World world, List points, int minY, int maxY) { super(world); - this.points = new ArrayList(points); + this.points = new ArrayList<>(points); this.minY = minY; this.maxY = maxY; hasY = true; @@ -409,12 +409,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { @Override public Iterable asFlatRegion() { - return new Iterable() { - @Override - public Iterator iterator() { - return new FlatRegionIterator(Polygonal2DRegion.this); - } - }; + return () -> new FlatRegionIterator(Polygonal2DRegion.this); } /** @@ -440,7 +435,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { @Override public Polygonal2DRegion clone() { Polygonal2DRegion clone = (Polygonal2DRegion) super.clone(); - clone.points = new ArrayList(points); + clone.points = new ArrayList<>(points); return clone; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java index dcdcee2cf..ad93903ee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java @@ -43,7 +43,7 @@ import java.util.List; */ public class RegionIntersection extends AbstractRegion { - private final List regions = new ArrayList(); + private final List regions = new ArrayList<>(); /** * Create a new instance with the included list of regions. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java index 3ffb59a03..cff94d8cd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java @@ -154,7 +154,7 @@ public class TransformRegion extends AbstractRegion { @Override public List polygonize(int maxPoints) { List origPoints = region.polygonize(maxPoints); - List transformedPoints = new ArrayList(); + List transformedPoints = new ArrayList<>(); for (BlockVector2D vector : origPoints) { transformedPoints.add(transform.apply(vector.toVector(0)).toVector2D().toBlockVector2D()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java index f7cac803e..afbcb1ae1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java @@ -19,7 +19,8 @@ package com.sk89q.worldedit.regions.selector; -import com.google.common.base.Optional; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.IncompleteRegionException; @@ -36,14 +37,14 @@ import com.sk89q.worldedit.regions.polyhedron.Triangle; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Creates a {@code ConvexPolyhedralRegion} from a user's selections. @@ -96,7 +97,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion region = new ConvexPolyhedralRegion(oldRegion.getWorld()); - for (final BlockVector2D pt : new ArrayList(oldRegion.polygonize(Integer.MAX_VALUE))) { + for (final BlockVector2D pt : new ArrayList<>(oldRegion.polygonize(Integer.MAX_VALUE))) { region.addVertex(pt.toVector(minY)); region.addVertex(pt.toVector(maxY)); } @@ -183,7 +184,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion @Override public List getInformationLines() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); ret.add("Vertices: "+region.getVertices().size()); ret.add("Triangles: "+region.getTriangles().size()); @@ -239,7 +240,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion Collection vertices = region.getVertices(); Collection triangles = region.getTriangles(); - Map vertexIds = new HashMap(vertices.size()); + Map vertexIds = new HashMap<>(vertices.size()); int lastVertexId = -1; for (Vector vertex : vertices) { vertexIds.put(vertex, ++lastVertexId); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java index 4b2f89705..fdafcd41b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java @@ -234,7 +234,7 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion { @Override public List getInformationLines() { - final List lines = new ArrayList(); + final List lines = new ArrayList<>(); if (position1 != null) { lines.add("Position 1: " + position1); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java index 2ff239b93..592d05f15 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java @@ -225,7 +225,7 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion { @Override public List getInformationLines() { - final List lines = new ArrayList(); + final List lines = new ArrayList<>(); if (!region.getCenter().equals(Vector.ZERO)) { lines.add("Center: " + region.getCenter()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java index ce330cb6b..e01e667da 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java @@ -201,7 +201,7 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion { @Override public List getInformationLines() { - final List lines = new ArrayList(); + final List lines = new ArrayList<>(); final Vector center = region.getCenter(); if (center.lengthSq() > 0) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java index 4089be208..2cf8682b8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java @@ -19,8 +19,13 @@ package com.sk89q.worldedit.regions.selector; -import com.google.common.base.Optional; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIRegion; import com.sk89q.worldedit.internal.cui.SelectionMinMaxEvent; @@ -32,11 +37,11 @@ import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; +import java.util.Optional; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Creates a {@code Polygonal2DRegion} from a user's selections. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/RegionSelectorType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/RegionSelectorType.java index c522ed532..9ce56af45 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/RegionSelectorType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/RegionSelectorType.java @@ -57,9 +57,7 @@ public enum RegionSelectorType { public RegionSelector createSelector() { try { return getSelectorClass().newInstance(); - } catch (InstantiationException e) { - throw new RuntimeException("Could not create selector", e); - } catch (IllegalAccessException e) { + } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("Could not create selector", e); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/limit/PermissiveSelectorLimits.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/limit/PermissiveSelectorLimits.java index 17d965840..ff68702d5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/limit/PermissiveSelectorLimits.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/limit/PermissiveSelectorLimits.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.regions.selector.limit; -import com.google.common.base.Optional; +import java.util.Optional; /** * No limits at all. @@ -33,12 +33,12 @@ public class PermissiveSelectorLimits implements SelectorLimits { @Override public Optional getPolygonVertexLimit() { - return Optional.absent(); + return Optional.empty(); } @Override public Optional getPolyhedronVertexLimit() { - return Optional.absent(); + return Optional.empty(); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/limit/SelectorLimits.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/limit/SelectorLimits.java index 143efb49d..1f66c055b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/limit/SelectorLimits.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/limit/SelectorLimits.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.regions.selector.limit; -import com.google.common.base.Optional; +import java.util.Optional; /** * Defines limits for selections. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java index 744d53609..8dffdba77 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java @@ -48,32 +48,32 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockType(double x, double y, double z) { - return editSession.getBlockType(toWorld(x, y, z)); + return editSession.getLazyBlock(toWorld(x, y, z)).getId(); } @Override public int getBlockData(double x, double y, double z) { - return editSession.getBlockData(toWorld(x, y, z)); + return editSession.getLazyBlock(new Vector(x, y, z)).getData(); } @Override public int getBlockTypeAbs(double x, double y, double z) { - return editSession.getBlockType(new Vector(x, y, z)); + return editSession.getLazyBlock(new Vector(x, y, z)).getId(); } @Override public int getBlockDataAbs(double x, double y, double z) { - return editSession.getBlockData(new Vector(x, y, z)); + return editSession.getLazyBlock(new Vector(x, y, z)).getData(); } @Override public int getBlockTypeRel(double x, double y, double z) { - return editSession.getBlockType(toWorldRel(x, y, z)); + return editSession.getLazyBlock(toWorldRel(x, y, z)).getId(); } @Override public int getBlockDataRel(double x, double y, double z) { - return editSession.getBlockData(toWorldRel(x, y, z)); + return editSession.getLazyBlock(new Vector(x, y, z)).getData(); } public void setCurrentBlock(Vector current) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java index 613f13a6c..20170d615 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java @@ -151,18 +151,22 @@ public class MCEditSchematicFormat extends SchematicFormat { Map values = new HashMap<>(); for (Map.Entry entry : t.getValue().entrySet()) { - if (entry.getKey().equals("x")) { - if (entry.getValue() instanceof IntTag) { - x = ((IntTag) entry.getValue()).getValue(); - } - } else if (entry.getKey().equals("y")) { - if (entry.getValue() instanceof IntTag) { - y = ((IntTag) entry.getValue()).getValue(); - } - } else if (entry.getKey().equals("z")) { - if (entry.getValue() instanceof IntTag) { - z = ((IntTag) entry.getValue()).getValue(); - } + switch (entry.getKey()) { + case "x": + if (entry.getValue() instanceof IntTag) { + x = ((IntTag) entry.getValue()).getValue(); + } + break; + case "y": + if (entry.getValue() instanceof IntTag) { + y = ((IntTag) entry.getValue()).getValue(); + } + break; + case "z": + if (entry.getValue() instanceof IntTag) { + z = ((IntTag) entry.getValue()).getValue(); + } + break; } values.put(entry.getKey(), entry.getValue()); @@ -276,7 +280,7 @@ public class MCEditSchematicFormat extends SchematicFormat { schematic.put("Blocks", new ByteArrayTag(blocks)); schematic.put("Data", new ByteArrayTag(blockData)); - schematic.put("Entities", new ListTag(CompoundTag.class, new ArrayList())); + schematic.put("Entities", new ListTag(CompoundTag.class, new ArrayList<>())); schematic.put("TileEntities", new ListTag(CompoundTag.class, tileEntities)); if (addBlocks != null) { schematic.put("AddBlocks", new ByteArrayTag(addBlocks)); @@ -291,9 +295,7 @@ public class MCEditSchematicFormat extends SchematicFormat { @Override public boolean isOfFormat(File file) { - DataInputStream str = null; - try { - str = new DataInputStream(new GZIPInputStream(new FileInputStream(file))); + try (DataInputStream str = new DataInputStream(new GZIPInputStream(new FileInputStream(file)))) { if ((str.readByte() & 0xFF) != NBTConstants.TYPE_COMPOUND) { return false; } @@ -303,15 +305,8 @@ public class MCEditSchematicFormat extends SchematicFormat { return name.equals("Schematic"); } catch (IOException e) { return false; - } finally { - if (str != null) { - try { - str.close(); - } catch (IOException ignore) { - // blargh - } - } } + // blargh } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java index 7ecbe0181..1f87a0da9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.schematic; import com.sk89q.worldedit.CuboidClipboard; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.world.DataException; import java.io.File; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java index 0e3c4be1d..89cca721e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java @@ -31,7 +31,7 @@ public class RhinoScriptEngineFactory implements ScriptEngineFactory { private static List extensions; static { - names = new ArrayList(5); + names = new ArrayList<>(5); names.add("ECMAScript"); names.add("ecmascript"); names.add("JavaScript"); @@ -39,14 +39,14 @@ public class RhinoScriptEngineFactory implements ScriptEngineFactory { names.add("js"); names = Collections.unmodifiableList(names); - mimeTypes = new ArrayList(4); + mimeTypes = new ArrayList<>(4); mimeTypes.add("application/ecmascript"); mimeTypes.add("text/ecmascript"); mimeTypes.add("application/javascript"); mimeTypes.add("text/javascript"); mimeTypes = Collections.unmodifiableList(mimeTypes); - extensions = new ArrayList(2); + extensions = new ArrayList<>(2); extensions.add("emcascript"); extensions.add("js"); extensions = Collections.unmodifiableList(extensions); @@ -116,20 +116,21 @@ public class RhinoScriptEngineFactory implements ScriptEngineFactory { @Override public Object getParameter(String key) { - if (key.equals(ScriptEngine.ENGINE)) { - return getEngineName(); - } else if (key.equals(ScriptEngine.ENGINE_VERSION)) { - return getEngineVersion(); - } else if (key.equals(ScriptEngine.NAME)) { - return getEngineName(); - } else if (key.equals(ScriptEngine.LANGUAGE)) { - return getLanguageName(); - } else if (key.equals(ScriptEngine.LANGUAGE_VERSION)) { - return getLanguageVersion(); - } else if (key.equals("THREADING")) { - return "MULTITHREADED"; - } else { - throw new IllegalArgumentException("Invalid key"); + switch (key) { + case ScriptEngine.ENGINE: + return getEngineName(); + case ScriptEngine.ENGINE_VERSION: + return getEngineVersion(); + case ScriptEngine.NAME: + return getEngineName(); + case ScriptEngine.LANGUAGE: + return getLanguageName(); + case ScriptEngine.LANGUAGE_VERSION: + return getLanguageVersion(); + case "THREADING": + return "MULTITHREADED"; + default: + throw new IllegalArgumentException("Invalid key"); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java index 60c788ca9..887f45a3f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java @@ -64,7 +64,7 @@ public class SessionManager { private static final Logger log = Logger.getLogger(SessionManager.class.getCanonicalName()); private final Timer timer = new Timer(); private final WorldEdit worldEdit; - private final Map sessions = new HashMap(); + private final Map sessions = new HashMap<>(); private SessionStore store = new VoidStore(); /** @@ -204,30 +204,27 @@ public class SessionManager { return Futures.immediateFuture(sessions); } - return executorService.submit(new Callable() { - @Override - public Object call() throws Exception { - Exception exception = null; + return executorService.submit((Callable) () -> { + Exception exception = null; - for (Map.Entry entry : sessions.entrySet()) { - SessionKey key = entry.getKey(); + for (Map.Entry entry : sessions.entrySet()) { + SessionKey key = entry.getKey(); - if (key.isPersistent()) { - try { - store.save(getKey(key), entry.getValue()); - } catch (IOException e) { - log.log(Level.WARNING, "Failed to write session for UUID " + getKey(key), e); - exception = e; - } + if (key.isPersistent()) { + try { + store.save(getKey(key), entry.getValue()); + } catch (IOException e) { + log.log(Level.WARNING, "Failed to write session for UUID " + getKey(key), e); + exception = e; } } - - if (exception != null) { - throw exception; - } - - return sessions; } + + if (exception != null) { + throw exception; + } + + return sessions; }); } @@ -305,7 +302,7 @@ public class SessionManager { synchronized (SessionManager.this) { long now = System.currentTimeMillis(); Iterator it = sessions.values().iterator(); - Map saveQueue = new HashMap(); + Map saveQueue = new HashMap<>(); while (it.hasNext()) { SessionHolder stored = it.next(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/Request.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/Request.java index 99993ffa3..fd7cd2dde 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/Request.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/Request.java @@ -30,12 +30,7 @@ import javax.annotation.Nullable; */ public final class Request { - private static final ThreadLocal threadLocal = - new ThreadLocal() { - @Override protected Request initialValue() { - return new Request(); - } - }; + private static final ThreadLocal threadLocal = ThreadLocal.withInitial(Request::new); private @Nullable World world; private @Nullable LocalSession session; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java index 7247a52cd..962ae4426 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java @@ -85,8 +85,7 @@ public class JsonFileSessionStore implements SessionStore { @Override public LocalSession load(UUID id) throws IOException { File file = getPath(id); - Closer closer = Closer.create(); - try { + try (Closer closer = Closer.create()) { FileReader fr = closer.register(new FileReader(file)); BufferedReader br = closer.register(new BufferedReader(fr)); return gson.fromJson(br, LocalSession.class); @@ -94,11 +93,6 @@ public class JsonFileSessionStore implements SessionStore { throw new IOException(e); } catch (FileNotFoundException e) { return new LocalSession(); - } finally { - try { - closer.close(); - } catch (IOException ignored) { - } } } @@ -106,19 +100,13 @@ public class JsonFileSessionStore implements SessionStore { public void save(UUID id, LocalSession session) throws IOException { File finalFile = getPath(id); File tempFile = new File(finalFile.getParentFile(), finalFile.getName() + ".tmp"); - Closer closer = Closer.create(); - try { + try (Closer closer = Closer.create()) { FileWriter fr = closer.register(new FileWriter(tempFile)); BufferedWriter bw = closer.register(new BufferedWriter(fr)); gson.toJson(session, bw); } catch (JsonIOException e) { throw new IOException(e); - } finally { - try { - closer.close(); - } catch (IOException ignored) { - } } if (finalFile.exists()) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Countable.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Countable.java index e1f48d135..e522c3ae6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Countable.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Countable.java @@ -67,12 +67,6 @@ public class Countable implements Comparable> { @Override public int compareTo(Countable other) { - if (amount > other.amount) { - return 1; - } else if (amount == other.amount) { - return 0; - } else { - return -1; - } + return Integer.compare(amount, other.amount); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java index 47659b036..927692140 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java @@ -69,7 +69,7 @@ public final class FileDialogUtil { private String desc; private ExtensionFilter(String[] exts) { - this.exts = new HashSet(Arrays.asList(exts)); + this.exts = new HashSet<>(Arrays.asList(exts)); desc = StringUtil.joinString(exts, ","); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Java7Detector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Java7Detector.java deleted file mode 100644 index d825073a2..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Java7Detector.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ -package com.sk89q.worldedit.util; - -import com.sk89q.worldedit.WorldEdit; - -public final class Java7Detector { - - public static void notifyIfNot8() { - int major = -1; - try { - String[] ver = System.getProperty("java.version").split("\\."); - major = Integer.parseInt(ver[1]); - } catch (Exception ignored) { - } - - if (major == 7) { - WorldEdit.logger.warning( - "WorldEdit has detected you are using Java 7."); - WorldEdit.logger.warning( - "WorldEdit will stop supporting Java less than version 8 in the future," - + " due to Java 7 being EOL since April 2015." - + " Please update your server to Java 8."); - } - } - - private Java7Detector() { - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java index 75674ffe1..703910959 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java @@ -63,20 +63,11 @@ public class PropertiesConfiguration extends LocalConfiguration { @Override public void load() { - InputStream stream = null; - try { - stream = new FileInputStream(path); + try (InputStream stream = new FileInputStream(path)) { properties.load(stream); } catch (FileNotFoundException ignored) { } catch (IOException e) { log.log(Level.WARNING, "Failed to read configuration", e); - } finally { - if (stream != null) { - try { - stream.close(); - } catch (IOException ignored) { - } - } } loadExtra(); @@ -121,22 +112,11 @@ public class PropertiesConfiguration extends LocalConfiguration { snapshotRepo = new SnapshotRepository(snapshotsDir); } - OutputStream output = null; path.getParentFile().mkdirs(); - try { - output = new FileOutputStream(path); + try (OutputStream output = new FileOutputStream(path)) { properties.store(output, "Don't put comments; they get removed"); - } catch (FileNotFoundException e) { - log.log(Level.WARNING, "Failed to write configuration", e); } catch (IOException e) { log.log(Level.WARNING, "Failed to write configuration", e); - } finally { - if (output != null) { - try { - output.close(); - } catch (IOException ignored) { - } - } } } @@ -239,13 +219,13 @@ public class PropertiesConfiguration extends LocalConfiguration { String val = properties.getProperty(key); if (val == null) { properties.setProperty(key, StringUtil.joinString(def, ",", 0)); - Set set = new HashSet(); + Set set = new HashSet<>(); for (int i : def) { set.add(i); } return set; } else { - Set set = new HashSet(); + Set set = new HashSet<>(); String[] parts = val.split(","); for (String part : parts) { try { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java index 72541f9d8..eb95be7eb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.util; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.world.World; @@ -49,7 +49,7 @@ public class TargetBlock { */ public TargetBlock(Player player) { this.world = player.getWorld(); - this.setValues(player.getPosition().toVector(), player.getYaw(), player.getPitch(), + this.setValues(player.getLocation().toVector(), player.getLocation().getYaw(), player.getLocation().getPitch(), 300, 1.65, 0.2); } @@ -62,7 +62,7 @@ public class TargetBlock { */ public TargetBlock(Player player, int maxDistance, double checkDistance) { this.world = player.getWorld(); - this.setValues(player.getPosition().toVector(), player.getYaw(), player.getPitch(), maxDistance, 1.65, checkDistance); + this.setValues(player.getLocation().toVector(), player.getLocation().getYaw(), player.getLocation().getPitch(), maxDistance, 1.65, checkDistance); } /** @@ -103,7 +103,7 @@ public class TargetBlock { boolean searchForLastBlock = true; Location lastBlock = null; while (getNextBlock() != null) { - if (world.getBlockType(getCurrentBlock().toVector()) == BlockID.AIR) { + if (world.getLazyBlock(getCurrentBlock().toVector()).getType() == BlockTypes.AIR) { if (searchForLastBlock) { lastBlock = getCurrentBlock(); if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= world.getMaxY()) { @@ -125,7 +125,7 @@ public class TargetBlock { * @return Block */ public Location getTargetBlock() { - while (getNextBlock() != null && world.getBlockType(getCurrentBlock().toVector()) == 0) ; + while (getNextBlock() != null && world.getLazyBlock(getCurrentBlock().toVector()).getType() == BlockTypes.AIR) ; return getCurrentBlock(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java index 504d02b77..c88b47b66 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java @@ -24,7 +24,6 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; import javax.annotation.Nullable; @@ -108,7 +107,7 @@ public class TreeGenerator { /** * Stores a map of the names for fast access. */ - private static final Map lookup = new HashMap(); + private static final Map lookup = new HashMap<>(); private static final Set primaryAliases = Sets.newHashSet(); private final String name; @@ -204,7 +203,7 @@ public class TreeGenerator { // Create trunk for (int i = 0; i < trunkHeight; ++i) { - if (!editSession.setBlockIfAir(basePosition.add(0, i, 0), logBlock)) { + if (!setBlockIfAir(editSession, basePosition.add(0, i, 0), logBlock)) { return; } } @@ -214,38 +213,38 @@ public class TreeGenerator { // Create tree + leaves for (int i = 0; i < height; ++i) { - editSession.setBlockIfAir(basePosition.add(0, i, 0), logBlock); + setBlockIfAir(editSession, basePosition.add(0, i, 0), logBlock); // Less leaves at these levels double chance = ((i == 0 || i == height - 1) ? 0.6 : 1); // Inner leaves - editSession.setChanceBlockIfAir(basePosition.add(-1, i, 0), leavesBlock, chance); - editSession.setChanceBlockIfAir(basePosition.add(1, i, 0), leavesBlock, chance); - editSession.setChanceBlockIfAir(basePosition.add(0, i, -1), leavesBlock, chance); - editSession.setChanceBlockIfAir(basePosition.add(0, i, 1), leavesBlock, chance); - editSession.setChanceBlockIfAir(basePosition.add(1, i, 1), leavesBlock, chance); - editSession.setChanceBlockIfAir(basePosition.add(-1, i, 1), leavesBlock, chance); - editSession.setChanceBlockIfAir(basePosition.add(1, i, -1), leavesBlock, chance); - editSession.setChanceBlockIfAir(basePosition.add(-1, i, -1), leavesBlock, chance); + setChanceBlockIfAir(editSession, basePosition.add(-1, i, 0), leavesBlock, chance); + setChanceBlockIfAir(editSession, basePosition.add(1, i, 0), leavesBlock, chance); + setChanceBlockIfAir(editSession, basePosition.add(0, i, -1), leavesBlock, chance); + setChanceBlockIfAir(editSession, basePosition.add(0, i, 1), leavesBlock, chance); + setChanceBlockIfAir(editSession, basePosition.add(1, i, 1), leavesBlock, chance); + setChanceBlockIfAir(editSession, basePosition.add(-1, i, 1), leavesBlock, chance); + setChanceBlockIfAir(editSession, basePosition.add(1, i, -1), leavesBlock, chance); + setChanceBlockIfAir(editSession, basePosition.add(-1, i, -1), leavesBlock, chance); if (!(i == 0 || i == height - 1)) { for (int j = -2; j <= 2; ++j) { - editSession.setChanceBlockIfAir(basePosition.add(-2, i, j), leavesBlock, 0.6); + setChanceBlockIfAir(editSession, basePosition.add(-2, i, j), leavesBlock, 0.6); } for (int j = -2; j <= 2; ++j) { - editSession.setChanceBlockIfAir(basePosition.add(2, i, j), leavesBlock, 0.6); + setChanceBlockIfAir(editSession, basePosition.add(2, i, j), leavesBlock, 0.6); } for (int j = -2; j <= 2; ++j) { - editSession.setChanceBlockIfAir(basePosition.add(j, i, -2), leavesBlock, 0.6); + setChanceBlockIfAir(editSession, basePosition.add(j, i, -2), leavesBlock, 0.6); } for (int j = -2; j <= 2; ++j) { - editSession.setChanceBlockIfAir(basePosition.add(j, i, 2), leavesBlock, 0.6); + setChanceBlockIfAir(editSession, basePosition.add(j, i, 2), leavesBlock, 0.6); } } } - editSession.setBlockIfAir(basePosition.add(0, height, 0), leavesBlock); + setBlockIfAir(editSession, basePosition.add(0, height, 0), leavesBlock); } /** @@ -260,4 +259,30 @@ public class TreeGenerator { return TreeType.lookup(type); } + /** + * Set a block (only if a previous block was not there) if {@link Math#random()} + * returns a number less than the given probability. + * + * @param position the position + * @param block the block + * @param probability a probability between 0 and 1, inclusive + * @return whether a block was changed + * @throws MaxChangedBlocksException thrown if too many blocks are changed + */ + private static boolean setChanceBlockIfAir(EditSession session, Vector position, BaseBlock block, double probability) + throws MaxChangedBlocksException { + return Math.random() <= probability && setBlockIfAir(session, position, block); + } + + /** + * Set a block only if there's no block already there. + * + * @param position the position + * @param block the block to set + * @return if block was changed + * @throws MaxChangedBlocksException thrown if too many blocks are changed + */ + private static boolean setBlockIfAir(EditSession session, Vector position, BaseBlock block) throws MaxChangedBlocksException { + return session.getBlock(position).isAir() && session.setBlock(position, block); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/WeightedChoice.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/WeightedChoice.java index 3e5d5d440..e384ecf73 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/WeightedChoice.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/WeightedChoice.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.util; -import com.google.common.base.Function; -import com.google.common.base.Optional; - import static com.google.common.base.Preconditions.checkNotNull; +import java.util.Optional; +import java.util.function.Function; + /** * Returns the best choice given a weighting function and a target weight. * @@ -60,12 +60,10 @@ public class WeightedChoice { public void consider(T object) { checkNotNull(object); Number value = checkNotNull(function.apply(object)); - if (value != null) { - double distance = Math.abs(target - value.doubleValue()); - if (current == null || distance <= best) { - best = distance; - current = object; - } + double distance = Math.abs(target - value.doubleValue()); + if (current == null || distance <= best) { + best = distance; + current = object; } } @@ -76,9 +74,9 @@ public class WeightedChoice { */ public Optional> getChoice() { if (current != null) { - return Optional.of(new Choice(current, best)); + return Optional.of(new Choice<>(current, best)); } else { - return Optional.absent(); + return Optional.empty(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index 974313c50..909dfe4f1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -76,8 +76,8 @@ public class YAMLConfiguration extends LocalConfiguration { butcherDefaultRadius = Math.max(-1, config.getInt("limits.butcher-radius.default", butcherDefaultRadius)); butcherMaxRadius = Math.max(-1, config.getInt("limits.butcher-radius.maximum", butcherMaxRadius)); - disallowedBlocks = new HashSet(config.getIntList("limits.disallowed-blocks", null)); - allowedDataCycleBlocks = new HashSet(config.getIntList("limits.allowed-data-cycle-blocks", null)); + disallowedBlocks = new HashSet<>(config.getIntList("limits.disallowed-blocks", null)); + allowedDataCycleBlocks = new HashSet<>(config.getIntList("limits.allowed-data-cycle-blocks", null)); registerHelp = config.getBoolean("register-help", true); logCommands = config.getBoolean("logging.log-commands", logCommands); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java index f2b0a2539..d3bf38793 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java @@ -33,8 +33,8 @@ import java.util.NoSuchElementException; */ public class DoubleArrayList implements Iterable> { - private List listA = new ArrayList(); - private List listB = new ArrayList(); + private List listA = new ArrayList<>(); + private List listB = new ArrayList<>(); private boolean isReversed = false; /** @@ -81,11 +81,11 @@ public class DoubleArrayList implements Iterable> { */ public Iterator> iterator(boolean reversed) { if (reversed) { - return new ReverseEntryIterator>( + return new ReverseEntryIterator<>( listA.listIterator(listA.size()), listB.listIterator(listB.size())); } else { - return new ForwardEntryIterator>( + return new ForwardEntryIterator<>( listA.iterator(), listB.iterator()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java index 638de0194..75aea6b29 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java @@ -93,7 +93,7 @@ public class FastListIterator implements Iterator { * @return an iterator */ public static Iterator forwardIterator(List list) { - return new FastListIterator(list, 0, list.size(), 1); + return new FastListIterator<>(list, 0, list.size(), 1); } /** @@ -105,9 +105,9 @@ public class FastListIterator implements Iterator { */ public static Iterator reverseIterator(List list) { if (!list.isEmpty()) { - return new FastListIterator(list, list.size() - 1, list.size(), -1); + return new FastListIterator<>(list, list.size() - 1, list.size(), -1); } else { - return new FastListIterator(list, 0, 0, -1); + return new FastListIterator<>(list, 0, 0, -1); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/TupleArrayList.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/TupleArrayList.java index f4d9b1f4b..8247607f1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/TupleArrayList.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/TupleArrayList.java @@ -39,7 +39,7 @@ public class TupleArrayList extends ArrayList> { * @param b the 'value' */ public void put(A a, B b) { - add(new Tuple(a, b)); + add(new Tuple<>(a, b)); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDescription.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDescription.java index ad3047117..4bea65d91 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDescription.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDescription.java @@ -28,8 +28,8 @@ import java.util.List; */ public class SimpleDescription implements Description { - private List parameters = new ArrayList(); - private List permissions = new ArrayList(); + private List parameters = new ArrayList<>(); + private List permissions = new ArrayList<>(); private String description; private String help; private String overrideUsage; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java index 8478c76e9..1f67fe51c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java @@ -40,7 +40,7 @@ import java.util.Set; */ public class SimpleDispatcher implements Dispatcher { - private final Map commands = new HashMap(); + private final Map commands = new HashMap<>(); private final SimpleDescription description = new SimpleDescription(); /** @@ -74,7 +74,7 @@ public class SimpleDispatcher implements Dispatcher { @Override public Set getCommands() { - return Collections.unmodifiableSet(new HashSet(commands.values())); + return Collections.unmodifiableSet(new HashSet<>(commands.values())); } @Override @@ -84,7 +84,7 @@ public class SimpleDispatcher implements Dispatcher { @Override public Set getPrimaryAliases() { - Set aliases = new HashSet(); + Set aliases = new HashSet<>(); for (CommandMapping mapping : getCommands()) { aliases.add(mapping.getPrimaryAlias()); } @@ -143,7 +143,7 @@ public class SimpleDispatcher implements Dispatcher { if (split.length <= 1) { String prefix = split.length > 0 ? split[0] : ""; - List suggestions = new ArrayList(); + List suggestions = new ArrayList<>(); for (CommandMapping mapping : getCommands()) { if (mapping.getCallable().testPermission(locals)) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java index 2868a3ba8..2309adb53 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java @@ -39,7 +39,7 @@ public class FlagParser implements CommandExecutor { private final Map> flags = Maps.newHashMap(); public Flag registerFlag(char flag, CommandExecutor executor) { - Flag ret = new Flag(flag); + Flag ret = new Flag<>(flag); flags.put(flag, executor); return ret; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/ProvidedValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/ProvidedValue.java index 7620bc7c3..5528728b7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/ProvidedValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/ProvidedValue.java @@ -63,7 +63,7 @@ public class ProvidedValue implements CommandExecutor { } public static ProvidedValue create(T value, String description) { - return new ProvidedValue(value, description); + return new ProvidedValue<>(value, description); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/BindingHelper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/BindingHelper.java index a29d6ddd3..73b59f087 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/BindingHelper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/BindingHelper.java @@ -54,8 +54,8 @@ public class BindingHelper implements Binding { * Create a new instance. */ public BindingHelper() { - List bindings = new ArrayList(); - List types = new ArrayList(); + List bindings = new ArrayList<>(); + List types = new ArrayList<>(); for (Method method : this.getClass().getMethods()) { BindingMatch info = method.getAnnotation(BindingMatch.class); @@ -145,7 +145,7 @@ public class BindingHelper implements Binding { public Object bind(ParameterData parameter, ArgumentStack scoped, boolean onlyConsume) throws ParameterException, CommandException, InvocationTargetException { BoundMethod binding = match(parameter); - List args = new ArrayList(); + List args = new ArrayList<>(); args.add(scoped); if (binding.classifier != null) { @@ -184,7 +184,7 @@ public class BindingHelper implements Binding { @Override public List getSuggestions(ParameterData parameter, String prefix) { - return new ArrayList(); + return new ArrayList<>(); } private static class BoundMethod implements Comparable { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ExceptionConverterHelper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ExceptionConverterHelper.java index 2341e5816..5b2d9fd5d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ExceptionConverterHelper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ExceptionConverterHelper.java @@ -42,7 +42,7 @@ public abstract class ExceptionConverterHelper implements ExceptionConverter { @SuppressWarnings("unchecked") public ExceptionConverterHelper() { - List handlers = new ArrayList(); + List handlers = new ArrayList<>(); for (Method method : this.getClass().getMethods()) { if (method.getAnnotation(ExceptionMatch.class) == null) { @@ -76,9 +76,7 @@ public abstract class ExceptionConverterHelper implements ExceptionConverter { throw (CommandException) e.getCause(); } throw new WrappedCommandException(e); - } catch (IllegalArgumentException e) { - throw new WrappedCommandException(e); - } catch (IllegalAccessException e) { + } catch (IllegalArgumentException | IllegalAccessException e) { throw new WrappedCommandException(e); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java index b02178874..6204422b4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java @@ -54,9 +54,9 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class ParametricBuilder { - private final Map bindings = new HashMap(); + private final Map bindings = new HashMap<>(); private final Paranamer paranamer = new CachingParanamer(); - private final List invokeListeners = new ArrayList(); + private final List invokeListeners = new ArrayList<>(); private Authorizer authorizer = new NullAuthorizer(); private CommandCompleter defaultCompleter = new NullCompleter(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java index 5492a2e81..d24ebbb8f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java @@ -39,9 +39,9 @@ class ParametricCallable implements CommandCallable { private final Object object; private final Method method; private final ParameterData[] parameters; - private final Set valueFlags = new HashSet(); + private final Set valueFlags = new HashSet<>(); private final boolean anyFlags; - private final Set legacyFlags = new HashSet(); + private final Set legacyFlags = new HashSet<>(); private final SimpleDescription description = new SimpleDescription(); private final CommandPermissions commandPermissions; @@ -63,7 +63,7 @@ class ParametricCallable implements CommandCallable { String[] names = builder.getParanamer().lookupParameterNames(method, false); Type[] types = method.getGenericParameterTypes(); parameters = new ParameterData[types.length]; - List userParameters = new ArrayList(); + List userParameters = new ArrayList<>(); // This helps keep tracks of @Nullables that appear in the middle of a list // of parameters @@ -186,7 +186,7 @@ class ParametricCallable implements CommandCallable { try { // preProcess handlers - List handlers = new ArrayList(); + List handlers = new ArrayList<>(); for (InvokeListener listener : builder.getInvokeListeners()) { InvokeHandler handler = listener.createInvokeHandler(); handlers.add(handler); @@ -422,7 +422,7 @@ class ParametricCallable implements CommandCallable { if (!found) { if (unusedFlags == null) { - unusedFlags = new HashSet(); + unusedFlags = new HashSet<>(); } unusedFlags.add(flag); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/concurrency/EvenMoreExecutors.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/concurrency/EvenMoreExecutors.java index 6a5ee3430..5272039a1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/concurrency/EvenMoreExecutors.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/concurrency/EvenMoreExecutors.java @@ -46,7 +46,7 @@ public final class EvenMoreExecutors { ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor( minThreads, maxThreads, 60L, TimeUnit.SECONDS, - new ArrayBlockingQueue(queueSize)); + new ArrayBlockingQueue<>(queueSize)); threadPoolExecutor.allowCoreThreadTimeOut(true); return threadPoolExecutor; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventBus.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventBus.java index 0ee7b7d65..d8cbe8b20 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventBus.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventBus.java @@ -19,7 +19,8 @@ package com.sk89q.worldedit.util.eventbus; -import com.google.common.base.Supplier; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; import com.google.common.collect.SetMultimap; @@ -27,12 +28,17 @@ import com.google.common.eventbus.DeadEvent; import com.sk89q.worldedit.internal.annotation.RequiresNewerGuava; import java.lang.reflect.InvocationTargetException; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Dispatches events to listeners, and provides ways for listeners to register * themselves. @@ -50,13 +56,7 @@ public class EventBus { private final Logger logger = Logger.getLogger(EventBus.class.getCanonicalName()); private final SetMultimap, EventHandler> handlersByType = - Multimaps.newSetMultimap(new HashMap, Collection>(), - new Supplier>() { - @Override - public Set get() { - return newHandlerSet(); - } - }); + Multimaps.newSetMultimap(new HashMap<>(), this::newHandlerSet); /** * Strategy for finding handler methods in registered objects. Currently, @@ -153,7 +153,7 @@ public class EventBus { * @param event event to post. */ public void post(Object event) { - List dispatching = new ArrayList(); + List dispatching = new ArrayList<>(); synchronized (this) { Set> dispatchTypes = flattenHierarchy(event.getClass()); @@ -211,7 +211,7 @@ public class EventBus { * @return a new, mutable set for handlers. */ protected synchronized Set newHandlerSet() { - return new HashSet(); + return new HashSet<>(); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java index 31aeb1f53..5644e2aa3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java @@ -34,7 +34,7 @@ import java.util.*; @RequiresNewerGuava class HierarchyCache { - private final Map, Set>> cache = new WeakHashMap, Set>>(); + private final Map, Set>> cache = new WeakHashMap<>(); public Set> get(Class concreteClass) { Set> ret = cache.get(concreteClass); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java index 08cf70e18..0134827f5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java @@ -126,11 +126,8 @@ public class ColorCodeBuilder { return builder.toString(); } else if (!resetFrom.hasEqualFormatting(resetTo) || (resetFrom.getColor() != null && resetTo.getColor() == null)) { - StringBuilder builder = new StringBuilder(); // Have to set reset code and add back all the formatting codes - builder.append(Style.RESET); - builder.append(getCode(resetTo)); - return builder.toString(); + return String.valueOf(Style.RESET) + getCode(resetTo); } else { if (resetFrom.getColor() != resetTo.getColor()) { return String.valueOf(resetTo.getColor()); @@ -163,7 +160,7 @@ public class ColorCodeBuilder { char[] rawChars = (rawString + ' ').toCharArray(); // add a trailing space to trigger pagination StringBuilder word = new StringBuilder(); StringBuilder line = new StringBuilder(); - List lines = new LinkedList(); + List lines = new LinkedList<>(); int lineColorChars = 0; for (int i = 0; i < rawChars.length; i++) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java index eaa4293cc..9ef38446b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java @@ -27,7 +27,7 @@ import java.util.List; */ public class StyledFragment extends Fragment { - private final List children = new ArrayList(); + private final List children = new ArrayList<>(); private StyleSet style; private Fragment lastText; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java index 4f27aa6c1..adfbc1ec5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java @@ -71,8 +71,8 @@ public class CommandUsageBox extends StyledFragment { CommandListBox box = new CommandListBox("Subcommands"); String prefix = !commandString.isEmpty() ? commandString + " " : ""; - List list = new ArrayList(dispatcher.getCommands()); - Collections.sort(list, new PrimaryAliasComparator(CommandManager.COMMAND_CLEAN_PATTERN)); + List list = new ArrayList<>(dispatcher.getCommands()); + list.sort(new PrimaryAliasComparator(CommandManager.COMMAND_CLEAN_PATTERN)); for (CommandMapping mapping : list) { if (locals == null || mapping.getCallable().testPermission(locals)) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java index 6b5c37efe..ff1793082 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java @@ -55,8 +55,8 @@ public final class Closer implements Closeable { final Suppressor suppressor; // only need space for 2 elements in most cases, so try to use the smallest array possible - private final Deque stack = new ArrayDeque(4); - private final Deque zipStack = new ArrayDeque(4); + private final Deque stack = new ArrayDeque<>(4); + private final Deque zipStack = new ArrayDeque<>(4); private Throwable thrown; @VisibleForTesting Closer(Suppressor suppressor) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java index 7b0b8e9e5..05a4c8378 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.util.logging; import java.util.Date; import java.util.logging.Formatter; import java.util.logging.LogRecord; -import java.util.logging.Level; import java.io.PrintWriter; import java.io.StringWriter; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index 3f2d0e9b7..a3b248570 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -109,16 +109,6 @@ public abstract class AbstractWorld implements World { new BaseBlock(BlockTypes.FLOWING_WATER)); } - @Override - public int getBlockType(Vector pt) { - return getLazyBlock(pt).getType().getLegacyId(); - } - - @Override - public int getBlockData(Vector pt) { - return getLazyBlock(pt).getData(); - } - @Override public void dropItem(Vector pt, BaseItemStack item, int times) { for (int i = 0; i < times; ++i) { @@ -189,19 +179,15 @@ public abstract class AbstractWorld implements World { return false; } - @SuppressWarnings("deprecation") @Override public boolean queueBlockBreakEffect(Platform server, Vector position, int blockId, double priority) { if (taskId == -1) { - taskId = server.schedule(0, 1, new Runnable() { - @Override - public void run() { - int max = Math.max(1, Math.min(30, effectQueue.size() / 3)); - for (int i = 0; i < max; ++i) { - if (effectQueue.isEmpty()) return; + taskId = server.schedule(0, 1, () -> { + int max = Math.max(1, Math.min(30, effectQueue.size() / 3)); + for (int i = 0; i < max; ++i) { + if (effectQueue.isEmpty()) return; - effectQueue.poll().play(); - } + effectQueue.poll().play(); } }); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index 882356350..f92126eb0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -27,7 +27,6 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; @@ -92,18 +91,6 @@ public interface World extends Extent { */ boolean useItem(Vector position, BaseItem item, Direction face); - /** - * @deprecated Use {@link #getLazyBlock(Vector)} - */ - @Deprecated - int getBlockType(Vector pt); - - /** - * @deprecated Use {@link #getLazyBlock(Vector)} - */ - @Deprecated - int getBlockData(Vector pt); - /** * Similar to {@link Extent#setBlock(Vector, BaseBlock)} but a * {@code notifyAndLight} parameter indicates whether adjacent blocks diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/Biomes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/Biomes.java index c19c2ac93..0282227db 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/Biomes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/Biomes.java @@ -19,18 +19,19 @@ package com.sk89q.worldedit.world.biome; -import com.google.common.base.Function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Functions; -import com.google.common.base.Optional; import com.sk89q.worldedit.util.WeightedChoice; import com.sk89q.worldedit.util.WeightedChoice.Choice; import com.sk89q.worldedit.util.function.LevenshteinDistance; import com.sk89q.worldedit.world.registry.BiomeRegistry; -import javax.annotation.Nullable; import java.util.Collection; +import java.util.Optional; +import java.util.function.Function; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Utility methods related to biomes. @@ -55,7 +56,7 @@ public final class Biomes { checkNotNull(registry); Function compare = new LevenshteinDistance(name, false, LevenshteinDistance.STANDARD_CHARS); - WeightedChoice chooser = new WeightedChoice(Functions.compose(compare, new BiomeName(registry)), 0); + WeightedChoice chooser = new WeightedChoice<>(Functions.compose(compare::apply, new BiomeName(registry)), 0); for (BaseBiome biome : biomes) { chooser.consider(biome); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java index f52f6d969..87ec424aa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java @@ -196,7 +196,7 @@ public class AnvilChunk implements Chunk { List tags = NBTUtils.getChildTag(rootTag.getValue(), "TileEntities", ListTag.class).getValue(); - tileEntities = new HashMap>(); + tileEntities = new HashMap<>(); for (Tag tag : tags) { if (!(tag instanceof CompoundTag)) { @@ -210,21 +210,25 @@ public class AnvilChunk implements Chunk { int y = 0; int z = 0; - Map values = new HashMap(); + Map values = new HashMap<>(); for (Map.Entry entry : t.getValue().entrySet()) { - if (entry.getKey().equals("x")) { - if (entry.getValue() instanceof IntTag) { - x = ((IntTag) entry.getValue()).getValue(); - } - } else if (entry.getKey().equals("y")) { - if (entry.getValue() instanceof IntTag) { - y = ((IntTag) entry.getValue()).getValue(); - } - } else if (entry.getKey().equals("z")) { - if (entry.getValue() instanceof IntTag) { - z = ((IntTag) entry.getValue()).getValue(); - } + switch (entry.getKey()) { + case "x": + if (entry.getValue() instanceof IntTag) { + x = ((IntTag) entry.getValue()).getValue(); + } + break; + case "y": + if (entry.getValue() instanceof IntTag) { + y = ((IntTag) entry.getValue()).getValue(); + } + break; + case "z": + if (entry.getValue() instanceof IntTag) { + z = ((IntTag) entry.getValue()).getValue(); + } + break; } values.put(entry.getKey(), entry.getValue()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java index 98849cdcb..b2e35d3bc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java @@ -123,7 +123,7 @@ public class OldChunk implements Chunk { rootTag.getValue(), "TileEntities", ListTag.class) .getValue(); - tileEntities = new HashMap>(); + tileEntities = new HashMap<>(); for (Tag tag : tags) { if (!(tag instanceof CompoundTag)) { @@ -136,21 +136,25 @@ public class OldChunk implements Chunk { int y = 0; int z = 0; - Map values = new HashMap(); + Map values = new HashMap<>(); for (Map.Entry entry : t.getValue().entrySet()) { - if (entry.getKey().equals("x")) { - if (entry.getValue() instanceof IntTag) { - x = ((IntTag) entry.getValue()).getValue(); - } - } else if (entry.getKey().equals("y")) { - if (entry.getValue() instanceof IntTag) { - y = ((IntTag) entry.getValue()).getValue(); - } - } else if (entry.getKey().equals("z")) { - if (entry.getValue() instanceof IntTag) { - z = ((IntTag) entry.getValue()).getValue(); - } + switch (entry.getKey()) { + case "x": + if (entry.getValue() instanceof IntTag) { + x = ((IntTag) entry.getValue()).getValue(); + } + break; + case "y": + if (entry.getValue() instanceof IntTag) { + y = ((IntTag) entry.getValue()).getValue(); + } + break; + case "z": + if (entry.getValue() instanceof IntTag) { + z = ((IntTag) entry.getValue()).getValue(); + } + break; } values.put(entry.getKey(), entry.getValue()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java index 0b6ede080..2add97ec8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java @@ -37,7 +37,7 @@ import java.util.List; public class SnapshotRepository { protected File dir; - protected List dateParsers = new ArrayList(); + protected List dateParsers = new ArrayList<>(); /** * Create a new instance of a repository. @@ -71,19 +71,16 @@ public class SnapshotRepository { * @return a list of snapshots */ public List getSnapshots(boolean newestFirst, String worldName) throws MissingWorldException { - FilenameFilter filter = new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - File f = new File(dir, name); - return isValidSnapshot(f); - } + FilenameFilter filter = (dir, name) -> { + File f = new File(dir, name); + return isValidSnapshot(f); }; File[] snapshotFiles = dir.listFiles(); if (snapshotFiles == null) { throw new MissingWorldException(worldName); } - List list = new ArrayList(snapshotFiles.length); + List list = new ArrayList<>(snapshotFiles.length); for (File file : snapshotFiles) { if (isValidSnapshot(file)) { @@ -102,7 +99,7 @@ public class SnapshotRepository { } if (newestFirst) { - Collections.sort(list, Collections.reverseOrder()); + list.sort(Collections.reverseOrder()); } else { Collections.sort(list); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java index ca636e007..1ccfef753 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java @@ -44,7 +44,7 @@ import java.util.Map; */ public class SnapshotRestore { - private final Map> neededChunks = new LinkedHashMap>(); + private final Map> neededChunks = new LinkedHashMap<>(); private final ChunkStore chunkStore; private final EditSession editSession; private ArrayList missingChunks; @@ -111,7 +111,7 @@ public class SnapshotRestore { // Unidentified chunk if (!neededChunks.containsKey(chunkPos)) { - neededChunks.put(chunkPos, new ArrayList()); + neededChunks.put(chunkPos, new ArrayList<>()); } neededChunks.get(chunkPos).add(pos); @@ -133,8 +133,8 @@ public class SnapshotRestore { */ public void restore() throws MaxChangedBlocksException { - missingChunks = new ArrayList(); - errorChunks = new ArrayList(); + missingChunks = new ArrayList<>(); + errorChunks = new ArrayList<>(); // Now let's start restoring! for (Map.Entry> entry : neededChunks.entrySet()) { @@ -156,15 +156,9 @@ public class SnapshotRestore { } } catch (MissingChunkException me) { missingChunks.add(chunkPos); - } catch (MissingWorldException me) { + } catch (IOException | DataException me) { errorChunks.add(chunkPos); lastErrorMessage = me.getMessage(); - } catch (DataException de) { - errorChunks.add(chunkPos); - lastErrorMessage = de.getMessage(); - } catch (IOException ioe) { - errorChunks.add(chunkPos); - lastErrorMessage = ioe.getMessage(); } } } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index b68cbc3e4..eaa034d28 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -81,26 +81,11 @@ public class ForgePlayer extends AbstractPlayerActor { this.player.rotationPitch); } - @Override - public Location getPosition() { - return new Location(ForgeWorldEdit.inst.getWorld(this.player.world), this.player.posX, this.player.posY, this.player.posZ); - } - @Override public com.sk89q.worldedit.world.World getWorld() { return ForgeWorldEdit.inst.getWorld(this.player.world); } - @Override - public double getPitch() { - return this.player.rotationPitch; - } - - @Override - public double getYaw() { - return this.player.rotationYaw; - } - @Override public void giveItem(int type, int amt) { this.player.inventory.addItemStackToInventory(new ItemStack(Item.getItemById(type), amt, 0)); diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index ec6541ce9..64d7fd37c 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -167,8 +167,7 @@ public class ForgeWorld extends AbstractWorld { Chunk chunk = world.getChunkFromChunkCoords(x >> 4, z >> 4); BlockPos pos = new BlockPos(x, y, z); IBlockState old = chunk.getBlockState(pos); - @SuppressWarnings("deprecation") - IBlockState newState = Block.getBlockById(block.getId()).getStateFromMeta(block.getData()); + IBlockState newState = Block.getBlockById(block.getId()).getStateFromMeta(block.getData()); IBlockState successState = chunk.setBlockState(pos, newState); boolean successful = successState != null; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index b8f57edda..5024d56c0 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -81,27 +81,11 @@ public class SpongePlayer extends AbstractPlayerActor { return SpongeWorldEdit.inst().getAdapter().adapt(entityLoc, entityRot); } - @Override - public Location getPosition() { - Vector3d pos = this.player.getLocation().getPosition(); - return new Location(SpongeWorldEdit.inst().getAdapter().getWorld(this.player.getWorld()), pos.getX(), pos.getY(), pos.getZ()); - } - @Override public com.sk89q.worldedit.world.World getWorld() { return SpongeWorldEdit.inst().getAdapter().getWorld(player.getWorld()); } - @Override - public double getPitch() { - return getLocation().getPitch(); - } - - @Override - public double getYaw() { - return getLocation().getYaw(); - } - @Override public void giveItem(int type, int amt) { this.player.getInventory().offer(ItemStack.of(SpongeWorldEdit.inst().getAdapter().resolveItem(type), amt)); From c43109bde52fd498903a15f3bd9f2ec936a599cd Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 17 Jun 2018 15:42:47 +1000 Subject: [PATCH 14/74] Start work on the new BaseBlock/BlockState split --- .../main/java/com/sk89q/util/ArrayUtil.java | 44 ------- .../java/com/sk89q/worldedit/EditSession.java | 15 --- .../java/com/sk89q/worldedit/WorldEdit.java | 111 ++--------------- .../worldedit/blocks/type/BlockState.java | 114 ++++++++++++++++++ .../worldedit/blocks/type/BlockType.java | 39 ++++++ .../worldedit/command/SelectionCommands.java | 67 ++++------ .../sk89q/worldedit/command/ToolCommands.java | 21 +++- .../worldedit/command/UtilityCommands.java | 9 +- .../worldedit/command/tool/AreaPickaxe.java | 4 +- .../worldedit/command/tool/BlockReplacer.java | 4 +- .../command/tool/FloatingTreeRemover.java | 2 +- .../worldedit/command/tool/FloodFillTool.java | 20 +-- .../command/tool/RecursivePickaxe.java | 2 +- .../worldedit/command/tool/SinglePickaxe.java | 8 +- .../scripting/CraftScriptContext.java | 41 +++---- .../sk89q/worldedit/world/AbstractWorld.java | 12 +- .../java/com/sk89q/worldedit/world/World.java | 5 +- .../world/registry/BundledBlockData.java | 5 +- .../registry/state/DirectionalState.java | 5 + .../world/registry/state/SimpleState.java | 13 +- 20 files changed, 273 insertions(+), 268 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/util/ArrayUtil.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java diff --git a/worldedit-core/src/main/java/com/sk89q/util/ArrayUtil.java b/worldedit-core/src/main/java/com/sk89q/util/ArrayUtil.java deleted file mode 100644 index 5593c2e75..000000000 --- a/worldedit-core/src/main/java/com/sk89q/util/ArrayUtil.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.util; - -public final class ArrayUtil { - - private ArrayUtil() { - } - - public static String[] removePortionOfArray(String[] array, int from, int to, String replace) { - String[] newArray = new String[from + array.length - to - (replace == null ? 1 : 0)]; - System.arraycopy(array, 0, newArray, 0, from); - if (replace != null) newArray[from] = replace; - System.arraycopy(array, to + 1, newArray, from + (replace == null ? 0 : 1), - array.length - to - 1); - return newArray; - } - - public static char[] removePortionOfArray(char[] array, int from, int to, Character replace) { - char[] newArray = new char[from + array.length - to - (replace == null ? 1 : 0)]; - System.arraycopy(array, 0, newArray, 0, from); - if (replace != null) newArray[from] = replace; - System.arraycopy(array, to + 1, newArray, from + (replace == null ? 0 : 1), - array.length - to - 1); - return newArray; - } -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 0537110fd..62d78e4d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -599,21 +599,6 @@ public class EditSession implements Extent { return bypassNone.commit(); } - /** - * Count the number of blocks of a given list of types in a region. - * - * @param region the region - * @param searchIDs a list of IDs to search - * @return the number of found blocks - */ - public int countBlock(Region region, Set searchIDs) { - Set passOn = new HashSet<>(); - for (Integer i : searchIDs) { - passOn.add(new BaseBlock(i, -1)); - } - return countBlocks(region, passOn); - } - /** * Count the number of blocks of a list of types in a region. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 43471520d..52124861a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -19,12 +19,14 @@ package com.sk89q.worldedit; +import static com.sk89q.worldedit.event.platform.Interaction.HIT; +import static com.sk89q.worldedit.event.platform.Interaction.OPEN; + import com.sk89q.worldedit.CuboidClipboard.FlipDirection; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.event.platform.BlockInteractEvent; import com.sk89q.worldedit.event.platform.InputType; import com.sk89q.worldedit.event.platform.PlayerInputEvent; @@ -32,7 +34,6 @@ import com.sk89q.worldedit.extension.factory.BlockFactory; import com.sk89q.worldedit.extension.factory.ItemFactory; import com.sk89q.worldedit.extension.factory.MaskFactory; import com.sk89q.worldedit.extension.factory.PatternFactory; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.PlatformManager; @@ -50,23 +51,19 @@ import com.sk89q.worldedit.util.io.file.FilenameResolutionException; import com.sk89q.worldedit.util.io.file.InvalidFilenameException; import com.sk89q.worldedit.util.logging.WorldEditPrefixHandler; import com.sk89q.worldedit.world.registry.BundledBlockData; +import com.sk89q.worldedit.world.registry.BundledItemData; -import javax.script.ScriptException; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.event.platform.Interaction.HIT; -import static com.sk89q.worldedit.event.platform.Interaction.OPEN; +import javax.script.ScriptException; /** * The entry point and container for a working implementation of WorldEdit. @@ -102,6 +99,7 @@ public class WorldEdit { WorldEditPrefixHandler.register("com.sk89q.worldedit"); getVersion(); BundledBlockData.getInstance(); // Load block registry + BundledItemData.getInstance(); // Load item registry } private WorldEdit() { @@ -191,78 +189,6 @@ public class WorldEdit { return sessions; } - /** - * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromInput(String, ParserContext)} - */ - @Deprecated - public BaseBlock getBlock(Player player, String arg, boolean allAllowed) throws WorldEditException { - return getBlock(player, arg, allAllowed, false); - } - - /** - * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromInput(String, ParserContext)} - */ - @Deprecated - public BaseBlock getBlock(Player player, String arg, boolean allAllowed, boolean allowNoData) throws WorldEditException { - ParserContext context = new ParserContext(); - context.setActor(player); - context.setWorld(player.getWorld()); - context.setSession(getSessionManager().get(player)); - context.setRestricted(!allAllowed); - context.setPreferringWildcard(allowNoData); - return getBlockFactory().parseFromInput(arg, context); - } - - /** - * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromInput(String, ParserContext)} - */ - @Deprecated - public BaseBlock getBlock(Player player, String id) throws WorldEditException { - return getBlock(player, id, false); - } - - /** - * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromListInput(String, ParserContext)} - */ - @Deprecated - public Set getBlocks(Player player, String list, boolean allAllowed, boolean allowNoData) throws WorldEditException { - String[] items = list.split(","); - Set blocks = new HashSet<>(); - for (String id : items) { - blocks.add(getBlock(player, id, allAllowed, allowNoData)); - } - return blocks; - } - - /** - * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromInput(String, ParserContext)} - */ - @Deprecated - public Set getBlocks(Player player, String list, boolean allAllowed) throws WorldEditException { - return getBlocks(player, list, allAllowed, false); - } - - /** - * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromListInput(String, ParserContext)} - */ - @Deprecated - public Set getBlocks(Player player, String list) throws WorldEditException { - return getBlocks(player, list, false); - } - - /** - * @deprecated Use {@link #getBlockFactory()} and {@link BlockFactory#parseFromListInput(String, ParserContext)} - */ - @Deprecated - public Set getBlockIDs(Player player, String list, boolean allBlocksAllowed) throws WorldEditException { - String[] items = list.split(","); - Set blocks = new HashSet<>(); - for (String s : items) { - blocks.add(getBlock(player, s, allBlocksAllowed).getType().getLegacyId()); - } - return blocks; - } - /** * Gets the path to a file. This method will check to see if the filename * has valid characters and has an extension. It also prevents directory @@ -641,7 +567,7 @@ public class WorldEdit { String filename = f.getPath(); int index = filename.lastIndexOf("."); - String ext = filename.substring(index + 1, filename.length()); + String ext = filename.substring(index + 1); if (!ext.equalsIgnoreCase("js")) { player.printError("Only .js scripts are currently supported"); @@ -677,7 +603,7 @@ public class WorldEdit { LocalSession session = getSessionManager().get(player); CraftScriptContext scriptContext = new CraftScriptContext(this, getServer(), getConfiguration(), session, player, args); - CraftScriptEngine engine = null; + CraftScriptEngine engine; try { engine = new RhinoCraftScriptEngine(); @@ -739,20 +665,6 @@ public class WorldEdit { return editSessionFactory; } - /** - * @deprecated EditSessionFactories are no longer used. Please register an {@link EditSessionEvent} event - * with the event bus in order to override or catch changes to the world - */ - @Deprecated - public void setEditSessionFactory(EditSessionFactory factory) { - checkNotNull(factory); - logger.severe("Got request to set EditSessionFactory of type " + - factory.getClass().getName() + " from " + factory.getClass().getPackage().getName() + - " but EditSessionFactories have been removed in favor of extending EditSession's extents.\n\n" + - "This may mean that any block logger / intercepters addons/plugins/mods that you have installed will not " + - "intercept WorldEdit's changes! Please notify the maintainer of the other addon about this."); - } - /** * Get the version. * @@ -782,11 +694,4 @@ public class WorldEdit { return version; } - /** - * @deprecated Declare your platform version with {@link Platform#getPlatformVersion()} - */ - @Deprecated - public static void setVersion(String version) { - } - } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java new file mode 100644 index 000000000..306f15d27 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java @@ -0,0 +1,114 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import com.google.common.collect.ArrayTable; +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.Maps; +import com.google.common.collect.Table; +import com.sk89q.worldedit.world.registry.state.State; +import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue; + +import java.util.HashMap; +import java.util.Map; + +/** + * An immutable class that represents the state a block can be in. + */ +public class BlockState { + + private final BlockType blockType; + private final Map, SimpleStateValue> values; + + // Neighbouring state table. + private Table, SimpleStateValue, BlockState> states; + + BlockState(BlockType blockType) { + this.blockType = blockType; + this.values = new HashMap<>(); + } + + public void populate(Map, SimpleStateValue>, BlockState> stateMap) { + final Table, SimpleStateValue, BlockState> states = HashBasedTable.create(); + + for(final Map.Entry, SimpleStateValue> entry : this.values.entrySet()) { + final State state = entry.getKey(); + + state.getValues().forEach(value -> { + if(value != entry.getValue()) { + states.put(state, value, stateMap.get(this.withValue(state, value))); + } + }); + } + + this.states = states.isEmpty() ? states : ArrayTable.create(states); + } + + private Map, SimpleStateValue> withValue(final State property, final SimpleStateValue value) { + final Map, SimpleStateValue> values = Maps.newHashMap(this.values); + values.put(property, value); + return values; + } + + /** + * Get the block type + * + * @return The type + */ + public BlockType getBlockType() { + return this.blockType; + } + + /** + * Returns a BlockState with the given state and value applied. + * + * @param state The state + * @param value The value + * @return The modified state, or same if could not be applied + */ + public BlockState with(State state, SimpleStateValue value) { + BlockState result = states.get(state, value); + return result == null ? this : result; + } + + /** + * Gets the value at the given state + * + * @param state The state + * @return The value + */ + public SimpleStateValue getState(State state) { + return this.values.get(state); + } + + /** + * Internal method used for creating the initial BlockState. + * + * Sets a value. DO NOT USE THIS. + * + * @param state The state + * @param value The value + * @return The blockstate, for chaining + */ + BlockState setState(State state, SimpleStateValue value) { + this.values.put(state, value); + return this; + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java index a61bf0317..a1afc2820 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java @@ -21,22 +21,61 @@ package com.sk89q.worldedit.blocks.type; import com.sk89q.worldedit.world.registry.BundledBlockData; +import java.util.function.Function; + public class BlockType { private String id; + private BlockState defaultState; public BlockType(String id) { + this(id, null); + } + + public BlockType(String id, Function values) { // If it has no namespace, assume minecraft. if (!id.contains(":")) { id = "minecraft:" + id; } this.id = id; + this.defaultState = new BlockState(this); + if (values != null) { + this.defaultState = values.apply(this.defaultState); + } } + /** + * Gets the ID of this block. + * + * @return The id + */ public String getId() { return this.id; } + /** + * Gets the name of this block, or the ID if the name cannot be found. + * + * @return The name, or ID + */ + public String getName() { + BundledBlockData.BlockEntry entry = BundledBlockData.getInstance().findById(this.id); + if (entry == null) { + return getId(); + } else { + return entry.localizedName; + } + } + + /** + * Gets the default state of this block type. + * + * @return The default state + */ + public BlockState getDefaultState() { + return this.defaultState; + } + /** * Gets the legacy ID. Needed for legacy reasons. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 8c83bdcac..f5f60ca30 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -34,8 +34,8 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.regions.Region; @@ -624,26 +624,22 @@ public class SelectionCommands { aliases = { "/count" }, usage = "", desc = "Counts the number of a certain type of block", - flags = "d", min = 1, max = 1 ) @CommandPermissions("worldedit.analysis.count") public void count(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - boolean useData = args.hasFlag('d'); - if (args.getString(0).contains(":")) { - useData = true; //override d flag, if they specified data they want it - } - if (useData) { - Set searchBlocks = we.getBlocks(player, args.getString(0), true); - int count = editSession.countBlocks(session.getSelection(player.getWorld()), searchBlocks); - player.print("Counted: " + count); - } else { - Set searchIDs = we.getBlockIDs(player, args.getString(0), true); - int count = editSession.countBlock(session.getSelection(player.getWorld()), searchIDs); - player.print("Counted: " + count); - } + ParserContext context = new ParserContext(); + context.setActor(player); + context.setExtent(player.getExtent()); + context.setWorld(player.getWorld()); + context.setSession(session); + context.setRestricted(false); + + Set searchBlocks = we.getBlockFactory().parseFromListInput(args.getString(0), context); + int count = editSession.countBlocks(session.getSelection(player.getWorld()), searchBlocks); + player.print("Counted: " + count); } @Command( @@ -662,49 +658,32 @@ public class SelectionCommands { public void distr(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException, CommandException { int size; - boolean useData = args.hasFlag('d'); - List> distribution = null; - List> distributionData = null; + List> distributionData; if (args.hasFlag('c')) { // TODO: Update for new clipboard throw new CommandException("Needs to be re-written again"); } else { - if (useData) { - distributionData = editSession.getBlockDistributionWithData(session.getSelection(player.getWorld())); - } else { - distribution = editSession.getBlockDistribution(session.getSelection(player.getWorld())); - } + distributionData = editSession.getBlockDistributionWithData(session.getSelection(player.getWorld())); size = session.getSelection(player.getWorld()).getArea(); } - if ((useData && distributionData.size() <= 0) - || (!useData && distribution.size() <= 0)) { // *Should* always be false + if (distributionData.size() <= 0) { // *Should* always be false player.printError("No blocks counted."); return; } player.print("# total blocks: " + size); - if (useData) { - for (Countable c : distributionData) { - String name = BlockType.fromID(c.getID().getId()).getName(); - String str = String.format("%-7s (%.3f%%) %s #%d:%d", - String.valueOf(c.getAmount()), - c.getAmount() / (double) size * 100, - name == null ? "Unknown" : name, - c.getID().getType(), c.getID().getData()); - player.print(str); - } - } else { - for (Countable c : distribution) { - BlockType block = BlockType.fromID(c.getID()); - String str = String.format("%-7s (%.3f%%) %s #%d", - String.valueOf(c.getAmount()), - c.getAmount() / (double) size * 100, - block == null ? "Unknown" : block.getName(), c.getID()); - player.print(str); - } + for (Countable c : distributionData) { + String name = c.getID().getType().getName(); + String str = String.format("%-7s (%.3f%%) %s #%s%s", + String.valueOf(c.getAmount()), + c.getAmount() / (double) size * 100, + name, + c.getID().getType().getId(), + c.getID().getStates()); + player.print(str); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 1c3a05d23..ffd9f89ee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -100,7 +100,14 @@ public class ToolCommands { @CommandPermissions("worldedit.tool.replacer") public void repl(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - BaseBlock targetBlock = we.getBlock(player, args.getString(0)); + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + context.setRestricted(true); + context.setPreferringWildcard(false); + + BaseBlock targetBlock = we.getBlockFactory().parseFromInput(args.getString(0), context); session.setTool(player.getItemInHand(), new BlockReplacer(targetBlock)); player.print("Block replacer tool bound to " + ItemType.toHeldName(player.getItemInHand()) + "."); @@ -189,8 +196,16 @@ public class ToolCommands { @CommandPermissions("worldedit.tool.lrbuild") public void longrangebuildtool(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - BaseBlock secondary = we.getBlock(player, args.getString(0)); - BaseBlock primary = we.getBlock(player, args.getString(1)); + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + context.setRestricted(true); + context.setPreferringWildcard(false); + + BaseBlock secondary = we.getBlockFactory().parseFromInput(args.getString(0), context); + BaseBlock primary = we.getBlockFactory().parseFromInput(args.getString(1), context); + session.setTool(player.getItemInHand(), new LongRangeBuildTool(primary, secondary)); player.print("Long-range building tool bound to " + ItemType.toHeldName(player.getItemInHand()) + "."); player.print("Left-click set to " + ItemType.toName(secondary.getType().getLegacyId()) + "; right-click set to " diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 08dc0dd6f..1e465df36 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -250,7 +250,14 @@ public class UtilityCommands { @Logging(PLACEMENT) public void removeNear(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - BaseBlock block = we.getBlock(player, args.getString(0), true); + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + context.setRestricted(false); + context.setPreferringWildcard(false); + + BaseBlock block = we.getBlockFactory().parseFromInput(args.getString(0), context); int size = Math.max(1, args.getInteger(1, 50)); we.checkMaxRadius(size); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java index f33ffbbbe..7551309fe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java @@ -50,7 +50,7 @@ public class AreaPickaxe implements BlockTool { int ox = clicked.getBlockX(); int oy = clicked.getBlockY(); int oz = clicked.getBlockZ(); - BlockType initialType = ((World) clicked.getExtent()).getBlock(clicked.toVector()).getType(); + BlockType initialType = clicked.getExtent().getBlock(clicked.toVector()).getType(); if (initialType == BlockTypes.AIR) { return true; @@ -72,7 +72,7 @@ public class AreaPickaxe implements BlockTool { continue; } - ((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType.getLegacyId(), clicked.toVector().distanceSq(pos)); + ((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType, clicked.toVector().distanceSq(pos)); editSession.setBlock(pos, air); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java index 61dc556f6..a329638b6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java @@ -26,7 +26,6 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.inventory.BlockBag; -import com.sk89q.worldedit.world.World; /** * A mode that replaces one block. @@ -66,10 +65,9 @@ public class BlockReplacer implements DoubleActionBlockTool { @Override public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { - World world = (World) clicked.getExtent(); EditSession editSession = session.createEditSession(player); targetBlock = (editSession).getBlock(clicked.toVector()); - BlockType type = BlockType.fromID(targetBlock.getType().getLegacyId()); + BlockType type = targetBlock.getType().getLegacyType(); if (type != null) { player.print("Replacer tool switched to: " + type.getName()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index 7d3bc9698..12e71f951 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -102,7 +102,7 @@ public class FloatingTreeRemover implements BlockTool { return true; } - Vector[] recurseDirections = { + private Vector[] recurseDirections = { PlayerDirection.NORTH.vector(), PlayerDirection.EAST.vector(), PlayerDirection.SOUTH.vector(), diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java index dd2a73d86..25ff56c84 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java @@ -67,8 +67,8 @@ public class FloodFillTool implements BlockTool { EditSession editSession = session.createEditSession(player); try { - recurse(server, editSession, world, clicked.toVector().toBlockVector(), - clicked.toVector(), range, initialType.getLegacyId(), new HashSet<>()); + recurse(editSession, clicked.toVector().toBlockVector(), + clicked.toVector(), range, initialType, new HashSet<>()); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { @@ -78,7 +78,7 @@ public class FloodFillTool implements BlockTool { return true; } - private void recurse(Platform server, EditSession editSession, World world, BlockVector pos, Vector origin, int size, int initialType, + private void recurse(EditSession editSession, BlockVector pos, Vector origin, int size, BlockType initialType, Set visited) throws MaxChangedBlocksException { if (origin.distance(pos) > size || visited.contains(pos)) { @@ -87,23 +87,23 @@ public class FloodFillTool implements BlockTool { visited.add(pos); - if (editSession.getBlock(pos).getType().getLegacyId() == initialType) { + if (editSession.getBlock(pos).getType() == initialType) { editSession.setBlock(pos, pattern.apply(pos)); } else { return; } - recurse(server, editSession, world, pos.add(1, 0, 0).toBlockVector(), + recurse(editSession, pos.add(1, 0, 0).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(-1, 0, 0).toBlockVector(), + recurse(editSession, pos.add(-1, 0, 0).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(0, 0, 1).toBlockVector(), + recurse(editSession, pos.add(0, 0, 1).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(0, 0, -1).toBlockVector(), + recurse(editSession, pos.add(0, 0, -1).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(0, 1, 0).toBlockVector(), + recurse(editSession, pos.add(0, 1, 0).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(0, -1, 0).toBlockVector(), + recurse(editSession, pos.add(0, -1, 0).toBlockVector(), origin, size, initialType, visited); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java index ee2182c68..eb5ec44dd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java @@ -93,7 +93,7 @@ public class RecursivePickaxe implements BlockTool { return; } - world.queueBlockBreakEffect(server, pos, initialType.getLegacyId(), distanceSq); + world.queueBlockBreakEffect(server, pos, initialType, distanceSq); editSession.setBlock(pos, air); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java index 9b8bdb76d..edafb16c7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java @@ -24,7 +24,7 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; @@ -44,8 +44,8 @@ public class SinglePickaxe implements BlockTool { @Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { World world = (World) clicked.getExtent(); - final int blockType = world.getLazyBlock(clicked.toVector()).getId(); - if (blockType == BlockID.BEDROCK + final BlockType blockType = world.getLazyBlock(clicked.toVector()).getType(); + if (blockType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; } @@ -61,7 +61,7 @@ public class SinglePickaxe implements BlockTool { editSession.flushQueue(); } - world.playEffect(clicked.toVector(), 2001, blockType); + world.playEffect(clicked.toVector(), 2001, blockType.getLegacyId()); return true; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java index 0c5753d6d..96dc8cc89 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java @@ -143,7 +143,7 @@ public class CraftScriptContext extends CraftScriptEnvironment { } /** - * Get an item ID from an item name or an item ID number. + * Get an item from an item name or an item ID number. * * @param input input to parse * @param allAllowed true to ignore blacklists @@ -152,7 +152,14 @@ public class CraftScriptContext extends CraftScriptEnvironment { * @throws DisallowedItemException */ public BaseBlock getBlock(String input, boolean allAllowed) throws WorldEditException { - return controller.getBlock(player, input, allAllowed); + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + context.setRestricted(!allAllowed); + context.setPreferringWildcard(false); + + return controller.getBlockFactory().parseFromListInput(input, context).stream().findFirst().orElse(null); } /** @@ -164,7 +171,7 @@ public class CraftScriptContext extends CraftScriptEnvironment { * @throws DisallowedItemException */ public BaseBlock getBlock(String id) throws WorldEditException { - return controller.getBlock(player, id, false); + return getBlock(id, false); } /** @@ -192,27 +199,13 @@ public class CraftScriptContext extends CraftScriptEnvironment { * @throws UnknownItemException * @throws DisallowedItemException */ - public Set getBlockIDs(String list, boolean allBlocksAllowed) throws WorldEditException { - return controller.getBlockIDs(player, list, allBlocksAllowed); - } - - /** - * Gets the path to a file. This method will check to see if the filename - * has valid characters and has an extension. It also prevents directory - * traversal exploits by checking the root directory and the file directory. - * On success, a {@code java.io.File} object will be returned. - * - *

Use this method if you need to read a file from a directory.

- * - * @param folder sub-directory to look in - * @param filename filename (user-submitted) - * @return a file - * @throws FilenameException - */ - @Deprecated - public File getSafeFile(String folder, String filename) throws FilenameException { - File dir = controller.getWorkingDirectoryFile(folder); - return controller.getSafeOpenFile(player, dir, filename, null, (String[]) null); + public Set getBlocks(String list, boolean allBlocksAllowed) throws WorldEditException { + ParserContext context = new ParserContext(); + context.setActor(player); + context.setWorld(player.getWorld()); + context.setSession(session); + context.setRestricted(!allBlocksAllowed); + return controller.getBlockFactory().parseFromListInput(list, context); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index a3b248570..44ca7d2e8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -180,7 +180,7 @@ public abstract class AbstractWorld implements World { } @Override - public boolean queueBlockBreakEffect(Platform server, Vector position, int blockId, double priority) { + public boolean queueBlockBreakEffect(Platform server, Vector position, com.sk89q.worldedit.blocks.type.BlockType blockType, double priority) { if (taskId == -1) { taskId = server.schedule(0, 1, () -> { int max = Math.max(1, Math.min(30, effectQueue.size() / 3)); @@ -196,7 +196,7 @@ public abstract class AbstractWorld implements World { return false; } - effectQueue.offer(new QueuedEffect(position, blockId, priority)); + effectQueue.offer(new QueuedEffect(position, blockType, priority)); return true; } @@ -218,17 +218,17 @@ public abstract class AbstractWorld implements World { private class QueuedEffect implements Comparable { private final Vector position; - private final int blockId; + private final com.sk89q.worldedit.blocks.type.BlockType blockType; private final double priority; - private QueuedEffect(Vector position, int blockId, double priority) { + private QueuedEffect(Vector position, com.sk89q.worldedit.blocks.type.BlockType blockType, double priority) { this.position = position; - this.blockId = blockId; + this.blockType = blockType; this.priority = priority; } public void play() { - playEffect(position, 2001, blockId); + playEffect(position, 2001, blockType.getLegacyId()); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index f92126eb0..229c3fa50 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; @@ -262,11 +263,11 @@ public interface World extends Extent { * * @param server the server * @param position the position - * @param blockId the block ID + * @param blockType the block type * @param priority the priority * @return true if the effect was played */ - boolean queueBlockBreakEffect(Platform server, Vector position, int blockId, double priority); + boolean queueBlockBreakEffect(Platform server, Vector position, BlockType blockType, double priority); /** * Get the data for blocks and so on for this world. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 846eba25c..99bd9cbb7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -98,7 +98,7 @@ public class BundledBlockData { * @return the entry, or null */ @Nullable - private BlockEntry findById(String id) { + public BlockEntry findById(String id) { // If it has no namespace, assume minecraft. if (!id.contains(":")) { id = "minecraft:" + id; @@ -190,10 +190,11 @@ public class BundledBlockData { return INSTANCE; } - private static class BlockEntry { + public static class BlockEntry { private int legacyId; private String id; private String unlocalizedName; + public String localizedName; private List aliases; private Map states = new HashMap<>(); private SimpleBlockMaterial material = new SimpleBlockMaterial(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java index d4a578a67..0f9967c48 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java @@ -21,6 +21,11 @@ package com.sk89q.worldedit.world.registry.state; import com.sk89q.worldedit.world.registry.state.value.DirectionalStateValue; +import java.util.List; + public class DirectionalState extends SimpleState { + public DirectionalState(List values) { + super(values); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java index a6c66bf1d..790e47bca 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java @@ -21,17 +21,24 @@ package com.sk89q.worldedit.world.registry.state; import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue; -import java.util.ArrayList; import java.util.Collections; import java.util.List; public class SimpleState implements State { - private List values = new ArrayList<>(); + private List values; + + /** + * Creates a state with values + * + * @param values The values + */ + public SimpleState(List values) { + this.values = values; + } @Override public List getValues() { return Collections.unmodifiableList(values); } - } From e2608bc0c9bf048b129d1d59272c26bf1b762cf2 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 17 Jun 2018 17:50:04 +1000 Subject: [PATCH 15/74] Further modernise and remove legacy item classes --- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 16 +- .../bukkit/BukkitPlayerBlockBag.java | 9 +- .../sk89q/worldedit/bukkit/BukkitUtil.java | 5 + .../sk89q/worldedit/bukkit/BukkitWorld.java | 2 +- .../sk89q/worldedit/LocalConfiguration.java | 118 +-- .../com/sk89q/worldedit/LocalSession.java | 24 +- .../com/sk89q/worldedit/blocks/BaseItem.java | 19 +- .../com/sk89q/worldedit/blocks/BlockType.java | 18 - .../com/sk89q/worldedit/blocks/ItemType.java | 790 ------------------ .../sk89q/worldedit/blocks/type/ItemType.java | 15 + .../worldedit/blocks/type/ItemTypes.java | 5 + .../worldedit/command/BrushCommands.java | 15 +- .../worldedit/command/GeneralCommands.java | 91 +- .../worldedit/command/SelectionCommands.java | 3 +- .../sk89q/worldedit/command/ToolCommands.java | 60 +- .../worldedit/command/ToolUtilCommands.java | 11 +- .../composition/ShapedBrushCommand.java | 3 +- .../tool/InvalidToolBindException.java | 11 +- .../com/sk89q/worldedit/entity/Player.java | 11 +- .../extension/factory/DefaultBlockParser.java | 17 +- .../platform/AbstractPlayerActor.java | 26 +- .../extension/platform/PlatformManager.java | 23 +- .../extension/platform/PlayerProxy.java | 6 +- .../worldedit/extent/inventory/BlockBag.java | 9 +- .../command/WorldEditExceptionConverter.java | 20 +- .../com/sk89q/worldedit/util/HandSide.java | 25 + .../util/PropertiesConfiguration.java | 33 +- .../worldedit/util/YAMLConfiguration.java | 7 +- .../world/registry/BundledItemData.java | 7 +- .../sk89q/worldedit/forge/ForgePlayer.java | 10 +- .../com/sk89q/worldedit/forge/ForgeWorld.java | 7 +- .../sk89q/worldedit/forge/ForgeWorldEdit.java | 2 +- .../sk89q/worldedit/sponge/SpongePlayer.java | 10 +- .../sk89q/worldedit/sponge/SpongeWorld.java | 3 +- .../config/ConfigurateConfiguration.java | 6 +- 35 files changed, 392 insertions(+), 1045 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/HandSide.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index d0224b154..9053e4bf3 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -23,11 +23,13 @@ import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -55,14 +57,18 @@ public class BukkitPlayer extends AbstractPlayerActor { } @Override - public int getItemInHand() { - ItemStack itemStack = player.getItemInHand(); - return itemStack != null ? itemStack.getTypeId() : 0; + public BaseItemStack getItemInHand(HandSide handSide) { + ItemStack itemStack = handSide == HandSide.MAIN_HAND + ? player.getInventory().getItemInMainHand() + : player.getInventory().getItemInOffHand(); + return BukkitUtil.toBaseItemStack(itemStack); } @Override - public BaseBlock getBlockInHand() throws WorldEditException { - ItemStack itemStack = player.getItemInHand(); + public BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException { + ItemStack itemStack = handSide == HandSide.MAIN_HAND + ? player.getInventory().getItemInMainHand() + : player.getInventory().getItemInOffHand(); return BukkitUtil.toBlock(getWorld(), itemStack); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index 1f392fdc3..8733c4f9a 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BlockID; -import com.sk89q.worldedit.blocks.ItemType; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBagException; import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; @@ -65,11 +64,11 @@ public class BukkitPlayerBlockBag extends BlockBag { @Override public void fetchItem(BaseItem item) throws BlockBagException { - final int id = item.getType(); + final int id = item.getLegacyId(); final int damage = item.getData(); int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; assert(amount == 1); - boolean usesDamageValue = ItemType.usesDamageValue(id); + boolean usesDamageValue = true;// TODO ItemType.usesDamageValue(id); if (id == BlockID.AIR) { throw new IllegalArgumentException("Can't fetch air block"); @@ -120,11 +119,11 @@ public class BukkitPlayerBlockBag extends BlockBag { @Override public void storeItem(BaseItem item) throws BlockBagException { - final int id = item.getType(); + final int id = item.getLegacyId(); final int damage = item.getData(); int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; assert(amount <= 64); - boolean usesDamageValue = ItemType.usesDamageValue(id); + boolean usesDamageValue = true; //TODO ItemType.usesDamageValue(id); if (id == BlockID.AIR) { throw new IllegalArgumentException("Can't store air block"); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index c0f7c5852..eb50b50ca 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.NotABlockException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.ItemID; @@ -152,4 +153,8 @@ public final class BukkitUtil { throw new NotABlockException(typeId); } + + public static BaseItemStack toBaseItemStack(ItemStack itemStack) { + return new BaseItemStack(itemStack.getTypeId(), itemStack.getDurability()); + } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 7f3c11aac..903a54d10 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -324,7 +324,7 @@ public class BukkitWorld extends AbstractWorld { @Override public void dropItem(Vector pt, BaseItemStack item) { World world = getWorld(); - ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(), + ItemStack bukkitItem = new ItemStack(item.getLegacyId(), item.getAmount(), item.getData()); world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java index 613d60941..f5611a2e4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit; -import com.sk89q.worldedit.blocks.BlockID; -import com.sk89q.worldedit.blocks.ItemID; +import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.util.logging.LogFormat; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; @@ -33,53 +33,73 @@ import java.util.Set; */ public abstract class LocalConfiguration { - protected static final int[] defaultDisallowedBlocks = new int[] { - // dangerous stuff (physics/drops items) - BlockID.SAPLING, - BlockID.BED, - BlockID.POWERED_RAIL, - BlockID.DETECTOR_RAIL, - BlockID.LONG_GRASS, - BlockID.DEAD_BUSH, - BlockID.PISTON_EXTENSION, - BlockID.PISTON_MOVING_PIECE, - BlockID.YELLOW_FLOWER, - BlockID.RED_FLOWER, - BlockID.BROWN_MUSHROOM, - BlockID.RED_MUSHROOM, - BlockID.TNT, - BlockID.TORCH, - BlockID.FIRE, - BlockID.REDSTONE_WIRE, - BlockID.CROPS, - BlockID.MINECART_TRACKS, - BlockID.LEVER, - BlockID.REDSTONE_TORCH_OFF, - BlockID.REDSTONE_TORCH_ON, - BlockID.REDSTONE_REPEATER_OFF, - BlockID.REDSTONE_REPEATER_ON, - BlockID.STONE_BUTTON, - BlockID.CACTUS, - BlockID.REED, - // ores and stuff - BlockID.BEDROCK, - BlockID.GOLD_ORE, - BlockID.IRON_ORE, - BlockID.COAL_ORE, - BlockID.DIAMOND_ORE, - - // @TODO rethink what should be disallowed by default - // Gold and iron can be legitimately obtained, but were set to disallowed by - // default. Diamond and coal can't be legitimately obtained. Sponges, - // portals, snow, and locked chests also can't, but are allowed. None of - // these blocks poses any immediate threat. Most of the blocks (in the first - // section) are disallowed because people will accidentally set a huge area - // of them, triggering physics and a million item drops, lagging the server. - // Doors also have this effect, but are not disallowed. - }; + protected static final String[] defaultDisallowedBlocks = new String[] { + // dangerous stuff (physics/drops items) + BlockTypes.OAK_SAPLING.getId(), + BlockTypes.JUNGLE_SAPLING.getId(), + BlockTypes.DARK_OAK_SAPLING.getId(), + BlockTypes.SPRUCE_SAPLING.getId(), + BlockTypes.BIRCH_SAPLING.getId(), + BlockTypes.ACACIA_SAPLING.getId(), + BlockTypes.BLACK_BED.getId(), + BlockTypes.BLUE_BED.getId(), + BlockTypes.BROWN_BED.getId(), + BlockTypes.CYAN_BED.getId(), + BlockTypes.GRAY_BED.getId(), + BlockTypes.GREEN_BED.getId(), + BlockTypes.LIGHT_BLUE_BED.getId(), + BlockTypes.LIGHT_GRAY_BED.getId(), + BlockTypes.LIME_BED.getId(), + BlockTypes.MAGENTA_BED.getId(), + BlockTypes.ORANGE_BED.getId(), + BlockTypes.PINK_BED.getId(), + BlockTypes.PURPLE_BED.getId(), + BlockTypes.RED_BED.getId(), + BlockTypes.WHITE_BED.getId(), + BlockTypes.YELLOW_BED.getId(), + BlockTypes.POWERED_RAIL.getId(), + BlockTypes.DETECTOR_RAIL.getId(), + BlockTypes.GRASS.getId(), + BlockTypes.DEAD_BUSH.getId(), + BlockTypes.MOVING_PISTON.getId(), + BlockTypes.PISTON_HEAD.getId(), + BlockTypes.SUNFLOWER.getId(), + BlockTypes.ROSE_BUSH.getId(), + BlockTypes.DANDELION.getId(), + BlockTypes.POPPY.getId(), + BlockTypes.BROWN_MUSHROOM.getId(), + BlockTypes.RED_MUSHROOM.getId(), + BlockTypes.TNT.getId(), + BlockTypes.TORCH.getId(), + BlockTypes.FIRE.getId(), + BlockTypes.REDSTONE_WIRE.getId(), + BlockTypes.WHEAT.getId(), + BlockTypes.POTATOES.getId(), + BlockTypes.CARROTS.getId(), + BlockTypes.MELON_STEM.getId(), + BlockTypes.PUMPKIN_STEM.getId(), + BlockTypes.BEETROOTS.getId(), + BlockTypes.RAIL.getId(), + BlockTypes.LEVER.getId(), + BlockTypes.REDSTONE_TORCH.getId(), + BlockTypes.REDSTONE_WALL_TORCH.getId(), + BlockTypes.REPEATER.getId(), + BlockTypes.COMPARATOR.getId(), + BlockTypes.STONE_BUTTON.getId(), + BlockTypes.BIRCH_BUTTON.getId(), + BlockTypes.ACACIA_BUTTON.getId(), + BlockTypes.DARK_OAK_BUTTON.getId(), + BlockTypes.JUNGLE_BUTTON.getId(), + BlockTypes.OAK_BUTTON.getId(), + BlockTypes.SPRUCE_BUTTON.getId(), + BlockTypes.CACTUS.getId(), + BlockTypes.SUGAR_CANE.getId(), + // ores and stuff + BlockTypes.BEDROCK.getId(), + }; public boolean profile = false; - public Set disallowedBlocks = new HashSet<>(); + public Set disallowedBlocks = new HashSet<>(); public int defaultChangeLimit = -1; public int maxChangeLimit = -1; public int defaultMaxPolygonalPoints = -1; @@ -95,7 +115,7 @@ public abstract class LocalConfiguration { public String logFile = ""; public String logFormat = LogFormat.DEFAULT_FORMAT; public boolean registerHelp = true; // what is the point of this, it's not even used - public int wandItem = ItemID.WOOD_AXE; + public String wandItem = ItemTypes.WOODEN_AXE.getId(); public boolean superPickaxeDrop = true; public boolean superPickaxeManyDrop = true; public boolean noDoubleSlash = false; @@ -103,7 +123,7 @@ public abstract class LocalConfiguration { public boolean useInventoryOverride = false; public boolean useInventoryCreativeOverride = false; public boolean navigationUseGlass = true; - public int navigationWand = ItemID.COMPASS; + public String navigationWand = ItemTypes.COMPASS.getId(); public int navigationWandMaxDistance = 50; public int scriptTimeout = 3000; public Set allowedDataCycleBlocks = new HashSet<>(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index 1d7a0e7fb..d9c904344 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -25,6 +25,8 @@ import com.sk89q.jchronic.Chronic; import com.sk89q.jchronic.Options; import com.sk89q.jchronic.utils.Span; import com.sk89q.jchronic.utils.Time; +import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.command.tool.BlockTool; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.InvalidToolBindException; @@ -76,7 +78,7 @@ public class LocalSession { private transient boolean toolControl = true; private transient boolean superPickaxe = false; private transient BlockTool pickaxeMode = new SinglePickaxe(); - private transient Map tools = new HashMap<>(); + private transient Map tools = new HashMap<>(); private transient int maxBlocksChanged = -1; private transient boolean useInventory; private transient Snapshot snapshot; @@ -517,11 +519,11 @@ public class LocalSession { /** * Get the tool assigned to the item. * - * @param item the item type ID + * @param item the item type * @return the tool, which may be {@link null} */ @Nullable - public Tool getTool(int item) { + public Tool getTool(ItemType item) { return tools.get(item); } @@ -530,14 +532,14 @@ public class LocalSession { * or the tool is not assigned, the slot will be replaced with the * brush tool. * - * @param item the item type ID + * @param item the item type * @return the tool, or {@code null} * @throws InvalidToolBindException if the item can't be bound to that item */ - public BrushTool getBrushTool(int item) throws InvalidToolBindException { + public BrushTool getBrushTool(ItemType item) throws InvalidToolBindException { Tool tool = getTool(item); - if (tool == null || !(tool instanceof BrushTool)) { + if (!(tool instanceof BrushTool)) { tool = new BrushTool("worldedit.brush.sphere"); setTool(item, tool); } @@ -548,16 +550,16 @@ public class LocalSession { /** * Set the tool. * - * @param item the item type ID + * @param item the item type * @param tool the tool to set, which can be {@code null} * @throws InvalidToolBindException if the item can't be bound to that item */ - public void setTool(int item, @Nullable Tool tool) throws InvalidToolBindException { - if (item > 0 && item < 255) { + public void setTool(ItemType item, @Nullable Tool tool) throws InvalidToolBindException { + if (false /*TODO item > 0 && item < 255*/) { throw new InvalidToolBindException(item, "Blocks can't be used"); - } else if (item == config.wandItem) { + } else if (item == ItemTypes.getItemType(config.wandItem)) { throw new InvalidToolBindException(item, "Already used for the wand"); - } else if (item == config.navigationWand) { + } else if (item == ItemTypes.getItemType(config.navigationWand)) { throw new InvalidToolBindException(item, "Already used for the navigation wand"); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java index 1427332de..228035c98 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java @@ -65,7 +65,7 @@ public class BaseItem { */ @Deprecated public BaseItem(int id, short data) { - setType(id); + setLegacyId(id); this.damage = data; } @@ -86,7 +86,7 @@ public class BaseItem { * @return the id */ @Deprecated - public int getType() { + public int getLegacyId() { return this.itemType.getLegacyId(); } @@ -96,9 +96,18 @@ public class BaseItem { * @param id the id to set */ @Deprecated - public void setType(int id) { + public void setLegacyId(int id) { ItemType type = ItemTypes.getItemType(BundledItemData.getInstance().fromLegacyId(id)); - setItemType(type); + setType(type); + } + + /** + * Get the type of item. + * + * @return the type + */ + public ItemType getType() { + return this.itemType; } /** @@ -106,7 +115,7 @@ public class BaseItem { * * @param itemType The type to set */ - public void setItemType(ItemType itemType) { + public void setType(ItemType itemType) { this.itemType = itemType; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index e68df4b3f..d24b3e73f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -1633,24 +1633,6 @@ public enum BlockType { } } - /** - * Get the block or item that would have been dropped. If nothing is - * dropped, 0 will be returned. If the block should not be destroyed - * (i.e. bedrock), -1 will be returned. - * - * @param id the type ID of the block - * @return the dropped item - * @deprecated This function ignores the data value. - */ - @Deprecated - public static int getDroppedBlock(int id) { - BaseItem dropped = nonDataBlockBagItems.get(id); - if (dropped == null) { - return BlockID.AIR; - } - return dropped.getType(); - } - /** * Get the block drop for this type given a data value. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java deleted file mode 100644 index 809162ec6..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemType.java +++ /dev/null @@ -1,790 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import com.sk89q.util.StringUtil; - -import javax.annotation.Nullable; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - -/** - * An enum of types of items. - * - * {@Deprecated Please use {@link com.sk89q.worldedit.blocks.type.ItemType}} - */ -@Deprecated -public enum ItemType { - - // Blocks - AIR(BlockID.AIR, "Air", "air"), - STONE(BlockID.STONE, "Stone", "stone", "rock"), - GRASS(BlockID.GRASS, "Grass", "grass"), - DIRT(BlockID.DIRT, "Dirt", "dirt"), - COBBLESTONE(BlockID.COBBLESTONE, "Cobblestone", "cobblestone", "cobble"), - WOOD(BlockID.WOOD, "Wood", "wood", "woodplank", "plank", "woodplanks", "planks"), - SAPLING(BlockID.SAPLING, "Sapling", "sapling", "seedling"), - BEDROCK(BlockID.BEDROCK, "Bedrock", "adminium", "bedrock"), - WATER(BlockID.WATER, "Water", "watermoving", "movingwater", "flowingwater", "waterflowing"), - STATIONARY_WATER(BlockID.STATIONARY_WATER, "Water (stationary)", "water", "waterstationary", "stationarywater", "stillwater"), - LAVA(BlockID.LAVA, "Lava", "lavamoving", "movinglava", "flowinglava", "lavaflowing"), - STATIONARY_LAVA(BlockID.STATIONARY_LAVA, "Lava (stationary)", "lava", "lavastationary", "stationarylava", "stilllava"), - SAND(BlockID.SAND, "Sand", "sand"), - GRAVEL(BlockID.GRAVEL, "Gravel", "gravel"), - GOLD_ORE(BlockID.GOLD_ORE, "Gold ore", "goldore"), - IRON_ORE(BlockID.IRON_ORE, "Iron ore", "ironore"), - COAL_ORE(BlockID.COAL_ORE, "Coal ore", "coalore"), - LOG(BlockID.LOG, "Log", "log", "tree", "pine", "oak", "birch", "redwood"), - LEAVES(BlockID.LEAVES, "Leaves", "leaves", "leaf"), - SPONGE(BlockID.SPONGE, "Sponge", "sponge"), - GLASS(BlockID.GLASS, "Glass", "glass"), - LAPIS_LAZULI_ORE(BlockID.LAPIS_LAZULI_ORE, "Lapis lazuli ore", "lapislazuliore", "blueore", "lapisore"), - LAPIS_LAZULI(BlockID.LAPIS_LAZULI_BLOCK, "Lapis lazuli", "lapislazuli", "lapislazuliblock", "bluerock"), - DISPENSER(BlockID.DISPENSER, "Dispenser", "dispenser"), - SANDSTONE(BlockID.SANDSTONE, "Sandstone", "sandstone"), - NOTE_BLOCK(BlockID.NOTE_BLOCK, "Note block", "musicblock", "noteblock", "note", "music", "instrument"), - BED(BlockID.BED, "Bed", "bed"), - POWERED_RAIL(BlockID.POWERED_RAIL, "Powered Rail", "poweredrail", "boosterrail", "poweredtrack", "boostertrack", "booster"), - DETECTOR_RAIL(BlockID.DETECTOR_RAIL, "Detector Rail", "detectorrail", "detector"), - PISTON_STICKY_BASE(BlockID.PISTON_STICKY_BASE, "Sticky Piston", "stickypiston"), - WEB(BlockID.WEB, "Web", "web", "spiderweb"), - LONG_GRASS(BlockID.LONG_GRASS, "Long grass", "longgrass", "tallgrass"), - DEAD_BUSH(BlockID.DEAD_BUSH, "Shrub", "deadbush", "shrub", "deadshrub", "tumbleweed"), - PISTON_BASE(BlockID.PISTON_BASE, "Piston", "piston"), - PISTON_EXTENSION(BlockID.PISTON_EXTENSION, "Piston extension", "pistonextendsion", "pistonhead"), - CLOTH(BlockID.CLOTH, "Wool", "cloth", "wool"), - PISTON_MOVING_PIECE(BlockID.PISTON_MOVING_PIECE, "Piston moving piece", "movingpiston"), - YELLOW_FLOWER(BlockID.YELLOW_FLOWER, "Yellow flower", "yellowflower", "flower"), - RED_FLOWER(BlockID.RED_FLOWER, "Red rose", "redflower", "redrose", "rose"), - BROWN_MUSHROOM(BlockID.BROWN_MUSHROOM, "Brown mushroom", "brownmushroom", "mushroom"), - RED_MUSHROOM(BlockID.RED_MUSHROOM, "Red mushroom", "redmushroom"), - GOLD_BLOCK(BlockID.GOLD_BLOCK, "Gold block", "gold", "goldblock"), - IRON_BLOCK(BlockID.IRON_BLOCK, "Iron block", "iron", "ironblock"), - DOUBLE_STEP(BlockID.DOUBLE_STEP, "Double step", "doubleslab", "doublestoneslab", "doublestep"), - STEP(BlockID.STEP, "Step", "slab", "stoneslab", "step", "halfstep"), - BRICK(BlockID.BRICK, "Brick", "brick", "brickblock"), - TNT(BlockID.TNT, "TNT", "tnt", "c4", "explosive"), - BOOKCASE(BlockID.BOOKCASE, "Bookcase", "bookshelf", "bookshelves", "bookcase", "bookcases"), - MOSSY_COBBLESTONE(BlockID.MOSSY_COBBLESTONE, "Cobblestone (mossy)", "mossycobblestone", "mossstone", "mossystone", "mosscobble", "mossycobble", "moss", "mossy", "sossymobblecone"), - OBSIDIAN(BlockID.OBSIDIAN, "Obsidian", "obsidian"), - TORCH(BlockID.TORCH, "Torch", "torch", "light", "candle"), - FIRE(BlockID.FIRE, "Fire", "fire", "flame", "flames"), - MOB_SPAWNER(BlockID.MOB_SPAWNER, "Mob spawner", "mobspawner", "spawner"), - WOODEN_STAIRS(BlockID.OAK_WOOD_STAIRS, "Wooden stairs", "woodstair", "woodstairs", "woodenstair", "woodenstairs"), - CHEST(BlockID.CHEST, "Chest", "chest", "storage", "storagechest"), - REDSTONE_WIRE(BlockID.REDSTONE_WIRE, "Redstone wire", "redstone", "redstoneblock"), - DIAMOND_ORE(BlockID.DIAMOND_ORE, "Diamond ore", "diamondore"), - DIAMOND_BLOCK(BlockID.DIAMOND_BLOCK, "Diamond block", "diamond", "diamondblock"), - WORKBENCH(BlockID.WORKBENCH, "Workbench", "workbench", "table", "craftingtable", "crafting"), - CROPS(BlockID.CROPS, "Crops", "crops", "crop", "plant", "plants"), - SOIL(BlockID.SOIL, "Soil", "soil", "farmland"), - FURNACE(BlockID.FURNACE, "Furnace", "furnace"), - BURNING_FURNACE(BlockID.BURNING_FURNACE, "Furnace (burning)", "burningfurnace", "litfurnace"), - SIGN_POST(BlockID.SIGN_POST, "Sign post", "sign", "signpost"), - WOODEN_DOOR(BlockID.WOODEN_DOOR, "Wooden door", "wooddoor", "woodendoor", "door"), - LADDER(BlockID.LADDER, "Ladder", "ladder"), - MINECART_TRACKS(BlockID.MINECART_TRACKS, "Minecart tracks", "track", "tracks", "minecrattrack", "minecarttracks", "rails", "rail"), - COBBLESTONE_STAIRS(BlockID.COBBLESTONE_STAIRS, "Cobblestone stairs", "cobblestonestair", "cobblestonestairs", "cobblestair", "cobblestairs"), - WALL_SIGN(BlockID.WALL_SIGN, "Wall sign", "wallsign"), - LEVER(BlockID.LEVER, "Lever", "lever", "switch", "stonelever", "stoneswitch"), - STONE_PRESSURE_PLATE(BlockID.STONE_PRESSURE_PLATE, "Stone pressure plate", "stonepressureplate", "stoneplate"), - IRON_DOOR(BlockID.IRON_DOOR, "Iron Door", "irondoor"), - WOODEN_PRESSURE_PLATE(BlockID.WOODEN_PRESSURE_PLATE, "Wooden pressure plate", "woodpressureplate", "woodplate", "woodenpressureplate", "woodenplate", "plate", "pressureplate"), - REDSTONE_ORE(BlockID.REDSTONE_ORE, "Redstone ore", "redstoneore"), - GLOWING_REDSTONE_ORE(BlockID.GLOWING_REDSTONE_ORE, "Glowing redstone ore", "glowingredstoneore"), - REDSTONE_TORCH_OFF(BlockID.REDSTONE_TORCH_OFF, "Redstone torch (off)", "redstonetorchoff", "rstorchoff"), - REDSTONE_TORCH_ON(BlockID.REDSTONE_TORCH_ON, "Redstone torch (on)", "redstonetorch", "redstonetorchon", "rstorchon", "redtorch"), - STONE_BUTTON(BlockID.STONE_BUTTON, "Stone Button", "stonebutton", "button"), - SNOW(BlockID.SNOW, "Snow", "snow"), - ICE(BlockID.ICE, "Ice", "ice"), - SNOW_BLOCK(BlockID.SNOW_BLOCK, "Snow block", "snowblock"), - CACTUS(BlockID.CACTUS, "Cactus", "cactus", "cacti"), - CLAY(BlockID.CLAY, "Clay", "clay"), - SUGAR_CANE(BlockID.REED, "Reed", "reed", "cane", "sugarcane", "sugarcanes", "vine", "vines"), - JUKEBOX(BlockID.JUKEBOX, "Jukebox", "jukebox", "stereo", "recordplayer"), - FENCE(BlockID.FENCE, "Fence", "fence"), - PUMPKIN(BlockID.PUMPKIN, "Pumpkin", "pumpkin"), - NETHERRACK(BlockID.NETHERRACK, "Netherrack", "redmossycobblestone", "redcobblestone", "redmosstone", "redcobble", "netherstone", "netherrack", "nether", "hellstone"), - SOUL_SAND(BlockID.SLOW_SAND, "Soul sand", "slowmud", "mud", "soulsand", "hellmud"), - GLOWSTONE(BlockID.LIGHTSTONE, "Glowstone", "brittlegold", "glowstone", "lightstone", "brimstone", "australium"), - PORTAL(BlockID.PORTAL, "Portal", "portal"), - JACK_O_LANTERN(BlockID.JACKOLANTERN, "Pumpkin (on)", "pumpkinlighted", "pumpkinon", "litpumpkin", "jackolantern"), - CAKE(BlockID.CAKE_BLOCK, "Cake", "cake", "cakeblock"), - REDSTONE_REPEATER_OFF(BlockID.REDSTONE_REPEATER_OFF, "Redstone repeater (off)", "diodeoff", "redstonerepeater", "repeateroff", "delayeroff"), - REDSTONE_REPEATER_ON(BlockID.REDSTONE_REPEATER_ON, "Redstone repeater (on)", "diodeon", "redstonerepeateron", "repeateron", "delayeron"), - @Deprecated LOCKED_CHEST(BlockID.LOCKED_CHEST, "thisblockisinvalidusedstainedglassinstead"), - STAINED_GLASS(BlockID.STAINED_GLASS, "Stained Glass", "stainedglass"), - TRAP_DOOR(BlockID.TRAP_DOOR, "Trap door", "trapdoor", "hatch", "floordoor"), - SILVERFISH_BLOCK(BlockID.SILVERFISH_BLOCK, "Silverfish block", "silverfish", "silver"), - STONE_BRICK(BlockID.STONE_BRICK, "Stone brick", "stonebrick", "sbrick", "smoothstonebrick"), - RED_MUSHROOM_CAP(BlockID.RED_MUSHROOM_CAP, "Red mushroom cap", "giantmushroomred", "redgiantmushroom", "redmushroomcap"), - BROWN_MUSHROOM_CAP(BlockID.BROWN_MUSHROOM_CAP, "Brown mushroom cap", "giantmushroombrown", "browngiantmushoom", "brownmushroomcap"), - IRON_BARS(BlockID.IRON_BARS, "Iron bars", "ironbars", "ironfence"), - GLASS_PANE(BlockID.GLASS_PANE, "Glass pane", "window", "glasspane", "glasswindow"), - MELON_BLOCK(BlockID.MELON_BLOCK, "Melon (block)", "melonblock"), - PUMPKIN_STEM(BlockID.PUMPKIN_STEM, "Pumpkin stem", "pumpkinstem"), - MELON_STEM(BlockID.MELON_STEM, "Melon stem", "melonstem"), - VINE(BlockID.VINE, "Vine", "vine", "vines", "creepers"), - FENCE_GATE(BlockID.FENCE_GATE, "Fence gate", "fencegate", "gate"), - BRICK_STAIRS(BlockID.BRICK_STAIRS, "Brick stairs", "brickstairs", "bricksteps"), - STONE_BRICK_STAIRS(BlockID.STONE_BRICK_STAIRS, "Stone brick stairs", "stonebrickstairs", "smoothstonebrickstairs"), - MYCELIUM(BlockID.MYCELIUM, "Mycelium", "mycelium", "fungus", "mycel"), - LILY_PAD(BlockID.LILY_PAD, "Lily pad", "lilypad", "waterlily"), - NETHER_BRICK(BlockID.NETHER_BRICK, "Nether brick", "netherbrick"), - NETHER_BRICK_FENCE(BlockID.NETHER_BRICK_FENCE, "Nether brick fence", "netherbrickfence", "netherfence"), - NETHER_BRICK_STAIRS(BlockID.NETHER_BRICK_STAIRS, "Nether brick stairs", "netherbrickstairs", "netherbricksteps", "netherstairs", "nethersteps"), - NETHER_WART(BlockID.NETHER_WART, "Nether wart", "netherwart", "netherstalk"), - ENCHANTMENT_TABLE(BlockID.ENCHANTMENT_TABLE, "Enchantment table", "enchantmenttable", "enchanttable"), - BREWING_STAND(BlockID.BREWING_STAND, "Brewing Stand", "brewingstand"), - CAULDRON(BlockID.CAULDRON, "Cauldron"), - END_PORTAL(BlockID.END_PORTAL, "End Portal", "endportal", "blackstuff", "airportal", "weirdblackstuff"), - END_PORTAL_FRAME(BlockID.END_PORTAL_FRAME, "End Portal Frame", "endportalframe", "airportalframe", "crystalblock"), - END_STONE(BlockID.END_STONE, "End Stone", "endstone", "enderstone", "endersand"), - DRAGON_EGG(BlockID.DRAGON_EGG, "Dragon Egg", "dragonegg", "dragons"), - REDSTONE_LAMP_OFF(BlockID.REDSTONE_LAMP_OFF, "Redstone lamp (off)", "redstonelamp", "redstonelampoff", "rslamp", "rslampoff", "rsglow", "rsglowoff"), - REDSTONE_LAMP_ON(BlockID.REDSTONE_LAMP_ON, "Redstone lamp (on)", "redstonelampon", "rslampon", "rsglowon"), - DOUBLE_WOODEN_STEP(BlockID.DOUBLE_WOODEN_STEP, "Double wood step", "doublewoodslab", "doublewoodstep"), - WOODEN_STEP(BlockID.WOODEN_STEP, "Wood step", "woodenslab", "woodslab", "woodstep", "woodhalfstep"), - COCOA_PLANT(BlockID.COCOA_PLANT, "Cocoa plant", "cocoplant", "cocoaplant"), - SANDSTONE_STAIRS(BlockID.SANDSTONE_STAIRS, "Sandstone stairs", "sandstairs", "sandstonestairs"), - EMERALD_ORE(BlockID.EMERALD_ORE, "Emerald ore", "emeraldore"), - ENDER_CHEST(BlockID.ENDER_CHEST, "Ender chest", "enderchest"), - TRIPWIRE_HOOK(BlockID.TRIPWIRE_HOOK, "Tripwire hook", "tripwirehook"), - TRIPWIRE(BlockID.TRIPWIRE, "Tripwire", "tripwire", "string"), - EMERALD_BLOCK(BlockID.EMERALD_BLOCK, "Emerald block", "emeraldblock", "emerald"), - SPRUCE_WOOD_STAIRS(BlockID.SPRUCE_WOOD_STAIRS, "Spruce wood stairs", "sprucestairs", "sprucewoodstairs"), - BIRCH_WOOD_STAIRS(BlockID.BIRCH_WOOD_STAIRS, "Birch wood stairs", "birchstairs", "birchwoodstairs"), - JUNGLE_WOOD_STAIRS(BlockID.JUNGLE_WOOD_STAIRS, "Jungle wood stairs", "junglestairs", "junglewoodstairs"), - COMMAND_BLOCK(BlockID.COMMAND_BLOCK, "Command block", "commandblock", "cmdblock", "command", "cmd"), - BEACON(BlockID.BEACON, "Beacon", "beacon", "beaconblock"), - COBBLESTONE_WALL(BlockID.COBBLESTONE_WALL, "Cobblestone wall", "cobblestonewall", "cobblewall"), - FLOWER_POT_BLOCK(BlockID.FLOWER_POT, "Flower pot", "flowerpot", "plantpot", "pot"), - CARROTS(BlockID.CARROTS, "Carrots", "carrots", "carrotsplant", "carrotsblock"), - POTATOES(BlockID.POTATOES, "Potatoes", "potatoes", "potatoesblock"), - WOODEN_BUTTON(BlockID.WOODEN_BUTTON, "Wooden button", "woodbutton", "woodenbutton"), - HEAD_BLOCK(BlockID.HEAD, "Head", "head", "skull"), - ANVIL(BlockID.ANVIL, "Anvil", "anvil", "blacksmith"), - TRAPPED_CHEST(BlockID.TRAPPED_CHEST, "Trapped Chest", "trappedchest", "redstonechest"), - PRESSURE_PLATE_LIGHT(BlockID.PRESSURE_PLATE_LIGHT, "Weighted Pressure Plate (Light)", "lightpressureplate"), - PRESSURE_PLATE_HEAVY(BlockID.PRESSURE_PLATE_HEAVY, "Weighted Pressure Plate (Heavy)", "heavypressureplate"), - COMPARATOR_OFF(BlockID.COMPARATOR_OFF, "Redstone Comparator (inactive)", "redstonecomparator", "comparator"), - COMPARATOR_ON(BlockID.COMPARATOR_ON, "Redstone Comparator (active)", "redstonecomparatoron", "comparatoron"), - DAYLIGHT_SENSOR(BlockID.DAYLIGHT_SENSOR, "Daylight Sensor", "daylightsensor", "lightsensor", "daylightdetector"), - REDSTONE_BLOCK(BlockID.REDSTONE_BLOCK, "Block of Redstone", "redstoneblock", "blockofredstone"), - QUARTZ_ORE(BlockID.QUARTZ_ORE, "Nether Quartz Ore", "quartzore", "netherquartzore"), - HOPPER(BlockID.HOPPER, "Hopper", "hopper"), - QUARTZ_BLOCK(BlockID.QUARTZ_BLOCK, "Block of Quartz", "quartzblock", "quartz"), - QUARTZ_STAIRS(BlockID.QUARTZ_STAIRS, "Quartz Stairs", "quartzstairs"), - ACTIVATOR_RAIL(BlockID.ACTIVATOR_RAIL, "Activator Rail", "activatorrail", "tntrail", "activatortrack"), - DROPPER(BlockID.DROPPER, "Dropper", "dropper"), - STAINED_CLAY(BlockID.STAINED_CLAY, "Stained Clay", "stainedclay", "stainedhardenedclay"), - STAINED_GLASS_PANE(BlockID.STAINED_GLASS_PANE, "Stained Glass Pane", "stainedglasspane"), - LEAVES2(BlockID.LEAVES2, "Leaves", "leaves2", "acacialeaves", "darkoakleaves"), - LOG2(BlockID.LOG2, "Log", "log2", "acacia", "darkoak"), - ACACIA_STAIRS(BlockID.ACACIA_STAIRS, "Acacia Wood Stairs", "acaciawoodstairs", "acaciastairs"), - DARK_OAK_STAIRS(BlockID.DARK_OAK_STAIRS, "Dark Oak Wood Stairs", "darkoakwoodstairs", "darkoakstairs"), - HAY_BLOCK(BlockID.HAY_BLOCK, "Hay Block", "hayblock", "haybale", "wheatbale"), - CARPET(BlockID.CARPET, "Carpet", "carpet"), - HARDENED_CLAY(BlockID.HARDENED_CLAY, "Hardened Clay", "hardenedclay", "hardclay"), - COAL_BLOCK(BlockID.COAL_BLOCK, "Block of Coal", "coalblock", "blockofcoal"), - PACKED_ICE(BlockID.PACKED_ICE, "Packed Ice", "packedice", "hardice"), - DOUBLE_PLANT(BlockID.DOUBLE_PLANT, "Large Flowers", "largeflowers", "doubleflowers"), - - DARK_OAK_DOOR(BlockID.DARK_OAK_DOOR, "Dark Oak Door", "darkoakdoor"), - END_ROD(BlockID.END_ROD, "End Rod", "endrod", "endtorch"), - CHORUS_PLANT(BlockID.CHORUS_PLANT, "Chorus Plant", "chorusplant", "chorusstem"), - CHORUS_FLOWER(BlockID.CHORUS_FLOWER, "Chorus Flower", "chorusflower"), - PURPUR_BLOCK(BlockID.PURPUR_BLOCK, "Purpur Block", "purpurblock", "blockpurpur"), - PURPUR_PILLAR(BlockID.PURPUR_PILLAR, "Purpur Pillar", "purpurpillar"), - PURPUR_STAIRS(BlockID.PURPUR_STAIRS, "Purpur Stairs", "purpurstairs"), - PURPUR_DOUBLE_SLAB(BlockID.PURPUR_DOUBLE_SLAB, "Purpur Double Slab", "purpurdoubleslab", "doubleslabpurpur", "doublepurpurslab"), - PURPUR_SLAB(BlockID.PURPUR_SLAB, "Purpur Slab", "purpurslab", "slabpurpur"), - END_BRICKS(BlockID.END_BRICKS, "End Bricks", "endbricks"), - BEETROOTS(BlockID.BEETROOTS, "Beetroots", "beetroots", "beetroot_plant"), - GRASS_PATH(BlockID.GRASS_PATH, "Grass Path", "grasspath", "dirtpath"), - END_GATEWAY(BlockID.END_GATEWAY, "End Gateway", "endgateway"), - REPEATING_COMMAND_BLOCK(BlockID.REPEATING_COMMAND_BLOCK, "Repeating Command Block", "repeatingcommandblock", "commandblockrepeating"), - CHAIN_COMMAND_BLOCK(BlockID.CHAIN_COMMAND_BLOCK, "Chain Command Block", "chaincommandblock", "commandblockchain"), - FROSTED_ICE(BlockID.FROSTED_ICE, "Frosted Ice", "frostedice", "frostwalkerice"), - MAGMA_BLOCK(BlockID.MAGMA_BLOCK, "Magma Block", "magmablock", "magma"), - NETHER_WART_BLOCK(BlockID.NETHER_WART_BLOCK, "Nether Wart Block", "netherwartblock"), - RED_NETHER_BRICK(BlockID.RED_NETHER_BRICK, "Red Nether Brick", "rednetherbrick", "netherbrickred"), - BONE_BLOCK(BlockID.BONE_BLOCK, "Bone Block", "boneblock", "blockbone", "fossil", "fossilblock", "blockfossil"), - STRUCTURE_VOID(BlockID.STRUCTURE_VOID, "Structure Void", "structurevoid", "structureair"), - OBSERVER(BlockID.OBSERVER, "Observer", "observer", "blockupdatedetector"), - SHULKER_BOX_WHITE(BlockID.SHULKER_BOX_WHITE, "White Shulker Box", "shulkerboxwhite"), - SHULKER_BOX_ORANGE(BlockID.SHULKER_BOX_ORANGE, "Orange Shulker Box", "shulkerboxorange"), - SHULKER_BOX_MAGENTA(BlockID.SHULKER_BOX_MAGENTA, "Magenta Shulker Box", "shulkerboxmagenta"), - SHULKER_BOX_LIGHT_BLUE(BlockID.SHULKER_BOX_LIGHT_BLUE, "Light Blue Shulker Box", "shulkerboxlightblue"), - SHULKER_BOX_YELLOW(BlockID.SHULKER_BOX_YELLOW, "Yellow Shulker Box", "shulkerboxyellow"), - SHULKER_BOX_LIME(BlockID.SHULKER_BOX_LIME, "Lime Shulker Box", "shulkerboxlime"), - SHULKER_BOX_PINK(BlockID.SHULKER_BOX_PINK, "Pink Shulker Box", "shulkerboxpink"), - SHULKER_BOX_GRAY(BlockID.SHULKER_BOX_GRAY, "Gray Shulker Box", "shulkerboxgray"), - SHULKER_BOX_LIGHT_GRAY(BlockID.SHULKER_BOX_LIGHT_GRAY, "Light Gray Shulker Box", "shulkerboxlightgray"), - SHULKER_BOX_CYAN(BlockID.SHULKER_BOX_CYAN, "Cyan Shulker Box", "shulkerboxcyan"), - SHULKER_BOX_PURPLE(BlockID.SHULKER_BOX_PURPLE, "Purple Shulker Box", "shulkerboxpurple"), - SHULKER_BOX_BLUE(BlockID.SHULKER_BOX_BLUE, "Blue Shulker Box", "shulkerboxblue"), - SHULKER_BOX_BROWN(BlockID.SHULKER_BOX_BROWN, "Brown Shulker Box", "shulkerboxbrown"), - SHULKER_BOX_GREEN(BlockID.SHULKER_BOX_GREEN, "Green Shulker Box", "shulkerboxgreen"), - SHULKER_BOX_RED(BlockID.SHULKER_BOX_RED, "Red Shulker Box", "shulkerboxred"), - SHULKER_BOX_BLACK(BlockID.SHULKER_BOX_BLACK, "Black Shulker Box", "shulkerboxblack"), - TERRACOTTA_WHITE(BlockID.TERRACOTTA_WHITE, "White Terracotta", "terracottawhite"), - TERRACOTTA_ORANGE(BlockID.TERRACOTTA_ORANGE, "Orange Terracotta", "terracottaorange"), - TERRACOTTA_MAGENTA(BlockID.TERRACOTTA_MAGENTA, "Magenta Terracotta", "terracottamagenta"), - TERRACOTTA_LIGHT_BLUE(BlockID.TERRACOTTA_LIGHT_BLUE, "Light Blue Terracotta", "terracottalightblue"), - TERRACOTTA_YELLOW(BlockID.TERRACOTTA_YELLOW, "Yellow Terracotta", "terracottayellow"), - TERRACOTTA_LIME(BlockID.TERRACOTTA_LIME, "Lime Terracotta", "terracottalime"), - TERRACOTTA_PINK(BlockID.TERRACOTTA_PINK, "Pink Terracotta", "terracottapink"), - TERRACOTTA_GRAY(BlockID.TERRACOTTA_GRAY, "Gray Terracotta", "terracottagray"), - TERRACOTTA_LIGHT_GRAY(BlockID.TERRACOTTA_LIGHT_GRAY, "Light Gray Terracotta", "terracottalightgray"), - TERRACOTTA_CYAN(BlockID.TERRACOTTA_CYAN, "Cyan Terracotta", "terracottacyan"), - TERRACOTTA_PURPLE(BlockID.TERRACOTTA_PURPLE, "Purple Terracotta", "terracottapurple"), - TERRACOTTA_BLUE(BlockID.TERRACOTTA_BLUE, "Blue Terracotta", "terracottablue"), - TERRACOTTA_BROWN(BlockID.TERRACOTTA_BROWN, "Brown Terracotta", "terracottabrown"), - TERRACOTTA_GREEN(BlockID.TERRACOTTA_GREEN, "Green Terracotta", "terracottagreen"), - TERRACOTTA_RED(BlockID.TERRACOTTA_RED, "Red Terracotta", "terracottared"), - TERRACOTTA_BLACK(BlockID.TERRACOTTA_BLACK, "Black Terracotta", "terracottablack"), - CONCRETE(BlockID.CONCRETE, "Concrete", "concrete"), - CONCRETE_POWDER(BlockID.CONCRETE_POWDER, "Concrete Powder", "concretepowder"), - STRUCTURE_BLOCK(BlockID.STRUCTURE_BLOCK, "Structure Block", "structureblock"), - - // Items - IRON_SHOVEL(ItemID.IRON_SHOVEL, "Iron shovel", "ironshovel"), - IRON_PICK(ItemID.IRON_PICK, "Iron pick", "ironpick", "ironpickaxe"), - IRON_AXE(ItemID.IRON_AXE, "Iron axe", "ironaxe"), - FLINT_AND_TINDER(ItemID.FLINT_AND_TINDER, "Flint and tinder", "flintandtinder", "lighter", "flintandsteel", "flintsteel", "flintandiron", "flintnsteel", "flintniron", "flintntinder"), - RED_APPLE(ItemID.RED_APPLE, "Red apple", "redapple", "apple"), - BOW(ItemID.BOW, "Bow", "bow"), - ARROW(ItemID.ARROW, "Arrow", "arrow"), - COAL(ItemID.COAL, "Coal", "coal"), - DIAMOND(ItemID.DIAMOND, "Diamond", "diamond"), - IRON_BAR(ItemID.IRON_BAR, "Iron bar", "ironbar", "iron"), - GOLD_BAR(ItemID.GOLD_BAR, "Gold bar", "goldbar", "gold"), - IRON_SWORD(ItemID.IRON_SWORD, "Iron sword", "ironsword"), - WOOD_SWORD(ItemID.WOOD_SWORD, "Wooden sword", "woodsword"), - WOOD_SHOVEL(ItemID.WOOD_SHOVEL, "Wooden shovel", "woodshovel"), - WOOD_PICKAXE(ItemID.WOOD_PICKAXE, "Wooden pickaxe", "woodpick", "woodpickaxe"), - WOOD_AXE(ItemID.WOOD_AXE, "Wooden axe", "woodaxe"), - STONE_SWORD(ItemID.STONE_SWORD, "Stone sword", "stonesword"), - STONE_SHOVEL(ItemID.STONE_SHOVEL, "Stone shovel", "stoneshovel"), - STONE_PICKAXE(ItemID.STONE_PICKAXE, "Stone pickaxe", "stonepick", "stonepickaxe"), - STONE_AXE(ItemID.STONE_AXE, "Stone pickaxe", "stoneaxe"), - DIAMOND_SWORD(ItemID.DIAMOND_SWORD, "Diamond sword", "diamondsword"), - DIAMOND_SHOVEL(ItemID.DIAMOND_SHOVEL, "Diamond shovel", "diamondshovel"), - DIAMOND_PICKAXE(ItemID.DIAMOND_PICKAXE, "Diamond pickaxe", "diamondpick", "diamondpickaxe"), - DIAMOND_AXE(ItemID.DIAMOND_AXE, "Diamond axe", "diamondaxe"), - STICK(ItemID.STICK, "Stick", "stick"), - BOWL(ItemID.BOWL, "Bowl", "bowl"), - MUSHROOM_SOUP(ItemID.MUSHROOM_SOUP, "Mushroom soup", "mushroomsoup", "soup", "brbsoup"), - GOLD_SWORD(ItemID.GOLD_SWORD, "Golden sword", "goldsword"), - GOLD_SHOVEL(ItemID.GOLD_SHOVEL, "Golden shovel", "goldshovel"), - GOLD_PICKAXE(ItemID.GOLD_PICKAXE, "Golden pickaxe", "goldpick", "goldpickaxe"), - GOLD_AXE(ItemID.GOLD_AXE, "Golden axe", "goldaxe"), - STRING(ItemID.STRING, "String", "string"), - FEATHER(ItemID.FEATHER, "Feather", "feather"), - SULPHUR(ItemID.SULPHUR, "Sulphur", "sulphur", "sulfur", "gunpowder"), - WOOD_HOE(ItemID.WOOD_HOE, "Wooden hoe", "woodhoe"), - STONE_HOE(ItemID.STONE_HOE, "Stone hoe", "stonehoe"), - IRON_HOE(ItemID.IRON_HOE, "Iron hoe", "ironhoe"), - DIAMOND_HOE(ItemID.DIAMOND_HOE, "Diamond hoe", "diamondhoe"), - GOLD_HOE(ItemID.GOLD_HOE, "Golden hoe", "goldhoe"), - SEEDS(ItemID.SEEDS, "Seeds", "seeds", "seed"), - WHEAT(ItemID.WHEAT, "Wheat", "wheat"), - BREAD(ItemID.BREAD, "Bread", "bread"), - LEATHER_HELMET(ItemID.LEATHER_HELMET, "Leather helmet", "leatherhelmet", "leatherhat"), - LEATHER_CHEST(ItemID.LEATHER_CHEST, "Leather chestplate", "leatherchest", "leatherchestplate", "leathervest", "leatherbreastplate", "leatherplate", "leathercplate", "leatherbody"), - LEATHER_PANTS(ItemID.LEATHER_PANTS, "Leather pants", "leatherpants", "leathergreaves", "leatherlegs", "leatherleggings", "leatherstockings", "leatherbreeches"), - LEATHER_BOOTS(ItemID.LEATHER_BOOTS, "Leather boots", "leatherboots", "leathershoes", "leatherfoot", "leatherfeet"), - CHAINMAIL_HELMET(ItemID.CHAINMAIL_HELMET, "Chainmail helmet", "chainmailhelmet", "chainmailhat"), - CHAINMAIL_CHEST(ItemID.CHAINMAIL_CHEST, "Chainmail chestplate", "chainmailchest", "chainmailchestplate", "chainmailvest", "chainmailbreastplate", "chainmailplate", "chainmailcplate", "chainmailbody"), - CHAINMAIL_PANTS(ItemID.CHAINMAIL_PANTS, "Chainmail pants", "chainmailpants", "chainmailgreaves", "chainmaillegs", "chainmailleggings", "chainmailstockings", "chainmailbreeches"), - CHAINMAIL_BOOTS(ItemID.CHAINMAIL_BOOTS, "Chainmail boots", "chainmailboots", "chainmailshoes", "chainmailfoot", "chainmailfeet"), - IRON_HELMET(ItemID.IRON_HELMET, "Iron helmet", "ironhelmet", "ironhat"), - IRON_CHEST(ItemID.IRON_CHEST, "Iron chestplate", "ironchest", "ironchestplate", "ironvest", "ironbreastplate", "ironplate", "ironcplate", "ironbody"), - IRON_PANTS(ItemID.IRON_PANTS, "Iron pants", "ironpants", "irongreaves", "ironlegs", "ironleggings", "ironstockings", "ironbreeches"), - IRON_BOOTS(ItemID.IRON_BOOTS, "Iron boots", "ironboots", "ironshoes", "ironfoot", "ironfeet"), - DIAMOND_HELMET(ItemID.DIAMOND_HELMET, "Diamond helmet", "diamondhelmet", "diamondhat"), - DIAMOND_CHEST(ItemID.DIAMOND_CHEST, "Diamond chestplate", "diamondchest", "diamondchestplate", "diamondvest", "diamondbreastplate", "diamondplate", "diamondcplate", "diamondbody"), - DIAMOND_PANTS(ItemID.DIAMOND_PANTS, "Diamond pants", "diamondpants", "diamondgreaves", "diamondlegs", "diamondleggings", "diamondstockings", "diamondbreeches"), - DIAMOND_BOOTS(ItemID.DIAMOND_BOOTS, "Diamond boots", "diamondboots", "diamondshoes", "diamondfoot", "diamondfeet"), - GOLD_HELMET(ItemID.GOLD_HELMET, "Gold helmet", "goldhelmet", "goldhat"), - GOLD_CHEST(ItemID.GOLD_CHEST, "Gold chestplate", "goldchest", "goldchestplate", "goldvest", "goldbreastplate", "goldplate", "goldcplate", "goldbody"), - GOLD_PANTS(ItemID.GOLD_PANTS, "Gold pants", "goldpants", "goldgreaves", "goldlegs", "goldleggings", "goldstockings", "goldbreeches"), - GOLD_BOOTS(ItemID.GOLD_BOOTS, "Gold boots", "goldboots", "goldshoes", "goldfoot", "goldfeet"), - FLINT(ItemID.FLINT, "Flint", "flint"), - RAW_PORKCHOP(ItemID.RAW_PORKCHOP, "Raw porkchop", "rawpork", "rawporkchop", "rawbacon", "baconstrips", "rawmeat"), - COOKED_PORKCHOP(ItemID.COOKED_PORKCHOP, "Cooked porkchop", "pork", "cookedpork", "cookedporkchop", "cookedbacon", "bacon", "meat"), - PAINTING(ItemID.PAINTING, "Painting", "painting"), - GOLD_APPLE(ItemID.GOLD_APPLE, "Golden apple", "goldapple", "goldenapple"), - SIGN(ItemID.SIGN, "Wooden sign", "sign"), - WOODEN_DOOR_ITEM(ItemID.WOODEN_DOOR_ITEM, "Wooden door", "wooddoor", "door"), - BUCKET(ItemID.BUCKET, "Bucket", "bucket", "bukkit"), - WATER_BUCKET(ItemID.WATER_BUCKET, "Water bucket", "waterbucket", "waterbukkit"), - LAVA_BUCKET(ItemID.LAVA_BUCKET, "Lava bucket", "lavabucket", "lavabukkit"), - MINECART(ItemID.MINECART, "Minecart", "minecart", "cart"), - SADDLE(ItemID.SADDLE, "Saddle", "saddle"), - IRON_DOOR_ITEM(ItemID.IRON_DOOR_ITEM, "Iron door", "irondoor"), - REDSTONE_DUST(ItemID.REDSTONE_DUST, "Redstone dust", "redstonedust", "reddust", "redstone", "dust", "wire"), - SNOWBALL(ItemID.SNOWBALL, "Snowball", "snowball"), - WOOD_BOAT(ItemID.WOOD_BOAT, "Wooden boat", "woodboat", "woodenboat", "boat"), - LEATHER(ItemID.LEATHER, "Leather", "leather", "cowhide"), - MILK_BUCKET(ItemID.MILK_BUCKET, "Milk bucket", "milkbucket", "milk", "milkbukkit"), - BRICK_BAR(ItemID.BRICK_BAR, "Brick", "brickbar"), - CLAY_BALL(ItemID.CLAY_BALL, "Clay", "clay"), - SUGAR_CANE_ITEM(ItemID.SUGAR_CANE_ITEM, "Sugar cane", "sugarcane", "reed", "reeds"), - PAPER(ItemID.PAPER, "Paper", "paper"), - BOOK(ItemID.BOOK, "Book", "book"), - SLIME_BALL(ItemID.SLIME_BALL, "Slime ball", "slimeball", "slime"), - STORAGE_MINECART(ItemID.STORAGE_MINECART, "Minecart with Chest", "storageminecart", "storagecart", "minecartwithchest", "minecartchest", "chestminecart"), - POWERED_MINECART(ItemID.POWERED_MINECART, "Minecart with Furnace", "poweredminecart", "poweredcart", "minecartwithfurnace", "minecartfurnace", "furnaceminecart"), - EGG(ItemID.EGG, "Egg", "egg"), - COMPASS(ItemID.COMPASS, "Compass", "compass"), - FISHING_ROD(ItemID.FISHING_ROD, "Fishing rod", "fishingrod", "fishingpole"), - WATCH(ItemID.WATCH, "Watch", "watch", "clock", "timer"), - LIGHTSTONE_DUST(ItemID.LIGHTSTONE_DUST, "Glowstone dust", "lightstonedust", "glowstonedone", "brightstonedust", "brittlegolddust", "brimstonedust"), - RAW_FISH(ItemID.RAW_FISH, "Raw fish", "rawfish", "fish"), - COOKED_FISH(ItemID.COOKED_FISH, "Cooked fish", "cookedfish"), - INK_SACK(ItemID.INK_SACK, "Ink sac", "inksac", "ink", "dye", "inksack"), - BONE(ItemID.BONE, "Bone", "bone"), - SUGAR(ItemID.SUGAR, "Sugar", "sugar"), - CAKE_ITEM(ItemID.CAKE_ITEM, "Cake", "cake"), - BED_ITEM(ItemID.BED_ITEM, "Bed", "bed"), - REDSTONE_REPEATER(ItemID.REDSTONE_REPEATER, "Redstone repeater", "redstonerepeater", "diode", "delayer", "repeater"), - COOKIE(ItemID.COOKIE, "Cookie", "cookie"), - MAP(ItemID.MAP, "Map", "map"), - SHEARS(ItemID.SHEARS, "Shears", "shears", "scissors"), - MELON(ItemID.MELON, "Melon Slice", "melon", "melonslice"), - PUMPKIN_SEEDS(ItemID.PUMPKIN_SEEDS, "Pumpkin seeds", "pumpkinseed", "pumpkinseeds"), - MELON_SEEDS(ItemID.MELON_SEEDS, "Melon seeds", "melonseed", "melonseeds"), - RAW_BEEF(ItemID.RAW_BEEF, "Raw beef", "rawbeef", "rawcow", "beef"), - COOKED_BEEF(ItemID.COOKED_BEEF, "Steak", "steak", "cookedbeef", "cookedcow"), - RAW_CHICKEN(ItemID.RAW_CHICKEN, "Raw chicken", "rawchicken"), - COOKED_CHICKEN(ItemID.COOKED_CHICKEN, "Cooked chicken", "cookedchicken", "chicken", "grilledchicken"), - ROTTEN_FLESH(ItemID.ROTTEN_FLESH, "Rotten flesh", "rottenflesh", "zombiemeat", "flesh"), - ENDER_PEARL(ItemID.ENDER_PEARL, "Ender pearl", "pearl", "enderpearl"), - BLAZE_ROD(ItemID.BLAZE_ROD, "Blaze rod", "blazerod"), - GHAST_TEAR(ItemID.GHAST_TEAR, "Ghast tear", "ghasttear"), - GOLD_NUGGET(ItemID.GOLD_NUGGET, "Gold nuggest", "goldnugget"), - NETHER_WART_ITEM(ItemID.NETHER_WART_SEED, "Nether wart", "netherwart", "netherwartseed"), - POTION(ItemID.POTION, "Potion", "potion"), - GLASS_BOTTLE(ItemID.GLASS_BOTTLE, "Glass bottle", "glassbottle"), - SPIDER_EYE(ItemID.SPIDER_EYE, "Spider eye", "spidereye"), - FERMENTED_SPIDER_EYE(ItemID.FERMENTED_SPIDER_EYE, "Fermented spider eye", "fermentedspidereye", "fermentedeye"), - BLAZE_POWDER(ItemID.BLAZE_POWDER, "Blaze powder", "blazepowder"), - MAGMA_CREAM(ItemID.MAGMA_CREAM, "Magma cream", "magmacream"), - BREWING_STAND_ITEM(ItemID.BREWING_STAND, "Brewing stand", "brewingstand"), - CAULDRON_ITEM(ItemID.CAULDRON, "Cauldron", "cauldron"), - EYE_OF_ENDER(ItemID.EYE_OF_ENDER, "Eye of Ender", "eyeofender", "endereye"), - GLISTERING_MELON(ItemID.GLISTERING_MELON, "Glistering Melon", "glisteringmelon", "goldmelon"), - SPAWN_EGG(ItemID.SPAWN_EGG, "Spawn Egg", "spawnegg", "spawn", "mobspawnegg"), - BOTTLE_O_ENCHANTING(ItemID.BOTTLE_O_ENCHANTING, "Bottle o' Enchanting", "expbottle", "bottleoenchanting", "experiencebottle", "exppotion", "experiencepotion"), - FIRE_CHARGE(ItemID.FIRE_CHARGE, "Fire Charge", "firecharge", "firestarter", "firerock"), - BOOK_AND_QUILL(ItemID.BOOK_AND_QUILL, "Book and Quill", "bookandquill", "quill", "writingbook"), - WRITTEN_BOOK(ItemID.WRITTEN_BOOK, "Written Book", "writtenbook"), - EMERALD(ItemID.EMERALD, "Emerald", "emeraldingot", "emerald"), - ITEM_FRAME(ItemID.ITEM_FRAME, "Item frame", "itemframe", "frame", "itempainting"), - FLOWER_POT(ItemID.FLOWER_POT, "Flower pot", "flowerpot", "plantpot", "pot"), - CARROT(ItemID.CARROT, "Carrot", "carrot"), - POTATO(ItemID.POTATO, "Potato", "potato"), - BAKED_POTATO(ItemID.BAKED_POTATO, "Baked potato", "bakedpotato", "potatobaked"), - POISONOUS_POTATO(ItemID.POISONOUS_POTATO, "Poisonous potato", "poisonpotato", "poisonouspotato"), - BLANK_MAP(ItemID.BLANK_MAP, "Blank map", "blankmap", "emptymap"), - GOLDEN_CARROT(ItemID.GOLDEN_CARROT, "Golden carrot", "goldencarrot", "goldcarrot"), - HEAD(ItemID.HEAD, "Head", "skull", "head", "headmount", "mount"), - CARROT_ON_A_STICK(ItemID.CARROT_ON_A_STICK, "Carrot on a stick", "carrotonastick", "carrotonstick", "stickcarrot", "carrotstick"), - NETHER_STAR(ItemID.NETHER_STAR, "Nether star", "netherstar", "starnether"), - PUMPKIN_PIE(ItemID.PUMPKIN_PIE, "Pumpkin pie", "pumpkinpie"), - FIREWORK_ROCKET(ItemID.FIREWORK_ROCKET, "Firework rocket", "firework", "rocket"), - FIREWORK_STAR(ItemID.FIREWORK_STAR, "Firework star", "fireworkstar", "fireworkcharge"), - ENCHANTED_BOOK(ItemID.ENCHANTED_BOOK, "Enchanted book", "enchantedbook", "spellbook", "enchantedtome", "tome"), - COMPARATOR(ItemID.COMPARATOR, "Comparator", "comparator", "capacitor"), - NETHER_BRICK_ITEM(ItemID.NETHER_BRICK, "Nether Brick (item)", "netherbrickitem"), - NETHER_QUARTZ(ItemID.NETHER_QUARTZ, "Nether Quartz", "netherquartz", "quartz"), - TNT_MINECART(ItemID.TNT_MINECART, "Minecart with TNT", "minecraftwithtnt", "tntminecart", "minecarttnt"), - HOPPER_MINECART(ItemID.HOPPER_MINECART, "Minecart with Hopper", "minecraftwithhopper", "hopperminecart", "minecarthopper"), - PRISMARINE_SHARD(ItemID.PRISMARINE_SHARD, "Prismarine Shard", "prismarineshard"), - PRISMARINE_CRYSTALS(ItemID.PRISMARINE_CRYSTALS, "Prismarine Crystals", "prismarinecrystals", "prismarinecrystal"), - RABBIT(ItemID.RABBIT, "Raw Rabbit", "rawrabbit", "rabbit"), // raw and wriggling - COOKED_RABBIT(ItemID.COOKED_RABBIT, "Cooked Rabbit", "cookedrabbit"), // stupid fat hobbit, you ruins it - RABBIT_STEW(ItemID.RABBIT_STEW, "Rabbit Stew", "rabbitstew"), // po-ta-toes - RABBIT_FOOT(ItemID.RABBIT_FOOT, "Rabbit's Foot", "rabbitsfoot", "rabbitfoot"), - RABBIT_HIDE(ItemID.RABBIT_HIDE, "Rabbit Hide", "rabbithide", "rabbitskin"), - ARMOR_STAND(ItemID.ARMOR_STAND, "Armor Stand", "armorstand"), - HORSE_ARMOR_IRON(ItemID.HORSE_ARMOR_IRON, "Iron Horse Armor", "ironhorsearmor", "ironbarding"), - HORSE_ARMOR_GOLD(ItemID.HORSE_ARMOR_GOLD, "Gold Horse Armor", "goldhorsearmor", "goldbarding"), - HORSE_ARMOR_DIAMOND(ItemID.HORSE_ARMOR_DIAMOND, "Diamond Horse Armor", "diamondhorsearmor", "diamondbarding"), - LEAD(ItemID.LEAD, "Lead", "lead", "leash"), - NAME_TAG(ItemID.NAME_TAG, "Name Tag", "nametag"), - COMMAND_BLOCK_MINECART(ItemID.COMMAND_BLOCK_MINECART, "Minecart with Command Block"), - MUTTON(ItemID.MUTTON, "Mutton", "mutton", "rawmutton"), - COOKED_MUTTON(ItemID.COOKED_MUTTON, "Cooked Mutton", "cookedmutton"), - BANNER(ItemID.BANNER, "Banner", "banner"), - END_CRYSTAL(ItemID.END_CRYSTAL, "End Crystal", "endcrystal"), - SPRUCE_DOOR_ITEM(ItemID.SPRUCE_DOOR, "Spruce Door", "sprucedoor"), - BIRCH_DOOR_ITEM(ItemID.BIRCH_DOOR, "Birch Door", "birchdoor"), - JUNGLE_DOOR_ITEM(ItemID.JUNGLE_DOOR, "Jungle Door", "jungledoor"), - ACACIA_DOOR_ITEM(ItemID.ACACIA_DOOR, "Acacia Door", "acaciadoor"), - DARK_OAK_DOOR_ITEM(ItemID.DARK_OAK_DOOR, "Dark Oak Door", "darkoakdoor"), - CHORUS_FRUIT(ItemID.CHORUS_FRUIT, "Chorus Fruit", "chorusfruit"), - CHORUS_FRUIT_POPPED(ItemID.CHORUS_FRUIT_POPPED, "Popped Chorus Fruit", "poppedchorusfruit", "chorusfruitpopped", "cookedchorusfruit"), - BEETROOT(ItemID.BEETROOT, "Beetroot", "beetroot"), - BEETROOT_SEEDS(ItemID.BEETROOT_SEEDS, "Beetroot Seeds", "beetrootseeds"), - BEETROOT_SOUP(ItemID.BEETROOT_SOUP, "Beetroot Soup", "beetrootsoup"), - DRAGON_BREATH(ItemID.DRAGON_BREATH, "Dragon Breath", "dragonbreath"), - SPLASH_POTION(ItemID.SPLASH_POTION, "Splash Potion", "splashpotion", "potionsplash"), - SPECTRAL_ARROW(ItemID.SPECTRAL_ARROW, "Spectral Arrow", "spectralarrow", "glowingarrow"), - TIPPED_ARROW(ItemID.TIPPED_ARROW, "Tipped Arrow", "tippedarrow", "potionarrow"), - LINGERING_POTION(ItemID.LINGERING_POTION, "Lingering Potion", "lingeringpotion", "potionlingering"), - SHIELD(ItemID.SHIELD, "Shield", "shield"), - ELYTRA(ItemID.ELYTRA, "Elytra", "elytra", "wings"), - SPRUCE_BOAT(ItemID.SPRUCE_BOAT, "Spruce Boat", "spruceboat", "boatspruce"), - BIRCH_BOAT(ItemID.BIRCH_BOAT, "Birch Boat", "birchboat", "boatbirch"), - JUNGLE_BOAT(ItemID.JUNGLE_BOAT, "Jungle Boat", "jungleboat", "boatjungle"), - ACACIA_BOAT(ItemID.ACACIA_BOAT, "Acacia Boat", "acaciaboat", "boatacacia"), - DARK_OAK_BOAT(ItemID.DARK_OAK_BOAT, "Dark Oak Boat", "darkoakboat", "boatdarkoak"), - TOTEM_OF_UNDYING(ItemID.TOTEM_OF_UNDYING, "Totem of Undying", "totemofundying", "undyingtotem"), - SHULKER_SHELL(ItemID.SHULKER_SHELL, "Shulker Shell", "shulkershell"), - IRON_NUGGET(ItemID.IRON_NUGGET, "Iron Nugget", "ironnugget"), - KNOWLEDGE_BOOK(ItemID.KNOWLEDGE_BOOK, "Knowledge Book", "knowledgebook", "recipebook"), - - DISC_13(ItemID.DISC_13, "Music Disc - 13", "disc_13"), - DISC_CAT(ItemID.DISC_CAT, "Music Disc - Cat", "disc_cat"), - DISC_BLOCKS(ItemID.DISC_BLOCKS, "Music Disc - blocks", "disc_blocks"), - DISC_CHIRP(ItemID.DISC_CHIRP, "Music Disc - chirp", "disc_chirp"), - DISC_FAR(ItemID.DISC_FAR, "Music Disc - far", "disc_far"), - DISC_MALL(ItemID.DISC_MALL, "Music Disc - mall", "disc_mall"), - DISC_MELLOHI(ItemID.DISC_MELLOHI, "Music Disc - mellohi", "disc_mellohi"), - DISC_STAL(ItemID.DISC_STAL, "Music Disc - stal", "disc_stal"), - DISC_STRAD(ItemID.DISC_STRAD, "Music Disc - strad", "disc_strad"), - DISC_WARD(ItemID.DISC_WARD, "Music Disc - ward", "disc_ward"), - DISC_11(ItemID.DISC_11, "Music Disc - 11", "disc_11"), - DISC_WAIT(ItemID.DISC_WAIT, "Music Disc - wait", "disc_wait"), - - // deprecated - @Deprecated GOLD_RECORD(ItemID.GOLD_RECORD, "Gold Record", "goldrecord", "golddisc"), - @Deprecated GREEN_RECORD(ItemID.GREEN_RECORD, "Green Record", "greenrecord", "greenddisc"); - - /** - * Stores a map of the IDs for fast access. - */ - private static final Map ids = new HashMap<>(); - /** - * Stores a map of the names for fast access. - */ - private static final Map lookup = new LinkedHashMap<>(); - - private final int id; - private final String name; - private final String[] lookupKeys; - - static { - for (ItemType type : EnumSet.allOf(ItemType.class)) { - ids.put(type.id, type); - for (String key : type.lookupKeys) { - lookup.put(key, type); - } - } - } - - - /** - * Construct the type. - * - * @param id the type ID of the item - * @param name the name of the item - * @param lookupKey a name to refer to the item type by - */ - ItemType(int id, String name, String lookupKey) { - this.id = id; - this.name = name; - this.lookupKeys = new String[] { lookupKey }; - } - - /** - * Construct the type. - * - * @param id the type ID of the item - * @param name the name of the item - * @param lookupKeys a list of names to refer to the item type by - */ - ItemType(int id, String name, String... lookupKeys) { - this.id = id; - this.name = name; - this.lookupKeys = lookupKeys; - } - - /** - * Return type from ID. May return null. - * - * @param id the type ID of the item - * @return an item type or null - */ - @Nullable - public static ItemType fromID(int id) { - return ids.get(id); - } - - /** - * Get a name for the item. - * - *

If the item type is not null, the numeric ID will be returned.

- * - * @param id the type ID of the item - * @return a name for the item - */ - public static String toName(int id) { - ItemType type = ids.get(id); - if (type != null) { - return type.getName(); - } else { - return "#" + id; - } - } - - /** - * Get a name for a held item. - * - *

If the item type is not null, the numeric ID will be returned.

- * - * @param id the type ID of the item - * @return the name of the item - */ - public static String toHeldName(int id) { - if (id == 0) { - return "Hand"; - } - ItemType type = ids.get(id); - if (type != null) { - return type.getName(); - } else { - return "#" + id; - } - } - - /** - * Return type from name. May return null. - * - * @param name the name - * @return the type or null - */ - @Nullable - public static ItemType lookup(String name) { - return lookup(name, true); - } - - /** - * Return type from name. May return null. - * - * @param name the name - * @param fuzzy true to do a fuzzy string search - * @return the type or null - */ - @Nullable - public static ItemType lookup(String name, boolean fuzzy) { - try { - return fromID(Integer.parseInt(name)); - } catch (NumberFormatException e) { - return StringUtil.lookup(lookup, name, fuzzy); - } - } - - /** - * Get item numeric ID. - * - * @return the type ID of this item - */ - public int getID() { - return id; - } - - /** - * Get user-friendly item name. - * - * @return a name of this item - */ - public String getName() { - return name; - } - - /** - * Get a list of aliases. - * - * @return a list of aliases - */ - public String[] getAliases() { - return lookupKeys; - } - - private static final Set shouldNotStack = new HashSet<>(); - static { - shouldNotStack.add(ItemID.IRON_SHOVEL); - shouldNotStack.add(ItemID.IRON_PICK); - shouldNotStack.add(ItemID.IRON_AXE); - shouldNotStack.add(ItemID.FLINT_AND_TINDER); - shouldNotStack.add(ItemID.BOW); - shouldNotStack.add(ItemID.IRON_SWORD); - shouldNotStack.add(ItemID.WOOD_SWORD); - shouldNotStack.add(ItemID.WOOD_SHOVEL); - shouldNotStack.add(ItemID.WOOD_PICKAXE); - shouldNotStack.add(ItemID.WOOD_AXE); - shouldNotStack.add(ItemID.STONE_SWORD); - shouldNotStack.add(ItemID.STONE_SHOVEL); - shouldNotStack.add(ItemID.STONE_PICKAXE); - shouldNotStack.add(ItemID.STONE_AXE); - shouldNotStack.add(ItemID.DIAMOND_SWORD); - shouldNotStack.add(ItemID.DIAMOND_SHOVEL); - shouldNotStack.add(ItemID.DIAMOND_PICKAXE); - shouldNotStack.add(ItemID.DIAMOND_AXE); - shouldNotStack.add(ItemID.BOWL); - shouldNotStack.add(ItemID.GOLD_SWORD); - shouldNotStack.add(ItemID.GOLD_SHOVEL); - shouldNotStack.add(ItemID.GOLD_PICKAXE); - shouldNotStack.add(ItemID.GOLD_AXE); - shouldNotStack.add(ItemID.WOOD_HOE); - shouldNotStack.add(ItemID.STONE_HOE); - shouldNotStack.add(ItemID.IRON_HOE); - shouldNotStack.add(ItemID.DIAMOND_HOE); - shouldNotStack.add(ItemID.GOLD_HOE); - shouldNotStack.add(ItemID.LEATHER_HELMET); - shouldNotStack.add(ItemID.LEATHER_CHEST); - shouldNotStack.add(ItemID.LEATHER_PANTS); - shouldNotStack.add(ItemID.LEATHER_BOOTS); - shouldNotStack.add(ItemID.CHAINMAIL_CHEST); - shouldNotStack.add(ItemID.CHAINMAIL_HELMET); - shouldNotStack.add(ItemID.CHAINMAIL_BOOTS); - shouldNotStack.add(ItemID.CHAINMAIL_PANTS); - shouldNotStack.add(ItemID.IRON_HELMET); - shouldNotStack.add(ItemID.IRON_CHEST); - shouldNotStack.add(ItemID.IRON_PANTS); - shouldNotStack.add(ItemID.IRON_BOOTS); - shouldNotStack.add(ItemID.DIAMOND_HELMET); - shouldNotStack.add(ItemID.DIAMOND_PANTS); - shouldNotStack.add(ItemID.DIAMOND_CHEST); - shouldNotStack.add(ItemID.DIAMOND_BOOTS); - shouldNotStack.add(ItemID.GOLD_HELMET); - shouldNotStack.add(ItemID.GOLD_CHEST); - shouldNotStack.add(ItemID.GOLD_PANTS); - shouldNotStack.add(ItemID.GOLD_BOOTS); - shouldNotStack.add(ItemID.WOODEN_DOOR_ITEM); - shouldNotStack.add(ItemID.WATER_BUCKET); - shouldNotStack.add(ItemID.LAVA_BUCKET); - shouldNotStack.add(ItemID.MINECART); - shouldNotStack.add(ItemID.SADDLE); - shouldNotStack.add(ItemID.IRON_DOOR_ITEM); - shouldNotStack.add(ItemID.WOOD_BOAT); - shouldNotStack.add(ItemID.MILK_BUCKET); - shouldNotStack.add(ItemID.STORAGE_MINECART); - shouldNotStack.add(ItemID.POWERED_MINECART); - shouldNotStack.add(ItemID.WATCH); - shouldNotStack.add(ItemID.CAKE_ITEM); - shouldNotStack.add(ItemID.BED_ITEM); - shouldNotStack.add(ItemID.MAP); - shouldNotStack.add(ItemID.SHEARS); - shouldNotStack.add(ItemID.HEAD); - shouldNotStack.add(ItemID.FIREWORK_ROCKET); - shouldNotStack.add(ItemID.FIREWORK_STAR); - shouldNotStack.add(ItemID.ENCHANTED_BOOK); - shouldNotStack.add(ItemID.TNT_MINECART); - shouldNotStack.add(ItemID.HOPPER_MINECART); - shouldNotStack.add(ItemID.HORSE_ARMOR_IRON); - shouldNotStack.add(ItemID.HORSE_ARMOR_GOLD); - shouldNotStack.add(ItemID.HORSE_ARMOR_DIAMOND); - shouldNotStack.add(ItemID.COMMAND_BLOCK_MINECART); - shouldNotStack.add(ItemID.DISC_13); - shouldNotStack.add(ItemID.DISC_CAT); - shouldNotStack.add(ItemID.DISC_BLOCKS); - shouldNotStack.add(ItemID.DISC_CHIRP); - shouldNotStack.add(ItemID.DISC_FAR); - shouldNotStack.add(ItemID.DISC_MALL); - shouldNotStack.add(ItemID.DISC_MELLOHI); - shouldNotStack.add(ItemID.DISC_STAL); - shouldNotStack.add(ItemID.DISC_STRAD); - shouldNotStack.add(ItemID.DISC_WARD); - shouldNotStack.add(ItemID.DISC_11); - shouldNotStack.add(ItemID.DISC_WAIT); - } - - /** - * Returns true if an item should not be stacked. - * - * @param id the type ID of the item - * @return true if the item should not stack - */ - public static boolean shouldNotStack(int id) { - return shouldNotStack.contains(id); - } - - private static final Set usesDamageValue = new HashSet<>(); - static { - usesDamageValue.add(BlockID.DIRT); - usesDamageValue.add(BlockID.WOOD); - usesDamageValue.add(BlockID.SAPLING); - usesDamageValue.add(BlockID.SAND); - usesDamageValue.add(BlockID.LOG); - usesDamageValue.add(BlockID.LEAVES); - usesDamageValue.add(BlockID.SANDSTONE); - usesDamageValue.add(BlockID.LONG_GRASS); - usesDamageValue.add(BlockID.CLOTH); - usesDamageValue.add(BlockID.RED_FLOWER); - usesDamageValue.add(BlockID.DOUBLE_STEP); - usesDamageValue.add(BlockID.STEP); - usesDamageValue.add(BlockID.SILVERFISH_BLOCK); - usesDamageValue.add(BlockID.STONE_BRICK); - usesDamageValue.add(BlockID.BROWN_MUSHROOM_CAP); - usesDamageValue.add(BlockID.RED_MUSHROOM_CAP); - usesDamageValue.add(BlockID.DOUBLE_WOODEN_STEP); - usesDamageValue.add(BlockID.WOODEN_STEP); - usesDamageValue.add(BlockID.COBBLESTONE_WALL); - usesDamageValue.add(BlockID.ANVIL); - usesDamageValue.add(BlockID.QUARTZ_BLOCK); - usesDamageValue.add(BlockID.STAINED_CLAY); - usesDamageValue.add(BlockID.CARPET); - usesDamageValue.add(BlockID.CONCRETE); - usesDamageValue.add(BlockID.CONCRETE_POWDER); - - usesDamageValue.add(ItemID.COAL); - usesDamageValue.add(ItemID.INK_SACK); - usesDamageValue.add(ItemID.POTION); - usesDamageValue.add(ItemID.SPAWN_EGG); - usesDamageValue.add(ItemID.MAP); - usesDamageValue.add(ItemID.HEAD); - usesDamageValue.add(ItemID.GOLD_APPLE); - usesDamageValue.add(ItemID.RAW_FISH); - usesDamageValue.add(ItemID.COOKED_FISH); - usesDamageValue.add(ItemID.BED_ITEM); - usesDamageValue.add(ItemID.BANNER); - } - - /** - * Returns true if an item uses its damage value for something - * other than damage. - * - * @param id the type ID of the item - * @return true if the item uses its damage value - */ - public static boolean usesDamageValue(int id) { - return usesDamageValue.contains(id); - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java index f903a268b..f7443adf7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.blocks.type; +import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.BundledItemData; public class ItemType { @@ -37,6 +38,20 @@ public class ItemType { return this.id; } + /** + * Gets the name of this item, or the ID if the name cannot be found. + * + * @return The name, or ID + */ + public String getName() { + BundledItemData.ItemEntry entry = BundledItemData.getInstance().findById(this.id); + if (entry == null) { + return getId(); + } else { + return entry.localizedName; + } + } + /** * Gets the legacy ID. Needed for legacy reasons. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java index 1810a67e7..865bbd0d5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.blocks.type; import java.lang.reflect.Field; +import java.util.Collection; import java.util.HashMap; import java.util.Map; @@ -772,4 +773,8 @@ public class ItemTypes { } return itemMapping.get(id); } + + public static Collection values() { + return itemMapping.values(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index d0a5f6577..8f61f5593 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -46,6 +46,7 @@ import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.session.ClipboardHolder; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; @@ -84,7 +85,7 @@ public class BrushCommands { @Optional("2") double radius, @Switch('h') boolean hollow) throws WorldEditException { worldEdit.checkMaxBrushRadius(radius); - BrushTool tool = session.getBrushTool(player.getItemInHand()); + BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setFill(fill); tool.setSize(radius); @@ -114,7 +115,7 @@ public class BrushCommands { worldEdit.checkMaxBrushRadius(radius); worldEdit.checkMaxBrushRadius(height); - BrushTool tool = session.getBrushTool(player.getItemInHand()); + BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setFill(fill); tool.setSize(radius); @@ -149,7 +150,7 @@ public class BrushCommands { worldEdit.checkMaxBrushRadius(size.getBlockY()); worldEdit.checkMaxBrushRadius(size.getBlockZ()); - BrushTool tool = session.getBrushTool(player.getItemInHand()); + BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setBrush(new ClipboardBrush(holder, ignoreAir, usingOrigin), "worldedit.brush.clipboard"); player.print("Clipboard brush shape equipped."); @@ -173,7 +174,7 @@ public class BrushCommands { worldEdit.checkMaxBrushRadius(radius); - BrushTool tool = session.getBrushTool(player.getItemInHand()); + BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setSize(radius); tool.setBrush(new SmoothBrush(iterations, naturalBlocksOnly), "worldedit.brush.smooth"); @@ -192,7 +193,7 @@ public class BrushCommands { public void extinguishBrush(Player player, LocalSession session, EditSession editSession, @Optional("5") double radius) throws WorldEditException { worldEdit.checkMaxBrushRadius(radius); - BrushTool tool = session.getBrushTool(player.getItemInHand()); + BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); Pattern fill = new BlockPattern(new BaseBlock(BlockTypes.AIR)); tool.setFill(fill); tool.setSize(radius); @@ -218,7 +219,7 @@ public class BrushCommands { public void gravityBrush(Player player, LocalSession session, EditSession editSession, @Optional("5") double radius, @Switch('h') boolean fromMaxY) throws WorldEditException { worldEdit.checkMaxBrushRadius(radius); - BrushTool tool = session.getBrushTool(player.getItemInHand()); + BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setSize(radius); tool.setBrush(new GravityBrush(fromMaxY), "worldedit.brush.gravity"); @@ -265,7 +266,7 @@ public class BrushCommands { CreatureButcher flags = new CreatureButcher(player); flags.fromCommand(args); - BrushTool tool = session.getBrushTool(player.getItemInHand()); + BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setSize(radius); tool.setBrush(new ButcherBrush(flags), "worldedit.brush.butcher"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java index 4d8aa6f8f..7cc2bc6b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java @@ -19,11 +19,13 @@ package com.sk89q.worldedit.command; +import com.google.common.collect.Sets; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.ItemType; +import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.function.mask.Mask; @@ -161,64 +163,55 @@ public class GeneralCommands { boolean blocksOnly = args.hasFlag('b'); boolean itemsOnly = args.hasFlag('i'); - try { - int id = Integer.parseInt(query); + ItemType type = ItemTypes.getItemType(query); - ItemType type = ItemType.fromID(id); - - if (type != null) { - actor.print("#" + type.getID() + " (" + type.getName() + ")"); - } else { - actor.printError("No item found by ID " + id); - } - - return; - } catch (NumberFormatException ignored) { - } - - if (query.length() <= 2) { - actor.printError("Enter a longer search string (len > 2)."); - return; - } - - if (!blocksOnly && !itemsOnly) { - actor.print("Searching for: " + query); - } else if (blocksOnly && itemsOnly) { - actor.printError("You cannot use both the 'b' and 'i' flags simultaneously."); - return; - } else if (blocksOnly) { - actor.print("Searching for blocks: " + query); + if (type != null) { + actor.print(type.getId() + " (" + type.getName() + ")"); } else { - actor.print("Searching for items: " + query); - } - - int found = 0; - - for (ItemType type : ItemType.values()) { - if (found >= 15) { - actor.print("Too many results!"); - break; + if (query.length() <= 2) { + actor.printError("Enter a longer search string (len > 2)."); + return; } - if (blocksOnly && type.getID() > 255) { - continue; + if (!blocksOnly && !itemsOnly) { + actor.print("Searching for: " + query); + } else if (blocksOnly && itemsOnly) { + actor.printError("You cannot use both the 'b' and 'i' flags simultaneously."); + return; + } else if (blocksOnly) { + actor.print("Searching for blocks: " + query); + } else { + actor.print("Searching for items: " + query); } - if (itemsOnly && type.getID() <= 255) { - continue; - } + int found = 0; - for (String alias : type.getAliases()) { - if (alias.contains(query)) { - actor.print("#" + type.getID() + " (" + type.getName() + ")"); - ++found; + for (ItemType searchType : ItemTypes.values()) { + if (found >= 15) { + actor.print("Too many results!"); break; } - } - } - if (found == 0) { - actor.printError("No items found."); +// TODO if (blocksOnly && searchType.getID() > 255) { +// continue; +// } +// +// if (itemsOnly && searchType.getID() <= 255) { +// continue; +// } + + for (String alias : Sets.newHashSet(searchType.getId(), searchType.getName())) { + if (alias.contains(query)) { + actor.print(searchType.getId() + " (" + searchType.getName() + ")"); + ++found; + break; + } + } + } + + if (found == 0) { + actor.printError("No items found."); + } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index f5f60ca30..61eaaa9ec 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -34,6 +34,7 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits; @@ -276,7 +277,7 @@ public class SelectionCommands { @CommandPermissions("worldedit.wand") public void wand(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - player.giveItem(we.getConfiguration().wandItem, 1); + player.giveItem(ItemTypes.getItemType(we.getConfiguration().wandItem).getLegacyId(), 1); player.print("Left click: select pos #1; Right click: select pos #2"); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index ffd9f89ee..465e204c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -24,11 +24,12 @@ import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.ItemType; +import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.command.tool.*; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.TreeGenerator; public class ToolCommands { @@ -47,7 +48,7 @@ public class ToolCommands { ) public void none(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - session.setTool(player.getItemInHand(), null); + session.setTool(player.getItemInHand(HandSide.MAIN_HAND).getType(), null); player.print("Tool unbound from your current item."); } @@ -61,9 +62,10 @@ public class ToolCommands { @CommandPermissions("worldedit.tool.info") public void info(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - session.setTool(player.getItemInHand(), new QueryTool()); + BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); + session.setTool(itemStack.getType(), new QueryTool()); player.print("Info tool bound to " - + ItemType.toHeldName(player.getItemInHand()) + "."); + + itemStack.getType().getName() + "."); } @Command( @@ -76,8 +78,8 @@ public class ToolCommands { @CommandPermissions("worldedit.tool.tree") public void tree(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - TreeGenerator.TreeType type = args.argsLength() > 0 ? - type = TreeGenerator.lookup(args.getString(0)) + TreeGenerator.TreeType type = args.argsLength() > 0 + ? TreeGenerator.lookup(args.getString(0)) : TreeGenerator.TreeType.TREE; if (type == null) { @@ -85,9 +87,9 @@ public class ToolCommands { return; } - session.setTool(player.getItemInHand(), new TreePlanter(new TreeGenerator(type))); - player.print("Tree tool bound to " - + ItemType.toHeldName(player.getItemInHand()) + "."); + BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); + session.setTool(itemStack.getType(), new TreePlanter(new TreeGenerator(type))); + player.print("Tree tool bound to " + itemStack.getType().getName() + "."); } @Command( @@ -108,9 +110,9 @@ public class ToolCommands { context.setPreferringWildcard(false); BaseBlock targetBlock = we.getBlockFactory().parseFromInput(args.getString(0), context); - session.setTool(player.getItemInHand(), new BlockReplacer(targetBlock)); - player.print("Block replacer tool bound to " - + ItemType.toHeldName(player.getItemInHand()) + "."); + BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); + session.setTool(itemStack.getType(), new BlockReplacer(targetBlock)); + player.print("Block replacer tool bound to " + itemStack.getType().getName() + "."); } @Command( @@ -123,9 +125,9 @@ public class ToolCommands { @CommandPermissions("worldedit.tool.data-cycler") public void cycler(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - session.setTool(player.getItemInHand(), new BlockDataCyler()); - player.print("Block data cycler tool bound to " - + ItemType.toHeldName(player.getItemInHand()) + "."); + BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); + session.setTool(itemStack.getType(), new BlockDataCyler()); + player.print("Block data cycler tool bound to " + itemStack.getType().getName() + "."); } @Command( @@ -152,9 +154,9 @@ public class ToolCommands { context.setSession(session); Pattern pattern = we.getPatternFactory().parseFromInput(args.getString(0), context); - session.setTool(player.getItemInHand(), new FloodFillTool(range, pattern)); - player.print("Block flood fill tool bound to " - + ItemType.toHeldName(player.getItemInHand()) + "."); + BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); + session.setTool(itemStack.getType(), new FloodFillTool(range, pattern)); + player.print("Block flood fill tool bound to " + itemStack.getType().getName() + "."); } @Command( @@ -167,9 +169,10 @@ public class ToolCommands { @CommandPermissions("worldedit.tool.deltree") public void deltree(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - session.setTool(player.getItemInHand(), new FloatingTreeRemover()); - player.print("Floating tree remover tool bound to " - + ItemType.toHeldName(player.getItemInHand()) + "."); + BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); + session.setTool(itemStack.getType(), new FloatingTreeRemover()); + player.print("Floating tree remover tool bound to " + + itemStack.getType().getName() + "."); } @Command( @@ -182,8 +185,9 @@ public class ToolCommands { @CommandPermissions("worldedit.tool.farwand") public void farwand(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - session.setTool(player.getItemInHand(), new DistanceWand()); - player.print("Far wand tool bound to " + ItemType.toHeldName(player.getItemInHand()) + "."); + BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); + session.setTool(itemStack.getType(), new DistanceWand()); + player.print("Far wand tool bound to " + itemStack.getType().getName() + "."); } @Command( @@ -206,9 +210,11 @@ public class ToolCommands { BaseBlock secondary = we.getBlockFactory().parseFromInput(args.getString(0), context); BaseBlock primary = we.getBlockFactory().parseFromInput(args.getString(1), context); - session.setTool(player.getItemInHand(), new LongRangeBuildTool(primary, secondary)); - player.print("Long-range building tool bound to " + ItemType.toHeldName(player.getItemInHand()) + "."); - player.print("Left-click set to " + ItemType.toName(secondary.getType().getLegacyId()) + "; right-click set to " - + ItemType.toName(primary.getType().getLegacyId()) + "."); + BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); + + session.setTool(itemStack.getType(), new LongRangeBuildTool(primary, secondary)); + player.print("Long-range building tool bound to " + itemStack.getType().getName() + "."); + player.print("Left-click set to " + secondary.getType().getName() + "; right-click set to " + + primary.getType().getName() + "."); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java index f4f92675c..3302c9981 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java @@ -26,6 +26,7 @@ import com.sk89q.worldedit.*; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.command.parametric.Optional; /** @@ -78,10 +79,10 @@ public class ToolUtilCommands { @CommandPermissions("worldedit.brush.options.mask") public void mask(Player player, LocalSession session, EditSession editSession, @Optional Mask mask) throws WorldEditException { if (mask == null) { - session.getBrushTool(player.getItemInHand()).setMask(null); + session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setMask(null); player.print("Brush mask disabled."); } else { - session.getBrushTool(player.getItemInHand()).setMask(mask); + session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setMask(mask); player.print("Brush mask set."); } } @@ -95,7 +96,7 @@ public class ToolUtilCommands { ) @CommandPermissions("worldedit.brush.options.material") public void material(Player player, LocalSession session, EditSession editSession, Pattern pattern) throws WorldEditException { - session.getBrushTool(player.getItemInHand()).setFill(pattern); + session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setFill(pattern); player.print("Brush material set."); } @@ -109,7 +110,7 @@ public class ToolUtilCommands { @CommandPermissions("worldedit.brush.options.range") public void range(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { int range = args.getInteger(0); - session.getBrushTool(player.getItemInHand()).setRange(range); + session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setRange(range); player.print("Brush range set."); } @@ -126,7 +127,7 @@ public class ToolUtilCommands { int radius = args.getInteger(0); we.checkMaxBrushRadius(radius); - session.getBrushTool(player.getItemInHand()).setSize(radius); + session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setSize(radius); player.print("Brush size set."); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java index f2e1beb11..0bf486328 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java @@ -35,6 +35,7 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.function.Contextual; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.regions.factory.RegionFactory; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.CommandExecutor; import com.sk89q.worldedit.util.command.composition.SimpleCommand; @@ -71,7 +72,7 @@ public class ShapedBrushCommand extends SimpleCommand { try { WorldEdit.getInstance().checkMaxBrushRadius(radius); - BrushTool tool = session.getBrushTool(player.getItemInHand()); + BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setSize(radius); tool.setBrush(new OperationFactoryBrush(factory, regionFactory), permission); } catch (MaxBrushRadiusException | InvalidToolBindException e) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/InvalidToolBindException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/InvalidToolBindException.java index 5f192d320..c2ba68882 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/InvalidToolBindException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/InvalidToolBindException.java @@ -20,18 +20,19 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.blocks.type.ItemType; public class InvalidToolBindException extends WorldEditException { - private int itemId; + private ItemType item; - public InvalidToolBindException(int itemId, String msg) { + public InvalidToolBindException(ItemType item, String msg) { super(msg); - this.itemId = itemId; + this.item = item; } - public int getItemId() { - return itemId; + public ItemType getItemType() { + return this.item; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index d626b73f4..c84a3e985 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -23,8 +23,11 @@ import com.sk89q.worldedit.PlayerDirection; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.ItemType; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; @@ -56,18 +59,18 @@ public interface Player extends Entity, Actor { PlayerDirection getCardinalDirection(int yawOffset); /** - * Get the ID of the item that the player is holding. + * Get the item that the player is holding. * - * @return the item id of the item the player is holding + * @return the item the player is holding */ - int getItemInHand(); + BaseItemStack getItemInHand(HandSide handSide); /** * Get the Block that the player is holding. * * @return the item id of the item the player is holding */ - BaseBlock getBlockInHand() throws WorldEditException; + BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException; /** * Gives the player an item. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index cda4c0093..9878ec3b2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -29,6 +29,7 @@ import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.registry.InputParser; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; /** @@ -40,10 +41,10 @@ class DefaultBlockParser extends InputParser { super(worldEdit); } - private static BaseBlock getBlockInHand(Actor actor) throws InputParseException { + private static BaseBlock getBlockInHand(Actor actor, HandSide handSide) throws InputParseException { if (actor instanceof Player) { try { - return ((Player) actor).getBlockInHand(); + return ((Player) actor).getBlockInHand(handSide); } catch (NotABlockException e) { throw new InputParseException("You're not holding a block!"); } catch (WorldEditException e) { @@ -108,7 +109,17 @@ class DefaultBlockParser extends InputParser { if ("hand".equalsIgnoreCase(testId)) { // Get the block type from the item in the user's hand. - final BaseBlock blockInHand = getBlockInHand(context.requireActor()); + final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND); + if (blockInHand.getClass() != BaseBlock.class) { + return blockInHand; + } + + blockId = blockInHand.getId(); + blockType = BlockType.fromID(blockId); + data = blockInHand.getData(); + } else if ("offhand".equalsIgnoreCase(testId)) { + // Get the block type from the item in the user's off hand. + final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.OFF_HAND); if (blockInHand.getClass() != BaseBlock.class) { return blockInHand; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index e9ea78519..322c88e29 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -26,11 +26,13 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; -import com.sk89q.worldedit.blocks.ItemID; import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.internal.cui.CUIEvent; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TargetBlock; import com.sk89q.worldedit.util.auth.AuthorizationException; @@ -81,12 +83,12 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public boolean isHoldingPickAxe() { - int item = getItemInHand(); - return item == ItemID.IRON_PICK - || item == ItemID.WOOD_PICKAXE - || item == ItemID.STONE_PICKAXE - || item == ItemID.DIAMOND_PICKAXE - || item == ItemID.GOLD_PICKAXE; + ItemType item = getItemInHand(HandSide.MAIN_HAND).getType(); + return item == ItemTypes.IRON_PICKAXE + || item == ItemTypes.WOODEN_PICKAXE + || item == ItemTypes.STONE_PICKAXE + || item == ItemTypes.DIAMOND_PICKAXE + || item == ItemTypes.GOLDEN_PICKAXE; } @Override @@ -362,12 +364,12 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { } @Override - public BaseBlock getBlockInHand() throws WorldEditException { - final int typeId = getItemInHand(); - if (!getWorld().isValidBlockType(typeId)) { - throw new NotABlockException(typeId); + public BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException { + final ItemType typeId = getItemInHand(handSide).getType(); + if (!getWorld().isValidBlockType(typeId.getLegacyId())) { + throw new NotABlockException(typeId.getId()); } - return new BaseBlock(typeId); + return new BaseBlock(typeId.getLegacyId()); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index c4ba1c6d0..5a42e67c0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -41,6 +41,7 @@ import com.sk89q.worldedit.event.platform.PlayerInputEvent; import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits; import com.sk89q.worldedit.internal.ServerInterfaceAdapter; import com.sk89q.worldedit.regions.RegionSelector; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.eventbus.Subscribe; import com.sk89q.worldedit.world.World; @@ -318,7 +319,7 @@ public class PlatformManager { LocalSession session = worldEdit.getSessionManager().get(actor); if (event.getType() == Interaction.HIT) { - if (player.getItemInHand() == getConfiguration().wandItem) { + if (player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().wandItem)) { if (!session.isToolControlEnabled()) { return; } @@ -345,8 +346,8 @@ public class PlatformManager { } } - Tool tool = session.getTool(player.getItemInHand()); - if (tool != null && tool instanceof DoubleActionBlockTool) { + Tool tool = session.getTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); + if (tool instanceof DoubleActionBlockTool) { if (tool.canUse(player)) { ((DoubleActionBlockTool) tool).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location); event.setCancelled(true); @@ -354,7 +355,7 @@ public class PlatformManager { } } else if (event.getType() == Interaction.OPEN) { - if (player.getItemInHand() == getConfiguration().wandItem) { + if (player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().wandItem)) { if (!session.isToolControlEnabled()) { return; } @@ -372,8 +373,8 @@ public class PlatformManager { return; } - Tool tool = session.getTool(player.getItemInHand()); - if (tool != null && tool instanceof BlockTool) { + Tool tool = session.getTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); + if (tool instanceof BlockTool) { if (tool.canUse(player)) { ((BlockTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location); event.setCancelled(true); @@ -391,7 +392,7 @@ public class PlatformManager { switch (event.getInputType()) { case PRIMARY: { - if (player.getItemInHand() == getConfiguration().navigationWand) { + if (player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().navigationWand)) { if (getConfiguration().navigationWandMaxDistance <= 0) { return; } @@ -413,7 +414,7 @@ public class PlatformManager { LocalSession session = worldEdit.getSessionManager().get(player); - Tool tool = session.getTool(player.getItemInHand()); + Tool tool = session.getTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); if (tool instanceof DoubleActionTraceTool) { if (tool.canUse(player)) { ((DoubleActionTraceTool) tool).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session); @@ -426,7 +427,7 @@ public class PlatformManager { } case SECONDARY: { - if (player.getItemInHand() == getConfiguration().navigationWand) { + if (player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().navigationWand)) { if (getConfiguration().navigationWandMaxDistance <= 0) { return; } @@ -445,8 +446,8 @@ public class PlatformManager { LocalSession session = worldEdit.getSessionManager().get(player); - Tool tool = session.getTool(player.getItemInHand()); - if (tool != null && tool instanceof TraceTool) { + Tool tool = session.getTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); + if (tool instanceof TraceTool) { if (tool.canUse(player)) { ((TraceTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session); event.setCancelled(true); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 64278310d..1654fba9e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -20,11 +20,13 @@ package com.sk89q.worldedit.extension.platform; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; @@ -58,8 +60,8 @@ class PlayerProxy extends AbstractPlayerActor { } @Override - public int getItemInHand() { - return basePlayer.getItemInHand(); + public BaseItemStack getItemInHand(HandSide handSide) { + return basePlayer.getItemInHand(handSide); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java index 79df290c8..075d4236d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.extent.inventory; import com.sk89q.worldedit.blocks.*; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.util.Location; /** @@ -49,7 +50,7 @@ public abstract class BlockBag { public void storeDroppedBlock(int id, int data) throws BlockBagException { BaseItem dropped = BlockType.getBlockBagItem(id, data); if (dropped == null) return; - if (dropped.getType() == BlockID.AIR) return; + if (dropped.getType() == ItemTypes.AIR) return; storeItem(dropped); } @@ -107,7 +108,7 @@ public abstract class BlockBag { } catch (OutOfBlocksException e) { BaseItem placed = BlockType.getBlockBagItem(id, data); if (placed == null) throw e; // TODO: check - if (placed.getType() == BlockID.AIR) throw e; // TODO: check + if (placed.getType() == ItemTypes.AIR) throw e; // TODO: check fetchItem(placed); } @@ -134,7 +135,7 @@ public abstract class BlockBag { * @throws BlockBagException on error */ public void fetchItem(BaseItem item) throws BlockBagException { - fetchBlock(item.getType()); + fetchBlock(item.getLegacyId()); } /** @@ -158,7 +159,7 @@ public abstract class BlockBag { * @throws BlockBagException on error */ public void storeItem(BaseItem item) throws BlockBagException { - storeBlock(item.getType()); + storeBlock(item.getLegacyId()); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditExceptionConverter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditExceptionConverter.java index 8cd7aa2f6..10294c0a2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditExceptionConverter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditExceptionConverter.java @@ -19,9 +19,20 @@ package com.sk89q.worldedit.internal.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.ItemType; +import com.sk89q.worldedit.DisallowedItemException; +import com.sk89q.worldedit.EmptyClipboardException; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.InvalidItemException; +import com.sk89q.worldedit.MaxBrushRadiusException; +import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.MaxRadiusException; +import com.sk89q.worldedit.UnknownDirectionException; +import com.sk89q.worldedit.UnknownItemException; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.command.InsufficientArgumentsException; import com.sk89q.worldedit.command.tool.InvalidToolBindException; import com.sk89q.worldedit.internal.expression.ExpressionException; @@ -35,8 +46,6 @@ import com.sk89q.worldedit.util.io.file.InvalidFilenameException; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; - /** * converts WorldEdit exceptions and converts them into {@link CommandException}s. */ @@ -138,8 +147,7 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper { @ExceptionMatch public void convert(InvalidToolBindException e) throws CommandException { - throw new CommandException("Can't bind tool to " - + ItemType.toHeldName(e.getItemId()) + ": " + e.getMessage()); + throw new CommandException("Can't bind tool to " + e.getItemType().getName() + ": " + e.getMessage()); } @ExceptionMatch diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/HandSide.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/HandSide.java new file mode 100644 index 000000000..b74b31908 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/HandSide.java @@ -0,0 +1,25 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.util; + +public enum HandSide { + MAIN_HAND, + OFF_HAND +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java index 703910959..3bff3352d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java @@ -33,6 +33,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.Arrays; import java.util.HashSet; import java.util.Properties; import java.util.Set; @@ -73,7 +74,7 @@ public class PropertiesConfiguration extends LocalConfiguration { loadExtra(); profile = getBool("profile", profile); - disallowedBlocks = getIntSet("disallowed-blocks", defaultDisallowedBlocks); + disallowedBlocks = getStringSet("disallowed-blocks", defaultDisallowedBlocks); defaultChangeLimit = getInt("default-max-changed-blocks", defaultChangeLimit); maxChangeLimit = getInt("max-changed-blocks", maxChangeLimit); defaultMaxPolygonalPoints = getInt("default-max-polygon-points", defaultMaxPolygonalPoints); @@ -88,14 +89,14 @@ public class PropertiesConfiguration extends LocalConfiguration { logFile = getString("log-file", logFile); logFormat = getString("log-format", logFormat); registerHelp = getBool("register-help", registerHelp); - wandItem = getInt("wand-item", wandItem); + wandItem = getString("wand-item", wandItem); superPickaxeDrop = getBool("super-pickaxe-drop-items", superPickaxeDrop); superPickaxeManyDrop = getBool("super-pickaxe-many-drop-items", superPickaxeManyDrop); noDoubleSlash = getBool("no-double-slash", noDoubleSlash); useInventory = getBool("use-inventory", useInventory); useInventoryOverride = getBool("use-inventory-override", useInventoryOverride); useInventoryCreativeOverride = getBool("use-inventory-creative-override", useInventoryCreativeOverride); - navigationWand = getInt("nav-wand-item", navigationWand); + navigationWand = getString("nav-wand-item", navigationWand); navigationWandMaxDistance = getInt("nav-wand-distance", navigationWandMaxDistance); navigationUseGlass = getBool("nav-use-glass", navigationUseGlass); scriptTimeout = getInt("scripting-timeout", scriptTimeout); @@ -238,4 +239,30 @@ public class PropertiesConfiguration extends LocalConfiguration { } } + /** + * Get a String set. + * + * @param key the key + * @param def the default value + * @return the value + */ + protected Set getStringSet(String key, String[] def) { + String val = properties.getProperty(key); + if (val == null) { + properties.setProperty(key, StringUtil.joinString(def, ",", 0)); + return new HashSet<>(Arrays.asList(def)); + } else { + Set set = new HashSet<>(); + String[] parts = val.split(","); + for (String part : parts) { + try { + String v = part.trim(); + set.add(v); + } catch (NumberFormatException ignored) { + } + } + return set; + } + } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index 909dfe4f1..342936824 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.util; +import com.google.common.collect.Lists; import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -53,7 +54,7 @@ public class YAMLConfiguration extends LocalConfiguration { } profile = config.getBoolean("debug", profile); - wandItem = config.getInt("wand-item", wandItem); + wandItem = config.getString("wand-item", wandItem); defaultChangeLimit = Math.max(-1, config.getInt( "limits.max-blocks-changed.default", defaultChangeLimit)); @@ -76,7 +77,7 @@ public class YAMLConfiguration extends LocalConfiguration { butcherDefaultRadius = Math.max(-1, config.getInt("limits.butcher-radius.default", butcherDefaultRadius)); butcherMaxRadius = Math.max(-1, config.getInt("limits.butcher-radius.maximum", butcherMaxRadius)); - disallowedBlocks = new HashSet<>(config.getIntList("limits.disallowed-blocks", null)); + disallowedBlocks = new HashSet<>(config.getStringList("limits.disallowed-blocks", Lists.newArrayList(defaultDisallowedBlocks))); allowedDataCycleBlocks = new HashSet<>(config.getIntList("limits.allowed-data-cycle-blocks", null)); registerHelp = config.getBoolean("register-help", true); @@ -97,7 +98,7 @@ public class YAMLConfiguration extends LocalConfiguration { useInventoryCreativeOverride = config.getBoolean("use-inventory.creative-mode-overrides", useInventoryCreativeOverride); - navigationWand = config.getInt("navigation-wand.item", navigationWand); + navigationWand = config.getString("navigation-wand.item", navigationWand); navigationWandMaxDistance = config.getInt("navigation-wand.max-distance", navigationWandMaxDistance); navigationUseGlass = config.getBoolean("navigation.use-glass", navigationUseGlass); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java index 4b2e4f434..2a5fc607a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java @@ -97,8 +97,7 @@ public class BundledItemData { * @param id the ID * @return the entry, or null */ - @Nullable - private ItemEntry findById(String id) { + @Nullable public ItemEntry findById(String id) { // If it has no namespace, assume minecraft. if (!id.contains(":")) { id = "minecraft:" + id; @@ -158,12 +157,12 @@ public class BundledItemData { return INSTANCE; } - private static class ItemEntry { + public static class ItemEntry { private int legacyId; // -1 for items without legacy IDs. private short legacyData; private String id; private String unlocalizedName; - private String localizedName; + public String localizedName; private int maxDamage; private int maxStackSize; } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index eaa034d28..96fc95fbf 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -21,11 +21,14 @@ package com.sk89q.worldedit.forge; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import io.netty.buffer.Unpooled; import net.minecraft.entity.player.EntityPlayerMP; @@ -36,6 +39,7 @@ import net.minecraft.network.play.server.SPacketCustomPayload; import net.minecraft.util.EnumHand; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.common.registry.ForgeRegistries; import java.util.UUID; @@ -56,9 +60,9 @@ public class ForgePlayer extends AbstractPlayerActor { } @Override - public int getItemInHand() { - ItemStack is = this.player.getHeldItem(EnumHand.MAIN_HAND); - return Item.getIdFromItem(is.getItem()); + public BaseItemStack getItemInHand(HandSide handSide) { + ItemStack is = this.player.getHeldItem(handSide == HandSide.MAIN_HAND ? EnumHand.MAIN_HAND : EnumHand.OFF_HAND); + return new BaseItemStack(ItemTypes.getItemType(ForgeRegistries.ITEMS.getKey(is.getItem()).toString())); } @Override diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 64d7fd37c..d2ceafd44 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -31,6 +31,7 @@ import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.internal.Constants; @@ -226,7 +227,7 @@ public class ForgeWorld extends AbstractWorld { checkNotNull(biome); Chunk chunk = getWorld().getChunkFromBlockCoords(new BlockPos(position.getBlockX(), 0, position.getBlockZ())); - if ((chunk != null) && (chunk.isLoaded())) { + if (chunk.isLoaded()) { chunk.getBiomeArray()[((position.getBlockZ() & 0xF) << 4 | position.getBlockX() & 0xF)] = (byte) biome.getId(); return true; } @@ -236,7 +237,7 @@ public class ForgeWorld extends AbstractWorld { @Override public boolean useItem(Vector position, BaseItem item, Direction face) { - Item nativeItem = Item.getItemById(item.getType()); + Item nativeItem = Item.getByNameOrId(item.getType().getId()); ItemStack stack = new ItemStack(nativeItem, 1, item.getData()); World world = getWorld(); EnumActionResult used = stack.onItemUse(new WorldEditFakePlayer((WorldServer) world), world, ForgeAdapter.toBlockPos(position), @@ -249,7 +250,7 @@ public class ForgeWorld extends AbstractWorld { checkNotNull(position); checkNotNull(item); - if (item.getType() == 0) { + if (item.getType() == ItemTypes.AIR) { return; } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index 16ce2ca3b..657032c5b 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -214,7 +214,7 @@ public class ForgeWorldEdit { } public static ItemStack toForgeItemStack(BaseItemStack item) { - ItemStack ret = new ItemStack(Item.getItemById(item.getType()), item.getAmount(), item.getData()); + ItemStack ret = new ItemStack(Item.getByNameOrId(item.getType().getId()), item.getAmount(), item.getData()); for (Map.Entry entry : item.getEnchantments().entrySet()) { ret.addEnchantment(net.minecraft.enchantment.Enchantment.getEnchantmentByID(entry.getKey()), entry.getValue()); } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index 5024d56c0..07e15825d 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -22,11 +22,14 @@ package com.sk89q.worldedit.sponge; import com.flowpowered.math.vector.Vector3d; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; +import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import org.spongepowered.api.data.type.HandTypes; import org.spongepowered.api.entity.living.player.Player; @@ -58,9 +61,10 @@ public class SpongePlayer extends AbstractPlayerActor { } @Override - public int getItemInHand() { - Optional is = this.player.getItemInHand(HandTypes.MAIN_HAND); - return is.map(itemStack -> SpongeWorldEdit.inst().getAdapter().resolve(itemStack.getItem())).orElse(0); + public BaseItemStack getItemInHand(HandSide handSide) { + Optional is = this.player.getItemInHand(handSide == HandSide.MAIN_HAND + ? HandTypes.MAIN_HAND : HandTypes.OFF_HAND); + return is.map(itemStack -> new BaseItemStack(ItemTypes.getItemType(itemStack.getType().getId()))).orElse(null); } @Override diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index b0a2405a9..3ad40ae59 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.regions.Region; @@ -183,7 +184,7 @@ public abstract class SpongeWorld extends AbstractWorld { checkNotNull(position); checkNotNull(item); - if (item.getType() == 0) { + if (item.getType() == ItemTypes.AIR) { return; } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java index 5f6eb194d..f0279d8a1 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java @@ -57,7 +57,7 @@ public class ConfigurateConfiguration extends LocalConfiguration { } profile = node.getNode("debug").getBoolean(profile); - wandItem = node.getNode("wand-item").getInt(wandItem); + wandItem = node.getNode("wand-item").getString(wandItem); defaultChangeLimit = Math.max(-1, node.getNode("limits", "max-blocks-changed", "default").getInt(defaultChangeLimit)); maxChangeLimit = Math.max(-1, node.getNode("limits", "max-blocks-changed", "maximum").getInt(maxChangeLimit)); @@ -73,7 +73,7 @@ public class ConfigurateConfiguration extends LocalConfiguration { butcherMaxRadius = Math.max(-1, node.getNode("limits", "butcher-radius", "maximum").getInt(butcherMaxRadius)); try { - disallowedBlocks = new HashSet<>(node.getNode("limits", "disallowed-blocks").getList(TypeToken.of(Integer.class))); + disallowedBlocks = new HashSet<>(node.getNode("limits", "disallowed-blocks").getList(TypeToken.of(String.class))); } catch (ObjectMappingException e) { logger.warn("Error loading WorldEdit configuration", e); } @@ -97,7 +97,7 @@ public class ConfigurateConfiguration extends LocalConfiguration { useInventoryOverride = node.getNode("use-inventory", "allow-override").getBoolean(useInventoryOverride); useInventoryCreativeOverride = node.getNode("use-inventory", "creative-mode-overrides").getBoolean(useInventoryCreativeOverride); - navigationWand = node.getNode("navigation-wand", "item").getInt(navigationWand); + navigationWand = node.getNode("navigation-wand", "item").getString(navigationWand); navigationWandMaxDistance = node.getNode("navigation-wand", "max-distance").getInt(navigationWandMaxDistance); navigationUseGlass = node.getNode("navigation", "use-glass").getBoolean(navigationUseGlass); From 5f5a1797ad18390c0a2dcf182891c5032014cff8 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 17 Jun 2018 22:04:35 +1000 Subject: [PATCH 16/74] Remove legacy ServerInterface --- .../sk89q/worldedit/bukkit/BukkitWorld.java | 1 - .../com/sk89q/worldedit/blocks/LazyBlock.java | 16 --- .../com/sk89q/worldedit/ServerInterface.java | 33 ----- .../java/com/sk89q/worldedit/WorldEdit.java | 13 +- .../worldedit/command/WorldEditCommands.java | 2 +- .../extension/factory/DefaultBlockParser.java | 7 +- .../extension/platform/PlatformManager.java | 12 -- .../internal/ServerInterfaceAdapter.java | 135 ------------------ .../worldedit/sponge/SpongeWorldEdit.java | 6 + 9 files changed, 14 insertions(+), 211 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/ServerInterface.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/internal/ServerInterfaceAdapter.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 903a54d10..5454cb799 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -79,7 +79,6 @@ public class BukkitWorld extends AbstractWorld { * * @param world the world */ - @SuppressWarnings("unchecked") public BukkitWorld(World world) { this.worldRef = new WeakReference<>(world); } diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java index 6e3a7e9b4..e70bd31ab 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java @@ -62,22 +62,6 @@ public class LazyBlock extends BaseBlock { this.position = position; } - /** - * Create a new lazy block. - * - * @param type the block type - * @param extent the extent to later load the full block data from - * @param position the position to later load the full block data from - */ - @Deprecated - public LazyBlock(int type, Extent extent, Vector position) { - super(type); - checkNotNull(extent); - checkNotNull(position); - this.extent = extent; - this.position = position; - } - /** * Create a new lazy block. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/ServerInterface.java b/worldedit-core/src/main/java/com/sk89q/worldedit/ServerInterface.java deleted file mode 100644 index 8012fce15..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/ServerInterface.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -import com.sk89q.worldedit.extension.platform.AbstractPlatform; -import com.sk89q.worldedit.extension.platform.Platform; - -/** - * A legacy abstract class that is to be replaced with {@link Platform}. - * Extend {@link AbstractPlatform} instead. - * - * @deprecated Use {@link Platform} wherever possible - */ -@Deprecated -public abstract class ServerInterface extends AbstractPlatform { -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 52124861a..761f4fb60 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -35,6 +35,7 @@ import com.sk89q.worldedit.extension.factory.ItemFactory; import com.sk89q.worldedit.extension.factory.MaskFactory; import com.sk89q.worldedit.extension.factory.PatternFactory; import com.sk89q.worldedit.extension.platform.Actor; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.PlatformManager; import com.sk89q.worldedit.extent.inventory.BlockBag; @@ -601,7 +602,8 @@ public class WorldEdit { } LocalSession session = getSessionManager().get(player); - CraftScriptContext scriptContext = new CraftScriptContext(this, getServer(), getConfiguration(), session, player, args); + CraftScriptContext scriptContext = new CraftScriptContext(this, getPlatformManager().queryCapability(Capability.USER_COMMANDS), + getConfiguration(), session, player, args); CraftScriptEngine engine; @@ -649,15 +651,6 @@ public class WorldEdit { return getPlatformManager().getConfiguration(); } - /** - * Get the server interface. - * - * @return the server interface - */ - public ServerInterface getServer() { - return getPlatformManager().getServerInterface(); - } - /** * Get a factory for {@link EditSession}s. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java index 1c40eb8f6..6cfa41059 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java @@ -78,7 +78,7 @@ public class WorldEditCommands { ) @CommandPermissions("worldedit.reload") public void reload(Actor actor) throws WorldEditException { - we.getServer().reload(); + we.getPlatformManager().queryCapability(Capability.CONFIGURATION).reload(); we.getEventBus().post(new ConfigurationLoadEvent(we.getPlatformManager().queryCapability(Capability.CONFIGURATION).getConfiguration())); actor.print("Configuration reloaded!"); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 9878ec3b2..2147d05e0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -28,6 +28,7 @@ import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.internal.registry.InputParser; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; @@ -153,12 +154,12 @@ class DefaultBlockParser extends InputParser { } catch (NumberFormatException e) { blockType = BlockType.lookup(testId); if (blockType == null) { - int t = worldEdit.getServer().resolveItem(testId); + int t = worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).resolveItem(testId); if (t >= 0) { blockType = BlockType.fromID(t); // Could be null blockId = t; } else if (blockLocator.length == 2) { // Block IDs in MC 1.7 and above use mod:name - t = worldEdit.getServer().resolveItem(blockAndExtraData[0]); + t = worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).resolveItem(blockAndExtraData[0]); if (t >= 0) { blockType = BlockType.fromID(t); // Could be null blockId = t; @@ -306,7 +307,7 @@ class DefaultBlockParser extends InputParser { break; } } - if (!worldEdit.getServer().isValidMobType(mobName)) { + if (!worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).isValidMobType(mobName)) { throw new NoMatchException("Unknown mob type '" + mobName + "'"); } return new MobSpawnerBlock(data, mobName); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index 5a42e67c0..356ad5c58 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -23,7 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.ServerInterface; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.command.tool.BlockTool; @@ -39,7 +38,6 @@ import com.sk89q.worldedit.event.platform.PlatformInitializeEvent; import com.sk89q.worldedit.event.platform.PlatformReadyEvent; import com.sk89q.worldedit.event.platform.PlayerInputEvent; import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits; -import com.sk89q.worldedit.internal.ServerInterfaceAdapter; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; @@ -286,16 +284,6 @@ public class PlatformManager { return queryCapability(Capability.CONFIGURATION).getConfiguration(); } - /** - * Return a legacy {@link ServerInterface}. - * - * @return a {@link ServerInterface} - * @throws IllegalStateException if no platform has been registered - */ - public ServerInterface getServerInterface() throws IllegalStateException { - return ServerInterfaceAdapter.adapt(queryCapability(Capability.USER_COMMANDS)); - } - @Subscribe public void handlePlatformReady(PlatformReadyEvent event) { choosePreferred(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/ServerInterfaceAdapter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/ServerInterfaceAdapter.java deleted file mode 100644 index 32d0922cc..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/ServerInterfaceAdapter.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.internal; - -import com.sk89q.worldedit.LocalConfiguration; -import com.sk89q.worldedit.ServerInterface; -import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.extension.platform.Capability; -import com.sk89q.worldedit.extension.platform.Platform; -import com.sk89q.worldedit.extension.platform.Preference; -import com.sk89q.worldedit.util.command.Dispatcher; -import com.sk89q.worldedit.world.World; - -import javax.annotation.Nullable; -import java.util.List; -import java.util.Map; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Adapts {@link Platform}s into the legacy {@link ServerInterface}. - */ -public class ServerInterfaceAdapter extends ServerInterface { - - private final Platform platform; - - /** - * Create a new adapter. - * - * @param platform the platform - */ - private ServerInterfaceAdapter(Platform platform) { - checkNotNull(platform); - this.platform = platform; - } - - @Override - public int resolveItem(String name) { - return platform.resolveItem(name); - } - - @Override - public boolean isValidMobType(String type) { - return platform.isValidMobType(type); - } - - @Override - public void reload() { - platform.reload(); - } - - @Override - public int schedule(long delay, long period, Runnable task) { - return platform.schedule(delay, period, task); - } - - @Override - public List getWorlds() { - return platform.getWorlds(); - } - - @Nullable - @Override - public Player matchPlayer(Player player) { - return platform.matchPlayer(player); - } - - @Nullable - @Override - public World matchWorld(World world) { - return platform.matchWorld(world); - } - - @Override - public void registerCommands(Dispatcher dispatcher) { - platform.registerCommands(dispatcher); - } - - @Override - public void registerGameHooks() { - } - - @Override - public LocalConfiguration getConfiguration() { - return platform.getConfiguration(); - } - - @Override - public String getVersion() { - return platform.getVersion(); - } - - @Override - public String getPlatformName() { - return platform.getPlatformName(); - } - - @Override - public String getPlatformVersion() { - return platform.getPlatformVersion(); - } - - @Override - public Map getCapabilities() { - return platform.getCapabilities(); - } - - /** - * Adapt an {@link Platform} instance into a {@link ServerInterface}. - * - * @param platform the platform - * @return the server interface - */ - public static ServerInterface adapt(Platform platform) { - return new ServerInterfaceAdapter(platform); - } - -} diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java index ae835075d..e5cb50c3d 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java @@ -50,6 +50,7 @@ import org.spongepowered.api.event.game.state.GamePostInitializationEvent; import org.spongepowered.api.event.game.state.GamePreInitializationEvent; import org.spongepowered.api.event.game.state.GameStartedServerEvent; import org.spongepowered.api.event.game.state.GameStoppingServerEvent; +import org.spongepowered.api.item.ItemType; import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.plugin.Plugin; import org.spongepowered.api.plugin.PluginContainer; @@ -132,9 +133,14 @@ public class SpongeWorldEdit { this.provider = new SpongePermissionsProvider(); for (BlockType blockType : Sponge.getRegistry().getAllOf(BlockType.class)) { + // TODO Handle blockstate stuff com.sk89q.worldedit.blocks.type.BlockTypes.registerBlock(new com.sk89q.worldedit.blocks.type.BlockType(blockType.getId())); } + for (ItemType itemType : Sponge.getRegistry().getAllOf(ItemType.class)) { + com.sk89q.worldedit.blocks.type.ItemTypes.registerItem(new com.sk89q.worldedit.blocks.type.ItemType(itemType.getId())); + } + WorldEdit.getInstance().getPlatformManager().register(platform); } From 811f1d4433301d16994e9d41fc7ac0ee24052dcb Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 17 Jun 2018 23:13:22 +1000 Subject: [PATCH 17/74] Rewrote block parsing, and further switch to BlockState --- .../sk89q/worldedit/bukkit/BukkitUtil.java | 4 - .../worldedit/blocks/MobSpawnerBlock.java | 32 +- .../com/sk89q/worldedit/blocks/SignBlock.java | 19 +- .../sk89q/worldedit/blocks/SkullBlock.java | 98 +---- .../com/sk89q/worldedit/blocks/BaseBlock.java | 6 + .../worldedit/blocks/type/BlockState.java | 61 +++- .../extension/factory/DefaultBlockParser.java | 334 ++++++------------ .../extension/factory/DefaultItemParser.java | 2 +- .../worldedit/extent/inventory/BlockBag.java | 24 -- .../java/com/sk89q/worldedit/world/World.java | 1 + .../world/registry/BundledBlockData.java | 2 +- .../world/registry/state/SimpleState.java | 9 + .../worldedit/world/registry/state/State.java | 10 + 13 files changed, 198 insertions(+), 404 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index eb50b50ca..07d5f81d7 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -28,7 +28,6 @@ import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.ItemID; -import com.sk89q.worldedit.blocks.SkullBlock; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; import org.bukkit.DyeColor; @@ -136,9 +135,6 @@ public final class BukkitUtil { } break; - case ItemID.HEAD: - return new SkullBlock(0, (byte) itemStack.getDurability()); - default: final BaseBlock baseBlock = BlockType.getBlockForItem(typeId, itemStack.getDurability()); if (baseBlock != null) { diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java index a876a1c1f..4fc2070d0 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java @@ -25,7 +25,7 @@ import com.sk89q.jnbt.NBTUtils; import com.sk89q.jnbt.ShortTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.metadata.MobType; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.world.storage.InvalidFormatException; import java.util.HashMap; @@ -49,41 +49,23 @@ public class MobSpawnerBlock extends BaseBlock implements TileEntityBlock { private short maxNearbyEntities; private short requiredPlayerRange; - /** - * Construct the mob spawner block with a pig as the mob type. - */ - public MobSpawnerBlock() { - super(BlockID.MOB_SPAWNER); - this.mobType = MobType.PIG.getName(); - } - - /** - * Construct the mob spawner block with a given mob type. - * - * @param mobType mob type - */ - public MobSpawnerBlock(String mobType) { - super(BlockID.MOB_SPAWNER); - this.mobType = mobType; - } - /** * Construct the mob spawner block with a specified data value. * - * @param data data value + * @param blockState The block state */ - public MobSpawnerBlock(int data) { - super(BlockID.MOB_SPAWNER, data); + public MobSpawnerBlock(BlockState blockState) { + super(blockState); } /** * Construct the mob spawner block. * - * @param data data value + * @param blockState The block state * @param mobType mob type */ - public MobSpawnerBlock(int data, String mobType) { - super(BlockID.MOB_SPAWNER, data); + public MobSpawnerBlock(BlockState blockState, String mobType) { + super(blockState); this.mobType = mobType; } diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java index 78f78419e..8d71a662f 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.util.gson.GsonUtil; import java.util.HashMap; @@ -36,26 +37,14 @@ public class SignBlock extends BaseBlock implements TileEntityBlock { private static String EMPTY = "{\"text\":\"\"}"; - /** - * Construct the sign without text. - * - * @param type type ID - * @param data data value (orientation) - */ - public SignBlock(int type, int data) { - super(type, data); - this.text = new String[] { EMPTY, EMPTY, EMPTY, EMPTY }; - } - /** * Construct the sign with text. * - * @param type type ID - * @param data data value (orientation) + * @param blockState The block state * @param text lines of text */ - public SignBlock(int type, int data, String[] text) { - super(type, data); + public SignBlock(BlockState blockState, String[] text) { + super(blockState); if (text == null) { this.text = new String[] { EMPTY, EMPTY, EMPTY, EMPTY }; return; diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java index 6f7024c28..fb651f9ab 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.blocks; -import com.sk89q.jnbt.ByteTag; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.blocks.type.BlockState; import java.util.HashMap; import java.util.Map; @@ -33,60 +33,25 @@ import java.util.Map; public class SkullBlock extends BaseBlock implements TileEntityBlock { private String owner = ""; // notchian - private byte skullType; // stored here for block, in damage value for item - private byte rot; // only matters if block data == 0x1 (on floor) /** * Construct the skull block with a default type of skelton. - * @param data data value to set, controls placement + * @param state BlockState to set */ - public SkullBlock(int data) { - this(data, (byte) 0); - } - - /** - * Construct the skull block with a given type. - * 0 - skeleton - * 1 - wither skelly - * 2 - zombie - * 3 - human - * 4 - creeper - * @param data data value to set, controls placement - * @param type type of skull - */ - public SkullBlock(int data, byte type) { - this(data, type, (byte) 0); - } - - /** - * Construct the skull block with a given type and rotation. - * @param data data value to set, controls placement - * @param type type of skull - * @param rot rotation (if on floor) - */ - public SkullBlock(int data, byte type, byte rot) { - super(BlockID.HEAD, data); - if (type < (byte) 0 || type > (byte) 4) { - this.skullType = (byte) 0; - } else { - this.skullType = type; - } - this.rot = rot; + public SkullBlock(BlockState state) { + super(state); this.owner = ""; } /** * Construct the skull block with a given rotation and owner. * The type is assumed to be player unless owner is null or empty. - * @param data data value to set, controls placement - * @param rot rotation of skull + * @param blockState BlockState to set * @param owner name of player */ - public SkullBlock(int data, byte rot, String owner) { - super(BlockID.HEAD, data); - this.rot = rot; + public SkullBlock(BlockState blockState, String owner) { + super(blockState); this.setOwner(owner); - if (owner == null || owner.isEmpty()) this.skullType = (byte) 0; } /** @@ -100,7 +65,6 @@ public class SkullBlock extends BaseBlock implements TileEntityBlock { if (owner.length() > 16 || owner.isEmpty()) this.owner = ""; else this.owner = owner; } - if (!this.owner.isEmpty()) this.skullType = (byte) 3; } /** @@ -111,38 +75,6 @@ public class SkullBlock extends BaseBlock implements TileEntityBlock { return owner; } - /** - * Get the type of skull. - * @return the skullType - */ - public byte getSkullType() { - return skullType; - } - - /** - * Set the type of skull; - * @param skullType the skullType to set - */ - public void setSkullType(byte skullType) { - this.skullType = skullType; - } - - /** - * Get rotation of skull. This only means anything if the block data is 1. - * @return the rotation - */ - public byte getRot() { - return rot; - } - - /** - * Set the rotation of skull. - * @param rot the rotation to set - */ - public void setRot(byte rot) { - this.rot = rot; - } - @Override public boolean hasNbtData() { return true; @@ -155,11 +87,9 @@ public class SkullBlock extends BaseBlock implements TileEntityBlock { @Override public CompoundTag getNbtData() { - Map values = new HashMap(); - values.put("SkullType", new ByteTag(skullType)); + Map values = new HashMap<>(); if (owner == null) owner = ""; - values.put("ExtraType", new StringTag( owner)); - values.put("Rot", new ByteTag(rot)); + values.put("ExtraType", new StringTag(owner)); return new CompoundTag(values); } @@ -178,17 +108,9 @@ public class SkullBlock extends BaseBlock implements TileEntityBlock { throw new RuntimeException("'Skull' tile entity expected"); } - t = values.get("SkullType"); - if (t instanceof ByteTag) { - skullType = ((ByteTag) t).getValue(); - } t = values.get("ExtraType"); - if (t != null && t instanceof StringTag) { + if (t instanceof StringTag) { owner = ((StringTag) t).getValue(); } - t = values.get("Rot"); - if (t instanceof ByteTag) { - rot = ((ByteTag) t).getValue(); - } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 2846de359..5c1644280 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -23,6 +23,7 @@ import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.CuboidClipboard.FlipDirection; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.mask.Mask; @@ -76,6 +77,11 @@ public class BaseBlock implements TileEntityBlock { this.states = new HashMap<>(); } + public BaseBlock(BlockState blockState) { + this.blockType = blockState.getBlockType(); + this.states = blockState.getStates(); + } + /** * Construct a block with the given type and default data. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java index 306f15d27..420dc9a99 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java @@ -24,36 +24,52 @@ import com.google.common.collect.HashBasedTable; import com.google.common.collect.Maps; import com.google.common.collect.Table; import com.sk89q.worldedit.world.registry.state.State; -import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue; +import com.sk89q.worldedit.world.registry.state.value.StateValue; +import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * An immutable class that represents the state a block can be in. */ +@SuppressWarnings("unchecked") public class BlockState { private final BlockType blockType; - private final Map, SimpleStateValue> values; + private final Map values; + private final boolean fuzzy; // Neighbouring state table. - private Table, SimpleStateValue, BlockState> states; + private Table states; BlockState(BlockType blockType) { this.blockType = blockType; this.values = new HashMap<>(); + this.fuzzy = false; } - public void populate(Map, SimpleStateValue>, BlockState> stateMap) { - final Table, SimpleStateValue, BlockState> states = HashBasedTable.create(); + /** + * Creates a fuzzy BlockState. This can be used for partial matching. + * + * @param blockType The block type + * @param values The block state values + */ + public BlockState(BlockType blockType, Map values) { + this.blockType = blockType; + this.values = values; + this.fuzzy = true; + } - for(final Map.Entry, SimpleStateValue> entry : this.values.entrySet()) { - final State state = entry.getKey(); + public void populate(Map, BlockState> stateMap) { + final Table states = HashBasedTable.create(); - state.getValues().forEach(value -> { + for(final Map.Entry entry : this.values.entrySet()) { + final State state = entry.getKey(); + + state.getValues().stream().forEach(value -> { if(value != entry.getValue()) { - states.put(state, value, stateMap.get(this.withValue(state, value))); + states.put(state, (StateValue) value, stateMap.get(this.withValue(state, (StateValue) value))); } }); } @@ -61,8 +77,8 @@ public class BlockState { this.states = states.isEmpty() ? states : ArrayTable.create(states); } - private Map, SimpleStateValue> withValue(final State property, final SimpleStateValue value) { - final Map, SimpleStateValue> values = Maps.newHashMap(this.values); + private Map withValue(final State property, final StateValue value) { + final Map values = Maps.newHashMap(this.values); values.put(property, value); return values; } @@ -83,9 +99,13 @@ public class BlockState { * @param value The value * @return The modified state, or same if could not be applied */ - public BlockState with(State state, SimpleStateValue value) { - BlockState result = states.get(state, value); - return result == null ? this : result; + public BlockState with(State state, StateValue value) { + if (fuzzy) { + return setState(state, value); + } else { + BlockState result = states.get(state, value); + return result == null ? this : result; + } } /** @@ -94,10 +114,19 @@ public class BlockState { * @param state The state * @return The value */ - public SimpleStateValue getState(State state) { + public StateValue getState(State state) { return this.values.get(state); } + /** + * Gets an immutable collection of the states. + * + * @return The states + */ + public Map getStates() { + return Collections.unmodifiableMap(this.values); + } + /** * Internal method used for creating the initial BlockState. * @@ -107,7 +136,7 @@ public class BlockState { * @param value The value * @return The blockstate, for chaining */ - BlockState setState(State state, SimpleStateValue value) { + BlockState setState(State state, StateValue value) { this.values.put(state, value); return this; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 2147d05e0..cb49a0795 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -19,9 +19,19 @@ package com.sk89q.worldedit.extension.factory; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.*; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.NotABlockException; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.MobSpawnerBlock; +import com.sk89q.worldedit.blocks.SignBlock; +import com.sk89q.worldedit.blocks.SkullBlock; import com.sk89q.worldedit.blocks.metadata.MobType; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.DisallowedUsageException; import com.sk89q.worldedit.extension.input.InputParseException; @@ -32,6 +42,14 @@ import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.internal.registry.InputParser; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.registry.BundledBlockData; +import com.sk89q.worldedit.world.registry.state.State; +import com.sk89q.worldedit.world.registry.state.value.StateValue; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Parses block input strings. @@ -59,9 +77,6 @@ class DefaultBlockParser extends InputParser { @Override public BaseBlock parseFromInput(String input, ParserContext context) throws InputParseException { - // TODO: Rewrite this entire method to use BaseBlocks and ignore - // BlockType, as well as to properly handle mod:name IDs - String originalInput = input; input = input.replace("_", " "); input = input.replace(";", "|"); @@ -84,51 +99,44 @@ class DefaultBlockParser extends InputParser { } } + private static Pattern blockStatePattern = Pattern.compile("([a-z:]+)(?:\\[([a-zA-Z0-9=, ]+)\\])?", Pattern.CASE_INSENSITIVE); + private static String[] EMPTY_STRING_ARRAY = new String[]{}; + private BaseBlock parseLogic(String input, ParserContext context) throws InputParseException, NoMatchException, DisallowedUsageException { BlockType blockType; + Map blockStates = new HashMap<>(); String[] blockAndExtraData = input.split("\\|"); - String[] blockLocator = blockAndExtraData[0].split(":", 3); - String[] typeAndData; - switch (blockLocator.length) { - case 3: - typeAndData = new String[] { - blockLocator[0] + ":" + blockLocator[1], - blockLocator[2] }; - break; - default: - typeAndData = blockLocator; + Matcher matcher = blockStatePattern.matcher(blockAndExtraData[0]); + if (matcher.groupCount() < 1 || matcher.groupCount() > 2) { + throw new InputParseException("Invalid format"); + } + String typeString = matcher.group(1); + String[] stateProperties = EMPTY_STRING_ARRAY; + if (matcher.groupCount() == 2) { + stateProperties = matcher.group(2).split(","); } - String testId = typeAndData[0]; - int blockId = -1; - - int data = -1; - - boolean parseDataValue = true; - - if ("hand".equalsIgnoreCase(testId)) { + if ("hand".equalsIgnoreCase(typeString)) { // Get the block type from the item in the user's hand. final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND); if (blockInHand.getClass() != BaseBlock.class) { return blockInHand; } - blockId = blockInHand.getId(); - blockType = BlockType.fromID(blockId); - data = blockInHand.getData(); - } else if ("offhand".equalsIgnoreCase(testId)) { + blockType = blockInHand.getType(); + blockStates = blockInHand.getStates(); + } else if ("offhand".equalsIgnoreCase(typeString)) { // Get the block type from the item in the user's off hand. final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.OFF_HAND); if (blockInHand.getClass() != BaseBlock.class) { return blockInHand; } - blockId = blockInHand.getId(); - blockType = BlockType.fromID(blockId); - data = blockInHand.getData(); - } else if ("pos1".equalsIgnoreCase(testId)) { + blockType = blockInHand.getType(); + blockStates = blockInHand.getStates(); + } else if ("pos1".equalsIgnoreCase(typeString)) { // Get the block type from the "primary position" final World world = context.requireWorld(); final BlockVector primaryPosition; @@ -142,135 +150,49 @@ class DefaultBlockParser extends InputParser { return blockInHand; } - blockId = blockInHand.getId(); - blockType = BlockType.fromID(blockId); - data = blockInHand.getData(); + blockType = blockInHand.getType(); + blockStates = blockInHand.getStates(); } else { - // Attempt to parse the item ID or otherwise resolve an item/block - // name to its numeric ID - try { - blockId = Integer.parseInt(testId); - blockType = BlockType.fromID(blockId); - } catch (NumberFormatException e) { - blockType = BlockType.lookup(testId); - if (blockType == null) { - int t = worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).resolveItem(testId); - if (t >= 0) { - blockType = BlockType.fromID(t); // Could be null - blockId = t; - } else if (blockLocator.length == 2) { // Block IDs in MC 1.7 and above use mod:name - t = worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).resolveItem(blockAndExtraData[0]); - if (t >= 0) { - blockType = BlockType.fromID(t); // Could be null - blockId = t; - typeAndData = new String[] { blockAndExtraData[0] }; - testId = blockAndExtraData[0]; - } - } - } - } + // Attempt to lookup a block from ID or name. + blockType = BlockTypes.getBlockType(typeString); - if (blockId == -1 && blockType == null) { - // Maybe it's a cloth - ClothColor col = ClothColor.lookup(testId); - if (col == null) { - throw new NoMatchException("Can't figure out what block '" + input + "' refers to"); - } - - blockType = BlockType.CLOTH; - data = col.getID(); - - // Prevent overriding the data value - parseDataValue = false; - } - - // Read block ID - if (blockId == -1) { - blockId = blockType.getID(); - } - - if (!context.requireWorld().isValidBlockType(blockId)) { + if (blockType == null) { throw new NoMatchException("Does not match a valid block type: '" + input + "'"); } } - if (!context.isPreferringWildcard() && data == -1) { - // No wildcards allowed => eliminate them. - data = 0; + BlockState state; + + if (!context.isPreferringWildcard()) { + // No wildcards allowed => eliminate them. (Start with default state) + state = blockType.getDefaultState(); + } else { + state = new BlockState(blockType, blockStates); } - if (parseDataValue) { // Block data not yet detected + if (stateProperties.length > 0) { // Block data not yet detected // Parse the block data (optional) - try { - if (typeAndData.length > 1 && !typeAndData[1].isEmpty()) { - data = Integer.parseInt(typeAndData[1]); - } + for (String parseableData : stateProperties) { + try { + String[] parts = parseableData.split("="); + if (parts.length != 2) { + throw new NoMatchException("Bad state format in " + parseableData); + } - if (data > 15) { - throw new NoMatchException("Invalid data value '" + typeAndData[1] + "'"); - } + State stateKey = BundledBlockData.getInstance().findById(blockType.getId()).states.get(parts[0]); + if (stateKey == null) { + throw new NoMatchException("Unknown state " + parts[0] + " for block " + blockType.getName()); + } + StateValue value = stateKey.getValueFor(parts[1]); + if (value == null) { + throw new NoMatchException("Unknown value " + parts[1] + " for state " + parts[0]); + } - if (data < 0 && (context.isRestricted() || data != -1)) { - data = 0; - } - } catch (NumberFormatException e) { - if (blockType == null) { - throw new NoMatchException("Unknown data value '" + typeAndData[1] + "'"); - } - - switch (blockType) { - case CLOTH: - case STAINED_CLAY: - case CARPET: - ClothColor col = ClothColor.lookup(typeAndData[1]); - if (col == null) { - throw new NoMatchException("Unknown wool color '" + typeAndData[1] + "'"); - } - - data = col.getID(); - break; - - case STEP: - case DOUBLE_STEP: - BlockType dataType = BlockType.lookup(typeAndData[1]); - - if (dataType == null) { - throw new NoMatchException("Unknown step type '" + typeAndData[1] + "'"); - } - - switch (dataType) { - case STONE: - data = 0; - break; - case SANDSTONE: - data = 1; - break; - case WOOD: - data = 2; - break; - case COBBLESTONE: - data = 3; - break; - case BRICK: - data = 4; - break; - case STONE_BRICK: - data = 5; - break; - case NETHER_BRICK: - data = 6; - break; - case QUARTZ_BLOCK: - data = 7; - break; - - default: - throw new NoMatchException("Invalid step type '" + typeAndData[1] + "'"); - } - break; - - default: - throw new NoMatchException("Unknown data value '" + typeAndData[1] + "'"); + state = state.with(stateKey, value); + } catch (NoMatchException e) { + throw e; // Pass-through + } catch (Exception e) { + throw new NoMatchException("Unknown state '" + parseableData + "'"); } } } @@ -278,94 +200,46 @@ class DefaultBlockParser extends InputParser { // Check if the item is allowed Actor actor = context.requireActor(); if (context.isRestricted() && actor != null && !actor.hasPermission("worldedit.anyblock") - && worldEdit.getConfiguration().disallowedBlocks.contains(blockId)) { + && worldEdit.getConfiguration().disallowedBlocks.contains(blockType.getId())) { throw new DisallowedUsageException("You are not allowed to use '" + input + "'"); } - if (blockType == null) { - return new BaseBlock(blockId, data); - } - - switch (blockType) { - case SIGN_POST: - case WALL_SIGN: - // Allow special sign text syntax - String[] text = new String[4]; - text[0] = blockAndExtraData.length > 1 ? blockAndExtraData[1] : ""; - text[1] = blockAndExtraData.length > 2 ? blockAndExtraData[2] : ""; - text[2] = blockAndExtraData.length > 3 ? blockAndExtraData[3] : ""; - text[3] = blockAndExtraData.length > 4 ? blockAndExtraData[4] : ""; - return new SignBlock(blockType.getID(), data, text); - - case MOB_SPAWNER: - // Allow setting mob spawn type - if (blockAndExtraData.length > 1) { - String mobName = blockAndExtraData[1]; - for (MobType mobType : MobType.values()) { - if (mobType.getName().toLowerCase().equals(mobName.toLowerCase())) { - mobName = mobType.getName(); - break; - } - } - if (!worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).isValidMobType(mobName)) { - throw new NoMatchException("Unknown mob type '" + mobName + "'"); - } - return new MobSpawnerBlock(data, mobName); - } else { - return new MobSpawnerBlock(data, MobType.PIG.getName()); - } - - case NOTE_BLOCK: - // Allow setting note - if (blockAndExtraData.length <= 1) { - return new NoteBlock(data, (byte) 0); - } - - byte note = Byte.parseByte(blockAndExtraData[1]); - if (note < 0 || note > 24) { - throw new InputParseException("Out of range note value: '" + blockAndExtraData[1] + "'"); - } - - return new NoteBlock(data, note); - - case HEAD: - // allow setting type/player/rotation - if (blockAndExtraData.length <= 1) { - return new SkullBlock(data); - } - - byte rot = 0; - String type = ""; - try { - rot = Byte.parseByte(blockAndExtraData[1]); - } catch (NumberFormatException e) { - type = blockAndExtraData[1]; - if (blockAndExtraData.length > 2) { - try { - rot = Byte.parseByte(blockAndExtraData[2]); - } catch (NumberFormatException e2) { - throw new InputParseException("Second part of skull metadata should be a number."); - } + if (blockType == BlockTypes.SIGN || blockType == BlockTypes.WALL_SIGN) { + // Allow special sign text syntax + String[] text = new String[4]; + text[0] = blockAndExtraData.length > 1 ? blockAndExtraData[1] : ""; + text[1] = blockAndExtraData.length > 2 ? blockAndExtraData[2] : ""; + text[2] = blockAndExtraData.length > 3 ? blockAndExtraData[3] : ""; + text[3] = blockAndExtraData.length > 4 ? blockAndExtraData[4] : ""; + return new SignBlock(state, text); + } else if (blockType == BlockTypes.MOB_SPAWNER) { + // Allow setting mob spawn type + if (blockAndExtraData.length > 1) { + String mobName = blockAndExtraData[1]; + for (MobType mobType : MobType.values()) { + if (mobType.getName().toLowerCase().equals(mobName.toLowerCase())) { + mobName = mobType.getName(); + break; } } - byte skullType = 0; - // type is either the mob type or the player name - // sorry for the four minecraft accounts named "skeleton", "wither", "zombie", or "creeper" - if (!type.isEmpty()) { - if (type.equalsIgnoreCase("skeleton")) skullType = 0; - else if (type.equalsIgnoreCase("wither")) skullType = 1; - else if (type.equalsIgnoreCase("zombie")) skullType = 2; - else if (type.equalsIgnoreCase("creeper")) skullType = 4; - else skullType = 3; - } - if (skullType == 3) { - return new SkullBlock(data, rot, type.replace(" ", "_")); // valid MC usernames - } else { - return new SkullBlock(data, skullType, rot); + if (!worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).isValidMobType(mobName)) { + throw new NoMatchException("Unknown mob type '" + mobName + "'"); } + return new MobSpawnerBlock(state, mobName); + } else { + return new MobSpawnerBlock(state, MobType.PIG.getName()); + } + } else if (blockType == BlockTypes.PLAYER_HEAD || blockType == BlockTypes.PLAYER_WALL_HEAD) { + // allow setting type/player/rotation + if (blockAndExtraData.length <= 1) { + return new SkullBlock(state); + } - default: - return new BaseBlock(blockId, data); + String type = blockAndExtraData[1]; + + return new SkullBlock(state, type.replace(" ", "_")); // valid MC usernames + } else { + return new BaseBlock(state); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java index b837f6d4b..a4164421f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java @@ -61,7 +61,7 @@ public class DefaultItemParser extends InputParser { try { damage = Short.parseShort(tokens[2]); } catch (NumberFormatException ignored) { - throw new InputParseException("Expected '" + tokens[2] + "' to be a metadata value but it's not a number"); + throw new InputParseException("Expected '" + tokens[2] + "' to be a damage value but it's not a number"); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java index 075d4236d..2eb77c97c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java @@ -28,18 +28,6 @@ import com.sk89q.worldedit.util.Location; */ public abstract class BlockBag { - /** - * Stores a block as if it was mined. - * - * @param id the type ID - * @throws BlockBagException on error - * @deprecated Use {@link BlockBag#storeDroppedBlock(int, int)} instead - */ - @Deprecated - public void storeDroppedBlock(int id) throws BlockBagException { - storeDroppedBlock(id, 0); - } - /** * Stores a block as if it was mined. * @@ -55,18 +43,6 @@ public abstract class BlockBag { storeItem(dropped); } - /** - * Sets a block as if it was placed by hand. - * - * @param id the type ID - * @throws BlockBagException on error - * @deprecated Use {@link #fetchPlacedBlock(int,int)} instead - */ - @Deprecated - public void fetchPlacedBlock(int id) throws BlockBagException { - fetchPlacedBlock(id, 0); - } - /** * Sets a block as if it was placed by hand. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index 229c3fa50..3e2b2e0ea 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -62,6 +62,7 @@ public interface World extends Extent { * @param id the block ID * @return true if the block ID is a valid one */ + @Deprecated boolean isValidBlockType(int id); /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 99bd9cbb7..76acf9de6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -196,7 +196,7 @@ public class BundledBlockData { private String unlocalizedName; public String localizedName; private List aliases; - private Map states = new HashMap<>(); + public Map states = new HashMap<>(); private SimpleBlockMaterial material = new SimpleBlockMaterial(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java index 790e47bca..c34f95647 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java @@ -23,6 +23,9 @@ import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue; import java.util.Collections; import java.util.List; +import java.util.Objects; + +import javax.annotation.Nullable; public class SimpleState implements State { @@ -41,4 +44,10 @@ public class SimpleState implements State { public List getValues() { return Collections.unmodifiableList(values); } + + @Nullable + @Override + public T getValueFor(String string) { + return values.stream().filter(value -> Objects.equals(value.getData(), string)).findFirst().orElse(null); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java index 49d77a1c0..ba3d94122 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java @@ -23,6 +23,8 @@ import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue; import java.util.List; +import javax.annotation.Nullable; + /** * Describes a state property of a block. * @@ -38,4 +40,12 @@ public interface State { */ List getValues(); + /** + * Gets the value for the given string, or null. + * + * @param string The string + * @return The value, or null + */ + @Nullable + T getValueFor(String string); } From e99190225eec9ea8d5944c89c64421ec0c55f9cc Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 18 Jun 2018 17:53:33 +1000 Subject: [PATCH 18/74] Further BaseBlock modernisation --- .../worldedit/bukkit/BukkitBiomeRegistry.java | 9 +- .../sk89q/worldedit/bukkit/BukkitEntity.java | 2 +- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 4 +- .../bukkit/BukkitPlayerBlockBag.java | 33 +-- .../sk89q/worldedit/bukkit/BukkitUtil.java | 11 +- .../sk89q/worldedit/bukkit/BukkitWorld.java | 40 +--- .../com/sk89q/worldedit/blocks/LazyBlock.java | 41 +--- .../java/com/sk89q/worldedit/EditSession.java | 50 ++-- .../com/sk89q/worldedit/blocks/BaseBlock.java | 224 +++++------------- .../com/sk89q/worldedit/blocks/BaseItem.java | 94 ++------ .../sk89q/worldedit/blocks/BaseItemStack.java | 9 +- .../com/sk89q/worldedit/blocks/BlockType.java | 7 +- .../worldedit/blocks/type/BlockState.java | 33 +-- .../blocks/type/BlockStateHolder.java | 59 +++++ .../worldedit/command/SelectionCommands.java | 7 +- .../sk89q/worldedit/command/ToolCommands.java | 4 +- .../worldedit/command/UtilityCommands.java | 8 +- .../command/argument/ItemUseParser.java | 2 +- .../worldedit/command/tool/AreaPickaxe.java | 4 +- .../worldedit/command/tool/BlockReplacer.java | 2 +- .../command/tool/FloatingTreeRemover.java | 2 +- .../worldedit/command/tool/FloodFillTool.java | 4 +- .../command/tool/LongRangeBuildTool.java | 4 +- .../worldedit/command/tool/QueryTool.java | 4 +- .../command/tool/RecursivePickaxe.java | 4 +- .../worldedit/command/tool/SinglePickaxe.java | 2 +- .../com/sk89q/worldedit/entity/Player.java | 6 +- .../extension/factory/DefaultBlockParser.java | 6 +- .../extension/factory/DefaultItemParser.java | 36 +-- .../platform/AbstractPlayerActor.java | 4 - .../extension/platform/PlayerProxy.java | 4 +- .../SignCompatibilityHandler.java | 2 +- .../extent/inventory/BlockBagExtent.java | 4 +- .../extent/inventory/OutOfSpaceException.java | 18 +- .../extent/reorder/MultiStageReorder.java | 14 +- .../transform/BlockTransformExtent.java | 2 +- .../validation/DataValidatorExtent.java | 2 +- .../extent/world/BlockQuirkExtent.java | 2 +- .../function/block/ExtentBlockCopy.java | 2 +- .../function/generator/FloraGenerator.java | 4 +- .../function/generator/ForestGenerator.java | 2 +- .../generator/GardenPatchGenerator.java | 2 +- .../worldedit/function/mask/BlockMask.java | 2 +- .../function/mask/FuzzyBlockMask.java | 2 +- .../function/mask/SolidBlockMask.java | 2 +- .../worldedit/math/convolution/HeightMap.java | 4 +- .../regions/shape/ArbitraryShape.java | 2 +- .../com/sk89q/worldedit/util/TargetBlock.java | 4 +- .../sk89q/worldedit/world/AbstractWorld.java | 67 +----- .../java/com/sk89q/worldedit/world/World.java | 67 ------ .../worldedit/world/chunk/AnvilChunk.java | 32 +-- .../sk89q/worldedit/world/chunk/Chunk.java | 21 +- .../sk89q/worldedit/world/chunk/OldChunk.java | 82 +++---- .../world/registry/BundledBlockRegistry.java | 4 +- .../transform/BlockTransformExtentTest.java | 4 +- .../worldedit/forge/ForgeItemRegistry.java | 5 +- .../sk89q/worldedit/forge/ForgePlayer.java | 5 +- .../com/sk89q/worldedit/forge/ForgeWorld.java | 15 +- .../sk89q/worldedit/forge/ForgeWorldEdit.java | 24 +- .../sk89q/worldedit/sponge/SpongePlayer.java | 9 +- .../sk89q/worldedit/sponge/SpongeWorld.java | 7 +- 61 files changed, 344 insertions(+), 787 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java index 72e3379fc..8a69eaf31 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java @@ -48,7 +48,7 @@ class BukkitBiomeRegistry implements BiomeRegistry { public List getBiomes() { BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); if (adapter != null) { - List biomes = new ArrayList(); + List biomes = new ArrayList<>(); for (Biome biome : Biome.values()) { int biomeId = adapter.getBiomeId(biome); biomes.add(new BaseBiome(biomeId)); @@ -65,12 +65,7 @@ class BukkitBiomeRegistry implements BiomeRegistry { BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); if (adapter != null) { final Biome bukkitBiome = adapter.getBiome(biome.getId()); - return new BiomeData() { - @Override - public String getName() { - return bukkitBiome.name(); - } - }; + return bukkitBiome::name; } else { return null; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java index cfc49b01b..010ad55bc 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java @@ -47,7 +47,7 @@ class BukkitEntity implements Entity { */ BukkitEntity(org.bukkit.entity.Entity entity) { checkNotNull(entity); - this.entityRef = new WeakReference(entity); + this.entityRef = new WeakReference<>(entity); } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index 9053e4bf3..a129b9633 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -78,8 +78,8 @@ public class BukkitPlayer extends AbstractPlayerActor { } @Override - public void giveItem(int type, int amt) { - player.getInventory().addItem(new ItemStack(type, amt)); + public void giveItem(BaseItemStack itemStack) { + player.getInventory().addItem(new ItemStack(itemStack.getLegacyId(), itemStack.getAmount())); } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index 8733c4f9a..a939c1ae0 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -21,7 +21,8 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBagException; import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; @@ -64,13 +65,11 @@ public class BukkitPlayerBlockBag extends BlockBag { @Override public void fetchItem(BaseItem item) throws BlockBagException { - final int id = item.getLegacyId(); - final int damage = item.getData(); + final ItemType id = item.getType(); int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; assert(amount == 1); - boolean usesDamageValue = true;// TODO ItemType.usesDamageValue(id); - if (id == BlockID.AIR) { + if (id == ItemTypes.AIR) { throw new IllegalArgumentException("Can't fetch air block"); } @@ -85,16 +84,12 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (bukkitItem.getTypeId() != id) { + if (bukkitItem.getTypeId() != id.getLegacyId()) { + // TODO Fix when bukkit gets not awful // Type id doesn't fit continue; } - if (usesDamageValue && bukkitItem.getDurability() != damage) { - // Damage value doesn't fit. - continue; - } - int currentAmount = bukkitItem.getAmount(); if (currentAmount < 0) { // Unlimited @@ -119,13 +114,11 @@ public class BukkitPlayerBlockBag extends BlockBag { @Override public void storeItem(BaseItem item) throws BlockBagException { - final int id = item.getLegacyId(); - final int damage = item.getData(); + final ItemType id = item.getType(); int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; assert(amount <= 64); - boolean usesDamageValue = true; //TODO ItemType.usesDamageValue(id); - if (id == BlockID.AIR) { + if (id == ItemTypes.AIR) { throw new IllegalArgumentException("Can't store air block"); } @@ -146,16 +139,12 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (bukkitItem.getTypeId() != id) { + if (bukkitItem.getTypeId() != id.getLegacyId()) { + // TODO Fix when bukkit gets not terrible // Type id doesn't fit continue; } - if (usesDamageValue && bukkitItem.getDurability() != damage) { - // Damage value doesn't fit. - continue; - } - int currentAmount = bukkitItem.getAmount(); if (currentAmount < 0) { // Unlimited @@ -177,7 +166,7 @@ public class BukkitPlayerBlockBag extends BlockBag { } if (freeSlot > -1) { - items[freeSlot] = new ItemStack(id, amount); + items[freeSlot] = new ItemStack(id.getLegacyId(), amount); // TODO Ditto return; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index 07d5f81d7..f32d56766 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -20,14 +20,13 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.BlockVector; -import com.sk89q.worldedit.NotABlockException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.ItemID; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; import org.bukkit.DyeColor; @@ -131,7 +130,7 @@ public final class BukkitUtil { case ItemID.INK_SACK: final Dye materialData = (Dye) itemStack.getData(); if (materialData.getColor() == DyeColor.BROWN) { - return new BaseBlock(BlockID.COCOA_PLANT, -1); + return new BaseBlock(BlockTypes.COCOA); } break; @@ -143,11 +142,7 @@ public final class BukkitUtil { break; } - if (world.isValidBlockType(typeId)) { - return new BaseBlock(typeId, -1); - } - - throw new NotABlockException(typeId); + return new BaseBlock(typeId, -1); } public static BaseItemStack toBaseItemStack(ItemStack itemStack) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 5454cb799..36871447f 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -248,36 +248,6 @@ public class BukkitWorld extends AbstractWorld { return true; } - @Override - @Deprecated - public boolean generateTree(EditSession editSession, Vector pt) { - return generateTree(TreeGenerator.TreeType.TREE, editSession, pt); - } - - @Override - @Deprecated - public boolean generateBigTree(EditSession editSession, Vector pt) { - return generateTree(TreeGenerator.TreeType.BIG_TREE, editSession, pt); - } - - @Override - @Deprecated - public boolean generateBirchTree(EditSession editSession, Vector pt) { - return generateTree(TreeGenerator.TreeType.BIRCH, editSession, pt); - } - - @Override - @Deprecated - public boolean generateRedwoodTree(EditSession editSession, Vector pt) { - return generateTree(TreeGenerator.TreeType.REDWOOD, editSession, pt); - } - - @Override - @Deprecated - public boolean generateTallRedwoodTree(EditSession editSession, Vector pt) { - return generateTree(TreeGenerator.TreeType.TALL_REDWOOD, editSession, pt); - } - /** * An EnumMap that stores which WorldEdit TreeTypes apply to which Bukkit TreeTypes */ @@ -323,16 +293,10 @@ public class BukkitWorld extends AbstractWorld { @Override public void dropItem(Vector pt, BaseItemStack item) { World world = getWorld(); - ItemStack bukkitItem = new ItemStack(item.getLegacyId(), item.getAmount(), - item.getData()); + ItemStack bukkitItem = new ItemStack(item.getLegacyId(), item.getAmount()); // TODO Add data. world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem); } - @Override - public boolean isValidBlockType(int type) { - return Material.getMaterial(type) != null && Material.getMaterial(type).isBlock(); - } - @Override public void checkLoadedChunk(Vector pt) { World world = getWorld(); @@ -415,7 +379,7 @@ public class BukkitWorld extends AbstractWorld { return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight); } else { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - return bukkitBlock.setTypeIdAndData(block.getType().getLegacyId(), (byte) block.getData(), notifyAndLight); + return bukkitBlock.setTypeIdAndData(block.getBlockType().getLegacyId(), (byte) block.getData(), notifyAndLight); } } diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java index e70bd31ab..fe7dee50a 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java @@ -19,16 +19,13 @@ package com.sk89q.worldedit.blocks; -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.world.registry.state.State; -import com.sk89q.worldedit.world.registry.state.value.StateValue; - import static com.google.common.base.Preconditions.checkNotNull; -import java.util.Map; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.extent.Extent; /** * A implementation of a lazy block for {@link Extent#getLazyBlock(Vector)} @@ -65,14 +62,13 @@ public class LazyBlock extends BaseBlock { /** * Create a new lazy block. * - * @param type the block type - * @param states the block states + * @param state the block state * @param extent the extent to later load the full block data from * @param position the position to later load the full block data from */ @Deprecated - public LazyBlock(BlockType type, Map states, Extent extent, Vector position) { - super(type, states); + public LazyBlock(BlockState state, Extent extent, Vector position) { + super(state); checkNotNull(extent); checkNotNull(position); this.extent = extent; @@ -96,31 +92,12 @@ public class LazyBlock extends BaseBlock { this.position = position; } - @Override - public void setId(int id) { - throw new UnsupportedOperationException("This object is immutable"); - } - - @Override - public void setData(int data) { - throw new UnsupportedOperationException("This object is immutable"); - } - - @Override - public void setType(BlockType type) { - throw new UnsupportedOperationException("This object is immutable"); - } - - @Override - public void setState(State state, StateValue stateValue) { - throw new UnsupportedOperationException("This object is immutable"); - } - @Override public CompoundTag getNbtData() { if (!loaded) { BaseBlock loadedBlock = extent.getBlock(position); super.setNbtData(loadedBlock.getNbtData()); + loaded = true; } return super.getNbtData(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 62d78e4d4..f5ed6c283 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -1063,7 +1063,7 @@ public class EditSession implements Extent { // Remove the original blocks com.sk89q.worldedit.function.pattern.Pattern pattern = replacement != null ? new BlockPattern(replacement) : - new BlockPattern(new BaseBlock(BlockID.AIR)); + new BlockPattern(new BaseBlock(BlockTypes.AIR)); BlockReplace remove = new BlockReplace(this, pattern); // Copy to a buffer so we don't destroy our original before we can copy all the blocks from it @@ -1143,22 +1143,22 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int fixLiquid(Vector origin, double radius, int moving, int stationary) throws MaxChangedBlocksException { + public int fixLiquid(Vector origin, double radius, com.sk89q.worldedit.blocks.type.BlockType moving, com.sk89q.worldedit.blocks.type.BlockType stationary) throws MaxChangedBlocksException { checkNotNull(origin); checkArgument(radius >= 0, "radius >= 0 required"); // Our origins can only be liquids BlockMask liquidMask = new BlockMask( this, - new BaseBlock(moving, -1), - new BaseBlock(stationary, -1)); + new BaseBlock(moving), + new BaseBlock(stationary)); // But we will also visit air blocks MaskIntersection blockMask = new MaskUnion(liquidMask, new BlockMask( this, - new BaseBlock(BlockID.AIR))); + new BaseBlock(BlockTypes.AIR))); // There are boundaries that the routine needs to stay in MaskIntersection mask = new MaskIntersection( @@ -1449,7 +1449,7 @@ public class EditSession implements Extent { for (int y = world.getMaxY(); y >= 1; --y) { Vector pt = new Vector(x, y, z); - com.sk89q.worldedit.blocks.type.BlockType id = getLazyBlock(pt).getType(); + com.sk89q.worldedit.blocks.type.BlockType id = getLazyBlock(pt).getBlockType(); if (id == BlockTypes.ICE) { if (setBlock(pt, water)) { @@ -1657,14 +1657,14 @@ public class EditSession implements Extent { for (int y = basePosition.getBlockY(); y >= basePosition.getBlockY() - 10; --y) { // Check if we hit the ground - int t = getBlock(new Vector(x, y, z)).getType().getLegacyId(); - if (t == BlockID.GRASS || t == BlockID.DIRT) { + com.sk89q.worldedit.blocks.type.BlockType t = getBlock(new Vector(x, y, z)).getBlockType(); + if (t == BlockTypes.GRASS_BLOCK || t == BlockTypes.DIRT) { treeGenerator.generate(this, new Vector(x, y + 1, z)); ++affected; break; - } else if (t == BlockID.SNOW) { - setBlock(new Vector(x, y, z), new BaseBlock(BlockID.AIR)); - } else if (t != BlockID.AIR) { // Trees won't grow on this! + } else if (t == BlockTypes.SNOW) { + setBlock(new Vector(x, y, z), new BaseBlock(BlockTypes.AIR)); + } else if (t != BlockTypes.AIR) { // Trees won't grow on this! break; } } @@ -1680,9 +1680,9 @@ public class EditSession implements Extent { * @param region a region * @return the results */ - public List> getBlockDistribution(Region region) { - List> distribution = new ArrayList<>(); - Map> map = new HashMap<>(); + public List> getBlockDistribution(Region region) { + List> distribution = new ArrayList<>(); + Map> map = new HashMap<>(); if (region instanceof CuboidRegion) { // Doing this for speed @@ -1701,13 +1701,13 @@ public class EditSession implements Extent { for (int z = minZ; z <= maxZ; ++z) { Vector pt = new Vector(x, y, z); - int id = getLazyBlock(pt).getId(); + com.sk89q.worldedit.blocks.type.BlockType type = getLazyBlock(pt).getBlockType(); - if (map.containsKey(id)) { - map.get(id).increment(); + if (map.containsKey(type)) { + map.get(type).increment(); } else { - Countable c = new Countable<>(id, 1); - map.put(id, c); + Countable c = new Countable<>(type, 1); + map.put(type, c); distribution.add(c); } } @@ -1715,13 +1715,13 @@ public class EditSession implements Extent { } } else { for (Vector pt : region) { - int id = getLazyBlock(pt).getId(); + com.sk89q.worldedit.blocks.type.BlockType type = getLazyBlock(pt).getBlockType(); - if (map.containsKey(id)) { - map.get(id).increment(); + if (map.containsKey(type)) { + map.get(type).increment(); } else { - Countable c = new Countable<>(id, 1); - map.put(id, c); + Countable c = new Countable<>(type, 1); + map.put(type, c); } } } @@ -1809,7 +1809,7 @@ public class EditSession implements Extent { final Vector scaled = current.subtract(zero).divide(unit); try { - if (expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ(), defaultMaterial.getType().getLegacyId(), defaultMaterial.getData()) <= 0) { + if (expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ(), defaultMaterial.getBlockType().getLegacyId(), defaultMaterial.getData()) <= 0) { return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 5c1644280..df4f5b14a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -24,19 +24,18 @@ import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.CuboidClipboard.FlipDirection; import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.mask.Mask; -import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.state.State; import com.sk89q.worldedit.world.registry.state.value.StateValue; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import javax.annotation.Nullable; @@ -54,13 +53,12 @@ import javax.annotation.Nullable; * as a "wildcard" block value, even though a {@link Mask} would be * more appropriate.

*/ -public class BaseBlock implements TileEntityBlock { +public class BaseBlock implements BlockStateHolder, TileEntityBlock { // Instances of this class should be _as small as possible_ because there will // be millions of instances of this object. - private BlockType blockType; - private Map states; + private BlockState blockState; @Nullable private CompoundTag nbtData; @@ -68,18 +66,18 @@ public class BaseBlock implements TileEntityBlock { * Construct a block with the given ID and a data value of 0. * * @param id ID value - * @see #setId(int) */ @Deprecated public BaseBlock(int id) { - internalSetId(id); - internalSetData(0); - this.states = new HashMap<>(); } + /** + * Construct a block with a state. + * + * @param blockState The blockstate + */ public BaseBlock(BlockState blockState) { - this.blockType = blockState.getBlockType(); - this.states = blockState.getStates(); + this.blockState = blockState; } /** @@ -88,8 +86,18 @@ public class BaseBlock implements TileEntityBlock { * @param blockType The block type */ public BaseBlock(BlockType blockType) { - internalSetType(blockType); - this.states = new HashMap<>(); + this.blockState = blockType.getDefaultState(); + } + + /** + * Construct a block with the given ID, data value and NBT data structure. + * + * @param state The block state + * @param nbtData NBT data, which may be null + */ + public BaseBlock(BlockState state, @Nullable CompoundTag nbtData) { + this.blockState = state; + setNbtData(nbtData); } /** @@ -97,27 +105,9 @@ public class BaseBlock implements TileEntityBlock { * * @param id ID value * @param data data value - * @see #setId(int) - * @see #setData(int) */ @Deprecated public BaseBlock(int id, int data) { - internalSetId(id); - internalSetData(data); - this.states = new HashMap<>(); - } - - /** - * Construct a block with the given ID and data value. - * - * @param blockType The block type - * @param states The states - * @see #setId(int) - * @see #setData(int) - */ - public BaseBlock(BlockType blockType, Map states) { - internalSetType(blockType); - setStates(states); } /** @@ -129,22 +119,6 @@ public class BaseBlock implements TileEntityBlock { */ @Deprecated public BaseBlock(int id, int data, @Nullable CompoundTag nbtData) { - internalSetId(id); - setData(data); - setNbtData(nbtData); - this.states = new HashMap<>(); - } - - /** - * Construct a block with the given ID, data value and NBT data structure. - * - * @param blockType The block type - * @param states The states - * @param nbtData NBT data, which may be null - */ - public BaseBlock(BlockType blockType, Map states, @Nullable CompoundTag nbtData) { - setType(blockType); - setStates(states); setNbtData(nbtData); } @@ -154,7 +128,16 @@ public class BaseBlock implements TileEntityBlock { * @param other the other block */ public BaseBlock(BaseBlock other) { - this(other.getType(), other.getStates(), other.getNbtData()); + this(other.getState(), other.getNbtData()); + } + + /** + * Get the block state + * + * @return The block state + */ + public BlockState getState() { + return this.blockState; } /** @@ -164,45 +147,7 @@ public class BaseBlock implements TileEntityBlock { */ @Deprecated public int getId() { - return this.blockType.getLegacyId(); - } - - /** - * Set the block ID. - * - * @param type block type - */ - protected final void internalSetType(BlockType type) { - if (type == null) { - throw new IllegalArgumentException("You must provide a BlockType"); - } - - this.blockType = type; - } - - /** - * Set the block ID. - * - * @param id block id - */ - @Deprecated - public void setId(int id) { - internalSetId(id); - } - - @Deprecated - private void internalSetId(int id) { - BlockType type = BlockTypes.getBlockType(BundledBlockData.getInstance().fromLegacyId(id)); - internalSetType(type); - } - - /** - * Set the block type. - * - * @param type block type - */ - public void setType(BlockType type) { - internalSetType(type); + return this.blockState.getBlockType().getLegacyId(); } /** @@ -223,16 +168,17 @@ public class BaseBlock implements TileEntityBlock { * @return The state map */ public Map getStates() { - return Collections.unmodifiableMap(states); + return this.blockState.getStates(); } - /** - * Sets the states of this block. - * - * @param states The states - */ - private void setStates(Map states) { - this.states = states; + @Override + public BlockType getBlockType() { + return this.blockState.getBlockType(); + } + + @Override + public BaseBlock with(State state, StateValue value) { + return new BaseBlock(this.blockState.with(state, value), getNbtData()); } /** @@ -242,26 +188,7 @@ public class BaseBlock implements TileEntityBlock { * @return The state value */ public StateValue getState(State state) { - return states.get(state); - } - - /** - * Sets a state to a specific value - * - * @param state The state - * @param stateValue The value - */ - public void setState(State state, StateValue stateValue) { - this.states.put(state, stateValue); - } - - /** - * Set the block's data value. - * - * @param data block data value - */ - @Deprecated - protected final void internalSetData(int data) { + return this.blockState.getState(state); } /** @@ -271,34 +198,6 @@ public class BaseBlock implements TileEntityBlock { */ @Deprecated public void setData(int data) { - internalSetData(data); - } - - /** - * Set both the block's ID and data value. - * - * @param id ID value - * @param data data value - * @see #setId(int) - * @see #setData(int) - */ - @Deprecated - public void setIdAndData(int id, int data) { - setId(id); - setData(data); - } - - /** - * Returns whether there are no matched states. - * - * @return true if there are no matched states - */ - public boolean hasWildcardData() { - return getStates().isEmpty(); - } - - public boolean hasWildcardDataFor(State state) { - return getState(state) == null; } @Override @@ -323,21 +222,12 @@ public class BaseBlock implements TileEntityBlock { @Nullable @Override public CompoundTag getNbtData() { - return nbtData; + return this.nbtData; } @Override public void setNbtData(@Nullable CompoundTag nbtData) { - this.nbtData = nbtData; - } - - /** - * Get the type of block. - * - * @return the type - */ - public BlockType getType() { - return this.blockType; + throw new UnsupportedOperationException("This class is immutable."); } /** @@ -346,7 +236,7 @@ public class BaseBlock implements TileEntityBlock { * @return if air */ public boolean isAir() { - return getType() == BlockTypes.AIR; + return getBlockType() == BlockTypes.AIR; } /** @@ -357,7 +247,7 @@ public class BaseBlock implements TileEntityBlock { */ @Deprecated public int rotate90() { - int newData = BlockData.rotate90(getType().getLegacyId(), getData()); + int newData = BlockData.rotate90(getBlockType().getLegacyId(), getData()); setData(newData); return newData; } @@ -370,7 +260,7 @@ public class BaseBlock implements TileEntityBlock { */ @Deprecated public int rotate90Reverse() { - int newData = BlockData.rotate90Reverse(getType().getLegacyId(), getData()); + int newData = BlockData.rotate90Reverse(getBlockType().getLegacyId(), getData()); setData((short) newData); return newData; } @@ -384,7 +274,7 @@ public class BaseBlock implements TileEntityBlock { */ @Deprecated public int cycleData(int increment) { - int newData = BlockData.cycle(getType().getLegacyId(), getData(), increment); + int newData = BlockData.cycle(getBlockType().getLegacyId(), getData(), increment); setData((short) newData); return newData; } @@ -397,7 +287,7 @@ public class BaseBlock implements TileEntityBlock { */ @Deprecated public BaseBlock flip() { - setData((short) BlockData.flip(getType().getLegacyId(), getData())); + setData((short) BlockData.flip(getBlockType().getLegacyId(), getData())); return this; } @@ -410,7 +300,7 @@ public class BaseBlock implements TileEntityBlock { */ @Deprecated public BaseBlock flip(FlipDirection direction) { - setData((short) BlockData.flip(getType().getLegacyId(), getData(), direction)); + setData((short) BlockData.flip(getBlockType().getLegacyId(), getData(), direction)); return this; } @@ -425,7 +315,7 @@ public class BaseBlock implements TileEntityBlock { final BaseBlock otherBlock = (BaseBlock) o; - return getType() == otherBlock.getType() && getData() == otherBlock.getData(); + return this.getState().equals(otherBlock.getState()) && Objects.equals(getNbtData(), otherBlock.getNbtData()); } @@ -436,7 +326,7 @@ public class BaseBlock implements TileEntityBlock { * @return true if equal */ public boolean equalsFuzzy(BaseBlock o) { - if (!getType().equals(o.getType())) { + if (!getBlockType().equals(o.getBlockType())) { return false; } @@ -484,14 +374,16 @@ public class BaseBlock implements TileEntityBlock { @Override public int hashCode() { - int ret = getType().hashCode() << 3; - ret += getStates().hashCode(); + int ret = getState().hashCode() << 3; + if (hasNbtData()) { + ret += getNbtData().hashCode(); + } return ret; } @Override public String toString() { - return "Block{Type:" + getType().getId() + ", States: " + getStates().toString() + "}"; + return "Block{State: " + this.getState().toString() + ", NBT: " + String.valueOf(getNbtData()) + "}"; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java index 228035c98..529d5829a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java @@ -19,12 +19,11 @@ package com.sk89q.worldedit.blocks; +import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.blocks.type.ItemType; -import com.sk89q.worldedit.blocks.type.ItemTypes; -import com.sk89q.worldedit.world.registry.BundledItemData; +import com.sk89q.worldedit.world.NbtValued; -import java.util.HashMap; -import java.util.Map; +import javax.annotation.Nullable; /** * Represents an item, without an amount value. See {@link BaseItemStack} @@ -32,11 +31,11 @@ import java.util.Map; * *

This class may be removed in the future.

*/ -public class BaseItem { +public class BaseItem implements NbtValued { private ItemType itemType; - private short damage; - private final Map enchantments = new HashMap<>(); + @Nullable + private CompoundTag nbtData; /** * Construct the object. @@ -45,7 +44,6 @@ public class BaseItem { */ @Deprecated public BaseItem(int id) { - this(id, (short) 0); } /** @@ -57,27 +55,15 @@ public class BaseItem { this.itemType = itemType; } - /** - * Construct the object. - * - * @param id ID of the item - * @param data data value of the item - */ - @Deprecated - public BaseItem(int id, short data) { - setLegacyId(id); - this.damage = data; - } - /** * Construct the object. * * @param itemType Type of the item - * @param damage Damage value of the item + * @param tag NBT Compound tag */ - public BaseItem(ItemType itemType, short damage) { + public BaseItem(ItemType itemType, CompoundTag tag) { this.itemType = itemType; - this.damage = damage; + this.nbtData = tag; } /** @@ -90,17 +76,6 @@ public class BaseItem { return this.itemType.getLegacyId(); } - /** - * Set the type of item. - * - * @param id the id to set - */ - @Deprecated - public void setLegacyId(int id) { - ItemType type = ItemTypes.getItemType(BundledItemData.getInstance().fromLegacyId(id)); - setType(type); - } - /** * Get the type of item. * @@ -119,50 +94,19 @@ public class BaseItem { this.itemType = itemType; } - /** - * Get the damage value. - * - * @return the damage - */ - public short getDamage() { - return this.damage; + @Override + public boolean hasNbtData() { + return this.nbtData != null; } - /** - * Get the data value. - * - * @return the data - */ - @Deprecated - public short getData() { - return this.damage; + @Nullable + @Override + public CompoundTag getNbtData() { + return this.nbtData; } - /** - * Set the data value. - * - * @param damage the damage to set - */ - public void setDamage(short damage) { - this.damage = damage; - } - - /** - * Set the data value. - * - * @param data the damage to set - */ - @Deprecated - public void setData(short data) { - this.damage = data; - } - - /** - * Get the map of enchantments. - * - * @return map of enchantments - */ - public Map getEnchantments() { - return enchantments; + @Override + public void setNbtData(@Nullable CompoundTag nbtData) { + this.nbtData = nbtData; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java index 93c876b8c..acb97c04f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.blocks; +import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.blocks.type.ItemType; /** @@ -81,7 +82,7 @@ public class BaseItemStack extends BaseItem { */ @Deprecated public BaseItemStack(int id, int amount, short data) { - super(id, data); + super(id); this.amount = amount; } @@ -89,11 +90,11 @@ public class BaseItemStack extends BaseItem { * Construct the object. * * @param id The item type + * @param tag Tag value * @param amount amount in the stack - * @param damage Damage value */ - public BaseItemStack(ItemType id, int amount, short damage) { - super(id, damage); + public BaseItemStack(ItemType id, CompoundTag tag, int amount) { + super(id, tag); this.amount = amount; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index d24b3e73f..19f09490d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -1540,7 +1540,7 @@ public enum BlockType { addIdentities(BlockID.DOUBLE_WOODEN_STEP, 7); // rule 3 addIdentities(BlockID.WOODEN_STEP, 7); // rule 1 - nonDataBlockBagItems.put(BlockID.COCOA_PLANT, new BaseItem(ItemID.INK_SACK, (short) (15 - ClothColor.ID.BROWN))); // rule 3 + nonDataBlockBagItems.put(BlockID.COCOA_PLANT, new BaseItem(ItemID.INK_SACK)); // rule 3 TODO data removed addIdentity(BlockID.SANDSTONE_STAIRS); // rule 1 nonDataBlockBagItems.put(BlockID.EMERALD_ORE, new BaseItem(ItemID.EMERALD)); // rule 5 addIdentity(BlockID.ENDER_CHEST); // rule 3 @@ -1569,7 +1569,8 @@ public enum BlockType { addIdentity(BlockID.HOPPER); // rule 1 addIdentities(BlockID.QUARTZ_BLOCK, 1); // rule 4 for (int i = 2; i <= 4; i++) { - dataBlockBagItems.put(typeDataKey(BlockID.QUARTZ_BLOCK, i), new BaseItem(BlockID.QUARTZ_BLOCK, (short) 2)); // rule 4, quartz pillars + dataBlockBagItems.put(typeDataKey(BlockID.QUARTZ_BLOCK, i), new BaseItem(BlockID.QUARTZ_BLOCK)); // rule 4, quartz pillars TODO data + // removed } addIdentity(BlockID.QUARTZ_STAIRS); // rule 1 addIdentity(BlockID.ACTIVATOR_RAIL); // rule 1 @@ -1629,7 +1630,7 @@ public enum BlockType { private static void addIdentities(int type, int maxData) { for (int data = 0; data < maxData; ++data) { - dataBlockBagItems.put(typeDataKey(type, data), new BaseItem(type, (short) data)); + dataBlockBagItems.put(typeDataKey(type, data), new BaseItem(type)); // TODO data removed } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java index 420dc9a99..618eeaf6f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java @@ -34,7 +34,7 @@ import java.util.Map; * An immutable class that represents the state a block can be in. */ @SuppressWarnings("unchecked") -public class BlockState { +public class BlockState implements BlockStateHolder { private final BlockType blockType; private final Map values; @@ -67,7 +67,7 @@ public class BlockState { for(final Map.Entry entry : this.values.entrySet()) { final State state = entry.getKey(); - state.getValues().stream().forEach(value -> { + state.getValues().forEach(value -> { if(value != entry.getValue()) { states.put(state, (StateValue) value, stateMap.get(this.withValue(state, (StateValue) value))); } @@ -83,22 +83,12 @@ public class BlockState { return values; } - /** - * Get the block type - * - * @return The type - */ + @Override public BlockType getBlockType() { return this.blockType; } - /** - * Returns a BlockState with the given state and value applied. - * - * @param state The state - * @param value The value - * @return The modified state, or same if could not be applied - */ + @Override public BlockState with(State state, StateValue value) { if (fuzzy) { return setState(state, value); @@ -108,21 +98,12 @@ public class BlockState { } } - /** - * Gets the value at the given state - * - * @param state The state - * @return The value - */ + @Override public StateValue getState(State state) { return this.values.get(state); } - /** - * Gets an immutable collection of the states. - * - * @return The states - */ + @Override public Map getStates() { return Collections.unmodifiableMap(this.values); } @@ -136,7 +117,7 @@ public class BlockState { * @param value The value * @return The blockstate, for chaining */ - BlockState setState(State state, StateValue value) { + private BlockState setState(State state, StateValue value) { this.values.put(state, value); return this; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java new file mode 100644 index 000000000..9375d2915 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java @@ -0,0 +1,59 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import com.sk89q.worldedit.world.registry.state.State; +import com.sk89q.worldedit.world.registry.state.value.StateValue; + +import java.util.Map; + +public interface BlockStateHolder { + + /** + * Get the block type + * + * @return The type + */ + BlockType getBlockType(); + + /** + * Returns a BlockState with the given state and value applied. + * + * @param state The state + * @param value The value + * @return The modified state, or same if could not be applied + */ + T with(State state, StateValue value); + + /** + * Gets the value at the given state + * + * @param state The state + * @return The value + */ + StateValue getState(State state); + + /** + * Gets an immutable collection of the states. + * + * @return The states + */ + Map getStates(); +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 61eaaa9ec..7fe95ac74 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -34,6 +34,7 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; @@ -277,7 +278,7 @@ public class SelectionCommands { @CommandPermissions("worldedit.wand") public void wand(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - player.giveItem(ItemTypes.getItemType(we.getConfiguration().wandItem).getLegacyId(), 1); + player.giveItem(new BaseItemStack(ItemTypes.getItemType(we.getConfiguration().wandItem), 1)); player.print("Left click: select pos #1; Right click: select pos #2"); } @@ -677,12 +678,12 @@ public class SelectionCommands { player.print("# total blocks: " + size); for (Countable c : distributionData) { - String name = c.getID().getType().getName(); + String name = c.getID().getBlockType().getName(); String str = String.format("%-7s (%.3f%%) %s #%s%s", String.valueOf(c.getAmount()), c.getAmount() / (double) size * 100, name, - c.getID().getType().getId(), + c.getID().getBlockType().getId(), c.getID().getStates()); player.print(str); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 465e204c3..e1419bd65 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -214,7 +214,7 @@ public class ToolCommands { session.setTool(itemStack.getType(), new LongRangeBuildTool(primary, secondary)); player.print("Long-range building tool bound to " + itemStack.getType().getName() + "."); - player.print("Left-click set to " + secondary.getType().getName() + "; right-click set to " - + primary.getType().getName() + "."); + player.print("Left-click set to " + secondary.getBlockType().getName() + "; right-click set to " + + primary.getBlockType().getName() + "."); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 1e465df36..1a79e804a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -32,6 +32,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.command.util.CreatureButcher; import com.sk89q.worldedit.command.util.EntityRemover; import com.sk89q.worldedit.entity.Entity; @@ -65,7 +66,6 @@ import com.sk89q.worldedit.util.formatting.component.CommandUsageBox; import com.sk89q.worldedit.world.World; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Set; @@ -176,7 +176,7 @@ public class UtilityCommands { double radius = Math.max(0, args.getDouble(0)); we.checkMaxRadius(radius); int affected = editSession.fixLiquid( - session.getPlacementPosition(player), radius, 10, 11); + session.getPlacementPosition(player), radius, BlockTypes.FLOWING_LAVA, BlockTypes.LAVA); player.print(affected + " block(s) have been changed."); } @@ -194,7 +194,7 @@ public class UtilityCommands { double radius = Math.max(0, args.getDouble(0)); we.checkMaxRadius(radius); int affected = editSession.fixLiquid( - session.getPlacementPosition(player), radius, 8, 9); + session.getPlacementPosition(player), radius, BlockTypes.FLOWING_WATER, BlockTypes.WATER); player.print(affected + " block(s) have been changed."); } @@ -261,7 +261,7 @@ public class UtilityCommands { int size = Math.max(1, args.getInteger(1, 50)); we.checkMaxRadius(size); - int affected = editSession.removeNear(session.getPlacementPosition(player), block.getType().getLegacyId(), size); + int affected = editSession.removeNear(session.getPlacementPosition(player), block.getBlockType().getLegacyId(), size); player.print(affected + " block(s) have been removed."); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemUseParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemUseParser.java index 94e30e1b0..2ce222c5b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemUseParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemUseParser.java @@ -68,7 +68,7 @@ public class ItemUseParser extends SimpleCommand> { @Override public String toString() { - return "application of the item " + item.getType() + ":" + item.getData(); + return "application of the item " + item.getType() + ":" + item.getNbtData(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java index 7551309fe..fef394793 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java @@ -50,7 +50,7 @@ public class AreaPickaxe implements BlockTool { int ox = clicked.getBlockX(); int oy = clicked.getBlockY(); int oz = clicked.getBlockZ(); - BlockType initialType = clicked.getExtent().getBlock(clicked.toVector()).getType(); + BlockType initialType = clicked.getExtent().getBlock(clicked.toVector()).getBlockType(); if (initialType == BlockTypes.AIR) { return true; @@ -68,7 +68,7 @@ public class AreaPickaxe implements BlockTool { for (int y = oy - range; y <= oy + range; ++y) { for (int z = oz - range; z <= oz + range; ++z) { Vector pos = new Vector(x, y, z); - if (editSession.getBlock(pos).getType() != initialType) { + if (editSession.getBlock(pos).getBlockType() != initialType) { continue; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java index a329638b6..15a503859 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java @@ -67,7 +67,7 @@ public class BlockReplacer implements DoubleActionBlockTool { public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { EditSession editSession = session.createEditSession(player); targetBlock = (editSession).getBlock(clicked.toVector()); - BlockType type = targetBlock.getType().getLegacyType(); + BlockType type = targetBlock.getBlockType().getLegacyType(); if (type != null) { player.print("Replacer tool switched to: " + type.getName()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index 12e71f951..b5ea93730 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -81,7 +81,7 @@ public class FloatingTreeRemover implements BlockTool { } for (Vector blockVector : blockSet) { - final int typeId = editSession.getBlock(blockVector).getType().getLegacyId(); + final int typeId = editSession.getBlock(blockVector).getBlockType().getLegacyId(); switch (typeId) { case BlockID.LOG: case BlockID.LOG2: diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java index 25ff56c84..763bc9343 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java @@ -54,7 +54,7 @@ public class FloodFillTool implements BlockTool { public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { World world = (World) clicked.getExtent(); - BlockType initialType = world.getLazyBlock(clicked.toVector()).getType(); + BlockType initialType = world.getLazyBlock(clicked.toVector()).getBlockType(); if (initialType == BlockTypes.AIR) { return true; @@ -87,7 +87,7 @@ public class FloodFillTool implements BlockTool { visited.add(pos); - if (editSession.getBlock(pos).getType() == initialType) { + if (editSession.getBlock(pos).getBlockType() == initialType) { editSession.setBlock(pos, pattern.apply(pos)); } else { return; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index d6a64dea8..e121867b3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -55,7 +55,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo if (pos == null) return false; EditSession eS = session.createEditSession(player); try { - if (secondary.getType() == BlockTypes.AIR) { + if (secondary.getBlockType() == BlockTypes.AIR) { eS.setBlock(pos.toVector(), secondary); } else { eS.setBlock(pos.getDirection(), secondary); @@ -74,7 +74,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo if (pos == null) return false; EditSession eS = session.createEditSession(player); try { - if (primary.getType() == BlockTypes.AIR) { + if (primary.getBlockType() == BlockTypes.AIR) { eS.setBlock(pos.toVector(), primary); } else { eS.setBlock(pos.getDirection(), primary); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index 9a12f7891..ec0eb9aef 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -48,8 +48,8 @@ public class QueryTool implements BlockTool { BaseBlock block = editSession.getBlock(clicked.toVector()); player.print("\u00A79@" + clicked.toVector() + ": " + "\u00A7e" - + "#" + block.getType() + "\u00A77" + " (" - + block.getType().getId() + ") " + + "#" + block.getBlockType() + "\u00A77" + " (" + + block.getBlockType().getId() + ") " + "\u00A7f" + "[" + block.getStates().toString() + "]" + " (" + world.getBlockLightLevel(clicked.toVector()) + "/" + world.getBlockLightLevel(clicked.toVector().add(0, 1, 0)) + ")"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java index eb5ec44dd..ef3bb3f88 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java @@ -53,7 +53,7 @@ public class RecursivePickaxe implements BlockTool { public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { World world = (World) clicked.getExtent(); - BlockType initialType = world.getBlock(clicked.toVector()).getType(); + BlockType initialType = world.getBlock(clicked.toVector()).getBlockType(); if (initialType == BlockTypes.AIR) { return true; @@ -89,7 +89,7 @@ public class RecursivePickaxe implements BlockTool { visited.add(pos); - if (editSession.getBlock(pos).getType() != initialType) { + if (editSession.getBlock(pos).getBlockType() != initialType) { return; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java index edafb16c7..8dfe64bb8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java @@ -44,7 +44,7 @@ public class SinglePickaxe implements BlockTool { @Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { World world = (World) clicked.getExtent(); - final BlockType blockType = world.getLazyBlock(clicked.toVector()).getType(); + final BlockType blockType = world.getLazyBlock(clicked.toVector()).getBlockType(); if (blockType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index c84a3e985..690eb027a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -24,7 +24,6 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.ItemType; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.util.HandSide; @@ -75,10 +74,9 @@ public interface Player extends Entity, Actor { /** * Gives the player an item. * - * @param type The item id of the item to be given to the player - * @param amount How many items in the stack + * @param itemStack The item to give */ - void giveItem(int type, int amount); + void giveItem(BaseItemStack itemStack); /** * Get this actor's block bag. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index cb49a0795..6a30a2a3b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -125,7 +125,7 @@ class DefaultBlockParser extends InputParser { return blockInHand; } - blockType = blockInHand.getType(); + blockType = blockInHand.getBlockType(); blockStates = blockInHand.getStates(); } else if ("offhand".equalsIgnoreCase(typeString)) { // Get the block type from the item in the user's off hand. @@ -134,7 +134,7 @@ class DefaultBlockParser extends InputParser { return blockInHand; } - blockType = blockInHand.getType(); + blockType = blockInHand.getBlockType(); blockStates = blockInHand.getStates(); } else if ("pos1".equalsIgnoreCase(typeString)) { // Get the block type from the "primary position" @@ -150,7 +150,7 @@ class DefaultBlockParser extends InputParser { return blockInHand; } - blockType = blockInHand.getType(); + blockType = blockInHand.getBlockType(); blockStates = blockInHand.getStates(); } else { // Attempt to lookup a block from ID or name. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java index a4164421f..b146382e9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java @@ -33,45 +33,11 @@ public class DefaultItemParser extends InputParser { @Override public BaseItem parseFromInput(String input, ParserContext context) throws InputParseException { - String[] tokens = input.split(":", 3); - BaseItem item; - short damage = 0; - - try { - int id = Integer.parseInt(tokens[0]); - - // Parse metadata - if (tokens.length == 2) { - try { - damage = Short.parseShort(tokens[1]); - } catch (NumberFormatException ignored) { - throw new InputParseException("Expected '" + tokens[1] + "' to be a damage value but it's not a number"); - } - } - - item = context.requireWorld().getWorldData().getItemRegistry().createFromId(id); - } catch (NumberFormatException e) { - String name = tokens[0]; - if (input.length() >= 2) { - name += ":" + tokens[1]; - } - - // Parse metadata - if (tokens.length == 3) { - try { - damage = Short.parseShort(tokens[2]); - } catch (NumberFormatException ignored) { - throw new InputParseException("Expected '" + tokens[2] + "' to be a damage value but it's not a number"); - } - } - - item = context.requireWorld().getWorldData().getItemRegistry().createFromId(name); - } + BaseItem item = context.requireWorld().getWorldData().getItemRegistry().createFromId(input); if (item == null) { throw new InputParseException("'" + input + "' did not match any item"); } else { - item.setDamage(damage); return item; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index 322c88e29..8586d0aa4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -19,7 +19,6 @@ package com.sk89q.worldedit.extension.platform; -import com.sk89q.worldedit.NotABlockException; import com.sk89q.worldedit.PlayerDirection; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; @@ -366,9 +365,6 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException { final ItemType typeId = getItemInHand(handSide).getType(); - if (!getWorld().isValidBlockType(typeId.getLegacyId())) { - throw new NotABlockException(typeId.getId()); - } return new BaseBlock(typeId.getLegacyId()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 1654fba9e..7c5cd3119 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -65,8 +65,8 @@ class PlayerProxy extends AbstractPlayerActor { } @Override - public void giveItem(int type, int amount) { - basePlayer.giveItem(type, amount); + public void giveItem(BaseItemStack itemStack) { + basePlayer.giveItem(itemStack); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java index 11c08c183..08605952e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java @@ -34,7 +34,7 @@ import java.util.Map; public class SignCompatibilityHandler implements NBTCompatibilityHandler { @Override public boolean isAffectedBlock(BaseBlock block) { - return block.getType() == BlockTypes.SIGN || block.getType() == BlockTypes.WALL_SIGN; + return block.getBlockType() == BlockTypes.SIGN || block.getBlockType() == BlockTypes.WALL_SIGN; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index 6063ade33..3742dc7ca 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java @@ -82,8 +82,8 @@ public class BlockBagExtent extends AbstractDelegateExtent { public boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { if (blockBag != null) { BaseBlock lazyBlock = getExtent().getLazyBlock(position); - int existing = lazyBlock.getType().getLegacyId(); - final int type = block.getType().getLegacyId(); + int existing = lazyBlock.getBlockType().getLegacyId(); + final int type = block.getBlockType().getLegacyId(); if (type > 0) { try { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java index 27eb6d1f4..f9a0900f3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java @@ -19,28 +19,30 @@ package com.sk89q.worldedit.extent.inventory; +import com.sk89q.worldedit.blocks.type.ItemType; + /** * Thrown when the target inventory of a block bag is full. */ public class OutOfSpaceException extends BlockBagException { - private int id; + private ItemType type; /** * Construct the object. * - * @param id the ID of the block + * @param type the type of the block */ - public OutOfSpaceException(int id) { - this.id = id; + public OutOfSpaceException(ItemType type) { + this.type = type; } /** - * Get the ID of the block + * Get the type of the block * - * @return the id + * @return the type */ - public int getID() { - return id; + public ItemType getType() { + return this.type; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index 7b3b93391..431674249 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -94,21 +94,21 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder return super.setBlock(location, block); } - if (BlockType.shouldPlaceLast(block.getType().getLegacyId())) { + if (BlockType.shouldPlaceLast(block.getBlockType().getLegacyId())) { // Place torches, etc. last stage2.put(location.toBlockVector(), block); - return !(lazyBlock.getType() == block.getType() && lazyBlock.getData() == block.getData()); - } else if (BlockType.shouldPlaceFinal(block.getType().getLegacyId())) { + return !(lazyBlock.getBlockType() == block.getBlockType() && lazyBlock.getData() == block.getData()); + } else if (BlockType.shouldPlaceFinal(block.getBlockType().getLegacyId())) { // Place signs, reed, etc even later stage3.put(location.toBlockVector(), block); - return !(lazyBlock.getType() == block.getType() && lazyBlock.getData() == block.getData()); - } else if (BlockType.shouldPlaceLast(lazyBlock.getType().getLegacyId())) { + return !(lazyBlock.getBlockType() == block.getBlockType() && lazyBlock.getData() == block.getData()); + } else if (BlockType.shouldPlaceLast(lazyBlock.getBlockType().getLegacyId())) { // Destroy torches, etc. first super.setBlock(location, new BaseBlock(BlockTypes.AIR)); return super.setBlock(location, block); } else { stage1.put(location.toBlockVector(), block); - return !(lazyBlock.getType() == block.getType() && lazyBlock.getData() == block.getData()); + return !(lazyBlock.getBlockType() == block.getBlockType() && lazyBlock.getData() == block.getData()); } } @@ -150,7 +150,7 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder final BaseBlock baseBlock = blockTypes.get(current); - final int type = baseBlock.getType().getLegacyId(); + final int type = baseBlock.getBlockType().getLegacyId(); final int data = baseBlock.getData(); switch (type) { 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 abe9a8c7b..9eedc0aa8 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 @@ -138,7 +138,7 @@ public class BlockTransformExtent extends AbstractDelegateExtent { if (value != null && value.getData() != null) { DirectionalStateValue newValue = getNewStateValue((DirectionalState) state, transform, value.getDirection()); if (newValue != null) { - changedBlock.setState(state, newValue); + changedBlock.with(state, newValue); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index 10b09a313..90d126871 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -51,7 +51,7 @@ public class DataValidatorExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { final int y = location.getBlockY(); - final BlockType type = block.getType(); + final BlockType type = block.getBlockType(); if (y < 0 || y > world.getMaxY()) { return false; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index 8e44947c6..2b3b06281 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -54,7 +54,7 @@ public class BlockQuirkExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { BaseBlock lazyBlock = getExtent().getLazyBlock(position); - int existing = lazyBlock.getType().getLegacyId(); + int existing = lazyBlock.getBlockType().getLegacyId(); if (BlockType.isContainerBlock(existing)) { world.clearContainerBlockContents(position); // Clear the container block so that it doesn't drop items diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java index 576882ded..9f5b502ec 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java @@ -104,7 +104,7 @@ public class ExtentBlockCopy implements RegionFunction { builder.putByte("Rot", (byte) MCDirections.toRotation(newDirection)); - return new BaseBlock(state.getType(), state.getStates(), builder.build()); + return new BaseBlock(state.getState(), builder.build()); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index 068c075a6..9447de469 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -106,10 +106,10 @@ public class FloraGenerator implements RegionFunction { public boolean apply(Vector position) throws WorldEditException { BaseBlock block = editSession.getBlock(position); - if (block.getType() == BlockTypes.GRASS) { + if (block.getBlockType() == BlockTypes.GRASS) { editSession.setBlock(position.add(0, 1, 0), temperatePattern.apply(position)); return true; - } else if (block.getType() == BlockTypes.SAND) { + } else if (block.getBlockType() == BlockTypes.SAND) { editSession.setBlock(position.add(0, 1, 0), desertPattern.apply(position)); return true; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index d0ab03f0a..f5ed90db7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -51,7 +51,7 @@ public class ForestGenerator implements RegionFunction { @Override public boolean apply(Vector position) throws WorldEditException { BaseBlock block = editSession.getBlock(position); - BlockType t = block.getType(); + BlockType t = block.getBlockType(); if (t == BlockTypes.GRASS || t == BlockTypes.DIRT) { treeGenerator.generate(editSession, position.add(0, 1, 0)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index ce973c195..65117b76e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -163,7 +163,7 @@ public class GardenPatchGenerator implements RegionFunction { position = position.add(0, 1, 0); } - if (editSession.getBlock(position.add(0, -1, 0)).getType() != BlockTypes.GRASS) { + if (editSession.getBlock(position.add(0, -1, 0)).getBlockType() != BlockTypes.GRASS) { return false; } 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 4ffbea7bf..533adc2eb 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 @@ -95,7 +95,7 @@ public class BlockMask extends AbstractExtentMask { @Override public boolean test(Vector vector) { BaseBlock block = getExtent().getBlock(vector); - return blocks.contains(block) || blocks.contains(new BaseBlock(block.getType())); + return blocks.contains(block) || blocks.contains(new BaseBlock(block.getBlockType())); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java index 0b0fc603f..c018ed0a0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java @@ -41,7 +41,7 @@ public class FuzzyBlockMask extends BlockMask { Extent extent = getExtent(); Collection blocks = getBlocks(); BaseBlock lazyBlock = extent.getLazyBlock(vector); - BaseBlock compare = new BaseBlock(lazyBlock.getType(), lazyBlock.getStates()); + BaseBlock compare = new BaseBlock(lazyBlock.getState()); return Blocks.containsFuzzy(blocks, compare); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java index 5c08cd963..bb755a889 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java @@ -36,7 +36,7 @@ public class SolidBlockMask extends AbstractExtentMask { public boolean test(Vector vector) { Extent extent = getExtent(); BaseBlock lazyBlock = extent.getLazyBlock(vector); - return !BlockType.canPassThrough(lazyBlock.getType().getLegacyId(), lazyBlock.getData()); + return !BlockType.canPassThrough(lazyBlock.getBlockType().getLegacyId(), lazyBlock.getData()); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index 45c85a99a..693cefe7f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -148,8 +148,8 @@ public class HeightMap { BaseBlock existing = session.getBlock(new Vector(xr, curHeight, zr)); // Skip water/lava - if (existing.getType() != BlockTypes.WATER && existing.getType() != BlockTypes.FLOWING_WATER - && existing.getType() != BlockTypes.LAVA && existing.getType() != BlockTypes.FLOWING_LAVA) { + if (existing.getBlockType() != BlockTypes.WATER && existing.getBlockType() != BlockTypes.FLOWING_WATER + && existing.getBlockType() != BlockTypes.LAVA && existing.getBlockType() != BlockTypes.FLOWING_LAVA) { session.setBlock(new Vector(xr, newHeight, zr), existing); ++blocksChanged; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java index e9da33d08..b2a6023e2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java @@ -99,7 +99,7 @@ public abstract class ArbitraryShape { return null; } - short newCacheEntry = (short) (material.getType().getLegacyId() | ((material.getData() + 1) << 8)); + short newCacheEntry = (short) (material.getBlockType().getLegacyId() | ((material.getData() + 1) << 8)); if (newCacheEntry == 0) { // type and data 0 newCacheEntry = -2; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java index eb95be7eb..f25d9e4d9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java @@ -103,7 +103,7 @@ public class TargetBlock { boolean searchForLastBlock = true; Location lastBlock = null; while (getNextBlock() != null) { - if (world.getLazyBlock(getCurrentBlock().toVector()).getType() == BlockTypes.AIR) { + if (world.getLazyBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) { if (searchForLastBlock) { lastBlock = getCurrentBlock(); if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= world.getMaxY()) { @@ -125,7 +125,7 @@ public class TargetBlock { * @return Block */ public Location getTargetBlock() { - while (getNextBlock() != null && world.getLazyBlock(getCurrentBlock().toVector()).getType() == BlockTypes.AIR) ; + while (getNextBlock() != null && world.getLazyBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) ; return getCurrentBlock(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index 44ca7d2e8..96fe3601e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -20,8 +20,6 @@ package com.sk89q.worldedit.world; import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; @@ -34,7 +32,6 @@ import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.util.Direction; -import com.sk89q.worldedit.util.TreeGenerator.TreeType; import java.util.PriorityQueue; @@ -53,32 +50,6 @@ public abstract class AbstractWorld implements World { return false; } - @Override - public final boolean setBlockType(Vector position, int type) { - try { - return setBlock(position, new BaseBlock(type)); - } catch (WorldEditException ignored) { - return false; - } - } - - @Override - public final void setBlockData(Vector position, int data) { - try { - setBlock(position, new BaseBlock(getLazyBlock(position).getType().getLegacyId(), data)); - } catch (WorldEditException ignored) { - } - } - - @Override - public final boolean setTypeIdAndData(Vector position, int type, int data) { - try { - return setBlock(position, new BaseBlock(type, data)); - } catch (WorldEditException ignored) { - return false; - } - } - @Override public final boolean setBlock(Vector pt, BaseBlock block) throws WorldEditException { return setBlock(pt, block, true); @@ -89,17 +60,6 @@ public abstract class AbstractWorld implements World { return getMaximumPoint().getBlockY(); } - @Override - public boolean isValidBlockType(int type) { - return BlockType.fromID(type) != null; - } - - @Override - public boolean usesBlockData(int type) { - // We future proof here by assuming all unknown blocks use data - return BlockType.usesData(type) || BlockType.fromID(type) == null; - } - @Override public Mask createLiquidMask() { return new BlockMask(this, @@ -124,7 +84,7 @@ public abstract class AbstractWorld implements World { if (stack != null) { final int amount = stack.getAmount(); if (amount > 1) { - dropItem(pt, new BaseItemStack(stack.getType(), 1, stack.getData()), amount); + dropItem(pt, new BaseItemStack(stack.getType(), stack.getNbtData(), 1), amount); } else { dropItem(pt, stack, amount); } @@ -137,31 +97,6 @@ public abstract class AbstractWorld implements World { } } - @Override - public boolean generateTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return generateTree(TreeType.TREE, editSession, pt); - } - - @Override - public boolean generateBigTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return generateTree(TreeType.BIG_TREE, editSession, pt); - } - - @Override - public boolean generateBirchTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return generateTree(TreeType.BIRCH, editSession, pt); - } - - @Override - public boolean generateRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return generateTree(TreeType.REDWOOD, editSession, pt); - } - - @Override - public boolean generateTallRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException { - return generateTree(TreeType.TALL_REDWOOD, editSession, pt); - } - @Override public void checkLoadedChunk(Vector pt) { } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index 3e2b2e0ea..3cebd9817 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -34,7 +34,6 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.TreeGenerator; -import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.registry.WorldData; /** @@ -56,24 +55,6 @@ public interface World extends Extent { */ int getMaxY(); - /** - * Checks whether the given block ID is a valid block ID. - * - * @param id the block ID - * @return true if the block ID is a valid one - */ - @Deprecated - boolean isValidBlockType(int id); - - /** - * Checks whether the given block ID uses data values for differentiating - * types of blocks. - * - * @param id the block ID - * @return true if the block uses data values - */ - boolean usesBlockData(int id); - /** * Create a mask that matches all liquids. * @@ -113,24 +94,6 @@ public interface World extends Extent { */ boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException; - /** - * @deprecated Use {@link #setBlock(Vector, BaseBlock)} - */ - @Deprecated - boolean setBlockType(Vector position, int type); - - /** - * @deprecated Use {@link #setBlock(Vector, BaseBlock)} - */ - @Deprecated - void setBlockData(Vector position, int data); - - /** - * @deprecated Use {@link #setBlock(Vector, BaseBlock)} - */ - @Deprecated - boolean setTypeIdAndData(Vector position, int type, int data); - /** * Get the light level at the given block. * @@ -192,36 +155,6 @@ public interface World extends Extent { */ boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Vector position) throws MaxChangedBlocksException; - /** - * @deprecated Use {@link #generateTree(TreeType, EditSession, Vector)} - */ - @Deprecated - boolean generateTree(EditSession editSession, Vector position) throws MaxChangedBlocksException; - - /** - * @deprecated Use {@link #generateTree(TreeType, EditSession, Vector)} - */ - @Deprecated - boolean generateBigTree(EditSession editSession, Vector position) throws MaxChangedBlocksException; - - /** - * @deprecated Use {@link #generateTree(TreeType, EditSession, Vector)} - */ - @Deprecated - boolean generateBirchTree(EditSession editSession, Vector position) throws MaxChangedBlocksException; - - /** - * @deprecated Use {@link #generateTree(TreeType, EditSession, Vector)} - */ - @Deprecated - boolean generateRedwoodTree(EditSession editSession, Vector position) throws MaxChangedBlocksException; - - /** - * @deprecated Use {@link #generateTree(TreeType, EditSession, Vector)} - */ - @Deprecated - boolean generateTallRedwoodTree(EditSession editSession, Vector position) throws MaxChangedBlocksException; - /** * Load the chunk at the given position if it isn't loaded. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java index 87ec424aa..36046193f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java @@ -118,8 +118,7 @@ public class AnvilChunk implements Chunk { } } - @Override - public int getBlockID(Vector position) throws DataException { + private int getBlockID(Vector position) throws DataException { int x = position.getBlockX() - rootX * 16; int y = position.getBlockY(); int z = position.getBlockZ() - rootZ * 16; @@ -130,9 +129,6 @@ public class AnvilChunk implements Chunk { } int yindex = y & 0x0F; - if (yindex < 0 || yindex >= 16) { - throw new DataException("Chunk does not contain position " + position); - } int index = x + (z * 16 + (yindex * 16 * 16)); @@ -155,8 +151,7 @@ public class AnvilChunk implements Chunk { } } - @Override - public int getBlockData(Vector position) throws DataException { + private int getBlockData(Vector position) throws DataException { int x = position.getBlockX() - rootX * 16; int y = position.getBlockY(); int z = position.getBlockZ() - rootZ * 16; @@ -167,10 +162,6 @@ public class AnvilChunk implements Chunk { if (section < 0 || section >= blocks.length) { throw new DataException("Chunk does not contain position " + position); } - - if (yIndex < 0 || yIndex >= 16) { - throw new DataException("Chunk does not contain position " + position); - } int index = x + (z * 16 + (yIndex * 16 * 16)); boolean shift = index % 2 == 0; @@ -200,8 +191,7 @@ public class AnvilChunk implements Chunk { for (Tag tag : tags) { if (!(tag instanceof CompoundTag)) { - throw new InvalidFormatException( - "CompoundTag expected in TileEntities"); + throw new InvalidFormatException("CompoundTag expected in TileEntities"); } CompoundTag t = (CompoundTag) tag; @@ -268,21 +258,7 @@ public class AnvilChunk implements Chunk { int data = getBlockData(position); BaseBlock block; - /*if (id == BlockID.WALL_SIGN || id == BlockID.SIGN_POST) { - block = new SignBlock(id, data); - } else if (id == BlockID.CHEST) { - block = new ChestBlock(data); - } else if (id == BlockID.FURNACE || id == BlockID.BURNING_FURNACE) { - block = new FurnaceBlock(id, data); - } else if (id == BlockID.DISPENSER) { - block = new DispenserBlock(data); - } else if (id == BlockID.MOB_SPAWNER) { - block = new MobSpawnerBlock(data); - } else if (id == BlockID.NOTE_BLOCK) { - block = new NoteBlock(data); - } else {*/ - block = new BaseBlock(id, data); - //} + block = new BaseBlock(id, data); CompoundTag tileEntity = getBlockTileEntity(position); if (tileEntity != null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/Chunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/Chunk.java index 03eff63be..7cfca5005 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/Chunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/Chunk.java @@ -27,25 +27,6 @@ import com.sk89q.worldedit.world.DataException; * A 16 by 16 block chunk. */ public interface Chunk { - - /** - * Get the block ID of a block. - * - * @param position the position of the block - * @return the type ID of the block - * @throws DataException thrown on data error - */ - public int getBlockID(Vector position) throws DataException; - - /** - * Get the block data of a block. - * - * @param position the position of the block - * @return the data value of the block - * @throws DataException thrown on data error - */ - public int getBlockData(Vector position) throws DataException; - /** * Get a block; @@ -54,6 +35,6 @@ public interface Chunk { * @return block the block * @throws DataException thrown on data error */ - public BaseBlock getBlock(Vector position) throws DataException; + BaseBlock getBlock(Vector position) throws DataException; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java index b2e35d3bc..188341e35 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java @@ -28,6 +28,7 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.storage.InvalidFormatException; @@ -76,43 +77,6 @@ public class OldChunk implements Chunk { } } - @Override - public int getBlockID(Vector position) throws DataException { - if(position.getBlockY() >= 128) return 0; - - int x = position.getBlockX() - rootX * 16; - int y = position.getBlockY(); - int z = position.getBlockZ() - rootZ * 16; - int index = y + (z * 128 + (x * 128 * 16)); - try { - return blocks[index]; - } catch (IndexOutOfBoundsException e) { - throw new DataException("Chunk does not contain position " + position); - } - } - - @Override - public int getBlockData(Vector position) throws DataException { - if(position.getBlockY() >= 128) return 0; - - int x = position.getBlockX() - rootX * 16; - int y = position.getBlockY(); - int z = position.getBlockZ() - rootZ * 16; - int index = y + (z * 128 + (x * 128 * 16)); - boolean shift = index % 2 == 0; - index /= 2; - - try { - if (!shift) { - return (data[index] & 0xF0) >> 4; - } else { - return data[index] & 0xF; - } - } catch (IndexOutOfBoundsException e) { - throw new DataException("Chunk does not contain position " + position); - } - } - /** * Used to load the tile entities. * @@ -188,25 +152,33 @@ public class OldChunk implements Chunk { @Override public BaseBlock getBlock(Vector position) throws DataException { - int id = getBlockID(position); - int data = getBlockData(position); - BaseBlock block; + if(position.getBlockY() >= 128) new BaseBlock(BlockTypes.AIR); + int id, dataVal; - /*if (id == BlockID.WALL_SIGN || id == BlockID.SIGN_POST) { - block = new SignBlock(id, data); - } else if (id == BlockID.CHEST) { - block = new ChestBlock(data); - } else if (id == BlockID.FURNACE || id == BlockID.BURNING_FURNACE) { - block = new FurnaceBlock(id, data); - } else if (id == BlockID.DISPENSER) { - block = new DispenserBlock(data); - } else if (id == BlockID.MOB_SPAWNER) { - block = new MobSpawnerBlock(data); - } else if (id == BlockID.NOTE_BLOCK) { - block = new NoteBlock(data); - } else {*/ - block = new BaseBlock(id, data); - //} + int x = position.getBlockX() - rootX * 16; + int y = position.getBlockY(); + int z = position.getBlockZ() - rootZ * 16; + int index = y + (z * 128 + (x * 128 * 16)); + try { + id = blocks[index]; + } catch (IndexOutOfBoundsException e) { + throw new DataException("Chunk does not contain position " + position); + } + + boolean shift = index % 2 == 0; + index /= 2; + + try { + if (!shift) { + dataVal = (data[index] & 0xF0) >> 4; + } else { + dataVal = data[index] & 0xF; + } + } catch (IndexOutOfBoundsException e) { + throw new DataException("Chunk does not contain position " + position); + } + + BaseBlock block = new BaseBlock(id, dataVal); CompoundTag tileEntity = getBlockTileEntity(position); if (tileEntity != null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 5979a164b..864b36daa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -53,13 +53,13 @@ public class BundledBlockRegistry implements BlockRegistry { @Nullable @Override public BlockMaterial getMaterial(BaseBlock block) { - return BundledBlockData.getInstance().getMaterialById(block.getType().getId()); + return BundledBlockData.getInstance().getMaterialById(block.getBlockType().getId()); } @Nullable @Override public Map getStates(BaseBlock block) { - return BundledBlockData.getInstance().getStatesById(block.getType().getId()); + return BundledBlockData.getInstance().getStatesById(block.getBlockType().getId()); } } diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java index 83000503c..70e795a2f 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java @@ -72,7 +72,7 @@ public class BlockTransformExtentTest { BaseBlock orig = new BaseBlock(type); for (int i = 1; i < 4; i++) { BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_90, blockRegistry); - BaseBlock reference = new BaseBlock(orig.getType().getLegacyId(), BlockData.rotate90(orig.getType().getLegacyId(), orig.getData())); + BaseBlock reference = new BaseBlock(orig.getBlockType().getLegacyId(), BlockData.rotate90(orig.getBlockType().getLegacyId(), orig.getData())); assertThat(type + "#" + type.getId() + " rotated " + (90 * i) + " degrees did not match BlockData.rotate90()'s expected result", rotated, equalTo(reference)); orig = rotated; @@ -81,7 +81,7 @@ public class BlockTransformExtentTest { orig = new BaseBlock(type); for (int i = 0; i < 4; i++) { BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_NEG_90, blockRegistry); - BaseBlock reference = new BaseBlock(orig.getType().getLegacyId(), BlockData.rotate90Reverse(orig.getType().getLegacyId(), orig.getData())); + BaseBlock reference = new BaseBlock(orig.getBlockType().getLegacyId(), BlockData.rotate90Reverse(orig.getBlockType().getLegacyId(), orig.getData())); assertThat(type + "#" + type.getId() + " rotated " + (-90 * i) + " degrees did not match BlockData.rotate90Reverse()'s expected result", rotated, equalTo(reference)); orig = rotated; } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java index 83222c029..713297e02 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.blocks.BaseItem; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.world.registry.ItemRegistry; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; @@ -31,7 +32,7 @@ public class ForgeItemRegistry implements ItemRegistry { public BaseItem createFromId(String id) { Item match = Item.REGISTRY.getObject(new ResourceLocation(id)); if (match != null) { - return new BaseItem(Item.REGISTRY.getIDForObject(match), (short) 0); + return new BaseItem(ItemTypes.getItemType(id)); } else { return null; } @@ -41,7 +42,7 @@ public class ForgeItemRegistry implements ItemRegistry { @Override public BaseItem createFromId(int id) { if (Item.REGISTRY.getObjectById(id) != null) { - return new BaseItem(id, (short) 0); + return new BaseItem(id); } else { return null; } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index 96fc95fbf..9fa198403 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -91,8 +91,9 @@ public class ForgePlayer extends AbstractPlayerActor { } @Override - public void giveItem(int type, int amt) { - this.player.inventory.addItemStackToInventory(new ItemStack(Item.getItemById(type), amt, 0)); + public void giveItem(BaseItemStack itemStack) { + this.player.inventory.addItemStackToInventory( + new ItemStack(Item.getByNameOrId(itemStack.getType().getId()), itemStack.getAmount(), 0)); } @Override diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index d2ceafd44..5984a330a 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -238,7 +238,12 @@ public class ForgeWorld extends AbstractWorld { @Override public boolean useItem(Vector position, BaseItem item, Direction face) { Item nativeItem = Item.getByNameOrId(item.getType().getId()); - ItemStack stack = new ItemStack(nativeItem, 1, item.getData()); + ItemStack stack = null; + if (item.getNbtData() == null) { + stack = new ItemStack(nativeItem, 1, 0); + } else { + stack = new ItemStack(nativeItem, 1, 0, NBTConverter.toNative(item.getNbtData())); + } World world = getWorld(); EnumActionResult used = stack.onItemUse(new WorldEditFakePlayer((WorldServer) world), world, ForgeAdapter.toBlockPos(position), EnumHand.MAIN_HAND, ForgeAdapter.adapt(face), 0, 0, 0); @@ -333,7 +338,7 @@ public class ForgeWorld extends AbstractWorld { @Override public boolean generateTree(TreeType type, EditSession editSession, Vector position) throws MaxChangedBlocksException { WorldGenerator generator = createWorldGenerator(type); - return generator != null ? generator.generate(getWorld(), random, ForgeAdapter.toBlockPos(position)) : false; + return generator != null && generator.generate(getWorld(), random, ForgeAdapter.toBlockPos(position)); } @Override @@ -341,12 +346,6 @@ public class ForgeWorld extends AbstractWorld { return ForgeWorldData.getInstance(); } - @Override - public boolean isValidBlockType(int id) { - Block block = Block.getBlockById(id); - return Block.getIdFromBlock(block) == id; - } - @Override public BaseBlock getBlock(Vector position) { World world = getWorld(); diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index 657032c5b..3b1efe7eb 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -19,9 +19,8 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.util.Location; -import net.minecraft.block.Block; -import org.apache.logging.log4j.Logger; +import static com.google.common.base.Preconditions.checkNotNull; +import static net.minecraft.block.Block.REGISTRY; import com.google.common.base.Joiner; import com.sk89q.worldedit.LocalSession; @@ -30,12 +29,12 @@ import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.event.platform.PlatformReadyEvent; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.forge.net.LeftClickAirEventMessage; - -import java.io.File; -import java.util.Map; +import com.sk89q.worldedit.util.Location; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.CommandEvent; @@ -54,9 +53,9 @@ import net.minecraftforge.fml.common.event.FMLServerStartedEvent; import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; import net.minecraftforge.fml.common.eventhandler.Event.Result; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.apache.logging.log4j.Logger; -import static com.google.common.base.Preconditions.checkNotNull; -import static net.minecraft.block.Block.REGISTRY; +import java.io.File; /** * The Forge implementation of WorldEdit. @@ -214,12 +213,11 @@ public class ForgeWorldEdit { } public static ItemStack toForgeItemStack(BaseItemStack item) { - ItemStack ret = new ItemStack(Item.getByNameOrId(item.getType().getId()), item.getAmount(), item.getData()); - for (Map.Entry entry : item.getEnchantments().entrySet()) { - ret.addEnchantment(net.minecraft.enchantment.Enchantment.getEnchantmentByID(entry.getKey()), entry.getValue()); + NBTTagCompound forgeCompound = null; + if (item.getNbtData() != null) { + forgeCompound = NBTConverter.toNative(item.getNbtData()); } - - return ret; + return new ItemStack(Item.getByNameOrId(item.getType().getId()), item.getAmount(), 0, forgeCompound); } /** diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index 07e15825d..d471f09b6 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -31,8 +31,10 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; +import org.spongepowered.api.Sponge; import org.spongepowered.api.data.type.HandTypes; import org.spongepowered.api.entity.living.player.Player; +import org.spongepowered.api.item.ItemType; import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.format.TextColor; @@ -91,8 +93,11 @@ public class SpongePlayer extends AbstractPlayerActor { } @Override - public void giveItem(int type, int amt) { - this.player.getInventory().offer(ItemStack.of(SpongeWorldEdit.inst().getAdapter().resolveItem(type), amt)); + public void giveItem(BaseItemStack itemStack) { + this.player.getInventory().offer( + ItemStack.of(Sponge.getGame().getRegistry().getType(ItemType.class, itemStack.getType().getId()).get(), + itemStack.getAmount()) + ); } @Override diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index 3ad40ae59..4586b0bb6 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -202,11 +202,6 @@ public abstract class SpongeWorld extends AbstractWorld { return SpongeWorldData.getInstance(); } - @Override - public boolean isValidBlockType(int id) { - return id == 0 || SpongeWorldEdit.inst().getAdapter().resolveBlock(id) != null; - } - @Override public int hashCode() { return getWorld().hashCode(); @@ -220,7 +215,7 @@ public abstract class SpongeWorld extends AbstractWorld { SpongeWorld other = ((SpongeWorld) o); World otherWorld = other.worldRef.get(); World thisWorld = worldRef.get(); - return otherWorld != null && thisWorld != null && otherWorld.equals(thisWorld); + return otherWorld != null && otherWorld.equals(thisWorld); } else { return o instanceof com.sk89q.worldedit.world.World && ((com.sk89q.worldedit.world.World) o).getName().equals(getName()); From 484687a49d25c857f5109d27cdb60aabea75b997 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 18 Jun 2018 22:51:21 +1000 Subject: [PATCH 19/74] Further work on BlockState transition --- .../sk89q/worldedit/bukkit/BukkitWorld.java | 54 +- .../EditSessionBlockChangeDelegate.java | 4 +- .../bukkit/adapter/BukkitImplAdapter.java | 3 +- .../com/sk89q/worldedit/blocks/LazyBlock.java | 2 +- .../com/sk89q/worldedit/CuboidClipboard.java | 287 +- .../java/com/sk89q/worldedit/EditSession.java | 63 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 61 +- .../com/sk89q/worldedit/blocks/BaseItem.java | 3 + .../com/sk89q/worldedit/blocks/BlockType.java | 9 +- .../com/sk89q/worldedit/blocks/Blocks.java | 6 +- .../worldedit/blocks/type/BlockState.java | 29 + .../blocks/type/BlockStateHolder.java | 8 + .../worldedit/command/SelectionCommands.java | 7 +- .../sk89q/worldedit/command/ToolCommands.java | 7 +- .../worldedit/command/UtilityCommands.java | 10 +- .../worldedit/command/tool/BlockReplacer.java | 10 +- .../command/tool/LongRangeBuildTool.java | 7 +- .../worldedit/command/tool/QueryTool.java | 3 +- .../command/tool/brush/GravityBrush.java | 9 +- .../extension/factory/BlockFactory.java | 7 +- .../extension/factory/DefaultBlockParser.java | 24 +- .../factory/RandomPatternParser.java | 3 +- .../platform/AbstractPlayerActor.java | 29 +- .../extent/AbstractDelegateExtent.java | 14 +- .../worldedit/extent/ChangeSetExtent.java | 5 +- .../sk89q/worldedit/extent/InputExtent.java | 23 +- .../sk89q/worldedit/extent/MaskingExtent.java | 3 +- .../sk89q/worldedit/extent/NullExtent.java | 18 +- .../sk89q/worldedit/extent/OutputExtent.java | 8 +- .../extent/buffer/ForgetfulExtentBuffer.java | 17 +- .../extent/cache/LastAccessExtentCache.java | 9 +- .../extent/clipboard/BlockArrayClipboard.java | 48 +- .../extent/clipboard/io/ClipboardFormat.java | 5 +- .../extent/clipboard/io/SchematicWriter.java | 218 - .../extent/inventory/BlockBagExtent.java | 3 +- .../extent/logging/AbstractLoggingExtent.java | 57 - .../extent/reorder/MultiStageReorder.java | 41 +- .../transform/BlockTransformExtent.java | 22 +- .../extent/validation/BlockChangeLimiter.java | 3 +- .../validation/DataValidatorExtent.java | 12 +- .../extent/world/BlockQuirkExtent.java | 3 +- .../extent/world/ChunkLoadingExtent.java | 3 +- .../extent/world/FastModeExtent.java | 3 +- .../extent/world/SurvivalModeExtent.java | 6 +- .../function/block/ExtentBlockCopy.java | 3 +- .../function/generator/FloraGenerator.java | 3 +- .../function/generator/ForestGenerator.java | 3 +- .../generator/GardenPatchGenerator.java | 20 +- .../worldedit/function/mask/BlockMask.java | 18 +- .../function/mask/FuzzyBlockMask.java | 11 +- .../operation/BlockMapEntryPlacer.java | 7 +- .../function/pattern/BlockPattern.java | 11 +- .../function/pattern/ClipboardPattern.java | 3 +- .../worldedit/function/pattern/Pattern.java | 7 +- .../function/pattern/RandomPattern.java | 3 +- .../pattern/RepeatingExtentPattern.java | 3 +- .../worldedit/history/change/BlockChange.java | 11 +- .../changeset/BlockOptimizedHistory.java | 7 +- .../internal/command/WorldEditBinding.java | 3 +- .../worldedit/math/convolution/HeightMap.java | 3 +- .../regions/shape/ArbitraryShape.java | 125 +- .../worldedit/regions/shape/RegionShape.java | 3 +- .../schematic/MCEditSchematicFormat.java | 91 +- .../scripting/CraftScriptContext.java | 7 +- .../util/PropertiesConfiguration.java | 9 + .../sk89q/worldedit/util/TreeGenerator.java | 2 +- .../worldedit/util/YAMLConfiguration.java | 9 + .../sk89q/worldedit/world/AbstractWorld.java | 13 +- .../com/sk89q/worldedit/world/NullWorld.java | 18 +- .../java/com/sk89q/worldedit/world/World.java | 7 +- .../world/registry/BlockRegistry.java | 8 +- .../world/registry/BundledBlockRegistry.java | 10 +- .../worldedit/world/registry/blocks.json | 11255 ++++------------ .../com/sk89q/worldedit/forge/ForgeWorld.java | 43 +- .../sk89q/worldedit/sponge/SpongeWorld.java | 29 +- .../config/ConfigurateConfiguration.java | 10 + 76 files changed, 2911 insertions(+), 10010 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/extent/logging/AbstractLoggingExtent.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 36871447f..df412f695 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -30,15 +30,18 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.WorldData; import org.bukkit.Effect; -import org.bukkit.Material; import org.bukkit.TreeType; import org.bukkit.World; import org.bukkit.block.Biome; @@ -167,7 +170,7 @@ public class BukkitWorld extends AbstractWorld { for (int z = 0; z < 16; ++z) { Vector pt = min.add(x, y, z); int index = y * 16 * 16 + z * 16 + x; - history[index] = editSession.getBlock(pt); + history[index] = editSession.getFullBlock(pt); } } } @@ -190,7 +193,7 @@ public class BukkitWorld extends AbstractWorld { editSession.smartSetBlock(pt, history[index]); } else { // Otherwise fool with history editSession.rememberChange(pt, history[index], - editSession.rawGetBlock(pt)); + editSession.getFullBlock(pt)); } } } @@ -362,7 +365,32 @@ public class BukkitWorld extends AbstractWorld { } @Override - public BaseBlock getBlock(Vector position) { + public com.sk89q.worldedit.blocks.type.BlockState getBlock(Vector position) { + Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); + BlockType blockType = BlockTypes.getBlockType(BundledBlockData.getInstance().fromLegacyId(bukkitBlock.getTypeId())); + return blockType.getDefaultState(); // TODO Data + } + + @Override + public boolean setBlock(Vector position, BlockStateHolder block, boolean notifyAndLight) throws WorldEditException { + BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); + if (adapter != null) { + return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight); + } else { + Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); + return bukkitBlock.setTypeIdAndData(block.getBlockType().getLegacyId(), (byte) 0, notifyAndLight); // TODO Data + } + } + + @Override + public LazyBlock getLazyBlock(Vector position) { + World world = getWorld(); + Block bukkitBlock = world.getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); + return new LazyBlock(bukkitBlock.getTypeId(), bukkitBlock.getData(), this, position); + } + + @Override + public BaseBlock getFullBlock(Vector position) { BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); if (adapter != null) { return adapter.getBlock(BukkitAdapter.adapt(getWorld(), position)); @@ -372,24 +400,6 @@ public class BukkitWorld extends AbstractWorld { } } - @Override - public boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException { - BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); - if (adapter != null) { - return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight); - } else { - Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - return bukkitBlock.setTypeIdAndData(block.getBlockType().getLegacyId(), (byte) block.getData(), notifyAndLight); - } - } - - @Override - public BaseBlock getLazyBlock(Vector position) { - World world = getWorld(); - Block bukkitBlock = world.getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - return new LazyBlock(bukkitBlock.getTypeId(), bukkitBlock.getData(), this, position); - } - @Override public BaseBiome getBiome(Vector2D position) { BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java index 8eeb38e55..04de1794d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java @@ -68,7 +68,7 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { @Override public int getTypeId(int x, int y, int z) { - return editSession.getBlock(new Vector(x, y, z)).getId(); + return editSession.getBlock(new Vector(x, y, z)).getBlockType().getLegacyId(); } @Override @@ -78,7 +78,7 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { @Override public boolean isEmpty(int x, int y, int z) { - return editSession.getBlock(new Vector(x, y, z)).isAir(); + return editSession.getBlock(new Vector(x, y, z)).getBlockType() == BlockTypes.AIR; } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 04113a6d5..0431c690a 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.bukkit.adapter; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import org.bukkit.Location; import org.bukkit.Material; @@ -89,7 +90,7 @@ public interface BukkitImplAdapter { * @param notifyAndLight notify and light if set * @return true if a block was likely changed */ - boolean setBlock(Location location, BaseBlock state, boolean notifyAndLight); + boolean setBlock(Location location, BlockStateHolder state, boolean notifyAndLight); /** * Get the state for the given entity. diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java index fe7dee50a..4d68ddec0 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java @@ -95,7 +95,7 @@ public class LazyBlock extends BaseBlock { @Override public CompoundTag getNbtData() { if (!loaded) { - BaseBlock loadedBlock = extent.getBlock(position); + BaseBlock loadedBlock = extent.getFullBlock(position); super.setNbtData(loadedBlock.getNbtData()); loaded = true; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java index 71e3cc370..183a5d720 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java @@ -19,8 +19,11 @@ package com.sk89q.worldedit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.command.ClipboardCommands; import com.sk89q.worldedit.command.SchematicCommands; import com.sk89q.worldedit.entity.Entity; @@ -30,18 +33,12 @@ import com.sk89q.worldedit.function.operation.ForwardExtentCopy; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.schematic.SchematicFormat; -import com.sk89q.worldedit.util.Countable; import com.sk89q.worldedit.world.DataException; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; - -import static com.google.common.base.Preconditions.checkNotNull; /** * The clipboard remembers the state of a cuboid region. @@ -71,7 +68,7 @@ public class CuboidClipboard { UP_DOWN } - private BaseBlock[][][] data; + private BlockStateHolder[][][] data; private Vector offset; private Vector origin; private Vector size; @@ -154,186 +151,6 @@ public class CuboidClipboard { return size.getBlockY(); } - /** - * Rotate the clipboard in 2D. It can only rotate by angles divisible by 90. - * - * @param angle in degrees - */ - public void rotate2D(int angle) { - angle = angle % 360; - if (angle % 90 != 0) { // Can only rotate 90 degrees at the moment - return; - } - final boolean reverse = angle < 0; - final int numRotations = Math.abs((int) Math.floor(angle / 90.0)); - - final int width = getWidth(); - final int length = getLength(); - final int height = getHeight(); - final Vector sizeRotated = size.transform2D(angle, 0, 0, 0, 0); - final int shiftX = sizeRotated.getX() < 0 ? -sizeRotated.getBlockX() - 1 : 0; - final int shiftZ = sizeRotated.getZ() < 0 ? -sizeRotated.getBlockZ() - 1 : 0; - - final BaseBlock[][][] newData = new BaseBlock - [Math.abs(sizeRotated.getBlockX())] - [Math.abs(sizeRotated.getBlockY())] - [Math.abs(sizeRotated.getBlockZ())]; - - for (int x = 0; x < width; ++x) { - for (int z = 0; z < length; ++z) { - final Vector2D v = new Vector2D(x, z).transform2D(angle, 0, 0, shiftX, shiftZ); - final int newX = v.getBlockX(); - final int newZ = v.getBlockZ(); - for (int y = 0; y < height; ++y) { - final BaseBlock block = data[x][y][z]; - newData[newX][y][newZ] = block; - - if (block == null) { - continue; - } - - if (reverse) { - for (int i = 0; i < numRotations; ++i) { - block.rotate90Reverse(); - } - } else { - for (int i = 0; i < numRotations; ++i) { - block.rotate90(); - } - } - } - } - } - - data = newData; - size = new Vector(Math.abs(sizeRotated.getBlockX()), - Math.abs(sizeRotated.getBlockY()), - Math.abs(sizeRotated.getBlockZ())); - offset = offset.transform2D(angle, 0, 0, 0, 0) - .subtract(shiftX, 0, shiftZ); - } - - /** - * Flip the clipboard. - * - * @param dir direction to flip - */ - public void flip(FlipDirection dir) { - flip(dir, false); - } - - /** - * Flip the clipboard. - * - * @param dir direction to flip - * @param aroundPlayer flip the offset around the player - */ - public void flip(FlipDirection dir, boolean aroundPlayer) { - checkNotNull(dir); - - final int width = getWidth(); - final int length = getLength(); - final int height = getHeight(); - - switch (dir) { - case WEST_EAST: - final int wid = (int) Math.ceil(width / 2.0f); - for (int xs = 0; xs < wid; ++xs) { - for (int z = 0; z < length; ++z) { - for (int y = 0; y < height; ++y) { - final BaseBlock block1 = data[xs][y][z]; - if (block1 != null) { - block1.flip(dir); - } - - // Skip the center plane - if (xs == width - xs - 1) { - continue; - } - - final BaseBlock block2 = data[width - xs - 1][y][z]; - if (block2 != null) { - block2.flip(dir); - } - - data[xs][y][z] = block2; - data[width - xs - 1][y][z] = block1; - } - } - } - - if (aroundPlayer) { - offset = offset.setX(1 - offset.getX() - width); - } - - break; - - case NORTH_SOUTH: - final int len = (int) Math.ceil(length / 2.0f); - for (int zs = 0; zs < len; ++zs) { - for (int x = 0; x < width; ++x) { - for (int y = 0; y < height; ++y) { - final BaseBlock block1 = data[x][y][zs]; - if (block1 != null) { - block1.flip(dir); - } - - // Skip the center plane - if (zs == length - zs - 1) { - continue; - } - - final BaseBlock block2 = data[x][y][length - zs - 1]; - if (block2 != null) { - block2.flip(dir); - } - - data[x][y][zs] = block2; - data[x][y][length - zs - 1] = block1; - } - } - } - - if (aroundPlayer) { - offset = offset.setZ(1 - offset.getZ() - length); - } - - break; - - case UP_DOWN: - final int hei = (int) Math.ceil(height / 2.0f); - for (int ys = 0; ys < hei; ++ys) { - for (int x = 0; x < width; ++x) { - for (int z = 0; z < length; ++z) { - final BaseBlock block1 = data[x][ys][z]; - if (block1 != null) { - block1.flip(dir); - } - - // Skip the center plane - if (ys == height - ys - 1) { - continue; - } - - final BaseBlock block2 = data[x][height - ys - 1][z]; - if (block2 != null) { - block2.flip(dir); - } - - data[x][ys][z] = block2; - data[x][height - ys - 1][z] = block1; - } - } - } - - if (aroundPlayer) { - offset = offset.setY(1 - offset.getY() - height); - } - - break; - } - } - /** * Copies blocks to the clipboard. * @@ -426,12 +243,12 @@ public class CuboidClipboard { for (int x = 0; x < size.getBlockX(); ++x) { for (int y = 0; y < size.getBlockY(); ++y) { for (int z = 0; z < size.getBlockZ(); ++z) { - final BaseBlock block = data[x][y][z]; + final BlockStateHolder block = data[x][y][z]; if (block == null) { continue; } - if (noAir && block.isAir()) { + if (noAir && block.getBlockType() == BlockTypes.AIR) { continue; } @@ -481,10 +298,10 @@ public class CuboidClipboard { * @deprecated use {@link #getBlock(Vector)} instead */ @Deprecated - public BaseBlock getPoint(Vector position) throws ArrayIndexOutOfBoundsException { - final BaseBlock block = getBlock(position); + public BlockStateHolder getPoint(Vector position) throws ArrayIndexOutOfBoundsException { + final BlockStateHolder block = getBlock(position); if (block == null) { - return new BaseBlock(BlockID.AIR); + return BlockTypes.AIR.getDefaultState(); } return block; @@ -499,7 +316,7 @@ public class CuboidClipboard { * @return null, if this block was outside the (non-cuboid) selection while copying * @throws ArrayIndexOutOfBoundsException if the position is outside the bounds of the CuboidClipboard */ - public BaseBlock getBlock(Vector position) throws ArrayIndexOutOfBoundsException { + public BlockStateHolder getBlock(Vector position) throws ArrayIndexOutOfBoundsException { return data[position.getBlockX()][position.getBlockY()][position.getBlockZ()]; } @@ -599,88 +416,6 @@ public class CuboidClipboard { this.offset = offset; } - /** - * Get the block distribution inside a clipboard. - * - * @return a block distribution - */ - public List> getBlockDistribution() { - List> distribution = new ArrayList<>(); - Map> map = new HashMap<>(); - - int maxX = getWidth(); - int maxY = getHeight(); - int maxZ = getLength(); - - for (int x = 0; x < maxX; ++x) { - for (int y = 0; y < maxY; ++y) { - for (int z = 0; z < maxZ; ++z) { - final BaseBlock block = data[x][y][z]; - if (block == null) { - continue; - } - - int id = block.getId(); - - if (map.containsKey(id)) { - map.get(id).increment(); - } else { - Countable c = new Countable<>(id, 1); - map.put(id, c); - distribution.add(c); - } - } - } - } - - Collections.sort(distribution); - // Collections.reverse(distribution); - - return distribution; - } - - /** - * Get the block distribution inside a clipboard with data values. - * - * @return a block distribution - */ - // TODO reduce code duplication - public List> getBlockDistributionWithData() { - List> distribution = new ArrayList<>(); - Map> map = new HashMap<>(); - - int maxX = getWidth(); - int maxY = getHeight(); - int maxZ = getLength(); - - for (int x = 0; x < maxX; ++x) { - for (int y = 0; y < maxY; ++y) { - for (int z = 0; z < maxZ; ++z) { - final BaseBlock block = data[x][y][z]; - if (block == null) { - continue; - } - - // Strip the block from metadata that is not part of our key - final BaseBlock bareBlock = new BaseBlock(block.getId(), block.getData()); - - if (map.containsKey(bareBlock)) { - map.get(bareBlock).increment(); - } else { - Countable c = new Countable<>(bareBlock, 1); - map.put(bareBlock, c); - distribution.add(c); - } - } - } - } - - Collections.sort(distribution); - // Collections.reverse(distribution); - - return distribution; - } - /** * Stores a copied entity. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index f5ed6c283..4287db4ff 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -22,6 +22,9 @@ package com.sk89q.worldedit; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -101,7 +104,7 @@ public class EditSession implements Extent { private static final Logger log = Logger.getLogger(EditSession.class.getCanonicalName()); /** - * Used by {@link #setBlock(Vector, BaseBlock, Stage)} to + * Used by {@link #setBlock(Vector, BlockStateHolder, Stage)} to * determine which {@link Extent}s should be bypassed. */ public enum Stage { @@ -365,25 +368,18 @@ public class EditSession implements Extent { } @Override - public BaseBlock getLazyBlock(Vector position) { + public LazyBlock getLazyBlock(Vector position) { return world.getLazyBlock(position); } @Override - public BaseBlock getBlock(Vector position) { + public BlockState getBlock(Vector position) { return world.getBlock(position); } - /** - * Gets the block type at a position. - * - * @param position the position - * @return a block - * @deprecated Use {@link #getBlock(Vector)} - */ - @Deprecated - public BaseBlock rawGetBlock(Vector position) { - return getBlock(position); + @Override + public BaseBlock getFullBlock(Vector position) { + return world.getFullBlock(position); } /** @@ -432,7 +428,7 @@ public class EditSession implements Extent { * @return whether the block changed * @throws WorldEditException thrown on a set error */ - public boolean setBlock(Vector position, BaseBlock block, Stage stage) throws WorldEditException { + public boolean setBlock(Vector position, BlockStateHolder block, Stage stage) throws WorldEditException { switch (stage) { case BEFORE_HISTORY: return bypassNone.setBlock(position, block); @@ -452,7 +448,7 @@ public class EditSession implements Extent { * @param block the block * @return whether the block changed */ - public boolean rawSetBlock(Vector position, BaseBlock block) { + public boolean rawSetBlock(Vector position, BlockStateHolder block) { try { return setBlock(position, block, Stage.BEFORE_CHANGE); } catch (WorldEditException e) { @@ -467,7 +463,7 @@ public class EditSession implements Extent { * @param block the block * @return whether the block changed */ - public boolean smartSetBlock(Vector position, BaseBlock block) { + public boolean smartSetBlock(Vector position, BlockStateHolder block) { try { return setBlock(position, block, Stage.BEFORE_REORDER); } catch (WorldEditException e) { @@ -476,7 +472,7 @@ public class EditSession implements Extent { } @Override - public boolean setBlock(Vector position, BaseBlock block) throws MaxChangedBlocksException { + public boolean setBlock(Vector position, BlockStateHolder block) throws MaxChangedBlocksException { try { return setBlock(position, block, Stage.BEFORE_HISTORY); } catch (MaxChangedBlocksException e) { @@ -606,7 +602,7 @@ public class EditSession implements Extent { * @param searchBlocks the list of blocks to search * @return the number of blocks that matched the pattern */ - public int countBlocks(Region region, Set searchBlocks) { + public int countBlocks(Region region, Set searchBlocks) { FuzzyBlockMask mask = new FuzzyBlockMask(this, searchBlocks); Counter count = new Counter(); RegionMaskingFilter filter = new RegionMaskingFilter(mask, count); @@ -626,7 +622,7 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int fillXZ(Vector origin, BaseBlock block, double radius, int depth, boolean recursive) throws MaxChangedBlocksException { + public int fillXZ(Vector origin, BlockStateHolder block, double radius, int depth, boolean recursive) throws MaxChangedBlocksException { return fillXZ(origin, new BlockPattern(block), radius, depth, recursive); } @@ -781,7 +777,7 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int replaceBlocks(Region region, Set filter, BaseBlock replacement) throws MaxChangedBlocksException { + public int replaceBlocks(Region region, Set filter, BlockStateHolder replacement) throws MaxChangedBlocksException { return replaceBlocks(region, filter, new BlockPattern(replacement)); } @@ -795,7 +791,7 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int replaceBlocks(Region region, Set filter, Pattern pattern) throws MaxChangedBlocksException { + public int replaceBlocks(Region region, Set filter, Pattern pattern) throws MaxChangedBlocksException { Mask mask = filter == null ? new ExistingBlockMask(this) : new FuzzyBlockMask(this, filter); return replaceBlocks(region, mask, pattern); } @@ -948,7 +944,7 @@ public class EditSession implements Extent { final int maxY = region.getMaximumPoint().getBlockY(); final ArbitraryShape shape = new RegionShape(region) { @Override - protected BaseBlock getMaterial(int x, int y, int z, BaseBlock defaultMaterial) { + protected BlockStateHolder getMaterial(int x, int y, int z, BlockStateHolder defaultMaterial) { if (y > maxY || y < minY) { // Put holes into the floor and ceiling by telling ArbitraryShape that the shape goes on outside the region return defaultMaterial; @@ -1647,7 +1643,7 @@ public class EditSession implements Extent { for (int z = basePosition.getBlockZ() - size; z <= basePosition.getBlockZ() + size; ++z) { // Don't want to be in the ground - if (!getBlock(new Vector(x, basePosition.getBlockY(), z)).isAir()) { + if (getBlock(new Vector(x, basePosition.getBlockY(), z)).getBlockType() != BlockTypes.AIR) { continue; } // The gods don't want a tree here @@ -1739,9 +1735,9 @@ public class EditSession implements Extent { * @return the results */ // TODO reduce code duplication - probably during ops-redux - public List> getBlockDistributionWithData(Region region) { - List> distribution = new ArrayList<>(); - Map> map = new HashMap<>(); + public List> getBlockDistributionWithData(Region region) { + List> distribution = new ArrayList<>(); + Map> map = new HashMap<>(); if (region instanceof CuboidRegion) { // Doing this for speed @@ -1760,12 +1756,12 @@ public class EditSession implements Extent { for (int z = minZ; z <= maxZ; ++z) { Vector pt = new Vector(x, y, z); - BaseBlock blk = getBlock(pt); + BlockStateHolder blk = getBlock(pt); if (map.containsKey(blk)) { map.get(blk).increment(); } else { - Countable c = new Countable<>(blk, 1); + Countable c = new Countable<>(blk, 1); map.put(blk, c); distribution.add(c); } @@ -1774,12 +1770,12 @@ public class EditSession implements Extent { } } else { for (Vector pt : region) { - BaseBlock blk = getBlock(pt); + BlockStateHolder blk = getBlock(pt); if (map.containsKey(blk)) { map.get(blk).increment(); } else { - Countable c = new Countable<>(blk, 1); + Countable c = new Countable<>(blk, 1); map.put(blk, c); } } @@ -1803,13 +1799,14 @@ public class EditSession implements Extent { final ArbitraryShape shape = new ArbitraryShape(region) { @Override - protected BaseBlock getMaterial(int x, int y, int z, BaseBlock defaultMaterial) { + protected BlockStateHolder getMaterial(int x, int y, int z, BlockStateHolder defaultMaterial) { final Vector current = new Vector(x, y, z); environment.setCurrentBlock(current); final Vector scaled = current.subtract(zero).divide(unit); try { - if (expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ(), defaultMaterial.getBlockType().getLegacyId(), defaultMaterial.getData()) <= 0) { + if (expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ(), defaultMaterial.getBlockType().getLegacyId(), 0) <= 0) { + // TODO data return null; } @@ -1847,7 +1844,7 @@ public class EditSession implements Extent { final BlockVector sourcePosition = environment.toWorld(x.getValue(), y.getValue(), z.getValue()); // read block from world - final BaseBlock material = world.getBlock(sourcePosition); + final BaseBlock material = world.getFullBlock(sourcePosition); // queue operation queue.put(position, material); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index df4f5b14a..9c5d227a7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -28,12 +28,10 @@ import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.mask.Mask; +import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.state.State; import com.sk89q.worldedit.world.registry.state.value.StateValue; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; import java.util.Map; import java.util.Objects; @@ -69,6 +67,13 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { */ @Deprecated public BaseBlock(int id) { + try { + this.blockState = BlockTypes.getBlockType(BundledBlockData.getInstance().fromLegacyId(id)).getDefaultState(); + } catch (Exception e) { + System.out.println(id); + System.out.println(BundledBlockData.getInstance().fromLegacyId(id)); + e.printStackTrace(); + } } /** @@ -108,6 +113,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { */ @Deprecated public BaseBlock(int id, int data) { + this(id); } /** @@ -119,6 +125,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { */ @Deprecated public BaseBlock(int id, int data, @Nullable CompoundTag nbtData) { + this(id); setNbtData(nbtData); } @@ -325,51 +332,9 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { * @param o other block * @return true if equal */ - public boolean equalsFuzzy(BaseBlock o) { - if (!getBlockType().equals(o.getBlockType())) { - return false; - } - - List differingStates = new ArrayList<>(); - for (State state : o.getStates().keySet()) { - if (getState(state) == null) { - differingStates.add(state); - } - } - for (State state : getStates().keySet()) { - if (o.getState(state) == null) { - differingStates.add(state); - } - } - - for (State state : differingStates) { - if (!getState(state).equals(o.getState(state))) { - return false; - } - } - - return true; - } - - /** - * @deprecated This method is silly, use {@link #containsFuzzy(java.util.Collection, BaseBlock)} instead. - */ - @Deprecated - public boolean inIterable(Iterable iter) { - for (BaseBlock block : iter) { - if (block.equalsFuzzy(this)) { - return true; - } - } - return false; - } - - /** - * @deprecated Use {@link Blocks#containsFuzzy(Collection, BaseBlock)} - */ - @Deprecated - public static boolean containsFuzzy(Collection collection, BaseBlock o) { - return Blocks.containsFuzzy(collection, o); + @Override + public boolean equalsFuzzy(BlockStateHolder o) { + return this.getState().equalsFuzzy(o); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java index 529d5829a..be35174d1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java @@ -21,7 +21,9 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.world.NbtValued; +import com.sk89q.worldedit.world.registry.BundledItemData; import javax.annotation.Nullable; @@ -44,6 +46,7 @@ public class BaseItem implements NbtValued { */ @Deprecated public BaseItem(int id) { + this(ItemTypes.getItemType(BundledItemData.getInstance().fromLegacyId(id))); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 19f09490d..871855343 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.blocks; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.PlayerDirection; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import javax.annotation.Nullable; @@ -671,9 +672,9 @@ public enum BlockType { * @param block the block * @return true if the block can be passed through */ - public static boolean canPassThrough(BaseBlock block) { + public static boolean canPassThrough(BlockStateHolder block) { checkNotNull(block); - return canPassThrough(block.getId(), block.getData()); + return canPassThrough(block.getBlockType().getLegacyId()); } /** @@ -769,9 +770,9 @@ public enum BlockType { * @param block the block * @return the y offset */ - public static double centralTopLimit(BaseBlock block) { + public static double centralTopLimit(BlockStateHolder block) { checkNotNull(block); - return centralTopLimit(block.getId(), block.getData()); + return centralTopLimit(block.getBlockType().getLegacyId(), 0); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java index c4c3c7f48..89f158745 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.blocks; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; + import java.util.Collection; /** @@ -36,9 +38,9 @@ public final class Blocks { * @param o the block * @return true if the collection contains the given block */ - public static boolean containsFuzzy(Collection collection, BaseBlock o) { + public static boolean containsFuzzy(Collection collection, BlockStateHolder o) { // Allow masked data in the searchBlocks to match various types - for (BaseBlock b : collection) { + for (BlockStateHolder b : collection) { if (b.equalsFuzzy(o)) { return true; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java index 618eeaf6f..39c48b410 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java @@ -26,8 +26,10 @@ import com.google.common.collect.Table; import com.sk89q.worldedit.world.registry.state.State; import com.sk89q.worldedit.world.registry.state.value.StateValue; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -108,6 +110,33 @@ public class BlockState implements BlockStateHolder { return Collections.unmodifiableMap(this.values); } + @Override + public boolean equalsFuzzy(BlockStateHolder o) { + if (!getBlockType().equals(o.getBlockType())) { + return false; + } + + List differingStates = new ArrayList<>(); + for (Object state : o.getStates().keySet()) { + if (getState((State) state) == null) { + differingStates.add((State) state); + } + } + for (State state : getStates().keySet()) { + if (o.getState(state) == null) { + differingStates.add(state); + } + } + + for (State state : differingStates) { + if (!getState(state).equals(o.getState(state))) { + return false; + } + } + + return true; + } + /** * Internal method used for creating the initial BlockState. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java index 9375d2915..d39d1c5d1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java @@ -56,4 +56,12 @@ public interface BlockStateHolder { * @return The states */ Map getStates(); + + /** + * Checks if the type is the same, and if the matched states are the same. + * + * @param o other block + * @return true if equal + */ + boolean equalsFuzzy(BlockStateHolder o); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 7fe95ac74..5a541c722 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -35,6 +35,7 @@ import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; @@ -639,7 +640,7 @@ public class SelectionCommands { context.setSession(session); context.setRestricted(false); - Set searchBlocks = we.getBlockFactory().parseFromListInput(args.getString(0), context); + Set searchBlocks = we.getBlockFactory().parseFromListInput(args.getString(0), context); int count = editSession.countBlocks(session.getSelection(player.getWorld()), searchBlocks); player.print("Counted: " + count); } @@ -660,7 +661,7 @@ public class SelectionCommands { public void distr(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException, CommandException { int size; - List> distributionData; + List> distributionData; if (args.hasFlag('c')) { // TODO: Update for new clipboard @@ -677,7 +678,7 @@ public class SelectionCommands { player.print("# total blocks: " + size); - for (Countable c : distributionData) { + for (Countable c : distributionData) { String name = c.getID().getBlockType().getName(); String str = String.format("%-7s (%.3f%%) %s #%s%s", String.valueOf(c.getAmount()), diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index e1419bd65..7e5956d4b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -25,6 +25,7 @@ import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.command.tool.*; @@ -109,7 +110,7 @@ public class ToolCommands { context.setRestricted(true); context.setPreferringWildcard(false); - BaseBlock targetBlock = we.getBlockFactory().parseFromInput(args.getString(0), context); + BlockStateHolder targetBlock = we.getBlockFactory().parseFromInput(args.getString(0), context); BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(itemStack.getType(), new BlockReplacer(targetBlock)); player.print("Block replacer tool bound to " + itemStack.getType().getName() + "."); @@ -207,8 +208,8 @@ public class ToolCommands { context.setRestricted(true); context.setPreferringWildcard(false); - BaseBlock secondary = we.getBlockFactory().parseFromInput(args.getString(0), context); - BaseBlock primary = we.getBlockFactory().parseFromInput(args.getString(1), context); + BlockStateHolder secondary = we.getBlockFactory().parseFromInput(args.getString(0), context); + BlockStateHolder primary = we.getBlockFactory().parseFromInput(args.getString(1), context); BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 1a79e804a..a46e803da 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.PLACEMENT; + import com.google.common.base.Joiner; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; @@ -31,7 +33,7 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.command.util.CreatureButcher; import com.sk89q.worldedit.command.util.EntityRemover; @@ -69,8 +71,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.PLACEMENT; - /** * Utility commands. */ @@ -257,7 +257,7 @@ public class UtilityCommands { context.setRestricted(false); context.setPreferringWildcard(false); - BaseBlock block = we.getBlockFactory().parseFromInput(args.getString(0), context); + BlockStateHolder block = we.getBlockFactory().parseFromInput(args.getString(0), context); int size = Math.max(1, args.getInteger(1, 50)); we.checkMaxRadius(size); @@ -279,7 +279,7 @@ public class UtilityCommands { int size = Math.max(1, args.getInteger(0)); int affected; - Set from; + Set from; Pattern to; ParserContext context = new ParserContext(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java index 15a503859..46df0b079 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; @@ -32,9 +32,9 @@ import com.sk89q.worldedit.extent.inventory.BlockBag; */ public class BlockReplacer implements DoubleActionBlockTool { - private BaseBlock targetBlock; + private BlockStateHolder targetBlock; - public BlockReplacer(BaseBlock targetBlock) { + public BlockReplacer(BlockStateHolder targetBlock) { this.targetBlock = targetBlock; } @@ -67,7 +67,7 @@ public class BlockReplacer implements DoubleActionBlockTool { public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { EditSession editSession = session.createEditSession(player); targetBlock = (editSession).getBlock(clicked.toVector()); - BlockType type = targetBlock.getBlockType().getLegacyType(); + BlockType type = targetBlock.getBlockType(); if (type != null) { player.print("Replacer tool switched to: " + type.getName()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index e121867b3..df5d9702f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; @@ -35,10 +36,10 @@ import com.sk89q.worldedit.util.Location; */ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTool { - private BaseBlock primary; - private BaseBlock secondary; + private BlockStateHolder primary; + private BlockStateHolder secondary; - public LongRangeBuildTool(BaseBlock primary, BaseBlock secondary) { + public LongRangeBuildTool(BlockStateHolder primary, BlockStateHolder secondary) { super("worldedit.tool.lrbuild"); this.primary = primary; this.secondary = secondary; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index ec0eb9aef..f4c897a51 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.MobSpawnerBlock; import com.sk89q.worldedit.blocks.NoteBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; @@ -45,7 +46,7 @@ public class QueryTool implements BlockTool { World world = (World) clicked.getExtent(); EditSession editSession = session.createEditSession(player); - BaseBlock block = editSession.getBlock(clicked.toVector()); + BlockStateHolder block = editSession.getFullBlock(clicked.toVector()); player.print("\u00A79@" + clicked.toVector() + ": " + "\u00A7e" + "#" + block.getBlockType() + "\u00A77" + " (" diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java index 0e708e064..08f3ba017 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.pattern.Pattern; @@ -43,11 +44,11 @@ public class GravityBrush implements Brush { for (double x = position.getBlockX() + size; x > position.getBlockX() - size; --x) { for (double z = position.getBlockZ() + size; z > position.getBlockZ() - size; --z) { double y = startY; - final List blockTypes = new ArrayList<>(); + final List blockTypes = new ArrayList<>(); for (; y > position.getBlockY() - size; --y) { final Vector pt = new Vector(x, y, z); - final BaseBlock block = editSession.getBlock(pt); - if (!block.isAir()) { + final BlockStateHolder block = editSession.getBlock(pt); + if (block.getBlockType() != BlockTypes.AIR) { blockTypes.add(block); editSession.setBlock(pt, air); } @@ -55,7 +56,7 @@ public class GravityBrush implements Brush { Vector pt = new Vector(x, y, z); Collections.reverse(blockTypes); for (int i = 0; i < blockTypes.size();) { - if (editSession.getBlock(pt).isAir()) { + if (editSession.getBlock(pt).getBlockType() == BlockTypes.AIR) { editSession.setBlock(pt, blockTypes.get(i++)); } pt = pt.add(0, 1, 0); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java index 2cb35aab1..406377c54 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.internal.registry.AbstractFactory; @@ -35,7 +36,7 @@ import java.util.Set; *

Instances of this class can be taken from * {@link WorldEdit#getBlockFactory()}.

*/ -public class BlockFactory extends AbstractFactory { +public class BlockFactory extends AbstractFactory { /** * Create a new instance. @@ -56,8 +57,8 @@ public class BlockFactory extends AbstractFactory { * @return a set of blocks * @throws InputParseException thrown in error with the input */ - public Set parseFromListInput(String input, ParserContext context) throws InputParseException { - Set blocks = new HashSet<>(); + public Set parseFromListInput(String input, ParserContext context) throws InputParseException { + Set blocks = new HashSet<>(); for (String token : input.split(",")) { blocks.add(parseFromInput(token, context)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 6a30a2a3b..76d0dc139 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -30,6 +30,7 @@ import com.sk89q.worldedit.blocks.SignBlock; import com.sk89q.worldedit.blocks.SkullBlock; import com.sk89q.worldedit.blocks.metadata.MobType; import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; @@ -54,7 +55,7 @@ import java.util.regex.Pattern; /** * Parses block input strings. */ -class DefaultBlockParser extends InputParser { +class DefaultBlockParser extends InputParser { protected DefaultBlockParser(WorldEdit worldEdit) { super(worldEdit); @@ -75,14 +76,14 @@ class DefaultBlockParser extends InputParser { } @Override - public BaseBlock parseFromInput(String input, ParserContext context) + public BlockStateHolder parseFromInput(String input, ParserContext context) throws InputParseException { String originalInput = input; input = input.replace("_", " "); input = input.replace(";", "|"); Exception suppressed = null; try { - BaseBlock modified = parseLogic(input, context); + BlockStateHolder modified = parseLogic(input, context); if (modified != null) { return modified; } @@ -99,22 +100,22 @@ class DefaultBlockParser extends InputParser { } } - private static Pattern blockStatePattern = Pattern.compile("([a-z:]+)(?:\\[([a-zA-Z0-9=, ]+)\\])?", Pattern.CASE_INSENSITIVE); + private static Pattern blockStatePattern = Pattern.compile("([a-z:]+)(?:\\[([a-zA-Z0-9=, ]+)])?", Pattern.CASE_INSENSITIVE); private static String[] EMPTY_STRING_ARRAY = new String[]{}; - private BaseBlock parseLogic(String input, ParserContext context) + private BlockStateHolder parseLogic(String input, ParserContext context) throws InputParseException, NoMatchException, DisallowedUsageException { BlockType blockType; Map blockStates = new HashMap<>(); - String[] blockAndExtraData = input.split("\\|"); + String[] blockAndExtraData = input.trim().split("\\|"); Matcher matcher = blockStatePattern.matcher(blockAndExtraData[0]); - if (matcher.groupCount() < 1 || matcher.groupCount() > 2) { + if (!matcher.matches() || matcher.groupCount() < 2 || matcher.groupCount() > 3) { throw new InputParseException("Invalid format"); } String typeString = matcher.group(1); String[] stateProperties = EMPTY_STRING_ARRAY; - if (matcher.groupCount() == 2) { + if (matcher.groupCount() == 3) { stateProperties = matcher.group(2).split(","); } @@ -145,10 +146,7 @@ class DefaultBlockParser extends InputParser { } catch (IncompleteRegionException e) { throw new InputParseException("Your selection is not complete."); } - final BaseBlock blockInHand = world.getBlock(primaryPosition); - if (blockInHand.getClass() != BaseBlock.class) { - return blockInHand; - } + final BlockState blockInHand = world.getBlock(primaryPosition); blockType = blockInHand.getBlockType(); blockStates = blockInHand.getStates(); @@ -239,7 +237,7 @@ class DefaultBlockParser extends InputParser { return new SkullBlock(state, type.replace(" ", "_")); // valid MC usernames } else { - return new BaseBlock(state); + return state; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java index a850b98ff..1eebb9688 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.function.pattern.BlockPattern; @@ -40,7 +41,7 @@ class RandomPatternParser extends InputParser { RandomPattern randomPattern = new RandomPattern(); for (String token : input.split(",")) { - BaseBlock block; + BlockStateHolder block; double chance; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index 8586d0aa4..245ee0503 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -23,8 +23,9 @@ import com.sk89q.worldedit.PlayerDirection; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.blocks.type.ItemType; import com.sk89q.worldedit.blocks.type.ItemTypes; @@ -110,9 +111,8 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { if (free == 2) { if (y - 1 != origY) { final Vector pos = new Vector(x, y - 2, z); - final int id = world.getBlock(pos).getId(); - final int data = world.getBlock(pos).getData(); - setPosition(new Vector(x + 0.5, y - 2 + BlockType.centralTopLimit(id, data), z + 0.5)); + final BlockState state = world.getBlock(pos); + setPosition(new Vector(x + 0.5, y - 2 + BlockType.centralTopLimit(state), z + 0.5)); } return; @@ -131,10 +131,9 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { while (y >= 0) { final Vector pos = new Vector(x, y, z); - final int id = world.getBlock(pos).getId(); - final int data = world.getBlock(pos).getData(); - if (!BlockType.canPassThrough(id, data)) { - setPosition(new Vector(x + 0.5, y + BlockType.centralTopLimit(id, data), z + 0.5)); + final BlockState id = world.getBlock(pos); + if (!BlockType.canPassThrough(id.getBlockType().getLegacyId())) { + setPosition(new Vector(x + 0.5, y + BlockType.centralTopLimit(id), z + 0.5)); return; } @@ -169,11 +168,11 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { ++spots; if (spots == 2) { final Vector platform = new Vector(x, y - 2, z); - final BaseBlock block = world.getBlock(platform); - final int type = block.getId(); + final BlockStateHolder block = world.getBlock(platform); + final com.sk89q.worldedit.blocks.type.BlockType type = block.getBlockType(); // Don't get put in lava! - if (type == BlockID.LAVA || type == BlockID.STATIONARY_LAVA) { + if (type == BlockTypes.LAVA || type == BlockTypes.FLOWING_LAVA) { return false; } @@ -211,11 +210,11 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { // stand upon while (y >= 0) { final Vector platform = new Vector(x, y, z); - final BaseBlock block = world.getBlock(platform); - final int type = block.getId(); + final BlockStateHolder block = world.getBlock(platform); + final com.sk89q.worldedit.blocks.type.BlockType type = block.getBlockType(); // Don't want to end up in lava - if (type != BlockID.AIR && type != BlockID.LAVA && type != BlockID.STATIONARY_LAVA) { + if (type != BlockTypes.AIR && type != BlockTypes.LAVA && type != BlockTypes.FLOWING_LAVA) { // Found a block! setPosition(platform.add(0.5, BlockType.centralTopLimit(block), 0.5)); return true; @@ -248,7 +247,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { Extent world = getLocation().getExtent(); // No free space above - if (world.getBlock(new Vector(x, y, z)).getId() != 0) { + if (world.getBlock(new Vector(x, y, z)).getBlockType() != BlockTypes.AIR) { return false; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java index 7a1bd25f9..38404981f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java @@ -23,6 +23,9 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; @@ -64,17 +67,22 @@ public abstract class AbstractDelegateExtent implements Extent { } @Override - public BaseBlock getBlock(Vector position) { + public BlockState getBlock(Vector position) { return extent.getBlock(position); } @Override - public BaseBlock getLazyBlock(Vector position) { + public LazyBlock getLazyBlock(Vector position) { return extent.getLazyBlock(position); } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { + public BaseBlock getFullBlock(Vector position) { + return extent.getFullBlock(position); + } + + @Override + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { return extent.setBlock(location, block); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java index e76fa285f..021644153 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.history.change.BlockChange; @@ -58,8 +59,8 @@ public class ChangeSetExtent extends AbstractDelegateExtent { } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { - BaseBlock previous = getBlock(location); + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { + BlockStateHolder previous = getBlock(location); changeSet.add(new BlockChange(location.toBlockVector(), previous, block)); return super.setBlock(location, block); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java index f8e3a7a8f..99af94b21 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java @@ -22,6 +22,9 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.biome.BaseBiome; @@ -37,20 +40,14 @@ public interface InputExtent { * is undefined (an air block could be returned). However, {@code null} * should not be returned.

* - *

The returned block is mutable and is a snapshot of the block at the time + *

The returned block is immutable and is a snapshot of the block at the time * of call. It has no position attached to it, so it could be reused in * {@link Pattern}s and so on.

* - *

Calls to this method can actually be quite expensive, so cache results - * whenever it is possible, while being aware of the mutability aspect. - * The cost, however, depends on the implementation and particular extent. - * If only basic information about the block is required, then use of - * {@link #getLazyBlock(Vector)} is recommended.

- * * @param position position of the block * @return the block */ - BaseBlock getBlock(Vector position); + BlockState getBlock(Vector position); /** * Get a lazy, immutable snapshot of the block at the given location that only @@ -73,7 +70,15 @@ public interface InputExtent { * @param position position of the block * @return the block */ - BaseBlock getLazyBlock(Vector position); + LazyBlock getLazyBlock(Vector position); + + /** + * Get a immutable snapshot of the block at the given location. + * + * @param position position of the block + * @return the block + */ + BaseBlock getFullBlock(Vector position); /** * Get the biome at the given location. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java index 8c53d1ba5..d906369d9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.function.mask.Mask; import static com.google.common.base.Preconditions.checkNotNull; @@ -65,7 +66,7 @@ public class MaskingExtent extends AbstractDelegateExtent { } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { return mask.test(location) && super.setBlock(location, block); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java index 20a3b1556..3616cc53c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java @@ -23,6 +23,9 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -70,13 +73,18 @@ public class NullExtent implements Extent { } @Override - public BaseBlock getBlock(Vector position) { - return new BaseBlock(BlockTypes.AIR); + public BlockState getBlock(Vector position) { + return BlockTypes.AIR.getDefaultState(); } @Override - public BaseBlock getLazyBlock(Vector position) { - return new BaseBlock(BlockTypes.AIR); + public LazyBlock getLazyBlock(Vector position) { + return new LazyBlock(BlockTypes.AIR, this, position); + } + + @Override + public BaseBlock getFullBlock(Vector position) { + return new BaseBlock(getBlock(position)); } @Nullable @@ -86,7 +94,7 @@ public class NullExtent implements Extent { } @Override - public boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector position, BlockStateHolder block) throws WorldEditException { return false; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java index cdb21d662..2ebaeb925 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.world.biome.BaseBiome; @@ -35,8 +35,8 @@ public interface OutputExtent { /** * Change the block at the given location to the given block. The operation may - * not tie the given {@link BaseBlock} to the world, so future changes to the - * {@link BaseBlock} do not affect the world until this method is called again. + * not tie the given {@link BlockStateHolder} to the world, so future changes to the + * {@link BlockStateHolder} do not affect the world until this method is called again. * *

The return value of this method indicates whether the change was probably * successful. It may not be successful if, for example, the location is out @@ -50,7 +50,7 @@ public interface OutputExtent { * @return true if the block was successfully set (return value may not be accurate) * @throws WorldEditException thrown on an error */ - boolean setBlock(Vector position, BaseBlock block) throws WorldEditException; + boolean setBlock(Vector position, BlockStateHolder block) throws WorldEditException; /** * Set the biome. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java index eca710dd3..07ef43fe2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java @@ -19,10 +19,13 @@ package com.sk89q.worldedit.extent.buffer; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; @@ -37,8 +40,6 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Buffers changes to an {@link Extent} and allows later retrieval for * actual application of the changes. @@ -48,9 +49,9 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pattern { - private static final BaseBlock AIR = new BaseBlock(BlockTypes.AIR); + private static final BlockState AIR = BlockTypes.AIR.getDefaultState(); - private final Map buffer = new LinkedHashMap<>(); + private final Map buffer = new LinkedHashMap<>(); private final Mask mask; private Vector min = null; private Vector max = null; @@ -79,7 +80,7 @@ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pat } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { // Update minimum if (min == null) { min = location; @@ -104,8 +105,8 @@ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pat } @Override - public BaseBlock apply(Vector pos) { - BaseBlock block = buffer.get(pos.toBlockVector()); + public BlockStateHolder apply(Vector pos) { + BlockStateHolder block = buffer.get(pos.toBlockVector()); if (block != null) { return block; } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java index 3e6150ed7..2a61679c7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.extent.cache; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; @@ -43,13 +44,13 @@ public class LastAccessExtentCache extends AbstractDelegateExtent { } @Override - public BaseBlock getLazyBlock(Vector position) { + public LazyBlock getLazyBlock(Vector position) { BlockVector blockVector = position.toBlockVector(); CachedBlock lastBlock = this.lastBlock; if (lastBlock != null && lastBlock.position.equals(blockVector)) { return lastBlock.block; } else { - BaseBlock block = super.getLazyBlock(position); + LazyBlock block = super.getLazyBlock(position); this.lastBlock = new CachedBlock(blockVector, block); return block; } @@ -57,9 +58,9 @@ public class LastAccessExtentCache extends AbstractDelegateExtent { private static class CachedBlock { private final BlockVector position; - private final BaseBlock block; + private final LazyBlock block; - private CachedBlock(BlockVector position, BaseBlock block) { + private CachedBlock(BlockVector position, LazyBlock block) { this.position = position; this.block = block; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index dd79786f7..4c563f1ae 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -23,6 +23,9 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -45,8 +48,8 @@ import static com.google.common.base.Preconditions.checkNotNull; public class BlockArrayClipboard implements Clipboard { private final Region region; - private Vector origin = new Vector(); - private final BaseBlock[][][] blocks; + private Vector origin; + private final BlockStateHolder[][][] blocks; private final List entities = new ArrayList<>(); /** @@ -120,12 +123,38 @@ public class BlockArrayClipboard implements Clipboard { } @Override - public BaseBlock getBlock(Vector position) { + public BlockState getBlock(Vector position) { if (region.contains(position)) { Vector v = position.subtract(region.getMinimumPoint()); - BaseBlock block = blocks[v.getBlockX()][v.getBlockY()][v.getBlockZ()]; + BlockStateHolder block = blocks[v.getBlockX()][v.getBlockY()][v.getBlockZ()]; if (block != null) { - return new BaseBlock(block); + if (block instanceof BlockState) { + return (BlockState) block; + } else if (block instanceof BaseBlock) { + return ((BaseBlock) block).getState(); + } + } + } + + return BlockTypes.AIR.getDefaultState(); + } + + @Override + public LazyBlock getLazyBlock(Vector position) { + return new LazyBlock(getBlock(position), null, position); + } + + @Override + public BaseBlock getFullBlock(Vector position) { + if (region.contains(position)) { + Vector v = position.subtract(region.getMinimumPoint()); + BlockStateHolder block = blocks[v.getBlockX()][v.getBlockY()][v.getBlockZ()]; + if (block != null) { + if (block instanceof BlockState) { + return new BaseBlock((BlockState) block); + } else if (block instanceof BaseBlock) { + return (BaseBlock) block; + } } } @@ -133,15 +162,10 @@ public class BlockArrayClipboard implements Clipboard { } @Override - public BaseBlock getLazyBlock(Vector position) { - return getBlock(position); - } - - @Override - public boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector position, BlockStateHolder block) throws WorldEditException { if (region.contains(position)) { Vector v = position.subtract(region.getMinimumPoint()); - blocks[v.getBlockX()][v.getBlockY()][v.getBlockZ()] = new BaseBlock(block); + blocks[v.getBlockX()][v.getBlockY()][v.getBlockZ()] = block; return true; } else { return false; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java index f170db83d..c654c9d82 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.extent.clipboard.io; import com.sk89q.jnbt.NBTConstants; import com.sk89q.jnbt.NBTInputStream; -import com.sk89q.jnbt.NBTOutputStream; import javax.annotation.Nullable; import java.io.DataInputStream; @@ -38,7 +37,6 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; import static com.google.common.base.Preconditions.checkNotNull; @@ -59,8 +57,7 @@ public enum ClipboardFormat { @Override public ClipboardWriter getWriter(OutputStream outputStream) throws IOException { - NBTOutputStream nbtStream = new NBTOutputStream(new GZIPOutputStream(outputStream)); - return new SchematicWriter(nbtStream); + throw new UnsupportedOperationException("This clipboard format is deprecated."); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java deleted file mode 100644 index 98a0324ea..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.extent.clipboard.io; - -import com.sk89q.jnbt.ByteArrayTag; -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.DoubleTag; -import com.sk89q.jnbt.FloatTag; -import com.sk89q.jnbt.IntTag; -import com.sk89q.jnbt.ListTag; -import com.sk89q.jnbt.NBTOutputStream; -import com.sk89q.jnbt.ShortTag; -import com.sk89q.jnbt.StringTag; -import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.entity.BaseEntity; -import com.sk89q.worldedit.entity.Entity; -import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.util.Location; -import com.sk89q.worldedit.world.registry.WorldData; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Writes schematic files based that are compatible with MCEdit and other editors. - */ -public class SchematicWriter implements ClipboardWriter { - - private static final int MAX_SIZE = Short.MAX_VALUE - Short.MIN_VALUE; - private final NBTOutputStream outputStream; - - /** - * Create a new schematic writer. - * - * @param outputStream the output stream to write to - */ - public SchematicWriter(NBTOutputStream outputStream) { - checkNotNull(outputStream); - this.outputStream = outputStream; - } - - @Override - public void write(Clipboard clipboard, WorldData data) throws IOException { - Region region = clipboard.getRegion(); - Vector origin = clipboard.getOrigin(); - Vector min = region.getMinimumPoint(); - Vector offset = min.subtract(origin); - int width = region.getWidth(); - int height = region.getHeight(); - int length = region.getLength(); - - if (width > MAX_SIZE) { - throw new IllegalArgumentException("Width of region too large for a .schematic"); - } - if (height > MAX_SIZE) { - throw new IllegalArgumentException("Height of region too large for a .schematic"); - } - if (length > MAX_SIZE) { - throw new IllegalArgumentException("Length of region too large for a .schematic"); - } - - // ==================================================================== - // Metadata - // ==================================================================== - - HashMap schematic = new HashMap<>(); - schematic.put("Width", new ShortTag((short) width)); - schematic.put("Length", new ShortTag((short) length)); - schematic.put("Height", new ShortTag((short) height)); - schematic.put("Materials", new StringTag("Alpha")); - schematic.put("WEOriginX", new IntTag(min.getBlockX())); - schematic.put("WEOriginY", new IntTag(min.getBlockY())); - schematic.put("WEOriginZ", new IntTag(min.getBlockZ())); - schematic.put("WEOffsetX", new IntTag(offset.getBlockX())); - schematic.put("WEOffsetY", new IntTag(offset.getBlockY())); - schematic.put("WEOffsetZ", new IntTag(offset.getBlockZ())); - - // ==================================================================== - // Block handling - // ==================================================================== - - byte[] blocks = new byte[width * height * length]; - byte[] addBlocks = null; - byte[] blockData = new byte[width * height * length]; - List tileEntities = new ArrayList<>(); - - for (Vector point : region) { - Vector relative = point.subtract(min); - int x = relative.getBlockX(); - int y = relative.getBlockY(); - int z = relative.getBlockZ(); - - int index = y * width * length + z * width + x; - BaseBlock block = clipboard.getBlock(point); - - // Save 4096 IDs in an AddBlocks section - if (block.getId() > 255) { - if (addBlocks == null) { // Lazily create section - addBlocks = new byte[(blocks.length >> 1) + 1]; - } - - addBlocks[index >> 1] = (byte) (((index & 1) == 0) ? - addBlocks[index >> 1] & 0xF0 | (block.getId() >> 8) & 0xF - : addBlocks[index >> 1] & 0xF | ((block.getId() >> 8) & 0xF) << 4); - } - - blocks[index] = (byte) block.getId(); - blockData[index] = (byte) block.getData(); - - // Store TileEntity data - CompoundTag rawTag = block.getNbtData(); - if (rawTag != null) { - Map values = new HashMap<>(); - for (Entry entry : rawTag.getValue().entrySet()) { - values.put(entry.getKey(), entry.getValue()); - } - - values.put("id", new StringTag(block.getNbtId())); - values.put("x", new IntTag(x)); - values.put("y", new IntTag(y)); - values.put("z", new IntTag(z)); - - CompoundTag tileEntityTag = new CompoundTag(values); - tileEntities.add(tileEntityTag); - } - } - - schematic.put("Blocks", new ByteArrayTag(blocks)); - schematic.put("Data", new ByteArrayTag(blockData)); - schematic.put("TileEntities", new ListTag(CompoundTag.class, tileEntities)); - - if (addBlocks != null) { - schematic.put("AddBlocks", new ByteArrayTag(addBlocks)); - } - - // ==================================================================== - // Entities - // ==================================================================== - - List entities = new ArrayList<>(); - for (Entity entity : clipboard.getEntities()) { - BaseEntity state = entity.getState(); - - if (state != null) { - Map values = new HashMap<>(); - - // Put NBT provided data - CompoundTag rawTag = state.getNbtData(); - if (rawTag != null) { - values.putAll(rawTag.getValue()); - } - - // Store our location data, overwriting any - values.put("id", new StringTag(state.getTypeId())); - values.put("Pos", writeVector(entity.getLocation().toVector(), "Pos")); - values.put("Rotation", writeRotation(entity.getLocation(), "Rotation")); - - CompoundTag entityTag = new CompoundTag(values); - entities.add(entityTag); - } - } - - schematic.put("Entities", new ListTag(CompoundTag.class, entities)); - - // ==================================================================== - // Output - // ==================================================================== - - CompoundTag schematicTag = new CompoundTag(schematic); - outputStream.writeNamedTag("Schematic", schematicTag); - } - - private Tag writeVector(Vector vector, String name) { - List list = new ArrayList<>(); - list.add(new DoubleTag(vector.getX())); - list.add(new DoubleTag(vector.getY())); - list.add(new DoubleTag(vector.getZ())); - return new ListTag(DoubleTag.class, list); - } - - private Tag writeRotation(Location location, String name) { - List list = new ArrayList<>(); - list.add(new FloatTag(location.getYaw())); - list.add(new FloatTag(location.getPitch())); - return new ListTag(FloatTag.class, list); - } - - @Override - public void close() throws IOException { - outputStream.close(); - } -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index 3742dc7ca..aaed19d05 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.extent.inventory; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; @@ -79,7 +80,7 @@ public class BlockBagExtent extends AbstractDelegateExtent { } @Override - public boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector position, BlockStateHolder block) throws WorldEditException { if (blockBag != null) { BaseBlock lazyBlock = getExtent().getLazyBlock(position); int existing = lazyBlock.getBlockType().getLegacyId(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/logging/AbstractLoggingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/logging/AbstractLoggingExtent.java deleted file mode 100644 index 41aae000c..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/logging/AbstractLoggingExtent.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.extent.logging; - -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.extent.AbstractDelegateExtent; -import com.sk89q.worldedit.extent.Extent; - -/** - * An abstract class to implement block loggers and so on with. - */ -public abstract class AbstractLoggingExtent extends AbstractDelegateExtent { - - /** - * Create a new instance. - * - * @param extent the extent - */ - protected AbstractLoggingExtent(Extent extent) { - super(extent); - } - - /** - * Called when a block is being changed. - * - * @param position the position - * @param newBlock the new block to replace the old one - */ - protected void onBlockChange(Vector position, BaseBlock newBlock) { - } - - @Override - public final boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { - onBlockChange(position, block); - return super.setBlock(position, block); - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index 431674249..f0bfc4326 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; @@ -43,9 +44,9 @@ import java.util.*; */ public class MultiStageReorder extends AbstractDelegateExtent implements ReorderingExtent { - private TupleArrayList stage1 = new TupleArrayList<>(); - private TupleArrayList stage2 = new TupleArrayList<>(); - private TupleArrayList stage3 = new TupleArrayList<>(); + private TupleArrayList stage1 = new TupleArrayList<>(); + private TupleArrayList stage2 = new TupleArrayList<>(); + private TupleArrayList stage3 = new TupleArrayList<>(); private boolean enabled; /** @@ -87,7 +88,7 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { BaseBlock lazyBlock = getLazyBlock(location); if (!enabled) { @@ -97,18 +98,18 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder if (BlockType.shouldPlaceLast(block.getBlockType().getLegacyId())) { // Place torches, etc. last stage2.put(location.toBlockVector(), block); - return !(lazyBlock.getBlockType() == block.getBlockType() && lazyBlock.getData() == block.getData()); + return !(lazyBlock.getBlockType() == block.getBlockType()); // TODO && lazyBlock.getData() == block.getData()); } else if (BlockType.shouldPlaceFinal(block.getBlockType().getLegacyId())) { // Place signs, reed, etc even later stage3.put(location.toBlockVector(), block); - return !(lazyBlock.getBlockType() == block.getBlockType() && lazyBlock.getData() == block.getData()); + return !(lazyBlock.getBlockType() == block.getBlockType()); // TODO && lazyBlock.getData() == block.getData()); } else if (BlockType.shouldPlaceLast(lazyBlock.getBlockType().getLegacyId())) { // Destroy torches, etc. first - super.setBlock(location, new BaseBlock(BlockTypes.AIR)); + super.setBlock(location, BlockTypes.AIR.getDefaultState()); return super.setBlock(location, block); } else { stage1.put(location.toBlockVector(), block); - return !(lazyBlock.getBlockType() == block.getBlockType() && lazyBlock.getData() == block.getData()); + return !(lazyBlock.getBlockType() == block.getBlockType()); // TODO && lazyBlock.getData() == block.getData()); } } @@ -128,8 +129,8 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder Extent extent = getExtent(); final Set blocks = new HashSet<>(); - final Map blockTypes = new HashMap<>(); - for (Map.Entry entry : stage3) { + final Map blockTypes = new HashMap<>(); + for (Map.Entry entry : stage3) { final BlockVector pt = entry.getKey(); blocks.add(pt); blockTypes.put(pt, entry.getValue()); @@ -148,10 +149,10 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder assert (blockTypes.containsKey(current)); - final BaseBlock baseBlock = blockTypes.get(current); + final BlockStateHolder baseBlock = blockTypes.get(current); final int type = baseBlock.getBlockType().getLegacyId(); - final int data = baseBlock.getData(); +// final int data = baseBlock.getData(); switch (type) { case BlockID.WOODEN_DOOR: @@ -161,13 +162,13 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder case BlockID.DARK_OAK_DOOR: case BlockID.SPRUCE_DOOR: case BlockID.IRON_DOOR: - if ((data & 0x8) == 0) { - // Deal with lower door halves being attached to the floor AND the upper half - BlockVector upperBlock = current.add(0, 1, 0).toBlockVector(); - if (blocks.contains(upperBlock) && !walked.contains(upperBlock)) { - walked.addFirst(upperBlock); - } - } +// TODO if ((data & 0x8) == 0) { +// // Deal with lower door halves being attached to the floor AND the upper half +// BlockVector upperBlock = current.add(0, 1, 0).toBlockVector(); +// if (blocks.contains(upperBlock) && !walked.contains(upperBlock)) { +// walked.addFirst(upperBlock); +// } +// } break; case BlockID.MINECART_TRACKS: @@ -183,7 +184,7 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder break; } - final PlayerDirection attachment = BlockType.getAttachment(type, data); + final PlayerDirection attachment = BlockType.getAttachment(type, 0); // TODO if (attachment == null) { // Block is not attached to anything => we can place it break; 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 9eedc0aa8..886e18aa8 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 @@ -24,6 +24,9 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.transform.Transform; @@ -77,24 +80,29 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * @param reverse true to transform in the opposite direction * @return the same block */ - private BaseBlock transformBlock(BaseBlock block, boolean reverse) { + private T transformBlock(T block, boolean reverse) { transform(block, reverse ? transform.inverse() : transform, blockRegistry); return block; } @Override - public BaseBlock getBlock(Vector position) { + public BlockState getBlock(Vector position) { return transformBlock(super.getBlock(position), false); } @Override - public BaseBlock getLazyBlock(Vector position) { + public LazyBlock getLazyBlock(Vector position) { return transformBlock(super.getLazyBlock(position), false); } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { - return super.setBlock(location, transformBlock(new BaseBlock(block), true)); + public BaseBlock getFullBlock(Vector position) { + return transformBlock(super.getFullBlock(position), false); + } + + @Override + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { + return super.setBlock(location, transformBlock(block, true)); } @@ -108,7 +116,7 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * @param registry the registry * @return the same block */ - public static BaseBlock transform(BaseBlock block, Transform transform, BlockRegistry registry) { + public static T transform(T block, Transform transform, BlockRegistry registry) { return transform(block, transform, registry, block); } @@ -121,7 +129,7 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * @param changedBlock the block to change * @return the changed block */ - private static BaseBlock transform(BaseBlock block, Transform transform, BlockRegistry registry, BaseBlock changedBlock) { + private static T transform(T block, Transform transform, BlockRegistry registry, T changedBlock) { checkNotNull(block); checkNotNull(transform); checkNotNull(registry); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java index fc18d7257..7a99f80fb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; @@ -77,7 +78,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent { } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { if (limit >= 0) { if (count >= limit) { throw new MaxChangedBlocksException(limit); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index 90d126871..8356ef15e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.extent.validation; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; @@ -49,7 +50,7 @@ public class DataValidatorExtent extends AbstractDelegateExtent { } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { final int y = location.getBlockY(); final BlockType type = block.getBlockType(); if (y < 0 || y > world.getMaxY()) { @@ -61,16 +62,7 @@ public class DataValidatorExtent extends AbstractDelegateExtent { return false; } - if (block.getData() < 0) { - throw new SevereValidationException("Cannot set a data value that is less than 0"); - } - return super.setBlock(location, block); } - private static class SevereValidationException extends WorldEditException { - private SevereValidationException(String message) { - super(message); - } - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index 2b3b06281..80b3dc1d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; @@ -52,7 +53,7 @@ public class BlockQuirkExtent extends AbstractDelegateExtent { } @Override - public boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector position, BlockStateHolder block) throws WorldEditException { BaseBlock lazyBlock = getExtent().getLazyBlock(position); int existing = lazyBlock.getBlockType().getLegacyId(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java index f417a3c7f..9a15d1142 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.extent.world; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; @@ -61,7 +62,7 @@ public class ChunkLoadingExtent extends AbstractDelegateExtent { } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { world.checkLoadedChunk(location); return super.setBlock(location, block); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java index a64b140b8..7b7b0d256 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; @@ -84,7 +85,7 @@ public class FastModeExtent extends AbstractDelegateExtent { } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { if (enabled) { dirtyChunks.add(new BlockVector2D(location.getBlockX() >> 4, location.getBlockZ() >> 4)); return world.setBlock(location, block, false); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java index a5ceb03c2..3090cb972 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java @@ -22,6 +22,8 @@ package com.sk89q.worldedit.extent.world; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; @@ -79,8 +81,8 @@ public class SurvivalModeExtent extends AbstractDelegateExtent { } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { - if (toolUse && block.isAir()) { + public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { + if (toolUse && block.getBlockType() == BlockTypes.AIR) { world.simulateBlockMine(location); return true; } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java index 9f5b502ec..2b669b332 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java @@ -24,6 +24,7 @@ import com.sk89q.jnbt.CompoundTagBuilder; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.internal.helper.MCDirections; @@ -68,7 +69,7 @@ public class ExtentBlockCopy implements RegionFunction { @Override public boolean apply(Vector position) throws WorldEditException { - BaseBlock block = source.getBlock(position); + BaseBlock block = source.getFullBlock(position); Vector orig = position.subtract(from); Vector transformed = transform.apply(orig); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index 9447de469..a0bbf9f87 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; @@ -104,7 +105,7 @@ public class FloraGenerator implements RegionFunction { @Override public boolean apply(Vector position) throws WorldEditException { - BaseBlock block = editSession.getBlock(position); + BlockStateHolder block = editSession.getBlock(position); if (block.getBlockType() == BlockTypes.GRASS) { editSession.setBlock(position.add(0, 1, 0), temperatePattern.apply(position)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index f5ed90db7..3c0a0660c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; @@ -50,7 +51,7 @@ public class ForestGenerator implements RegionFunction { @Override public boolean apply(Vector position) throws WorldEditException { - BaseBlock block = editSession.getBlock(position); + BlockStateHolder block = editSession.getBlock(position); BlockType t = block.getBlockType(); if (t == BlockTypes.GRASS || t == BlockTypes.DIRT) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index 65117b76e..0e851d2f4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -24,6 +24,8 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; @@ -86,25 +88,25 @@ public class GardenPatchGenerator implements RegionFunction { */ private void placeVine(Vector basePos, Vector pos) throws MaxChangedBlocksException { if (pos.distance(basePos) > 4) return; - if (!editSession.getBlock(pos).isAir()) return; + if (editSession.getBlock(pos).getBlockType() != BlockTypes.AIR) return; for (int i = -1; i > -3; --i) { Vector testPos = pos.add(0, i, 0); - if (editSession.getBlock(testPos).isAir()) { + if (editSession.getBlock(testPos).getBlockType() == BlockTypes.AIR) { pos = testPos; } else { break; } } - setBlockIfAir(editSession, pos, new BaseBlock(BlockTypes.OAK_LEAVES)); + setBlockIfAir(editSession, pos, BlockTypes.OAK_LEAVES.getDefaultState()); affected++; int t = random.nextInt(4); int h = random.nextInt(3) - 1; Vector p; - BaseBlock log = new BaseBlock(BlockTypes.OAK_LOG); + BlockState log = BlockTypes.OAK_LOG.getDefaultState(); switch (t) { case 0: @@ -159,7 +161,7 @@ public class GardenPatchGenerator implements RegionFunction { @Override public boolean apply(Vector position) throws WorldEditException { - if (!editSession.getBlock(position).isAir()) { + if (editSession.getBlock(position).getBlockType() != BlockTypes.AIR) { position = position.add(0, 1, 0); } @@ -167,9 +169,9 @@ public class GardenPatchGenerator implements RegionFunction { return false; } - BaseBlock leavesBlock = new BaseBlock(BlockTypes.OAK_LEAVES); + BlockState leavesBlock = BlockTypes.OAK_LEAVES.getDefaultState(); - if (editSession.getBlock(position).isAir()) { + if (editSession.getBlock(position).getBlockType() == BlockTypes.AIR) { editSession.setBlock(position, leavesBlock); } @@ -202,8 +204,8 @@ public class GardenPatchGenerator implements RegionFunction { * @return if block was changed * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - private static boolean setBlockIfAir(EditSession session, Vector position, BaseBlock block) throws MaxChangedBlocksException { - return session.getBlock(position).isAir() && session.setBlock(position, block); + private static boolean setBlockIfAir(EditSession session, Vector position, BlockStateHolder block) throws MaxChangedBlocksException { + return session.getBlock(position).getBlockType() == BlockTypes.AIR && session.setBlock(position, block); } /** 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 533adc2eb..822443f97 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 @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.mask; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; @@ -40,7 +42,7 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class BlockMask extends AbstractExtentMask { - private final Set blocks = new HashSet<>(); + private final Set blocks = new HashSet<>(); /** * Create a new block mask. @@ -48,7 +50,7 @@ public class BlockMask extends AbstractExtentMask { * @param extent the extent * @param blocks a list of blocks to match */ - public BlockMask(Extent extent, Collection blocks) { + public BlockMask(Extent extent, Collection blocks) { super(extent); checkNotNull(blocks); this.blocks.addAll(blocks); @@ -60,7 +62,7 @@ public class BlockMask extends AbstractExtentMask { * @param extent the extent * @param block an array of blocks to match */ - public BlockMask(Extent extent, BaseBlock... block) { + public BlockMask(Extent extent, BlockStateHolder... block) { this(extent, Arrays.asList(checkNotNull(block))); } @@ -69,7 +71,7 @@ public class BlockMask extends AbstractExtentMask { * * @param blocks a list of blocks */ - public void add(Collection blocks) { + public void add(Collection blocks) { checkNotNull(blocks); this.blocks.addAll(blocks); } @@ -79,7 +81,7 @@ public class BlockMask extends AbstractExtentMask { * * @param block an array of blocks */ - public void add(BaseBlock... block) { + public void add(BlockStateHolder... block) { add(Arrays.asList(checkNotNull(block))); } @@ -88,14 +90,14 @@ public class BlockMask extends AbstractExtentMask { * * @return a list of blocks */ - public Collection getBlocks() { + public Collection getBlocks() { return blocks; } @Override public boolean test(Vector vector) { - BaseBlock block = getExtent().getBlock(vector); - return blocks.contains(block) || blocks.contains(new BaseBlock(block.getBlockType())); + BlockStateHolder block = getExtent().getBlock(vector); + return blocks.contains(block) || blocks.contains(block); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java index c018ed0a0..baf453c22 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java @@ -22,26 +22,25 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.Blocks; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import java.util.Collection; public class FuzzyBlockMask extends BlockMask { - public FuzzyBlockMask(Extent extent, Collection blocks) { + public FuzzyBlockMask(Extent extent, Collection blocks) { super(extent, blocks); } - public FuzzyBlockMask(Extent extent, BaseBlock... block) { + public FuzzyBlockMask(Extent extent, BlockStateHolder... block) { super(extent, block); } @Override public boolean test(Vector vector) { Extent extent = getExtent(); - Collection blocks = getBlocks(); - BaseBlock lazyBlock = extent.getLazyBlock(vector); - BaseBlock compare = new BaseBlock(lazyBlock.getState()); - return Blocks.containsFuzzy(blocks, compare); + Collection blocks = getBlocks(); + return Blocks.containsFuzzy(blocks, extent.getFullBlock(vector)); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java index a12850c10..8c2a2799c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.function.operation; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import java.util.Iterator; @@ -37,7 +38,7 @@ import static com.google.common.base.Preconditions.checkNotNull; public class BlockMapEntryPlacer implements Operation { private final Extent extent; - private final Iterator> iterator; + private final Iterator> iterator; /** * Create a new instance. @@ -45,7 +46,7 @@ public class BlockMapEntryPlacer implements Operation { * @param extent the extent to set the blocks on * @param iterator the iterator */ - public BlockMapEntryPlacer(Extent extent, Iterator> iterator) { + public BlockMapEntryPlacer(Extent extent, Iterator> iterator) { checkNotNull(extent); checkNotNull(iterator); this.extent = extent; @@ -55,7 +56,7 @@ public class BlockMapEntryPlacer implements Operation { @Override public Operation resume(RunContext run) throws WorldEditException { while (iterator.hasNext()) { - Map.Entry entry = iterator.next(); + Map.Entry entry = iterator.next(); extent.setBlock(entry.getKey(), entry.getValue()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java index 8d088810d..245701d06 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import static com.google.common.base.Preconditions.checkNotNull; @@ -29,14 +30,14 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class BlockPattern extends AbstractPattern { - private BaseBlock block; + private BlockStateHolder block; /** * Create a new pattern with the given block. * * @param block the block */ - public BlockPattern(BaseBlock block) { + public BlockPattern(BlockStateHolder block) { setBlock(block); } @@ -45,7 +46,7 @@ public class BlockPattern extends AbstractPattern { * * @return the block that is always returned */ - public BaseBlock getBlock() { + public BlockStateHolder getBlock() { return block; } @@ -54,13 +55,13 @@ public class BlockPattern extends AbstractPattern { * * @param block the block */ - public void setBlock(BaseBlock block) { + public void setBlock(BlockStateHolder block) { checkNotNull(block); this.block = block; } @Override - public BaseBlock apply(Vector position) { + public BlockStateHolder apply(Vector position) { return block; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java index c16718330..ccd030394 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.clipboard.Clipboard; import static com.google.common.base.Preconditions.checkNotNull; @@ -45,7 +46,7 @@ public class ClipboardPattern extends AbstractPattern { } @Override - public BaseBlock apply(Vector position) { + public BlockStateHolder apply(Vector position) { int xp = Math.abs(position.getBlockX()) % size.getBlockX(); int yp = Math.abs(position.getBlockY()) % size.getBlockY(); int zp = Math.abs(position.getBlockZ()) % size.getBlockZ(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Pattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Pattern.java index 08c74bfde..c28d40539 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Pattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Pattern.java @@ -21,18 +21,19 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; /** - * Returns a {@link BaseBlock} for a given position. + * Returns a {@link BlockStateHolder} for a given position. */ public interface Pattern { /** - * Return a {@link BaseBlock} for the given position. + * Return a {@link BlockStateHolder} for the given position. * * @param position the position * @return a block */ - BaseBlock apply(Vector position); + BlockStateHolder apply(Vector position); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java index 31f58fc31..2eefd0ca9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import java.util.ArrayList; import java.util.List; @@ -53,7 +54,7 @@ public class RandomPattern extends AbstractPattern { } @Override - public BaseBlock apply(Vector position) { + public BlockStateHolder apply(Vector position) { double r = random.nextDouble(); double offset = 0; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java index 024c674fa..fbedc3d57 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import static com.google.common.base.Preconditions.checkNotNull; @@ -83,7 +84,7 @@ public class RepeatingExtentPattern extends AbstractPattern { } @Override - public BaseBlock apply(Vector position) { + public BlockStateHolder apply(Vector position) { Vector base = position.add(offset); Vector size = extent.getMaximumPoint().subtract(extent.getMinimumPoint()).add(1, 1, 1); int x = base.getBlockX() % size.getBlockX(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java index 0b1e91e05..d76c7b7ab 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.history.change; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.history.UndoContext; @@ -37,8 +38,8 @@ import static com.google.common.base.Preconditions.checkNotNull; public class BlockChange implements Change { private final BlockVector position; - private final BaseBlock previous; - private final BaseBlock current; + private final BlockStateHolder previous; + private final BlockStateHolder current; /** * Create a new block change. @@ -47,7 +48,7 @@ public class BlockChange implements Change { * @param previous the previous block * @param current the current block */ - public BlockChange(BlockVector position, BaseBlock previous, BaseBlock current) { + public BlockChange(BlockVector position, BlockStateHolder previous, BlockStateHolder current) { checkNotNull(position); checkNotNull(previous); checkNotNull(current); @@ -70,7 +71,7 @@ public class BlockChange implements Change { * * @return the previous block */ - public BaseBlock getPrevious() { + public BlockStateHolder getPrevious() { return previous; } @@ -79,7 +80,7 @@ public class BlockChange implements Change { * * @return the current block */ - public BaseBlock getCurrent() { + public BlockStateHolder getCurrent() { return current; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java index f6e921263..11760efc6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java @@ -23,6 +23,7 @@ import com.google.common.base.Function; import com.google.common.collect.Iterators; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.history.change.BlockChange; import com.sk89q.worldedit.history.change.Change; import com.sk89q.worldedit.util.collection.TupleArrayList; @@ -43,8 +44,8 @@ import static java.util.Map.Entry; */ public class BlockOptimizedHistory extends ArrayListHistory { - private final TupleArrayList previous = new TupleArrayList<>(); - private final TupleArrayList current = new TupleArrayList<>(); + private final TupleArrayList previous = new TupleArrayList<>(); + private final TupleArrayList current = new TupleArrayList<>(); @Override public void add(Change change) { @@ -85,7 +86,7 @@ public class BlockOptimizedHistory extends ArrayListHistory { * * @return a function */ - private Function, Change> createTransform() { + private Function, Change> createTransform() { return entry -> new BlockChange(entry.getKey(), entry.getValue(), entry.getValue()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java index fbccb8204..c2788cf7d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.NoMatchException; @@ -169,7 +170,7 @@ public class WorldEditBinding extends BindingHelper { @BindingMatch(type = BaseBlock.class, behavior = BindingBehavior.CONSUMES, consumedCount = 1) - public BaseBlock getBaseBlock(ArgumentStack context) throws ParameterException, WorldEditException { + public BlockStateHolder getBaseBlock(ArgumentStack context) throws ParameterException, WorldEditException { Actor actor = context.getContext().getLocals().get(Actor.class); ParserContext parserContext = new ParserContext(); parserContext.setActor(context.getContext().getLocals().get(Actor.class)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index 693cefe7f..606c8caf9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.regions.Region; @@ -145,7 +146,7 @@ public class HeightMap { // Depending on growing or shrinking we need to start at the bottom or top if (newHeight > curHeight) { // Set the top block of the column to be the same type (this might go wrong with rounding) - BaseBlock existing = session.getBlock(new Vector(xr, curHeight, zr)); + BlockState existing = session.getBlock(new Vector(xr, curHeight, zr)); // Skip water/lava if (existing.getBlockType() != BlockTypes.WATER && existing.getBlockType() != BlockTypes.FLOWING_WATER diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java index b2a6023e2..1f0979e96 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java @@ -22,9 +22,7 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.Region; @@ -35,45 +33,15 @@ import com.sk89q.worldedit.regions.Region; public abstract class ArbitraryShape { protected final Region extent; - private int cacheOffsetX; - private int cacheOffsetY; - private int cacheOffsetZ; - @SuppressWarnings("FieldCanBeLocal") - private int cacheSizeX; - private int cacheSizeY; - private int cacheSizeZ; public ArbitraryShape(Region extent) { this.extent = extent; - - Vector min = extent.getMinimumPoint(); - Vector max = extent.getMaximumPoint(); - - cacheOffsetX = min.getBlockX() - 1; - cacheOffsetY = min.getBlockY() - 1; - cacheOffsetZ = min.getBlockZ() - 1; - - cacheSizeX = (int) (max.getX() - cacheOffsetX + 2); - cacheSizeY = (int) (max.getY() - cacheOffsetY + 2); - cacheSizeZ = (int) (max.getZ() - cacheOffsetZ + 2); - - cache = new short[cacheSizeX * cacheSizeY * cacheSizeZ]; } protected Region getExtent() { return extent; } - - /** - * Cache entries: - * 0 = unknown - * -1 = outside - * -2 = inside but type and data 0 - * > 0 = inside, value = (type | (data << 8)), not handling data < 0 - */ - private final short[] cache; - /** * Override this function to specify the shape to generate. * @@ -83,60 +51,7 @@ public abstract class ArbitraryShape { * @param defaultMaterial The material returned by the pattern for the current block. * @return material to place or null to not place anything. */ - protected abstract BaseBlock getMaterial(int x, int y, int z, BaseBlock defaultMaterial); - - private BaseBlock getMaterialCached(int x, int y, int z, Pattern pattern) { - final int index = (y - cacheOffsetY) + (z - cacheOffsetZ) * cacheSizeY + (x - cacheOffsetX) * cacheSizeY * cacheSizeZ; - - final short cacheEntry = cache[index]; - switch (cacheEntry) { - case 0: - // unknown, fetch material - final BaseBlock material = getMaterial(x, y, z, pattern.apply(new BlockVector(x, y, z))); - if (material == null) { - // outside - cache[index] = -1; - return null; - } - - short newCacheEntry = (short) (material.getBlockType().getLegacyId() | ((material.getData() + 1) << 8)); - if (newCacheEntry == 0) { - // type and data 0 - newCacheEntry = -2; - } - - cache[index] = newCacheEntry; - return material; - - case -1: - // outside - return null; - - case -2: - // type and data 0 - return new BaseBlock(BlockTypes.AIR); - } - - return new BaseBlock(cacheEntry & 255, ((cacheEntry >> 8) - 1) & 15); - } - - private boolean isInsideCached(int x, int y, int z, Pattern pattern) { - final int index = (y - cacheOffsetY) + (z - cacheOffsetZ) * cacheSizeY + (x - cacheOffsetX) * cacheSizeY * cacheSizeZ; - - switch (cache[index]) { - case 0: - // unknown block, meaning they must be outside the extent at this stage, but might still be inside the shape - return getMaterialCached(x, y, z, pattern) != null; - - case -1: - // outside - return false; - - default: - // inside - return true; - } - } + protected abstract BlockStateHolder getMaterial(int x, int y, int z, BlockStateHolder defaultMaterial); /** * Generates the shape. @@ -156,7 +71,7 @@ public abstract class ArbitraryShape { int z = position.getBlockZ(); if (!hollow) { - final BaseBlock material = getMaterial(x, y, z, pattern.apply(position)); + final BlockStateHolder material = getMaterial(x, y, z, pattern.apply(position)); if (material != null && editSession.setBlock(position, material)) { ++affected; } @@ -164,43 +79,11 @@ public abstract class ArbitraryShape { continue; } - final BaseBlock material = getMaterialCached(x, y, z, pattern); + final BlockStateHolder material = getMaterial(x, y, z, pattern.apply(position)); if (material == null) { continue; } - boolean draw = false; - do { - if (!isInsideCached(x + 1, y, z, pattern)) { - draw = true; - break; - } - if (!isInsideCached(x - 1, y, z, pattern)) { - draw = true; - break; - } - if (!isInsideCached(x, y, z + 1, pattern)) { - draw = true; - break; - } - if (!isInsideCached(x, y, z - 1, pattern)) { - draw = true; - break; - } - if (!isInsideCached(x, y + 1, z, pattern)) { - draw = true; - break; - } - if (!isInsideCached(x, y - 1, z, pattern)) { - draw = true; - break; - } - } while (false); - - if (!draw) { - continue; - } - if (editSession.setBlock(position, material)) { ++affected; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java index 94478527a..ad6e06f08 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.regions.Region; /** @@ -34,7 +35,7 @@ public class RegionShape extends ArbitraryShape { } @Override - protected BaseBlock getMaterial(int x, int y, int z, BaseBlock defaultMaterial) { + protected BlockStateHolder getMaterial(int x, int y, int z, BlockStateHolder defaultMaterial) { if (!this.extent.contains(new Vector(x, y, z))) { return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java index 20170d615..af4638e30 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java @@ -25,7 +25,6 @@ import com.sk89q.jnbt.IntTag; import com.sk89q.jnbt.ListTag; import com.sk89q.jnbt.NBTConstants; import com.sk89q.jnbt.NBTInputStream; -import com.sk89q.jnbt.NBTOutputStream; import com.sk89q.jnbt.NamedTag; import com.sk89q.jnbt.ShortTag; import com.sk89q.jnbt.StringTag; @@ -39,16 +38,12 @@ import com.sk89q.worldedit.world.DataException; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; public class MCEditSchematicFormat extends SchematicFormat { @@ -206,91 +201,7 @@ public class MCEditSchematicFormat extends SchematicFormat { @Override public void save(CuboidClipboard clipboard, File file) throws IOException, DataException { - int width = clipboard.getWidth(); - int height = clipboard.getHeight(); - int length = clipboard.getLength(); - - if (width > MAX_SIZE) { - throw new DataException("Width of region too large for a .schematic"); - } - if (height > MAX_SIZE) { - throw new DataException("Height of region too large for a .schematic"); - } - if (length > MAX_SIZE) { - throw new DataException("Length of region too large for a .schematic"); - } - - HashMap schematic = new HashMap<>(); - schematic.put("Width", new ShortTag((short) width)); - schematic.put("Length", new ShortTag((short) length)); - schematic.put("Height", new ShortTag((short) height)); - schematic.put("Materials", new StringTag("Alpha")); - schematic.put("WEOriginX", new IntTag(clipboard.getOrigin().getBlockX())); - schematic.put("WEOriginY", new IntTag(clipboard.getOrigin().getBlockY())); - schematic.put("WEOriginZ", new IntTag(clipboard.getOrigin().getBlockZ())); - schematic.put("WEOffsetX", new IntTag(clipboard.getOffset().getBlockX())); - schematic.put("WEOffsetY", new IntTag(clipboard.getOffset().getBlockY())); - schematic.put("WEOffsetZ", new IntTag(clipboard.getOffset().getBlockZ())); - - // Copy - byte[] blocks = new byte[width * height * length]; - byte[] addBlocks = null; - byte[] blockData = new byte[width * height * length]; - ArrayList tileEntities = new ArrayList<>(); - - for (int x = 0; x < width; ++x) { - for (int y = 0; y < height; ++y) { - for (int z = 0; z < length; ++z) { - int index = y * width * length + z * width + x; - BaseBlock block = clipboard.getPoint(new BlockVector(x, y, z)); - - // Save 4096 IDs in an AddBlocks section - if (block.getId() > 255) { - if (addBlocks == null) { // Lazily create section - addBlocks = new byte[(blocks.length >> 1) + 1]; - } - - addBlocks[index >> 1] = (byte) (((index & 1) == 0) ? - addBlocks[index >> 1] & 0xF0 | (block.getId() >> 8) & 0xF - : addBlocks[index >> 1] & 0xF | ((block.getId() >> 8) & 0xF) << 4); - } - - blocks[index] = (byte) block.getId(); - blockData[index] = (byte) block.getData(); - - // Get the list of key/values from the block - CompoundTag rawTag = block.getNbtData(); - if (rawTag != null) { - Map values = new HashMap<>(); - for (Entry entry : rawTag.getValue().entrySet()) { - values.put(entry.getKey(), entry.getValue()); - } - - values.put("id", new StringTag(block.getNbtId())); - values.put("x", new IntTag(x)); - values.put("y", new IntTag(y)); - values.put("z", new IntTag(z)); - - CompoundTag tileEntityTag = new CompoundTag(values); - tileEntities.add(tileEntityTag); - } - } - } - } - - schematic.put("Blocks", new ByteArrayTag(blocks)); - schematic.put("Data", new ByteArrayTag(blockData)); - schematic.put("Entities", new ListTag(CompoundTag.class, new ArrayList<>())); - schematic.put("TileEntities", new ListTag(CompoundTag.class, tileEntities)); - if (addBlocks != null) { - schematic.put("AddBlocks", new ByteArrayTag(addBlocks)); - } - - // Build and output - CompoundTag schematicTag = new CompoundTag(schematic); - NBTOutputStream stream = new NBTOutputStream(new GZIPOutputStream(new FileOutputStream(file))); - stream.writeNamedTag("Schematic", schematicTag); - stream.close(); + throw new UnsupportedOperationException("Saving is deprecated"); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java index 96dc8cc89..5fbd1c448 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.scripting; import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.command.InsufficientArgumentsException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; @@ -151,7 +152,7 @@ public class CraftScriptContext extends CraftScriptEnvironment { * @throws UnknownItemException * @throws DisallowedItemException */ - public BaseBlock getBlock(String input, boolean allAllowed) throws WorldEditException { + public BlockStateHolder getBlock(String input, boolean allAllowed) throws WorldEditException { ParserContext context = new ParserContext(); context.setActor(player); context.setWorld(player.getWorld()); @@ -170,7 +171,7 @@ public class CraftScriptContext extends CraftScriptEnvironment { * @throws UnknownItemException * @throws DisallowedItemException */ - public BaseBlock getBlock(String id) throws WorldEditException { + public BlockStateHolder getBlock(String id) throws WorldEditException { return getBlock(id, false); } @@ -199,7 +200,7 @@ public class CraftScriptContext extends CraftScriptEnvironment { * @throws UnknownItemException * @throws DisallowedItemException */ - public Set getBlocks(String list, boolean allBlocksAllowed) throws WorldEditException { + public Set getBlocks(String list, boolean allBlocksAllowed) throws WorldEditException { ParserContext context = new ParserContext(); context.setActor(player); context.setWorld(player.getWorld()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java index 3bff3352d..9d0333814 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java @@ -24,6 +24,7 @@ package com.sk89q.worldedit.util; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.world.registry.BundledItemData; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import java.io.File; @@ -90,6 +91,10 @@ public class PropertiesConfiguration extends LocalConfiguration { logFormat = getString("log-format", logFormat); registerHelp = getBool("register-help", registerHelp); wandItem = getString("wand-item", wandItem); + try { + wandItem = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(wandItem)); + } catch (Throwable e) { + } superPickaxeDrop = getBool("super-pickaxe-drop-items", superPickaxeDrop); superPickaxeManyDrop = getBool("super-pickaxe-many-drop-items", superPickaxeManyDrop); noDoubleSlash = getBool("no-double-slash", noDoubleSlash); @@ -97,6 +102,10 @@ public class PropertiesConfiguration extends LocalConfiguration { useInventoryOverride = getBool("use-inventory-override", useInventoryOverride); useInventoryCreativeOverride = getBool("use-inventory-creative-override", useInventoryCreativeOverride); navigationWand = getString("nav-wand-item", navigationWand); + try { + navigationWand = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(navigationWand)); + } catch (Throwable e) { + } navigationWandMaxDistance = getInt("nav-wand-distance", navigationWandMaxDistance); navigationUseGlass = getBool("nav-use-glass", navigationUseGlass); scriptTimeout = getInt("scripting-timeout", scriptTimeout); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java index c88b47b66..039f27ab2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java @@ -283,6 +283,6 @@ public class TreeGenerator { * @throws MaxChangedBlocksException thrown if too many blocks are changed */ private static boolean setBlockIfAir(EditSession session, Vector position, BaseBlock block) throws MaxChangedBlocksException { - return session.getBlock(position).isAir() && session.setBlock(position, block); + return session.getBlock(position).getBlockType() == BlockTypes.AIR && session.setBlock(position, block); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index 342936824..e4502d949 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -24,6 +24,7 @@ import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.session.SessionManager; +import com.sk89q.worldedit.world.registry.BundledItemData; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import java.io.IOException; @@ -55,6 +56,10 @@ public class YAMLConfiguration extends LocalConfiguration { profile = config.getBoolean("debug", profile); wandItem = config.getString("wand-item", wandItem); + try { + wandItem = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(wandItem)); + } catch (Throwable e) { + } defaultChangeLimit = Math.max(-1, config.getInt( "limits.max-blocks-changed.default", defaultChangeLimit)); @@ -99,6 +104,10 @@ public class YAMLConfiguration extends LocalConfiguration { useInventoryCreativeOverride); navigationWand = config.getString("navigation-wand.item", navigationWand); + try { + navigationWand = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(navigationWand)); + } catch (Throwable e) { + } navigationWandMaxDistance = config.getInt("navigation-wand.max-distance", navigationWandMaxDistance); navigationUseGlass = config.getBoolean("navigation.use-glass", navigationUseGlass); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index 96fe3601e..7d9532170 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -26,6 +26,8 @@ import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.mask.BlockMask; @@ -33,6 +35,7 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.util.Direction; +import java.util.HashMap; import java.util.PriorityQueue; import javax.annotation.Nullable; @@ -51,7 +54,7 @@ public abstract class AbstractWorld implements World { } @Override - public final boolean setBlock(Vector pt, BaseBlock block) throws WorldEditException { + public final boolean setBlock(Vector pt, BlockStateHolder block) throws WorldEditException { return setBlock(pt, block, true); } @@ -63,10 +66,10 @@ public abstract class AbstractWorld implements World { @Override public Mask createLiquidMask() { return new BlockMask(this, - new BaseBlock(BlockTypes.LAVA), - new BaseBlock(BlockTypes.FLOWING_LAVA), - new BaseBlock(BlockTypes.WATER), - new BaseBlock(BlockTypes.FLOWING_WATER)); + new BlockState(BlockTypes.LAVA, new HashMap<>()), + new BlockState(BlockTypes.FLOWING_LAVA, new HashMap<>()), + new BlockState(BlockTypes.WATER, new HashMap<>()), + new BlockState(BlockTypes.FLOWING_WATER, new HashMap<>())); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java index 049fecfbe..9a254c658 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -26,6 +26,9 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -57,7 +60,7 @@ public class NullWorld extends AbstractWorld { } @Override - public boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException { + public boolean setBlock(Vector position, BlockStateHolder block, boolean notifyAndLight) throws WorldEditException { return false; } @@ -101,13 +104,18 @@ public class NullWorld extends AbstractWorld { } @Override - public BaseBlock getBlock(Vector position) { - return new BaseBlock(BlockTypes.AIR); + public BlockState getBlock(Vector position) { + return BlockTypes.AIR.getDefaultState(); } @Override - public BaseBlock getLazyBlock(Vector position) { - return new BaseBlock(BlockTypes.AIR); + public LazyBlock getLazyBlock(Vector position) { + return new LazyBlock(getBlock(position), this, position); + } + + @Override + public BaseBlock getFullBlock(Vector position) { + return new BaseBlock(getBlock(position)); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index 3cebd9817..61dee0838 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.Extent; @@ -75,7 +76,7 @@ public interface World extends Extent { boolean useItem(Vector position, BaseItem item, Direction face); /** - * Similar to {@link Extent#setBlock(Vector, BaseBlock)} but a + * Similar to {@link Extent#setBlock(Vector, BlockStateHolder)} but a * {@code notifyAndLight} parameter indicates whether adjacent blocks * should be notified that changes have been made and lighting operations * should be executed. @@ -92,7 +93,7 @@ public interface World extends Extent { * @param notifyAndLight true to to notify and light * @return true if the block was successfully set (return value may not be accurate) */ - boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException; + boolean setBlock(Vector position, BlockStateHolder block, boolean notifyAndLight) throws WorldEditException; /** * Get the light level at the given block. @@ -165,7 +166,7 @@ public interface World extends Extent { /** * Fix the given chunks after fast mode was used. * - *

Fast mode makes calls to {@link #setBlock(Vector, BaseBlock, boolean)} + *

Fast mode makes calls to {@link #setBlock(Vector, BlockStateHolder, boolean)} * with {@code false} for the {@code notifyAndLight} parameter, which * may causes lighting errors to accumulate. Use of this method, if * it is implemented by the underlying world, corrects those lighting diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index 12e35a040..4debcc682 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -21,6 +21,8 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockMaterial; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.world.registry.state.State; import javax.annotation.Nullable; @@ -38,7 +40,7 @@ public interface BlockRegistry { * @return the block, which may be null if no block exists */ @Nullable - BaseBlock createFromId(String id); + BlockState createFromId(String id); /** * Create a new block using its legacy numeric ID. @@ -48,7 +50,7 @@ public interface BlockRegistry { */ @Nullable @Deprecated - BaseBlock createFromId(int id); + BlockState createFromId(int id); /** * Get the material for the given block. @@ -66,6 +68,6 @@ public interface BlockRegistry { * @return a map of states where the key is the state's ID */ @Nullable - Map getStates(BaseBlock block); + Map getStates(BlockStateHolder block); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 864b36daa..56637e552 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -21,6 +21,8 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockMaterial; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.world.registry.state.State; @@ -35,13 +37,13 @@ public class BundledBlockRegistry implements BlockRegistry { @Nullable @Override - public BaseBlock createFromId(String id) { - return new BaseBlock(BlockTypes.getBlockType(id)); + public BlockState createFromId(String id) { + return BlockTypes.getBlockType(id).getDefaultState(); } @Nullable @Override - public BaseBlock createFromId(int legacyId) { + public BlockState createFromId(int legacyId) { String id = BundledBlockData.getInstance().fromLegacyId(legacyId); if (id != null) { return createFromId(id); @@ -58,7 +60,7 @@ public class BundledBlockRegistry implements BlockRegistry { @Nullable @Override - public Map getStates(BaseBlock block) { + public Map getStates(BlockStateHolder block) { return BundledBlockData.getInstance().getStatesById(block.getBlockType().getId()); } diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json index b6d6d71e7..081ebf427 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json @@ -37,30 +37,15 @@ "localizedName": "Stone", "states": { "variant": { - "dataMask": 7, - "values": { - "stone": { - "data": 0 - }, - "granite": { - "data": 1 - }, - "smooth_granite": { - "data": 2 - }, - "diorite": { - "data": 3 - }, - "smooth_diorite": { - "data": 4 - }, - "andesite": { - "data": 5 - }, - "smooth_andesite": { - "data": 6 - } - } + "values": [ + "stone", + "granite", + "smooth_granite", + "diorite", + "smooth_diorite", + "andesite", + "smooth_andesite" + ] } }, "material": { @@ -95,15 +80,10 @@ "localizedName": "Grass Block", "states": { "snowy": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -138,29 +118,17 @@ "localizedName": "Dirt", "states": { "snowy": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "variant": { - "dataMask": 3, - "values": { - "dirt": { - "data": 0 - }, - "coarse_dirt": { - "data": 1 - }, - "podzol": { - "data": 2 - } - } + "values": [ + "dirt", + "coarse_dirt", + "podzol" + ] } }, "material": { @@ -226,27 +194,14 @@ "localizedName": "Wooden Planks", "states": { "variant": { - "dataMask": 7, - "values": { - "oak": { - "data": 0 - }, - "spruce": { - "data": 1 - }, - "birch": { - "data": 2 - }, - "jungle": { - "data": 3 - }, - "acacia": { - "data": 4 - }, - "dark_oak": { - "data": 5 - } - } + "values": [ + "oak", + "spruce", + "birch", + "jungle", + "acacia", + "dark_oak" + ] } }, "material": { @@ -281,38 +236,20 @@ "localizedName": "Oak Sapling", "states": { "stage": { - "dataMask": 8, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 8 - } - } + "values": [ + "0", + "1" + ] }, "type": { - "dataMask": 7, - "values": { - "oak": { - "data": 0 - }, - "spruce": { - "data": 1 - }, - "birch": { - "data": 2 - }, - "jungle": { - "data": 3 - }, - "acacia": { - "data": 4 - }, - "dark_oak": { - "data": 5 - } - } + "values": [ + "oak", + "spruce", + "birch", + "jungle", + "acacia", + "dark_oak" + ] } }, "material": { @@ -378,57 +315,24 @@ "localizedName": "Water", "states": { "level": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -463,57 +367,24 @@ "localizedName": "Water", "states": { "level": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -548,57 +419,24 @@ "localizedName": "Lava", "states": { "level": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -633,57 +471,24 @@ "localizedName": "Lava", "states": { "level": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -718,15 +523,10 @@ "localizedName": "Sand", "states": { "variant": { - "dataMask": 1, - "values": { - "sand": { - "data": 0 - }, - "red_sand": { - "data": 1 - } - } + "values": [ + "sand", + "red_sand" + ] } }, "material": { @@ -885,77 +685,20 @@ "localizedName": "Wood", "states": { "axis": { - "dataMask": 12, - "values": { - "x": { - "data": 4, - "direction": [ - 1, - 0, - 0 - ] - }, - "-x": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "y": { - "data": 0, - "direction": [ - 0, - 1, - 0 - ] - }, - "-y": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "z": { - "data": 8, - "direction": [ - 0, - 0, - 1 - ] - }, - "-z": { - "data": 8, - "direction": [ - 0, - 0, - -1 - ] - }, - "none": { - "data": 12 - } - } + "values": [ + "x", + "y", + "z", + "none" + ] }, "variant": { - "dataMask": 3, - "values": { - "oak": { - "data": 0 - }, - "spruce": { - "data": 1 - }, - "birch": { - "data": 2 - }, - "jungle": { - "data": 3 - } - } + "values": [ + "oak", + "spruce", + "birch", + "jungle" + ] } }, "material": { @@ -990,43 +733,24 @@ "localizedName": "Leaves", "states": { "check_decay": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "decayable": { - "dataMask": 4, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 4 - } - } + "values": [ + "true", + "false" + ] }, "variant": { - "dataMask": 3, - "values": { - "oak": { - "data": 0 - }, - "spruce": { - "data": 1 - }, - "birch": { - "data": 2 - }, - "jungle": { - "data": 3 - } - } + "values": [ + "oak", + "spruce", + "birch", + "jungle" + ] } }, "material": { @@ -1061,15 +785,10 @@ "localizedName": "Sponge", "states": { "wet": { - "dataMask": 1, - "values": { - "true": { - "data": 1 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -1197,68 +916,20 @@ "localizedName": "Dispenser", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] }, "triggered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -1293,18 +964,11 @@ "localizedName": "Sandstone", "states": { "type": { - "dataMask": 3, - "values": { - "sandstone": { - "data": 0 - }, - "chiseled_sandstone": { - "data": 1 - }, - "smooth_sandstone": { - "data": 2 - } - } + "values": [ + "sandstone", + "chiseled_sandstone", + "smooth_sandstone" + ] } }, "material": { @@ -1367,66 +1031,27 @@ "legacyId": 26, "id": "minecraft:bed", "unlocalizedName": "tile.bed", - "localizedName": "Bed", + "localizedName": "tile.bed.name", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "occupied": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "part": { - "dataMask": 8, - "values": { - "head": { - "data": 8 - }, - "foot": { - "data": 0 - } - } + "values": [ + "head", + "foot" + ] } }, "material": { @@ -1461,38 +1086,20 @@ "localizedName": "Powered Rail", "states": { "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "shape": { - "dataMask": 7, - "values": { - "north_south": { - "data": 0 - }, - "east_west": { - "data": 1 - }, - "ascending_east": { - "data": 2 - }, - "ascending_west": { - "data": 3 - }, - "ascending_north": { - "data": 4 - }, - "ascending_south": { - "data": 5 - } - } + "values": [ + "north_south", + "east_west", + "ascending_east", + "ascending_west", + "ascending_north", + "ascending_south" + ] } }, "material": { @@ -1527,38 +1134,20 @@ "localizedName": "Detector Rail", "states": { "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "shape": { - "dataMask": 7, - "values": { - "north_south": { - "data": 0 - }, - "east_west": { - "data": 1 - }, - "ascending_east": { - "data": 2 - }, - "ascending_west": { - "data": 3 - }, - "ascending_north": { - "data": 4 - }, - "ascending_south": { - "data": 5 - } - } + "values": [ + "north_south", + "east_west", + "ascending_east", + "ascending_west", + "ascending_north", + "ascending_south" + ] } }, "material": { @@ -1593,68 +1182,20 @@ "localizedName": "Sticky Piston", "states": { "extended": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -1720,18 +1261,11 @@ "localizedName": "Grass", "states": { "type": { - "dataMask": 3, - "values": { - "dead_bush": { - "data": 0 - }, - "tall_grass": { - "data": 1 - }, - "fern": { - "data": 2 - } - } + "values": [ + "dead_bush", + "tall_grass", + "fern" + ] } }, "material": { @@ -1797,68 +1331,20 @@ "localizedName": "Piston", "states": { "extended": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -1893,79 +1379,26 @@ "localizedName": "Piston", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] }, "short": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "type": { - "dataMask": 8, - "values": { - "normal": { - "data": 0 - }, - "sticky": { - "data": 8 - } - } + "values": [ + "normal", + "sticky" + ] } }, "material": { @@ -2000,57 +1433,24 @@ "localizedName": "Wool", "states": { "color": { - "dataMask": 15, - "values": { - "white": { - "data": 0 - }, - "orange": { - "data": 1 - }, - "magenta": { - "data": 2 - }, - "light_blue": { - "data": 3 - }, - "yellow": { - "data": 4 - }, - "lime": { - "data": 5 - }, - "pink": { - "data": 6 - }, - "gray": { - "data": 7 - }, - "silver": { - "data": 8 - }, - "cyan": { - "data": 9 - }, - "purple": { - "data": 10 - }, - "blue": { - "data": 11 - }, - "brown": { - "data": 12 - }, - "green": { - "data": 13 - }, - "red": { - "data": 14 - }, - "black": { - "data": 15 - } - } + "values": [ + "white", + "orange", + "magenta", + "light_blue", + "yellow", + "lime", + "pink", + "gray", + "silver", + "cyan", + "purple", + "blue", + "brown", + "green", + "red", + "black" + ] } }, "material": { @@ -2085,68 +1485,20 @@ "localizedName": "tile.null.name", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] }, "type": { - "dataMask": 8, - "values": { - "normal": { - "data": 0 - }, - "sticky": { - "data": 8 - } - } + "values": [ + "normal", + "sticky" + ] } }, "material": { @@ -2181,12 +1533,9 @@ "localizedName": "Flower", "states": { "type": { - "dataMask": 0, - "values": { - "dandelion": { - "data": 0 - } - } + "values": [ + "dandelion" + ] } }, "material": { @@ -2221,36 +1570,17 @@ "localizedName": "Flower", "states": { "type": { - "dataMask": 15, - "values": { - "poppy": { - "data": 0 - }, - "blue_orchid": { - "data": 1 - }, - "allium": { - "data": 2 - }, - "houstonia": { - "data": 3 - }, - "red_tulip": { - "data": 4 - }, - "orange_tulip": { - "data": 5 - }, - "white_tulip": { - "data": 6 - }, - "pink_tulip": { - "data": 7 - }, - "oxeye_daisy": { - "data": 8 - } - } + "values": [ + "poppy", + "blue_orchid", + "allium", + "houstonia", + "red_tulip", + "orange_tulip", + "white_tulip", + "pink_tulip", + "oxeye_daisy" + ] } }, "material": { @@ -2409,44 +1739,22 @@ "localizedName": "Stone Slab", "states": { "seamless": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "variant": { - "dataMask": 7, - "values": { - "stone": { - "data": 0 - }, - "sandstone": { - "data": 1 - }, - "wood_old": { - "data": 2 - }, - "cobblestone": { - "data": 3 - }, - "brick": { - "data": 4 - }, - "stone_brick": { - "data": 5 - }, - "nether_brick": { - "data": 6 - }, - "quartz": { - "data": 7 - } - } + "values": [ + "stone", + "sandstone", + "wood_old", + "cobblestone", + "brick", + "stone_brick", + "nether_brick", + "quartz" + ] } }, "material": { @@ -2481,54 +1789,22 @@ "localizedName": "Stone Slab", "states": { "half": { - "dataMask": 8, - "values": { - "top": { - "data": 8, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "variant": { - "dataMask": 7, - "values": { - "stone": { - "data": 0 - }, - "sandstone": { - "data": 1 - }, - "wood_old": { - "data": 2 - }, - "cobblestone": { - "data": 3 - }, - "brick": { - "data": 4 - }, - "stone_brick": { - "data": 5 - }, - "nether_brick": { - "data": 6 - }, - "quartz": { - "data": 7 - } - } + "values": [ + "stone", + "sandstone", + "wood_old", + "cobblestone", + "brick", + "stone_brick", + "nether_brick", + "quartz" + ] } }, "material": { @@ -2594,15 +1870,10 @@ "localizedName": "TNT", "states": { "explode": { - "dataMask": 1, - "values": { - "true": { - "data": 1 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -2730,49 +2001,13 @@ "localizedName": "Torch", "states": { "facing": { - "dataMask": 7, - "values": { - "up": { - "data": 5, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 4, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 1, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -2807,112 +2042,54 @@ "localizedName": "Fire", "states": { "age": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] }, "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "up": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -2978,82 +2155,27 @@ "localizedName": "Oak Wood Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -3088,41 +2210,12 @@ "localizedName": "Chest", "states": { "facing": { - "dataMask": 7, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -3157,113 +2250,52 @@ "localizedName": "Redstone Dust", "states": { "east": { - "dataMask": 0, - "values": { - "up": { - "data": 0 - }, - "side": { - "data": 0 - }, - "none": { - "data": 0 - } - } + "values": [ + "up", + "side", + "none" + ] }, "north": { - "dataMask": 0, - "values": { - "up": { - "data": 0 - }, - "side": { - "data": 0 - }, - "none": { - "data": 0 - } - } + "values": [ + "up", + "side", + "none" + ] }, "power": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] }, "south": { - "dataMask": 0, - "values": { - "up": { - "data": 0 - }, - "side": { - "data": 0 - }, - "none": { - "data": 0 - } - } + "values": [ + "up", + "side", + "none" + ] }, "west": { - "dataMask": 0, - "values": { - "up": { - "data": 0 - }, - "side": { - "data": 0 - }, - "none": { - "data": 0 - } - } + "values": [ + "up", + "side", + "none" + ] } }, "material": { @@ -3391,33 +2423,16 @@ "localizedName": "Crops", "states": { "age": { - "dataMask": 7, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] } }, "material": { @@ -3452,33 +2467,16 @@ "localizedName": "Farmland", "states": { "moisture": { - "dataMask": 7, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] } }, "material": { @@ -3513,41 +2511,12 @@ "localizedName": "Furnace", "states": { "facing": { - "dataMask": 7, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -3582,41 +2551,12 @@ "localizedName": "Furnace", "states": { "facing": { - "dataMask": 7, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -3651,137 +2591,24 @@ "localizedName": "Sign", "states": { "rotation": { - "dataMask": 15, - "values": { - "0": { - "data": 0, - "direction": [ - 0.0, - 0.0, - -1.0 - ] - }, - "1": { - "data": 1, - "direction": [ - 0.5, - 0.0, - -1.0 - ] - }, - "2": { - "data": 2, - "direction": [ - 1.0, - 0.0, - -1.0 - ] - }, - "3": { - "data": 3, - "direction": [ - 1.0, - 0.0, - -0.5 - ] - }, - "4": { - "data": 4, - "direction": [ - 1.0, - 0.0, - 0.0 - ] - }, - "5": { - "data": 5, - "direction": [ - 1.0, - 0.0, - 0.5 - ] - }, - "6": { - "data": 6, - "direction": [ - 1.0, - 0.0, - 1.0 - ] - }, - "7": { - "data": 7, - "direction": [ - 0.5, - 0.0, - 1.0 - ] - }, - "8": { - "data": 8, - "direction": [ - 0.0, - 0.0, - 1.0 - ] - }, - "9": { - "data": 9, - "direction": [ - -0.5, - 0.0, - 1.0 - ] - }, - "10": { - "data": 10, - "direction": [ - -1.0, - 0.0, - 1.0 - ] - }, - "11": { - "data": 11, - "direction": [ - -1.0, - 0.0, - 0.5 - ] - }, - "12": { - "data": 12, - "direction": [ - -1.0, - 0.0, - 0.0 - ] - }, - "13": { - "data": 13, - "direction": [ - -1.0, - 0.0, - -0.5 - ] - }, - "14": { - "data": 14, - "direction": [ - -1.0, - 0.0, - -1.0 - ] - }, - "15": { - "data": 15, - "direction": [ - -0.5, - 0.0, - -1.0 - ] - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -3816,85 +2643,36 @@ "localizedName": "Oak Door", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 1, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 8, - "values": { - "upper": { - "data": 8 - }, - "lower": { - "data": 0 - } - } + "values": [ + "upper", + "lower" + ] }, "hinge": { - "dataMask": 0, - "values": { - "left": { - "data": 0 - }, - "right": { - "data": 0 - } - } + "values": [ + "left", + "right" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -3929,41 +2707,12 @@ "localizedName": "Ladder", "states": { "facing": { - "dataMask": 7, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -3998,39 +2747,18 @@ "localizedName": "Rail", "states": { "shape": { - "dataMask": 15, - "values": { - "north_south": { - "data": 0 - }, - "east_west": { - "data": 1 - }, - "ascending_east": { - "data": 2 - }, - "ascending_west": { - "data": 3 - }, - "ascending_north": { - "data": 4 - }, - "ascending_south": { - "data": 5 - }, - "south_east": { - "data": 6 - }, - "south_west": { - "data": 7 - }, - "north_west": { - "data": 8 - }, - "north_east": { - "data": 9 - } - } + "values": [ + "north_south", + "east_west", + "ascending_east", + "ascending_west", + "ascending_north", + "ascending_south", + "south_east", + "south_west", + "north_west", + "north_east" + ] } }, "material": { @@ -4065,82 +2793,27 @@ "localizedName": "Cobblestone Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -4175,41 +2848,12 @@ "localizedName": "Sign", "states": { "facing": { - "dataMask": 7, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -4244,64 +2888,22 @@ "localizedName": "Lever", "states": { "facing": { - "dataMask": 7, - "values": { - "down_x": { - "data": 0 - }, - "east": { - "data": 1, - "direction": [ - 1, - 0, - 0 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "north": { - "data": 4, - "direction": [ - 0, - 0, - -1 - ] - }, - "up_z": { - "data": 5 - }, - "up_x": { - "data": 6 - }, - "down_z": { - "data": 7 - } - } + "values": [ + "down_x", + "east", + "west", + "south", + "north", + "up_z", + "up_x", + "down_z" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -4336,15 +2938,10 @@ "localizedName": "Stone Pressure Plate", "states": { "powered": { - "dataMask": 1, - "values": { - "true": { - "data": 1 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -4379,85 +2976,36 @@ "localizedName": "Iron Door", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 1, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 8, - "values": { - "upper": { - "data": 8 - }, - "lower": { - "data": 0 - } - } + "values": [ + "upper", + "lower" + ] }, "hinge": { - "dataMask": 0, - "values": { - "left": { - "data": 0 - }, - "right": { - "data": 0 - } - } + "values": [ + "left", + "right" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -4492,15 +3040,10 @@ "localizedName": "Wooden Pressure Plate", "states": { "powered": { - "dataMask": 1, - "values": { - "true": { - "data": 1 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -4597,49 +3140,13 @@ "localizedName": "Redstone Torch", "states": { "facing": { - "dataMask": 7, - "values": { - "up": { - "data": 5, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 4, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 1, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -4674,49 +3181,13 @@ "localizedName": "Redstone Torch", "states": { "facing": { - "dataMask": 7, - "values": { - "up": { - "data": 5, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 4, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 1, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -4751,68 +3222,20 @@ "localizedName": "Button", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 5, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 4, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 1, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -4847,33 +3270,16 @@ "localizedName": "Snow", "states": { "layers": { - "dataMask": 7, - "values": { - "1": { - "data": 0 - }, - "2": { - "data": 1 - }, - "3": { - "data": 2 - }, - "4": { - "data": 3 - }, - "5": { - "data": 4 - }, - "6": { - "data": 5 - }, - "7": { - "data": 6 - }, - "8": { - "data": 7 - } - } + "values": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8" + ] } }, "material": { @@ -4970,57 +3376,24 @@ "localizedName": "Cactus", "states": { "age": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -5086,57 +3459,24 @@ "localizedName": "Sugar cane", "states": { "age": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -5171,15 +3511,10 @@ "localizedName": "Jukebox", "states": { "has_record": { - "dataMask": 1, - "values": { - "true": { - "data": 1 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -5214,48 +3549,28 @@ "localizedName": "Oak Fence", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -5290,41 +3605,12 @@ "localizedName": "Pumpkin", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -5452,41 +3738,10 @@ "localizedName": "Portal", "states": { "axis": { - "dataMask": 3, - "values": { - "x": { - "data": 1, - "direction": [ - 1, - 0, - 0 - ] - }, - "-x": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "z": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "-z": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - } - } + "values": [ + "x", + "z" + ] } }, "material": { @@ -5521,41 +3776,12 @@ "localizedName": "Jack o\u0027Lantern", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -5590,30 +3816,15 @@ "localizedName": "Cake", "states": { "bites": { - "dataMask": 7, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6" + ] } }, "material": { @@ -5648,69 +3859,26 @@ "localizedName": "Redstone Repeater", "states": { "delay": { - "dataMask": 12, - "values": { - "1": { - "data": 0 - }, - "2": { - "data": 4 - }, - "3": { - "data": 8 - }, - "4": { - "data": 12 - } - } + "values": [ + "1", + "2", + "3", + "4" + ] }, "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "locked": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -5745,69 +3913,26 @@ "localizedName": "Redstone Repeater", "states": { "delay": { - "dataMask": 12, - "values": { - "1": { - "data": 0 - }, - "2": { - "data": 4 - }, - "3": { - "data": 8 - }, - "4": { - "data": 12 - } - } + "values": [ + "1", + "2", + "3", + "4" + ] }, "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "locked": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -5842,57 +3967,24 @@ "localizedName": "Stained Glass", "states": { "color": { - "dataMask": 15, - "values": { - "white": { - "data": 0 - }, - "orange": { - "data": 1 - }, - "magenta": { - "data": 2 - }, - "light_blue": { - "data": 3 - }, - "yellow": { - "data": 4 - }, - "lime": { - "data": 5 - }, - "pink": { - "data": 6 - }, - "gray": { - "data": 7 - }, - "silver": { - "data": 8 - }, - "cyan": { - "data": 9 - }, - "purple": { - "data": 10 - }, - "blue": { - "data": 11 - }, - "brown": { - "data": 12 - }, - "green": { - "data": 13 - }, - "red": { - "data": 14 - }, - "black": { - "data": 15 - } - } + "values": [ + "white", + "orange", + "magenta", + "light_blue", + "yellow", + "lime", + "pink", + "gray", + "silver", + "cyan", + "purple", + "blue", + "brown", + "green", + "red", + "black" + ] } }, "material": { @@ -5927,73 +4019,24 @@ "localizedName": "Wooden Trapdoor", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 0, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 1, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 8, - "values": { - "top": { - "data": 8, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -6028,27 +4071,14 @@ "localizedName": "Stone Monster Egg", "states": { "variant": { - "dataMask": 7, - "values": { - "stone": { - "data": 0 - }, - "cobblestone": { - "data": 1 - }, - "stone_brick": { - "data": 2 - }, - "mossy_brick": { - "data": 3 - }, - "cracked_brick": { - "data": 4 - }, - "chiseled_brick": { - "data": 5 - } - } + "values": [ + "stone", + "cobblestone", + "stone_brick", + "mossy_brick", + "cracked_brick", + "chiseled_brick" + ] } }, "material": { @@ -6083,21 +4113,12 @@ "localizedName": "Stone Bricks", "states": { "variant": { - "dataMask": 3, - "values": { - "stonebrick": { - "data": 0 - }, - "mossy_stonebrick": { - "data": 1 - }, - "cracked_stonebrick": { - "data": 2 - }, - "chiseled_stonebrick": { - "data": 3 - } - } + "values": [ + "stonebrick", + "mossy_stonebrick", + "cracked_stonebrick", + "chiseled_stonebrick" + ] } }, "material": { @@ -6132,48 +4153,21 @@ "localizedName": "Mushroom", "states": { "variant": { - "dataMask": 15, - "values": { - "north_west": { - "data": 1 - }, - "north": { - "data": 2 - }, - "north_east": { - "data": 3 - }, - "west": { - "data": 4 - }, - "center": { - "data": 5 - }, - "east": { - "data": 6 - }, - "south_west": { - "data": 7 - }, - "south": { - "data": 8 - }, - "south_east": { - "data": 9 - }, - "stem": { - "data": 10 - }, - "all_inside": { - "data": 0 - }, - "all_outside": { - "data": 14 - }, - "all_stem": { - "data": 15 - } - } + "values": [ + "north_west", + "north", + "north_east", + "west", + "center", + "east", + "south_west", + "south", + "south_east", + "stem", + "all_inside", + "all_outside", + "all_stem" + ] } }, "material": { @@ -6208,48 +4202,21 @@ "localizedName": "Mushroom", "states": { "variant": { - "dataMask": 15, - "values": { - "north_west": { - "data": 1 - }, - "north": { - "data": 2 - }, - "north_east": { - "data": 3 - }, - "west": { - "data": 4 - }, - "center": { - "data": 5 - }, - "east": { - "data": 6 - }, - "south_west": { - "data": 7 - }, - "south": { - "data": 8 - }, - "south_east": { - "data": 9 - }, - "stem": { - "data": 10 - }, - "all_inside": { - "data": 0 - }, - "all_outside": { - "data": 14 - }, - "all_stem": { - "data": 15 - } - } + "values": [ + "north_west", + "north", + "north_east", + "west", + "center", + "east", + "south_west", + "south", + "south_east", + "stem", + "all_inside", + "all_outside", + "all_stem" + ] } }, "material": { @@ -6284,48 +4251,28 @@ "localizedName": "Iron Bars", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -6360,48 +4307,28 @@ "localizedName": "Glass Pane", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -6467,78 +4394,25 @@ "localizedName": "Pumpkin Stem", "states": { "age": { - "dataMask": 7, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] }, "facing": { - "dataMask": 0, - "values": { - "up": { - "data": 0, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 0, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 0, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -6573,78 +4447,25 @@ "localizedName": "Pumpkin Stem", "states": { "age": { - "dataMask": 7, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] }, "facing": { - "dataMask": 0, - "values": { - "up": { - "data": 0, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 0, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 0, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -6679,59 +4500,34 @@ "localizedName": "Vines", "states": { "east": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 1, - "values": { - "true": { - "data": 1 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "up": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 2, - "values": { - "true": { - "data": 2 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -6766,74 +4562,30 @@ "localizedName": "Oak Fence Gate", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "in_wall": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -6868,82 +4620,27 @@ "localizedName": "Brick Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -6978,82 +4675,27 @@ "localizedName": "Stone Brick Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -7088,15 +4730,10 @@ "localizedName": "Mycelium", "states": { "snowy": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -7193,48 +4830,28 @@ "localizedName": "Nether Brick Fence", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -7269,82 +4886,27 @@ "localizedName": "Nether Brick Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -7379,21 +4941,12 @@ "localizedName": "Nether Wart", "states": { "age": { - "dataMask": 3, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - } - } + "values": [ + "0", + "1", + "2", + "3" + ] } }, "material": { @@ -7459,37 +5012,22 @@ "localizedName": "Brewing Stand", "states": { "has_bottle_0": { - "dataMask": 1, - "values": { - "true": { - "data": 1 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "has_bottle_1": { - "dataMask": 2, - "values": { - "true": { - "data": 2 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "has_bottle_2": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -7524,21 +5062,12 @@ "localizedName": "Cauldron", "states": { "level": { - "dataMask": 3, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - } - } + "values": [ + "0", + "1", + "2", + "3" + ] } }, "material": { @@ -7604,52 +5133,18 @@ "localizedName": "End Portal", "states": { "eye": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -7808,27 +5303,14 @@ "localizedName": "Wood Slab", "states": { "variant": { - "dataMask": 7, - "values": { - "oak": { - "data": 0 - }, - "spruce": { - "data": 1 - }, - "birch": { - "data": 2 - }, - "jungle": { - "data": 3 - }, - "acacia": { - "data": 4 - }, - "dark_oak": { - "data": 5 - } - } + "values": [ + "oak", + "spruce", + "birch", + "jungle", + "acacia", + "dark_oak" + ] } }, "material": { @@ -7863,48 +5345,20 @@ "localizedName": "Wood Slab", "states": { "half": { - "dataMask": 8, - "values": { - "top": { - "data": 8, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "variant": { - "dataMask": 7, - "values": { - "oak": { - "data": 0 - }, - "spruce": { - "data": 1 - }, - "birch": { - "data": 2 - }, - "jungle": { - "data": 3 - }, - "acacia": { - "data": 4 - }, - "dark_oak": { - "data": 5 - } - } + "values": [ + "oak", + "spruce", + "birch", + "jungle", + "acacia", + "dark_oak" + ] } }, "material": { @@ -7939,55 +5393,19 @@ "localizedName": "Cocoa", "states": { "age": { - "dataMask": 12, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 4 - }, - "2": { - "data": 8 - } - } + "values": [ + "0", + "1", + "2" + ] }, "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -8022,82 +5440,27 @@ "localizedName": "Sandstone Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -8163,41 +5526,12 @@ "localizedName": "Ender Chest", "states": { "facing": { - "dataMask": 7, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -8232,63 +5566,24 @@ "localizedName": "Tripwire Hook", "states": { "attached": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -8323,81 +5618,46 @@ "localizedName": "Tripwire", "states": { "attached": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "disarmed": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 1, - "values": { - "true": { - "data": 1 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -8463,82 +5723,27 @@ "localizedName": "Spruce Wood Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -8573,82 +5778,27 @@ "localizedName": "Birch Wood Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -8683,82 +5833,27 @@ "localizedName": "Jungle Wood Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -8793,68 +5888,20 @@ "localizedName": "Command Block", "states": { "conditional": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -8920,70 +5967,40 @@ "localizedName": "Cobblestone Wall", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "up": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "variant": { - "dataMask": 1, - "values": { - "cobblestone": { - "data": 0 - }, - "mossy_cobblestone": { - "data": 1 - } - } + "values": [ + "cobblestone", + "mossy_cobblestone" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -9018,128 +6035,50 @@ "localizedName": "Flower Pot", "states": { "contents": { - "dataMask": 0, - "values": { - "empty": { - "data": 0 - }, - "rose": { - "data": 0 - }, - "blue_orchid": { - "data": 0 - }, - "allium": { - "data": 0 - }, - "houstonia": { - "data": 0 - }, - "red_tulip": { - "data": 0 - }, - "orange_tulip": { - "data": 0 - }, - "white_tulip": { - "data": 0 - }, - "pink_tulip": { - "data": 0 - }, - "oxeye_daisy": { - "data": 0 - }, - "dandelion": { - "data": 0 - }, - "oak_sapling": { - "data": 0 - }, - "spruce_sapling": { - "data": 0 - }, - "birch_sapling": { - "data": 0 - }, - "jungle_sapling": { - "data": 0 - }, - "acacia_sapling": { - "data": 0 - }, - "dark_oak_sapling": { - "data": 0 - }, - "mushroom_red": { - "data": 0 - }, - "mushroom_brown": { - "data": 0 - }, - "dead_bush": { - "data": 0 - }, - "fern": { - "data": 0 - }, - "cactus": { - "data": 0 - } - } + "values": [ + "empty", + "rose", + "blue_orchid", + "allium", + "houstonia", + "red_tulip", + "orange_tulip", + "white_tulip", + "pink_tulip", + "oxeye_daisy", + "dandelion", + "oak_sapling", + "spruce_sapling", + "birch_sapling", + "jungle_sapling", + "acacia_sapling", + "dark_oak_sapling", + "mushroom_red", + "mushroom_brown", + "dead_bush", + "fern", + "cactus" + ] }, "legacy_data": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -9174,33 +6113,16 @@ "localizedName": "Carrots", "states": { "age": { - "dataMask": 7, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] } }, "material": { @@ -9235,33 +6157,16 @@ "localizedName": "Potatoes", "states": { "age": { - "dataMask": 7, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] } }, "material": { @@ -9296,68 +6201,20 @@ "localizedName": "Button", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 5, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 4, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 1, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -9392,68 +6249,20 @@ "localizedName": "tile.skull.skeleton.name", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] }, "nodrop": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -9488,55 +6297,19 @@ "localizedName": "Anvil", "states": { "damage": { - "dataMask": 12, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 4 - }, - "2": { - "data": 8 - } - } + "values": [ + "0", + "1", + "2" + ] }, "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -9571,41 +6344,12 @@ "localizedName": "Trapped Chest", "states": { "facing": { - "dataMask": 7, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -9640,57 +6384,24 @@ "localizedName": "Weighted Pressure Plate (Light)", "states": { "power": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -9725,57 +6436,24 @@ "localizedName": "Weighted Pressure Plate (Heavy)", "states": { "power": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -9810,63 +6488,24 @@ "localizedName": "Redstone Comparator", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "mode": { - "dataMask": 4, - "values": { - "compare": { - "data": 0 - }, - "subtract": { - "data": 4 - } - } + "values": [ + "compare", + "subtract" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -9901,63 +6540,24 @@ "localizedName": "Redstone Comparator", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "mode": { - "dataMask": 4, - "values": { - "compare": { - "data": 0 - }, - "subtract": { - "data": 4 - } - } + "values": [ + "compare", + "subtract" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -9992,57 +6592,24 @@ "localizedName": "Daylight Sensor", "states": { "power": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -10139,60 +6706,19 @@ "localizedName": "Hopper", "states": { "enabled": { - "dataMask": 8, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 8 - } - } + "values": [ + "true", + "false" + ] }, "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -10227,24 +6753,13 @@ "localizedName": "Block of Quartz", "states": { "variant": { - "dataMask": 7, - "values": { - "default": { - "data": 0 - }, - "chiseled": { - "data": 1 - }, - "lines_y": { - "data": 2 - }, - "lines_x": { - "data": 3 - }, - "lines_z": { - "data": 4 - } - } + "values": [ + "default", + "chiseled", + "lines_y", + "lines_x", + "lines_z" + ] } }, "material": { @@ -10279,82 +6794,27 @@ "localizedName": "Quartz Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -10389,38 +6849,20 @@ "localizedName": "Activator Rail", "states": { "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "shape": { - "dataMask": 7, - "values": { - "north_south": { - "data": 0 - }, - "east_west": { - "data": 1 - }, - "ascending_east": { - "data": 2 - }, - "ascending_west": { - "data": 3 - }, - "ascending_north": { - "data": 4 - }, - "ascending_south": { - "data": 5 - } - } + "values": [ + "north_south", + "east_west", + "ascending_east", + "ascending_west", + "ascending_north", + "ascending_south" + ] } }, "material": { @@ -10455,68 +6897,20 @@ "localizedName": "Dropper", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] }, "triggered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -10551,57 +6945,24 @@ "localizedName": "Stained Terracotta", "states": { "color": { - "dataMask": 15, - "values": { - "white": { - "data": 0 - }, - "orange": { - "data": 1 - }, - "magenta": { - "data": 2 - }, - "light_blue": { - "data": 3 - }, - "yellow": { - "data": 4 - }, - "lime": { - "data": 5 - }, - "pink": { - "data": 6 - }, - "gray": { - "data": 7 - }, - "silver": { - "data": 8 - }, - "cyan": { - "data": 9 - }, - "purple": { - "data": 10 - }, - "blue": { - "data": 11 - }, - "brown": { - "data": 12 - }, - "green": { - "data": 13 - }, - "red": { - "data": 14 - }, - "black": { - "data": 15 - } - } + "values": [ + "white", + "orange", + "magenta", + "light_blue", + "yellow", + "lime", + "pink", + "gray", + "silver", + "cyan", + "purple", + "blue", + "brown", + "green", + "red", + "black" + ] } }, "material": { @@ -10636,101 +6997,48 @@ "localizedName": "Stained Glass Pane", "states": { "color": { - "dataMask": 15, - "values": { - "white": { - "data": 0 - }, - "orange": { - "data": 1 - }, - "magenta": { - "data": 2 - }, - "light_blue": { - "data": 3 - }, - "yellow": { - "data": 4 - }, - "lime": { - "data": 5 - }, - "pink": { - "data": 6 - }, - "gray": { - "data": 7 - }, - "silver": { - "data": 8 - }, - "cyan": { - "data": 9 - }, - "purple": { - "data": 10 - }, - "blue": { - "data": 11 - }, - "brown": { - "data": 12 - }, - "green": { - "data": 13 - }, - "red": { - "data": 14 - }, - "black": { - "data": 15 - } - } + "values": [ + "white", + "orange", + "magenta", + "light_blue", + "yellow", + "lime", + "pink", + "gray", + "silver", + "cyan", + "purple", + "blue", + "brown", + "green", + "red", + "black" + ] }, "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -10765,37 +7073,22 @@ "localizedName": "Leaves", "states": { "check_decay": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "decayable": { - "dataMask": 4, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 4 - } - } + "values": [ + "true", + "false" + ] }, "variant": { - "dataMask": 1, - "values": { - "acacia": { - "data": 0 - }, - "dark_oak": { - "data": 1 - } - } + "values": [ + "acacia", + "dark_oak" + ] } }, "material": { @@ -10830,71 +7123,18 @@ "localizedName": "Wood", "states": { "axis": { - "dataMask": 12, - "values": { - "x": { - "data": 4, - "direction": [ - 1, - 0, - 0 - ] - }, - "-x": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "y": { - "data": 0, - "direction": [ - 0, - 1, - 0 - ] - }, - "-y": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "z": { - "data": 8, - "direction": [ - 0, - 0, - 1 - ] - }, - "-z": { - "data": 8, - "direction": [ - 0, - 0, - -1 - ] - }, - "none": { - "data": 12 - } - } + "values": [ + "x", + "y", + "z", + "none" + ] }, "variant": { - "dataMask": 1, - "values": { - "acacia": { - "data": 0 - }, - "dark_oak": { - "data": 1 - } - } + "values": [ + "acacia", + "dark_oak" + ] } }, "material": { @@ -10929,82 +7169,27 @@ "localizedName": "Acacia Wood Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -11039,82 +7224,27 @@ "localizedName": "Dark Oak Wood Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -11211,73 +7341,24 @@ "localizedName": "Iron Trapdoor", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 0, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 1, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 8, - "values": { - "top": { - "data": 8, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -11312,18 +7393,11 @@ "localizedName": "Prismarine", "states": { "variant": { - "dataMask": 3, - "values": { - "prismarine": { - "data": 0 - }, - "prismarine_bricks": { - "data": 1 - }, - "dark_prismarine": { - "data": 2 - } - } + "values": [ + "prismarine", + "prismarine_bricks", + "dark_prismarine" + ] } }, "material": { @@ -11389,57 +7463,11 @@ "localizedName": "Hay Bale", "states": { "axis": { - "dataMask": 12, - "values": { - "x": { - "data": 4, - "direction": [ - 1, - 0, - 0 - ] - }, - "-x": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "y": { - "data": 0, - "direction": [ - 0, - 1, - 0 - ] - }, - "-y": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "z": { - "data": 8, - "direction": [ - 0, - 0, - 1 - ] - }, - "-z": { - "data": 8, - "direction": [ - 0, - 0, - -1 - ] - } - } + "values": [ + "x", + "y", + "z" + ] } }, "material": { @@ -11474,57 +7502,24 @@ "localizedName": "Carpet", "states": { "color": { - "dataMask": 15, - "values": { - "white": { - "data": 0 - }, - "orange": { - "data": 1 - }, - "magenta": { - "data": 2 - }, - "light_blue": { - "data": 3 - }, - "yellow": { - "data": 4 - }, - "lime": { - "data": 5 - }, - "pink": { - "data": 6 - }, - "gray": { - "data": 7 - }, - "silver": { - "data": 8 - }, - "cyan": { - "data": 9 - }, - "purple": { - "data": 10 - }, - "blue": { - "data": 11 - }, - "brown": { - "data": 12 - }, - "green": { - "data": 13 - }, - "red": { - "data": 14 - }, - "black": { - "data": 15 - } - } + "values": [ + "white", + "orange", + "magenta", + "light_blue", + "yellow", + "lime", + "pink", + "gray", + "silver", + "cyan", + "purple", + "blue", + "brown", + "green", + "red", + "black" + ] } }, "material": { @@ -11652,75 +7647,28 @@ "localizedName": "Plant", "states": { "facing": { - "dataMask": 0, - "values": { - "north": { - "data": 0, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 0, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 10, - "values": { - "upper": { - "data": 10 - }, - "lower": { - "data": 0 - } - } + "values": [ + "upper", + "lower" + ] }, "variant": { - "dataMask": 7, - "values": { - "sunflower": { - "data": 0 - }, - "syringa": { - "data": 1 - }, - "double_grass": { - "data": 2 - }, - "double_fern": { - "data": 3 - }, - "double_rose": { - "data": 4 - }, - "paeonia": { - "data": 5 - } - } + "values": [ + "sunflower", + "syringa", + "double_grass", + "double_fern", + "double_rose", + "paeonia" + ] } }, "material": { @@ -11755,137 +7703,24 @@ "localizedName": "White Banner", "states": { "rotation": { - "dataMask": 15, - "values": { - "0": { - "data": 0, - "direction": [ - 0.0, - 0.0, - -1.0 - ] - }, - "1": { - "data": 1, - "direction": [ - 0.5, - 0.0, - -1.0 - ] - }, - "2": { - "data": 2, - "direction": [ - 1.0, - 0.0, - -1.0 - ] - }, - "3": { - "data": 3, - "direction": [ - 1.0, - 0.0, - -0.5 - ] - }, - "4": { - "data": 4, - "direction": [ - 1.0, - 0.0, - 0.0 - ] - }, - "5": { - "data": 5, - "direction": [ - 1.0, - 0.0, - 0.5 - ] - }, - "6": { - "data": 6, - "direction": [ - 1.0, - 0.0, - 1.0 - ] - }, - "7": { - "data": 7, - "direction": [ - 0.5, - 0.0, - 1.0 - ] - }, - "8": { - "data": 8, - "direction": [ - 0.0, - 0.0, - 1.0 - ] - }, - "9": { - "data": 9, - "direction": [ - -0.5, - 0.0, - 1.0 - ] - }, - "10": { - "data": 10, - "direction": [ - -1.0, - 0.0, - 1.0 - ] - }, - "11": { - "data": 11, - "direction": [ - -1.0, - 0.0, - 0.5 - ] - }, - "12": { - "data": 12, - "direction": [ - -1.0, - 0.0, - 0.0 - ] - }, - "13": { - "data": 13, - "direction": [ - -1.0, - 0.0, - -0.5 - ] - }, - "14": { - "data": 14, - "direction": [ - -1.0, - 0.0, - -1.0 - ] - }, - "15": { - "data": 15, - "direction": [ - -0.5, - 0.0, - -1.0 - ] - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -11920,41 +7755,12 @@ "localizedName": "White Banner", "states": { "facing": { - "dataMask": 7, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -11989,57 +7795,24 @@ "localizedName": "Daylight Sensor", "states": { "power": { - "dataMask": 15, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - }, - "6": { - "data": 6 - }, - "7": { - "data": 7 - }, - "8": { - "data": 8 - }, - "9": { - "data": 9 - }, - "10": { - "data": 10 - }, - "11": { - "data": 11 - }, - "12": { - "data": 12 - }, - "13": { - "data": 13 - }, - "14": { - "data": 14 - }, - "15": { - "data": 15 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] } }, "material": { @@ -12074,18 +7847,11 @@ "localizedName": "Red Sandstone", "states": { "type": { - "dataMask": 3, - "values": { - "red_sandstone": { - "data": 0 - }, - "chiseled_red_sandstone": { - "data": 1 - }, - "smooth_red_sandstone": { - "data": 2 - } - } + "values": [ + "red_sandstone", + "chiseled_red_sandstone", + "smooth_red_sandstone" + ] } }, "material": { @@ -12120,82 +7886,27 @@ "localizedName": "Red Sandstone Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -12230,23 +7941,15 @@ "localizedName": "Red Sandstone Slab", "states": { "seamless": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "variant": { - "dataMask": 0, - "values": { - "red_sandstone": { - "data": 0 - } - } + "values": [ + "red_sandstone" + ] } }, "material": { @@ -12281,33 +7984,15 @@ "localizedName": "Red Sandstone Slab", "states": { "half": { - "dataMask": 8, - "values": { - "top": { - "data": 8, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "variant": { - "dataMask": 0, - "values": { - "red_sandstone": { - "data": 0 - } - } + "values": [ + "red_sandstone" + ] } }, "material": { @@ -12342,74 +8027,30 @@ "localizedName": "Spruce Fence Gate", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "in_wall": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -12444,74 +8085,30 @@ "localizedName": "Birch Fence Gate", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "in_wall": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -12546,74 +8143,30 @@ "localizedName": "Jungle Fence Gate", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "in_wall": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -12648,74 +8201,30 @@ "localizedName": "Dark Oak Fence Gate", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "in_wall": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -12750,74 +8259,30 @@ "localizedName": "Acacia Fence Gate", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "in_wall": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -12852,48 +8317,28 @@ "localizedName": "Spruce Fence", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -12928,48 +8373,28 @@ "localizedName": "Birch Fence", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13004,48 +8429,28 @@ "localizedName": "Jungle Fence", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13080,48 +8485,28 @@ "localizedName": "Dark Oak Fence", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13156,48 +8541,28 @@ "localizedName": "Acacia Fence", "states": { "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13232,85 +8597,36 @@ "localizedName": "Spruce Door", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 1, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 8, - "values": { - "upper": { - "data": 8 - }, - "lower": { - "data": 0 - } - } + "values": [ + "upper", + "lower" + ] }, "hinge": { - "dataMask": 0, - "values": { - "left": { - "data": 0 - }, - "right": { - "data": 0 - } - } + "values": [ + "left", + "right" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13345,85 +8661,36 @@ "localizedName": "Birch Door", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 1, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 8, - "values": { - "upper": { - "data": 8 - }, - "lower": { - "data": 0 - } - } + "values": [ + "upper", + "lower" + ] }, "hinge": { - "dataMask": 0, - "values": { - "left": { - "data": 0 - }, - "right": { - "data": 0 - } - } + "values": [ + "left", + "right" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13458,85 +8725,36 @@ "localizedName": "Jungle Door", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 1, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 8, - "values": { - "upper": { - "data": 8 - }, - "lower": { - "data": 0 - } - } + "values": [ + "upper", + "lower" + ] }, "hinge": { - "dataMask": 0, - "values": { - "left": { - "data": 0 - }, - "right": { - "data": 0 - } - } + "values": [ + "left", + "right" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13571,85 +8789,36 @@ "localizedName": "Acacia Door", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 1, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 8, - "values": { - "upper": { - "data": 8 - }, - "lower": { - "data": 0 - } - } + "values": [ + "upper", + "lower" + ] }, "hinge": { - "dataMask": 0, - "values": { - "left": { - "data": 0 - }, - "right": { - "data": 0 - } - } + "values": [ + "left", + "right" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13684,85 +8853,36 @@ "localizedName": "Dark Oak Door", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 1, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 2, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 8, - "values": { - "upper": { - "data": 8 - }, - "lower": { - "data": 0 - } - } + "values": [ + "upper", + "lower" + ] }, "hinge": { - "dataMask": 0, - "values": { - "left": { - "data": 0 - }, - "right": { - "data": 0 - } - } + "values": [ + "left", + "right" + ] }, "open": { - "dataMask": 4, - "values": { - "true": { - "data": 4 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "powered": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13797,57 +8917,14 @@ "localizedName": "End Rod", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -13882,70 +8959,40 @@ "localizedName": "Chorus Plant", "states": { "down": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "east": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "north": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "south": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "up": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "west": { - "dataMask": 0, - "values": { - "true": { - "data": 0 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -13980,27 +9027,14 @@ "localizedName": "Chorus Flower", "states": { "age": { - "dataMask": 7, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - }, - "4": { - "data": 4 - }, - "5": { - "data": 5 - } - } + "values": [ + "0", + "1", + "2", + "3", + "4", + "5" + ] } }, "material": { @@ -14066,57 +9100,11 @@ "localizedName": "Purpur Pillar", "states": { "axis": { - "dataMask": 12, - "values": { - "x": { - "data": 4, - "direction": [ - 1, - 0, - 0 - ] - }, - "-x": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "y": { - "data": 0, - "direction": [ - 0, - 1, - 0 - ] - }, - "-y": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "z": { - "data": 8, - "direction": [ - 0, - 0, - 1 - ] - }, - "-z": { - "data": 8, - "direction": [ - 0, - 0, - -1 - ] - } - } + "values": [ + "x", + "y", + "z" + ] } }, "material": { @@ -14151,82 +9139,27 @@ "localizedName": "Purpur Stairs", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 3, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 2, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 0, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] }, "half": { - "dataMask": 4, - "values": { - "top": { - "data": 4, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "shape": { - "dataMask": 0, - "values": { - "straight": { - "data": 0 - }, - "inner_left": { - "data": 0 - }, - "inner_right": { - "data": 0 - }, - "outer_left": { - "data": 0 - }, - "outer_right": { - "data": 0 - } - } + "values": [ + "straight", + "inner_left", + "inner_right", + "outer_left", + "outer_right" + ] } }, "material": { @@ -14261,12 +9194,9 @@ "localizedName": "Purpur Slab", "states": { "variant": { - "dataMask": 0, - "values": { - "default": { - "data": 0 - } - } + "values": [ + "default" + ] } }, "material": { @@ -14301,33 +9231,15 @@ "localizedName": "Purpur Slab", "states": { "half": { - "dataMask": 8, - "values": { - "top": { - "data": 8, - "direction": [ - 0, - 1, - 0 - ] - }, - "bottom": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - } - } + "values": [ + "top", + "bottom" + ] }, "variant": { - "dataMask": 0, - "values": { - "default": { - "data": 0 - } - } + "values": [ + "default" + ] } }, "material": { @@ -14393,21 +9305,12 @@ "localizedName": "Beetroots", "states": { "age": { - "dataMask": 3, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - } - } + "values": [ + "0", + "1", + "2", + "3" + ] } }, "material": { @@ -14504,68 +9407,20 @@ "localizedName": "Repeating Command Block", "states": { "conditional": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -14600,68 +9455,20 @@ "localizedName": "Chain Command Block", "states": { "conditional": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] }, "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -14696,21 +9503,12 @@ "localizedName": "Frosted Ice", "states": { "age": { - "dataMask": 3, - "values": { - "0": { - "data": 0 - }, - "1": { - "data": 1 - }, - "2": { - "data": 2 - }, - "3": { - "data": 3 - } - } + "values": [ + "0", + "1", + "2", + "3" + ] } }, "material": { @@ -14838,57 +9636,11 @@ "localizedName": "Bone Block", "states": { "axis": { - "dataMask": 12, - "values": { - "x": { - "data": 4, - "direction": [ - 1, - 0, - 0 - ] - }, - "-x": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "y": { - "data": 0, - "direction": [ - 0, - 1, - 0 - ] - }, - "-y": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "z": { - "data": 8, - "direction": [ - 0, - 0, - 1 - ] - }, - "-z": { - "data": 8, - "direction": [ - 0, - 0, - -1 - ] - } - } + "values": [ + "x", + "y", + "z" + ] } }, "material": { @@ -14954,68 +9706,20 @@ "localizedName": "Observer", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] }, "powered": { - "dataMask": 8, - "values": { - "true": { - "data": 8 - }, - "false": { - "data": 0 - } - } + "values": [ + "true", + "false" + ] } }, "material": { @@ -15050,57 +9754,14 @@ "localizedName": "White Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15135,57 +9796,14 @@ "localizedName": "Orange Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15220,57 +9838,14 @@ "localizedName": "Magenta Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15305,57 +9880,14 @@ "localizedName": "Light Blue Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15390,57 +9922,14 @@ "localizedName": "Yellow Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15475,57 +9964,14 @@ "localizedName": "Lime Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15560,57 +10006,14 @@ "localizedName": "Pink Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15645,57 +10048,14 @@ "localizedName": "Gray Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15730,57 +10090,14 @@ "localizedName": "Light Gray Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15815,57 +10132,14 @@ "localizedName": "Cyan Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15900,57 +10174,14 @@ "localizedName": "Purple Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -15985,57 +10216,14 @@ "localizedName": "Blue Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16070,57 +10258,14 @@ "localizedName": "Brown Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16155,57 +10300,14 @@ "localizedName": "Green Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16240,57 +10342,14 @@ "localizedName": "Red Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16325,57 +10384,14 @@ "localizedName": "Black Shulker Box", "states": { "facing": { - "dataMask": 7, - "values": { - "down": { - "data": 0, - "direction": [ - 0, - -1, - 0 - ] - }, - "up": { - "data": 1, - "direction": [ - 0, - 1, - 0 - ] - }, - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 3, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 4, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 5, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "down", + "up", + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16410,41 +10426,12 @@ "localizedName": "White Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16479,41 +10466,12 @@ "localizedName": "Orange Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16548,41 +10506,12 @@ "localizedName": "Magenta Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16617,41 +10546,12 @@ "localizedName": "Light Blue Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16686,41 +10586,12 @@ "localizedName": "Yellow Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16755,41 +10626,12 @@ "localizedName": "Lime Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16824,41 +10666,12 @@ "localizedName": "Pink Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16893,41 +10706,12 @@ "localizedName": "Gray Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -16962,41 +10746,12 @@ "localizedName": "Light Gray Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -17031,41 +10786,12 @@ "localizedName": "Cyan Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -17100,41 +10826,12 @@ "localizedName": "Purple Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -17169,41 +10866,12 @@ "localizedName": "Blue Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -17238,41 +10906,12 @@ "localizedName": "Brown Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -17307,41 +10946,12 @@ "localizedName": "Green Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -17376,41 +10986,12 @@ "localizedName": "Red Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -17445,41 +11026,12 @@ "localizedName": "Black Glazed Terracotta", "states": { "facing": { - "dataMask": 3, - "values": { - "north": { - "data": 2, - "direction": [ - 0, - 0, - -1 - ] - }, - "south": { - "data": 0, - "direction": [ - 0, - 0, - 1 - ] - }, - "west": { - "data": 1, - "direction": [ - -1, - 0, - 0 - ] - }, - "east": { - "data": 3, - "direction": [ - 1, - 0, - 0 - ] - } - } + "values": [ + "north", + "south", + "west", + "east" + ] } }, "material": { @@ -17514,57 +11066,24 @@ "localizedName": "tile.concrete.name", "states": { "color": { - "dataMask": 15, - "values": { - "white": { - "data": 0 - }, - "orange": { - "data": 1 - }, - "magenta": { - "data": 2 - }, - "light_blue": { - "data": 3 - }, - "yellow": { - "data": 4 - }, - "lime": { - "data": 5 - }, - "pink": { - "data": 6 - }, - "gray": { - "data": 7 - }, - "silver": { - "data": 8 - }, - "cyan": { - "data": 9 - }, - "purple": { - "data": 10 - }, - "blue": { - "data": 11 - }, - "brown": { - "data": 12 - }, - "green": { - "data": 13 - }, - "red": { - "data": 14 - }, - "black": { - "data": 15 - } - } + "values": [ + "white", + "orange", + "magenta", + "light_blue", + "yellow", + "lime", + "pink", + "gray", + "silver", + "cyan", + "purple", + "blue", + "brown", + "green", + "red", + "black" + ] } }, "material": { @@ -17599,57 +11118,24 @@ "localizedName": "tile.concretePowder.name", "states": { "color": { - "dataMask": 15, - "values": { - "white": { - "data": 0 - }, - "orange": { - "data": 1 - }, - "magenta": { - "data": 2 - }, - "light_blue": { - "data": 3 - }, - "yellow": { - "data": 4 - }, - "lime": { - "data": 5 - }, - "pink": { - "data": 6 - }, - "gray": { - "data": 7 - }, - "silver": { - "data": 8 - }, - "cyan": { - "data": 9 - }, - "purple": { - "data": 10 - }, - "blue": { - "data": 11 - }, - "brown": { - "data": 12 - }, - "green": { - "data": 13 - }, - "red": { - "data": 14 - }, - "black": { - "data": 15 - } - } + "values": [ + "white", + "orange", + "magenta", + "light_blue", + "yellow", + "lime", + "pink", + "gray", + "silver", + "cyan", + "purple", + "blue", + "brown", + "green", + "red", + "black" + ] } }, "material": { @@ -17684,21 +11170,12 @@ "localizedName": "Structure Block", "states": { "mode": { - "dataMask": 3, - "values": { - "save": { - "data": 0 - }, - "load": { - "data": 1 - }, - "corner": { - "data": 2 - }, - "data": { - "data": 3 - } - } + "values": [ + "save", + "load", + "corner", + "data" + ] } }, "material": { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 5984a330a..bd9512688 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -31,6 +31,9 @@ import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -84,6 +87,7 @@ import net.minecraft.world.gen.feature.WorldGenTaiga2; import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.fml.common.registry.ForgeRegistries; import javax.annotation.Nullable; @@ -116,7 +120,7 @@ public class ForgeWorld extends AbstractWorld { */ ForgeWorld(World world) { checkNotNull(world); - this.worldRef = new WeakReference(world); + this.worldRef = new WeakReference<>(world); } /** @@ -155,7 +159,7 @@ public class ForgeWorld extends AbstractWorld { } @Override - public boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException { + public boolean setBlock(Vector position, BlockStateHolder block, boolean notifyAndLight) throws WorldEditException { checkNotNull(position); checkNotNull(block); @@ -168,17 +172,17 @@ public class ForgeWorld extends AbstractWorld { Chunk chunk = world.getChunkFromChunkCoords(x >> 4, z >> 4); BlockPos pos = new BlockPos(x, y, z); IBlockState old = chunk.getBlockState(pos); - IBlockState newState = Block.getBlockById(block.getId()).getStateFromMeta(block.getData()); + IBlockState newState = Block.getBlockById(block.getBlockType().getLegacyId()).getDefaultState(); // TODO .getStateFromMeta(block.getData()); IBlockState successState = chunk.setBlockState(pos, newState); boolean successful = successState != null; // Create the TileEntity if (successful) { - if (block.hasNbtData()) { + if (block instanceof BaseBlock && ((BaseBlock) block).hasNbtData()) { // Kill the old TileEntity world.removeTileEntity(pos); - NBTTagCompound nativeTag = NBTConverter.toNative(block.getNbtData()); - nativeTag.setString("id", block.getNbtId()); + NBTTagCompound nativeTag = NBTConverter.toNative(((BaseBlock) block).getNbtData()); + nativeTag.setString("id", ((BaseBlock) block).getNbtId()); TileEntityUtils.setTileEntity(world, position, nativeTag); } } @@ -347,7 +351,24 @@ public class ForgeWorld extends AbstractWorld { } @Override - public BaseBlock getBlock(Vector position) { + public BlockState getBlock(Vector position) { + World world = getWorld(); + BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); + IBlockState state = world.getBlockState(pos); + + return BlockTypes.getBlockType(ForgeRegistries.BLOCKS.getKey(state.getBlock()).toString()).getDefaultState(); // TODO Data + } + + @Override + public LazyBlock getLazyBlock(Vector position) { + World world = getWorld(); + BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); + IBlockState state = world.getBlockState(pos); + return new LazyBlock(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state), this, position); + } + + @Override + public BaseBlock getFullBlock(Vector position) { World world = getWorld(); BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); IBlockState state = world.getBlockState(pos); @@ -360,14 +381,6 @@ public class ForgeWorld extends AbstractWorld { } } - @Override - public BaseBlock getLazyBlock(Vector position) { - World world = getWorld(); - BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - IBlockState state = world.getBlockState(pos); - return new LazyBlock(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state), this, position); - } - @Override public int hashCode() { return getWorld().hashCode(); diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index 4586b0bb6..54c523843 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -35,10 +36,15 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.registry.WorldData; +import com.sk89q.worldedit.world.registry.state.State; +import com.sk89q.worldedit.world.registry.state.value.StateValue; import org.spongepowered.api.Sponge; import org.spongepowered.api.block.BlockSnapshot; import org.spongepowered.api.block.BlockState; +import org.spongepowered.api.block.BlockType; +import org.spongepowered.api.block.BlockTypes; import org.spongepowered.api.block.tileentity.TileEntity; +import org.spongepowered.api.block.trait.BlockTrait; import org.spongepowered.api.data.key.Keys; import org.spongepowered.api.data.property.block.GroundLuminanceProperty; import org.spongepowered.api.data.property.block.SkyLuminanceProperty; @@ -51,7 +57,10 @@ import javax.annotation.Nullable; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkNotNull; @@ -107,14 +116,26 @@ public abstract class SpongeWorld extends AbstractWorld { return getWorld().getName(); } - protected abstract BlockState getBlockState(BaseBlock block); + @SuppressWarnings("WeakerAccess") + protected BlockState getBlockState(BlockStateHolder block) { + if (block instanceof com.sk89q.worldedit.blocks.type.BlockState) { + BlockState state = Sponge.getRegistry().getType(BlockType.class, block.getBlockType().getId()).orElse(BlockTypes.AIR).getDefaultState(); + for (Map.Entry entry : block.getStates().entrySet()) { + // TODO Convert across states + } + return state; + } else { + throw new UnsupportedOperationException("Missing Sponge adapter for WorldEdit!"); + } + } + @SuppressWarnings("WeakerAccess") protected abstract void applyTileEntityData(TileEntity entity, BaseBlock block); private static final BlockSnapshot.Builder builder = BlockSnapshot.builder(); @Override - public boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException { + public boolean setBlock(Vector position, BlockStateHolder block, boolean notifyAndLight) throws WorldEditException { checkNotNull(position); checkNotNull(block); @@ -133,9 +154,9 @@ public abstract class SpongeWorld extends AbstractWorld { snapshot.restore(true, notifyAndLight ? BlockChangeFlags.ALL : BlockChangeFlags.NONE); // Create the TileEntity - if (block.hasNbtData()) { + if (block instanceof BaseBlock && ((BaseBlock) block).hasNbtData()) { // Kill the old TileEntity - world.getTileEntity(pos).ifPresent(tileEntity -> applyTileEntityData(tileEntity, block)); + world.getTileEntity(pos).ifPresent(tileEntity -> applyTileEntityData(tileEntity, (BaseBlock) block)); } return true; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java index f0279d8a1..f971c3c78 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java @@ -22,7 +22,9 @@ package com.sk89q.worldedit.sponge.config; import com.google.common.reflect.TypeToken; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.session.SessionManager; +import com.sk89q.worldedit.world.registry.BundledItemData; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import ninja.leaping.configurate.ConfigurationOptions; import ninja.leaping.configurate.commented.CommentedConfigurationNode; @@ -58,6 +60,10 @@ public class ConfigurateConfiguration extends LocalConfiguration { profile = node.getNode("debug").getBoolean(profile); wandItem = node.getNode("wand-item").getString(wandItem); + try { + wandItem = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(wandItem)); + } catch (Throwable e) { + } defaultChangeLimit = Math.max(-1, node.getNode("limits", "max-blocks-changed", "default").getInt(defaultChangeLimit)); maxChangeLimit = Math.max(-1, node.getNode("limits", "max-blocks-changed", "maximum").getInt(maxChangeLimit)); @@ -98,6 +104,10 @@ public class ConfigurateConfiguration extends LocalConfiguration { useInventoryCreativeOverride = node.getNode("use-inventory", "creative-mode-overrides").getBoolean(useInventoryCreativeOverride); navigationWand = node.getNode("navigation-wand", "item").getString(navigationWand); + try { + navigationWand = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(navigationWand)); + } catch (Throwable e) { + } navigationWandMaxDistance = node.getNode("navigation-wand", "max-distance").getInt(navigationWandMaxDistance); navigationUseGlass = node.getNode("navigation", "use-glass").getBoolean(navigationUseGlass); From 282eca766367c3ce5f263d98643be17f0f4a74b6 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 19 Jun 2018 10:53:15 +1000 Subject: [PATCH 20/74] Added a category system and refactored registries --- ...itWorldData.java => BukkitRegistries.java} | 10 +- .../bukkit/BukkitServerInterface.java | 9 +- .../sk89q/worldedit/bukkit/BukkitWorld.java | 11 +- .../java/com/sk89q/worldedit/EditSession.java | 12 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 90 +-------------- .../blocks/type/BlockCategories.java | 108 ++++++++++++++++++ .../worldedit/blocks/type/BlockCategory.java | 70 ++++++++++++ .../worldedit/blocks/type/ItemCategories.java | 102 +++++++++++++++++ .../worldedit/blocks/type/ItemCategory.java | 73 ++++++++++++ .../worldedit/command/BiomeCommands.java | 7 +- .../worldedit/command/ClipboardCommands.java | 6 +- .../command/FlattenedClipboardTransform.java | 18 +-- .../worldedit/command/SchematicCommands.java | 11 +- .../worldedit/command/UtilityCommands.java | 8 +- .../worldedit/command/tool/AreaPickaxe.java | 10 +- .../command/tool/FloatingTreeRemover.java | 24 ++-- .../command/tool/brush/ButcherBrush.java | 2 +- .../command/tool/brush/ClipboardBrush.java | 2 +- .../command/util/CreatureButcher.java | 5 +- .../worldedit/command/util/EntityRemover.java | 10 +- .../extension/factory/DefaultItemParser.java | 4 +- .../extension/factory/DefaultMaskParser.java | 4 +- .../extension/platform/Platform.java | 8 +- .../extent/clipboard/io/ClipboardReader.java | 5 +- .../extent/clipboard/io/ClipboardWriter.java | 4 +- .../extent/clipboard/io/SchematicReader.java | 8 +- .../transform/BlockTransformExtent.java | 23 ++-- .../function/mask/ExistingBlockMask.java | 3 +- .../internal/command/WorldEditBinding.java | 4 +- .../worldedit/session/ClipboardHolder.java | 24 +--- .../sk89q/worldedit/session/PasteBuilder.java | 14 +-- .../com/sk89q/worldedit/world/NullWorld.java | 10 +- .../java/com/sk89q/worldedit/world/World.java | 10 +- .../world/registry/BlockCategoryRegistry.java | 29 +++++ ...dWorldData.java => BundledRegistries.java} | 22 +++- .../world/registry/CategoryRegistry.java | 44 +++++++ .../world/registry/ItemCategoryRegistry.java | 29 +++++ .../registry/NullBlockCategoryRegistry.java | 38 ++++++ .../registry/NullItemCategoryRegistry.java | 38 ++++++ .../{WorldData.java => Registries.java} | 19 ++- .../transform/BlockTransformExtentTest.java | 4 +- .../sk89q/worldedit/forge/ForgePlatform.java | 34 +----- ...rgeWorldData.java => ForgeRegistries.java} | 8 +- .../com/sk89q/worldedit/forge/ForgeWorld.java | 10 +- .../worldedit/sponge/SpongePlatform.java | 29 ++--- ...geWorldData.java => SpongeRegistries.java} | 8 +- .../sk89q/worldedit/sponge/SpongeWorld.java | 10 +- 47 files changed, 715 insertions(+), 316 deletions(-) rename worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/{BukkitWorldData.java => BukkitRegistries.java} (83%) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategory.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategory.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockCategoryRegistry.java rename worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/{BundledWorldData.java => BundledRegistries.java} (70%) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/CategoryRegistry.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemCategoryRegistry.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java rename worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/{WorldData.java => Registries.java} (77%) rename worldedit-forge/src/main/java/com/sk89q/worldedit/forge/{ForgeWorldData.java => ForgeRegistries.java} (86%) rename worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/{SpongeWorldData.java => SpongeRegistries.java} (83%) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorldData.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitRegistries.java similarity index 83% rename from worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorldData.java rename to worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitRegistries.java index c6bd94a54..65346d683 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorldData.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitRegistries.java @@ -20,20 +20,20 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.world.registry.BiomeRegistry; -import com.sk89q.worldedit.world.registry.BundledWorldData; +import com.sk89q.worldedit.world.registry.BundledRegistries; /** * World data for the Bukkit platform. */ -class BukkitWorldData extends BundledWorldData { +class BukkitRegistries extends BundledRegistries { - private static final BukkitWorldData INSTANCE = new BukkitWorldData(); + private static final BukkitRegistries INSTANCE = new BukkitRegistries(); private final BiomeRegistry biomeRegistry = new BukkitBiomeRegistry(); /** * Create a new instance. */ - BukkitWorldData() { + BukkitRegistries() { } @Override @@ -46,7 +46,7 @@ class BukkitWorldData extends BundledWorldData { * * @return an instance */ - public static BukkitWorldData getInstance() { + public static BukkitRegistries getInstance() { return INSTANCE; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java index 91db498b7..8c125dc9b 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java @@ -30,8 +30,8 @@ import com.sk89q.worldedit.extension.platform.Preference; import com.sk89q.worldedit.util.command.CommandMapping; import com.sk89q.worldedit.util.command.Description; import com.sk89q.worldedit.util.command.Dispatcher; +import com.sk89q.worldedit.world.registry.Registries; import org.bukkit.Bukkit; -import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.entity.EntityType; @@ -48,13 +48,11 @@ public class BukkitServerInterface implements MultiUserPlatform { public Server server; public WorldEditPlugin plugin; private CommandRegistration dynamicCommands; - private BukkitBiomeRegistry biomes; private boolean hookingEvents; public BukkitServerInterface(WorldEditPlugin plugin, Server server) { this.plugin = plugin; this.server = server; - this.biomes = new BukkitBiomeRegistry(); dynamicCommands = new CommandRegistration(plugin); } @@ -63,9 +61,8 @@ public class BukkitServerInterface implements MultiUserPlatform { } @Override - public int resolveItem(String name) { - Material mat = Material.matchMaterial(name); - return mat == null ? 0 : mat.getId(); + public Registries getRegistries() { + return BukkitRegistries.getInstance(); } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index df412f695..eac643e49 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -40,7 +40,7 @@ import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.registry.BundledBlockData; -import com.sk89q.worldedit.world.registry.WorldData; +import com.sk89q.worldedit.world.registry.Registries; import org.bukkit.Effect; import org.bukkit.TreeType; import org.bukkit.World; @@ -354,11 +354,6 @@ public class BukkitWorld extends AbstractWorld { return true; } - @Override - public WorldData getWorldData() { - return BukkitWorldData.getInstance(); - } - @Override public void simulateBlockMine(Vector pt) { getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).breakNaturally(); @@ -367,7 +362,9 @@ public class BukkitWorld extends AbstractWorld { @Override public com.sk89q.worldedit.blocks.type.BlockState getBlock(Vector position) { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - BlockType blockType = BlockTypes.getBlockType(BundledBlockData.getInstance().fromLegacyId(bukkitBlock.getTypeId())); + BlockType blockType = BlockTypes.getBlockType( + BundledBlockData.getInstance().fromLegacyId(bukkitBlock.getTypeId()) + ); return blockType.getDefaultState(); // TODO Data } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 4287db4ff..543cda5a3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -2165,12 +2165,12 @@ public class EditSession implements Extent { } private static final Vector[] recurseDirections = { - PlayerDirection.NORTH.vector(), - PlayerDirection.EAST.vector(), - PlayerDirection.SOUTH.vector(), - PlayerDirection.WEST.vector(), - PlayerDirection.UP.vector(), - PlayerDirection.DOWN.vector(), + Direction.NORTH.toVector(), + Direction.EAST.toVector(), + Direction.SOUTH.toVector(), + Direction.WEST.toVector(), + Direction.UP.toVector(), + Direction.DOWN.toVector(), }; private static double lengthSq(double x, double y, double z) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 9c5d227a7..45db309f8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.CuboidClipboard.FlipDirection; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; @@ -102,7 +101,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { */ public BaseBlock(BlockState state, @Nullable CompoundTag nbtData) { this.blockState = state; - setNbtData(nbtData); + this.nbtData = nbtData; } /** @@ -126,7 +125,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { @Deprecated public BaseBlock(int id, int data, @Nullable CompoundTag nbtData) { this(id); - setNbtData(nbtData); + this.nbtData = nbtData; } /** @@ -174,6 +173,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { * * @return The state map */ + @Override public Map getStates() { return this.blockState.getStates(); } @@ -194,19 +194,11 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { * @param state The state to get the value for * @return The state value */ + @Override public StateValue getState(State state) { return this.blockState.getState(state); } - /** - * Set the block's data value. - * - * @param data block data value - */ - @Deprecated - public void setData(int data) { - } - @Override public boolean hasNbtData() { return getNbtData() != null; @@ -237,80 +229,6 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { throw new UnsupportedOperationException("This class is immutable."); } - /** - * Returns true if it's air. - * - * @return if air - */ - public boolean isAir() { - return getBlockType() == BlockTypes.AIR; - } - - /** - * Rotate this block 90 degrees. - * - * @return new data value - * @deprecated Use {@link BlockData#rotate90(int, int)} - */ - @Deprecated - public int rotate90() { - int newData = BlockData.rotate90(getBlockType().getLegacyId(), getData()); - setData(newData); - return newData; - } - - /** - * Rotate this block -90 degrees. - * - * @return new data value - * @deprecated Use {@link BlockData#rotate90Reverse(int, int)} - */ - @Deprecated - public int rotate90Reverse() { - int newData = BlockData.rotate90Reverse(getBlockType().getLegacyId(), getData()); - setData((short) newData); - return newData; - } - - /** - * Cycle the damage value of the block forward or backward - * - * @param increment 1 for forward, -1 for backward - * @return new data value - * @deprecated Use {@link BlockData#cycle(int, int, int)} - */ - @Deprecated - public int cycleData(int increment) { - int newData = BlockData.cycle(getBlockType().getLegacyId(), getData(), increment); - setData((short) newData); - return newData; - } - - /** - * Flip this block. - * - * @return this block - * @deprecated Use {@link BlockData#flip(int, int)} - */ - @Deprecated - public BaseBlock flip() { - setData((short) BlockData.flip(getBlockType().getLegacyId(), getData())); - return this; - } - - /** - * Flip this block. - * - * @param direction direction to flip in - * @return this block - * @deprecated Use {@link BlockData#flip(int, int, FlipDirection)} - */ - @Deprecated - public BaseBlock flip(FlipDirection direction) { - setData((short) BlockData.flip(getBlockType().getLegacyId(), getData(), direction)); - return this; - } - /** * Checks whether the type ID and data value are equal. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java new file mode 100644 index 000000000..25b324cc0 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java @@ -0,0 +1,108 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; + +/** + * Stores a list of categories of Block Types. + */ +public class BlockCategories { + + private BlockCategories() { + } + + public static final BlockCategory ACACIA_LOGS = new BlockCategory("minecraft:acacia_logs"); + public static final BlockCategory ANVIL = new BlockCategory("minecraft:anvil"); + public static final BlockCategory BANNERS = new BlockCategory("minecraft:banners"); + public static final BlockCategory BIRCH_LOGS = new BlockCategory("minecraft:birch_logs"); + public static final BlockCategory BUTTONS = new BlockCategory("minecraft:buttons"); + public static final BlockCategory CARPETS = new BlockCategory("minecraft:carpets"); + public static final BlockCategory CORAL = new BlockCategory("minecraft:coral"); + public static final BlockCategory CORAL_PLANTS = new BlockCategory("minecraft:coral_plants"); + public static final BlockCategory DARK_OAK_LOGS = new BlockCategory("minecraft:dark_oak_logs"); + public static final BlockCategory DOORS = new BlockCategory("minecraft:doors"); + public static final BlockCategory ENDERMAN_HOLDABLE = new BlockCategory("minecraft:enderman_holdable"); + public static final BlockCategory FLOWER_POTS = new BlockCategory("minecraft:flower_pots"); + public static final BlockCategory ICE = new BlockCategory("minecraft:ice"); + public static final BlockCategory JUNGLE_LOGS = new BlockCategory("minecraft:jungle_logs"); + public static final BlockCategory LEAVES = new BlockCategory("minecraft:leaves"); + public static final BlockCategory LOGS = new BlockCategory("minecraft:logs"); + public static final BlockCategory OAK_LOGS = new BlockCategory("minecraft:oak_logs"); + public static final BlockCategory PLANKS = new BlockCategory("minecraft:planks"); + public static final BlockCategory RAILS = new BlockCategory("minecraft:rails"); + public static final BlockCategory SAND = new BlockCategory("minecraft:sand"); + public static final BlockCategory SAPLINGS = new BlockCategory("minecraft:saplings"); + public static final BlockCategory SLABS = new BlockCategory("minecraft:slabs"); + public static final BlockCategory SPRUCE_LOGS = new BlockCategory("minecraft:spruce_logs"); + public static final BlockCategory STAIRS = new BlockCategory("minecraft:stairs"); + public static final BlockCategory STONE_BRICKS = new BlockCategory("minecraft:stone_bricks"); + public static final BlockCategory VALID_SPAWN = new BlockCategory("minecraft:valid_spawn"); + public static final BlockCategory WOODEN_BUTTONS = new BlockCategory("minecraft:wooden_buttons"); + public static final BlockCategory WOODEN_DOORS = new BlockCategory("minecraft:wooden_doors"); + public static final BlockCategory WOODEN_PRESSURE_PLATES = new BlockCategory("minecraft:wooden_pressure_plates"); + public static final BlockCategory WOODEN_SLABS = new BlockCategory("minecraft:wooden_slabs"); + public static final BlockCategory WOODEN_STAIRS = new BlockCategory("minecraft:wooden_stairs"); + public static final BlockCategory WOOL = new BlockCategory("minecraft:wool"); + + // Fluids + public static final BlockCategory LAVA = new BlockCategory("minecraft:lava"); + public static final BlockCategory WATER = new BlockCategory("minecraft:water"); + + private static final Map categoryMapping = new HashMap<>(); + + static { + for (Field field : BlockCategories.class.getFields()) { + if (field.getType() == BlockCategory.class) { + try { + registerCategory((BlockCategory) field.get(null)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + } + + public static void registerCategory(BlockCategory blockCategory) { + if (categoryMapping.containsKey(blockCategory.getId()) && !blockCategory.getId().startsWith("minecraft:")) { + throw new IllegalArgumentException("Existing category with this ID already registered"); + } + + categoryMapping.put(blockCategory.getId(), blockCategory); + } + + @Nullable + public static BlockCategory getBlockType(String id) { + // If it has no namespace, assume minecraft. + if (id != null && !id.contains(":")) { + id = "minecraft:" + id; + } + return categoryMapping.get(id); + } + + public static Collection values() { + return categoryMapping.values(); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategory.java new file mode 100644 index 000000000..ca7831ef9 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategory.java @@ -0,0 +1,70 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.platform.Capability; + +import java.util.Set; + +/** + * A category of blocks. This is due to the splitting up of + * blocks such as wool into separate ids. + */ +public class BlockCategory { + + private final String id; + + public BlockCategory(String id) { + this.id = id; + } + + public String getId() { + return this.id; + } + + public Set getBlockTypes() { + return WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries() + .getBlockCategoryRegistry().getCategorisedByName(this.id); + } + + /** + * Checks whether the BlocKType is contained within + * this category. + * + * @param blockType The blocktype + * @return If it's a part of this category + */ + public boolean contains(BlockType blockType) { + return getBlockTypes().contains(blockType); + } + + /** + * Checks whether the BlockStateHolder is contained within + * this category. + * + * @param blockStateHolder The blockstateholder + * @return If it's a part of this category + */ + public boolean contains(BlockStateHolder blockStateHolder) { + return getBlockTypes().contains(blockStateHolder.getBlockType()); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java new file mode 100644 index 000000000..2a6a35a70 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java @@ -0,0 +1,102 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; + +/** + * Stores a list of categories of Item Types. + */ +public class ItemCategories { + + private ItemCategories() { + } + + public static final ItemCategory ACACIA_LOGS = new ItemCategory("minecraft:acacia_logs"); + public static final ItemCategory ANVIL = new ItemCategory("minecraft:anvil"); + public static final ItemCategory BANNERS = new ItemCategory("minecraft:banners"); + public static final ItemCategory BIRCH_LOGS = new ItemCategory("minecraft:birch_logs"); + public static final ItemCategory BOATS = new ItemCategory("minecraft:boats"); + public static final ItemCategory BUTTONS = new ItemCategory("minecraft:buttons"); + public static final ItemCategory CARPETS = new ItemCategory("minecraft:carpets"); + public static final ItemCategory CORAL = new ItemCategory("minecraft:coral"); + public static final ItemCategory CORAL_PLANTS = new ItemCategory("minecraft:coral_plants"); + public static final ItemCategory DARK_OAK_LOGS = new ItemCategory("minecraft:dark_oak_logs"); + public static final ItemCategory DOORS = new ItemCategory("minecraft:doors"); + public static final ItemCategory FISHES = new ItemCategory("minecraft:fishes"); + public static final ItemCategory JUNGLE_LOGS = new ItemCategory("minecraft:jungle_logs"); + public static final ItemCategory LEAVES = new ItemCategory("minecraft:leaves"); + public static final ItemCategory LOGS = new ItemCategory("minecraft:logs"); + public static final ItemCategory OAK_LOGS = new ItemCategory("minecraft:oak_logs"); + public static final ItemCategory PLANKS = new ItemCategory("minecraft:planks"); + public static final ItemCategory RAILS = new ItemCategory("minecraft:rails"); + public static final ItemCategory SAND = new ItemCategory("minecraft:sand"); + public static final ItemCategory SAPLINGS = new ItemCategory("minecraft:saplings"); + public static final ItemCategory SLABS = new ItemCategory("minecraft:slabs"); + public static final ItemCategory SPRUCE_LOGS = new ItemCategory("minecraft:spruce_logs"); + public static final ItemCategory STAIRS = new ItemCategory("minecraft:stairs"); + public static final ItemCategory STONE_BRICKS = new ItemCategory("minecraft:stone_bricks"); + public static final ItemCategory WOODEN_BUTTONS = new ItemCategory("minecraft:wooden_buttons"); + public static final ItemCategory WOODEN_DOORS = new ItemCategory("minecraft:wooden_doors"); + public static final ItemCategory WOODEN_PRESSURE_PLATES = new ItemCategory("minecraft:wooden_pressure_plates"); + public static final ItemCategory WOODEN_SLABS = new ItemCategory("minecraft:wooden_slabs"); + public static final ItemCategory WOODEN_STAIRS = new ItemCategory("minecraft:wooden_stairs"); + public static final ItemCategory WOOL = new ItemCategory("minecraft:wool"); + + private static final Map categoryMapping = new HashMap<>(); + + static { + for (Field field : ItemCategories.class.getFields()) { + if (field.getType() == ItemCategory.class) { + try { + registerCategory((ItemCategory) field.get(null)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + } + + public static void registerCategory(ItemCategory itemCategory) { + if (categoryMapping.containsKey(itemCategory.getId()) && !itemCategory.getId().startsWith("minecraft:")) { + throw new IllegalArgumentException("Existing category with this ID already registered"); + } + + categoryMapping.put(itemCategory.getId(), itemCategory); + } + + @Nullable + public static ItemCategory getBlockType(String id) { + // If it has no namespace, assume minecraft. + if (id != null && !id.contains(":")) { + id = "minecraft:" + id; + } + return categoryMapping.get(id); + } + + public static Collection values() { + return categoryMapping.values(); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategory.java new file mode 100644 index 000000000..6784be079 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategory.java @@ -0,0 +1,73 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.blocks.BaseItem; +import com.sk89q.worldedit.extension.platform.Capability; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +/** + * A category of items. This is due to the splitting up of + * items such as wool into separate ids. + */ +public class ItemCategory { + + private final String id; + + public ItemCategory(String id) { + this.id = id; + } + + public String getId() { + return this.id; + } + + public Set getItemTypes() { + return WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries() + .getItemCategoryRegistry().getCategorisedByName(this.id); + } + + /** + * Checks whether the ItemType is contained within + * this category. + * + * @param itemType The itemType + * @return If it's a part of this category + */ + public boolean contains(ItemType itemType) { + return getItemTypes().contains(itemType); + } + + /** + * Checks whether the BaseItem is contained within + * this category. + * + * @param baseItem The item + * @return If it's a part of this category + */ + public boolean contains(BaseItem baseItem) { + return getItemTypes().contains(baseItem.getType()); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java index fdf4a39f5..94cd303ea 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java @@ -30,6 +30,7 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.function.FlatRegionFunction; import com.sk89q.worldedit.function.FlatRegionMaskingFilter; import com.sk89q.worldedit.function.biome.BiomeReplace; @@ -91,7 +92,8 @@ public class BiomeCommands { offset = (page - 1) * 19; } - BiomeRegistry biomeRegistry = player.getWorld().getWorldData().getBiomeRegistry(); + BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); List biomes = biomeRegistry.getBiomes(); int totalPages = biomes.size() / 19 + 1; player.print("Available Biomes (page " + page + "/" + totalPages + ") :"); @@ -125,7 +127,8 @@ public class BiomeCommands { ) @CommandPermissions("worldedit.biome.info") public void biomeInfo(Player player, LocalSession session, CommandContext args) throws WorldEditException { - BiomeRegistry biomeRegistry = player.getWorld().getWorldData().getBiomeRegistry(); + BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); Set biomes = new HashSet<>(); String qualifier; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 9d7cb265a..3feca48b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -89,7 +89,7 @@ public class ClipboardCommands { copy.setSourceMask(mask); } Operations.completeLegacy(copy); - session.setClipboard(new ClipboardHolder(clipboard, editSession.getWorld().getWorldData())); + session.setClipboard(new ClipboardHolder(clipboard)); player.print(region.getArea() + " block(s) were copied."); } @@ -122,7 +122,7 @@ public class ClipboardCommands { copy.setSourceMask(mask); } Operations.completeLegacy(copy); - session.setClipboard(new ClipboardHolder(clipboard, editSession.getWorld().getWorldData())); + session.setClipboard(new ClipboardHolder(clipboard)); player.print(region.getArea() + " block(s) were copied."); } @@ -153,7 +153,7 @@ public class ClipboardCommands { Vector to = atOrigin ? clipboard.getOrigin() : session.getPlacementPosition(player); Operation operation = holder - .createPaste(editSession, editSession.getWorld().getWorldData()) + .createPaste(editSession) .to(to) .ignoreAirBlocks(ignoreAirBlocks) .build(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/FlattenedClipboardTransform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/FlattenedClipboardTransform.java index 70adc7803..b15d444d9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/FlattenedClipboardTransform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/FlattenedClipboardTransform.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.clipboard.Clipboard; @@ -30,9 +32,6 @@ import com.sk89q.worldedit.math.transform.CombinedTransform; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.world.registry.WorldData; - -import static com.google.common.base.Preconditions.checkNotNull; /** * Helper class to 'bake' a transform into a clipboard. @@ -46,22 +45,18 @@ class FlattenedClipboardTransform { private final Clipboard original; private final Transform transform; - private final WorldData worldData; /** * Create a new instance. * * @param original the original clipboard * @param transform the transform - * @param worldData the world data instance */ - private FlattenedClipboardTransform(Clipboard original, Transform transform, WorldData worldData) { + private FlattenedClipboardTransform(Clipboard original, Transform transform) { checkNotNull(original); checkNotNull(transform); - checkNotNull(worldData); this.original = original; this.transform = transform; - this.worldData = worldData; } /** @@ -122,7 +117,7 @@ class FlattenedClipboardTransform { * @return the operation */ public Operation copyTo(Extent target) { - BlockTransformExtent extent = new BlockTransformExtent(original, transform, worldData.getBlockRegistry()); + BlockTransformExtent extent = new BlockTransformExtent(original, transform); ForwardExtentCopy copy = new ForwardExtentCopy(extent, original.getRegion(), original.getOrigin(), target, original.getOrigin()); copy.setTransform(transform); return copy; @@ -133,11 +128,10 @@ class FlattenedClipboardTransform { * * @param original the original clipboard * @param transform the transform - * @param worldData the world data instance * @return a builder */ - public static FlattenedClipboardTransform transform(Clipboard original, Transform transform, WorldData worldData) { - return new FlattenedClipboardTransform(original, transform, worldData); + public static FlattenedClipboardTransform transform(Clipboard original, Transform transform) { + return new FlattenedClipboardTransform(original, transform); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 9d14467a6..f3744bcb5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -44,7 +44,7 @@ import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; import com.sk89q.worldedit.util.io.Closer; import com.sk89q.worldedit.util.io.file.FilenameException; -import com.sk89q.worldedit.world.registry.WorldData; +import com.sk89q.worldedit.world.registry.Registries; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; @@ -111,9 +111,8 @@ public class SchematicCommands { BufferedInputStream bis = closer.register(new BufferedInputStream(fis)); ClipboardReader reader = format.getReader(bis); - WorldData worldData = player.getWorld().getWorldData(); - Clipboard clipboard = reader.read(player.getWorld().getWorldData()); - session.setClipboard(new ClipboardHolder(clipboard, worldData)); + Clipboard clipboard = reader.read(); + session.setClipboard(new ClipboardHolder(clipboard)); log.info(player.getName() + " loaded " + f.getCanonicalPath()); player.print(filename + " loaded. Paste it with //paste"); @@ -150,7 +149,7 @@ public class SchematicCommands { // If we have a transform, bake it into the copy if (!transform.isIdentity()) { - FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform, holder.getWorldData()); + FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform); target = new BlockArrayClipboard(result.getTransformedRegion()); target.setOrigin(clipboard.getOrigin()); Operations.completeLegacy(result.copyTo(target)); @@ -170,7 +169,7 @@ public class SchematicCommands { FileOutputStream fos = closer.register(new FileOutputStream(f)); BufferedOutputStream bos = closer.register(new BufferedOutputStream(fos)); ClipboardWriter writer = closer.register(format.getWriter(bos)); - writer.write(target, holder.getWorldData()); + writer.write(target); log.info(player.getName() + " saved " + f.getCanonicalPath()); player.print(filename + " saved."); } catch (IOException e) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index a46e803da..447e42c7b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -448,12 +448,12 @@ public class UtilityCommands { } else { entities = editSession.getEntities(); } - visitors.add(new EntityVisitor(entities.iterator(), flags.createFunction(editSession.getWorld().getWorldData().getEntityRegistry()))); + visitors.add(new EntityVisitor(entities.iterator(), flags.createFunction())); } else { Platform platform = we.getPlatformManager().queryCapability(Capability.WORLD_EDITING); for (World world : platform.getWorlds()) { List entities = world.getEntities(); - visitors.add(new EntityVisitor(entities.iterator(), flags.createFunction(world.getWorldData().getEntityRegistry()))); + visitors.add(new EntityVisitor(entities.iterator(), flags.createFunction())); } } @@ -508,12 +508,12 @@ public class UtilityCommands { } else { entities = editSession.getEntities(); } - visitors.add(new EntityVisitor(entities.iterator(), remover.createFunction(editSession.getWorld().getWorldData().getEntityRegistry()))); + visitors.add(new EntityVisitor(entities.iterator(), remover.createFunction())); } else { Platform platform = we.getPlatformManager().queryCapability(Capability.WORLD_EDITING); for (World world : platform.getWorlds()) { List entities = world.getEntities(); - visitors.add(new EntityVisitor(entities.iterator(), remover.createFunction(world.getWorldData().getEntityRegistry()))); + visitors.add(new EntityVisitor(entities.iterator(), remover.createFunction())); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java index fef394793..f5bde5bf2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java @@ -19,8 +19,12 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; @@ -33,7 +37,7 @@ import com.sk89q.worldedit.world.World; */ public class AreaPickaxe implements BlockTool { - private static final BaseBlock air = new BaseBlock(BlockTypes.AIR); + private static final BlockState air = BlockTypes.AIR.getDefaultState(); private int range; public AreaPickaxe(int range) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index b5ea93730..a6f766bd3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -19,13 +19,18 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; +import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; @@ -38,7 +43,7 @@ import java.util.Set; * to anything else) */ public class FloatingTreeRemover implements BlockTool { - private static final BaseBlock AIR = new BaseBlock(BlockTypes.AIR); + private static final BlockState AIR = BlockTypes.AIR.getDefaultState(); private int rangeSq; public FloatingTreeRemover() { @@ -55,6 +60,7 @@ public class FloatingTreeRemover implements BlockTool { Player player, LocalSession session, Location clicked) { final World world = (World) clicked.getExtent(); + final BlockState state = world.getBlock(clicked.toVector()); switch (world.getLazyBlock(clicked.toVector()).getId()) { case BlockID.LOG: @@ -103,12 +109,12 @@ public class FloatingTreeRemover implements BlockTool { } private Vector[] recurseDirections = { - PlayerDirection.NORTH.vector(), - PlayerDirection.EAST.vector(), - PlayerDirection.SOUTH.vector(), - PlayerDirection.WEST.vector(), - PlayerDirection.UP.vector(), - PlayerDirection.DOWN.vector(), + Direction.NORTH.toVector(), + Direction.EAST.toVector(), + Direction.SOUTH.toVector(), + Direction.WEST.toVector(), + Direction.UP.toVector(), + Direction.DOWN.toVector(), }; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/ButcherBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/ButcherBrush.java index b949d6b0e..175cc32ae 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/ButcherBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/ButcherBrush.java @@ -43,7 +43,7 @@ public class ButcherBrush implements Brush { public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { CylinderRegion region = CylinderRegion.createRadius(editSession, position, size); List entities = editSession.getEntities(region); - Operations.completeLegacy(new EntityVisitor(entities.iterator(), flags.createFunction(editSession.getWorld().getWorldData().getEntityRegistry()))); + Operations.completeLegacy(new EntityVisitor(entities.iterator(), flags.createFunction())); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/ClipboardBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/ClipboardBrush.java index 4417d1a35..184480787 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/ClipboardBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/ClipboardBrush.java @@ -48,7 +48,7 @@ public class ClipboardBrush implements Brush { Vector centerOffset = region.getCenter().subtract(clipboard.getOrigin()); Operation operation = holder - .createPaste(editSession, editSession.getWorld().getWorldData()) + .createPaste(editSession) .to(usingOrigin ? position : position.subtract(centerOffset)) .ignoreAirBlocks(ignoreAirBlocks) .build(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java index 96545811a..c672257f5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java @@ -20,12 +20,9 @@ package com.sk89q.worldedit.command.util; import com.sk89q.minecraft.util.commands.CommandContext; -import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.metadata.EntityType; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.function.EntityFunction; -import com.sk89q.worldedit.world.registry.EntityRegistry; /** * The implementation of /butcher. @@ -80,7 +77,7 @@ public class CreatureButcher { or(Flags.WITH_LIGHTNING, args.hasFlag('l'), "worldedit.butcher.lightning"); } - public EntityFunction createFunction(final EntityRegistry entityRegistry) { + public EntityFunction createFunction() { return entity -> { boolean killPets = (flags & Flags.PETS) != 0; boolean killNPCs = (flags & Flags.NPCS) != 0; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java index d336eda71..1d8de101a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java @@ -19,17 +19,15 @@ package com.sk89q.worldedit.command.util; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; -import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.metadata.EntityType; import com.sk89q.worldedit.function.EntityFunction; -import com.sk89q.worldedit.world.registry.EntityRegistry; -import javax.annotation.Nullable; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * The implementation of /remove. @@ -138,7 +136,7 @@ public class EntityRemover { } } - public EntityFunction createFunction(final EntityRegistry entityRegistry) { + public EntityFunction createFunction() { final Type type = this.type; checkNotNull(type, "type can't be null"); return entity -> { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java index b146382e9..d39356cbe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.internal.registry.InputParser; public class DefaultItemParser extends InputParser { @@ -33,7 +34,8 @@ public class DefaultItemParser extends InputParser { @Override public BaseItem parseFromInput(String input, ParserContext context) throws InputParseException { - BaseItem item = context.requireWorld().getWorldData().getItemRegistry().createFromId(input); + BaseItem item = WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries().getItemRegistry().createFromId(input); if (item == null) { throw new InputParseException("'" + input + "' did not match any item"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java index bdba0c924..cf0565739 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.BiomeMask2D; import com.sk89q.worldedit.function.mask.BlockMask; @@ -128,7 +129,8 @@ class DefaultMaskParser extends InputParser { case '$': Set biomes = new HashSet<>(); String[] biomesList = component.substring(1).split(","); - BiomeRegistry biomeRegistry = context.requireWorld().getWorldData().getBiomeRegistry(); + BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); List knownBiomes = biomeRegistry.getBiomes(); for (String biomeName : biomesList) { BaseBiome biome = Biomes.findBiomeByName(knownBiomes, biomeName, biomeRegistry); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java index 03d4812a9..517c98e93 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.registry.Registries; import javax.annotation.Nullable; import java.util.List; @@ -37,12 +38,11 @@ import java.util.Map; public interface Platform { /** - * Resolves an item name to its ID. + * Gets the registry holder. * - * @param name The name to look up - * @return The id that corresponds to the name, or -1 if no such ID exists + * @return The registry holder */ - int resolveItem(String name); + Registries getRegistries(); /** * Checks if a mob type is valid. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java index ccb74ee5b..40808d755 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java @@ -20,7 +20,7 @@ package com.sk89q.worldedit.extent.clipboard.io; import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.world.registry.WorldData; +import com.sk89q.worldedit.world.registry.Registries; import java.io.IOException; @@ -34,10 +34,9 @@ public interface ClipboardReader { /** * Read a {@code Clipboard}. * - * @param data the world data space to convert the blocks to * @return the read clipboard * @throws IOException thrown on I/O error */ - Clipboard read(WorldData data) throws IOException; + Clipboard read() throws IOException; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardWriter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardWriter.java index 9f5dc307b..1407f579e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardWriter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardWriter.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.extent.clipboard.io; import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.world.registry.WorldData; import java.io.Closeable; import java.io.IOException; @@ -36,9 +35,8 @@ public interface ClipboardWriter extends Closeable { * Writes a clipboard. * * @param clipboard the clipboard - * @param data the world data instance * @throws IOException thrown on I/O error */ - void write(Clipboard clipboard, WorldData data) throws IOException; + void write(Clipboard clipboard) throws IOException; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java index 92f05f9d9..29f2b3a1a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.extent.clipboard.io; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.ByteArrayTag; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.IntTag; @@ -40,10 +42,8 @@ import com.sk89q.worldedit.extent.clipboard.io.legacycompat.SignCompatibilityHan import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; -import com.sk89q.worldedit.world.registry.WorldData; import com.sk89q.worldedit.world.storage.NBTConversions; -import javax.annotation.Nullable; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -52,7 +52,7 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Reads schematic files based that are compatible with MCEdit and other editors. @@ -79,7 +79,7 @@ public class SchematicReader implements ClipboardReader { } @Override - public Clipboard read(WorldData data) throws IOException { + public Clipboard read() throws IOException { // Schematic tag NamedTag rootTag = inputStream.readNamedTag(); if (!rootTag.getName().equals("Schematic")) { 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 886e18aa8..224b1b220 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 @@ -22,15 +22,16 @@ package com.sk89q.worldedit.extent.transform; import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.transform.Transform; -import com.sk89q.worldedit.world.registry.BlockRegistry; import com.sk89q.worldedit.world.registry.state.DirectionalState; import com.sk89q.worldedit.world.registry.state.State; import com.sk89q.worldedit.world.registry.state.value.DirectionalStateValue; @@ -48,20 +49,16 @@ public class BlockTransformExtent extends AbstractDelegateExtent { private static final double RIGHT_ANGLE = Math.toRadians(90); private final Transform transform; - private final BlockRegistry blockRegistry; /** * Create a new instance. * * @param extent the extent - * @param blockRegistry the block registry used for block direction data */ - public BlockTransformExtent(Extent extent, Transform transform, BlockRegistry blockRegistry) { + public BlockTransformExtent(Extent extent, Transform transform) { super(extent); checkNotNull(transform); - checkNotNull(blockRegistry); this.transform = transform; - this.blockRegistry = blockRegistry; } /** @@ -81,7 +78,7 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * @return the same block */ private T transformBlock(T block, boolean reverse) { - transform(block, reverse ? transform.inverse() : transform, blockRegistry); + transform(block, reverse ? transform.inverse() : transform); return block; } @@ -113,11 +110,10 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * * @param block the block * @param transform the transform - * @param registry the registry * @return the same block */ - public static T transform(T block, Transform transform, BlockRegistry registry) { - return transform(block, transform, registry, block); + public static T transform(T block, Transform transform) { + return transform(block, transform, block); } /** @@ -125,16 +121,15 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * * @param block the block * @param transform the transform - * @param registry the registry * @param changedBlock the block to change * @return the changed block */ - private static T transform(T block, Transform transform, BlockRegistry registry, T changedBlock) { + private static T transform(T block, Transform transform, T changedBlock) { checkNotNull(block); checkNotNull(transform); - checkNotNull(registry); - Map states = registry.getStates(block); + Map states = WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getStates(block); if (states == null) { return changedBlock; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java index 20c417ca1..15d7c9067 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.function.mask; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.Vector; @@ -41,7 +42,7 @@ public class ExistingBlockMask extends AbstractExtentMask { @Override public boolean test(Vector vector) { - return !getExtent().getLazyBlock(vector).isAir(); + return getExtent().getBlock(vector).getBlockType() != BlockTypes.AIR; } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java index c2788cf7d..59d5f33b9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java @@ -33,6 +33,7 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.pattern.Pattern; @@ -318,7 +319,8 @@ public class WorldEditBinding extends BindingHelper { throw new ParameterException("An entity is required."); } - BiomeRegistry biomeRegistry = world.getWorldData().getBiomeRegistry(); + BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); List knownBiomes = biomeRegistry.getBiomes(); BaseBiome biome = Biomes.findBiomeByName(knownBiomes, input, biomeRegistry); if (biome != null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/ClipboardHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/ClipboardHolder.java index 37bb50de8..097c05cf6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/ClipboardHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/ClipboardHolder.java @@ -19,20 +19,18 @@ package com.sk89q.worldedit.session; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.math.transform.Identity; import com.sk89q.worldedit.math.transform.Transform; -import com.sk89q.worldedit.world.registry.WorldData; - -import static com.google.common.base.Preconditions.checkNotNull; /** * Holds the clipboard and the current transform on the clipboard. */ public class ClipboardHolder { - private final WorldData worldData; private final Clipboard clipboard; private Transform transform = new Identity(); @@ -40,22 +38,10 @@ public class ClipboardHolder { * Create a new instance with the given clipboard. * * @param clipboard the clipboard - * @param worldData the mapping of blocks, entities, and so on */ - public ClipboardHolder(Clipboard clipboard, WorldData worldData) { + public ClipboardHolder(Clipboard clipboard) { checkNotNull(clipboard); - checkNotNull(worldData); this.clipboard = clipboard; - this.worldData = worldData; - } - - /** - * Get the mapping used for blocks, entities, and so on. - * - * @return the mapping - */ - public WorldData getWorldData() { - return worldData; } /** @@ -94,8 +80,8 @@ public class ClipboardHolder { * * @return a builder */ - public PasteBuilder createPaste(Extent targetExtent, WorldData targetWorldData) { - return new PasteBuilder(this, targetExtent, targetWorldData); + public PasteBuilder createPaste(Extent targetExtent) { + return new PasteBuilder(this, targetExtent); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java index 5abe2e5f6..3fcce7100 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java @@ -20,6 +20,8 @@ package com.sk89q.worldedit.session; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.transform.BlockTransformExtent; @@ -27,7 +29,7 @@ import com.sk89q.worldedit.function.mask.ExistingBlockMask; import com.sk89q.worldedit.function.operation.ForwardExtentCopy; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.math.transform.Transform; -import com.sk89q.worldedit.world.registry.WorldData; +import com.sk89q.worldedit.world.registry.Registries; import static com.google.common.base.Preconditions.checkNotNull; @@ -37,10 +39,8 @@ import static com.google.common.base.Preconditions.checkNotNull; public class PasteBuilder { private final Clipboard clipboard; - private final WorldData worldData; private final Transform transform; private final Extent targetExtent; - private final WorldData targetWorldData; private Vector to = new Vector(); private boolean ignoreAirBlocks; @@ -50,17 +50,13 @@ public class PasteBuilder { * * @param holder the clipboard holder * @param targetExtent an extent - * @param targetWorldData world data of the target */ - PasteBuilder(ClipboardHolder holder, Extent targetExtent, WorldData targetWorldData) { + PasteBuilder(ClipboardHolder holder, Extent targetExtent) { checkNotNull(holder); checkNotNull(targetExtent); - checkNotNull(targetWorldData); this.clipboard = holder.getClipboard(); - this.worldData = holder.getWorldData(); this.transform = holder.getTransform(); this.targetExtent = targetExtent; - this.targetWorldData = targetWorldData; } /** @@ -90,7 +86,7 @@ public class PasteBuilder { * @return the operation */ public Operation build() { - BlockTransformExtent extent = new BlockTransformExtent(clipboard, transform, targetWorldData.getBlockRegistry()); + BlockTransformExtent extent = new BlockTransformExtent(clipboard, transform); ForwardExtentCopy copy = new ForwardExtentCopy(extent, clipboard.getRegion(), clipboard.getOrigin(), targetExtent, to); copy.setTransform(transform); if (ignoreAirBlocks) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java index 9a254c658..9bfaa02fe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -36,13 +36,12 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.BundledWorldData; -import com.sk89q.worldedit.world.registry.WorldData; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A null implementation of {@link World} that drops all changes and * returns dummy data. @@ -98,11 +97,6 @@ public class NullWorld extends AbstractWorld { return false; } - @Override - public WorldData getWorldData() { - return BundledWorldData.getInstance(); - } - @Override public BlockState getBlock(Vector position) { return BlockTypes.AIR.getDefaultState(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index 61dee0838..4bd434a78 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -24,7 +24,6 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.type.BlockStateHolder; @@ -35,7 +34,7 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.TreeGenerator; -import com.sk89q.worldedit.world.registry.WorldData; +import com.sk89q.worldedit.world.registry.Registries; /** * Represents a world (dimension). @@ -204,13 +203,6 @@ public interface World extends Extent { */ boolean queueBlockBreakEffect(Platform server, Vector position, BlockType blockType, double priority); - /** - * Get the data for blocks and so on for this world. - * - * @return the world data - */ - WorldData getWorldData(); - @Override boolean equals(Object other); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockCategoryRegistry.java new file mode 100644 index 000000000..9b08915c4 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockCategoryRegistry.java @@ -0,0 +1,29 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry; + +import com.sk89q.worldedit.blocks.type.BlockType; + +/** + * A registry for BlockType categories. + */ +public interface BlockCategoryRegistry extends CategoryRegistry { + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledRegistries.java similarity index 70% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledRegistries.java index 27147e2b5..7c6abc390 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledWorldData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledRegistries.java @@ -20,21 +20,23 @@ package com.sk89q.worldedit.world.registry; /** - * An implementation of {@link WorldData} that converts legacy numeric IDs and + * An implementation of {@link Registries} that converts legacy numeric IDs and * a contains a built-in block and item database. */ -public class BundledWorldData implements WorldData { +public class BundledRegistries implements Registries { - private static final BundledWorldData INSTANCE = new BundledWorldData(); + private static final BundledRegistries INSTANCE = new BundledRegistries(); private final BundledBlockRegistry blockRegistry = new BundledBlockRegistry(); private final BundledItemRegistry itemRegistry = new BundledItemRegistry(); private final NullEntityRegistry entityRegistry = new NullEntityRegistry(); private final NullBiomeRegistry biomeRegistry = new NullBiomeRegistry(); + private final NullBlockCategoryRegistry blockCategoryRegistry = new NullBlockCategoryRegistry(); + private final NullItemCategoryRegistry itemCategoryRegistry = new NullItemCategoryRegistry(); /** * Create a new instance. */ - protected BundledWorldData() { + protected BundledRegistries() { } @Override @@ -57,12 +59,22 @@ public class BundledWorldData implements WorldData { return biomeRegistry; } + @Override + public BlockCategoryRegistry getBlockCategoryRegistry() { + return blockCategoryRegistry; + } + + @Override + public ItemCategoryRegistry getItemCategoryRegistry() { + return itemCategoryRegistry; + } + /** * Get a singleton instance. * * @return an instance */ - public static BundledWorldData getInstance() { + public static BundledRegistries getInstance() { return INSTANCE; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/CategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/CategoryRegistry.java new file mode 100644 index 000000000..066231d17 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/CategoryRegistry.java @@ -0,0 +1,44 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry; + +import java.util.Set; + +/** + * A registry of categories. Minecraft internally calls these 'Tags'. + */ +public interface CategoryRegistry { + + /** + * Gets a set of values with a given category. + * + * @param category The category + * @return A set of values + */ + Set getCategorisedByName(String category); + + /** + * Gets a list of categories given to a value. + * + * @param categorised The value + * @return A set of categories + */ + Set getCategories(T categorised); +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemCategoryRegistry.java new file mode 100644 index 000000000..c80aea96a --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemCategoryRegistry.java @@ -0,0 +1,29 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry; + +import com.sk89q.worldedit.blocks.type.ItemType; + +/** + * A registry for ItemType categories. + */ +public interface ItemCategoryRegistry extends CategoryRegistry { + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java new file mode 100644 index 000000000..3a45304e2 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java @@ -0,0 +1,38 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry; + +import com.sk89q.worldedit.blocks.type.BlockType; + +import java.util.Collections; +import java.util.Set; + +public class NullBlockCategoryRegistry implements BlockCategoryRegistry { + + @Override + public Set getCategorisedByName(String category) { + return Collections.emptySet(); + } + + @Override + public Set getCategories(BlockType categorised) { + return Collections.emptySet(); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java new file mode 100644 index 000000000..c116e46cc --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java @@ -0,0 +1,38 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry; + +import com.sk89q.worldedit.blocks.type.ItemType; + +import java.util.Collections; +import java.util.Set; + +public class NullItemCategoryRegistry implements ItemCategoryRegistry { + + @Override + public Set getCategorisedByName(String category) { + return Collections.emptySet(); + } + + @Override + public Set getCategories(ItemType categorised) { + return Collections.emptySet(); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/WorldData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/Registries.java similarity index 77% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/WorldData.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/Registries.java index ada70dd3c..aea32e09a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/WorldData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/Registries.java @@ -20,10 +20,9 @@ package com.sk89q.worldedit.world.registry; /** - * Describes the necessary data for blocks, entities, and other objects - * on a world. + * Contains getters for the various registries. */ -public interface WorldData { +public interface Registries { /** * Get the block registry. @@ -53,4 +52,18 @@ public interface WorldData { */ BiomeRegistry getBiomeRegistry(); + /** + * Get the block category registry. + * + * @return the block category registry + */ + BlockCategoryRegistry getBlockCategoryRegistry(); + + /** + * Get the item category registry. + * + * @return the item category registry + */ + ItemCategoryRegistry getItemCategoryRegistry(); + } diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java index 70e795a2f..f949710d4 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java @@ -71,7 +71,7 @@ public class BlockTransformExtentTest { BaseBlock orig = new BaseBlock(type); for (int i = 1; i < 4; i++) { - BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_90, blockRegistry); + BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_90); BaseBlock reference = new BaseBlock(orig.getBlockType().getLegacyId(), BlockData.rotate90(orig.getBlockType().getLegacyId(), orig.getData())); assertThat(type + "#" + type.getId() + " rotated " + (90 * i) + " degrees did not match BlockData.rotate90()'s expected result", rotated, equalTo(reference)); @@ -80,7 +80,7 @@ public class BlockTransformExtentTest { orig = new BaseBlock(type); for (int i = 0; i < 4; i++) { - BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_NEG_90, blockRegistry); + BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_NEG_90); BaseBlock reference = new BaseBlock(orig.getBlockType().getLegacyId(), BlockData.rotate90Reverse(orig.getBlockType().getLegacyId(), orig.getData())); assertThat(type + "#" + type.getId() + " rotated " + (-90 * i) + " degrees did not match BlockData.rotate90Reverse()'s expected result", rotated, equalTo(reference)); orig = rotated; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlatform.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlatform.java index 2ddf75c51..2c0b8e234 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlatform.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlatform.java @@ -28,12 +28,10 @@ import com.sk89q.worldedit.extension.platform.Preference; import com.sk89q.worldedit.util.command.CommandMapping; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.world.World; - -import net.minecraft.block.Block; +import com.sk89q.worldedit.world.registry.Registries; import net.minecraft.command.ServerCommandManager; import net.minecraft.entity.EntityList; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; import net.minecraft.server.MinecraftServer; import net.minecraft.server.management.PlayerList; import net.minecraft.util.ResourceLocation; @@ -41,14 +39,14 @@ import net.minecraft.world.WorldServer; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fml.common.FMLCommonHandler; -import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.Collection; import java.util.EnumMap; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; + class ForgePlatform extends AbstractPlatform implements MultiUserPlatform { private final ForgeWorldEdit mod; @@ -65,30 +63,8 @@ class ForgePlatform extends AbstractPlatform implements MultiUserPlatform { } @Override - public int resolveItem(String name) { - if (name == null) return 0; - - int index = name.indexOf(':'); - - if (index != 0 && index != name.length() - 1) { - Block block = Block.getBlockFromName(name); - if (block != null) { - return Block.getIdFromBlock(block); - } - } - - for (Item item : Item.REGISTRY) { - if (item == null) continue; - if (item.getUnlocalizedName() == null) continue; - if (item.getUnlocalizedName().startsWith("item.")) { - if (item.getUnlocalizedName().equalsIgnoreCase("item." + name)) return Item.getIdFromItem(item); - } - if (item.getUnlocalizedName().startsWith("tile.")) { - if (item.getUnlocalizedName().equalsIgnoreCase("tile." + name)) return Item.getIdFromItem(item); - } - if (item.getUnlocalizedName().equalsIgnoreCase(name)) return Item.getIdFromItem(item); - } - return -1; + public Registries getRegistries() { + return ForgeRegistries.getInstance(); } @Override diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldData.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java similarity index 86% rename from worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldData.java rename to worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java index 0a6784727..bbdde9048 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldData.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java @@ -21,14 +21,14 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.world.registry.BiomeRegistry; import com.sk89q.worldedit.world.registry.ItemRegistry; -import com.sk89q.worldedit.world.registry.BundledWorldData; +import com.sk89q.worldedit.world.registry.BundledRegistries; /** * World data for the Forge platform. */ -class ForgeWorldData extends BundledWorldData { +class ForgeRegistries extends BundledRegistries { - private static final ForgeWorldData INSTANCE = new ForgeWorldData(); + private static final ForgeRegistries INSTANCE = new ForgeRegistries(); private final BiomeRegistry biomeRegistry = new ForgeBiomeRegistry(); private final ItemRegistry itemRegistry = new ForgeItemRegistry(); @@ -47,7 +47,7 @@ class ForgeWorldData extends BundledWorldData { * * @return an instance */ - public static ForgeWorldData getInstance() { + public static ForgeRegistries getInstance() { return INSTANCE; } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index bd9512688..f086e171d 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -45,7 +45,7 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.WorldData; +import com.sk89q.worldedit.world.registry.Registries; import net.minecraft.block.Block; import net.minecraft.block.BlockLeaves; @@ -87,7 +87,6 @@ import net.minecraft.world.gen.feature.WorldGenTaiga2; import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.fml.common.registry.ForgeRegistries; import javax.annotation.Nullable; @@ -345,18 +344,13 @@ public class ForgeWorld extends AbstractWorld { return generator != null && generator.generate(getWorld(), random, ForgeAdapter.toBlockPos(position)); } - @Override - public WorldData getWorldData() { - return ForgeWorldData.getInstance(); - } - @Override public BlockState getBlock(Vector position) { World world = getWorld(); BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); IBlockState state = world.getBlockState(pos); - return BlockTypes.getBlockType(ForgeRegistries.BLOCKS.getKey(state.getBlock()).toString()).getDefaultState(); // TODO Data + return BlockTypes.getBlockType(net.minecraftforge.fml.common.registry.ForgeRegistries.BLOCKS.getKey(state.getBlock()).toString()).getDefaultState(); // TODO Data } @Override diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlatform.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlatform.java index a0be01208..774347645 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlatform.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlatform.java @@ -20,26 +20,35 @@ package com.sk89q.worldedit.sponge; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.platform.CommandEvent; import com.sk89q.worldedit.event.platform.CommandSuggestionEvent; -import com.sk89q.worldedit.extension.platform.*; +import com.sk89q.worldedit.extension.platform.AbstractPlatform; +import com.sk89q.worldedit.extension.platform.Actor; +import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.extension.platform.MultiUserPlatform; +import com.sk89q.worldedit.extension.platform.Preference; import com.sk89q.worldedit.sponge.config.SpongeConfiguration; import com.sk89q.worldedit.util.command.CommandMapping; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.registry.Registries; import org.spongepowered.api.Sponge; import org.spongepowered.api.command.CommandException; import org.spongepowered.api.command.CommandResult; import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.entity.EntityType; -import org.spongepowered.api.item.ItemType; import org.spongepowered.api.scheduler.Task; import org.spongepowered.api.world.Location; +import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + import javax.annotation.Nullable; -import java.util.*; class SpongePlatform extends AbstractPlatform implements MultiUserPlatform { @@ -55,16 +64,8 @@ class SpongePlatform extends AbstractPlatform implements MultiUserPlatform { } @Override - public int resolveItem(String name) { - if (name == null) return 0; - - Optional optBlock = Sponge.getRegistry().getType(org.spongepowered.api.block.BlockType.class, name); - if (optBlock.isPresent()) { - return optBlock.map(blockType -> SpongeWorldEdit.inst().getAdapter().resolve(blockType)).orElse(0); - } else { - Optional optType = Sponge.getRegistry().getType(ItemType.class, name); - return optType.map(itemType -> SpongeWorldEdit.inst().getAdapter().resolve(itemType)).orElse(0); - } + public Registries getRegistries() { + return SpongeRegistries.getInstance(); } @Override diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldData.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeRegistries.java similarity index 83% rename from worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldData.java rename to worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeRegistries.java index 752342c1e..6e2777b7e 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldData.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeRegistries.java @@ -20,14 +20,14 @@ package com.sk89q.worldedit.sponge; import com.sk89q.worldedit.world.registry.BiomeRegistry; -import com.sk89q.worldedit.world.registry.BundledWorldData; +import com.sk89q.worldedit.world.registry.BundledRegistries; /** * World data for the Sponge platform. */ -class SpongeWorldData extends BundledWorldData { +class SpongeRegistries extends BundledRegistries { - private static final SpongeWorldData INSTANCE = new SpongeWorldData(); + private static final SpongeRegistries INSTANCE = new SpongeRegistries(); private final BiomeRegistry biomeRegistry = new SpongeBiomeRegistry(); @Override @@ -40,7 +40,7 @@ class SpongeWorldData extends BundledWorldData { * * @return an instance */ - public static SpongeWorldData getInstance() { + public static SpongeRegistries getInstance() { return INSTANCE; } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index 54c523843..a0eb80ed9 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -35,7 +35,7 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.WorldData; +import com.sk89q.worldedit.world.registry.Registries; import com.sk89q.worldedit.world.registry.state.State; import com.sk89q.worldedit.world.registry.state.value.StateValue; import org.spongepowered.api.Sponge; @@ -44,7 +44,6 @@ import org.spongepowered.api.block.BlockState; import org.spongepowered.api.block.BlockType; import org.spongepowered.api.block.BlockTypes; import org.spongepowered.api.block.tileentity.TileEntity; -import org.spongepowered.api.block.trait.BlockTrait; import org.spongepowered.api.data.key.Keys; import org.spongepowered.api.data.property.block.GroundLuminanceProperty; import org.spongepowered.api.data.property.block.SkyLuminanceProperty; @@ -59,8 +58,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.function.Function; -import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkNotNull; @@ -218,11 +215,6 @@ public abstract class SpongeWorld extends AbstractWorld { getWorld().spawnEntity(entity); } - @Override - public WorldData getWorldData() { - return SpongeWorldData.getInstance(); - } - @Override public int hashCode() { return getWorld().hashCode(); From 70aceb3837b67fcda0444d441f4dd35e9729df8b Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 19 Jun 2018 11:55:35 +1000 Subject: [PATCH 21/74] Use default state a bit more. --- .../java/com/sk89q/worldedit/EditSession.java | 30 +++++++++---------- .../worldedit/blocks/type/BlockState.java | 4 +++ .../worldedit/command/BrushCommands.java | 9 +++--- .../worldedit/command/UtilityCommands.java | 4 +-- .../command/tool/RecursivePickaxe.java | 3 +- .../worldedit/command/tool/SinglePickaxe.java | 2 +- .../command/tool/brush/CylinderBrush.java | 2 +- .../platform/AbstractPlayerActor.java | 2 +- .../extent/world/BlockQuirkExtent.java | 8 ++--- .../worldedit/function/block/Naturalizer.java | 7 +++-- .../function/generator/FloraGenerator.java | 13 ++++---- .../function/generator/ForestGenerator.java | 4 +-- .../generator/GardenPatchGenerator.java | 2 +- .../worldedit/math/convolution/HeightMap.java | 7 ++--- .../sk89q/worldedit/util/TreeGenerator.java | 14 +++++---- .../sk89q/worldedit/world/AbstractWorld.java | 2 +- 16 files changed, 59 insertions(+), 54 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 543cda5a3..531c2527a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -688,7 +688,7 @@ public class EditSession implements Extent { getWorld(), // Causes clamping of Y range position.add(-apothem + 1, 0, -apothem + 1), position.add(apothem - 1, height - 1, apothem - 1)); - Pattern pattern = new BlockPattern(new BaseBlock(BlockTypes.AIR)); + Pattern pattern = new BlockPattern(BlockTypes.AIR.getDefaultState()); return setBlocks(region, pattern); } @@ -710,7 +710,7 @@ public class EditSession implements Extent { getWorld(), // Causes clamping of Y range position.add(-apothem + 1, 0, -apothem + 1), position.add(apothem - 1, -height + 1, apothem - 1)); - Pattern pattern = new BlockPattern(new BaseBlock(BlockTypes.AIR)); + Pattern pattern = new BlockPattern(BlockTypes.AIR.getDefaultState()); return setBlocks(region, pattern); } @@ -723,17 +723,17 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int removeNear(Vector position, int blockType, int apothem) throws MaxChangedBlocksException { + public int removeNear(Vector position, com.sk89q.worldedit.blocks.type.BlockType blockType, int apothem) throws MaxChangedBlocksException { checkNotNull(position); checkArgument(apothem >= 1, "apothem >= 1"); - Mask mask = new FuzzyBlockMask(this, new BaseBlock(blockType, -1)); + Mask mask = new FuzzyBlockMask(this, blockType.getDefaultState().toFuzzy()); Vector adjustment = new Vector(1, 1, 1).multiply(apothem - 1); Region region = new CuboidRegion( getWorld(), // Causes clamping of Y range position.add(adjustment.multiply(-1)), position.add(adjustment)); - Pattern pattern = new BlockPattern(new BaseBlock(BlockTypes.AIR)); + Pattern pattern = new BlockPattern(BlockTypes.AIR.getDefaultState()); return replaceBlocks(region, mask, pattern); } @@ -1059,7 +1059,7 @@ public class EditSession implements Extent { // Remove the original blocks com.sk89q.worldedit.function.pattern.Pattern pattern = replacement != null ? new BlockPattern(replacement) : - new BlockPattern(new BaseBlock(BlockTypes.AIR)); + new BlockPattern(BlockTypes.AIR.getDefaultState()); BlockReplace remove = new BlockReplace(this, pattern); // Copy to a buffer so we don't destroy our original before we can copy all the blocks from it @@ -1146,15 +1146,15 @@ public class EditSession implements Extent { // Our origins can only be liquids BlockMask liquidMask = new BlockMask( this, - new BaseBlock(moving), - new BaseBlock(stationary)); + moving.getDefaultState(), + stationary.getDefaultState()); // But we will also visit air blocks MaskIntersection blockMask = new MaskUnion(liquidMask, new BlockMask( this, - new BaseBlock(BlockTypes.AIR))); + BlockTypes.AIR.getDefaultState())); // There are boundaries that the routine needs to stay in MaskIntersection mask = new MaskIntersection( @@ -1162,7 +1162,7 @@ public class EditSession implements Extent { new RegionMask(new EllipsoidRegion(null, origin, new Vector(radius, radius, radius))), blockMask); - BlockReplace replace = new BlockReplace(this, new BlockPattern(new BaseBlock(stationary))); + BlockReplace replace = new BlockReplace(this, new BlockPattern(stationary.getDefaultState())); NonRisingVisitor visitor = new NonRisingVisitor(mask, replace); // Around the origin in a 3x3 block @@ -1433,8 +1433,8 @@ public class EditSession implements Extent { int oy = position.getBlockY(); int oz = position.getBlockZ(); - BaseBlock air = new BaseBlock(BlockTypes.AIR); - BaseBlock water = new BaseBlock(BlockTypes.WATER); + BlockState air = BlockTypes.AIR.getDefaultState(); + BlockState water = BlockTypes.WATER.getDefaultState(); int ceilRadius = (int) Math.ceil(radius); for (int x = ox - ceilRadius; x <= ox + ceilRadius; ++x) { @@ -1483,8 +1483,8 @@ public class EditSession implements Extent { int oy = position.getBlockY(); int oz = position.getBlockZ(); - BaseBlock ice = new BaseBlock(BlockTypes.ICE); - BaseBlock snow = new BaseBlock(BlockTypes.SNOW); + BlockState ice = BlockTypes.ICE.getDefaultState(); + BlockState snow = BlockTypes.SNOW.getDefaultState(); int ceilRadius = (int) Math.ceil(radius); for (int x = ox - ceilRadius; x <= ox + ceilRadius; ++x) { @@ -1659,7 +1659,7 @@ public class EditSession implements Extent { ++affected; break; } else if (t == BlockTypes.SNOW) { - setBlock(new Vector(x, y, z), new BaseBlock(BlockTypes.AIR)); + setBlock(new Vector(x, y, z), BlockTypes.AIR.getDefaultState()); } else if (t != BlockTypes.AIR) { // Trees won't grow on this! break; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java index 39c48b410..43a867180 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java @@ -110,6 +110,10 @@ public class BlockState implements BlockStateHolder { return Collections.unmodifiableMap(this.values); } + public BlockState toFuzzy() { + return new BlockState(this.getBlockType(), new HashMap<>()); + } + @Override public boolean equalsFuzzy(BlockStateHolder o) { if (!getBlockType().equals(o.getBlockType())) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index 8f61f5593..eaf2ac45d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; @@ -28,7 +30,6 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.brush.ButcherBrush; @@ -50,8 +51,6 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Commands to set brush shape. */ @@ -194,10 +193,10 @@ public class BrushCommands { worldEdit.checkMaxBrushRadius(radius); BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); - Pattern fill = new BlockPattern(new BaseBlock(BlockTypes.AIR)); + Pattern fill = new BlockPattern(BlockTypes.AIR.getDefaultState()); tool.setFill(fill); tool.setSize(radius); - tool.setMask(new BlockMask(editSession, new BaseBlock(BlockTypes.FIRE))); + tool.setMask(new BlockMask(editSession, BlockTypes.FIRE.getDefaultState().toFuzzy())); tool.setBrush(new SphereBrush(), "worldedit.brush.ex"); player.print(String.format("Extinguisher equipped (%.0f).", radius)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 447e42c7b..d14065951 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -261,7 +261,7 @@ public class UtilityCommands { int size = Math.max(1, args.getInteger(1, 50)); we.checkMaxRadius(size); - int affected = editSession.removeNear(session.getPlacementPosition(player), block.getBlockType().getLegacyId(), size); + int affected = editSession.removeNear(session.getPlacementPosition(player), block.getBlockType(), size); player.print(affected + " block(s) have been removed."); } @@ -381,7 +381,7 @@ public class UtilityCommands { : defaultRadius; we.checkMaxRadius(size); - int affected = editSession.removeNear(session.getPlacementPosition(player), 51, size); + int affected = editSession.removeNear(session.getPlacementPosition(player), BlockTypes.FIRE, size); player.print(affected + " block(s) have been removed."); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java index ef3bb3f88..7734b3c0c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; @@ -37,7 +38,7 @@ import java.util.Set; */ public class RecursivePickaxe implements BlockTool { - private static final BaseBlock air = new BaseBlock(BlockTypes.AIR); + private static final BlockState air = BlockTypes.AIR.getDefaultState(); private double range; public RecursivePickaxe(double range) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java index 8dfe64bb8..b8fc29c7f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java @@ -54,7 +54,7 @@ public class SinglePickaxe implements BlockTool { editSession.getSurvivalExtent().setToolUse(config.superPickaxeDrop); try { - editSession.setBlock(clicked.toVector(), new BaseBlock(BlockTypes.AIR)); + editSession.setBlock(clicked.toVector(), BlockTypes.AIR.getDefaultState()); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java index 6f1eb3540..b860e4db9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java @@ -38,7 +38,7 @@ public class CylinderBrush implements Brush { @Override public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { if (pattern == null) { - pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); + pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState()); } editSession.makeCylinder(position, pattern, size, size, height, true); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index 245ee0503..f6bbd8c87 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -299,7 +299,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public void floatAt(int x, int y, int z, boolean alwaysGlass) { try { - getLocation().getExtent().setBlock(new Vector(x, y - 1, z), new BaseBlock(BlockTypes.GLASS)); + getLocation().getExtent().setBlock(new Vector(x, y - 1, z), BlockTypes.GLASS.getDefaultState()); } catch (WorldEditException e) { e.printStackTrace(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index 80b3dc1d4..9f306fc5d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -55,12 +55,12 @@ public class BlockQuirkExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector position, BlockStateHolder block) throws WorldEditException { BaseBlock lazyBlock = getExtent().getLazyBlock(position); - int existing = lazyBlock.getBlockType().getLegacyId(); + com.sk89q.worldedit.blocks.type.BlockType existing = lazyBlock.getBlockType(); - if (BlockType.isContainerBlock(existing)) { + if (BlockType.isContainerBlock(existing.getLegacyId())) { world.clearContainerBlockContents(position); // Clear the container block so that it doesn't drop items - } else if (existing == BlockID.ICE) { - world.setBlock(position, new BaseBlock(BlockTypes.AIR)); // Ice turns until water so this has to be done first + } else if (existing == BlockTypes.ICE) { + world.setBlock(position, BlockTypes.AIR.getDefaultState()); // Ice turns until water so this has to be done first } return super.setBlock(position, block); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java index 6b9967250..3be5a2345 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java @@ -24,6 +24,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.LayerFunction; import com.sk89q.worldedit.function.mask.BlockMask; @@ -38,9 +39,9 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class Naturalizer implements LayerFunction { - private static final BaseBlock grass = new BaseBlock(BlockTypes.GRASS_BLOCK); - private static final BaseBlock dirt = new BaseBlock(BlockTypes.DIRT); - private static final BaseBlock stone = new BaseBlock(BlockTypes.STONE); + private static final BlockState grass = BlockTypes.GRASS_BLOCK.getDefaultState(); + private static final BlockState dirt = BlockTypes.DIRT.getDefaultState(); + private static final BlockState stone = BlockTypes.STONE.getDefaultState(); private final EditSession editSession; private final Mask mask; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index a0bbf9f87..4833cc439 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; @@ -84,9 +83,9 @@ public class FloraGenerator implements RegionFunction { */ public static Pattern getDesertPattern() { RandomPattern pattern = new RandomPattern(); - pattern.add(new BlockPattern(new BaseBlock(BlockTypes.DEAD_BUSH)), 30); - pattern.add(new BlockPattern(new BaseBlock(BlockTypes.CACTUS)), 20); - pattern.add(new BlockPattern(new BaseBlock(BlockTypes.AIR)), 300); + pattern.add(new BlockPattern(BlockTypes.DEAD_BUSH.getDefaultState()), 30); + pattern.add(new BlockPattern(BlockTypes.CACTUS.getDefaultState()), 20); + pattern.add(new BlockPattern(BlockTypes.AIR.getDefaultState()), 300); return pattern; } @@ -97,9 +96,9 @@ public class FloraGenerator implements RegionFunction { */ public static Pattern getTemperatePattern() { RandomPattern pattern = new RandomPattern(); - pattern.add(new BlockPattern(new BaseBlock(BlockTypes.GRASS)), 300); - pattern.add(new BlockPattern(new BaseBlock(BlockTypes.POPPY)), 5); - pattern.add(new BlockPattern(new BaseBlock(BlockTypes.DANDELION)), 5); + pattern.add(new BlockPattern(BlockTypes.GRASS.getDefaultState()), 300); + pattern.add(new BlockPattern(BlockTypes.POPPY.getDefaultState()), 5); + pattern.add(new BlockPattern(BlockTypes.DANDELION.getDefaultState()), 5); return pattern; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index 3c0a0660c..644a183db 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -58,11 +58,11 @@ public class ForestGenerator implements RegionFunction { treeGenerator.generate(editSession, position.add(0, 1, 0)); return true; } else if (t == BlockTypes.TALL_GRASS || t == BlockTypes.DEAD_BUSH || t == BlockTypes.POPPY || t == BlockTypes.DANDELION) { // TODO: This list needs to be moved - editSession.setBlock(position, new BaseBlock(BlockTypes.AIR)); + editSession.setBlock(position, BlockTypes.AIR.getDefaultState()); treeGenerator.generate(editSession, position); return true; } else if (t == BlockTypes.SNOW) { - editSession.setBlock(position, new BaseBlock(BlockTypes.AIR)); + editSession.setBlock(position, BlockTypes.AIR.getDefaultState()); return false; } else { // Trees won't grow on this! return false; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index 0e851d2f4..ee5f4b1b4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -214,6 +214,6 @@ public class GardenPatchGenerator implements RegionFunction { * @return a melon pattern */ public static Pattern getMelonPattern() { - return new BlockPattern(new BaseBlock(BlockTypes.MELON_BLOCK)); + return new BlockPattern(BlockTypes.MELON_BLOCK.getDefaultState()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index 606c8caf9..2ab320f2c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -19,16 +19,15 @@ package com.sk89q.worldedit.math.convolution; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.regions.Region; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Allows applications of Kernels onto the region's height map. * @@ -123,7 +122,7 @@ public class HeightMap { int originZ = minY.getBlockZ(); int maxY = region.getMaximumPoint().getBlockY(); - BaseBlock fillerAir = new BaseBlock(BlockTypes.AIR); + BlockState fillerAir = BlockTypes.AIR.getDefaultState(); int blocksChanged = 0; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java index 039f27ab2..55546b95a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java @@ -23,10 +23,10 @@ import com.google.common.collect.Sets; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; -import javax.annotation.Nullable; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; @@ -34,6 +34,8 @@ import java.util.Map; import java.util.Random; import java.util.Set; +import javax.annotation.Nullable; + /** * Tree generator. */ @@ -198,8 +200,8 @@ public class TreeGenerator { int trunkHeight = (int) Math.floor(Math.random() * 2) + 3; int height = (int) Math.floor(Math.random() * 5) + 8; - BaseBlock logBlock = new BaseBlock(BlockTypes.OAK_LOG); - BaseBlock leavesBlock = new BaseBlock(BlockTypes.OAK_LEAVES); + BlockState logBlock = BlockTypes.OAK_LOG.getDefaultState(); + BlockState leavesBlock = BlockTypes.OAK_LEAVES.getDefaultState(); // Create trunk for (int i = 0; i < trunkHeight; ++i) { @@ -269,7 +271,7 @@ public class TreeGenerator { * @return whether a block was changed * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - private static boolean setChanceBlockIfAir(EditSession session, Vector position, BaseBlock block, double probability) + private static boolean setChanceBlockIfAir(EditSession session, Vector position, BlockStateHolder block, double probability) throws MaxChangedBlocksException { return Math.random() <= probability && setBlockIfAir(session, position, block); } @@ -282,7 +284,7 @@ public class TreeGenerator { * @return if block was changed * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - private static boolean setBlockIfAir(EditSession session, Vector position, BaseBlock block) throws MaxChangedBlocksException { + private static boolean setBlockIfAir(EditSession session, Vector position, BlockStateHolder block) throws MaxChangedBlocksException { return session.getBlock(position).getBlockType() == BlockTypes.AIR && session.setBlock(position, block); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index 7d9532170..c7fb04f33 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -94,7 +94,7 @@ public abstract class AbstractWorld implements World { } try { - setBlock(pt, new BaseBlock(BlockTypes.AIR)); + setBlock(pt, BlockTypes.AIR.getDefaultState()); } catch (WorldEditException e) { throw new RuntimeException(e); } From 416480c16d5be0c8b152c28514335d502b5e4450 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 19 Jun 2018 15:50:31 +1000 Subject: [PATCH 22/74] Separated out fluids and blocks - they're different now --- .../java/com/sk89q/worldedit/EditSession.java | 13 +- .../blocks/type/BlockCategories.java | 6 +- .../worldedit/blocks/type/BlockTypes.java | 1063 +++++++++-------- .../blocks/type/FluidCategories.java | 74 ++ .../worldedit/blocks/type/FluidCategory.java | 58 + .../worldedit/blocks/type/FluidType.java | 52 + .../worldedit/blocks/type/FluidTypes.java | 78 ++ .../worldedit/blocks/type/ItemCategories.java | 2 +- .../worldedit/command/UtilityCommands.java | 6 +- .../event/extent/EditSessionEvent.java | 4 +- .../platform/AbstractPlayerActor.java | 4 +- .../generator/GardenPatchGenerator.java | 3 +- .../worldedit/math/convolution/HeightMap.java | 3 +- .../sk89q/worldedit/world/AbstractWorld.java | 4 +- .../worldedit/world/storage/BlockData.java | 131 -- 15 files changed, 836 insertions(+), 665 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategories.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategory.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidType.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidTypes.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/BlockData.java diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 531c2527a..8903a7dd6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.LazyBlock; +import com.sk89q.worldedit.blocks.type.BlockCategories; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; @@ -1445,7 +1446,7 @@ public class EditSession implements Extent { for (int y = world.getMaxY(); y >= 1; --y) { Vector pt = new Vector(x, y, z); - com.sk89q.worldedit.blocks.type.BlockType id = getLazyBlock(pt).getBlockType(); + com.sk89q.worldedit.blocks.type.BlockType id = getBlock(pt).getBlockType(); if (id == BlockTypes.ICE) { if (setBlock(pt, water)) { @@ -1495,14 +1496,14 @@ public class EditSession implements Extent { for (int y = world.getMaxY(); y >= 1; --y) { Vector pt = new Vector(x, y, z); - int id = getLazyBlock(pt).getId(); + com.sk89q.worldedit.blocks.type.BlockType id = getBlock(pt).getBlockType(); - if (id == BlockID.AIR) { + if (id == BlockTypes.AIR) { continue; } // Ice! - if (id == BlockID.WATER || id == BlockID.STATIONARY_WATER) { + if (id == BlockTypes.WATER) { if (setBlock(pt, ice)) { ++affected; } @@ -1510,9 +1511,9 @@ public class EditSession implements Extent { } // Snow should not cover these blocks - if (BlockType.isTranslucent(id)) { + if (BlockType.isTranslucent(id.getLegacyId())) { // Add snow on leaves - if (id != BlockID.LEAVES && id != BlockID.LEAVES2) { + if (BlockCategories.LEAVES.contains(id)) { break; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java index 25b324cc0..40cf4f07f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java @@ -67,10 +67,6 @@ public class BlockCategories { public static final BlockCategory WOODEN_STAIRS = new BlockCategory("minecraft:wooden_stairs"); public static final BlockCategory WOOL = new BlockCategory("minecraft:wool"); - // Fluids - public static final BlockCategory LAVA = new BlockCategory("minecraft:lava"); - public static final BlockCategory WATER = new BlockCategory("minecraft:water"); - private static final Map categoryMapping = new HashMap<>(); static { @@ -94,7 +90,7 @@ public class BlockCategories { } @Nullable - public static BlockCategory getBlockType(String id) { + public static BlockCategory getBlockCategory(String id) { // If it has no namespace, assume minecraft. if (id != null && !id.contains(":")) { id = "minecraft:" + id; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java index 7b6316b01..8b1438050 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java @@ -34,535 +34,578 @@ public class BlockTypes { private BlockTypes() { } - public static final BlockType AIR = new BlockType("minecraft:air"); - public static final BlockType STONE = new BlockType("minecraft:stone"); - public static final BlockType GRANITE = new BlockType("minecraft:granite"); - public static final BlockType POLISHED_GRANITE = new BlockType("minecraft:polished_granite"); - public static final BlockType DIORITE = new BlockType("minecraft:diorite"); - public static final BlockType POLISHED_DIORITE = new BlockType("minecraft:polished_diorite"); - public static final BlockType ANDESITE = new BlockType("minecraft:andesite"); - public static final BlockType POLISHED_ANDESITE = new BlockType("minecraft:polished_andesite"); - public static final BlockType GRASS_BLOCK = new BlockType("minecraft:grass_block"); - public static final BlockType DIRT = new BlockType("minecraft:dirt"); - public static final BlockType COARSE_DIRT = new BlockType("minecraft:coarse_dirt"); - public static final BlockType PODZOL = new BlockType("minecraft:podzol"); - public static final BlockType COBBLESTONE = new BlockType("minecraft:cobblestone"); - public static final BlockType OAK_PLANKS = new BlockType("minecraft:oak_planks"); - public static final BlockType SPRUCE_PLANKS = new BlockType("minecraft:spruce_planks"); - public static final BlockType BIRCH_PLANKS = new BlockType("minecraft:birch_planks"); - public static final BlockType JUNGLE_PLANKS = new BlockType("minecraft:jungle_planks"); - public static final BlockType ACACIA_PLANKS = new BlockType("minecraft:acacia_planks"); - public static final BlockType DARK_OAK_PLANKS = new BlockType("minecraft:dark_oak_planks"); - public static final BlockType OAK_SAPLING = new BlockType("minecraft:oak_sapling"); - public static final BlockType SPRUCE_SAPLING = new BlockType("minecraft:spruce_sapling"); - public static final BlockType BIRCH_SAPLING = new BlockType("minecraft:birch_sapling"); - public static final BlockType JUNGLE_SAPLING = new BlockType("minecraft:jungle_sapling"); - public static final BlockType ACACIA_SAPLING = new BlockType("minecraft:acacia_sapling"); - public static final BlockType DARK_OAK_SAPLING = new BlockType("minecraft:dark_oak_sapling"); - public static final BlockType BEDROCK = new BlockType("minecraft:bedrock"); - public static final BlockType FLOWING_WATER = new BlockType("minecraft:flowing_water"); - public static final BlockType WATER = new BlockType("minecraft:water"); - public static final BlockType FLOWING_LAVA = new BlockType("minecraft:flowing_lava"); - public static final BlockType LAVA = new BlockType("minecraft:lava"); - public static final BlockType SAND = new BlockType("minecraft:sand"); - public static final BlockType RED_SAND = new BlockType("minecraft:red_sand"); - public static final BlockType GRAVEL = new BlockType("minecraft:gravel"); - public static final BlockType GOLD_ORE = new BlockType("minecraft:gold_ore"); - public static final BlockType IRON_ORE = new BlockType("minecraft:iron_ore"); - public static final BlockType COAL_ORE = new BlockType("minecraft:coal_ore"); - public static final BlockType OAK_LOG = new BlockType("minecraft:oak_log"); - public static final BlockType SPRUCE_LOG = new BlockType("minecraft:spruce_log"); - public static final BlockType BIRCH_LOG = new BlockType("minecraft:birch_log"); - public static final BlockType JUNGLE_LOG = new BlockType("minecraft:jungle_log"); - public static final BlockType ACACIA_LOG = new BlockType("minecraft:acacia_log"); - public static final BlockType DARK_OAK_LOG = new BlockType("minecraft:dark_oak_log"); - public static final BlockType OAK_BARK = new BlockType("minecraft:oak_bark"); - public static final BlockType SPRUCE_BARK = new BlockType("minecraft:spruce_bark"); - public static final BlockType BIRCH_BARK = new BlockType("minecraft:birch_bark"); - public static final BlockType JUNGLE_BARK = new BlockType("minecraft:jungle_bark"); public static final BlockType ACACIA_BARK = new BlockType("minecraft:acacia_bark"); - public static final BlockType DARK_OAK_BARK = new BlockType("minecraft:dark_oak_bark"); - public static final BlockType OAK_LEAVES = new BlockType("minecraft:oak_leaves"); - public static final BlockType SPRUCE_LEAVES = new BlockType("minecraft:spruce_leaves"); - public static final BlockType BIRCH_LEAVES = new BlockType("minecraft:birch_leaves"); - public static final BlockType JUNGLE_LEAVES = new BlockType("minecraft:jungle_leaves"); + public static final BlockType ACACIA_BUTTON = new BlockType("minecraft:acacia_button"); + public static final BlockType ACACIA_DOOR = new BlockType("minecraft:acacia_door"); + public static final BlockType ACACIA_FENCE = new BlockType("minecraft:acacia_fence"); + public static final BlockType ACACIA_FENCE_GATE = new BlockType("minecraft:acacia_fence_gate"); public static final BlockType ACACIA_LEAVES = new BlockType("minecraft:acacia_leaves"); - public static final BlockType DARK_OAK_LEAVES = new BlockType("minecraft:dark_oak_leaves"); - public static final BlockType SPONGE = new BlockType("minecraft:sponge"); - public static final BlockType WET_SPONGE = new BlockType("minecraft:wet_sponge"); - public static final BlockType GLASS = new BlockType("minecraft:glass"); - public static final BlockType LAPIS_ORE = new BlockType("minecraft:lapis_ore"); - public static final BlockType LAPIS_BLOCK = new BlockType("minecraft:lapis_block"); - public static final BlockType DISPENSER = new BlockType("minecraft:dispenser"); - public static final BlockType SANDSTONE = new BlockType("minecraft:sandstone"); - public static final BlockType CHISELED_SANDSTONE = new BlockType("minecraft:chiseled_sandstone"); - public static final BlockType CUT_SANDSTONE = new BlockType("minecraft:cut_sandstone"); - public static final BlockType NOTE_BLOCK = new BlockType("minecraft:note_block"); - public static final BlockType WHITE_BED = new BlockType("minecraft:white_bed"); - public static final BlockType ORANGE_BED = new BlockType("minecraft:orange_bed"); - public static final BlockType MAGENTA_BED = new BlockType("minecraft:magenta_bed"); - public static final BlockType LIGHT_BLUE_BED = new BlockType("minecraft:light_blue_bed"); - public static final BlockType YELLOW_BED = new BlockType("minecraft:yellow_bed"); - public static final BlockType LIME_BED = new BlockType("minecraft:lime_bed"); - public static final BlockType PINK_BED = new BlockType("minecraft:pink_bed"); - public static final BlockType GRAY_BED = new BlockType("minecraft:gray_bed"); - public static final BlockType LIGHT_GRAY_BED = new BlockType("minecraft:light_gray_bed"); - public static final BlockType CYAN_BED = new BlockType("minecraft:cyan_bed"); - public static final BlockType PURPLE_BED = new BlockType("minecraft:purple_bed"); - public static final BlockType BLUE_BED = new BlockType("minecraft:blue_bed"); - public static final BlockType BROWN_BED = new BlockType("minecraft:brown_bed"); - public static final BlockType GREEN_BED = new BlockType("minecraft:green_bed"); - public static final BlockType RED_BED = new BlockType("minecraft:red_bed"); + public static final BlockType ACACIA_LOG = new BlockType("minecraft:acacia_log"); + public static final BlockType ACACIA_PLANKS = new BlockType("minecraft:acacia_planks"); + public static final BlockType ACACIA_PRESSURE_PLATE = new BlockType("minecraft:acacia_pressure_plate"); + public static final BlockType ACACIA_SAPLING = new BlockType("minecraft:acacia_sapling"); + public static final BlockType ACACIA_SLAB = new BlockType("minecraft:acacia_slab"); + public static final BlockType ACACIA_STAIRS = new BlockType("minecraft:acacia_stairs"); + public static final BlockType ACACIA_TRAPDOOR = new BlockType("minecraft:acacia_trapdoor"); + public static final BlockType ACTIVATOR_RAIL = new BlockType("minecraft:activator_rail"); + public static final BlockType AIR = new BlockType("minecraft:air"); + public static final BlockType ALLIUM = new BlockType("minecraft:allium"); + public static final BlockType ANDESITE = new BlockType("minecraft:andesite"); + public static final BlockType ANVIL = new BlockType("minecraft:anvil"); + public static final BlockType ATTACHED_MELON_STEM = new BlockType("minecraft:attached_melon_stem"); + public static final BlockType ATTACHED_PUMPKIN_STEM = new BlockType("minecraft:attached_pumpkin_stem"); + public static final BlockType AZURE_BLUET = new BlockType("minecraft:azure_bluet"); + public static final BlockType BARRIER = new BlockType("minecraft:barrier"); + public static final BlockType BEACON = new BlockType("minecraft:beacon"); + public static final BlockType BEDROCK = new BlockType("minecraft:bedrock"); + public static final BlockType BEETROOTS = new BlockType("minecraft:beetroots"); + public static final BlockType BIRCH_BARK = new BlockType("minecraft:birch_bark"); + public static final BlockType BIRCH_BUTTON = new BlockType("minecraft:birch_button"); + public static final BlockType BIRCH_DOOR = new BlockType("minecraft:birch_door"); + public static final BlockType BIRCH_FENCE = new BlockType("minecraft:birch_fence"); + public static final BlockType BIRCH_FENCE_GATE = new BlockType("minecraft:birch_fence_gate"); + public static final BlockType BIRCH_LEAVES = new BlockType("minecraft:birch_leaves"); + public static final BlockType BIRCH_LOG = new BlockType("minecraft:birch_log"); + public static final BlockType BIRCH_PLANKS = new BlockType("minecraft:birch_planks"); + public static final BlockType BIRCH_PRESSURE_PLATE = new BlockType("minecraft:birch_pressure_plate"); + public static final BlockType BIRCH_SAPLING = new BlockType("minecraft:birch_sapling"); + public static final BlockType BIRCH_SLAB = new BlockType("minecraft:birch_slab"); + public static final BlockType BIRCH_STAIRS = new BlockType("minecraft:birch_stairs"); + public static final BlockType BIRCH_TRAPDOOR = new BlockType("minecraft:birch_trapdoor"); + public static final BlockType BLACK_BANNER = new BlockType("minecraft:black_banner"); public static final BlockType BLACK_BED = new BlockType("minecraft:black_bed"); - public static final BlockType POWERED_RAIL = new BlockType("minecraft:powered_rail"); - public static final BlockType DETECTOR_RAIL = new BlockType("minecraft:detector_rail"); - public static final BlockType STICKY_PISTON = new BlockType("minecraft:sticky_piston"); + public static final BlockType BLACK_CARPET = new BlockType("minecraft:black_carpet"); + public static final BlockType BLACK_CONCRETE = new BlockType("minecraft:black_concrete"); + public static final BlockType BLACK_CONCRETE_POWDER = new BlockType("minecraft:black_concrete_powder"); + public static final BlockType BLACK_GLAZED_TERRACOTTA = new BlockType("minecraft:black_glazed_terracotta"); + public static final BlockType BLACK_SHULKER_BOX = new BlockType("minecraft:black_shulker_box"); + public static final BlockType BLACK_STAINED_GLASS = new BlockType("minecraft:black_stained_glass"); + public static final BlockType BLACK_STAINED_GLASS_PANE = new BlockType("minecraft:black_stained_glass_pane"); + public static final BlockType BLACK_TERRACOTTA = new BlockType("minecraft:black_terracotta"); + public static final BlockType BLACK_WALL_BANNER = new BlockType("minecraft:black_wall_banner"); + public static final BlockType BLACK_WOOL = new BlockType("minecraft:black_wool"); + public static final BlockType BLUE_BANNER = new BlockType("minecraft:blue_banner"); + public static final BlockType BLUE_BED = new BlockType("minecraft:blue_bed"); + public static final BlockType BLUE_CARPET = new BlockType("minecraft:blue_carpet"); + public static final BlockType BLUE_CONCRETE = new BlockType("minecraft:blue_concrete"); + public static final BlockType BLUE_CONCRETE_POWDER = new BlockType("minecraft:blue_concrete_powder"); + public static final BlockType BLUE_GLAZED_TERRACOTTA = new BlockType("minecraft:blue_glazed_terracotta"); + public static final BlockType BLUE_ICE = new BlockType("minecraft:blue_ice"); + public static final BlockType BLUE_ORCHID = new BlockType("minecraft:blue_orchid"); + public static final BlockType BLUE_SHULKER_BOX = new BlockType("minecraft:blue_shulker_box"); + public static final BlockType BLUE_STAINED_GLASS = new BlockType("minecraft:blue_stained_glass"); + public static final BlockType BLUE_STAINED_GLASS_PANE = new BlockType("minecraft:blue_stained_glass_pane"); + public static final BlockType BLUE_TERRACOTTA = new BlockType("minecraft:blue_terracotta"); + public static final BlockType BLUE_WALL_BANNER = new BlockType("minecraft:blue_wall_banner"); + public static final BlockType BLUE_WOOL = new BlockType("minecraft:blue_wool"); + public static final BlockType BONE_BLOCK = new BlockType("minecraft:bone_block"); + public static final BlockType BOOKSHELF = new BlockType("minecraft:bookshelf"); + public static final BlockType BRAIN_CORAL = new BlockType("minecraft:brain_coral"); + public static final BlockType BRAIN_CORAL_BLOCK = new BlockType("minecraft:brain_coral_block"); + public static final BlockType BRAIN_CORAL_FAN = new BlockType("minecraft:brain_coral_fan"); + public static final BlockType BREWING_STAND = new BlockType("minecraft:brewing_stand"); + public static final BlockType BRICK_SLAB = new BlockType("minecraft:brick_slab"); + public static final BlockType BRICK_STAIRS = new BlockType("minecraft:brick_stairs"); + public static final BlockType BRICKS = new BlockType("minecraft:bricks"); + public static final BlockType BROWN_BANNER = new BlockType("minecraft:brown_banner"); + public static final BlockType BROWN_BED = new BlockType("minecraft:brown_bed"); + public static final BlockType BROWN_CARPET = new BlockType("minecraft:brown_carpet"); + public static final BlockType BROWN_CONCRETE = new BlockType("minecraft:brown_concrete"); + public static final BlockType BROWN_CONCRETE_POWDER = new BlockType("minecraft:brown_concrete_powder"); + public static final BlockType BROWN_GLAZED_TERRACOTTA = new BlockType("minecraft:brown_glazed_terracotta"); + public static final BlockType BROWN_MUSHROOM = new BlockType("minecraft:brown_mushroom"); + public static final BlockType BROWN_MUSHROOM_BLOCK = new BlockType("minecraft:brown_mushroom_block"); + public static final BlockType BROWN_SHULKER_BOX = new BlockType("minecraft:brown_shulker_box"); + public static final BlockType BROWN_STAINED_GLASS = new BlockType("minecraft:brown_stained_glass"); + public static final BlockType BROWN_STAINED_GLASS_PANE = new BlockType("minecraft:brown_stained_glass_pane"); + public static final BlockType BROWN_TERRACOTTA = new BlockType("minecraft:brown_terracotta"); + public static final BlockType BROWN_WALL_BANNER = new BlockType("minecraft:brown_wall_banner"); + public static final BlockType BROWN_WOOL = new BlockType("minecraft:brown_wool"); + public static final BlockType BUBBLE_COLUMN = new BlockType("minecraft:bubble_column"); + public static final BlockType BUBBLE_CORAL = new BlockType("minecraft:bubble_coral"); + public static final BlockType BUBBLE_CORAL_BLOCK = new BlockType("minecraft:bubble_coral_block"); + public static final BlockType BUBBLE_CORAL_FAN = new BlockType("minecraft:bubble_coral_fan"); + public static final BlockType CACTUS = new BlockType("minecraft:cactus"); + public static final BlockType CAKE = new BlockType("minecraft:cake"); + public static final BlockType CARROTS = new BlockType("minecraft:carrots"); + public static final BlockType CARVED_PUMPKIN = new BlockType("minecraft:carved_pumpkin"); + public static final BlockType CAULDRON = new BlockType("minecraft:cauldron"); + public static final BlockType CAVE_AIR = new BlockType("minecraft:cave_air"); + public static final BlockType CHAIN_COMMAND_BLOCK = new BlockType("minecraft:chain_command_block"); + public static final BlockType CHEST = new BlockType("minecraft:chest"); + public static final BlockType CHIPPED_ANVIL = new BlockType("minecraft:chipped_anvil"); + public static final BlockType CHISELED_QUARTZ_BLOCK = new BlockType("minecraft:chiseled_quartz_block"); + public static final BlockType CHISELED_RED_SANDSTONE = new BlockType("minecraft:chiseled_red_sandstone"); + public static final BlockType CHISELED_SANDSTONE = new BlockType("minecraft:chiseled_sandstone"); + public static final BlockType CHISELED_STONE_BRICKS = new BlockType("minecraft:chiseled_stone_bricks"); + public static final BlockType CHORUS_FLOWER = new BlockType("minecraft:chorus_flower"); + public static final BlockType CHORUS_PLANT = new BlockType("minecraft:chorus_plant"); + public static final BlockType CLAY = new BlockType("minecraft:clay"); + public static final BlockType COAL_BLOCK = new BlockType("minecraft:coal_block"); + public static final BlockType COAL_ORE = new BlockType("minecraft:coal_ore"); + public static final BlockType COARSE_DIRT = new BlockType("minecraft:coarse_dirt"); + public static final BlockType COBBLESTONE = new BlockType("minecraft:cobblestone"); + public static final BlockType COBBLESTONE_SLAB = new BlockType("minecraft:cobblestone_slab"); + public static final BlockType COBBLESTONE_STAIRS = new BlockType("minecraft:cobblestone_stairs"); + public static final BlockType COBBLESTONE_WALL = new BlockType("minecraft:cobblestone_wall"); public static final BlockType COBWEB = new BlockType("minecraft:cobweb"); - public static final BlockType GRASS = new BlockType("minecraft:grass"); - public static final BlockType FERN = new BlockType("minecraft:fern"); + public static final BlockType COCOA = new BlockType("minecraft:cocoa"); + public static final BlockType COMMAND_BLOCK = new BlockType("minecraft:command_block"); + public static final BlockType COMPARATOR = new BlockType("minecraft:comparator"); + public static final BlockType CONDUIT = new BlockType("minecraft:conduit"); + public static final BlockType CRACKED_STONE_BRICKS = new BlockType("minecraft:cracked_stone_bricks"); + public static final BlockType CRAFTING_TABLE = new BlockType("minecraft:crafting_table"); + public static final BlockType CREEPER_HEAD = new BlockType("minecraft:creeper_head"); + public static final BlockType CREEPER_WALL_HEAD = new BlockType("minecraft:creeper_wall_head"); + public static final BlockType CUT_RED_SANDSTONE = new BlockType("minecraft:cut_red_sandstone"); + public static final BlockType CUT_SANDSTONE = new BlockType("minecraft:cut_sandstone"); + public static final BlockType CYAN_BANNER = new BlockType("minecraft:cyan_banner"); + public static final BlockType CYAN_BED = new BlockType("minecraft:cyan_bed"); + public static final BlockType CYAN_CARPET = new BlockType("minecraft:cyan_carpet"); + public static final BlockType CYAN_CONCRETE = new BlockType("minecraft:cyan_concrete"); + public static final BlockType CYAN_CONCRETE_POWDER = new BlockType("minecraft:cyan_concrete_powder"); + public static final BlockType CYAN_GLAZED_TERRACOTTA = new BlockType("minecraft:cyan_glazed_terracotta"); + public static final BlockType CYAN_SHULKER_BOX = new BlockType("minecraft:cyan_shulker_box"); + public static final BlockType CYAN_STAINED_GLASS = new BlockType("minecraft:cyan_stained_glass"); + public static final BlockType CYAN_STAINED_GLASS_PANE = new BlockType("minecraft:cyan_stained_glass_pane"); + public static final BlockType CYAN_TERRACOTTA = new BlockType("minecraft:cyan_terracotta"); + public static final BlockType CYAN_WALL_BANNER = new BlockType("minecraft:cyan_wall_banner"); + public static final BlockType CYAN_WOOL = new BlockType("minecraft:cyan_wool"); + public static final BlockType DAMAGED_ANVIL = new BlockType("minecraft:damaged_anvil"); + public static final BlockType DANDELION = new BlockType("minecraft:dandelion"); + public static final BlockType DARK_OAK_BARK = new BlockType("minecraft:dark_oak_bark"); + public static final BlockType DARK_OAK_BUTTON = new BlockType("minecraft:dark_oak_button"); + public static final BlockType DARK_OAK_DOOR = new BlockType("minecraft:dark_oak_door"); + public static final BlockType DARK_OAK_FENCE = new BlockType("minecraft:dark_oak_fence"); + public static final BlockType DARK_OAK_FENCE_GATE = new BlockType("minecraft:dark_oak_fence_gate"); + public static final BlockType DARK_OAK_LEAVES = new BlockType("minecraft:dark_oak_leaves"); + public static final BlockType DARK_OAK_LOG = new BlockType("minecraft:dark_oak_log"); + public static final BlockType DARK_OAK_PLANKS = new BlockType("minecraft:dark_oak_planks"); + public static final BlockType DARK_OAK_PRESSURE_PLATE = new BlockType("minecraft:dark_oak_pressure_plate"); + public static final BlockType DARK_OAK_SAPLING = new BlockType("minecraft:dark_oak_sapling"); + public static final BlockType DARK_OAK_SLAB = new BlockType("minecraft:dark_oak_slab"); + public static final BlockType DARK_OAK_STAIRS = new BlockType("minecraft:dark_oak_stairs"); + public static final BlockType DARK_OAK_TRAPDOOR = new BlockType("minecraft:dark_oak_trapdoor"); + public static final BlockType DARK_PRISMARINE = new BlockType("minecraft:dark_prismarine"); + public static final BlockType DARK_PRISMARINE_SLAB = new BlockType("minecraft:dark_prismarine_slab"); + public static final BlockType DARK_PRISMARINE_STAIRS = new BlockType("minecraft:dark_prismarine_stairs"); + public static final BlockType DAYLIGHT_DETECTOR = new BlockType("minecraft:daylight_detector"); + public static final BlockType DEAD_BRAIN_CORAL_BLOCK = new BlockType("minecraft:dead_brain_coral_block"); + public static final BlockType DEAD_BUBBLE_CORAL_BLOCK = new BlockType("minecraft:dead_bubble_coral_block"); public static final BlockType DEAD_BUSH = new BlockType("minecraft:dead_bush"); + public static final BlockType DEAD_FIRE_CORAL_BLOCK = new BlockType("minecraft:dead_fire_coral_block"); + public static final BlockType DEAD_HORN_CORAL_BLOCK = new BlockType("minecraft:dead_horn_coral_block"); + public static final BlockType DEAD_TUBE_CORAL_BLOCK = new BlockType("minecraft:dead_tube_coral_block"); + public static final BlockType DETECTOR_RAIL = new BlockType("minecraft:detector_rail"); + public static final BlockType DIAMOND_BLOCK = new BlockType("minecraft:diamond_block"); + public static final BlockType DIAMOND_ORE = new BlockType("minecraft:diamond_ore"); + public static final BlockType DIORITE = new BlockType("minecraft:diorite"); + public static final BlockType DIRT = new BlockType("minecraft:dirt"); + public static final BlockType DISPENSER = new BlockType("minecraft:dispenser"); + public static final BlockType DRAGON_EGG = new BlockType("minecraft:dragon_egg"); + public static final BlockType DRAGON_HEAD = new BlockType("minecraft:dragon_head"); + public static final BlockType DRAGON_WALL_HEAD = new BlockType("minecraft:dragon_wall_head"); + public static final BlockType DRIED_KELP_BLOCK = new BlockType("minecraft:dried_kelp_block"); + public static final BlockType DROPPER = new BlockType("minecraft:dropper"); + public static final BlockType EMERALD_BLOCK = new BlockType("minecraft:emerald_block"); + public static final BlockType EMERALD_ORE = new BlockType("minecraft:emerald_ore"); + public static final BlockType ENCHANTING_TABLE = new BlockType("minecraft:enchanting_table"); + public static final BlockType END_GATEWAY = new BlockType("minecraft:end_gateway"); + public static final BlockType END_PORTAL = new BlockType("minecraft:end_portal"); + public static final BlockType END_PORTAL_FRAME = new BlockType("minecraft:end_portal_frame"); + public static final BlockType END_ROD = new BlockType("minecraft:end_rod"); + public static final BlockType END_STONE = new BlockType("minecraft:end_stone"); + public static final BlockType END_STONE_BRICKS = new BlockType("minecraft:end_stone_bricks"); + public static final BlockType ENDER_CHEST = new BlockType("minecraft:ender_chest"); + public static final BlockType FARMLAND = new BlockType("minecraft:farmland"); + public static final BlockType FERN = new BlockType("minecraft:fern"); + public static final BlockType FIRE = new BlockType("minecraft:fire"); + public static final BlockType FIRE_CORAL = new BlockType("minecraft:fire_coral"); + public static final BlockType FIRE_CORAL_BLOCK = new BlockType("minecraft:fire_coral_block"); + public static final BlockType FIRE_CORAL_FAN = new BlockType("minecraft:fire_coral_fan"); + public static final BlockType FLOWER_POT = new BlockType("minecraft:flower_pot"); + public static final BlockType FROSTED_ICE = new BlockType("minecraft:frosted_ice"); + public static final BlockType FURNACE = new BlockType("minecraft:furnace"); + public static final BlockType GLASS = new BlockType("minecraft:glass"); + public static final BlockType GLASS_PANE = new BlockType("minecraft:glass_pane"); + public static final BlockType GLOWSTONE = new BlockType("minecraft:glowstone"); + public static final BlockType GOLD_BLOCK = new BlockType("minecraft:gold_block"); + public static final BlockType GOLD_ORE = new BlockType("minecraft:gold_ore"); + public static final BlockType GRANITE = new BlockType("minecraft:granite"); + public static final BlockType GRASS = new BlockType("minecraft:grass"); + public static final BlockType GRASS_BLOCK = new BlockType("minecraft:grass_block"); + public static final BlockType GRASS_PATH = new BlockType("minecraft:grass_path"); + public static final BlockType GRAVEL = new BlockType("minecraft:gravel"); + public static final BlockType GRAY_BANNER = new BlockType("minecraft:gray_banner"); + public static final BlockType GRAY_BED = new BlockType("minecraft:gray_bed"); + public static final BlockType GRAY_CARPET = new BlockType("minecraft:gray_carpet"); + public static final BlockType GRAY_CONCRETE = new BlockType("minecraft:gray_concrete"); + public static final BlockType GRAY_CONCRETE_POWDER = new BlockType("minecraft:gray_concrete_powder"); + public static final BlockType GRAY_GLAZED_TERRACOTTA = new BlockType("minecraft:gray_glazed_terracotta"); + public static final BlockType GRAY_SHULKER_BOX = new BlockType("minecraft:gray_shulker_box"); + public static final BlockType GRAY_STAINED_GLASS = new BlockType("minecraft:gray_stained_glass"); + public static final BlockType GRAY_STAINED_GLASS_PANE = new BlockType("minecraft:gray_stained_glass_pane"); + public static final BlockType GRAY_TERRACOTTA = new BlockType("minecraft:gray_terracotta"); + public static final BlockType GRAY_WALL_BANNER = new BlockType("minecraft:gray_wall_banner"); + public static final BlockType GRAY_WOOL = new BlockType("minecraft:gray_wool"); + public static final BlockType GREEN_BANNER = new BlockType("minecraft:green_banner"); + public static final BlockType GREEN_BED = new BlockType("minecraft:green_bed"); + public static final BlockType GREEN_CARPET = new BlockType("minecraft:green_carpet"); + public static final BlockType GREEN_CONCRETE = new BlockType("minecraft:green_concrete"); + public static final BlockType GREEN_CONCRETE_POWDER = new BlockType("minecraft:green_concrete_powder"); + public static final BlockType GREEN_GLAZED_TERRACOTTA = new BlockType("minecraft:green_glazed_terracotta"); + public static final BlockType GREEN_SHULKER_BOX = new BlockType("minecraft:green_shulker_box"); + public static final BlockType GREEN_STAINED_GLASS = new BlockType("minecraft:green_stained_glass"); + public static final BlockType GREEN_STAINED_GLASS_PANE = new BlockType("minecraft:green_stained_glass_pane"); + public static final BlockType GREEN_TERRACOTTA = new BlockType("minecraft:green_terracotta"); + public static final BlockType GREEN_WALL_BANNER = new BlockType("minecraft:green_wall_banner"); + public static final BlockType GREEN_WOOL = new BlockType("minecraft:green_wool"); + public static final BlockType HAY_BLOCK = new BlockType("minecraft:hay_block"); + public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = new BlockType("minecraft:heavy_weighted_pressure_plate"); + public static final BlockType HOPPER = new BlockType("minecraft:hopper"); + public static final BlockType HORN_CORAL = new BlockType("minecraft:horn_coral"); + public static final BlockType HORN_CORAL_BLOCK = new BlockType("minecraft:horn_coral_block"); + public static final BlockType HORN_CORAL_FAN = new BlockType("minecraft:horn_coral_fan"); + public static final BlockType ICE = new BlockType("minecraft:ice"); + public static final BlockType INFESTED_CHISELED_STONE_BRICKS = new BlockType("minecraft:infested_chiseled_stone_bricks"); + public static final BlockType INFESTED_COBBLESTONE = new BlockType("minecraft:infested_cobblestone"); + public static final BlockType INFESTED_CRACKED_STONE_BRICKS = new BlockType("minecraft:infested_cracked_stone_bricks"); + public static final BlockType INFESTED_MOSSY_STONE_BRICKS = new BlockType("minecraft:infested_mossy_stone_bricks"); + public static final BlockType INFESTED_STONE = new BlockType("minecraft:infested_stone"); + public static final BlockType INFESTED_STONE_BRICKS = new BlockType("minecraft:infested_stone_bricks"); + public static final BlockType IRON_BARS = new BlockType("minecraft:iron_bars"); + public static final BlockType IRON_BLOCK = new BlockType("minecraft:iron_block"); + public static final BlockType IRON_DOOR = new BlockType("minecraft:iron_door"); + public static final BlockType IRON_ORE = new BlockType("minecraft:iron_ore"); + public static final BlockType IRON_TRAPDOOR = new BlockType("minecraft:iron_trapdoor"); + public static final BlockType JACK_O_LANTERN = new BlockType("minecraft:jack_o_lantern"); + public static final BlockType JUKEBOX = new BlockType("minecraft:jukebox"); + public static final BlockType JUNGLE_BARK = new BlockType("minecraft:jungle_bark"); + public static final BlockType JUNGLE_BUTTON = new BlockType("minecraft:jungle_button"); + public static final BlockType JUNGLE_DOOR = new BlockType("minecraft:jungle_door"); + public static final BlockType JUNGLE_FENCE = new BlockType("minecraft:jungle_fence"); + public static final BlockType JUNGLE_FENCE_GATE = new BlockType("minecraft:jungle_fence_gate"); + public static final BlockType JUNGLE_LEAVES = new BlockType("minecraft:jungle_leaves"); + public static final BlockType JUNGLE_LOG = new BlockType("minecraft:jungle_log"); + public static final BlockType JUNGLE_PLANKS = new BlockType("minecraft:jungle_planks"); + public static final BlockType JUNGLE_PRESSURE_PLATE = new BlockType("minecraft:jungle_pressure_plate"); + public static final BlockType JUNGLE_SAPLING = new BlockType("minecraft:jungle_sapling"); + public static final BlockType JUNGLE_SLAB = new BlockType("minecraft:jungle_slab"); + public static final BlockType JUNGLE_STAIRS = new BlockType("minecraft:jungle_stairs"); + public static final BlockType JUNGLE_TRAPDOOR = new BlockType("minecraft:jungle_trapdoor"); + public static final BlockType KELP = new BlockType("minecraft:kelp"); + public static final BlockType KELP_PLANT = new BlockType("minecraft:kelp_plant"); + public static final BlockType LADDER = new BlockType("minecraft:ladder"); + public static final BlockType LAPIS_BLOCK = new BlockType("minecraft:lapis_block"); + public static final BlockType LAPIS_ORE = new BlockType("minecraft:lapis_ore"); + public static final BlockType LARGE_FERN = new BlockType("minecraft:large_fern"); + public static final BlockType LAVA = new BlockType("minecraft:lava"); + public static final BlockType LEVER = new BlockType("minecraft:lever"); + public static final BlockType LIGHT_BLUE_BANNER = new BlockType("minecraft:light_blue_banner"); + public static final BlockType LIGHT_BLUE_BED = new BlockType("minecraft:light_blue_bed"); + public static final BlockType LIGHT_BLUE_CARPET = new BlockType("minecraft:light_blue_carpet"); + public static final BlockType LIGHT_BLUE_CONCRETE = new BlockType("minecraft:light_blue_concrete"); + public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = new BlockType("minecraft:light_blue_concrete_powder"); + public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = new BlockType("minecraft:light_blue_glazed_terracotta"); + public static final BlockType LIGHT_BLUE_SHULKER_BOX = new BlockType("minecraft:light_blue_shulker_box"); + public static final BlockType LIGHT_BLUE_STAINED_GLASS = new BlockType("minecraft:light_blue_stained_glass"); + public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = new BlockType("minecraft:light_blue_stained_glass_pane"); + public static final BlockType LIGHT_BLUE_TERRACOTTA = new BlockType("minecraft:light_blue_terracotta"); + public static final BlockType LIGHT_BLUE_WALL_BANNER = new BlockType("minecraft:light_blue_wall_banner"); + public static final BlockType LIGHT_BLUE_WOOL = new BlockType("minecraft:light_blue_wool"); + public static final BlockType LIGHT_GRAY_BANNER = new BlockType("minecraft:light_gray_banner"); + public static final BlockType LIGHT_GRAY_BED = new BlockType("minecraft:light_gray_bed"); + public static final BlockType LIGHT_GRAY_CARPET = new BlockType("minecraft:light_gray_carpet"); + public static final BlockType LIGHT_GRAY_CONCRETE = new BlockType("minecraft:light_gray_concrete"); + public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = new BlockType("minecraft:light_gray_concrete_powder"); + public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = new BlockType("minecraft:light_gray_glazed_terracotta"); + public static final BlockType LIGHT_GRAY_SHULKER_BOX = new BlockType("minecraft:light_gray_shulker_box"); + public static final BlockType LIGHT_GRAY_STAINED_GLASS = new BlockType("minecraft:light_gray_stained_glass"); + public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = new BlockType("minecraft:light_gray_stained_glass_pane"); + public static final BlockType LIGHT_GRAY_TERRACOTTA = new BlockType("minecraft:light_gray_terracotta"); + public static final BlockType LIGHT_GRAY_WALL_BANNER = new BlockType("minecraft:light_gray_wall_banner"); + public static final BlockType LIGHT_GRAY_WOOL = new BlockType("minecraft:light_gray_wool"); + public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = new BlockType("minecraft:light_weighted_pressure_plate"); + public static final BlockType LILAC = new BlockType("minecraft:lilac"); + public static final BlockType LILY_PAD = new BlockType("minecraft:lily_pad"); + public static final BlockType LIME_BANNER = new BlockType("minecraft:lime_banner"); + public static final BlockType LIME_BED = new BlockType("minecraft:lime_bed"); + public static final BlockType LIME_CARPET = new BlockType("minecraft:lime_carpet"); + public static final BlockType LIME_CONCRETE = new BlockType("minecraft:lime_concrete"); + public static final BlockType LIME_CONCRETE_POWDER = new BlockType("minecraft:lime_concrete_powder"); + public static final BlockType LIME_GLAZED_TERRACOTTA = new BlockType("minecraft:lime_glazed_terracotta"); + public static final BlockType LIME_SHULKER_BOX = new BlockType("minecraft:lime_shulker_box"); + public static final BlockType LIME_STAINED_GLASS = new BlockType("minecraft:lime_stained_glass"); + public static final BlockType LIME_STAINED_GLASS_PANE = new BlockType("minecraft:lime_stained_glass_pane"); + public static final BlockType LIME_TERRACOTTA = new BlockType("minecraft:lime_terracotta"); + public static final BlockType LIME_WALL_BANNER = new BlockType("minecraft:lime_wall_banner"); + public static final BlockType LIME_WOOL = new BlockType("minecraft:lime_wool"); + public static final BlockType MAGENTA_BANNER = new BlockType("minecraft:magenta_banner"); + public static final BlockType MAGENTA_BED = new BlockType("minecraft:magenta_bed"); + public static final BlockType MAGENTA_CARPET = new BlockType("minecraft:magenta_carpet"); + public static final BlockType MAGENTA_CONCRETE = new BlockType("minecraft:magenta_concrete"); + public static final BlockType MAGENTA_CONCRETE_POWDER = new BlockType("minecraft:magenta_concrete_powder"); + public static final BlockType MAGENTA_GLAZED_TERRACOTTA = new BlockType("minecraft:magenta_glazed_terracotta"); + public static final BlockType MAGENTA_SHULKER_BOX = new BlockType("minecraft:magenta_shulker_box"); + public static final BlockType MAGENTA_STAINED_GLASS = new BlockType("minecraft:magenta_stained_glass"); + public static final BlockType MAGENTA_STAINED_GLASS_PANE = new BlockType("minecraft:magenta_stained_glass_pane"); + public static final BlockType MAGENTA_TERRACOTTA = new BlockType("minecraft:magenta_terracotta"); + public static final BlockType MAGENTA_WALL_BANNER = new BlockType("minecraft:magenta_wall_banner"); + public static final BlockType MAGENTA_WOOL = new BlockType("minecraft:magenta_wool"); + public static final BlockType MAGMA_BLOCK = new BlockType("minecraft:magma_block"); + public static final BlockType MELON = new BlockType("minecraft:melon"); + public static final BlockType MELON_STEM = new BlockType("minecraft:melon_stem"); + public static final BlockType MOB_SPAWNER = new BlockType("minecraft:mob_spawner"); + public static final BlockType MOSSY_COBBLESTONE = new BlockType("minecraft:mossy_cobblestone"); + public static final BlockType MOSSY_COBBLESTONE_WALL = new BlockType("minecraft:mossy_cobblestone_wall"); + public static final BlockType MOSSY_STONE_BRICKS = new BlockType("minecraft:mossy_stone_bricks"); + public static final BlockType MOVING_PISTON = new BlockType("minecraft:moving_piston"); + public static final BlockType MUSHROOM_STEM = new BlockType("minecraft:mushroom_stem"); + public static final BlockType MYCELIUM = new BlockType("minecraft:mycelium"); + public static final BlockType NETHER_BRICK_FENCE = new BlockType("minecraft:nether_brick_fence"); + public static final BlockType NETHER_BRICK_SLAB = new BlockType("minecraft:nether_brick_slab"); + public static final BlockType NETHER_BRICK_STAIRS = new BlockType("minecraft:nether_brick_stairs"); + public static final BlockType NETHER_BRICKS = new BlockType("minecraft:nether_bricks"); + public static final BlockType NETHER_QUARTZ_ORE = new BlockType("minecraft:nether_quartz_ore"); + public static final BlockType NETHER_WART = new BlockType("minecraft:nether_wart"); + public static final BlockType NETHER_WART_BLOCK = new BlockType("minecraft:nether_wart_block"); + public static final BlockType NETHERRACK = new BlockType("minecraft:netherrack"); + public static final BlockType NOTE_BLOCK = new BlockType("minecraft:note_block"); + public static final BlockType OAK_BARK = new BlockType("minecraft:oak_bark"); + public static final BlockType OAK_BUTTON = new BlockType("minecraft:oak_button"); + public static final BlockType OAK_DOOR = new BlockType("minecraft:oak_door"); + public static final BlockType OAK_FENCE = new BlockType("minecraft:oak_fence"); + public static final BlockType OAK_FENCE_GATE = new BlockType("minecraft:oak_fence_gate"); + public static final BlockType OAK_LEAVES = new BlockType("minecraft:oak_leaves"); + public static final BlockType OAK_LOG = new BlockType("minecraft:oak_log"); + public static final BlockType OAK_PLANKS = new BlockType("minecraft:oak_planks"); + public static final BlockType OAK_PRESSURE_PLATE = new BlockType("minecraft:oak_pressure_plate"); + public static final BlockType OAK_SAPLING = new BlockType("minecraft:oak_sapling"); + public static final BlockType OAK_SLAB = new BlockType("minecraft:oak_slab"); + public static final BlockType OAK_STAIRS = new BlockType("minecraft:oak_stairs"); + public static final BlockType OAK_TRAPDOOR = new BlockType("minecraft:oak_trapdoor"); + public static final BlockType OBSERVER = new BlockType("minecraft:observer"); + public static final BlockType OBSIDIAN = new BlockType("minecraft:obsidian"); + public static final BlockType ORANGE_BANNER = new BlockType("minecraft:orange_banner"); + public static final BlockType ORANGE_BED = new BlockType("minecraft:orange_bed"); + public static final BlockType ORANGE_CARPET = new BlockType("minecraft:orange_carpet"); + public static final BlockType ORANGE_CONCRETE = new BlockType("minecraft:orange_concrete"); + public static final BlockType ORANGE_CONCRETE_POWDER = new BlockType("minecraft:orange_concrete_powder"); + public static final BlockType ORANGE_GLAZED_TERRACOTTA = new BlockType("minecraft:orange_glazed_terracotta"); + public static final BlockType ORANGE_SHULKER_BOX = new BlockType("minecraft:orange_shulker_box"); + public static final BlockType ORANGE_STAINED_GLASS = new BlockType("minecraft:orange_stained_glass"); + public static final BlockType ORANGE_STAINED_GLASS_PANE = new BlockType("minecraft:orange_stained_glass_pane"); + public static final BlockType ORANGE_TERRACOTTA = new BlockType("minecraft:orange_terracotta"); + public static final BlockType ORANGE_TULIP = new BlockType("minecraft:orange_tulip"); + public static final BlockType ORANGE_WALL_BANNER = new BlockType("minecraft:orange_wall_banner"); + public static final BlockType ORANGE_WOOL = new BlockType("minecraft:orange_wool"); + public static final BlockType OXEYE_DAISY = new BlockType("minecraft:oxeye_daisy"); + public static final BlockType PACKED_ICE = new BlockType("minecraft:packed_ice"); + public static final BlockType PEONY = new BlockType("minecraft:peony"); + public static final BlockType PETRIFIED_OAK_SLAB = new BlockType("minecraft:petrified_oak_slab"); + public static final BlockType PINK_BANNER = new BlockType("minecraft:pink_banner"); + public static final BlockType PINK_BED = new BlockType("minecraft:pink_bed"); + public static final BlockType PINK_CARPET = new BlockType("minecraft:pink_carpet"); + public static final BlockType PINK_CONCRETE = new BlockType("minecraft:pink_concrete"); + public static final BlockType PINK_CONCRETE_POWDER = new BlockType("minecraft:pink_concrete_powder"); + public static final BlockType PINK_GLAZED_TERRACOTTA = new BlockType("minecraft:pink_glazed_terracotta"); + public static final BlockType PINK_SHULKER_BOX = new BlockType("minecraft:pink_shulker_box"); + public static final BlockType PINK_STAINED_GLASS = new BlockType("minecraft:pink_stained_glass"); + public static final BlockType PINK_STAINED_GLASS_PANE = new BlockType("minecraft:pink_stained_glass_pane"); + public static final BlockType PINK_TERRACOTTA = new BlockType("minecraft:pink_terracotta"); + public static final BlockType PINK_TULIP = new BlockType("minecraft:pink_tulip"); + public static final BlockType PINK_WALL_BANNER = new BlockType("minecraft:pink_wall_banner"); + public static final BlockType PINK_WOOL = new BlockType("minecraft:pink_wool"); public static final BlockType PISTON = new BlockType("minecraft:piston"); public static final BlockType PISTON_HEAD = new BlockType("minecraft:piston_head"); - public static final BlockType WHITE_WOOL = new BlockType("minecraft:white_wool"); - public static final BlockType ORANGE_WOOL = new BlockType("minecraft:orange_wool"); - public static final BlockType MAGENTA_WOOL = new BlockType("minecraft:magenta_wool"); - public static final BlockType LIGHT_BLUE_WOOL = new BlockType("minecraft:light_blue_wool"); - public static final BlockType YELLOW_WOOL = new BlockType("minecraft:yellow_wool"); - public static final BlockType LIME_WOOL = new BlockType("minecraft:lime_wool"); - public static final BlockType PINK_WOOL = new BlockType("minecraft:pink_wool"); - public static final BlockType GRAY_WOOL = new BlockType("minecraft:gray_wool"); - public static final BlockType LIGHT_GRAY_WOOL = new BlockType("minecraft:light_gray_wool"); - public static final BlockType CYAN_WOOL = new BlockType("minecraft:cyan_wool"); - public static final BlockType PURPLE_WOOL = new BlockType("minecraft:purple_wool"); - public static final BlockType BLUE_WOOL = new BlockType("minecraft:blue_wool"); - public static final BlockType BROWN_WOOL = new BlockType("minecraft:brown_wool"); - public static final BlockType GREEN_WOOL = new BlockType("minecraft:green_wool"); - public static final BlockType RED_WOOL = new BlockType("minecraft:red_wool"); - public static final BlockType BLACK_WOOL = new BlockType("minecraft:black_wool"); - public static final BlockType MOVING_PISTON = new BlockType("minecraft:moving_piston"); - public static final BlockType DANDELION = new BlockType("minecraft:dandelion"); + public static final BlockType PLAYER_HEAD = new BlockType("minecraft:player_head"); + public static final BlockType PLAYER_WALL_HEAD = new BlockType("minecraft:player_wall_head"); + public static final BlockType PODZOL = new BlockType("minecraft:podzol"); + public static final BlockType POLISHED_ANDESITE = new BlockType("minecraft:polished_andesite"); + public static final BlockType POLISHED_DIORITE = new BlockType("minecraft:polished_diorite"); + public static final BlockType POLISHED_GRANITE = new BlockType("minecraft:polished_granite"); public static final BlockType POPPY = new BlockType("minecraft:poppy"); - public static final BlockType BLUE_ORCHID = new BlockType("minecraft:blue_orchid"); - public static final BlockType ALLIUM = new BlockType("minecraft:allium"); - public static final BlockType AZURE_BLUET = new BlockType("minecraft:azure_bluet"); - public static final BlockType RED_TULIP = new BlockType("minecraft:red_tulip"); - public static final BlockType ORANGE_TULIP = new BlockType("minecraft:orange_tulip"); - public static final BlockType WHITE_TULIP = new BlockType("minecraft:white_tulip"); - public static final BlockType PINK_TULIP = new BlockType("minecraft:pink_tulip"); - public static final BlockType OXEYE_DAISY = new BlockType("minecraft:oxeye_daisy"); - public static final BlockType BROWN_MUSHROOM = new BlockType("minecraft:brown_mushroom"); - public static final BlockType RED_MUSHROOM = new BlockType("minecraft:red_mushroom"); - public static final BlockType GOLD_BLOCK = new BlockType("minecraft:gold_block"); - public static final BlockType IRON_BLOCK = new BlockType("minecraft:iron_block"); - public static final BlockType BRICKS = new BlockType("minecraft:bricks"); - public static final BlockType TNT = new BlockType("minecraft:tnt"); - public static final BlockType BOOKSHELF = new BlockType("minecraft:bookshelf"); - public static final BlockType MOSSY_COBBLESTONE = new BlockType("minecraft:mossy_cobblestone"); - public static final BlockType OBSIDIAN = new BlockType("minecraft:obsidian"); - public static final BlockType TORCH = new BlockType("minecraft:torch"); - public static final BlockType WALL_TORCH = new BlockType("minecraft:wall_torch"); - public static final BlockType FIRE = new BlockType("minecraft:fire"); - public static final BlockType MOB_SPAWNER = new BlockType("minecraft:mob_spawner"); - public static final BlockType OAK_STAIRS = new BlockType("minecraft:oak_stairs"); - public static final BlockType CHEST = new BlockType("minecraft:chest"); - public static final BlockType REDSTONE_WIRE = new BlockType("minecraft:redstone_wire"); - public static final BlockType DIAMOND_ORE = new BlockType("minecraft:diamond_ore"); - public static final BlockType DIAMOND_BLOCK = new BlockType("minecraft:diamond_block"); - public static final BlockType CRAFTING_TABLE = new BlockType("minecraft:crafting_table"); - public static final BlockType WHEAT = new BlockType("minecraft:wheat"); - public static final BlockType FARMLAND = new BlockType("minecraft:farmland"); - public static final BlockType FURNACE = new BlockType("minecraft:furnace"); - public static final BlockType SIGN = new BlockType("minecraft:sign"); - public static final BlockType OAK_DOOR = new BlockType("minecraft:oak_door"); - public static final BlockType LADDER = new BlockType("minecraft:ladder"); + public static final BlockType PORTAL = new BlockType("minecraft:portal"); + public static final BlockType POTATOES = new BlockType("minecraft:potatoes"); + public static final BlockType POTTED_ACACIA_SAPLING = new BlockType("minecraft:potted_acacia_sapling"); + public static final BlockType POTTED_ALLIUM = new BlockType("minecraft:potted_allium"); + public static final BlockType POTTED_AZURE_BLUET = new BlockType("minecraft:potted_azure_bluet"); + public static final BlockType POTTED_BIRCH_SAPLING = new BlockType("minecraft:potted_birch_sapling"); + public static final BlockType POTTED_BLUE_ORCHID = new BlockType("minecraft:potted_blue_orchid"); + public static final BlockType POTTED_BROWN_MUSHROOM = new BlockType("minecraft:potted_brown_mushroom"); + public static final BlockType POTTED_CACTUS = new BlockType("minecraft:potted_cactus"); + public static final BlockType POTTED_DANDELION = new BlockType("minecraft:potted_dandelion"); + public static final BlockType POTTED_DARK_OAK_SAPLING = new BlockType("minecraft:potted_dark_oak_sapling"); + public static final BlockType POTTED_DEAD_BUSH = new BlockType("minecraft:potted_dead_bush"); + public static final BlockType POTTED_FERN = new BlockType("minecraft:potted_fern"); + public static final BlockType POTTED_JUNGLE_SAPLING = new BlockType("minecraft:potted_jungle_sapling"); + public static final BlockType POTTED_OAK_SAPLING = new BlockType("minecraft:potted_oak_sapling"); + public static final BlockType POTTED_ORANGE_TULIP = new BlockType("minecraft:potted_orange_tulip"); + public static final BlockType POTTED_OXEYE_DAISY = new BlockType("minecraft:potted_oxeye_daisy"); + public static final BlockType POTTED_PINK_TULIP = new BlockType("minecraft:potted_pink_tulip"); + public static final BlockType POTTED_POPPY = new BlockType("minecraft:potted_poppy"); + public static final BlockType POTTED_RED_MUSHROOM = new BlockType("minecraft:potted_red_mushroom"); + public static final BlockType POTTED_RED_TULIP = new BlockType("minecraft:potted_red_tulip"); + public static final BlockType POTTED_SPRUCE_SAPLING = new BlockType("minecraft:potted_spruce_sapling"); + public static final BlockType POTTED_WHITE_TULIP = new BlockType("minecraft:potted_white_tulip"); + public static final BlockType POWERED_RAIL = new BlockType("minecraft:powered_rail"); + public static final BlockType PRISMARINE = new BlockType("minecraft:prismarine"); + public static final BlockType PRISMARINE_BRICK_SLAB = new BlockType("minecraft:prismarine_brick_slab"); + public static final BlockType PRISMARINE_BRICK_STAIRS = new BlockType("minecraft:prismarine_brick_stairs"); + public static final BlockType PRISMARINE_BRICKS = new BlockType("minecraft:prismarine_bricks"); + public static final BlockType PRISMARINE_SLAB = new BlockType("minecraft:prismarine_slab"); + public static final BlockType PRISMARINE_STAIRS = new BlockType("minecraft:prismarine_stairs"); + public static final BlockType PUMPKIN = new BlockType("minecraft:pumpkin"); + public static final BlockType PUMPKIN_STEM = new BlockType("minecraft:pumpkin_stem"); + public static final BlockType PURPLE_BANNER = new BlockType("minecraft:purple_banner"); + public static final BlockType PURPLE_BED = new BlockType("minecraft:purple_bed"); + public static final BlockType PURPLE_CARPET = new BlockType("minecraft:purple_carpet"); + public static final BlockType PURPLE_CONCRETE = new BlockType("minecraft:purple_concrete"); + public static final BlockType PURPLE_CONCRETE_POWDER = new BlockType("minecraft:purple_concrete_powder"); + public static final BlockType PURPLE_GLAZED_TERRACOTTA = new BlockType("minecraft:purple_glazed_terracotta"); + public static final BlockType PURPLE_SHULKER_BOX = new BlockType("minecraft:purple_shulker_box"); + public static final BlockType PURPLE_STAINED_GLASS = new BlockType("minecraft:purple_stained_glass"); + public static final BlockType PURPLE_STAINED_GLASS_PANE = new BlockType("minecraft:purple_stained_glass_pane"); + public static final BlockType PURPLE_TERRACOTTA = new BlockType("minecraft:purple_terracotta"); + public static final BlockType PURPLE_WALL_BANNER = new BlockType("minecraft:purple_wall_banner"); + public static final BlockType PURPLE_WOOL = new BlockType("minecraft:purple_wool"); + public static final BlockType PURPUR_BLOCK = new BlockType("minecraft:purpur_block"); + public static final BlockType PURPUR_PILLAR = new BlockType("minecraft:purpur_pillar"); + public static final BlockType PURPUR_SLAB = new BlockType("minecraft:purpur_slab"); + public static final BlockType PURPUR_STAIRS = new BlockType("minecraft:purpur_stairs"); + public static final BlockType QUARTZ_BLOCK = new BlockType("minecraft:quartz_block"); + public static final BlockType QUARTZ_PILLAR = new BlockType("minecraft:quartz_pillar"); + public static final BlockType QUARTZ_SLAB = new BlockType("minecraft:quartz_slab"); + public static final BlockType QUARTZ_STAIRS = new BlockType("minecraft:quartz_stairs"); public static final BlockType RAIL = new BlockType("minecraft:rail"); - public static final BlockType COBBLESTONE_STAIRS = new BlockType("minecraft:cobblestone_stairs"); - public static final BlockType WALL_SIGN = new BlockType("minecraft:wall_sign"); - public static final BlockType LEVER = new BlockType("minecraft:lever"); - public static final BlockType STONE_PRESSURE_PLATE = new BlockType("minecraft:stone_pressure_plate"); - public static final BlockType IRON_DOOR = new BlockType("minecraft:iron_door"); - public static final BlockType OAK_PRESSURE_PLATE = new BlockType("minecraft:oak_pressure_plate"); - public static final BlockType SPRUCE_PRESSURE_PLATE = new BlockType("minecraft:spruce_pressure_plate"); - public static final BlockType BIRCH_PRESSURE_PLATE = new BlockType("minecraft:birch_pressure_plate"); - public static final BlockType JUNGLE_PRESSURE_PLATE = new BlockType("minecraft:jungle_pressure_plate"); - public static final BlockType ACACIA_PRESSURE_PLATE = new BlockType("minecraft:acacia_pressure_plate"); - public static final BlockType DARK_OAK_PRESSURE_PLATE = new BlockType("minecraft:dark_oak_pressure_plate"); + public static final BlockType RED_BANNER = new BlockType("minecraft:red_banner"); + public static final BlockType RED_BED = new BlockType("minecraft:red_bed"); + public static final BlockType RED_CARPET = new BlockType("minecraft:red_carpet"); + public static final BlockType RED_CONCRETE = new BlockType("minecraft:red_concrete"); + public static final BlockType RED_CONCRETE_POWDER = new BlockType("minecraft:red_concrete_powder"); + public static final BlockType RED_GLAZED_TERRACOTTA = new BlockType("minecraft:red_glazed_terracotta"); + public static final BlockType RED_MUSHROOM = new BlockType("minecraft:red_mushroom"); + public static final BlockType RED_MUSHROOM_BLOCK = new BlockType("minecraft:red_mushroom_block"); + public static final BlockType RED_NETHER_BRICKS = new BlockType("minecraft:red_nether_bricks"); + public static final BlockType RED_SAND = new BlockType("minecraft:red_sand"); + public static final BlockType RED_SANDSTONE = new BlockType("minecraft:red_sandstone"); + public static final BlockType RED_SANDSTONE_SLAB = new BlockType("minecraft:red_sandstone_slab"); + public static final BlockType RED_SANDSTONE_STAIRS = new BlockType("minecraft:red_sandstone_stairs"); + public static final BlockType RED_SHULKER_BOX = new BlockType("minecraft:red_shulker_box"); + public static final BlockType RED_STAINED_GLASS = new BlockType("minecraft:red_stained_glass"); + public static final BlockType RED_STAINED_GLASS_PANE = new BlockType("minecraft:red_stained_glass_pane"); + public static final BlockType RED_TERRACOTTA = new BlockType("minecraft:red_terracotta"); + public static final BlockType RED_TULIP = new BlockType("minecraft:red_tulip"); + public static final BlockType RED_WALL_BANNER = new BlockType("minecraft:red_wall_banner"); + public static final BlockType RED_WOOL = new BlockType("minecraft:red_wool"); + public static final BlockType REDSTONE_BLOCK = new BlockType("minecraft:redstone_block"); + public static final BlockType REDSTONE_LAMP = new BlockType("minecraft:redstone_lamp"); public static final BlockType REDSTONE_ORE = new BlockType("minecraft:redstone_ore"); public static final BlockType REDSTONE_TORCH = new BlockType("minecraft:redstone_torch"); public static final BlockType REDSTONE_WALL_TORCH = new BlockType("minecraft:redstone_wall_torch"); - public static final BlockType STONE_BUTTON = new BlockType("minecraft:stone_button"); - public static final BlockType SNOW = new BlockType("minecraft:snow"); - public static final BlockType ICE = new BlockType("minecraft:ice"); - public static final BlockType SNOW_BLOCK = new BlockType("minecraft:snow_block"); - public static final BlockType CACTUS = new BlockType("minecraft:cactus"); - public static final BlockType CLAY = new BlockType("minecraft:clay"); - public static final BlockType SUGAR_CANE = new BlockType("minecraft:sugar_cane"); - public static final BlockType JUKEBOX = new BlockType("minecraft:jukebox"); - public static final BlockType OAK_FENCE = new BlockType("minecraft:oak_fence"); - public static final BlockType PUMPKIN = new BlockType("minecraft:pumpkin"); - public static final BlockType NETHERRACK = new BlockType("minecraft:netherrack"); - public static final BlockType SOUL_SAND = new BlockType("minecraft:soul_sand"); - public static final BlockType GLOWSTONE = new BlockType("minecraft:glowstone"); - public static final BlockType PORTAL = new BlockType("minecraft:portal"); - public static final BlockType CARVED_PUMPKIN = new BlockType("minecraft:carved_pumpkin"); - public static final BlockType JACK_O_LANTERN = new BlockType("minecraft:jack_o_lantern"); - public static final BlockType CAKE = new BlockType("minecraft:cake"); + public static final BlockType REDSTONE_WIRE = new BlockType("minecraft:redstone_wire"); public static final BlockType REPEATER = new BlockType("minecraft:repeater"); - public static final BlockType WHITE_STAINED_GLASS = new BlockType("minecraft:white_stained_glass"); - public static final BlockType ORANGE_STAINED_GLASS = new BlockType("minecraft:orange_stained_glass"); - public static final BlockType MAGENTA_STAINED_GLASS = new BlockType("minecraft:magenta_stained_glass"); - public static final BlockType LIGHT_BLUE_STAINED_GLASS = new BlockType("minecraft:light_blue_stained_glass"); - public static final BlockType YELLOW_STAINED_GLASS = new BlockType("minecraft:yellow_stained_glass"); - public static final BlockType LIME_STAINED_GLASS = new BlockType("minecraft:lime_stained_glass"); - public static final BlockType PINK_STAINED_GLASS = new BlockType("minecraft:pink_stained_glass"); - public static final BlockType GRAY_STAINED_GLASS = new BlockType("minecraft:gray_stained_glass"); - public static final BlockType LIGHT_GRAY_STAINED_GLASS = new BlockType("minecraft:light_gray_stained_glass"); - public static final BlockType CYAN_STAINED_GLASS = new BlockType("minecraft:cyan_stained_glass"); - public static final BlockType PURPLE_STAINED_GLASS = new BlockType("minecraft:purple_stained_glass"); - public static final BlockType BLUE_STAINED_GLASS = new BlockType("minecraft:blue_stained_glass"); - public static final BlockType BROWN_STAINED_GLASS = new BlockType("minecraft:brown_stained_glass"); - public static final BlockType GREEN_STAINED_GLASS = new BlockType("minecraft:green_stained_glass"); - public static final BlockType RED_STAINED_GLASS = new BlockType("minecraft:red_stained_glass"); - public static final BlockType BLACK_STAINED_GLASS = new BlockType("minecraft:black_stained_glass"); - public static final BlockType OAK_TRAPDOOR = new BlockType("minecraft:oak_trapdoor"); - public static final BlockType SPRUCE_TRAPDOOR = new BlockType("minecraft:spruce_trapdoor"); - public static final BlockType BIRCH_TRAPDOOR = new BlockType("minecraft:birch_trapdoor"); - public static final BlockType JUNGLE_TRAPDOOR = new BlockType("minecraft:jungle_trapdoor"); - public static final BlockType ACACIA_TRAPDOOR = new BlockType("minecraft:acacia_trapdoor"); - public static final BlockType DARK_OAK_TRAPDOOR = new BlockType("minecraft:dark_oak_trapdoor"); - public static final BlockType INFESTED_STONE = new BlockType("minecraft:infested_stone"); - public static final BlockType INFESTED_COBBLESTONE = new BlockType("minecraft:infested_cobblestone"); - public static final BlockType INFESTED_STONE_BRICKS = new BlockType("minecraft:infested_stone_bricks"); - public static final BlockType INFESTED_MOSSY_STONE_BRICKS = new BlockType("minecraft:infested_mossy_stone_bricks"); - public static final BlockType INFESTED_CRACKED_STONE_BRICKS = new BlockType("minecraft:infested_cracked_stone_bricks"); - public static final BlockType INFESTED_CHISELED_STONE_BRICKS = new BlockType("minecraft:infested_chiseled_stone_bricks"); - public static final BlockType STONE_BRICKS = new BlockType("minecraft:stone_bricks"); - public static final BlockType MOSSY_STONE_BRICKS = new BlockType("minecraft:mossy_stone_bricks"); - public static final BlockType CRACKED_STONE_BRICKS = new BlockType("minecraft:cracked_stone_bricks"); - public static final BlockType CHISELED_STONE_BRICKS = new BlockType("minecraft:chiseled_stone_bricks"); - public static final BlockType BROWN_MUSHROOM_BLOCK = new BlockType("minecraft:brown_mushroom_block"); - public static final BlockType RED_MUSHROOM_BLOCK = new BlockType("minecraft:red_mushroom_block"); - public static final BlockType MUSHROOM_STEM = new BlockType("minecraft:mushroom_stem"); - public static final BlockType IRON_BARS = new BlockType("minecraft:iron_bars"); - public static final BlockType GLASS_PANE = new BlockType("minecraft:glass_pane"); - public static final BlockType MELON_BLOCK = new BlockType("minecraft:melon_block"); - public static final BlockType ATTACHED_PUMPKIN_STEM = new BlockType("minecraft:attached_pumpkin_stem"); - public static final BlockType ATTACHED_MELON_STEM = new BlockType("minecraft:attached_melon_stem"); - public static final BlockType PUMPKIN_STEM = new BlockType("minecraft:pumpkin_stem"); - public static final BlockType MELON_STEM = new BlockType("minecraft:melon_stem"); - public static final BlockType VINE = new BlockType("minecraft:vine"); - public static final BlockType OAK_FENCE_GATE = new BlockType("minecraft:oak_fence_gate"); - public static final BlockType BRICK_STAIRS = new BlockType("minecraft:brick_stairs"); - public static final BlockType STONE_BRICK_STAIRS = new BlockType("minecraft:stone_brick_stairs"); - public static final BlockType MYCELIUM = new BlockType("minecraft:mycelium"); - public static final BlockType LILY_PAD = new BlockType("minecraft:lily_pad"); - public static final BlockType NETHER_BRICKS = new BlockType("minecraft:nether_bricks"); - public static final BlockType NETHER_BRICK_FENCE = new BlockType("minecraft:nether_brick_fence"); - public static final BlockType NETHER_BRICK_STAIRS = new BlockType("minecraft:nether_brick_stairs"); - public static final BlockType NETHER_WART = new BlockType("minecraft:nether_wart"); - public static final BlockType ENCHANTING_TABLE = new BlockType("minecraft:enchanting_table"); - public static final BlockType BREWING_STAND = new BlockType("minecraft:brewing_stand"); - public static final BlockType CAULDRON = new BlockType("minecraft:cauldron"); - public static final BlockType END_PORTAL = new BlockType("minecraft:end_portal"); - public static final BlockType END_PORTAL_FRAME = new BlockType("minecraft:end_portal_frame"); - public static final BlockType END_STONE = new BlockType("minecraft:end_stone"); - public static final BlockType DRAGON_EGG = new BlockType("minecraft:dragon_egg"); - public static final BlockType REDSTONE_LAMP = new BlockType("minecraft:redstone_lamp"); - public static final BlockType COCOA = new BlockType("minecraft:cocoa"); - public static final BlockType SANDSTONE_STAIRS = new BlockType("minecraft:sandstone_stairs"); - public static final BlockType EMERALD_ORE = new BlockType("minecraft:emerald_ore"); - public static final BlockType ENDER_CHEST = new BlockType("minecraft:ender_chest"); - public static final BlockType TRIPWIRE_HOOK = new BlockType("minecraft:tripwire_hook"); - public static final BlockType TRIPWIRE = new BlockType("minecraft:tripwire"); - public static final BlockType EMERALD_BLOCK = new BlockType("minecraft:emerald_block"); - public static final BlockType SPRUCE_STAIRS = new BlockType("minecraft:spruce_stairs"); - public static final BlockType BIRCH_STAIRS = new BlockType("minecraft:birch_stairs"); - public static final BlockType JUNGLE_STAIRS = new BlockType("minecraft:jungle_stairs"); - public static final BlockType COMMAND_BLOCK = new BlockType("minecraft:command_block"); - public static final BlockType BEACON = new BlockType("minecraft:beacon"); - public static final BlockType COBBLESTONE_WALL = new BlockType("minecraft:cobblestone_wall"); - public static final BlockType MOSSY_COBBLESTONE_WALL = new BlockType("minecraft:mossy_cobblestone_wall"); - public static final BlockType FLOWER_POT = new BlockType("minecraft:flower_pot"); - public static final BlockType POTTED_OAK_SAPLING = new BlockType("minecraft:potted_oak_sapling"); - public static final BlockType POTTED_SPRUCE_SAPLING = new BlockType("minecraft:potted_spruce_sapling"); - public static final BlockType POTTED_BIRCH_SAPLING = new BlockType("minecraft:potted_birch_sapling"); - public static final BlockType POTTED_JUNGLE_SAPLING = new BlockType("minecraft:potted_jungle_sapling"); - public static final BlockType POTTED_ACACIA_SAPLING = new BlockType("minecraft:potted_acacia_sapling"); - public static final BlockType POTTED_DARK_OAK_SAPLING = new BlockType("minecraft:potted_dark_oak_sapling"); - public static final BlockType POTTED_FERN = new BlockType("minecraft:potted_fern"); - public static final BlockType POTTED_DANDELION = new BlockType("minecraft:potted_dandelion"); - public static final BlockType POTTED_POPPY = new BlockType("minecraft:potted_poppy"); - public static final BlockType POTTED_BLUE_ORCHID = new BlockType("minecraft:potted_blue_orchid"); - public static final BlockType POTTED_ALLIUM = new BlockType("minecraft:potted_allium"); - public static final BlockType POTTED_AZURE_BLUET = new BlockType("minecraft:potted_azure_bluet"); - public static final BlockType POTTED_RED_TULIP = new BlockType("minecraft:potted_red_tulip"); - public static final BlockType POTTED_ORANGE_TULIP = new BlockType("minecraft:potted_orange_tulip"); - public static final BlockType POTTED_WHITE_TULIP = new BlockType("minecraft:potted_white_tulip"); - public static final BlockType POTTED_PINK_TULIP = new BlockType("minecraft:potted_pink_tulip"); - public static final BlockType POTTED_OXEYE_DAISY = new BlockType("minecraft:potted_oxeye_daisy"); - public static final BlockType POTTED_RED_MUSHROOM = new BlockType("minecraft:potted_red_mushroom"); - public static final BlockType POTTED_BROWN_MUSHROOM = new BlockType("minecraft:potted_brown_mushroom"); - public static final BlockType POTTED_DEAD_BUSH = new BlockType("minecraft:potted_dead_bush"); - public static final BlockType POTTED_CACTUS = new BlockType("minecraft:potted_cactus"); - public static final BlockType CARROTS = new BlockType("minecraft:carrots"); - public static final BlockType POTATOES = new BlockType("minecraft:potatoes"); - public static final BlockType OAK_BUTTON = new BlockType("minecraft:oak_button"); - public static final BlockType SPRUCE_BUTTON = new BlockType("minecraft:spruce_button"); - public static final BlockType BIRCH_BUTTON = new BlockType("minecraft:birch_button"); - public static final BlockType JUNGLE_BUTTON = new BlockType("minecraft:jungle_button"); - public static final BlockType ACACIA_BUTTON = new BlockType("minecraft:acacia_button"); - public static final BlockType DARK_OAK_BUTTON = new BlockType("minecraft:dark_oak_button"); - public static final BlockType SKELETON_WALL_SKULL = new BlockType("minecraft:skeleton_wall_skull"); - public static final BlockType SKELETON_SKULL = new BlockType("minecraft:skeleton_skull"); - public static final BlockType WITHER_SKELETON_WALL_SKULL = new BlockType("minecraft:wither_skeleton_wall_skull"); - public static final BlockType WITHER_SKELETON_SKULL = new BlockType("minecraft:wither_skeleton_skull"); - public static final BlockType ZOMBIE_WALL_HEAD = new BlockType("minecraft:zombie_wall_head"); - public static final BlockType ZOMBIE_HEAD = new BlockType("minecraft:zombie_head"); - public static final BlockType PLAYER_WALL_HEAD = new BlockType("minecraft:player_wall_head"); - public static final BlockType PLAYER_HEAD = new BlockType("minecraft:player_head"); - public static final BlockType CREEPER_WALL_HEAD = new BlockType("minecraft:creeper_wall_head"); - public static final BlockType CREEPER_HEAD = new BlockType("minecraft:creeper_head"); - public static final BlockType DRAGON_WALL_HEAD = new BlockType("minecraft:dragon_wall_head"); - public static final BlockType DRAGON_HEAD = new BlockType("minecraft:dragon_head"); - public static final BlockType ANVIL = new BlockType("minecraft:anvil"); - public static final BlockType CHIPPED_ANVIL = new BlockType("minecraft:chipped_anvil"); - public static final BlockType DAMAGED_ANVIL = new BlockType("minecraft:damaged_anvil"); - public static final BlockType TRAPPED_CHEST = new BlockType("minecraft:trapped_chest"); - public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = new BlockType("minecraft:light_weighted_pressure_plate"); - public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = new BlockType("minecraft:heavy_weighted_pressure_plate"); - public static final BlockType COMPARATOR = new BlockType("minecraft:comparator"); - public static final BlockType DAYLIGHT_DETECTOR = new BlockType("minecraft:daylight_detector"); - public static final BlockType REDSTONE_BLOCK = new BlockType("minecraft:redstone_block"); - public static final BlockType NETHER_QUARTZ_ORE = new BlockType("minecraft:nether_quartz_ore"); - public static final BlockType HOPPER = new BlockType("minecraft:hopper"); - public static final BlockType QUARTZ_BLOCK = new BlockType("minecraft:quartz_block"); - public static final BlockType CHISELED_QUARTZ_BLOCK = new BlockType("minecraft:chiseled_quartz_block"); - public static final BlockType QUARTZ_PILLAR = new BlockType("minecraft:quartz_pillar"); - public static final BlockType QUARTZ_STAIRS = new BlockType("minecraft:quartz_stairs"); - public static final BlockType ACTIVATOR_RAIL = new BlockType("minecraft:activator_rail"); - public static final BlockType DROPPER = new BlockType("minecraft:dropper"); - public static final BlockType WHITE_TERRACOTTA = new BlockType("minecraft:white_terracotta"); - public static final BlockType ORANGE_TERRACOTTA = new BlockType("minecraft:orange_terracotta"); - public static final BlockType MAGENTA_TERRACOTTA = new BlockType("minecraft:magenta_terracotta"); - public static final BlockType LIGHT_BLUE_TERRACOTTA = new BlockType("minecraft:light_blue_terracotta"); - public static final BlockType YELLOW_TERRACOTTA = new BlockType("minecraft:yellow_terracotta"); - public static final BlockType LIME_TERRACOTTA = new BlockType("minecraft:lime_terracotta"); - public static final BlockType PINK_TERRACOTTA = new BlockType("minecraft:pink_terracotta"); - public static final BlockType GRAY_TERRACOTTA = new BlockType("minecraft:gray_terracotta"); - public static final BlockType LIGHT_GRAY_TERRACOTTA = new BlockType("minecraft:light_gray_terracotta"); - public static final BlockType CYAN_TERRACOTTA = new BlockType("minecraft:cyan_terracotta"); - public static final BlockType PURPLE_TERRACOTTA = new BlockType("minecraft:purple_terracotta"); - public static final BlockType BLUE_TERRACOTTA = new BlockType("minecraft:blue_terracotta"); - public static final BlockType BROWN_TERRACOTTA = new BlockType("minecraft:brown_terracotta"); - public static final BlockType GREEN_TERRACOTTA = new BlockType("minecraft:green_terracotta"); - public static final BlockType RED_TERRACOTTA = new BlockType("minecraft:red_terracotta"); - public static final BlockType BLACK_TERRACOTTA = new BlockType("minecraft:black_terracotta"); - public static final BlockType WHITE_STAINED_GLASS_PANE = new BlockType("minecraft:white_stained_glass_pane"); - public static final BlockType ORANGE_STAINED_GLASS_PANE = new BlockType("minecraft:orange_stained_glass_pane"); - public static final BlockType MAGENTA_STAINED_GLASS_PANE = new BlockType("minecraft:magenta_stained_glass_pane"); - public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = new BlockType("minecraft:light_blue_stained_glass_pane"); - public static final BlockType YELLOW_STAINED_GLASS_PANE = new BlockType("minecraft:yellow_stained_glass_pane"); - public static final BlockType LIME_STAINED_GLASS_PANE = new BlockType("minecraft:lime_stained_glass_pane"); - public static final BlockType PINK_STAINED_GLASS_PANE = new BlockType("minecraft:pink_stained_glass_pane"); - public static final BlockType GRAY_STAINED_GLASS_PANE = new BlockType("minecraft:gray_stained_glass_pane"); - public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = new BlockType("minecraft:light_gray_stained_glass_pane"); - public static final BlockType CYAN_STAINED_GLASS_PANE = new BlockType("minecraft:cyan_stained_glass_pane"); - public static final BlockType PURPLE_STAINED_GLASS_PANE = new BlockType("minecraft:purple_stained_glass_pane"); - public static final BlockType BLUE_STAINED_GLASS_PANE = new BlockType("minecraft:blue_stained_glass_pane"); - public static final BlockType BROWN_STAINED_GLASS_PANE = new BlockType("minecraft:brown_stained_glass_pane"); - public static final BlockType GREEN_STAINED_GLASS_PANE = new BlockType("minecraft:green_stained_glass_pane"); - public static final BlockType RED_STAINED_GLASS_PANE = new BlockType("minecraft:red_stained_glass_pane"); - public static final BlockType BLACK_STAINED_GLASS_PANE = new BlockType("minecraft:black_stained_glass_pane"); - public static final BlockType ACACIA_STAIRS = new BlockType("minecraft:acacia_stairs"); - public static final BlockType DARK_OAK_STAIRS = new BlockType("minecraft:dark_oak_stairs"); - public static final BlockType SLIME_BLOCK = new BlockType("minecraft:slime_block"); - public static final BlockType BARRIER = new BlockType("minecraft:barrier"); - public static final BlockType IRON_TRAPDOOR = new BlockType("minecraft:iron_trapdoor"); - public static final BlockType PRISMARINE = new BlockType("minecraft:prismarine"); - public static final BlockType PRISMARINE_BRICKS = new BlockType("minecraft:prismarine_bricks"); - public static final BlockType DARK_PRISMARINE = new BlockType("minecraft:dark_prismarine"); - public static final BlockType SEA_LANTERN = new BlockType("minecraft:sea_lantern"); - public static final BlockType HAY_BLOCK = new BlockType("minecraft:hay_block"); - public static final BlockType WHITE_CARPET = new BlockType("minecraft:white_carpet"); - public static final BlockType ORANGE_CARPET = new BlockType("minecraft:orange_carpet"); - public static final BlockType MAGENTA_CARPET = new BlockType("minecraft:magenta_carpet"); - public static final BlockType LIGHT_BLUE_CARPET = new BlockType("minecraft:light_blue_carpet"); - public static final BlockType YELLOW_CARPET = new BlockType("minecraft:yellow_carpet"); - public static final BlockType LIME_CARPET = new BlockType("minecraft:lime_carpet"); - public static final BlockType PINK_CARPET = new BlockType("minecraft:pink_carpet"); - public static final BlockType GRAY_CARPET = new BlockType("minecraft:gray_carpet"); - public static final BlockType LIGHT_GRAY_CARPET = new BlockType("minecraft:light_gray_carpet"); - public static final BlockType CYAN_CARPET = new BlockType("minecraft:cyan_carpet"); - public static final BlockType PURPLE_CARPET = new BlockType("minecraft:purple_carpet"); - public static final BlockType BLUE_CARPET = new BlockType("minecraft:blue_carpet"); - public static final BlockType BROWN_CARPET = new BlockType("minecraft:brown_carpet"); - public static final BlockType GREEN_CARPET = new BlockType("minecraft:green_carpet"); - public static final BlockType RED_CARPET = new BlockType("minecraft:red_carpet"); - public static final BlockType BLACK_CARPET = new BlockType("minecraft:black_carpet"); - public static final BlockType TERRACOTTA = new BlockType("minecraft:terracotta"); - public static final BlockType COAL_BLOCK = new BlockType("minecraft:coal_block"); - public static final BlockType PACKED_ICE = new BlockType("minecraft:packed_ice"); - public static final BlockType SUNFLOWER = new BlockType("minecraft:sunflower"); - public static final BlockType LILAC = new BlockType("minecraft:lilac"); + public static final BlockType REPEATING_COMMAND_BLOCK = new BlockType("minecraft:repeating_command_block"); public static final BlockType ROSE_BUSH = new BlockType("minecraft:rose_bush"); - public static final BlockType PEONY = new BlockType("minecraft:peony"); - public static final BlockType TALL_GRASS = new BlockType("minecraft:tall_grass"); - public static final BlockType LARGE_FERN = new BlockType("minecraft:large_fern"); - public static final BlockType WHITE_BANNER = new BlockType("minecraft:white_banner"); - public static final BlockType ORANGE_BANNER = new BlockType("minecraft:orange_banner"); - public static final BlockType MAGENTA_BANNER = new BlockType("minecraft:magenta_banner"); - public static final BlockType LIGHT_BLUE_BANNER = new BlockType("minecraft:light_blue_banner"); - public static final BlockType YELLOW_BANNER = new BlockType("minecraft:yellow_banner"); - public static final BlockType LIME_BANNER = new BlockType("minecraft:lime_banner"); - public static final BlockType PINK_BANNER = new BlockType("minecraft:pink_banner"); - public static final BlockType GRAY_BANNER = new BlockType("minecraft:gray_banner"); - public static final BlockType LIGHT_GRAY_BANNER = new BlockType("minecraft:light_gray_banner"); - public static final BlockType CYAN_BANNER = new BlockType("minecraft:cyan_banner"); - public static final BlockType PURPLE_BANNER = new BlockType("minecraft:purple_banner"); - public static final BlockType BLUE_BANNER = new BlockType("minecraft:blue_banner"); - public static final BlockType BROWN_BANNER = new BlockType("minecraft:brown_banner"); - public static final BlockType GREEN_BANNER = new BlockType("minecraft:green_banner"); - public static final BlockType RED_BANNER = new BlockType("minecraft:red_banner"); - public static final BlockType BLACK_BANNER = new BlockType("minecraft:black_banner"); - public static final BlockType WHITE_WALL_BANNER = new BlockType("minecraft:white_wall_banner"); - public static final BlockType ORANGE_WALL_BANNER = new BlockType("minecraft:orange_wall_banner"); - public static final BlockType MAGENTA_WALL_BANNER = new BlockType("minecraft:magenta_wall_banner"); - public static final BlockType LIGHT_BLUE_WALL_BANNER = new BlockType("minecraft:light_blue_wall_banner"); - public static final BlockType YELLOW_WALL_BANNER = new BlockType("minecraft:yellow_wall_banner"); - public static final BlockType LIME_WALL_BANNER = new BlockType("minecraft:lime_wall_banner"); - public static final BlockType PINK_WALL_BANNER = new BlockType("minecraft:pink_wall_banner"); - public static final BlockType GRAY_WALL_BANNER = new BlockType("minecraft:gray_wall_banner"); - public static final BlockType LIGHT_GRAY_WALL_BANNER = new BlockType("minecraft:light_gray_wall_banner"); - public static final BlockType CYAN_WALL_BANNER = new BlockType("minecraft:cyan_wall_banner"); - public static final BlockType PURPLE_WALL_BANNER = new BlockType("minecraft:purple_wall_banner"); - public static final BlockType BLUE_WALL_BANNER = new BlockType("minecraft:blue_wall_banner"); - public static final BlockType BROWN_WALL_BANNER = new BlockType("minecraft:brown_wall_banner"); - public static final BlockType GREEN_WALL_BANNER = new BlockType("minecraft:green_wall_banner"); - public static final BlockType RED_WALL_BANNER = new BlockType("minecraft:red_wall_banner"); - public static final BlockType BLACK_WALL_BANNER = new BlockType("minecraft:black_wall_banner"); - public static final BlockType RED_SANDSTONE = new BlockType("minecraft:red_sandstone"); - public static final BlockType CHISELED_RED_SANDSTONE = new BlockType("minecraft:chiseled_red_sandstone"); - public static final BlockType CUT_RED_SANDSTONE = new BlockType("minecraft:cut_red_sandstone"); - public static final BlockType RED_SANDSTONE_STAIRS = new BlockType("minecraft:red_sandstone_stairs"); - public static final BlockType OAK_SLAB = new BlockType("minecraft:oak_slab"); - public static final BlockType SPRUCE_SLAB = new BlockType("minecraft:spruce_slab"); - public static final BlockType BIRCH_SLAB = new BlockType("minecraft:birch_slab"); - public static final BlockType JUNGLE_SLAB = new BlockType("minecraft:jungle_slab"); - public static final BlockType ACACIA_SLAB = new BlockType("minecraft:acacia_slab"); - public static final BlockType DARK_OAK_SLAB = new BlockType("minecraft:dark_oak_slab"); - public static final BlockType STONE_SLAB = new BlockType("minecraft:stone_slab"); + public static final BlockType SAND = new BlockType("minecraft:sand"); + public static final BlockType SANDSTONE = new BlockType("minecraft:sandstone"); public static final BlockType SANDSTONE_SLAB = new BlockType("minecraft:sandstone_slab"); - public static final BlockType PETRIFIED_OAK_SLAB = new BlockType("minecraft:petrified_oak_slab"); - public static final BlockType COBBLESTONE_SLAB = new BlockType("minecraft:cobblestone_slab"); - public static final BlockType BRICK_SLAB = new BlockType("minecraft:brick_slab"); - public static final BlockType STONE_BRICK_SLAB = new BlockType("minecraft:stone_brick_slab"); - public static final BlockType NETHER_BRICK_SLAB = new BlockType("minecraft:nether_brick_slab"); - public static final BlockType QUARTZ_SLAB = new BlockType("minecraft:quartz_slab"); - public static final BlockType RED_SANDSTONE_SLAB = new BlockType("minecraft:red_sandstone_slab"); - public static final BlockType PURPUR_SLAB = new BlockType("minecraft:purpur_slab"); - public static final BlockType SMOOTH_STONE = new BlockType("minecraft:smooth_stone"); - public static final BlockType SMOOTH_SANDSTONE = new BlockType("minecraft:smooth_sandstone"); + public static final BlockType SANDSTONE_STAIRS = new BlockType("minecraft:sandstone_stairs"); + public static final BlockType SEA_LANTERN = new BlockType("minecraft:sea_lantern"); + public static final BlockType SEA_PICKLE = new BlockType("minecraft:sea_pickle"); + public static final BlockType SEAGRASS = new BlockType("minecraft:seagrass"); + public static final BlockType SHULKER_BOX = new BlockType("minecraft:shulker_box"); + public static final BlockType SIGN = new BlockType("minecraft:sign"); + public static final BlockType SKELETON_SKULL = new BlockType("minecraft:skeleton_skull"); + public static final BlockType SKELETON_WALL_SKULL = new BlockType("minecraft:skeleton_wall_skull"); + public static final BlockType SLIME_BLOCK = new BlockType("minecraft:slime_block"); public static final BlockType SMOOTH_QUARTZ = new BlockType("minecraft:smooth_quartz"); public static final BlockType SMOOTH_RED_SANDSTONE = new BlockType("minecraft:smooth_red_sandstone"); - public static final BlockType SPRUCE_FENCE_GATE = new BlockType("minecraft:spruce_fence_gate"); - public static final BlockType BIRCH_FENCE_GATE = new BlockType("minecraft:birch_fence_gate"); - public static final BlockType JUNGLE_FENCE_GATE = new BlockType("minecraft:jungle_fence_gate"); - public static final BlockType ACACIA_FENCE_GATE = new BlockType("minecraft:acacia_fence_gate"); - public static final BlockType DARK_OAK_FENCE_GATE = new BlockType("minecraft:dark_oak_fence_gate"); - public static final BlockType SPRUCE_FENCE = new BlockType("minecraft:spruce_fence"); - public static final BlockType BIRCH_FENCE = new BlockType("minecraft:birch_fence"); - public static final BlockType JUNGLE_FENCE = new BlockType("minecraft:jungle_fence"); - public static final BlockType ACACIA_FENCE = new BlockType("minecraft:acacia_fence"); - public static final BlockType DARK_OAK_FENCE = new BlockType("minecraft:dark_oak_fence"); + public static final BlockType SMOOTH_SANDSTONE = new BlockType("minecraft:smooth_sandstone"); + public static final BlockType SMOOTH_STONE = new BlockType("minecraft:smooth_stone"); + public static final BlockType SNOW = new BlockType("minecraft:snow"); + public static final BlockType SNOW_BLOCK = new BlockType("minecraft:snow_block"); + public static final BlockType SOUL_SAND = new BlockType("minecraft:soul_sand"); + public static final BlockType SPONGE = new BlockType("minecraft:sponge"); + public static final BlockType SPRUCE_BARK = new BlockType("minecraft:spruce_bark"); + public static final BlockType SPRUCE_BUTTON = new BlockType("minecraft:spruce_button"); public static final BlockType SPRUCE_DOOR = new BlockType("minecraft:spruce_door"); - public static final BlockType BIRCH_DOOR = new BlockType("minecraft:birch_door"); - public static final BlockType JUNGLE_DOOR = new BlockType("minecraft:jungle_door"); - public static final BlockType ACACIA_DOOR = new BlockType("minecraft:acacia_door"); - public static final BlockType DARK_OAK_DOOR = new BlockType("minecraft:dark_oak_door"); - public static final BlockType END_ROD = new BlockType("minecraft:end_rod"); - public static final BlockType CHORUS_PLANT = new BlockType("minecraft:chorus_plant"); - public static final BlockType CHORUS_FLOWER = new BlockType("minecraft:chorus_flower"); - public static final BlockType PURPUR_BLOCK = new BlockType("minecraft:purpur_block"); - public static final BlockType PURPUR_PILLAR = new BlockType("minecraft:purpur_pillar"); - public static final BlockType PURPUR_STAIRS = new BlockType("minecraft:purpur_stairs"); - public static final BlockType END_STONE_BRICKS = new BlockType("minecraft:end_stone_bricks"); - public static final BlockType BEETROOTS = new BlockType("minecraft:beetroots"); - public static final BlockType GRASS_PATH = new BlockType("minecraft:grass_path"); - public static final BlockType END_GATEWAY = new BlockType("minecraft:end_gateway"); - public static final BlockType REPEATING_COMMAND_BLOCK = new BlockType("minecraft:repeating_command_block"); - public static final BlockType CHAIN_COMMAND_BLOCK = new BlockType("minecraft:chain_command_block"); - public static final BlockType FROSTED_ICE = new BlockType("minecraft:frosted_ice"); - public static final BlockType MAGMA_BLOCK = new BlockType("minecraft:magma_block"); - public static final BlockType NETHER_WART_BLOCK = new BlockType("minecraft:nether_wart_block"); - public static final BlockType RED_NETHER_BRICKS = new BlockType("minecraft:red_nether_bricks"); - public static final BlockType BONE_BLOCK = new BlockType("minecraft:bone_block"); - public static final BlockType STRUCTURE_VOID = new BlockType("minecraft:structure_void"); - public static final BlockType OBSERVER = new BlockType("minecraft:observer"); - public static final BlockType WHITE_SHULKER_BOX = new BlockType("minecraft:white_shulker_box"); - public static final BlockType ORANGE_SHULKER_BOX = new BlockType("minecraft:orange_shulker_box"); - public static final BlockType MAGENTA_SHULKER_BOX = new BlockType("minecraft:magenta_shulker_box"); - public static final BlockType LIGHT_BLUE_SHULKER_BOX = new BlockType("minecraft:light_blue_shulker_box"); - public static final BlockType YELLOW_SHULKER_BOX = new BlockType("minecraft:yellow_shulker_box"); - public static final BlockType LIME_SHULKER_BOX = new BlockType("minecraft:lime_shulker_box"); - public static final BlockType PINK_SHULKER_BOX = new BlockType("minecraft:pink_shulker_box"); - public static final BlockType GRAY_SHULKER_BOX = new BlockType("minecraft:gray_shulker_box"); - public static final BlockType LIGHT_GRAY_SHULKER_BOX = new BlockType("minecraft:light_gray_shulker_box"); - public static final BlockType CYAN_SHULKER_BOX = new BlockType("minecraft:cyan_shulker_box"); - public static final BlockType PURPLE_SHULKER_BOX = new BlockType("minecraft:purple_shulker_box"); - public static final BlockType BLUE_SHULKER_BOX = new BlockType("minecraft:blue_shulker_box"); - public static final BlockType BROWN_SHULKER_BOX = new BlockType("minecraft:brown_shulker_box"); - public static final BlockType GREEN_SHULKER_BOX = new BlockType("minecraft:green_shulker_box"); - public static final BlockType RED_SHULKER_BOX = new BlockType("minecraft:red_shulker_box"); - public static final BlockType BLACK_SHULKER_BOX = new BlockType("minecraft:black_shulker_box"); - public static final BlockType WHITE_GLAZED_TERRACOTTA = new BlockType("minecraft:white_glazed_terracotta"); - public static final BlockType ORANGE_GLAZED_TERRACOTTA = new BlockType("minecraft:orange_glazed_terracotta"); - public static final BlockType MAGENTA_GLAZED_TERRACOTTA = new BlockType("minecraft:magenta_glazed_terracotta"); - public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = new BlockType("minecraft:light_blue_glazed_terracotta"); - public static final BlockType YELLOW_GLAZED_TERRACOTTA = new BlockType("minecraft:yellow_glazed_terracotta"); - public static final BlockType LIME_GLAZED_TERRACOTTA = new BlockType("minecraft:lime_glazed_terracotta"); - public static final BlockType PINK_GLAZED_TERRACOTTA = new BlockType("minecraft:pink_glazed_terracotta"); - public static final BlockType GRAY_GLAZED_TERRACOTTA = new BlockType("minecraft:gray_glazed_terracotta"); - public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = new BlockType("minecraft:light_gray_glazed_terracotta"); - public static final BlockType CYAN_GLAZED_TERRACOTTA = new BlockType("minecraft:cyan_glazed_terracotta"); - public static final BlockType PURPLE_GLAZED_TERRACOTTA = new BlockType("minecraft:purple_glazed_terracotta"); - public static final BlockType BLUE_GLAZED_TERRACOTTA = new BlockType("minecraft:blue_glazed_terracotta"); - public static final BlockType BROWN_GLAZED_TERRACOTTA = new BlockType("minecraft:brown_glazed_terracotta"); - public static final BlockType GREEN_GLAZED_TERRACOTTA = new BlockType("minecraft:green_glazed_terracotta"); - public static final BlockType RED_GLAZED_TERRACOTTA = new BlockType("minecraft:red_glazed_terracotta"); - public static final BlockType BLACK_GLAZED_TERRACOTTA = new BlockType("minecraft:black_glazed_terracotta"); - public static final BlockType WHITE_CONCRETE = new BlockType("minecraft:white_concrete"); - public static final BlockType ORANGE_CONCRETE = new BlockType("minecraft:orange_concrete"); - public static final BlockType MAGENTA_CONCRETE = new BlockType("minecraft:magenta_concrete"); - public static final BlockType LIGHT_BLUE_CONCRETE = new BlockType("minecraft:light_blue_concrete"); - public static final BlockType YELLOW_CONCRETE = new BlockType("minecraft:yellow_concrete"); - public static final BlockType LIME_CONCRETE = new BlockType("minecraft:lime_concrete"); - public static final BlockType PINK_CONCRETE = new BlockType("minecraft:pink_concrete"); - public static final BlockType GRAY_CONCRETE = new BlockType("minecraft:gray_concrete"); - public static final BlockType LIGHT_GRAY_CONCRETE = new BlockType("minecraft:light_gray_concrete"); - public static final BlockType CYAN_CONCRETE = new BlockType("minecraft:cyan_concrete"); - public static final BlockType PURPLE_CONCRETE = new BlockType("minecraft:purple_concrete"); - public static final BlockType BLUE_CONCRETE = new BlockType("minecraft:blue_concrete"); - public static final BlockType BROWN_CONCRETE = new BlockType("minecraft:brown_concrete"); - public static final BlockType GREEN_CONCRETE = new BlockType("minecraft:green_concrete"); - public static final BlockType RED_CONCRETE = new BlockType("minecraft:red_concrete"); - public static final BlockType BLACK_CONCRETE = new BlockType("minecraft:black_concrete"); - public static final BlockType WHITE_CONCRETE_POWDER = new BlockType("minecraft:white_concrete_powder"); - public static final BlockType ORANGE_CONCRETE_POWDER = new BlockType("minecraft:orange_concrete_powder"); - public static final BlockType MAGENTA_CONCRETE_POWDER = new BlockType("minecraft:magenta_concrete_powder"); - public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = new BlockType("minecraft:light_blue_concrete_powder"); - public static final BlockType YELLOW_CONCRETE_POWDER = new BlockType("minecraft:yellow_concrete_powder"); - public static final BlockType LIME_CONCRETE_POWDER = new BlockType("minecraft:lime_concrete_powder"); - public static final BlockType PINK_CONCRETE_POWDER = new BlockType("minecraft:pink_concrete_powder"); - public static final BlockType GRAY_CONCRETE_POWDER = new BlockType("minecraft:gray_concrete_powder"); - public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = new BlockType("minecraft:light_gray_concrete_powder"); - public static final BlockType CYAN_CONCRETE_POWDER = new BlockType("minecraft:cyan_concrete_powder"); - public static final BlockType PURPLE_CONCRETE_POWDER = new BlockType("minecraft:purple_concrete_powder"); - public static final BlockType BLUE_CONCRETE_POWDER = new BlockType("minecraft:blue_concrete_powder"); - public static final BlockType BROWN_CONCRETE_POWDER = new BlockType("minecraft:brown_concrete_powder"); - public static final BlockType GREEN_CONCRETE_POWDER = new BlockType("minecraft:green_concrete_powder"); - public static final BlockType RED_CONCRETE_POWDER = new BlockType("minecraft:red_concrete_powder"); - public static final BlockType BLACK_CONCRETE_POWDER = new BlockType("minecraft:black_concrete_powder"); + public static final BlockType SPRUCE_FENCE = new BlockType("minecraft:spruce_fence"); + public static final BlockType SPRUCE_FENCE_GATE = new BlockType("minecraft:spruce_fence_gate"); + public static final BlockType SPRUCE_LEAVES = new BlockType("minecraft:spruce_leaves"); + public static final BlockType SPRUCE_LOG = new BlockType("minecraft:spruce_log"); + public static final BlockType SPRUCE_PLANKS = new BlockType("minecraft:spruce_planks"); + public static final BlockType SPRUCE_PRESSURE_PLATE = new BlockType("minecraft:spruce_pressure_plate"); + public static final BlockType SPRUCE_SAPLING = new BlockType("minecraft:spruce_sapling"); + public static final BlockType SPRUCE_SLAB = new BlockType("minecraft:spruce_slab"); + public static final BlockType SPRUCE_STAIRS = new BlockType("minecraft:spruce_stairs"); + public static final BlockType SPRUCE_TRAPDOOR = new BlockType("minecraft:spruce_trapdoor"); + public static final BlockType STICKY_PISTON = new BlockType("minecraft:sticky_piston"); + public static final BlockType STONE = new BlockType("minecraft:stone"); + public static final BlockType STONE_BRICK_SLAB = new BlockType("minecraft:stone_brick_slab"); + public static final BlockType STONE_BRICK_STAIRS = new BlockType("minecraft:stone_brick_stairs"); + public static final BlockType STONE_BRICKS = new BlockType("minecraft:stone_bricks"); + public static final BlockType STONE_BUTTON = new BlockType("minecraft:stone_button"); + public static final BlockType STONE_PRESSURE_PLATE = new BlockType("minecraft:stone_pressure_plate"); + public static final BlockType STONE_SLAB = new BlockType("minecraft:stone_slab"); + public static final BlockType STRIPPED_ACACIA_LOG = new BlockType("minecraft:stripped_acacia_log"); + public static final BlockType STRIPPED_BIRCH_LOG = new BlockType("minecraft:stripped_birch_log"); + public static final BlockType STRIPPED_DARK_OAK_LOG = new BlockType("minecraft:stripped_dark_oak_log"); + public static final BlockType STRIPPED_JUNGLE_LOG = new BlockType("minecraft:stripped_jungle_log"); + public static final BlockType STRIPPED_OAK_LOG = new BlockType("minecraft:stripped_oak_log"); + public static final BlockType STRIPPED_SPRUCE_LOG = new BlockType("minecraft:stripped_spruce_log"); public static final BlockType STRUCTURE_BLOCK = new BlockType("minecraft:structure_block"); + public static final BlockType STRUCTURE_VOID = new BlockType("minecraft:structure_void"); + public static final BlockType SUGAR_CANE = new BlockType("minecraft:sugar_cane"); + public static final BlockType SUNFLOWER = new BlockType("minecraft:sunflower"); + public static final BlockType TALL_GRASS = new BlockType("minecraft:tall_grass"); + public static final BlockType TALL_SEAGRASS = new BlockType("minecraft:tall_seagrass"); + public static final BlockType TERRACOTTA = new BlockType("minecraft:terracotta"); + public static final BlockType TNT = new BlockType("minecraft:tnt"); + public static final BlockType TORCH = new BlockType("minecraft:torch"); + public static final BlockType TRAPPED_CHEST = new BlockType("minecraft:trapped_chest"); + public static final BlockType TRIPWIRE = new BlockType("minecraft:tripwire"); + public static final BlockType TRIPWIRE_HOOK = new BlockType("minecraft:tripwire_hook"); + public static final BlockType TUBE_CORAL = new BlockType("minecraft:tube_coral"); + public static final BlockType TUBE_CORAL_BLOCK = new BlockType("minecraft:tube_coral_block"); + public static final BlockType TUBE_CORAL_FAN = new BlockType("minecraft:tube_coral_fan"); + public static final BlockType TURTLE_EGG = new BlockType("minecraft:turtle_egg"); + public static final BlockType VINE = new BlockType("minecraft:vine"); + public static final BlockType VOID_AIR = new BlockType("minecraft:void_air"); + public static final BlockType WALL_SIGN = new BlockType("minecraft:wall_sign"); + public static final BlockType WALL_TORCH = new BlockType("minecraft:wall_torch"); + public static final BlockType WATER = new BlockType("minecraft:water"); + public static final BlockType WET_SPONGE = new BlockType("minecraft:wet_sponge"); + public static final BlockType WHEAT = new BlockType("minecraft:wheat"); + public static final BlockType WHITE_BANNER = new BlockType("minecraft:white_banner"); + public static final BlockType WHITE_BED = new BlockType("minecraft:white_bed"); + public static final BlockType WHITE_CARPET = new BlockType("minecraft:white_carpet"); + public static final BlockType WHITE_CONCRETE = new BlockType("minecraft:white_concrete"); + public static final BlockType WHITE_CONCRETE_POWDER = new BlockType("minecraft:white_concrete_powder"); + public static final BlockType WHITE_GLAZED_TERRACOTTA = new BlockType("minecraft:white_glazed_terracotta"); + public static final BlockType WHITE_SHULKER_BOX = new BlockType("minecraft:white_shulker_box"); + public static final BlockType WHITE_STAINED_GLASS = new BlockType("minecraft:white_stained_glass"); + public static final BlockType WHITE_STAINED_GLASS_PANE = new BlockType("minecraft:white_stained_glass_pane"); + public static final BlockType WHITE_TERRACOTTA = new BlockType("minecraft:white_terracotta"); + public static final BlockType WHITE_TULIP = new BlockType("minecraft:white_tulip"); + public static final BlockType WHITE_WALL_BANNER = new BlockType("minecraft:white_wall_banner"); + public static final BlockType WHITE_WOOL = new BlockType("minecraft:white_wool"); + public static final BlockType WITHER_SKELETON_SKULL = new BlockType("minecraft:wither_skeleton_skull"); + public static final BlockType WITHER_SKELETON_WALL_SKULL = new BlockType("minecraft:wither_skeleton_wall_skull"); + public static final BlockType YELLOW_BANNER = new BlockType("minecraft:yellow_banner"); + public static final BlockType YELLOW_BED = new BlockType("minecraft:yellow_bed"); + public static final BlockType YELLOW_CARPET = new BlockType("minecraft:yellow_carpet"); + public static final BlockType YELLOW_CONCRETE = new BlockType("minecraft:yellow_concrete"); + public static final BlockType YELLOW_CONCRETE_POWDER = new BlockType("minecraft:yellow_concrete_powder"); + public static final BlockType YELLOW_GLAZED_TERRACOTTA = new BlockType("minecraft:yellow_glazed_terracotta"); + public static final BlockType YELLOW_SHULKER_BOX = new BlockType("minecraft:yellow_shulker_box"); + public static final BlockType YELLOW_STAINED_GLASS = new BlockType("minecraft:yellow_stained_glass"); + public static final BlockType YELLOW_STAINED_GLASS_PANE = new BlockType("minecraft:yellow_stained_glass_pane"); + public static final BlockType YELLOW_TERRACOTTA = new BlockType("minecraft:yellow_terracotta"); + public static final BlockType YELLOW_WALL_BANNER = new BlockType("minecraft:yellow_wall_banner"); + public static final BlockType YELLOW_WOOL = new BlockType("minecraft:yellow_wool"); + public static final BlockType ZOMBIE_HEAD = new BlockType("minecraft:zombie_head"); + public static final BlockType ZOMBIE_WALL_HEAD = new BlockType("minecraft:zombie_wall_head"); private static final Map blockMapping = new HashMap<>(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategories.java new file mode 100644 index 000000000..2a0a1f96e --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategories.java @@ -0,0 +1,74 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; + +/** + * Stores a list of categories of Block Types. + */ +public class FluidCategories { + + private FluidCategories() { + } + + public static final FluidCategory LAVA = new FluidCategory("minecraft:lava"); + public static final FluidCategory WATER = new FluidCategory("minecraft:water"); + + private static final Map categoryMapping = new HashMap<>(); + + static { + for (Field field : FluidCategories.class.getFields()) { + if (field.getType() == FluidCategory.class) { + try { + registerCategory((FluidCategory) field.get(null)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + } + + public static void registerCategory(FluidCategory fluidCategory) { + if (categoryMapping.containsKey(fluidCategory.getId()) && !fluidCategory.getId().startsWith("minecraft:")) { + throw new IllegalArgumentException("Existing category with this ID already registered"); + } + + categoryMapping.put(fluidCategory.getId(), fluidCategory); + } + + @Nullable + public static FluidCategory getFluidCategory(String id) { + // If it has no namespace, assume minecraft. + if (id != null && !id.contains(":")) { + id = "minecraft:" + id; + } + return categoryMapping.get(id); + } + + public static Collection values() { + return categoryMapping.values(); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategory.java new file mode 100644 index 000000000..d3e713961 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategory.java @@ -0,0 +1,58 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import java.util.Collections; +import java.util.Set; + +/** + * A category of fluids. This is due to the splitting up of + * blocks such as wool into separate ids. + */ +public class FluidCategory { + + private final String id; + + public FluidCategory(String id) { + this.id = id; + } + + public String getId() { + return this.id; + } + + public Set getFluidTypes() { + return Collections.emptySet(); // TODO Make this work. + // return WorldEdit.getInstance().getPlatformManager() +// .queryCapability(Capability.GAME_HOOKS).getRegistries() +// .getBlockCategoryRegistry().getCategorisedByName(this.id); + } + + /** + * Checks whether the FluidType is contained within + * this category. + * + * @param fluidType The fluidType + * @return If it's a part of this category + */ + public boolean contains(FluidType fluidType) { + return getFluidTypes().contains(fluidType); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidType.java new file mode 100644 index 000000000..a1d541a1e --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidType.java @@ -0,0 +1,52 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +/** + * Minecraft now has a 'fluid' system. This is a + * stub class to represent what it may be in the future. + */ +public class FluidType { + + private String id; + + public FluidType(String id) { + this.id = id; + } + + /** + * Gets the ID of this block. + * + * @return The id + */ + public String getId() { + return this.id; + } + + @Override + public int hashCode() { + return this.id.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof FluidType && this.id.equals(((FluidType) obj).id); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidTypes.java new file mode 100644 index 000000000..613e45d1a --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidTypes.java @@ -0,0 +1,78 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.blocks.type; + +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; + +/** + * Stores a list of common Fluid String IDs. + */ +public class FluidTypes { + + private FluidTypes() { + } + + public static final FluidType EMPTY = new FluidType("minecraft:empty"); + public static final FluidType FLOWING_LAVA = new FluidType("minecraft:flowing_lava"); + public static final FluidType FLOWING_WATER = new FluidType("minecraft:flowing_water"); + public static final FluidType LAVA = new FluidType("minecraft:lava"); + public static final FluidType WATER = new FluidType("minecraft:water"); + + + private static final Map fluidMapping = new HashMap<>(); + + static { + for (Field field : FluidTypes.class.getFields()) { + if (field.getType() == FluidType.class) { + try { + registerFluid((FluidType) field.get(null)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + } + + public static void registerFluid(FluidType fluidType) { + if (fluidMapping.containsKey(fluidType.getId()) && !fluidType.getId().startsWith("minecraft:")) { + throw new IllegalArgumentException("Existing fluid with this ID already registered"); + } + + fluidMapping.put(fluidType.getId(), fluidType); + } + + @Nullable + public static FluidType getFluidType(String id) { + // If it has no namespace, assume minecraft. + if (id != null && !id.contains(":")) { + id = "minecraft:" + id; + } + return fluidMapping.get(id); + } + + public static Collection values() { + return fluidMapping.values(); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java index 2a6a35a70..f1454c867 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java @@ -88,7 +88,7 @@ public class ItemCategories { } @Nullable - public static ItemCategory getBlockType(String id) { + public static ItemCategory getItemCategory(String id) { // If it has no namespace, assume minecraft. if (id != null && !id.contains(":")) { id = "minecraft:" + id; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index d14065951..1a6a7d4c9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -175,8 +175,9 @@ public class UtilityCommands { double radius = Math.max(0, args.getDouble(0)); we.checkMaxRadius(radius); + // TODO Investigate with a real build of 1.13 int affected = editSession.fixLiquid( - session.getPlacementPosition(player), radius, BlockTypes.FLOWING_LAVA, BlockTypes.LAVA); + session.getPlacementPosition(player), radius, BlockTypes.LAVA, BlockTypes.LAVA); player.print(affected + " block(s) have been changed."); } @@ -193,8 +194,9 @@ public class UtilityCommands { double radius = Math.max(0, args.getDouble(0)); we.checkMaxRadius(radius); + // TODO Investigate with a real build of 1.13 int affected = editSession.fixLiquid( - session.getPlacementPosition(player), radius, BlockTypes.FLOWING_WATER, BlockTypes.WATER); + session.getPlacementPosition(player), radius, BlockTypes.WATER, BlockTypes.WATER); player.print(affected + " block(s) have been changed."); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java index f90642d07..66c4fbc81 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java @@ -22,6 +22,8 @@ package com.sk89q.worldedit.event.extent; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; @@ -53,7 +55,7 @@ import static com.sk89q.worldedit.EditSession.Stage; * is set to {@link Stage#BEFORE_HISTORY}, then you can drop (or log) changes * before the change has reached the history, reordering, and actual change * extents, but that means that any changes made with - * {@link EditSession#rawSetBlock(Vector, BaseBlock)} will skip your + * {@link EditSession#rawSetBlock(Vector, BlockStateHolder)} will skip your * custom {@link Extent} because that method bypasses history (and reorder). * It is thus recommended that loggers intercept at {@link Stage#BEFORE_CHANGE} * and block interceptors intercept at BOTH {@link Stage#BEFORE_CHANGE} and diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index f6bbd8c87..3a0a1b8e9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -172,7 +172,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { final com.sk89q.worldedit.blocks.type.BlockType type = block.getBlockType(); // Don't get put in lava! - if (type == BlockTypes.LAVA || type == BlockTypes.FLOWING_LAVA) { + if (type == BlockTypes.LAVA) { return false; } @@ -214,7 +214,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { final com.sk89q.worldedit.blocks.type.BlockType type = block.getBlockType(); // Don't want to end up in lava - if (type != BlockTypes.AIR && type != BlockTypes.LAVA && type != BlockTypes.FLOWING_LAVA) { + if (type != BlockTypes.AIR && type != BlockTypes.LAVA) { // Found a block! setPosition(platform.add(0.5, BlockType.centralTopLimit(block), 0.5)); return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index ee5f4b1b4..f53d9449d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; @@ -214,6 +213,6 @@ public class GardenPatchGenerator implements RegionFunction { * @return a melon pattern */ public static Pattern getMelonPattern() { - return new BlockPattern(BlockTypes.MELON_BLOCK.getDefaultState()); + return new BlockPattern(BlockTypes.MELON.getDefaultState()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index 2ab320f2c..cc37ee0a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -148,8 +148,7 @@ public class HeightMap { BlockState existing = session.getBlock(new Vector(xr, curHeight, zr)); // Skip water/lava - if (existing.getBlockType() != BlockTypes.WATER && existing.getBlockType() != BlockTypes.FLOWING_WATER - && existing.getBlockType() != BlockTypes.LAVA && existing.getBlockType() != BlockTypes.FLOWING_LAVA) { + if (existing.getBlockType() != BlockTypes.WATER && existing.getBlockType() != BlockTypes.LAVA) { session.setBlock(new Vector(xr, newHeight, zr), existing); ++blocksChanged; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index c7fb04f33..e838ff098 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -67,9 +67,7 @@ public abstract class AbstractWorld implements World { public Mask createLiquidMask() { return new BlockMask(this, new BlockState(BlockTypes.LAVA, new HashMap<>()), - new BlockState(BlockTypes.FLOWING_LAVA, new HashMap<>()), - new BlockState(BlockTypes.WATER, new HashMap<>()), - new BlockState(BlockTypes.FLOWING_WATER, new HashMap<>())); + new BlockState(BlockTypes.WATER, new HashMap<>())); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/BlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/BlockData.java deleted file mode 100644 index 3df632d76..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/BlockData.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.world.storage; - -import com.sk89q.worldedit.CuboidClipboard.FlipDirection; - -/** - * Block data related classes. - * - * @deprecated use {@link com.sk89q.worldedit.blocks.BlockData} - */ -@Deprecated -public final class BlockData { - - private BlockData() { - } - - /** - * Rotate a block's data value 90 degrees (north->east->south->west->north); - * - * @param type type ID of the block - * @param data data value of the block - * @return a new data value - * @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#rotate90(int, int)} - */ - @Deprecated - public static int rotate90(int type, int data) { - return com.sk89q.worldedit.blocks.BlockData.rotate90(type, data); - } - - /** - * Rotate a block's data value -90 degrees (north<-east<-south<-west<-north); - * - * @param type type ID of the block - * @param data data value of the block - * @return a new data value - * @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#rotate90Reverse(int, int)} - */ - @Deprecated - public static int rotate90Reverse(int type, int data) { - return com.sk89q.worldedit.blocks.BlockData.rotate90Reverse(type, data); - } - - /** - * Flip a block's data value. - * - * @param type type ID of the block - * @param data data value of the block - * @return a new data value - * @deprecated use return {@link com.sk89q.worldedit.blocks.BlockData#flip(int, int)} - */ - @Deprecated - public static int flip(int type, int data) { - return rotate90(type, rotate90(type, data)); - } - - /** - * Flip a block's data value. - * - * @param type type ID of the block - * @param data data value of the block - * @param direction the direction to flip - * @return a new data value - * @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#flip(int, int, FlipDirection)} - */ - @Deprecated - public static int flip(int type, int data, FlipDirection direction) { - return com.sk89q.worldedit.blocks.BlockData.flip(type, data, direction); - } - - /** - * Cycle a block's data value. This usually goes through some rotational pattern - * depending on the block. If it returns -1, it means the id and data specified - * do not have anything to cycle to. - * - * @param type block id to be cycled - * @param data block data value that it starts at - * @param increment whether to go forward (1) or backward (-1) in the cycle - * @return the new data value for the block - * @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#cycle(int, int, int)} - */ - @Deprecated - public static int cycle(int type, int data, int increment) { - return com.sk89q.worldedit.blocks.BlockData.cycle(type, data, increment); - } - - /** - * Returns the data value for the next color of cloth in the rainbow. This - * should not be used if you want to just increment the data value. - * - * @param data the data value - * @return a new data value - * @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#nextClothColor(int)} - */ - @Deprecated - public static int nextClothColor(int data) { - return com.sk89q.worldedit.blocks.BlockData.nextClothColor(data); - } - - /** - * Returns the data value for the previous ext color of cloth in the rainbow. - * This should not be used if you want to just increment the data value. - * - * @param data the data value - * @return a new data value - * @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#prevClothColor(int)} - */ - @Deprecated - public static int prevClothColor(int data) { - return com.sk89q.worldedit.blocks.BlockData.prevClothColor(data); - } - - -} From 66d70f00e744c3c62ef235ebcf08090d46b7319d Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 19 Jun 2018 17:03:09 +1000 Subject: [PATCH 23/74] Removed more deprecated code --- .../wepif/FlatFilePermissionsResolver.java | 5 - .../sk89q/worldedit/bukkit/BukkitWorld.java | 7 +- .../com/sk89q/worldedit/blocks/LazyBlock.java | 1 - .../com/sk89q/worldedit/blocks/NoteBlock.java | 122 ------------------ .../java/com/sk89q/worldedit/EditSession.java | 112 ++++++++-------- .../com/sk89q/worldedit/blocks/BlockID.java | 2 +- .../com/sk89q/worldedit/blocks/BlockType.java | 2 +- .../com/sk89q/worldedit/blocks/ItemID.java | 2 +- .../worldedit/command/GenerationCommands.java | 2 +- .../worldedit/command/RegionCommands.java | 2 +- .../sk89q/worldedit/command/ToolCommands.java | 2 +- .../command/argument/TreeGeneratorParser.java | 2 +- .../command/tool/FloatingTreeRemover.java | 74 ++++------- .../worldedit/command/tool/QueryTool.java | 5 - .../worldedit/command/tool/TreePlanter.java | 8 +- .../function/generator/ForestGenerator.java | 13 +- .../worldedit/regions/CylinderRegion.java | 10 -- .../worldedit/regions/Polygonal2DRegion.java | 5 - .../sk89q/worldedit/util/TreeGenerator.java | 27 +--- 19 files changed, 107 insertions(+), 296 deletions(-) delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/NoteBlock.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java index 6caa45207..704694c9f 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java @@ -66,11 +66,6 @@ public class FlatFilePermissionsResolver implements PermissionsResolver { this.userFile = userFile; } - @Deprecated - public static boolean filesExists() { - return (new File("perms_groups.txt")).exists() && (new File("perms_users.txt")).exists(); - } - public Map> loadGroupPermissions() { Map> userGroupPermissions = new HashMap>(); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index eac643e49..2c1a5e606 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -35,12 +35,12 @@ import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; +import com.sk89q.worldedit.history.change.BlockChange; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.registry.BundledBlockData; -import com.sk89q.worldedit.world.registry.Registries; import org.bukkit.Effect; import org.bukkit.TreeType; import org.bukkit.World; @@ -159,7 +159,7 @@ public class BukkitWorld extends AbstractWorld { @Override public boolean regenerate(Region region, EditSession editSession) { - BaseBlock[] history = new BaseBlock[16 * 16 * (getMaxY() + 1)]; + BlockStateHolder[] history = new BlockStateHolder[16 * 16 * (getMaxY() + 1)]; for (Vector2D chunk : region.getChunks()) { Vector min = new Vector(chunk.getBlockX() * 16, 0, chunk.getBlockZ() * 16); @@ -192,8 +192,7 @@ public class BukkitWorld extends AbstractWorld { if (!region.contains(pt)) { editSession.smartSetBlock(pt, history[index]); } else { // Otherwise fool with history - editSession.rememberChange(pt, history[index], - editSession.getFullBlock(pt)); + editSession.getChangeSet().add(new BlockChange(pt.toBlockVector(), history[index], editSession.getFullBlock(pt))); } } } diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java index 4d68ddec0..5baf31e4d 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java @@ -66,7 +66,6 @@ public class LazyBlock extends BaseBlock { * @param extent the extent to later load the full block data from * @param position the position to later load the full block data from */ - @Deprecated public LazyBlock(BlockState state, Extent extent, Vector position) { super(state); checkNotNull(extent); diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/NoteBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/NoteBlock.java deleted file mode 100644 index f061723c1..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/NoteBlock.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import com.sk89q.jnbt.ByteTag; -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.StringTag; -import com.sk89q.jnbt.Tag; - -import java.util.HashMap; -import java.util.Map; - -/** - * A note block. - */ -public class NoteBlock extends BaseBlock implements TileEntityBlock { - - private byte note; - - /** - * Construct the note block with a data value of 0. - */ - public NoteBlock() { - super(BlockID.NOTE_BLOCK); - this.note = 0; - } - - /** - * Construct the note block with a given data value. - * - * @param data data value - */ - public NoteBlock(int data) { - super(BlockID.NOTE_BLOCK, data); - this.note = 0; - } - - /** - * Construct the note block with a given data value and note. - * - * @param data data value - * @param note note - */ - public NoteBlock(int data, byte note) { - super(BlockID.NOTE_BLOCK, data); - this.note = note; - } - - /** - * Get the note. - * - * @return the note - */ - public byte getNote() { - return note; - } - - /** - * Set the note. - * - * @param note the note to set - */ - public void setNote(byte note) { - this.note = note; - } - - @Override - public boolean hasNbtData() { - return true; - } - - @Override - public String getNbtId() { - return "Music"; - } - - @Override - public CompoundTag getNbtData() { - Map values = new HashMap(); - values.put("note", new ByteTag(note)); - return new CompoundTag(values); - } - - @Override - public void setNbtData(CompoundTag rootTag) { - if (rootTag == null) { - return; - } - - Map values = rootTag.getValue(); - - Tag t; - - t = values.get("id"); - if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Music")) { - throw new RuntimeException("'Music' tile entity expected"); - } - - t = values.get("note"); - if (t instanceof ByteTag) { - note = ((ByteTag) t).getValue(); - } - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 8903a7dd6..e18c95efd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -19,8 +19,13 @@ package com.sk89q.worldedit; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.regions.Regions.asFlatRegion; +import static com.sk89q.worldedit.regions.Regions.maximumBlockY; +import static com.sk89q.worldedit.regions.Regions.minimumBlockY; + import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.blocks.type.BlockCategories; @@ -51,14 +56,30 @@ import com.sk89q.worldedit.function.block.BlockReplace; import com.sk89q.worldedit.function.block.Counter; import com.sk89q.worldedit.function.block.Naturalizer; import com.sk89q.worldedit.function.generator.GardenPatchGenerator; -import com.sk89q.worldedit.function.mask.*; -import com.sk89q.worldedit.function.operation.*; +import com.sk89q.worldedit.function.mask.BlockMask; +import com.sk89q.worldedit.function.mask.BoundedHeightMask; +import com.sk89q.worldedit.function.mask.ExistingBlockMask; +import com.sk89q.worldedit.function.mask.FuzzyBlockMask; +import com.sk89q.worldedit.function.mask.Mask; +import com.sk89q.worldedit.function.mask.MaskIntersection; +import com.sk89q.worldedit.function.mask.MaskUnion; +import com.sk89q.worldedit.function.mask.Masks; +import com.sk89q.worldedit.function.mask.NoiseFilter2D; +import com.sk89q.worldedit.function.mask.RegionMask; +import com.sk89q.worldedit.function.operation.ChangeSetExecutor; +import com.sk89q.worldedit.function.operation.ForwardExtentCopy; +import com.sk89q.worldedit.function.operation.Operation; +import com.sk89q.worldedit.function.operation.OperationQueue; +import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.util.RegionOffset; -import com.sk89q.worldedit.function.visitor.*; +import com.sk89q.worldedit.function.visitor.DownwardVisitor; +import com.sk89q.worldedit.function.visitor.LayerVisitor; +import com.sk89q.worldedit.function.visitor.NonRisingVisitor; +import com.sk89q.worldedit.function.visitor.RecursiveVisitor; +import com.sk89q.worldedit.function.visitor.RegionVisitor; import com.sk89q.worldedit.history.UndoContext; -import com.sk89q.worldedit.history.change.BlockChange; import com.sk89q.worldedit.history.changeset.BlockOptimizedHistory; import com.sk89q.worldedit.history.changeset.ChangeSet; import com.sk89q.worldedit.internal.expression.Expression; @@ -70,26 +91,36 @@ import com.sk89q.worldedit.math.interpolation.KochanekBartelsInterpolation; import com.sk89q.worldedit.math.interpolation.Node; import com.sk89q.worldedit.math.noise.RandomNoise; import com.sk89q.worldedit.math.transform.AffineTransform; -import com.sk89q.worldedit.regions.*; +import com.sk89q.worldedit.regions.CuboidRegion; +import com.sk89q.worldedit.regions.EllipsoidRegion; +import com.sk89q.worldedit.regions.FlatRegion; +import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.regions.Regions; import com.sk89q.worldedit.regions.shape.ArbitraryBiomeShape; import com.sk89q.worldedit.regions.shape.ArbitraryShape; import com.sk89q.worldedit.regions.shape.RegionShape; import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment; -import com.sk89q.worldedit.util.*; +import com.sk89q.worldedit.util.Countable; +import com.sk89q.worldedit.util.Direction; +import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.collection.DoubleArrayList; import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.world.NullWorld; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; -import javax.annotation.Nullable; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.regions.Regions.*; +import javax.annotation.Nullable; /** * An {@link Extent} that handles history, {@link BlockBag}s, change limits, @@ -518,19 +549,6 @@ public class EditSession implements Extent { return bypassNone.createEntity(location, entity); } - /** - * Insert a contrived block change into the history. - * - * @param position the position - * @param existing the previous block at that position - * @param block the new block - * @deprecated Get the change set with {@link #getChangeSet()} and add the change with that - */ - @Deprecated - public void rememberChange(Vector position, BaseBlock existing, BaseBlock block) { - changeSet.add(new BlockChange(position.toBlockVector(), existing, block)); - } - /** * Restores all blocks to their initial state. * @@ -1115,7 +1133,7 @@ public class EditSession implements Extent { new RegionMask(new EllipsoidRegion(null, origin, new Vector(radius, radius, radius))), getWorld().createLiquidMask()); - BlockReplace replace = new BlockReplace(this, new BlockPattern(new BaseBlock(BlockID.AIR))); + BlockReplace replace = new BlockReplace(this, new BlockPattern(BlockTypes.AIR.getDefaultState())); RecursiveVisitor visitor = new RecursiveVisitor(mask, replace); // Around the origin in a 3x3 block @@ -1553,7 +1571,7 @@ public class EditSession implements Extent { final int oy = position.getBlockY(); final int oz = position.getBlockZ(); - final BaseBlock grass = new BaseBlock(BlockID.GRASS); + final BlockState grass = BlockTypes.GRASS_BLOCK.getDefaultState(); final int ceilRadius = (int) Math.ceil(radius); for (int x = ox - ceilRadius; x <= ox + ceilRadius; ++x) { @@ -1562,35 +1580,21 @@ public class EditSession implements Extent { continue; } - loop: for (int y = world.getMaxY(); y >= 1; --y) { + for (int y = world.getMaxY(); y >= 1; --y) { final Vector pt = new Vector(x, y, z); - final BaseBlock block = getLazyBlock(pt); - final int id = block.getId(); - final int data = block.getData(); - - switch (id) { - case BlockID.DIRT: - if (onlyNormalDirt && data != 0) { - break loop; - } + final BlockState block = getBlock(pt); + final com.sk89q.worldedit.blocks.type.BlockType id = block.getBlockType(); + if (block.getBlockType() == BlockTypes.DIRT || + (!onlyNormalDirt && block.getBlockType() == BlockTypes.COARSE_DIRT)) { if (setBlock(pt, grass)) { ++affected; } - break loop; - - case BlockID.WATER: - case BlockID.STATIONARY_WATER: - case BlockID.LAVA: - case BlockID.STATIONARY_LAVA: - // break on liquids... - break loop; - - default: - // ...and all non-passable blocks - if (!BlockType.canPassThrough(id, data)) { - break loop; - } + break; + } else if (block.getBlockType() == BlockTypes.WATER || block.getBlockType() == BlockTypes.LAVA) { + break; + } else if (!BlockType.canPassThrough(id.getLegacyId())) { + break; } } } @@ -1632,11 +1636,11 @@ public class EditSession implements Extent { * @param basePosition a position * @param size a size * @param density between 0 and 1, inclusive - * @param treeGenerator the tree genreator + * @param treeType the tree type * @return number of trees created * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int makeForest(Vector basePosition, int size, double density, TreeGenerator treeGenerator) throws MaxChangedBlocksException { + public int makeForest(Vector basePosition, int size, double density, TreeGenerator.TreeType treeType) throws MaxChangedBlocksException { int affected = 0; for (int x = basePosition.getBlockX() - size; x <= basePosition.getBlockX() @@ -1656,7 +1660,7 @@ public class EditSession implements Extent { // Check if we hit the ground com.sk89q.worldedit.blocks.type.BlockType t = getBlock(new Vector(x, y, z)).getBlockType(); if (t == BlockTypes.GRASS_BLOCK || t == BlockTypes.DIRT) { - treeGenerator.generate(this, new Vector(x, y + 1, z)); + treeType.generate(this, new Vector(x, y + 1, z)); ++affected; break; } else if (t == BlockTypes.SNOW) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index 5e54d6272..b7164d28c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.blocks; /** * List of block IDs. * - * {@Deprecated Please use {@link com.sk89q.worldedit.blocks.type.BlockTypes}} + * {@deprecated Please use {@link com.sk89q.worldedit.blocks.type.BlockTypes}} */ @Deprecated public final class BlockID { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 871855343..32208eb00 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -37,7 +37,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Block types. * - * {@Deprecated Please use {@link com.sk89q.worldedit.blocks.type.BlockType}} + * {@deprecated Please use {@link com.sk89q.worldedit.blocks.type.BlockType}} */ @Deprecated public enum BlockType { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java index f412753dc..7944ab876 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.blocks; /** * List of item IDs. * - * {@Deprecated Please use {@link com.sk89q.worldedit.blocks.type.ItemTypes}} + * {@deprecated Please use {@link com.sk89q.worldedit.blocks.type.ItemTypes}} */ @Deprecated public final class ItemID { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java index e9121ae39..aa6640ba2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java @@ -197,7 +197,7 @@ public class GenerationCommands { @Logging(POSITION) public void forestGen(Player player, LocalSession session, EditSession editSession, @Optional("10") int size, @Optional("tree") TreeType type, @Optional("5") double density) throws WorldEditException { density = density / 100; - int affected = editSession.makeForest(session.getPlacementPosition(player), size, density, new TreeGenerator(type)); + int affected = editSession.makeForest(session.getPlacementPosition(player), size, density, type); player.print(affected + " trees created."); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 8751c3453..cd78705be 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -437,7 +437,7 @@ public class RegionCommands { public void forest(Player player, EditSession editSession, @Selection Region region, @Optional("tree") TreeType type, @Optional("5") @Range(min = 0, max = 100) double density) throws WorldEditException { density = density / 100; - ForestGenerator generator = new ForestGenerator(editSession, new TreeGenerator(type)); + ForestGenerator generator = new ForestGenerator(editSession, type); GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator); LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground); visitor.setMask(new NoiseFilter2D(new RandomNoise(), density)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 7e5956d4b..84dcd1861 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -89,7 +89,7 @@ public class ToolCommands { } BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); - session.setTool(itemStack.getType(), new TreePlanter(new TreeGenerator(type))); + session.setTool(itemStack.getType(), new TreePlanter(type)); player.print("Tree tool bound to " + itemStack.getType().getName() + "."); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/TreeGeneratorParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/TreeGeneratorParser.java index 34b782af7..3d3f73d6b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/TreeGeneratorParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/TreeGeneratorParser.java @@ -94,7 +94,7 @@ public class TreeGeneratorParser implements CommandExecutor stop walking this route + BlockState state = world.getBlock(next); + if (state.getBlockType() == BlockTypes.AIR || state.getBlockType() == BlockTypes.SNOW) { continue; - - case BlockID.LOG: - case BlockID.LOG2: - case BlockID.LEAVES: - case BlockID.LEAVES2: - case BlockID.BROWN_MUSHROOM_CAP: - case BlockID.RED_MUSHROOM_CAP: - case BlockID.VINE: - // queue next point + } + if (isTreeBlock(state.getBlockType())) { queue.addLast(next); - break; - - default: + } else { // we hit something solid - evaluate where we came from - final int curId = world.getLazyBlock(current).getId(); - if (curId == BlockID.LEAVES || curId == BlockID.LEAVES2 - || curId == BlockID.VINE) { - // leaves touching a wall/the ground => stop walking this route - continue; - } else { + final BlockType currentType = world.getBlock(current).getBlockType(); + if (!BlockCategories.LEAVES.contains(currentType) && currentType != BlockTypes.VINE) { // log/shroom touching a wall/the ground => this is not a floating tree, bail out return null; } - } // switch - } // if - } // for - } // while + } + } + } + } return visited; - } // bfs + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index f4c897a51..5813b6b4d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -22,9 +22,7 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.MobSpawnerBlock; -import com.sk89q.worldedit.blocks.NoteBlock; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; @@ -57,9 +55,6 @@ public class QueryTool implements BlockTool { if (block instanceof MobSpawnerBlock) { player.printRaw("\u00A7e" + "Mob Type: " + ((MobSpawnerBlock) block).getMobType()); - } else if (block instanceof NoteBlock) { - player.printRaw("\u00A7e" + "Note block: " - + ((NoteBlock) block).getNote()); } return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java index 2f8a67463..998c87fd5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java @@ -30,10 +30,10 @@ import com.sk89q.worldedit.util.*; */ public class TreePlanter implements BlockTool { - private TreeGenerator gen; + private TreeGenerator.TreeType treeType; - public TreePlanter(TreeGenerator gen) { - this.gen = gen; + public TreePlanter(TreeGenerator.TreeType treeType) { + this.treeType = treeType; } @Override @@ -50,7 +50,7 @@ public class TreePlanter implements BlockTool { boolean successful = false; for (int i = 0; i < 10; i++) { - if (gen.generate(editSession, clicked.toVector().add(0, 1, 0))) { + if (treeType.generate(editSession, clicked.toVector().add(0, 1, 0))) { successful = true; break; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index 644a183db..bb350b7ff 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; @@ -35,18 +34,18 @@ import com.sk89q.worldedit.util.TreeGenerator; */ public class ForestGenerator implements RegionFunction { - private final TreeGenerator treeGenerator; + private final TreeGenerator.TreeType treeType; private final EditSession editSession; /** * Create a new instance. * * @param editSession the edit session - * @param treeGenerator a tree generator + * @param treeType a tree generator */ - public ForestGenerator(EditSession editSession, TreeGenerator treeGenerator) { + public ForestGenerator(EditSession editSession, TreeGenerator.TreeType treeType) { this.editSession = editSession; - this.treeGenerator = treeGenerator; + this.treeType = treeType; } @Override @@ -55,11 +54,11 @@ public class ForestGenerator implements RegionFunction { BlockType t = block.getBlockType(); if (t == BlockTypes.GRASS || t == BlockTypes.DIRT) { - treeGenerator.generate(editSession, position.add(0, 1, 0)); + treeType.generate(editSession, position.add(0, 1, 0)); return true; } else if (t == BlockTypes.TALL_GRASS || t == BlockTypes.DEAD_BUSH || t == BlockTypes.POPPY || t == BlockTypes.DANDELION) { // TODO: This list needs to be moved editSession.setBlock(position, BlockTypes.AIR.getDefaultState()); - treeGenerator.generate(editSession, position); + treeType.generate(editSession, position); return true; } else if (t == BlockTypes.SNOW) { editSession.setBlock(position, BlockTypes.AIR.getDefaultState()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java index fd09c57b4..ed0e70822 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java @@ -107,16 +107,6 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion { return center.toVector((maxY + minY) / 2); } - /** - * Sets the main center point of the region - * - * @deprecated replaced by {@link #setCenter(Vector2D)} - */ - @Deprecated - public void setCenter(Vector center) { - setCenter(center.toVector2D()); - } - /** * Sets the main center point of the region * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java index 62361548e..b7d607d9d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java @@ -171,11 +171,6 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { return minY; } - @Deprecated - public int getMininumY() { - return minY; - } - /** * Set the minimum Y. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java index 55546b95a..f905042e6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java @@ -164,32 +164,11 @@ public class TreeGenerator { } } + private TreeGenerator() { + } + private static final Random RANDOM = new Random(); - private TreeType type; - - /** - * Construct the tree generator with a tree type. - * - * @param type the tree type - */ - @Deprecated - public TreeGenerator(TreeType type) { - this.type = type; - } - - /** - * Generate a tree. - * - * @param editSession the edit session - * @param position the position to generate the tree at - * @return true if generation was successful - * @throws MaxChangedBlocksException - */ - public boolean generate(EditSession editSession, Vector position) throws MaxChangedBlocksException { - return type.generate(editSession, position); - } - /** * Makes a terrible looking pine tree. * From 8e09eb3dbece6ddfb0fee50eac759e382435cc9b Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 19 Jun 2018 17:26:22 +1000 Subject: [PATCH 24/74] Re-added wool colours to block parser --- .../extension/factory/DefaultBlockParser.java | 55 ++++++++++++++++++- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 76d0dc139..b315d485d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -103,12 +103,61 @@ class DefaultBlockParser extends InputParser { private static Pattern blockStatePattern = Pattern.compile("([a-z:]+)(?:\\[([a-zA-Z0-9=, ]+)])?", Pattern.CASE_INSENSITIVE); private static String[] EMPTY_STRING_ARRAY = new String[]{}; - private BlockStateHolder parseLogic(String input, ParserContext context) - throws InputParseException, NoMatchException, - DisallowedUsageException { + /** + * Backwards compatibility for wool colours in block syntax. + * + * @param string Input string + * @return Mapped string + */ + private String woolMapper(String string) { + switch (string.toLowerCase()) { + case "white": + return BlockTypes.WHITE_WOOL.getId(); + case "black": + return BlockTypes.BLACK_WOOL.getId(); + case "blue": + return BlockTypes.BLUE_WOOL.getId(); + case "brown": + return BlockTypes.BROWN_WOOL.getId(); + case "cyan": + return BlockTypes.CYAN_WOOL.getId(); + case "gray": + case "grey": + return BlockTypes.GRAY_WOOL.getId(); + case "green": + return BlockTypes.GREEN_WOOL.getId(); + case "light_blue": + case "lightblue": + return BlockTypes.LIGHT_BLUE_WOOL.getId(); + case "light_gray": + case "light_grey": + case "lightgray": + case "lightgrey": + return BlockTypes.LIGHT_GRAY_WOOL.getId(); + case "lime": + return BlockTypes.LIME_WOOL.getId(); + case "magenta": + return BlockTypes.MAGENTA_WOOL.getId(); + case "orange": + return BlockTypes.ORANGE_WOOL.getId(); + case "pink": + return BlockTypes.PINK_WOOL.getId(); + case "purple": + return BlockTypes.PURPLE_WOOL.getId(); + case "yellow": + return BlockTypes.YELLOW_WOOL.getId(); + case "red": + return BlockTypes.RED_WOOL.getId(); + default: + return string; + } + } + + private BlockStateHolder parseLogic(String input, ParserContext context) throws InputParseException { BlockType blockType; Map blockStates = new HashMap<>(); String[] blockAndExtraData = input.trim().split("\\|"); + blockAndExtraData[0] = woolMapper(blockAndExtraData[0]); Matcher matcher = blockStatePattern.matcher(blockAndExtraData[0]); if (!matcher.matches() || matcher.groupCount() < 2 || matcher.groupCount() > 3) { throw new InputParseException("Invalid format"); From b06937d1c882e128d78301277ff890982340f6a5 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 1 Jul 2018 22:03:22 +1000 Subject: [PATCH 25/74] Setup a legacy mapper system. The file does not exist yet. --- .../sk89q/worldedit/bukkit/BukkitWorld.java | 15 +- .../EditSessionBlockChangeDelegate.java | 10 +- .../java/com/sk89q/worldedit/EditSession.java | 13 +- .../java/com/sk89q/worldedit/WorldEdit.java | 2 + .../com/sk89q/worldedit/blocks/BaseBlock.java | 35 +- .../com/sk89q/worldedit/blocks/BaseItem.java | 8 +- .../com/sk89q/worldedit/blocks/BlockData.java | 422 ++++++++---------- .../com/sk89q/worldedit/blocks/BlockType.java | 19 - .../sk89q/worldedit/blocks/ClothColor.java | 100 +---- .../worldedit/blocks/type/BlockState.java | 5 + .../blocks/type/BlockStateHolder.java | 7 + .../worldedit/blocks/type/BlockType.java | 5 +- .../sk89q/worldedit/blocks/type/ItemType.java | 8 +- .../command/tool/BlockDataCyler.java | 9 +- .../extension/factory/DefaultBlockParser.java | 68 +-- .../extent/clipboard/BlockArrayClipboard.java | 6 +- .../function/block/ExtentBlockCopy.java | 2 +- .../util/PropertiesConfiguration.java | 6 +- .../worldedit/util/YAMLConfiguration.java | 5 +- .../world/registry/BlockRegistry.java | 10 - .../world/registry/BundledBlockData.java | 53 +-- .../world/registry/BundledBlockRegistry.java | 11 - .../world/registry/BundledItemData.java | 52 +-- .../world/registry/BundledItemRegistry.java | 11 - .../world/registry/ItemRegistry.java | 9 - .../world/registry/LegacyMapper.java | 152 +++++++ .../world/registry/state/SimpleState.java | 13 + .../worldedit/world/registry/state/State.java | 7 + .../sk89q/worldedit/blocks/BlockDataTest.java | 76 ---- .../worldedit/forge/ForgeItemRegistry.java | 10 - .../config/ConfigurateConfiguration.java | 7 +- 31 files changed, 497 insertions(+), 659 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 2c1a5e606..56654dc07 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -31,8 +31,6 @@ import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.history.change.BlockChange; @@ -40,7 +38,7 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.BundledBlockData; +import com.sk89q.worldedit.world.registry.LegacyMapper; import org.bukkit.Effect; import org.bukkit.TreeType; import org.bukkit.World; @@ -361,10 +359,7 @@ public class BukkitWorld extends AbstractWorld { @Override public com.sk89q.worldedit.blocks.type.BlockState getBlock(Vector position) { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - BlockType blockType = BlockTypes.getBlockType( - BundledBlockData.getInstance().fromLegacyId(bukkitBlock.getTypeId()) - ); - return blockType.getDefaultState(); // TODO Data + return LegacyMapper.getInstance().getBlockFromLegacy(bukkitBlock.getTypeId(), bukkitBlock.getData()); } @Override @@ -374,7 +369,11 @@ public class BukkitWorld extends AbstractWorld { return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight); } else { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - return bukkitBlock.setTypeIdAndData(block.getBlockType().getLegacyId(), (byte) 0, notifyAndLight); // TODO Data + int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(block.toImmutableState()); + if (datas == null) { + throw new WorldEditException("Unknown block"){}; // TODO Remove. + } + return bukkitBlock.setTypeIdAndData(datas[0], (byte) datas[1], notifyAndLight); } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java index 04de1794d..08d1c0841 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java @@ -19,13 +19,12 @@ package com.sk89q.worldedit.bukkit; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.registry.LegacyMapper; import org.bukkit.BlockChangeDelegate; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.blocks.BaseBlock; /** * Proxy class to catch calls to set blocks. @@ -41,7 +40,7 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { @Override public boolean setRawTypeId(int x, int y, int z, int typeId) { try { - return editSession.setBlock(new Vector(x, y, z), new BaseBlock(typeId)); + return editSession.setBlock(new Vector(x, y, z), LegacyMapper.getInstance().getBlockFromLegacy(typeId)); } catch (MaxChangedBlocksException ex) { return false; } @@ -50,7 +49,7 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { @Override public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data) { try { - return editSession.setBlock(new Vector(x, y, z), new BaseBlock(typeId, data)); + return editSession.setBlock(new Vector(x, y, z), LegacyMapper.getInstance().getBlockFromLegacy(typeId, data)); } catch (MaxChangedBlocksException ex) { return false; } @@ -68,7 +67,8 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { @Override public int getTypeId(int x, int y, int z) { - return editSession.getBlock(new Vector(x, y, z)).getBlockType().getLegacyId(); + int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(editSession.getBlock(new Vector(x, y, z))); + return datas[0]; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index e18c95efd..1d98d726a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -108,6 +108,7 @@ import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.world.NullWorld; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.registry.LegacyMapper; import java.util.ArrayList; import java.util.Collections; @@ -440,10 +441,9 @@ public class EditSession implements Extent { public int getHighestTerrainBlock(int x, int z, int minY, int maxY, boolean naturalOnly) { for (int y = maxY; y >= minY; --y) { Vector pt = new Vector(x, y, z); - BaseBlock block = getLazyBlock(pt); - int id = block.getId(); - int data = block.getData(); - if (naturalOnly ? BlockType.isNaturalTerrainBlock(id, data) : !BlockType.canPassThrough(id, data)) { + BlockState block = getBlock(pt); + int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(block); + if (naturalOnly ? BlockType.isNaturalTerrainBlock(datas[0], datas[1]) : !BlockType.canPassThrough(datas[0], datas[1])) { return y; } } @@ -2115,8 +2115,9 @@ public class EditSession implements Extent { while (!queue.isEmpty()) { final BlockVector current = queue.removeFirst(); - final BaseBlock block = getLazyBlock(current); - if (!BlockType.canPassThrough(block.getId(), block.getData())) { + final BlockState block = getBlock(current); + int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(block); + if (!BlockType.canPassThrough(datas[0], datas[1])) { continue; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 761f4fb60..64d9485c0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -53,6 +53,7 @@ import com.sk89q.worldedit.util.io.file.InvalidFilenameException; import com.sk89q.worldedit.util.logging.WorldEditPrefixHandler; import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.BundledItemData; +import com.sk89q.worldedit.world.registry.LegacyMapper; import java.io.DataInputStream; import java.io.File; @@ -101,6 +102,7 @@ public class WorldEdit { getVersion(); BundledBlockData.getInstance(); // Load block registry BundledItemData.getInstance(); // Load item registry + LegacyMapper.getInstance(); // Load item registry } private WorldEdit() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 45db309f8..00a2832d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -27,7 +27,7 @@ import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.function.mask.Mask; -import com.sk89q.worldedit.world.registry.BundledBlockData; +import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.registry.state.State; import com.sk89q.worldedit.world.registry.state.value.StateValue; @@ -52,9 +52,6 @@ import javax.annotation.Nullable; */ public class BaseBlock implements BlockStateHolder, TileEntityBlock { - // Instances of this class should be _as small as possible_ because there will - // be millions of instances of this object. - private BlockState blockState; @Nullable private CompoundTag nbtData; @@ -67,10 +64,12 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { @Deprecated public BaseBlock(int id) { try { - this.blockState = BlockTypes.getBlockType(BundledBlockData.getInstance().fromLegacyId(id)).getDefaultState(); + this.blockState = LegacyMapper.getInstance().getBlockFromLegacy(id); + if (this.blockState == null) { + this.blockState = BlockTypes.AIR.getDefaultState(); + } } catch (Exception e) { System.out.println(id); - System.out.println(BundledBlockData.getInstance().fromLegacyId(id)); e.printStackTrace(); } } @@ -134,16 +133,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { * @param other the other block */ public BaseBlock(BaseBlock other) { - this(other.getState(), other.getNbtData()); - } - - /** - * Get the block state - * - * @return The block state - */ - public BlockState getState() { - return this.blockState; + this(other.toImmutableState(), other.getNbtData()); } /** @@ -240,7 +230,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { final BaseBlock otherBlock = (BaseBlock) o; - return this.getState().equals(otherBlock.getState()) && Objects.equals(getNbtData(), otherBlock.getNbtData()); + return this.toImmutableState().equals(otherBlock.toImmutableState()) && Objects.equals(getNbtData(), otherBlock.getNbtData()); } @@ -252,12 +242,17 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { */ @Override public boolean equalsFuzzy(BlockStateHolder o) { - return this.getState().equalsFuzzy(o); + return this.toImmutableState().equalsFuzzy(o); + } + + @Override + public BlockState toImmutableState() { + return this.blockState; } @Override public int hashCode() { - int ret = getState().hashCode() << 3; + int ret = toImmutableState().hashCode() << 3; if (hasNbtData()) { ret += getNbtData().hashCode(); } @@ -266,7 +261,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { @Override public String toString() { - return "Block{State: " + this.getState().toString() + ", NBT: " + String.valueOf(getNbtData()) + "}"; + return "Block{State: " + this.toImmutableState().toString() + ", NBT: " + String.valueOf(getNbtData()) + "}"; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java index be35174d1..5f7e7f1b2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java @@ -23,7 +23,7 @@ import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.blocks.type.ItemType; import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.world.NbtValued; -import com.sk89q.worldedit.world.registry.BundledItemData; +import com.sk89q.worldedit.world.registry.LegacyMapper; import javax.annotation.Nullable; @@ -46,7 +46,11 @@ public class BaseItem implements NbtValued { */ @Deprecated public BaseItem(int id) { - this(ItemTypes.getItemType(BundledItemData.getInstance().fromLegacyId(id))); + ItemType type = LegacyMapper.getInstance().getItemFromLegacy(id); + if (type == null) { + type = ItemTypes.AIR; + } + this.itemType = type; } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockData.java index 006de9041..ebdfae894 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockData.java @@ -855,246 +855,188 @@ public final class BlockData { * @return the new data value for the block */ public static int cycle(int type, int data, int increment) { - if (increment != -1 && increment != 1) { - throw new IllegalArgumentException("Increment must be 1 or -1."); - } - - int store; - switch (type) { - - // special case here, going to use "forward" for type and "backward" for orientation - case BlockID.LOG: - case BlockID.LOG2: - if (increment == -1) { - store = data & 0x3; // copy bottom (type) bits - return mod((data & ~0x3) + 4, 16) | store; // switch orientation with top bits and reapply bottom bits; - } else { - store = data & ~0x3; // copy top (orientation) bits - return mod((data & 0x3) + 1, 4) | store; // switch type with bottom bits and reapply top bits - } - - // same here - screw you unit tests - /*case BlockID.QUARTZ_BLOCK: - if (increment == -1 && data > 2) { - switch (data) { - case 2: return 3; - case 3: return 4; - case 4: return 2; - } - } else if (increment == 1) { - switch (data) { - case 0: - return 1; - case 1: - return 2; - case 2: - case 3: - case 4: - return 0; - } - } else { - return -1; - }*/ - - case BlockID.LONG_GRASS: - case BlockID.SANDSTONE: - case BlockID.DIRT: - if (data > 2) return -1; - return mod((data + increment), 3); - - case BlockID.TORCH: - case BlockID.REDSTONE_TORCH_ON: - case BlockID.REDSTONE_TORCH_OFF: - if (data < 1 || data > 4) return -1; - return mod((data - 1 + increment), 4) + 1; - - case BlockID.OAK_WOOD_STAIRS: - case BlockID.COBBLESTONE_STAIRS: - case BlockID.BRICK_STAIRS: - case BlockID.STONE_BRICK_STAIRS: - case BlockID.NETHER_BRICK_STAIRS: - case BlockID.SANDSTONE_STAIRS: - case BlockID.SPRUCE_WOOD_STAIRS: - case BlockID.BIRCH_WOOD_STAIRS: - case BlockID.JUNGLE_WOOD_STAIRS: - case BlockID.QUARTZ_STAIRS: - case BlockID.ACACIA_STAIRS: - case BlockID.DARK_OAK_STAIRS: - if (data > 7) return -1; - return mod((data + increment), 8); - - case BlockID.STONE_BRICK: - case BlockID.QUARTZ_BLOCK: - case BlockID.PUMPKIN: - case BlockID.JACKOLANTERN: - case BlockID.NETHER_WART: - case BlockID.CAULDRON: - case BlockID.WOODEN_STEP: - case BlockID.DOUBLE_WOODEN_STEP: - case BlockID.HAY_BLOCK: - if (data > 3) return -1; - return mod((data + increment), 4); - - case BlockID.STEP: - case BlockID.DOUBLE_STEP: - case BlockID.CAKE_BLOCK: - case BlockID.PISTON_BASE: - case BlockID.PISTON_STICKY_BASE: - case BlockID.SILVERFISH_BLOCK: - if (data > 5) return -1; - return mod((data + increment), 6); - - case BlockID.DOUBLE_PLANT: - store = data & 0x8; // top half flag - data &= ~0x8; - if (data > 5) return -1; - return mod((data + increment), 6) | store; - - case BlockID.CROPS: - case BlockID.PUMPKIN_STEM: - case BlockID.MELON_STEM: - if (data > 6) return -1; - return mod((data + increment), 7); - - case BlockID.SOIL: - case BlockID.RED_FLOWER: - if (data > 8) return -1; - return mod((data + increment), 9); - - case BlockID.RED_MUSHROOM_CAP: - case BlockID.BROWN_MUSHROOM_CAP: - if (data > 10) return -1; - return mod((data + increment), 11); - - case BlockID.CACTUS: - case BlockID.REED: - case BlockID.SIGN_POST: - case BlockID.VINE: - case BlockID.SNOW: - case BlockID.COCOA_PLANT: - if (data > 15) return -1; - return mod((data + increment), 16); - - case BlockID.FURNACE: - case BlockID.BURNING_FURNACE: - case BlockID.WALL_SIGN: - case BlockID.LADDER: - case BlockID.CHEST: - case BlockID.ENDER_CHEST: - case BlockID.TRAPPED_CHEST: - case BlockID.HOPPER: - int extra = data & 0x8; - int withoutFlags = data & ~0x8; - if (withoutFlags < 2 || withoutFlags > 5) return -1; - return (mod((withoutFlags - 2 + increment), 4) + 2) | extra; - - case BlockID.DISPENSER: - case BlockID.DROPPER: - store = data & 0x8; - data &= ~0x8; - if (data > 5) return -1; - return mod((data + increment), 6) | store; - - case BlockID.REDSTONE_REPEATER_OFF: - case BlockID.REDSTONE_REPEATER_ON: - case BlockID.COMPARATOR_OFF: - case BlockID.COMPARATOR_ON: - case BlockID.TRAP_DOOR: - case BlockID.FENCE_GATE: - case BlockID.LEAVES: - case BlockID.LEAVES2: - if (data > 7) return -1; - store = data & ~0x3; - return mod(((data & 0x3) + increment), 4) | store; - - case BlockID.MINECART_TRACKS: - if (data < 6 || data > 9) return -1; - return mod((data - 6 + increment), 4) + 6; - - case BlockID.SAPLING: - if ((data & 0x3) == 3 || data > 15) return -1; - store = data & ~0x3; - return mod(((data & 0x3) + increment), 3) | store; - - case BlockID.FLOWER_POT: - if (data > 13) return -1; - return mod((data + increment), 14); - - case BlockID.CLOTH: - case BlockID.STAINED_CLAY: - case BlockID.CARPET: - case BlockID.STAINED_GLASS: - case BlockID.STAINED_GLASS_PANE: - if (increment == 1) { - data = nextClothColor(data); - } else if (increment == -1) { - data = prevClothColor(data); - } - return data; - - default: - return -1; - } - } - - /** - * Returns the data value for the next color of cloth in the rainbow. This - * should not be used if you want to just increment the data value. - * - * @param data the data value - * @return the next data value - */ - public static int nextClothColor(int data) { - switch (data) { - case ClothColor.ID.WHITE: return ClothColor.ID.LIGHT_GRAY; - case ClothColor.ID.LIGHT_GRAY: return ClothColor.ID.GRAY; - case ClothColor.ID.GRAY: return ClothColor.ID.BLACK; - case ClothColor.ID.BLACK: return ClothColor.ID.BROWN; - case ClothColor.ID.BROWN: return ClothColor.ID.RED; - case ClothColor.ID.RED: return ClothColor.ID.ORANGE; - case ClothColor.ID.ORANGE: return ClothColor.ID.YELLOW; - case ClothColor.ID.YELLOW: return ClothColor.ID.LIGHT_GREEN; - case ClothColor.ID.LIGHT_GREEN: return ClothColor.ID.DARK_GREEN; - case ClothColor.ID.DARK_GREEN: return ClothColor.ID.CYAN; - case ClothColor.ID.CYAN: return ClothColor.ID.LIGHT_BLUE; - case ClothColor.ID.LIGHT_BLUE: return ClothColor.ID.BLUE; - case ClothColor.ID.BLUE: return ClothColor.ID.PURPLE; - case ClothColor.ID.PURPLE: return ClothColor.ID.MAGENTA; - case ClothColor.ID.MAGENTA: return ClothColor.ID.PINK; - case ClothColor.ID.PINK: return ClothColor.ID.WHITE; - } - - return ClothColor.ID.WHITE; - } - - /** - * Returns the data value for the previous ext color of cloth in the rainbow. - * This should not be used if you want to just increment the data value. - * - * @param data the data value - * @return the new data value - */ - public static int prevClothColor(int data) { - switch (data) { - case ClothColor.ID.LIGHT_GRAY: return ClothColor.ID.WHITE; - case ClothColor.ID.GRAY: return ClothColor.ID.LIGHT_GRAY; - case ClothColor.ID.BLACK: return ClothColor.ID.GRAY; - case ClothColor.ID.BROWN: return ClothColor.ID.BLACK; - case ClothColor.ID.RED: return ClothColor.ID.BROWN; - case ClothColor.ID.ORANGE: return ClothColor.ID.RED; - case ClothColor.ID.YELLOW: return ClothColor.ID.ORANGE; - case ClothColor.ID.LIGHT_GREEN: return ClothColor.ID.YELLOW; - case ClothColor.ID.DARK_GREEN: return ClothColor.ID.LIGHT_GREEN; - case ClothColor.ID.CYAN: return ClothColor.ID.DARK_GREEN; - case ClothColor.ID.LIGHT_BLUE: return ClothColor.ID.CYAN; - case ClothColor.ID.BLUE: return ClothColor.ID.LIGHT_BLUE; - case ClothColor.ID.PURPLE: return ClothColor.ID.BLUE; - case ClothColor.ID.MAGENTA: return ClothColor.ID.PURPLE; - case ClothColor.ID.PINK: return ClothColor.ID.MAGENTA; - case ClothColor.ID.WHITE: return ClothColor.ID.PINK; - } - - return ClothColor.ID.WHITE; + return data + increment; + // TODO Fix +// if (increment != -1 && increment != 1) { +// throw new IllegalArgumentException("Increment must be 1 or -1."); +// } +// +// int store; +// switch (type) { +// +// // special case here, going to use "forward" for type and "backward" for orientation +// case BlockID.LOG: +// case BlockID.LOG2: +// if (increment == -1) { +// store = data & 0x3; // copy bottom (type) bits +// return mod((data & ~0x3) + 4, 16) | store; // switch orientation with top bits and reapply bottom bits; +// } else { +// store = data & ~0x3; // copy top (orientation) bits +// return mod((data & 0x3) + 1, 4) | store; // switch type with bottom bits and reapply top bits +// } +// +// // same here - screw you unit tests +// /*case BlockID.QUARTZ_BLOCK: +// if (increment == -1 && data > 2) { +// switch (data) { +// case 2: return 3; +// case 3: return 4; +// case 4: return 2; +// } +// } else if (increment == 1) { +// switch (data) { +// case 0: +// return 1; +// case 1: +// return 2; +// case 2: +// case 3: +// case 4: +// return 0; +// } +// } else { +// return -1; +// }*/ +// +// case BlockID.LONG_GRASS: +// case BlockID.SANDSTONE: +// case BlockID.DIRT: +// if (data > 2) return -1; +// return mod((data + increment), 3); +// +// case BlockID.TORCH: +// case BlockID.REDSTONE_TORCH_ON: +// case BlockID.REDSTONE_TORCH_OFF: +// if (data < 1 || data > 4) return -1; +// return mod((data - 1 + increment), 4) + 1; +// +// case BlockID.OAK_WOOD_STAIRS: +// case BlockID.COBBLESTONE_STAIRS: +// case BlockID.BRICK_STAIRS: +// case BlockID.STONE_BRICK_STAIRS: +// case BlockID.NETHER_BRICK_STAIRS: +// case BlockID.SANDSTONE_STAIRS: +// case BlockID.SPRUCE_WOOD_STAIRS: +// case BlockID.BIRCH_WOOD_STAIRS: +// case BlockID.JUNGLE_WOOD_STAIRS: +// case BlockID.QUARTZ_STAIRS: +// case BlockID.ACACIA_STAIRS: +// case BlockID.DARK_OAK_STAIRS: +// if (data > 7) return -1; +// return mod((data + increment), 8); +// +// case BlockID.STONE_BRICK: +// case BlockID.QUARTZ_BLOCK: +// case BlockID.PUMPKIN: +// case BlockID.JACKOLANTERN: +// case BlockID.NETHER_WART: +// case BlockID.CAULDRON: +// case BlockID.WOODEN_STEP: +// case BlockID.DOUBLE_WOODEN_STEP: +// case BlockID.HAY_BLOCK: +// if (data > 3) return -1; +// return mod((data + increment), 4); +// +// case BlockID.STEP: +// case BlockID.DOUBLE_STEP: +// case BlockID.CAKE_BLOCK: +// case BlockID.PISTON_BASE: +// case BlockID.PISTON_STICKY_BASE: +// case BlockID.SILVERFISH_BLOCK: +// if (data > 5) return -1; +// return mod((data + increment), 6); +// +// case BlockID.DOUBLE_PLANT: +// store = data & 0x8; // top half flag +// data &= ~0x8; +// if (data > 5) return -1; +// return mod((data + increment), 6) | store; +// +// case BlockID.CROPS: +// case BlockID.PUMPKIN_STEM: +// case BlockID.MELON_STEM: +// if (data > 6) return -1; +// return mod((data + increment), 7); +// +// case BlockID.SOIL: +// case BlockID.RED_FLOWER: +// if (data > 8) return -1; +// return mod((data + increment), 9); +// +// case BlockID.RED_MUSHROOM_CAP: +// case BlockID.BROWN_MUSHROOM_CAP: +// if (data > 10) return -1; +// return mod((data + increment), 11); +// +// case BlockID.CACTUS: +// case BlockID.REED: +// case BlockID.SIGN_POST: +// case BlockID.VINE: +// case BlockID.SNOW: +// case BlockID.COCOA_PLANT: +// if (data > 15) return -1; +// return mod((data + increment), 16); +// +// case BlockID.FURNACE: +// case BlockID.BURNING_FURNACE: +// case BlockID.WALL_SIGN: +// case BlockID.LADDER: +// case BlockID.CHEST: +// case BlockID.ENDER_CHEST: +// case BlockID.TRAPPED_CHEST: +// case BlockID.HOPPER: +// int extra = data & 0x8; +// int withoutFlags = data & ~0x8; +// if (withoutFlags < 2 || withoutFlags > 5) return -1; +// return (mod((withoutFlags - 2 + increment), 4) + 2) | extra; +// +// case BlockID.DISPENSER: +// case BlockID.DROPPER: +// store = data & 0x8; +// data &= ~0x8; +// if (data > 5) return -1; +// return mod((data + increment), 6) | store; +// +// case BlockID.REDSTONE_REPEATER_OFF: +// case BlockID.REDSTONE_REPEATER_ON: +// case BlockID.COMPARATOR_OFF: +// case BlockID.COMPARATOR_ON: +// case BlockID.TRAP_DOOR: +// case BlockID.FENCE_GATE: +// case BlockID.LEAVES: +// case BlockID.LEAVES2: +// if (data > 7) return -1; +// store = data & ~0x3; +// return mod(((data & 0x3) + increment), 4) | store; +// +// case BlockID.MINECART_TRACKS: +// if (data < 6 || data > 9) return -1; +// return mod((data - 6 + increment), 4) + 6; +// +// case BlockID.SAPLING: +// if ((data & 0x3) == 3 || data > 15) return -1; +// store = data & ~0x3; +// return mod(((data & 0x3) + increment), 3) | store; +// +// case BlockID.FLOWER_POT: +// if (data > 13) return -1; +// return mod((data + increment), 14); +// +// case BlockID.CLOTH: +// case BlockID.STAINED_CLAY: +// case BlockID.CARPET: +// case BlockID.STAINED_GLASS: +// case BlockID.STAINED_GLASS_PANE: +// if (increment == 1) { +// data = nextClothColor(data); +// } else if (increment == -1) { +// data = prevClothColor(data); +// } +// return data; +// +// default: +// return -1; +// } } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 32208eb00..c77a4ca67 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -1194,25 +1194,6 @@ public enum BlockType { return isNaturalTerrainBlock.contains(-16*id-data) || isNaturalTerrainBlock.contains(id); } - /** - * Checks if the block type is naturally occurring - * - * @param block the block - * @return true if the block type is naturally occurring - */ - public static boolean isNaturalTerrainBlock(BaseBlock block) { - return isNaturalTerrainBlock(block.getId(), block.getData()); - } - - /** - * Checks if the block type is naturally occurring - * - * @return true if the block type is naturally occurring - */ - public boolean isNaturalTerrainBlock() { - return isNaturalTerrainBlock.contains(id); - } - /** * HashSet for emitsLight. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java index 5cf0a5e3f..23562fdf0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java @@ -31,61 +31,32 @@ import java.util.EnumSet; */ public enum ClothColor { - WHITE(ID.WHITE, "White", "white"), - ORANGE(ID.ORANGE, "Orange", "orange"), - MAGENTA(ID.MAGENTA, "Magenta", "magenta"), - LIGHT_BLUE(ID.LIGHT_BLUE, "Light blue", "lightblue"), - YELLOW(ID.YELLOW, "Yellow", "yellow"), - LIGHT_GREEN(ID.LIGHT_GREEN, "Light green", "lightgreen"), - PINK(ID.PINK, "Pink", new String[] { "pink", "lightred" }), - GRAY(ID.GRAY, "Gray", new String[] { "grey", "gray" }), - LIGHT_GRAY(ID.LIGHT_GRAY, "Light gray", new String[] { "lightgrey", "lightgray" }), - CYAN(ID.CYAN, "Cyan", new String[] { "cyan", "turquoise" }), - PURPLE(ID.PURPLE, "Purple", new String[] { "purple", "violet" }), - BLUE(ID.BLUE, "Blue", "blue"), - BROWN(ID.BROWN, "Brown", new String[] { "brown", "cocoa", "coffee" }), - DARK_GREEN(ID.DARK_GREEN, "Dark green", new String[] { "green", "darkgreen", "cactusgreen", "cactigreen" }), - RED(ID.RED, "Red", "red"), - BLACK(ID.BLACK, "Black", "black"); - - public static final class ID { - public static final int WHITE = 0; - public static final int ORANGE = 1; - public static final int MAGENTA = 2; - public static final int LIGHT_BLUE = 3; - public static final int YELLOW = 4; - public static final int LIGHT_GREEN = 5; - public static final int PINK = 6; - public static final int GRAY = 7; - public static final int LIGHT_GRAY = 8; - public static final int CYAN = 9; - public static final int PURPLE = 10; - public static final int BLUE = 11; - public static final int BROWN = 12; - public static final int DARK_GREEN = 13; - public static final int RED = 14; - public static final int BLACK = 15; - - private ID() { - } - } - - /** - * Stores a map of the IDs for fast access. - */ - private static final Map ids = new HashMap<>(); + WHITE("White", "white"), + ORANGE("Orange", "orange"), + MAGENTA("Magenta", "magenta"), + LIGHT_BLUE("Light blue", "lightblue"), + YELLOW("Yellow", "yellow"), + LIGHT_GREEN("Light green", "lightgreen"), + PINK("Pink", "pink", "lightred"), + GRAY("Gray", "grey", "gray"), + LIGHT_GRAY("Light gray", "lightgrey", "lightgray"), + CYAN("Cyan", "cyan", "turquoise"), + PURPLE("Purple", "purple", "violet"), + BLUE("Blue", "blue"), + BROWN("Brown", "brown", "cocoa", "coffee"), + DARK_GREEN("Dark green", "green", "darkgreen", "cactusgreen", "cactigreen"), + RED("Red", "red"), + BLACK("Black", "black"); /** * Stores a map of the names for fast access. */ private static final Map lookup = new HashMap<>(); - private final int id; private final String name; private final String[] lookupKeys; static { for (ClothColor type : EnumSet.allOf(ClothColor.class)) { - ids.put(type.id, type); for (String key : type.lookupKeys) { lookup.put(key, type); } @@ -96,40 +67,14 @@ public enum ClothColor { /** * Construct the type. * - * @param id the ID of the color * @param name the name of the color - * @param lookupKey a name to refer to the color by + * @param lookupKeys a name to refer to the color by */ - ClothColor(int id, String name, String lookupKey) { - this.id = id; - this.name = name; - this.lookupKeys = new String[] { lookupKey }; - } - - /** - * Construct the type. - * - * @param id the ID of the color - * @param name the name of the color - * @param lookupKeys an array of lookup keys - */ - ClothColor(int id, String name, String[] lookupKeys) { - this.id = id; + ClothColor(String name, String ... lookupKeys) { this.name = name; this.lookupKeys = lookupKeys; } - /** - * Return type from ID. May return null. - * - * @param id the ID - * @return a color or null - */ - @Nullable - public static ClothColor fromID(int id) { - return ids.get(id); - } - /** * Return type from name. May return null. * @@ -141,15 +86,6 @@ public enum ClothColor { return lookup.get(name.toLowerCase()); } - /** - * Get item numeric ID. - * - * @return the ID - */ - public int getID() { - return id; - } - /** * Get user-friendly item name. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java index 43a867180..8fb84cfbb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java @@ -141,6 +141,11 @@ public class BlockState implements BlockStateHolder { return true; } + @Override + public BlockState toImmutableState() { + return this; + } + /** * Internal method used for creating the initial BlockState. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java index d39d1c5d1..3c71c3e29 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java @@ -64,4 +64,11 @@ public interface BlockStateHolder { * @return true if equal */ boolean equalsFuzzy(BlockStateHolder o); + + /** + * Returns an immutable BlockState from this BlockStateHolder. + * + * @return A BlockState + */ + BlockState toImmutableState(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java index a1afc2820..98b2c4fdd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.blocks.type; import com.sk89q.worldedit.world.registry.BundledBlockData; +import com.sk89q.worldedit.world.registry.LegacyMapper; import java.util.function.Function; @@ -85,9 +86,9 @@ public class BlockType { */ @Deprecated public int getLegacyId() { - Integer id = BundledBlockData.getInstance().toLegacyId(this.id); + int[] id = LegacyMapper.getInstance().getLegacyFromBlock(this.getDefaultState()); if (id != null) { - return id; + return id[0]; } else { return 0; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java index f7443adf7..c3c6659f0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.blocks.type; -import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.BundledItemData; +import com.sk89q.worldedit.world.registry.LegacyMapper; public class ItemType { @@ -61,9 +61,9 @@ public class ItemType { */ @Deprecated public int getLegacyId() { - Integer id = BundledItemData.getInstance().toLegacyId(this.id); - if (id != null) { - return id; + int ids[] = LegacyMapper.getInstance().getLegacyFromItem(this); + if (ids != null) { + return ids[0]; } else { return 0; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java index 85e0c56b1..7894852e4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java @@ -25,11 +25,13 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockData; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.registry.LegacyMapper; /** * A mode that cycles the data values of supported blocks. @@ -46,9 +48,10 @@ public class BlockDataCyler implements DoubleActionBlockTool { World world = (World) clicked.getExtent(); - BaseBlock block = world.getLazyBlock(clicked.toVector()); - int type = block.getId(); - int data = block.getData(); + BlockState block = world.getBlock(clicked.toVector()); + int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(block); + int type = datas[0]; + int data = datas[1]; if (!config.allowedDataCycleBlocks.isEmpty() && !player.hasPermission("worldedit.override.data-cycler") diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index b315d485d..8edeb5dee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -153,6 +153,37 @@ class DefaultBlockParser extends InputParser { } } + private static BlockState applyProperties(BlockState state, String[] stateProperties) throws NoMatchException { + if (stateProperties.length > 0) { // Block data not yet detected + // Parse the block data (optional) + for (String parseableData : stateProperties) { + try { + String[] parts = parseableData.split("="); + if (parts.length != 2) { + throw new NoMatchException("Bad state format in " + parseableData); + } + + State stateKey = BundledBlockData.getInstance().findById(state.getBlockType().getId()).states.get(parts[0]); + if (stateKey == null) { + throw new NoMatchException("Unknown state " + parts[0] + " for block " + state.getBlockType().getName()); + } + StateValue value = stateKey.getValueFor(parts[1]); + if (value == null) { + throw new NoMatchException("Unknown value " + parts[1] + " for state " + parts[0]); + } + + state = state.with(stateKey, value); + } catch (NoMatchException e) { + throw e; // Pass-through + } catch (Exception e) { + throw new NoMatchException("Unknown state '" + parseableData + "'"); + } + } + } + + return state; + } + private BlockStateHolder parseLogic(String input, ParserContext context) throws InputParseException { BlockType blockType; Map blockStates = new HashMap<>(); @@ -217,38 +248,15 @@ class DefaultBlockParser extends InputParser { state = new BlockState(blockType, blockStates); } - if (stateProperties.length > 0) { // Block data not yet detected - // Parse the block data (optional) - for (String parseableData : stateProperties) { - try { - String[] parts = parseableData.split("="); - if (parts.length != 2) { - throw new NoMatchException("Bad state format in " + parseableData); - } - - State stateKey = BundledBlockData.getInstance().findById(blockType.getId()).states.get(parts[0]); - if (stateKey == null) { - throw new NoMatchException("Unknown state " + parts[0] + " for block " + blockType.getName()); - } - StateValue value = stateKey.getValueFor(parts[1]); - if (value == null) { - throw new NoMatchException("Unknown value " + parts[1] + " for state " + parts[0]); - } - - state = state.with(stateKey, value); - } catch (NoMatchException e) { - throw e; // Pass-through - } catch (Exception e) { - throw new NoMatchException("Unknown state '" + parseableData + "'"); - } - } - } + state = applyProperties(state, stateProperties); // Check if the item is allowed - Actor actor = context.requireActor(); - if (context.isRestricted() && actor != null && !actor.hasPermission("worldedit.anyblock") - && worldEdit.getConfiguration().disallowedBlocks.contains(blockType.getId())) { - throw new DisallowedUsageException("You are not allowed to use '" + input + "'"); + if (context.isRestricted()) { + Actor actor = context.requireActor(); + if (actor != null && !actor.hasPermission("worldedit.anyblock") + && worldEdit.getConfiguration().disallowedBlocks.contains(blockType.getId())) { + throw new DisallowedUsageException("You are not allowed to use '" + input + "'"); + } } if (blockType == BlockTypes.SIGN || blockType == BlockTypes.WALL_SIGN) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index 4c563f1ae..6a5d86acd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -128,11 +128,7 @@ public class BlockArrayClipboard implements Clipboard { Vector v = position.subtract(region.getMinimumPoint()); BlockStateHolder block = blocks[v.getBlockX()][v.getBlockY()][v.getBlockZ()]; if (block != null) { - if (block instanceof BlockState) { - return (BlockState) block; - } else if (block instanceof BaseBlock) { - return ((BaseBlock) block).getState(); - } + return block.toImmutableState(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java index 2b669b332..d20043450 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java @@ -105,7 +105,7 @@ public class ExtentBlockCopy implements RegionFunction { builder.putByte("Rot", (byte) MCDirections.toRotation(newDirection)); - return new BaseBlock(state.getState(), builder.build()); + return new BaseBlock(state.toImmutableState(), builder.build()); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java index 9d0333814..472796c4a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java @@ -24,7 +24,7 @@ package com.sk89q.worldedit.util; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.world.registry.BundledItemData; +import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import java.io.File; @@ -92,7 +92,7 @@ public class PropertiesConfiguration extends LocalConfiguration { registerHelp = getBool("register-help", registerHelp); wandItem = getString("wand-item", wandItem); try { - wandItem = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(wandItem)); + wandItem = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(wandItem)).getId(); } catch (Throwable e) { } superPickaxeDrop = getBool("super-pickaxe-drop-items", superPickaxeDrop); @@ -103,7 +103,7 @@ public class PropertiesConfiguration extends LocalConfiguration { useInventoryCreativeOverride = getBool("use-inventory-creative-override", useInventoryCreativeOverride); navigationWand = getString("nav-wand-item", navigationWand); try { - navigationWand = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(navigationWand)); + navigationWand = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(navigationWand)).getId(); } catch (Throwable e) { } navigationWandMaxDistance = getInt("nav-wand-distance", navigationWandMaxDistance); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index e4502d949..24705db26 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.session.SessionManager; import com.sk89q.worldedit.world.registry.BundledItemData; +import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import java.io.IOException; @@ -57,7 +58,7 @@ public class YAMLConfiguration extends LocalConfiguration { profile = config.getBoolean("debug", profile); wandItem = config.getString("wand-item", wandItem); try { - wandItem = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(wandItem)); + wandItem = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(wandItem)).getId(); } catch (Throwable e) { } @@ -105,7 +106,7 @@ public class YAMLConfiguration extends LocalConfiguration { navigationWand = config.getString("navigation-wand.item", navigationWand); try { - navigationWand = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(navigationWand)); + navigationWand = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(navigationWand)).getId(); } catch (Throwable e) { } navigationWandMaxDistance = config.getInt("navigation-wand.max-distance", navigationWandMaxDistance); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index 4debcc682..ed1a88b9d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -42,16 +42,6 @@ public interface BlockRegistry { @Nullable BlockState createFromId(String id); - /** - * Create a new block using its legacy numeric ID. - * - * @param id the id - * @return the block, which may be null if no block exists - */ - @Nullable - @Deprecated - BlockState createFromId(int id); - /** * Get the material for the given block. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 76acf9de6..549bfe37a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -56,7 +56,6 @@ public class BundledBlockData { private static final BundledBlockData INSTANCE = new BundledBlockData(); private final Map idMap = new HashMap<>(); - private final Map legacyMap = new HashMap<>(); // Trove usage removed temporarily /** * Create a new instance. @@ -87,7 +86,7 @@ public class BundledBlockData { for (BlockEntry entry : entries) { idMap.put(entry.id, entry); - legacyMap.put(entry.legacyId, entry); + entry.postDeserialization(); } } @@ -106,49 +105,6 @@ public class BundledBlockData { return idMap.get(id); } - /** - * Return the entry for the given block legacy numeric ID. - * - * @param id the ID - * @return the entry, or null - */ - @Nullable - private BlockEntry findById(int id) { - return legacyMap.get(id); - } - - /** - * Convert the given string ID to a legacy numeric ID. - * - * @param id the ID - * @return the legacy ID, which may be null if the block does not have a legacy ID - */ - @Nullable - public Integer toLegacyId(String id) { - BlockEntry entry = findById(id); - if (entry != null) { - return entry.legacyId; - } else { - return null; - } - } - - /** - * Convert the given legacy numeric ID to a string ID. - * - * @param id the legacy ID - * @return the ID, which may be null if the block does not have a ID - */ - @Nullable - public String fromLegacyId(Integer id) { - BlockEntry entry = findById(id); - if (entry != null) { - return entry.id; - } else { - return null; - } - } - /** * Get the material properties for the given block. * @@ -191,13 +147,18 @@ public class BundledBlockData { } public static class BlockEntry { - private int legacyId; private String id; private String unlocalizedName; public String localizedName; private List aliases; public Map states = new HashMap<>(); private SimpleBlockMaterial material = new SimpleBlockMaterial(); + + void postDeserialization() { + for (Map.Entry state : states.entrySet()) { + state.getValue().setName(state.getKey()); + } + } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 56637e552..518f008e7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -41,17 +41,6 @@ public class BundledBlockRegistry implements BlockRegistry { return BlockTypes.getBlockType(id).getDefaultState(); } - @Nullable - @Override - public BlockState createFromId(int legacyId) { - String id = BundledBlockData.getInstance().fromLegacyId(legacyId); - if (id != null) { - return createFromId(id); - } else { - return null; - } - } - @Nullable @Override public BlockMaterial getMaterial(BaseBlock block) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java index 2a5fc607a..725367d40 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java @@ -54,7 +54,6 @@ public class BundledItemData { private static final BundledItemData INSTANCE = new BundledItemData(); private final Map idMap = new HashMap<>(); - private final Map legacyMap = new HashMap<>(); // Trove usage removed temporarily /** * Create a new instance. @@ -85,9 +84,6 @@ public class BundledItemData { for (ItemEntry entry : entries) { idMap.put(entry.id, entry); - if (entry.legacyId >= 0) { - legacyMap.put(entry.legacyId, entry); - } } } @@ -97,7 +93,8 @@ public class BundledItemData { * @param id the ID * @return the entry, or null */ - @Nullable public ItemEntry findById(String id) { + @Nullable + public ItemEntry findById(String id) { // If it has no namespace, assume minecraft. if (!id.contains(":")) { id = "minecraft:" + id; @@ -105,49 +102,6 @@ public class BundledItemData { return idMap.get(id); } - /** - * Return the entry for the given item legacy numeric ID. - * - * @param id the ID - * @return the entry, or null - */ - @Nullable - private ItemEntry findById(int id) { - return legacyMap.get(id); - } - - /** - * Convert the given string ID to a legacy numeric ID. - * - * @param id the ID - * @return the legacy ID, which may be null if the item does not have a legacy ID - */ - @Nullable - public Integer toLegacyId(String id) { - ItemEntry entry = findById(id); - if (entry != null) { - return entry.legacyId; - } else { - return null; - } - } - - /** - * Convert the given legacy numeric ID to a string ID. - * - * @param id the legacy ID - * @return the ID, which may be null if the item does not have a ID - */ - @Nullable - public String fromLegacyId(Integer id) { - ItemEntry entry = findById(id); - if (entry != null) { - return entry.id; - } else { - return null; - } - } - /** * Get a singleton instance of this object. * @@ -158,8 +112,6 @@ public class BundledItemData { } public static class ItemEntry { - private int legacyId; // -1 for items without legacy IDs. - private short legacyData; private String id; private String unlocalizedName; public String localizedName; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java index ab864ae29..d3692db76 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java @@ -35,15 +35,4 @@ public class BundledItemRegistry implements ItemRegistry { public BaseItem createFromId(String id) { return new BaseItem(ItemTypes.getItemType(id)); } - - @Nullable - @Override - public BaseItem createFromId(int legacyId) { - String id = BundledItemData.getInstance().fromLegacyId(legacyId); - if (id != null) { - return createFromId(id); - } else { - return null; - } - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemRegistry.java index 31afa867f..749aa6a37 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemRegistry.java @@ -34,13 +34,4 @@ public interface ItemRegistry { @Nullable BaseItem createFromId(String id); - /** - * Create a new item using its legacy numeric ID. - * - * @param id the id - * @return the item, which may be null if no item exists - */ - @Nullable - BaseItem createFromId(int id); - } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java new file mode 100644 index 000000000..823bb71e9 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -0,0 +1,152 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.io.Resources; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.extension.input.ParserContext; +import com.sk89q.worldedit.util.gson.VectorAdapter; + +import java.io.IOException; +import java.net.URL; +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.annotation.Nullable; + +public class LegacyMapper { + + private static final Logger log = Logger.getLogger(LegacyMapper.class.getCanonicalName()); + private static final LegacyMapper INSTANCE = new LegacyMapper(); + + private BiMap blockMap = HashBiMap.create(); + private BiMap itemMap = HashBiMap.create(); + + /** + * Create a new instance. + */ + private LegacyMapper() { + try { + loadFromResource(); + } catch (IOException e) { + log.log(Level.WARNING, "Failed to load the built-in legacy id registry", e); + } + } + + /** + * Attempt to load the data from file. + * + * @throws IOException thrown on I/O error + */ + private void loadFromResource() throws IOException { + GsonBuilder gsonBuilder = new GsonBuilder(); + gsonBuilder.registerTypeAdapter(Vector.class, new VectorAdapter()); + Gson gson = gsonBuilder.disableHtmlEscaping().create(); + URL url = LegacyMapper.class.getResource("legacy.json"); + if (url == null) { + throw new IOException("Could not find legacy.json"); + } + String data = Resources.toString(url, Charset.defaultCharset()); + LegacyDataFile dataFile = gson.fromJson(data, new TypeToken() {}.getType()); + + ParserContext parserContext = new ParserContext(); + parserContext.setPreferringWildcard(false); + parserContext.setRestricted(false); + + for (Map.Entry blockEntry : dataFile.blocks.entrySet()) { + try { + blockMap.put(blockEntry.getKey(), + (BlockState) WorldEdit.getInstance().getBlockFactory().parseFromInput(blockEntry.getValue(), parserContext)); + } catch (Exception e) { + log.warning("Unknown block: " + blockEntry.getValue()); + } + } + + for (Map.Entry itemEntry : dataFile.items.entrySet()) { + try { + itemMap.put(itemEntry.getKey(), ItemTypes.getItemType(itemEntry.getValue())); + } catch (Exception e) { + log.warning("Unknown item: " + itemEntry.getValue()); + } + } + } + + @Nullable + public ItemType getItemFromLegacy(int legacyId) { + return itemMap.get(legacyId + ":0"); + } + + @Nullable + public ItemType getItemFromLegacy(int legacyId, int data) { + return itemMap.get(legacyId + ":" + data); + } + + @Nullable + public int[] getLegacyFromItem(ItemType itemType) { + if (!itemMap.inverse().containsKey(itemType)) { + return null; + } else { + String value = itemMap.inverse().get(itemType); + return Arrays.stream(value.split(":")).mapToInt(Integer::parseInt).toArray(); + } + } + + @Nullable + public BlockState getBlockFromLegacy(int legacyId) { + return blockMap.get(legacyId + ":0"); + } + + @Nullable + public BlockState getBlockFromLegacy(int legacyId, int data) { + return blockMap.get(legacyId + ":" + data); + } + + @Nullable + public int[] getLegacyFromBlock(BlockState blockState) { + if (!blockMap.inverse().containsKey(blockState)) { + return null; + } else { + String value = blockMap.inverse().get(blockState); + return Arrays.stream(value.split(":")).mapToInt(Integer::parseInt).toArray(); + } + } + + public static LegacyMapper getInstance() { + return INSTANCE; + } + + @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection", "unused"}) + private static class LegacyDataFile { + private Map blocks; + private Map items; + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java index c34f95647..fb66705b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java @@ -29,6 +29,7 @@ import javax.annotation.Nullable; public class SimpleState implements State { + private String name; private List values; /** @@ -37,9 +38,21 @@ public class SimpleState implements State { * @param values The values */ public SimpleState(List values) { + this.name = "Unknown"; this.values = values; } + /** + * Internal method for name setting post-deserialise. Do not use. + */ + public void setName(String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + @Override public List getValues() { return Collections.unmodifiableList(values); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java index ba3d94122..c6c2fc0c1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java @@ -33,6 +33,13 @@ import javax.annotation.Nullable; */ public interface State { + /** + * Returns the name of this state. + * + * @return The state name + */ + String getName(); + /** * Return a list of available values for this state. * diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/blocks/BlockDataTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/blocks/BlockDataTest.java index 044b6a88b..1a44ddeb0 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/blocks/BlockDataTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/blocks/BlockDataTest.java @@ -61,80 +61,4 @@ public class BlockDataTest { } } } - - private static final TreeSet datasTemplate = new TreeSet(); - static { - for (int data = 0; data < 16; ++data) { - datasTemplate.add(data); - } - } - - @Test - public void testCycle() { - // Test monotony and continuity - for (int type = 0; type < 256; ++type) { - // Cloth isn't monotonous, and thus excluded. - if (type == BlockID.CLOTH - || type == BlockID.STAINED_CLAY - || type == BlockID.STAINED_GLASS - || type == BlockID.STAINED_GLASS_PANE - || type == BlockID.CARPET) { - continue; - } - - for (int data = 0; data < 16; ++data) { - final String message = type + "/" + data; - - final int cycled = BlockData.cycle(type, data, 1); - - // If the cycle goes back (including -1), everything is ok. - if (cycled <= data) { - continue; - } - - // If there's a gap in the cycle, there's a problem. - assertEquals(message, data + 1, cycled); - } - } - - // Test cyclicity forwards - testCycle(1); - - // ...and backwards - testCycle(-1); - } - - private static void testCycle(final int increment) { - // Iterate each block type and data value that wasn't part of a cycle yet. - for (int type = 0; type < 256; ++type) { - @SuppressWarnings("unchecked") - final TreeSet datas = (TreeSet) datasTemplate.clone(); - while (!datas.isEmpty()) { - final int start = datas.pollFirst(); - String message = type + "/" + start; - int current = start; - boolean first = true; - while (true) { - current = BlockData.cycle(type, current, increment); - - // If the cycle immediately goes to -1, everything is ok. - if (first && current == -1) break; - - first = false; - message += "->" + current; - - // If the cycle goes off limits (including -1), there's a problem. - assertTrue(message, current >= 0); - assertTrue(message, current < 16); - - // The cycle completes, everything is ok. - if (current == start) break; - - // Mark the current element as walked. - assertTrue(message, datas.remove(current)); - } - } - } - } - } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java index 713297e02..44142e551 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java @@ -37,14 +37,4 @@ public class ForgeItemRegistry implements ItemRegistry { return null; } } - - @Nullable - @Override - public BaseItem createFromId(int id) { - if (Item.REGISTRY.getObjectById(id) != null) { - return new BaseItem(id); - } else { - return null; - } - } } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java index f971c3c78..80ff1e0e9 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java @@ -22,9 +22,8 @@ package com.sk89q.worldedit.sponge.config; import com.google.common.reflect.TypeToken; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.session.SessionManager; -import com.sk89q.worldedit.world.registry.BundledItemData; +import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import ninja.leaping.configurate.ConfigurationOptions; import ninja.leaping.configurate.commented.CommentedConfigurationNode; @@ -61,7 +60,7 @@ public class ConfigurateConfiguration extends LocalConfiguration { profile = node.getNode("debug").getBoolean(profile); wandItem = node.getNode("wand-item").getString(wandItem); try { - wandItem = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(wandItem)); + wandItem = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(wandItem)).getId(); } catch (Throwable e) { } @@ -105,7 +104,7 @@ public class ConfigurateConfiguration extends LocalConfiguration { navigationWand = node.getNode("navigation-wand", "item").getString(navigationWand); try { - navigationWand = BundledItemData.getInstance().fromLegacyId(Integer.parseInt(navigationWand)); + navigationWand = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(navigationWand)).getId(); } catch (Throwable e) { } navigationWandMaxDistance = node.getNode("navigation-wand", "max-distance").getInt(navigationWandMaxDistance); From 93b225ca3ccfb1331e16a1a46008e47dee3f3b9b Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 1 Jul 2018 23:20:07 +1000 Subject: [PATCH 26/74] Expose a way of switching between ItemType and BlockType for ItemBlocks. --- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 2 +- .../sk89q/worldedit/bukkit/BukkitUtil.java | 34 +- .../java/com/sk89q/worldedit/EditSession.java | 8 +- .../com/sk89q/worldedit/LocalSession.java | 2 +- .../java/com/sk89q/worldedit/WorldEdit.java | 4 +- .../com/sk89q/worldedit/blocks/BlockID.java | 58 -- .../com/sk89q/worldedit/blocks/BlockType.java | 940 +----------------- .../com/sk89q/worldedit/blocks/ItemID.java | 183 ---- .../worldedit/blocks/type/BlockType.java | 38 +- .../sk89q/worldedit/blocks/type/ItemType.java | 22 + .../worldedit/command/GeneralCommands.java | 14 +- .../platform/AbstractPlayerActor.java | 20 +- .../function/mask/FuzzyBlockMask.java | 1 - .../function/mask/SolidBlockMask.java | 9 +- .../com/sk89q/worldedit/util/TargetBlock.java | 2 +- .../world/registry/BlockRegistry.java | 8 +- .../world/registry/BundledBlockRegistry.java | 8 +- 17 files changed, 110 insertions(+), 1243 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index a129b9633..1b5b140d4 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -69,7 +69,7 @@ public class BukkitPlayer extends AbstractPlayerActor { ItemStack itemStack = handSide == HandSide.MAIN_HAND ? player.getInventory().getItemInMainHand() : player.getInventory().getItemInOffHand(); - return BukkitUtil.toBlock(getWorld(), itemStack); + return BukkitUtil.toBlock(itemStack); } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index f32d56766..fc003d783 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -24,19 +24,17 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.BlockType; -import com.sk89q.worldedit.blocks.ItemID; import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.blocks.type.ItemType; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; -import org.bukkit.DyeColor; +import com.sk89q.worldedit.world.registry.LegacyMapper; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import org.bukkit.material.Dye; import java.util.List; @@ -123,29 +121,17 @@ public final class BukkitUtil { return ((BukkitWorld) world).getWorld(); } - public static BaseBlock toBlock(com.sk89q.worldedit.world.World world, ItemStack itemStack) throws WorldEditException { - final int typeId = itemStack.getTypeId(); - - switch (typeId) { - case ItemID.INK_SACK: - final Dye materialData = (Dye) itemStack.getData(); - if (materialData.getColor() == DyeColor.BROWN) { - return new BaseBlock(BlockTypes.COCOA); - } - break; - - default: - final BaseBlock baseBlock = BlockType.getBlockForItem(typeId, itemStack.getDurability()); - if (baseBlock != null) { - return baseBlock; - } - break; + public static BaseBlock toBlock(ItemStack itemStack) throws WorldEditException { + ItemType itemType = LegacyMapper.getInstance().getItemFromLegacy(itemStack.getTypeId(), itemStack.getData().getData()); + if (itemType.hasBlockType()) { + return new BaseBlock(itemType.getBlockType().getDefaultState()); + } else { + return new BaseBlock(BlockTypes.AIR.getDefaultState()); } - - return new BaseBlock(typeId, -1); } public static BaseItemStack toBaseItemStack(ItemStack itemStack) { - return new BaseItemStack(itemStack.getTypeId(), itemStack.getDurability()); + ItemType itemType = LegacyMapper.getInstance().getItemFromLegacy(itemStack.getTypeId(), itemStack.getData().getData()); + return new BaseItemStack(itemType, itemStack.getAmount()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 1d98d726a..99d5a6033 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -443,7 +443,7 @@ public class EditSession implements Extent { Vector pt = new Vector(x, y, z); BlockState block = getBlock(pt); int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(block); - if (naturalOnly ? BlockType.isNaturalTerrainBlock(datas[0], datas[1]) : !BlockType.canPassThrough(datas[0], datas[1])) { + if (naturalOnly ? BlockType.isNaturalTerrainBlock(datas[0], datas[1]) : block.getBlockType().getMaterial().isMovementBlocker()) { return y; } } @@ -1583,7 +1583,6 @@ public class EditSession implements Extent { for (int y = world.getMaxY(); y >= 1; --y) { final Vector pt = new Vector(x, y, z); final BlockState block = getBlock(pt); - final com.sk89q.worldedit.blocks.type.BlockType id = block.getBlockType(); if (block.getBlockType() == BlockTypes.DIRT || (!onlyNormalDirt && block.getBlockType() == BlockTypes.COARSE_DIRT)) { @@ -1593,7 +1592,7 @@ public class EditSession implements Extent { break; } else if (block.getBlockType() == BlockTypes.WATER || block.getBlockType() == BlockTypes.LAVA) { break; - } else if (!BlockType.canPassThrough(id.getLegacyId())) { + } else if (block.getBlockType().getMaterial().isMovementBlocker()) { break; } } @@ -2116,8 +2115,7 @@ public class EditSession implements Extent { while (!queue.isEmpty()) { final BlockVector current = queue.removeFirst(); final BlockState block = getBlock(current); - int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(block); - if (!BlockType.canPassThrough(datas[0], datas[1])) { + if (block.getBlockType().getMaterial().isMovementBlocker()) { continue; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index d9c904344..12779701a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -555,7 +555,7 @@ public class LocalSession { * @throws InvalidToolBindException if the item can't be bound to that item */ public void setTool(ItemType item, @Nullable Tool tool) throws InvalidToolBindException { - if (false /*TODO item > 0 && item < 255*/) { + if (item.hasBlockType()) { throw new InvalidToolBindException(item, "Blocks can't be used"); } else if (item == ItemTypes.getItemType(config.wandItem)) { throw new InvalidToolBindException(item, "Already used for the wand"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 64d9485c0..9245a1e45 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -25,7 +25,7 @@ import static com.sk89q.worldedit.event.platform.Interaction.OPEN; import com.sk89q.worldedit.CuboidClipboard.FlipDirection; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; -import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.platform.BlockInteractEvent; import com.sk89q.worldedit.event.platform.InputType; @@ -488,7 +488,7 @@ public class WorldEdit { int i = 0; for (Integer id : missingBlocks.keySet()) { - BlockType type = BlockType.fromID(id); + BlockType type = LegacyMapper.getInstance().getBlockFromLegacy(id).getBlockType(); str.append(type != null ? type.getName() + " (" + id + ")" diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index b7164d28c..f9e7c43b7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -127,7 +127,6 @@ public final class BlockID { public static final int REDSTONE_REPEATER_ON = 94; // POWERED_REPEATER @Deprecated public static final int LOCKED_CHEST = 95; - public static final int STAINED_GLASS = 95; public static final int TRAP_DOOR = 96; // TRAPDOOR public static final int SILVERFISH_BLOCK = 97; // MONSTER_EGG public static final int STONE_BRICK = 98; // STONEBRICK @@ -154,7 +153,6 @@ public final class BlockID { public static final int END_PORTAL = 119; public static final int END_PORTAL_FRAME = 120; public static final int END_STONE = 121; - public static final int DRAGON_EGG = 122; public static final int REDSTONE_LAMP_OFF = 123; // REDSTONE_LAMP public static final int REDSTONE_LAMP_ON = 124; // LIT_REDSTONE_LAMP public static final int DOUBLE_WOODEN_STEP = 125; // DOUBLE_WOODEN_SLAB @@ -170,7 +168,6 @@ public final class BlockID { public static final int BIRCH_WOOD_STAIRS = 135; // BRUCE_STAIRS public static final int JUNGLE_WOOD_STAIRS = 136; // JUNGLE_STAIRS public static final int COMMAND_BLOCK = 137; - public static final int BEACON = 138; public static final int COBBLESTONE_WALL = 139; public static final int FLOWER_POT = 140; public static final int CARROTS = 141; @@ -197,11 +194,8 @@ public final class BlockID { public static final int LOG2 = 162; public static final int ACACIA_STAIRS = 163; public static final int DARK_OAK_STAIRS = 164; - public static final int SLIME = 165; public static final int BARRIER = 166; public static final int IRON_TRAP_DOOR = 167; - public static final int PRISMARINE = 168; - public static final int SEA_LANTERN = 169; public static final int HAY_BLOCK = 170; public static final int CARPET = 171; public static final int HARDENED_CLAY = 172; @@ -211,9 +205,7 @@ public final class BlockID { public static final int STANDING_BANNER = 176; public static final int WALL_BANNER = 177; public static final int DAYLIGHT_SENSOR_INVERTED = 178; - public static final int RED_SANDSTONE = 179; public static final int RED_SANDSTONE_STAIRS = 180; - public static final int DOUBLE_STEP2 = 181; public static final int STEP2 = 182; public static final int SPRUCE_FENCE_GATE = 183; public static final int BIRCH_FENCE_GATE = 184; @@ -233,59 +225,9 @@ public final class BlockID { public static final int END_ROD = 198; public static final int CHORUS_PLANT = 199; public static final int CHORUS_FLOWER = 200; - public static final int PURPUR_BLOCK = 201; - public static final int PURPUR_PILLAR = 202; public static final int PURPUR_STAIRS = 203; - public static final int PURPUR_DOUBLE_SLAB = 204; public static final int PURPUR_SLAB = 205; - public static final int END_BRICKS = 206; public static final int BEETROOTS = 207; - public static final int GRASS_PATH = 208; - public static final int END_GATEWAY = 209; - public static final int REPEATING_COMMAND_BLOCK = 210; - public static final int CHAIN_COMMAND_BLOCK = 211; - public static final int FROSTED_ICE = 212; - public static final int MAGMA_BLOCK = 213; - public static final int NETHER_WART_BLOCK = 214; - public static final int RED_NETHER_BRICK = 215; - public static final int BONE_BLOCK = 216; - public static final int STRUCTURE_VOID = 217; - public static final int OBSERVER = 218; - public static final int SHULKER_BOX_WHITE = 219; - public static final int SHULKER_BOX_ORANGE = 220; - public static final int SHULKER_BOX_MAGENTA = 221; - public static final int SHULKER_BOX_LIGHT_BLUE = 222; - public static final int SHULKER_BOX_YELLOW = 223; - public static final int SHULKER_BOX_LIME = 224; - public static final int SHULKER_BOX_PINK = 225; - public static final int SHULKER_BOX_GRAY = 226; - public static final int SHULKER_BOX_LIGHT_GRAY = 227; - public static final int SHULKER_BOX_CYAN = 228; - public static final int SHULKER_BOX_PURPLE = 229; - public static final int SHULKER_BOX_BLUE = 230; - public static final int SHULKER_BOX_BROWN = 231; - public static final int SHULKER_BOX_GREEN = 232; - public static final int SHULKER_BOX_RED = 233; - public static final int SHULKER_BOX_BLACK = 234; - public static final int TERRACOTTA_WHITE = 235; - public static final int TERRACOTTA_ORANGE = 236; - public static final int TERRACOTTA_MAGENTA = 237; - public static final int TERRACOTTA_LIGHT_BLUE = 238; - public static final int TERRACOTTA_YELLOW = 239; - public static final int TERRACOTTA_LIME = 240; - public static final int TERRACOTTA_PINK = 241; - public static final int TERRACOTTA_GRAY = 242; - public static final int TERRACOTTA_LIGHT_GRAY = 243; - public static final int TERRACOTTA_CYAN = 244; - public static final int TERRACOTTA_PURPLE = 245; - public static final int TERRACOTTA_BLUE = 246; - public static final int TERRACOTTA_BROWN = 247; - public static final int TERRACOTTA_GREEN = 248; - public static final int TERRACOTTA_RED = 249; - public static final int TERRACOTTA_BLACK = 250; - public static final int CONCRETE = 251; - public static final int CONCRETE_POWDER = 252; - public static final int STRUCTURE_BLOCK = 255; private BlockID() { } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index c77a4ca67..064562a82 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -19,20 +19,18 @@ package com.sk89q.worldedit.blocks; -import com.sk89q.util.StringUtil; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.PlayerDirection; import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import javax.annotation.Nullable; - -import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Random; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Block types. @@ -42,433 +40,7 @@ import static com.google.common.base.Preconditions.checkNotNull; @Deprecated public enum BlockType { - AIR(BlockID.AIR, "Air", "air"), - STONE(BlockID.STONE, "Stone", "stone", "rock"), - GRASS(BlockID.GRASS, "Grass", "grass"), - DIRT(BlockID.DIRT, "Dirt", "dirt"), - COBBLESTONE(BlockID.COBBLESTONE, "Cobblestone", "cobblestone", "cobble"), - WOOD(BlockID.WOOD, "Wood", "wood", "woodplank", "plank", "woodplanks", "planks"), - SAPLING(BlockID.SAPLING, "Sapling", "sapling", "seedling"), - BEDROCK(BlockID.BEDROCK, "Bedrock", "adminium", "bedrock"), - WATER(BlockID.WATER, "Water", "watermoving", "movingwater", "flowingwater", "waterflowing"), - STATIONARY_WATER(BlockID.STATIONARY_WATER, "Water (stationary)", "water", "waterstationary", "stationarywater", "stillwater"), - LAVA(BlockID.LAVA, "Lava", "lavamoving", "movinglava", "flowinglava", "lavaflowing"), - STATIONARY_LAVA(BlockID.STATIONARY_LAVA, "Lava (stationary)", "lava", "lavastationary", "stationarylava", "stilllava"), - SAND(BlockID.SAND, "Sand", "sand"), - GRAVEL(BlockID.GRAVEL, "Gravel", "gravel"), - GOLD_ORE(BlockID.GOLD_ORE, "Gold ore", "goldore"), - IRON_ORE(BlockID.IRON_ORE, "Iron ore", "ironore"), - COAL_ORE(BlockID.COAL_ORE, "Coal ore", "coalore"), - LOG(BlockID.LOG, "Log", "log", "tree", "pine", "oak", "birch", "redwood"), - LEAVES(BlockID.LEAVES, "Leaves", "leaves", "leaf"), - SPONGE(BlockID.SPONGE, "Sponge", "sponge"), - GLASS(BlockID.GLASS, "Glass", "glass"), - LAPIS_LAZULI_ORE(BlockID.LAPIS_LAZULI_ORE, "Lapis lazuli ore", "lapislazuliore", "blueore", "lapisore"), - LAPIS_LAZULI(BlockID.LAPIS_LAZULI_BLOCK, "Lapis lazuli", "lapislazuli", "lapislazuliblock", "bluerock"), - DISPENSER(BlockID.DISPENSER, "Dispenser", "dispenser"), - SANDSTONE(BlockID.SANDSTONE, "Sandstone", "sandstone"), - NOTE_BLOCK(BlockID.NOTE_BLOCK, "Note block", "musicblock", "noteblock", "note", "music", "instrument"), - BED(BlockID.BED, "Bed", "bed"), - POWERED_RAIL(BlockID.POWERED_RAIL, "Powered Rail", "poweredrail", "boosterrail", "poweredtrack", "boostertrack", "booster"), - DETECTOR_RAIL(BlockID.DETECTOR_RAIL, "Detector Rail", "detectorrail", "detector"), - PISTON_STICKY_BASE(BlockID.PISTON_STICKY_BASE, "Sticky Piston", "stickypiston"), - WEB(BlockID.WEB, "Web", "web", "spiderweb"), - LONG_GRASS(BlockID.LONG_GRASS, "Long grass", "longgrass", "tallgrass"), - DEAD_BUSH(BlockID.DEAD_BUSH, "Shrub", "deadbush", "shrub", "deadshrub", "tumbleweed"), - PISTON_BASE(BlockID.PISTON_BASE, "Piston", "piston"), - PISTON_EXTENSION(BlockID.PISTON_EXTENSION, "Piston extension", "pistonextendsion", "pistonhead"), - CLOTH(BlockID.CLOTH, "Wool", "cloth", "wool"), - PISTON_MOVING_PIECE(BlockID.PISTON_MOVING_PIECE, "Piston moving piece", "movingpiston"), - YELLOW_FLOWER(BlockID.YELLOW_FLOWER, "Yellow flower", "yellowflower", "flower"), - RED_FLOWER(BlockID.RED_FLOWER, "Red rose", "redflower", "redrose", "rose"), - BROWN_MUSHROOM(BlockID.BROWN_MUSHROOM, "Brown mushroom", "brownmushroom", "mushroom"), - RED_MUSHROOM(BlockID.RED_MUSHROOM, "Red mushroom", "redmushroom"), - GOLD_BLOCK(BlockID.GOLD_BLOCK, "Gold block", "gold", "goldblock"), - IRON_BLOCK(BlockID.IRON_BLOCK, "Iron block", "iron", "ironblock"), - DOUBLE_STEP(BlockID.DOUBLE_STEP, "Double step", "doubleslab", "doublestoneslab", "doublestep"), - STEP(BlockID.STEP, "Step", "slab", "stoneslab", "step", "halfstep"), - BRICK(BlockID.BRICK, "Brick", "brick", "brickblock"), - TNT(BlockID.TNT, "TNT", "tnt", "c4", "explosive"), - BOOKCASE(BlockID.BOOKCASE, "Bookcase", "bookshelf", "bookshelves", "bookcase", "bookcases"), - MOSSY_COBBLESTONE(BlockID.MOSSY_COBBLESTONE, "Cobblestone (mossy)", "mossycobblestone", "mossstone", "mossystone", "mosscobble", "mossycobble", "moss", "mossy", "sossymobblecone"), - OBSIDIAN(BlockID.OBSIDIAN, "Obsidian", "obsidian"), - TORCH(BlockID.TORCH, "Torch", "torch", "light", "candle"), - FIRE(BlockID.FIRE, "Fire", "fire", "flame", "flames"), - MOB_SPAWNER(BlockID.MOB_SPAWNER, "Mob spawner", "mobspawner", "spawner"), - WOODEN_STAIRS(BlockID.OAK_WOOD_STAIRS, "Wooden stairs", "woodstair", "woodstairs", "woodenstair", "woodenstairs"), - CHEST(BlockID.CHEST, "Chest", "chest", "storage", "storagechest"), - REDSTONE_WIRE(BlockID.REDSTONE_WIRE, "Redstone wire", "redstone", "redstoneblock"), - DIAMOND_ORE(BlockID.DIAMOND_ORE, "Diamond ore", "diamondore"), - DIAMOND_BLOCK(BlockID.DIAMOND_BLOCK, "Diamond block", "diamond", "diamondblock"), - WORKBENCH(BlockID.WORKBENCH, "Workbench", "workbench", "table", "craftingtable", "crafting"), - CROPS(BlockID.CROPS, "Crops", "crops", "crop", "plant", "plants"), - SOIL(BlockID.SOIL, "Soil", "soil", "farmland"), - FURNACE(BlockID.FURNACE, "Furnace", "furnace"), - BURNING_FURNACE(BlockID.BURNING_FURNACE, "Furnace (burning)", "burningfurnace", "litfurnace"), - SIGN_POST(BlockID.SIGN_POST, "Sign post", "sign", "signpost"), - WOODEN_DOOR(BlockID.WOODEN_DOOR, "Wooden door", "wooddoor", "woodendoor", "door"), - LADDER(BlockID.LADDER, "Ladder", "ladder"), - MINECART_TRACKS(BlockID.MINECART_TRACKS, "Minecart tracks", "track", "tracks", "minecrattrack", "minecarttracks", "rails", "rail"), - COBBLESTONE_STAIRS(BlockID.COBBLESTONE_STAIRS, "Cobblestone stairs", "cobblestonestair", "cobblestonestairs", "cobblestair", "cobblestairs"), - WALL_SIGN(BlockID.WALL_SIGN, "Wall sign", "wallsign"), - LEVER(BlockID.LEVER, "Lever", "lever", "switch", "stonelever", "stoneswitch"), - STONE_PRESSURE_PLATE(BlockID.STONE_PRESSURE_PLATE, "Stone pressure plate", "stonepressureplate", "stoneplate"), - IRON_DOOR(BlockID.IRON_DOOR, "Iron Door", "irondoor"), - WOODEN_PRESSURE_PLATE(BlockID.WOODEN_PRESSURE_PLATE, "Wooden pressure plate", "woodpressureplate", "woodplate", "woodenpressureplate", "woodenplate", "plate", "pressureplate"), - REDSTONE_ORE(BlockID.REDSTONE_ORE, "Redstone ore", "redstoneore"), - GLOWING_REDSTONE_ORE(BlockID.GLOWING_REDSTONE_ORE, "Glowing redstone ore", "glowingredstoneore"), - REDSTONE_TORCH_OFF(BlockID.REDSTONE_TORCH_OFF, "Redstone torch (off)", "redstonetorchoff", "rstorchoff"), - REDSTONE_TORCH_ON(BlockID.REDSTONE_TORCH_ON, "Redstone torch (on)", "redstonetorch", "redstonetorchon", "rstorchon", "redtorch"), - STONE_BUTTON(BlockID.STONE_BUTTON, "Stone Button", "stonebutton", "button"), - SNOW(BlockID.SNOW, "Snow", "snow"), - ICE(BlockID.ICE, "Ice", "ice"), - SNOW_BLOCK(BlockID.SNOW_BLOCK, "Snow block", "snowblock"), - CACTUS(BlockID.CACTUS, "Cactus", "cactus", "cacti"), - CLAY(BlockID.CLAY, "Clay", "clay"), - SUGAR_CANE(BlockID.REED, "Reed", "reed", "cane", "sugarcane", "sugarcanes", "vine", "vines"), - JUKEBOX(BlockID.JUKEBOX, "Jukebox", "jukebox", "stereo", "recordplayer"), - FENCE(BlockID.FENCE, "Fence", "fence"), - PUMPKIN(BlockID.PUMPKIN, "Pumpkin", "pumpkin"), - NETHERRACK(BlockID.NETHERRACK, "Netherrack", "redmossycobblestone", "redcobblestone", "redmosstone", "redcobble", "netherstone", "netherrack", "nether", "hellstone"), - SOUL_SAND(BlockID.SLOW_SAND, "Soul sand", "slowmud", "mud", "soulsand", "hellmud"), - GLOWSTONE(BlockID.LIGHTSTONE, "Glowstone", "brittlegold", "glowstone", "lightstone", "brimstone", "australium"), - PORTAL(BlockID.PORTAL, "Portal", "portal"), - JACK_O_LANTERN(BlockID.JACKOLANTERN, "Pumpkin (on)", "pumpkinlighted", "pumpkinon", "litpumpkin", "jackolantern"), - CAKE(BlockID.CAKE_BLOCK, "Cake", "cake", "cakeblock"), - REDSTONE_REPEATER_OFF(BlockID.REDSTONE_REPEATER_OFF, "Redstone repeater (off)", "diodeoff", "redstonerepeater", "repeateroff", "delayeroff"), - REDSTONE_REPEATER_ON(BlockID.REDSTONE_REPEATER_ON, "Redstone repeater (on)", "diodeon", "redstonerepeateron", "repeateron", "delayeron"), - STAINED_GLASS(BlockID.STAINED_GLASS, "Stained Glass", "stainedglass"), - TRAP_DOOR(BlockID.TRAP_DOOR, "Trap door", "trapdoor", "hatch", "floordoor"), - SILVERFISH_BLOCK(BlockID.SILVERFISH_BLOCK, "Silverfish block", "silverfish", "silver"), - STONE_BRICK(BlockID.STONE_BRICK, "Stone brick", "stonebrick", "sbrick", "smoothstonebrick"), - RED_MUSHROOM_CAP(BlockID.RED_MUSHROOM_CAP, "Red mushroom cap", "giantmushroomred", "redgiantmushroom", "redmushroomcap"), - BROWN_MUSHROOM_CAP(BlockID.BROWN_MUSHROOM_CAP, "Brown mushroom cap", "giantmushroombrown", "browngiantmushoom", "brownmushroomcap"), - IRON_BARS(BlockID.IRON_BARS, "Iron bars", "ironbars", "ironfence"), - GLASS_PANE(BlockID.GLASS_PANE, "Glass pane", "window", "glasspane", "glasswindow"), - MELON_BLOCK(BlockID.MELON_BLOCK, "Melon (block)", "melonblock"), - PUMPKIN_STEM(BlockID.PUMPKIN_STEM, "Pumpkin stem", "pumpkinstem"), - MELON_STEM(BlockID.MELON_STEM, "Melon stem", "melonstem"), - VINE(BlockID.VINE, "Vine", "vine", "vines", "creepers"), - FENCE_GATE(BlockID.FENCE_GATE, "Fence gate", "fencegate", "gate"), - BRICK_STAIRS(BlockID.BRICK_STAIRS, "Brick stairs", "brickstairs", "bricksteps"), - STONE_BRICK_STAIRS(BlockID.STONE_BRICK_STAIRS, "Stone brick stairs", "stonebrickstairs", "smoothstonebrickstairs"), - MYCELIUM(BlockID.MYCELIUM, "Mycelium", "mycelium", "fungus", "mycel"), - LILY_PAD(BlockID.LILY_PAD, "Lily pad", "lilypad", "waterlily"), - NETHER_BRICK(BlockID.NETHER_BRICK, "Nether brick", "netherbrick"), - NETHER_BRICK_FENCE(BlockID.NETHER_BRICK_FENCE, "Nether brick fence", "netherbrickfence", "netherfence"), - NETHER_BRICK_STAIRS(BlockID.NETHER_BRICK_STAIRS, "Nether brick stairs", "netherbrickstairs", "netherbricksteps", "netherstairs", "nethersteps"), - NETHER_WART(BlockID.NETHER_WART, "Nether wart", "netherwart", "netherstalk"), - ENCHANTMENT_TABLE(BlockID.ENCHANTMENT_TABLE, "Enchantment table", "enchantmenttable", "enchanttable"), - BREWING_STAND(BlockID.BREWING_STAND, "Brewing Stand", "brewingstand"), - CAULDRON(BlockID.CAULDRON, "Cauldron"), - END_PORTAL(BlockID.END_PORTAL, "End Portal", "endportal", "blackstuff", "airportal", "weirdblackstuff"), - END_PORTAL_FRAME(BlockID.END_PORTAL_FRAME, "End Portal Frame", "endportalframe", "airportalframe", "crystalblock"), - END_STONE(BlockID.END_STONE, "End Stone", "endstone", "enderstone", "endersand"), - DRAGON_EGG(BlockID.DRAGON_EGG, "Dragon Egg", "dragonegg", "dragons"), - REDSTONE_LAMP_OFF(BlockID.REDSTONE_LAMP_OFF, "Redstone lamp (off)", "redstonelamp", "redstonelampoff", "rslamp", "rslampoff", "rsglow", "rsglowoff"), - REDSTONE_LAMP_ON(BlockID.REDSTONE_LAMP_ON, "Redstone lamp (on)", "redstonelampon", "rslampon", "rsglowon"), - DOUBLE_WOODEN_STEP(BlockID.DOUBLE_WOODEN_STEP, "Double wood step", "doublewoodslab", "doublewoodstep"), - WOODEN_STEP(BlockID.WOODEN_STEP, "Wood step", "woodenslab", "woodslab", "woodstep", "woodhalfstep"), - COCOA_PLANT(BlockID.COCOA_PLANT, "Cocoa plant", "cocoplant", "cocoaplant"), - SANDSTONE_STAIRS(BlockID.SANDSTONE_STAIRS, "Sandstone stairs", "sandstairs", "sandstonestairs"), - EMERALD_ORE(BlockID.EMERALD_ORE, "Emerald ore", "emeraldore"), - ENDER_CHEST(BlockID.ENDER_CHEST, "Ender chest", "enderchest"), - TRIPWIRE_HOOK(BlockID.TRIPWIRE_HOOK, "Tripwire hook", "tripwirehook"), - TRIPWIRE(BlockID.TRIPWIRE, "Tripwire", "tripwire", "string"), - EMERALD_BLOCK(BlockID.EMERALD_BLOCK, "Emerald block", "emeraldblock", "emerald"), - SPRUCE_WOOD_STAIRS(BlockID.SPRUCE_WOOD_STAIRS, "Spruce wood stairs", "sprucestairs", "sprucewoodstairs"), - BIRCH_WOOD_STAIRS(BlockID.BIRCH_WOOD_STAIRS, "Birch wood stairs", "birchstairs", "birchwoodstairs"), - JUNGLE_WOOD_STAIRS(BlockID.JUNGLE_WOOD_STAIRS, "Jungle wood stairs", "junglestairs", "junglewoodstairs"), - COMMAND_BLOCK(BlockID.COMMAND_BLOCK, "Command block", "commandblock", "cmdblock", "command", "cmd"), - BEACON(BlockID.BEACON, "Beacon", "beacon", "beaconblock"), - COBBLESTONE_WALL(BlockID.COBBLESTONE_WALL, "Cobblestone wall", "cobblestonewall", "cobblewall"), - FLOWER_POT(BlockID.FLOWER_POT, "Flower pot", "flowerpot", "plantpot", "pot"), - CARROTS(BlockID.CARROTS, "Carrots", "carrots", "carrotsplant", "carrotsblock"), - POTATOES(BlockID.POTATOES, "Potatoes", "potatoes", "potatoesblock"), - WOODEN_BUTTON(BlockID.WOODEN_BUTTON, "Wooden button", "woodbutton", "woodenbutton"), - HEAD(BlockID.HEAD, "Head", "head", "skull"), - ANVIL(BlockID.ANVIL, "Anvil", "anvil", "blacksmith"), - TRAPPED_CHEST(BlockID.TRAPPED_CHEST, "Trapped Chest", "trappedchest", "redstonechest"), - PRESSURE_PLATE_LIGHT(BlockID.PRESSURE_PLATE_LIGHT, "Weighted Pressure Plate (Light)", "lightpressureplate"), - PRESSURE_PLATE_HEAVY(BlockID.PRESSURE_PLATE_HEAVY, "Weighted Pressure Plate (Heavy)", "heavypressureplate"), - COMPARATOR_OFF(BlockID.COMPARATOR_OFF, "Redstone Comparator (inactive)", "redstonecomparator", "comparator"), - COMPARATOR_ON(BlockID.COMPARATOR_ON, "Redstone Comparator (active)", "redstonecomparatoron", "comparatoron"), - DAYLIGHT_SENSOR(BlockID.DAYLIGHT_SENSOR, "Daylight Sensor", "daylightsensor", "lightsensor", "daylightdetector"), - REDSTONE_BLOCK(BlockID.REDSTONE_BLOCK, "Block of Redstone", "redstoneblock", "blockofredstone"), - QUARTZ_ORE(BlockID.QUARTZ_ORE, "Nether Quartz Ore", "quartzore", "netherquartzore"), - HOPPER(BlockID.HOPPER, "Hopper", "hopper"), - QUARTZ_BLOCK(BlockID.QUARTZ_BLOCK, "Block of Quartz", "quartzblock", "quartz"), - QUARTZ_STAIRS(BlockID.QUARTZ_STAIRS, "Quartz Stairs", "quartzstairs"), - ACTIVATOR_RAIL(BlockID.ACTIVATOR_RAIL, "Activator Rail", "activatorrail", "tntrail", "activatortrack"), - DROPPER(BlockID.DROPPER, "Dropper", "dropper"), - STAINED_CLAY(BlockID.STAINED_CLAY, "Stained Clay", "stainedclay", "stainedhardenedclay"), - STAINED_GLASS_PANE(BlockID.STAINED_GLASS_PANE, "Stained Glass Pane", "stainedglasspane"), - LEAVES2(BlockID.LEAVES2, "Leaves", "leaves2", "acacialeaves", "darkoakleaves"), - LOG2(BlockID.LOG2, "Log", "log2", "acacia", "darkoak"), - ACACIA_STAIRS(BlockID.ACACIA_STAIRS, "Acacia Wood Stairs", "acaciawoodstairs", "acaciastairs"), - DARK_OAK_STAIRS(BlockID.DARK_OAK_STAIRS, "Dark Oak Wood Stairs", "darkoakwoodstairs", "darkoakstairs"), - SLIME(BlockID.SLIME, "SLime", "slimeblock"), - BARRIER(BlockID.BARRIER, "Barrier", "barrier", "wall", "worldborder", "edge"), - IRON_TRAP_DOOR(BlockID.IRON_TRAP_DOOR, "Iron Trap Door", "irontrapdoor"), - PRISMARINE(BlockID.PRISMARINE, "Prismarine", "prismarine"), - SEA_LANTERN(BlockID.SEA_LANTERN, "Sea Lantern", "sealantern"), - HAY_BLOCK(BlockID.HAY_BLOCK, "Hay Block", "hayblock", "haybale", "wheatbale"), - CARPET(BlockID.CARPET, "Carpet", "carpet"), - HARDENED_CLAY(BlockID.HARDENED_CLAY, "Hardened Clay", "hardenedclay", "hardclay"), - COAL_BLOCK(BlockID.COAL_BLOCK, "Block of Coal", "coalblock", "blockofcoal"), - PACKED_ICE(BlockID.PACKED_ICE, "Packed Ice", "packedice", "hardice"), - DOUBLE_PLANT(BlockID.DOUBLE_PLANT, "Large Flowers", "largeflowers", "doubleflowers"), - STANDING_BANNER(BlockID.STANDING_BANNER, "Standing Banner", "standingbannear", "banner"), - WALL_BANNER(BlockID.WALL_BANNER, "Wall Banner", "wallbanner"), - DAYLIGHT_SENSOR_INVERTED(BlockID.DAYLIGHT_SENSOR_INVERTED, "Inverted Daylight Sensor", "inverteddaylight", "inverteddaylightsensor"), - RED_SANDSTONE(BlockID.RED_SANDSTONE, "Red Sandstone", "redsandstone"), - RED_SANDSTONE_STAIRS(BlockID.RED_SANDSTONE_STAIRS, "Red Sandstone Stairs", "redsandstonestairs"), - DOUBLE_STEP2(BlockID.DOUBLE_STEP2, "Double Step 2", "doublestep2", "doubleslab2", "doublestoneslab2", "doublestonestep2"), - STEP2(BlockID.STEP2, "Step 2", "step2", "slab2", "stonestep2", "stoneslab2"), - SPRUCE_FENCE_GATE(BlockID.SPRUCE_FENCE_GATE, "Spruce Fence Gate", "spurcefencegate"), - BIRCH_FENCE_GATE(BlockID.BIRCH_FENCE_GATE, "Birch Fence Gate", "birchfencegate"), - JUNGLE_FENCE_GATE(BlockID.JUNGLE_FENCE_GATE, "Jungle Fence Gate", "junglefencegate"), - DARK_OAK_FENCE_GATE(BlockID.DARK_OAK_FENCE_GATE, "Dark Oak Fence Gate", "darkoakfencegate"), - ACACIA_FENCE_GATE(BlockID.ACACIA_FENCE_GATE, "Acacia Fence Gate", "acaciafencegate"), - SPRUCE_FENCE(BlockID.SPRUCE_FENCE, "Spruce Fence", "sprucefence"), - BIRCH_FENCE(BlockID.BIRCH_FENCE, "Birch Fence", "birchfence"), - JUNGLE_FENCE(BlockID.JUNGLE_FENCE, "Jungle Fence", "junglefence"), - DARK_OAK_FENCE(BlockID.DARK_OAK_FENCE, "Dark Oak Fence", "darkoakfence"), - ACACIA_FENCE(BlockID.ACACIA_FENCE, "Acacia Fence", "acaciafence"), - SPRUCE_DOOR(BlockID.SPRUCE_DOOR, "Spruce Door", "sprucedoor"), - BIRCH_DOOR(BlockID.BIRCH_DOOR, "Birch Door", "birchdoor"), - JUNGLE_DOOR(BlockID.JUNGLE_DOOR, "Jungle Door", "jungledoor"), - ACACIA_DOOR(BlockID.ACACIA_DOOR, "Acacia Door", "acaciadoor"), - DARK_OAK_DOOR(BlockID.DARK_OAK_DOOR, "Dark Oak Door", "darkoakdoor"), - END_ROD(BlockID.END_ROD, "End Rod", "endrod", "endtorch"), - CHORUS_PLANT(BlockID.CHORUS_PLANT, "Chorus Plant", "chorusplant", "chorusstem"), - CHORUS_FLOWER(BlockID.CHORUS_FLOWER, "Chorus Flower", "chorusflower"), - PURPUR_BLOCK(BlockID.PURPUR_BLOCK, "Purpur Block", "purpurblock", "blockpurpur"), - PURPUR_PILLAR(BlockID.PURPUR_PILLAR, "Purpur Pillar", "purpurpillar"), - PURPUR_STAIRS(BlockID.PURPUR_STAIRS, "Purpur Stairs", "purpurstairs"), - PURPUR_DOUBLE_SLAB(BlockID.PURPUR_DOUBLE_SLAB, "Purpur Double Slab", "purpurdoubleslab", "doubleslabpurpur", "doublepurpurslab"), - PURPUR_SLAB(BlockID.PURPUR_SLAB, "Purpur Slab", "purpurslab", "slabpurpur"), - END_BRICKS(BlockID.END_BRICKS, "End Bricks", "endbricks"), - BEETROOTS(BlockID.BEETROOTS, "Beetroots", "beetroots", "beetroot_plant"), - GRASS_PATH(BlockID.GRASS_PATH, "Grass Path", "grasspath", "dirtpath"), - END_GATEWAY(BlockID.END_GATEWAY, "End Gateway", "endgateway"), - REPEATING_COMMAND_BLOCK(BlockID.REPEATING_COMMAND_BLOCK, "Repeating Command Block", "repeatingcommandblock", "commandblockrepeating"), - CHAIN_COMMAND_BLOCK(BlockID.CHAIN_COMMAND_BLOCK, "Chain Command Block", "chaincommandblock", "commandblockchain"), - FROSTED_ICE(BlockID.FROSTED_ICE, "Frosted Ice", "frostedice", "frostwalkerice"), - MAGMA_BLOCK(BlockID.MAGMA_BLOCK, "Magma Block", "magmablock", "magma"), - NETHER_WART_BLOCK(BlockID.NETHER_WART_BLOCK, "Nether Wart Block", "netherwartblock"), - RED_NETHER_BRICK(BlockID.RED_NETHER_BRICK, "Red Nether Brick", "rednetherbrick", "netherbrickred"), - BONE_BLOCK(BlockID.BONE_BLOCK, "Bone Block", "boneblock", "blockbone", "fossil", "fossilblock", "blockfossil"), - STRUCTURE_VOID(BlockID.STRUCTURE_VOID, "Structure Void", "structurevoid", "structureair"), - OBSERVER(BlockID.OBSERVER, "Observer", "observer", "blockupdatedetector"), - SHULKER_BOX_WHITE(BlockID.SHULKER_BOX_WHITE, "White Shulker Box", "shulkerboxwhite"), - SHULKER_BOX_ORANGE(BlockID.SHULKER_BOX_ORANGE, "Orange Shulker Box", "shulkerboxorange"), - SHULKER_BOX_MAGENTA(BlockID.SHULKER_BOX_MAGENTA, "Magenta Shulker Box", "shulkerboxmagenta"), - SHULKER_BOX_LIGHT_BLUE(BlockID.SHULKER_BOX_LIGHT_BLUE, "Light Blue Shulker Box", "shulkerboxlightblue"), - SHULKER_BOX_YELLOW(BlockID.SHULKER_BOX_YELLOW, "Yellow Shulker Box", "shulkerboxyellow"), - SHULKER_BOX_LIME(BlockID.SHULKER_BOX_LIME, "Lime Shulker Box", "shulkerboxlime"), - SHULKER_BOX_PINK(BlockID.SHULKER_BOX_PINK, "Pink Shulker Box", "shulkerboxpink"), - SHULKER_BOX_GRAY(BlockID.SHULKER_BOX_GRAY, "Gray Shulker Box", "shulkerboxgray"), - SHULKER_BOX_LIGHT_GRAY(BlockID.SHULKER_BOX_LIGHT_GRAY, "Light Gray Shulker Box", "shulkerboxlightgray"), - SHULKER_BOX_CYAN(BlockID.SHULKER_BOX_CYAN, "Cyan Shulker Box", "shulkerboxcyan"), - SHULKER_BOX_PURPLE(BlockID.SHULKER_BOX_PURPLE, "Purple Shulker Box", "shulkerboxpurple"), - SHULKER_BOX_BLUE(BlockID.SHULKER_BOX_BLUE, "Blue Shulker Box", "shulkerboxblue"), - SHULKER_BOX_BROWN(BlockID.SHULKER_BOX_BROWN, "Brown Shulker Box", "shulkerboxbrown"), - SHULKER_BOX_GREEN(BlockID.SHULKER_BOX_GREEN, "Green Shulker Box", "shulkerboxgreen"), - SHULKER_BOX_RED(BlockID.SHULKER_BOX_RED, "Red Shulker Box", "shulkerboxred"), - SHULKER_BOX_BLACK(BlockID.SHULKER_BOX_BLACK, "Black Shulker Box", "shulkerboxblack"), - TERRACOTTA_WHITE(BlockID.TERRACOTTA_WHITE, "White Terracotta", "terracottawhite"), - TERRACOTTA_ORANGE(BlockID.TERRACOTTA_ORANGE, "Orange Terracotta", "terracottaorange"), - TERRACOTTA_MAGENTA(BlockID.TERRACOTTA_MAGENTA, "Magenta Terracotta", "terracottamagenta"), - TERRACOTTA_LIGHT_BLUE(BlockID.TERRACOTTA_LIGHT_BLUE, "Light Blue Terracotta", "terracottalightblue"), - TERRACOTTA_YELLOW(BlockID.TERRACOTTA_YELLOW, "Yellow Terracotta", "terracottayellow"), - TERRACOTTA_LIME(BlockID.TERRACOTTA_LIME, "Lime Terracotta", "terracottalime"), - TERRACOTTA_PINK(BlockID.TERRACOTTA_PINK, "Pink Terracotta", "terracottapink"), - TERRACOTTA_GRAY(BlockID.TERRACOTTA_GRAY, "Gray Terracotta", "terracottagray"), - TERRACOTTA_LIGHT_GRAY(BlockID.TERRACOTTA_LIGHT_GRAY, "Light Gray Terracotta", "terracottalightgray"), - TERRACOTTA_CYAN(BlockID.TERRACOTTA_CYAN, "Cyan Terracotta", "terracottacyan"), - TERRACOTTA_PURPLE(BlockID.TERRACOTTA_PURPLE, "Purple Terracotta", "terracottapurple"), - TERRACOTTA_BLUE(BlockID.TERRACOTTA_BLUE, "Blue Terracotta", "terracottablue"), - TERRACOTTA_BROWN(BlockID.TERRACOTTA_BROWN, "Brown Terracotta", "terracottabrown"), - TERRACOTTA_GREEN(BlockID.TERRACOTTA_GREEN, "Green Terracotta", "terracottagreen"), - TERRACOTTA_RED(BlockID.TERRACOTTA_RED, "Red Terracotta", "terracottared"), - TERRACOTTA_BLACK(BlockID.TERRACOTTA_BLACK, "Black Terracotta", "terracottablack"), - CONCRETE(BlockID.CONCRETE, "Concrete", "concrete"), - CONCRETE_POWDER(BlockID.CONCRETE_POWDER, "Concrete Powder", "concretepowder"), - STRUCTURE_BLOCK(BlockID.STRUCTURE_BLOCK, "Structure Block", "structureblock"); - - /** - * Stores a map of the IDs for fast access. - */ - private static final Map ids = new HashMap<>(); - /** - * Stores a map of the names for fast access. - */ - private static final Map lookup = new HashMap<>(); - - private final int id; - private final String name; - private final String[] lookupKeys; - - static { - for (BlockType type : EnumSet.allOf(BlockType.class)) { - ids.put(type.id, type); - for (String key : type.lookupKeys) { - lookup.put(key, type); - } - } - } - - - /** - * Construct the type. - * - * @param id the ID of the block - * @param name the name of the block - * @param lookupKey a name to reference the block by - */ - BlockType(int id, String name, String lookupKey) { - this.id = id; - this.name = name; - this.lookupKeys = new String[] { lookupKey }; - } - - /** - * Construct the type. - * - * @param id the ID of the block - * @param name the name of the block - * @param lookupKeys an array of keys to reference the block by - */ - BlockType(int id, String name, String... lookupKeys) { - this.id = id; - this.name = name; - this.lookupKeys = lookupKeys; - } - - /** - * Return type from ID. May return null. - * - * @param id the type ID - * @return a block type, otherwise null - */ - @Nullable - public static BlockType fromID(int id) { - return ids.get(id); - } - - /** - * Return type from name. May return null. - * - * @param name the name to search - * @return a block type or null - */ - @Nullable - public static BlockType lookup(String name) { - return lookup(name, true); - } - - /** - * Return type from name. May return null. - * - * @param name the name (or ID) of a block - * @param fuzzy true to for a fuzzy search on the block name - * @return a block type or null - */ - @Nullable - public static BlockType lookup(String name, boolean fuzzy) { - try { - return fromID(Integer.parseInt(name)); - } catch (NumberFormatException e) { - return StringUtil.lookup(lookup, name, fuzzy); - } - } - - private static final Map itemBlockMapping = new HashMap<>(); - private static final Map dataItemBlockMapping = new HashMap<>(); - static { - for (int data = 0; data < 16; ++data) { - dataItemBlockMapping.put(typeDataKey(BlockID.DIRT, data), new BaseBlock(BlockID.DIRT, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.WOOD, data), new BaseBlock(BlockID.WOOD, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.SAND, data), new BaseBlock(BlockID.SAND, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.SANDSTONE, data), new BaseBlock(BlockID.SANDSTONE, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.LONG_GRASS, data), new BaseBlock(BlockID.LONG_GRASS, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.CLOTH, data), new BaseBlock(BlockID.CLOTH, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.SILVERFISH_BLOCK, data), new BaseBlock(BlockID.SILVERFISH_BLOCK, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.STONE_BRICK, data), new BaseBlock(BlockID.STONE_BRICK, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.COBBLESTONE_WALL, data), new BaseBlock(BlockID.COBBLESTONE_WALL, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.STAINED_CLAY, data), new BaseBlock(BlockID.STAINED_CLAY, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.CARPET, data), new BaseBlock(BlockID.CARPET, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.RED_FLOWER, data), new BaseBlock(BlockID.RED_FLOWER, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.DOUBLE_PLANT, data), new BaseBlock(BlockID.DOUBLE_PLANT, data)); - dataItemBlockMapping.put(typeDataKey(BlockID.STAINED_GLASS, data), new BaseBlock(BlockID.STAINED_GLASS, data)); - } - - itemBlockMapping.put(ItemID.FLINT_AND_TINDER, new BaseBlock(BlockID.FIRE, -1)); - itemBlockMapping.put(ItemID.STRING, new BaseBlock(BlockID.TRIPWIRE, -1)); - itemBlockMapping.put(ItemID.SEEDS, new BaseBlock(BlockID.CROPS, -1)); - itemBlockMapping.put(ItemID.SIGN, new BaseBlock(BlockID.SIGN_POST, -1)); - itemBlockMapping.put(ItemID.WOODEN_DOOR_ITEM, new BaseBlock(BlockID.WOODEN_DOOR, -1)); - itemBlockMapping.put(ItemID.WATER_BUCKET, new BaseBlock(BlockID.STATIONARY_WATER, -1)); - itemBlockMapping.put(ItemID.LAVA_BUCKET, new BaseBlock(BlockID.STATIONARY_LAVA, -1)); - itemBlockMapping.put(ItemID.IRON_DOOR_ITEM, new BaseBlock(BlockID.IRON_DOOR, -1)); - itemBlockMapping.put(ItemID.REDSTONE_DUST, new BaseBlock(BlockID.REDSTONE_WIRE, -1)); - itemBlockMapping.put(ItemID.SUGAR_CANE_ITEM, new BaseBlock(BlockID.REED, -1)); - itemBlockMapping.put(ItemID.BED_ITEM, new BaseBlock(BlockID.BED, -1)); - itemBlockMapping.put(ItemID.REDSTONE_REPEATER, new BaseBlock(BlockID.REDSTONE_REPEATER_OFF, -1)); - itemBlockMapping.put(ItemID.PUMPKIN_SEEDS, new BaseBlock(BlockID.PUMPKIN_STEM, -1)); - itemBlockMapping.put(ItemID.MELON_SEEDS, new BaseBlock(BlockID.MELON_STEM, -1)); - itemBlockMapping.put(ItemID.NETHER_WART_SEED, new BaseBlock(BlockID.NETHER_WART, -1)); - itemBlockMapping.put(ItemID.BREWING_STAND, new BaseBlock(BlockID.BREWING_STAND, -1)); - itemBlockMapping.put(ItemID.CAULDRON, new BaseBlock(BlockID.CAULDRON, -1)); - itemBlockMapping.put(ItemID.FLOWER_POT, new BaseBlock(BlockID.FLOWER_POT, -1)); - itemBlockMapping.put(ItemID.CARROT, new BaseBlock(BlockID.CARROTS, -1)); - itemBlockMapping.put(ItemID.POTATO, new BaseBlock(BlockID.POTATOES, -1)); - itemBlockMapping.put(ItemID.COMPARATOR, new BaseBlock(BlockID.COMPARATOR_OFF, -1)); - itemBlockMapping.put(ItemID.BANNER, new BaseBlock(BlockID.STANDING_BANNER, -1)); - itemBlockMapping.put(ItemID.SPRUCE_DOOR, new BaseBlock(BlockID.SPRUCE_DOOR, -1)); - itemBlockMapping.put(ItemID.BIRCH_DOOR, new BaseBlock(BlockID.BIRCH_DOOR, -1)); - itemBlockMapping.put(ItemID.JUNGLE_DOOR, new BaseBlock(BlockID.JUNGLE_DOOR, -1)); - itemBlockMapping.put(ItemID.ACACIA_DOOR, new BaseBlock(BlockID.ACACIA_DOOR, -1)); - itemBlockMapping.put(ItemID.DARK_OAK_DOOR, new BaseBlock(BlockID.DARK_OAK_DOOR, -1)); - } - - /** - * Get the equivalent block for an item. - * - * @param typeId the type ID of the block - * @param data the data valuie of the block - * @return a block or null - */ - @Nullable - public static BaseBlock getBlockForItem(int typeId, int data) { - final BaseBlock block = itemBlockMapping.get(typeId); - - if (block != null) { - return block; - } - - return dataItemBlockMapping.get(typeDataKey(typeId, data)); - } - - /** - * Get block numeric ID. - * - * @return the block ID - */ - public int getID() { - return id; - } - - /** - * Get user-friendly block name. - * - * @return the block name - */ - public String getName() { - return name; - } - + ; /** * HashSet for shouldPlaceLast. @@ -539,16 +111,6 @@ public enum BlockType { return shouldPlaceLast.contains(id); } - /** - * Checks to see whether this block should be placed last (when reordering - * blocks that are placed) - * - * @return true if the block should be placed last - */ - public boolean shouldPlaceLast() { - return shouldPlaceLast.contains(id); - } - /** * HashSet for shouldPlaceLast. */ @@ -584,108 +146,6 @@ public enum BlockType { return shouldPlaceFinal.contains(id); } - /** - * HashSet for canPassThrough. - */ - private static final Set canPassThrough = new HashSet<>(); - static { - canPassThrough.add(BlockID.AIR); - canPassThrough.add(BlockID.WATER); - canPassThrough.add(BlockID.STATIONARY_WATER); - canPassThrough.add(BlockID.SAPLING); - canPassThrough.add(BlockID.POWERED_RAIL); - canPassThrough.add(BlockID.DETECTOR_RAIL); - canPassThrough.add(BlockID.WEB); - canPassThrough.add(BlockID.LONG_GRASS); - canPassThrough.add(BlockID.DEAD_BUSH); - canPassThrough.add(BlockID.YELLOW_FLOWER); - canPassThrough.add(BlockID.RED_FLOWER); - canPassThrough.add(BlockID.BROWN_MUSHROOM); - canPassThrough.add(BlockID.RED_MUSHROOM); - canPassThrough.add(BlockID.TORCH); - canPassThrough.add(BlockID.FIRE); - canPassThrough.add(BlockID.REDSTONE_WIRE); - canPassThrough.add(BlockID.CROPS); - canPassThrough.add(BlockID.SIGN_POST); - canPassThrough.add(BlockID.LADDER); - canPassThrough.add(BlockID.MINECART_TRACKS); - canPassThrough.add(BlockID.WALL_SIGN); - canPassThrough.add(BlockID.LEVER); - canPassThrough.add(BlockID.STONE_PRESSURE_PLATE); - canPassThrough.add(BlockID.WOODEN_PRESSURE_PLATE); - canPassThrough.add(BlockID.REDSTONE_TORCH_OFF); - canPassThrough.add(BlockID.REDSTONE_TORCH_ON); - canPassThrough.add(BlockID.STONE_BUTTON); - canPassThrough.add(-16*BlockID.SNOW-0); - canPassThrough.add(-16*BlockID.SNOW-8); - canPassThrough.add(BlockID.REED); - canPassThrough.add(BlockID.PORTAL); - canPassThrough.add(BlockID.REDSTONE_REPEATER_OFF); - canPassThrough.add(BlockID.REDSTONE_REPEATER_ON); - canPassThrough.add(BlockID.PUMPKIN_STEM); - canPassThrough.add(BlockID.MELON_STEM); - canPassThrough.add(BlockID.VINE); - canPassThrough.add(BlockID.NETHER_WART); - canPassThrough.add(BlockID.END_PORTAL); - canPassThrough.add(BlockID.TRIPWIRE_HOOK); - canPassThrough.add(BlockID.TRIPWIRE); - canPassThrough.add(BlockID.CARROTS); - canPassThrough.add(BlockID.POTATOES); - canPassThrough.add(BlockID.WOODEN_BUTTON); - canPassThrough.add(BlockID.PRESSURE_PLATE_LIGHT); - canPassThrough.add(BlockID.PRESSURE_PLATE_HEAVY); - canPassThrough.add(BlockID.COMPARATOR_OFF); - canPassThrough.add(BlockID.COMPARATOR_ON); - canPassThrough.add(BlockID.ACTIVATOR_RAIL); - canPassThrough.add(BlockID.IRON_TRAP_DOOR); - canPassThrough.add(BlockID.CARPET); - canPassThrough.add(BlockID.DOUBLE_PLANT); - canPassThrough.add(BlockID.STANDING_BANNER); - canPassThrough.add(BlockID.WALL_BANNER); - } - - - /** - * Checks whether a block can be passed through. - * - * @param id the ID of the block - * @return true if the block can be passed through - */ - public static boolean canPassThrough(int id) { - return canPassThrough.contains(id); - } - - /** - * Checks whether a block can be passed through. - * - * @param id the ID of the block - * @param data the data value of the block - * @return true if the block can be passed through - */ - public static boolean canPassThrough(int id, int data) { - return canPassThrough.contains(-16*id-data) || canPassThrough.contains(id); - } - - /** - * Checks whether a block can be passed through. - * - * @param block the block - * @return true if the block can be passed through - */ - public static boolean canPassThrough(BlockStateHolder block) { - checkNotNull(block); - return canPassThrough(block.getBlockType().getLegacyId()); - } - - /** - * Checks whether the block type can be passed through. - * - * @return whether the block can be passed through - */ - public boolean canPassThrough() { - return canPassThrough.contains(id); - } - /** * HashSet for centralTopLimit. */ @@ -761,7 +221,7 @@ public enum BlockType { if (centralTopLimit.containsKey(id)) return centralTopLimit.get(id); - return canPassThrough(id) ? 0 : 1; + return 1; } /** @@ -775,163 +235,6 @@ public enum BlockType { return centralTopLimit(block.getBlockType().getLegacyId(), 0); } - /** - * Returns the y offset a player falls to when falling onto the top of a block at xp+0.5/zp+0.5. - * - * @return the y offset - */ - public double centralTopLimit() { - if (centralTopLimit.containsKey(id)) - return centralTopLimit.get(id); - - return canPassThrough(id) ? 0 : 1; - } - - /** - * HashSet for usesData. - */ - private static final Set usesData = new HashSet<>(); - static { - usesData.add(BlockID.STONE); - usesData.add(BlockID.DIRT); - usesData.add(BlockID.WOOD); - usesData.add(BlockID.SAPLING); - usesData.add(BlockID.WATER); - usesData.add(BlockID.STATIONARY_WATER); - usesData.add(BlockID.LAVA); - usesData.add(BlockID.STATIONARY_LAVA); - usesData.add(BlockID.SAND); - usesData.add(BlockID.LOG); - usesData.add(BlockID.LOG2); - usesData.add(BlockID.LEAVES); - usesData.add(BlockID.LEAVES2); - usesData.add(BlockID.SPONGE); - usesData.add(BlockID.DISPENSER); - usesData.add(BlockID.SANDSTONE); - usesData.add(BlockID.BED); - usesData.add(BlockID.POWERED_RAIL); - usesData.add(BlockID.DETECTOR_RAIL); - usesData.add(BlockID.PISTON_STICKY_BASE); - usesData.add(BlockID.LONG_GRASS); - usesData.add(BlockID.PISTON_BASE); - usesData.add(BlockID.PISTON_EXTENSION); - usesData.add(BlockID.CLOTH); - usesData.add(BlockID.RED_FLOWER); - usesData.add(BlockID.DOUBLE_STEP); - usesData.add(BlockID.STEP); - usesData.add(BlockID.TORCH); - usesData.add(BlockID.FIRE); - usesData.add(BlockID.OAK_WOOD_STAIRS); - usesData.add(BlockID.CHEST); - usesData.add(BlockID.REDSTONE_WIRE); - usesData.add(BlockID.CROPS); - usesData.add(BlockID.SOIL); - usesData.add(BlockID.FURNACE); - usesData.add(BlockID.BURNING_FURNACE); - usesData.add(BlockID.SIGN_POST); - usesData.add(BlockID.WOODEN_DOOR); - usesData.add(BlockID.LADDER); - usesData.add(BlockID.MINECART_TRACKS); - usesData.add(BlockID.COBBLESTONE_STAIRS); - usesData.add(BlockID.WALL_SIGN); - usesData.add(BlockID.LEVER); - usesData.add(BlockID.STONE_PRESSURE_PLATE); - usesData.add(BlockID.IRON_DOOR); - usesData.add(BlockID.WOODEN_PRESSURE_PLATE); - usesData.add(BlockID.REDSTONE_TORCH_OFF); - usesData.add(BlockID.REDSTONE_TORCH_ON); - usesData.add(BlockID.STONE_BUTTON); - usesData.add(BlockID.SNOW); - usesData.add(BlockID.CACTUS); - usesData.add(BlockID.REED); - usesData.add(BlockID.JUKEBOX); - usesData.add(BlockID.PUMPKIN); - usesData.add(BlockID.JACKOLANTERN); - usesData.add(BlockID.CAKE_BLOCK); - usesData.add(BlockID.REDSTONE_REPEATER_OFF); - usesData.add(BlockID.REDSTONE_REPEATER_ON); - usesData.add(BlockID.TRAP_DOOR); - usesData.add(BlockID.SILVERFISH_BLOCK); - usesData.add(BlockID.STONE_BRICK); - usesData.add(BlockID.RED_MUSHROOM_CAP); - usesData.add(BlockID.BROWN_MUSHROOM_CAP); - usesData.add(BlockID.PUMPKIN_STEM); - usesData.add(BlockID.MELON_STEM); - usesData.add(BlockID.VINE); - usesData.add(BlockID.FENCE_GATE); - usesData.add(BlockID.BRICK_STAIRS); - usesData.add(BlockID.STONE_BRICK_STAIRS); - usesData.add(BlockID.NETHER_BRICK_STAIRS); - usesData.add(BlockID.NETHER_WART); - usesData.add(BlockID.BREWING_STAND); - usesData.add(BlockID.CAULDRON); - usesData.add(BlockID.END_PORTAL_FRAME); - usesData.add(BlockID.DOUBLE_WOODEN_STEP); - usesData.add(BlockID.WOODEN_STEP); - usesData.add(BlockID.COCOA_PLANT); - usesData.add(BlockID.SANDSTONE_STAIRS); - usesData.add(BlockID.ENDER_CHEST); - usesData.add(BlockID.TRIPWIRE_HOOK); - usesData.add(BlockID.TRIPWIRE); - usesData.add(BlockID.SPRUCE_WOOD_STAIRS); - usesData.add(BlockID.BIRCH_WOOD_STAIRS); - usesData.add(BlockID.JUNGLE_WOOD_STAIRS); - usesData.add(BlockID.COBBLESTONE_WALL); - usesData.add(BlockID.FLOWER_POT); - usesData.add(BlockID.CARROTS); - usesData.add(BlockID.POTATOES); - usesData.add(BlockID.WOODEN_BUTTON); - usesData.add(BlockID.HEAD); - usesData.add(BlockID.ANVIL); - usesData.add(BlockID.PRESSURE_PLATE_LIGHT); - usesData.add(BlockID.PRESSURE_PLATE_HEAVY); - usesData.add(BlockID.COMPARATOR_OFF); - usesData.add(BlockID.COMPARATOR_ON); - usesData.add(BlockID.QUARTZ_BLOCK); - usesData.add(BlockID.QUARTZ_STAIRS); - usesData.add(BlockID.ACTIVATOR_RAIL); - usesData.add(BlockID.DROPPER); - usesData.add(BlockID.HOPPER); - usesData.add(BlockID.STAINED_CLAY); - usesData.add(BlockID.STAINED_GLASS); - usesData.add(BlockID.STAINED_GLASS_PANE); - usesData.add(BlockID.IRON_TRAP_DOOR); - usesData.add(BlockID.PRISMARINE); - usesData.add(BlockID.HAY_BLOCK); - usesData.add(BlockID.CARPET); - usesData.add(BlockID.DOUBLE_PLANT); - usesData.add(BlockID.STANDING_BANNER); - usesData.add(BlockID.WALL_BANNER); - usesData.add(BlockID.RED_SANDSTONE); - usesData.add(BlockID.RED_SANDSTONE_STAIRS); - usesData.add(BlockID.DOUBLE_STEP2); - usesData.add(BlockID.STEP2); - usesData.add(BlockID.SPRUCE_DOOR); - usesData.add(BlockID.BIRCH_DOOR); - usesData.add(BlockID.JUNGLE_DOOR); - usesData.add(BlockID.ACACIA_DOOR); - usesData.add(BlockID.DARK_OAK_DOOR); - } - - /** - * Returns true if the block uses its data value. - * - * @param id the type ID - * @return true if the block type uses its data value - */ - public static boolean usesData(int id) { - return usesData.contains(id); - } - - /** - * Returns true if the block uses its data value. - * - * @return true if this block type uses its data value - */ - public boolean usesData() { - return usesData.contains(id); - } - /** * HashSet for isContainerBlock. */ @@ -958,185 +261,6 @@ public enum BlockType { return isContainerBlock.contains(id); } - /** - * Returns true if the block is a container block. - * - * @return true if the block is a container block - */ - public boolean isContainerBlock() { - return isContainerBlock.contains(id); - } - - /** - * HashSet for isRedstoneBlock. - */ - private static final Set isRedstoneBlock = new HashSet<>(); - static { - isRedstoneBlock.add(BlockID.POWERED_RAIL); - isRedstoneBlock.add(BlockID.DETECTOR_RAIL); - isRedstoneBlock.add(BlockID.PISTON_STICKY_BASE); - isRedstoneBlock.add(BlockID.PISTON_BASE); - isRedstoneBlock.add(BlockID.LEVER); - isRedstoneBlock.add(BlockID.STONE_PRESSURE_PLATE); - isRedstoneBlock.add(BlockID.WOODEN_PRESSURE_PLATE); - isRedstoneBlock.add(BlockID.REDSTONE_TORCH_OFF); - isRedstoneBlock.add(BlockID.REDSTONE_TORCH_ON); - isRedstoneBlock.add(BlockID.STONE_BUTTON); - isRedstoneBlock.add(BlockID.REDSTONE_WIRE); - isRedstoneBlock.add(BlockID.WOODEN_DOOR); - isRedstoneBlock.add(BlockID.ACACIA_DOOR); - isRedstoneBlock.add(BlockID.BIRCH_DOOR); - isRedstoneBlock.add(BlockID.JUNGLE_DOOR); - isRedstoneBlock.add(BlockID.DARK_OAK_DOOR); - isRedstoneBlock.add(BlockID.SPRUCE_DOOR); - isRedstoneBlock.add(BlockID.IRON_DOOR); - isRedstoneBlock.add(BlockID.TNT); - isRedstoneBlock.add(BlockID.DISPENSER); - isRedstoneBlock.add(BlockID.NOTE_BLOCK); - isRedstoneBlock.add(BlockID.REDSTONE_REPEATER_OFF); - isRedstoneBlock.add(BlockID.REDSTONE_REPEATER_ON); - isRedstoneBlock.add(BlockID.TRIPWIRE_HOOK); - isRedstoneBlock.add(BlockID.COMMAND_BLOCK); - isRedstoneBlock.add(BlockID.WOODEN_BUTTON); - isRedstoneBlock.add(BlockID.TRAPPED_CHEST); - isRedstoneBlock.add(BlockID.PRESSURE_PLATE_LIGHT); - isRedstoneBlock.add(BlockID.PRESSURE_PLATE_HEAVY); - isRedstoneBlock.add(BlockID.COMPARATOR_OFF); - isRedstoneBlock.add(BlockID.COMPARATOR_ON); - isRedstoneBlock.add(BlockID.DAYLIGHT_SENSOR); - isRedstoneBlock.add(BlockID.REDSTONE_BLOCK); - isRedstoneBlock.add(BlockID.HOPPER); - isRedstoneBlock.add(BlockID.ACTIVATOR_RAIL); - isRedstoneBlock.add(BlockID.DROPPER); - isRedstoneBlock.add(BlockID.DAYLIGHT_SENSOR_INVERTED); - } - - /** - * Returns true if a block uses Redstone in some way. - * - * @param id the type ID of the block - * @return true if the block uses Redstone - */ - public static boolean isRedstoneBlock(int id) { - return isRedstoneBlock.contains(id); - } - - /** - * Returns true if a block uses Redstone in some way. - * - * @return true if the block uses Redstone - */ - public boolean isRedstoneBlock() { - return isRedstoneBlock.contains(id); - } - - /** - * HashSet for canTransferRedstone. - */ - private static final Set canTransferRedstone = new HashSet<>(); - static { - canTransferRedstone.add(BlockID.REDSTONE_TORCH_OFF); - canTransferRedstone.add(BlockID.REDSTONE_TORCH_ON); - canTransferRedstone.add(BlockID.REDSTONE_WIRE); - canTransferRedstone.add(BlockID.REDSTONE_REPEATER_OFF); - canTransferRedstone.add(BlockID.REDSTONE_REPEATER_ON); - canTransferRedstone.add(BlockID.COMPARATOR_OFF); - canTransferRedstone.add(BlockID.COMPARATOR_ON); - } - - /** - * Returns true if a block can transfer Redstone. - * - *

This was made since {@link #isRedstoneBlock} was getting big.

- * - * @param id the type ID of the block - * @return true if the block can transfer redstone - */ - public static boolean canTransferRedstone(int id) { - return canTransferRedstone.contains(id); - } - - /** - * Returns true if a block can transfer Redstone. - * - *

This was made since {@link #isRedstoneBlock} was getting big.

- * - * @return true if the block can transfer redstone - */ - public boolean canTransferRedstone() { - return canTransferRedstone.contains(id); - } - - /** - * HashSet for isRedstoneSource. - */ - private static final Set isRedstoneSource = new HashSet<>(); - static { - isRedstoneSource.add(BlockID.DETECTOR_RAIL); - isRedstoneSource.add(BlockID.REDSTONE_TORCH_OFF); - isRedstoneSource.add(BlockID.REDSTONE_TORCH_ON); - isRedstoneSource.add(BlockID.LEVER); - isRedstoneSource.add(BlockID.STONE_PRESSURE_PLATE); - isRedstoneSource.add(BlockID.WOODEN_PRESSURE_PLATE); - isRedstoneSource.add(BlockID.STONE_BUTTON); - isRedstoneSource.add(BlockID.TRIPWIRE_HOOK); - isRedstoneSource.add(BlockID.WOODEN_BUTTON); - isRedstoneSource.add(BlockID.PRESSURE_PLATE_LIGHT); - isRedstoneSource.add(BlockID.PRESSURE_PLATE_HEAVY); - isRedstoneSource.add(BlockID.DAYLIGHT_SENSOR); - isRedstoneSource.add(BlockID.REDSTONE_BLOCK); - isRedstoneSource.add(BlockID.DAYLIGHT_SENSOR_INVERTED); - } - - /** - * Returns whether the block is a Redstone source. - * - * @param id the type ID of the block - * @return true if the block is a Redstone source - */ - public static boolean isRedstoneSource(int id) { - return isRedstoneSource.contains(id); - } - - /** - * Returns whether the block is a Redstone source. - * - * @return true if the block is a Redstone source - */ - public boolean isRedstoneSource() { - return isRedstoneSource.contains(id); - } - - /** - * HashSet for isRailBlock. - */ - private static final Set isRailBlock = new HashSet<>(); - static { - isRailBlock.add(BlockID.POWERED_RAIL); - isRailBlock.add(BlockID.DETECTOR_RAIL); - isRailBlock.add(BlockID.MINECART_TRACKS); - isRailBlock.add(BlockID.ACTIVATOR_RAIL); - } - - /** - * Checks if the block is that of one of the rail types. - * - * @param id the type ID of the block - * @return true if the block is a rail block - */ - public static boolean isRailBlock(int id) { - return isRailBlock.contains(id); - } - - /** - * Checks if the block is that of one of the rail types - * - * @return true if the block is a rail block - */ - public boolean isRailBlock() { - return isRailBlock.contains(id); - } - /** * HashSet for isNaturalBlock. */ @@ -1194,44 +318,6 @@ public enum BlockType { return isNaturalTerrainBlock.contains(-16*id-data) || isNaturalTerrainBlock.contains(id); } - /** - * HashSet for emitsLight. - */ - private static final Set emitsLight = new HashSet<>(); - static { - emitsLight.add(BlockID.LAVA); - emitsLight.add(BlockID.STATIONARY_LAVA); - emitsLight.add(BlockID.BROWN_MUSHROOM); - emitsLight.add(BlockID.RED_MUSHROOM); - emitsLight.add(BlockID.TORCH); - emitsLight.add(BlockID.FIRE); - emitsLight.add(BlockID.BURNING_FURNACE); - emitsLight.add(BlockID.GLOWING_REDSTONE_ORE); - emitsLight.add(BlockID.REDSTONE_TORCH_ON); - emitsLight.add(BlockID.LIGHTSTONE); - emitsLight.add(BlockID.PORTAL); - emitsLight.add(BlockID.JACKOLANTERN); - emitsLight.add(BlockID.REDSTONE_REPEATER_ON); - emitsLight.add(BlockID.BROWN_MUSHROOM_CAP); - emitsLight.add(BlockID.RED_MUSHROOM_CAP); - emitsLight.add(BlockID.END_PORTAL); - emitsLight.add(BlockID.REDSTONE_LAMP_ON); - emitsLight.add(BlockID.ENDER_CHEST); - emitsLight.add(BlockID.BEACON); - emitsLight.add(BlockID.REDSTONE_BLOCK); - emitsLight.add(BlockID.SEA_LANTERN); - } - - /** - * Checks if the block type emits light. - * - * @param id the type ID of the block - * @return true if the block emits light - */ - public static boolean emitsLight(int id) { - return emitsLight.contains(id); - } - /** * HashSet for isTranslucent. */ @@ -1616,16 +702,6 @@ public enum BlockType { } } - /** - * Get the block drop for this type given a data value. - * - * @param data the data value - * @return the item stack - */ - public BaseItemStack getBlockDrop(short data) { - return getBlockDrop(id, data); - } - private static final Random random = new Random(); /** @@ -1844,11 +920,7 @@ public enum BlockType { return null; } - if (usesData(id)) { - return new BaseItemStack(id, 1, data); - } else { - return new BaseItemStack(id); - } + return new BaseItemStack(id); } private static final Map dataAttachments = new HashMap<>(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java index 7944ab876..92ccdd370 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java @@ -27,218 +27,35 @@ package com.sk89q.worldedit.blocks; @Deprecated public final class ItemID { - public static final int IRON_SHOVEL = 256; - public static final int IRON_PICK = 257; - public static final int IRON_AXE = 258; - public static final int FLINT_AND_TINDER = 259; - public static final int RED_APPLE = 260; - public static final int BOW = 261; - public static final int ARROW = 262; public static final int COAL = 263; public static final int DIAMOND = 264; - public static final int IRON_BAR = 265; - public static final int GOLD_BAR = 266; - public static final int IRON_SWORD = 267; - public static final int WOOD_SWORD = 268; - public static final int WOOD_SHOVEL = 269; - public static final int WOOD_PICKAXE = 270; - public static final int WOOD_AXE = 271; - public static final int STONE_SWORD = 272; - public static final int STONE_SHOVEL = 273; - public static final int STONE_PICKAXE = 274; - public static final int STONE_AXE = 275; - public static final int DIAMOND_SWORD = 276; - public static final int DIAMOND_SHOVEL = 277; - public static final int DIAMOND_PICKAXE = 278; - public static final int DIAMOND_AXE = 279; - public static final int STICK = 280; - public static final int BOWL = 281; - public static final int MUSHROOM_SOUP = 282; - public static final int GOLD_SWORD = 283; - public static final int GOLD_SHOVEL = 284; - public static final int GOLD_PICKAXE = 285; - public static final int GOLD_AXE = 286; public static final int STRING = 287; - public static final int FEATHER = 288; - public static final int SULPHUR = 289; - public static final int WOOD_HOE = 290; - public static final int STONE_HOE = 291; - public static final int IRON_HOE = 292; - public static final int DIAMOND_HOE = 293; - public static final int GOLD_HOE = 294; public static final int SEEDS = 295; public static final int WHEAT = 296; - public static final int BREAD = 297; - public static final int LEATHER_HELMET = 298; - public static final int LEATHER_CHEST = 299; - public static final int LEATHER_PANTS = 300; - public static final int LEATHER_BOOTS = 301; - public static final int CHAINMAIL_HELMET = 302; - public static final int CHAINMAIL_CHEST = 303; - public static final int CHAINMAIL_PANTS = 304; - public static final int CHAINMAIL_BOOTS = 305; - public static final int IRON_HELMET = 306; - public static final int IRON_CHEST = 307; - public static final int IRON_PANTS = 308; - public static final int IRON_BOOTS = 309; - public static final int DIAMOND_HELMET = 310; - public static final int DIAMOND_CHEST = 311; - public static final int DIAMOND_PANTS = 312; - public static final int DIAMOND_BOOTS = 313; - public static final int GOLD_HELMET = 314; - public static final int GOLD_CHEST = 315; - public static final int GOLD_PANTS = 316; - public static final int GOLD_BOOTS = 317; public static final int FLINT = 318; - public static final int RAW_PORKCHOP = 319; - public static final int COOKED_PORKCHOP = 320; - public static final int PAINTING = 321; - public static final int GOLD_APPLE = 322; public static final int SIGN = 323; public static final int WOODEN_DOOR_ITEM = 324; - public static final int BUCKET = 325; - public static final int WATER_BUCKET = 326; - public static final int LAVA_BUCKET = 327; - public static final int MINECART = 328; - public static final int SADDLE = 329; public static final int IRON_DOOR_ITEM = 330; public static final int REDSTONE_DUST = 331; - public static final int SNOWBALL = 332; - public static final int WOOD_BOAT = 333; - public static final int LEATHER = 334; - public static final int MILK_BUCKET = 335; - public static final int BRICK_BAR = 336; public static final int CLAY_BALL = 337; public static final int SUGAR_CANE_ITEM = 338; - public static final int PAPER = 339; - public static final int BOOK = 340; - public static final int SLIME_BALL = 341; - public static final int STORAGE_MINECART = 342; - public static final int POWERED_MINECART = 343; - public static final int EGG = 344; - public static final int COMPASS = 345; - public static final int FISHING_ROD = 346; - public static final int WATCH = 347; public static final int LIGHTSTONE_DUST = 348; - public static final int RAW_FISH = 349; - public static final int COOKED_FISH = 350; public static final int INK_SACK = 351; - public static final int BONE = 352; - public static final int SUGAR = 353; public static final int CAKE_ITEM = 354; public static final int BED_ITEM = 355; public static final int REDSTONE_REPEATER = 356; - public static final int COOKIE = 357; - public static final int MAP = 358; - public static final int SHEARS = 359; public static final int MELON = 360; public static final int PUMPKIN_SEEDS = 361; public static final int MELON_SEEDS = 362; - public static final int RAW_BEEF = 363; - public static final int COOKED_BEEF = 364; - public static final int RAW_CHICKEN = 365; - public static final int COOKED_CHICKEN = 366; - public static final int ROTTEN_FLESH = 367; - public static final int ENDER_PEARL = 368; - public static final int BLAZE_ROD = 369; - public static final int GHAST_TEAR = 370; - public static final int GOLD_NUGGET = 371; public static final int NETHER_WART_SEED = 372; - public static final int POTION = 373; - public static final int GLASS_BOTTLE = 374; - public static final int SPIDER_EYE = 375; - public static final int FERMENTED_SPIDER_EYE = 376; - public static final int BLAZE_POWDER = 377; - public static final int MAGMA_CREAM = 378; public static final int BREWING_STAND = 379; public static final int CAULDRON = 380; - public static final int EYE_OF_ENDER = 381; - public static final int GLISTERING_MELON = 382; - public static final int SPAWN_EGG = 383; - public static final int BOTTLE_O_ENCHANTING = 384; - public static final int FIRE_CHARGE = 385; - public static final int BOOK_AND_QUILL = 386; - public static final int WRITTEN_BOOK = 387; public static final int EMERALD = 388; - public static final int ITEM_FRAME = 389; public static final int FLOWER_POT = 390; public static final int CARROT = 391; public static final int POTATO = 392; - public static final int BAKED_POTATO = 393; - public static final int POISONOUS_POTATO = 394; - public static final int BLANK_MAP = 395; - public static final int GOLDEN_CARROT = 396; - public static final int HEAD = 397; - public static final int CARROT_ON_A_STICK = 398; - public static final int NETHER_STAR = 399; - public static final int PUMPKIN_PIE = 400; - public static final int FIREWORK_ROCKET = 401; - public static final int FIREWORK_STAR = 402; - public static final int ENCHANTED_BOOK = 403; public static final int COMPARATOR = 404; - public static final int NETHER_BRICK = 405; public static final int NETHER_QUARTZ = 406; - public static final int TNT_MINECART = 407; - public static final int HOPPER_MINECART = 408; - public static final int PRISMARINE_SHARD = 409; - public static final int PRISMARINE_CRYSTALS = 410; - public static final int RABBIT = 411; - public static final int COOKED_RABBIT = 412; - public static final int RABBIT_STEW = 413; - public static final int RABBIT_FOOT = 414; - public static final int RABBIT_HIDE = 415; - public static final int ARMOR_STAND = 416; - public static final int HORSE_ARMOR_IRON = 417; - public static final int HORSE_ARMOR_GOLD = 418; - public static final int HORSE_ARMOR_DIAMOND = 419; - public static final int LEAD = 420; - public static final int NAME_TAG = 421; - public static final int COMMAND_BLOCK_MINECART = 422; - public static final int MUTTON = 423; - public static final int COOKED_MUTTON = 424; - public static final int BANNER = 425; - public static final int END_CRYSTAL = 426; - public static final int SPRUCE_DOOR = 427; - public static final int BIRCH_DOOR = 428; - public static final int JUNGLE_DOOR = 429; - public static final int ACACIA_DOOR = 430; - public static final int DARK_OAK_DOOR = 431; - public static final int CHORUS_FRUIT = 432; - public static final int CHORUS_FRUIT_POPPED = 433; - public static final int BEETROOT = 434; - public static final int BEETROOT_SEEDS = 435; - public static final int BEETROOT_SOUP = 436; - public static final int DRAGON_BREATH = 437; - public static final int SPLASH_POTION = 438; - public static final int SPECTRAL_ARROW = 439; - public static final int TIPPED_ARROW = 440; - public static final int LINGERING_POTION = 441; - public static final int SHIELD = 442; - public static final int ELYTRA = 443; - public static final int SPRUCE_BOAT = 444; - public static final int BIRCH_BOAT = 445; - public static final int JUNGLE_BOAT = 446; - public static final int ACACIA_BOAT = 447; - public static final int DARK_OAK_BOAT = 448; - public static final int TOTEM_OF_UNDYING = 449; - public static final int SHULKER_SHELL = 450; - public static final int IRON_NUGGET = 452; - public static final int KNOWLEDGE_BOOK = 453; - - @Deprecated public static final int GOLD_RECORD = 2256; // deprecated, but leave it there - @Deprecated public static final int GREEN_RECORD = 2257; // deprecated, but leave it there - public static final int DISC_13 = 2256; - public static final int DISC_CAT = 2257; - public static final int DISC_BLOCKS = 2258; - public static final int DISC_CHIRP = 2259; - public static final int DISC_FAR = 2260; - public static final int DISC_MALL = 2261; - public static final int DISC_MELLOHI = 2262; - public static final int DISC_STAL = 2263; - public static final int DISC_STRAD = 2264; - public static final int DISC_WARD = 2265; - public static final int DISC_11 = 2266; - public static final int DISC_WAIT = 2267; private ItemID() { } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java index 98b2c4fdd..11660c745 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java @@ -19,11 +19,16 @@ package com.sk89q.worldedit.blocks.type; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.blocks.BlockMaterial; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.LegacyMapper; import java.util.function.Function; +import javax.annotation.Nullable; + public class BlockType { private String id; @@ -77,6 +82,34 @@ public class BlockType { return this.defaultState; } + /** + * Gets whether this block type has an item representation. + * + * @return If it has an item + */ + public boolean hasItemType() { + return getItemType() != null; + } + + /** + * Gets the item representation of this block type, if it exists. + * + * @return The item representation + */ + @Nullable + public ItemType getItemType() { + return ItemTypes.getItemType(this.id); + } + + /** + * Get the material for this BlockType. + * + * @return The material + */ + public BlockMaterial getMaterial() { + return WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this.id); + } + /** * Gets the legacy ID. Needed for legacy reasons. * @@ -94,11 +127,6 @@ public class BlockType { } } - @Deprecated - public com.sk89q.worldedit.blocks.BlockType getLegacyType() { - return com.sk89q.worldedit.blocks.BlockType.fromID(getLegacyId()); - } - @Override public int hashCode() { return this.id.hashCode(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java index c3c6659f0..68a7a59c0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java @@ -22,6 +22,8 @@ package com.sk89q.worldedit.blocks.type; import com.sk89q.worldedit.world.registry.BundledItemData; import com.sk89q.worldedit.world.registry.LegacyMapper; +import javax.annotation.Nullable; + public class ItemType { private String id; @@ -52,6 +54,26 @@ public class ItemType { } } + + /** + * Gets whether this item type has a block representation. + * + * @return If it has a block + */ + public boolean hasBlockType() { + return getBlockType() != null; + } + + /** + * Gets the block representation of this item type, if it exists. + * + * @return The block representation + */ + @Nullable + public BlockType getBlockType() { + return BlockTypes.getBlockType(this.id); + } + /** * Gets the legacy ID. Needed for legacy reasons. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java index 7cc2bc6b5..ec16ffab1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java @@ -192,13 +192,13 @@ public class GeneralCommands { break; } -// TODO if (blocksOnly && searchType.getID() > 255) { -// continue; -// } -// -// if (itemsOnly && searchType.getID() <= 255) { -// continue; -// } + if (blocksOnly && !searchType.hasBlockType()) { + continue; + } + + if (itemsOnly && searchType.hasBlockType()) { + continue; + } for (String alias : Sets.newHashSet(searchType.getId(), searchType.getName())) { if (alias.contains(query)) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index 3a0a1b8e9..43eed2d19 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -102,7 +102,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { byte free = 0; while (y <= world.getMinimumPoint().getBlockY() + 2) { - if (BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { + if (!world.getBlock(new Vector(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) { ++free; } else { free = 0; @@ -132,7 +132,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { while (y >= 0) { final Vector pos = new Vector(x, y, z); final BlockState id = world.getBlock(pos); - if (!BlockType.canPassThrough(id.getBlockType().getLegacyId())) { + if (id.getBlockType().getMaterial().isMovementBlocker()) { setPosition(new Vector(x + 0.5, y + BlockType.centralTopLimit(id), z + 0.5)); return; } @@ -158,7 +158,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { byte spots = 0; while (y <= world.getMaximumPoint().getY() + 2) { - if (BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { + if (!world.getBlock(new Vector(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) { ++free; } else { free = 0; @@ -198,7 +198,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { byte free = 0; while (y >= 1) { - if (BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { + if (!world.getBlock(new Vector(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) { ++free; } else { free = 0; @@ -253,7 +253,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { while (y <= world.getMaximumPoint().getY()) { // Found a ceiling! - if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { + if (world.getBlock(new Vector(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) { int platformY = Math.max(initialY, y - 3 - clearance); floatAt(x, platformY + 1, z, alwaysGlass); return true; @@ -281,7 +281,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { final Extent world = getLocation().getExtent(); while (y <= world.getMaximumPoint().getY() + 2) { - if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) { + if (world.getBlock(new Vector(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) { break; // Hit something } else if (y > maxY + 1) { break; @@ -364,7 +364,11 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException { final ItemType typeId = getItemInHand(handSide).getType(); - return new BaseBlock(typeId.getLegacyId()); + if (typeId.hasBlockType()) { + return new BaseBlock(typeId.getBlockType()); + } else { + return new BaseBlock(BlockTypes.AIR); + } } /** @@ -384,7 +388,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { boolean inFree = false; while ((block = hitBlox.getNextBlock()) != null) { - boolean free = BlockType.canPassThrough(world.getBlock(block.toVector())); + boolean free = !world.getBlock(block.toVector()).getBlockType().getMaterial().isMovementBlocker(); if (firstBlock) { firstBlock = false; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java index baf453c22..b9f266512 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.Blocks; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java index bb755a889..016b32cb5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java @@ -19,10 +19,9 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.extent.Extent; import javax.annotation.Nullable; @@ -35,8 +34,8 @@ public class SolidBlockMask extends AbstractExtentMask { @Override public boolean test(Vector vector) { Extent extent = getExtent(); - BaseBlock lazyBlock = extent.getLazyBlock(vector); - return !BlockType.canPassThrough(lazyBlock.getBlockType().getLegacyId(), lazyBlock.getData()); + BlockState block = extent.getBlock(vector); + return block.getBlockType().getMaterial().isMovementBlocker(); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java index f25d9e4d9..8caecc3f2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java @@ -136,7 +136,7 @@ public class TargetBlock { * @return Block */ public Location getSolidTargetBlock() { - while (getNextBlock() != null && BlockType.canPassThrough(world.getBlock(getCurrentBlock().toVector()))) ; + while (getNextBlock() != null && !world.getBlock(getCurrentBlock().toVector()).getBlockType().getMaterial().isMovementBlocker()) ; return getCurrentBlock(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index ed1a88b9d..b4c452051 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -19,15 +19,15 @@ package com.sk89q.worldedit.world.registry; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.world.registry.state.State; -import javax.annotation.Nullable; import java.util.Map; +import javax.annotation.Nullable; + /** * Provides information on blocks and provides methods to create them. */ @@ -45,11 +45,11 @@ public interface BlockRegistry { /** * Get the material for the given block. * - * @param block the block + * @param id the block * @return the material, or null if the material information is not known */ @Nullable - BlockMaterial getMaterial(BaseBlock block); + BlockMaterial getMaterial(String id); /** * Get an unmodifiable map of states for this block. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 518f008e7..13a745075 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -19,16 +19,16 @@ package com.sk89q.worldedit.world.registry; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.world.registry.state.State; -import javax.annotation.Nullable; import java.util.Map; +import javax.annotation.Nullable; + /** * A block registry that uses {@link BundledBlockData} to serve information * about blocks. @@ -43,8 +43,8 @@ public class BundledBlockRegistry implements BlockRegistry { @Nullable @Override - public BlockMaterial getMaterial(BaseBlock block) { - return BundledBlockData.getInstance().getMaterialById(block.getBlockType().getId()); + public BlockMaterial getMaterial(String id) { + return BundledBlockData.getInstance().getMaterialById(id); } @Nullable From 11f5d05e7bbd4e4e1b73b11ede048c8d0a0b6a63 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 1 Jul 2018 23:38:56 +1000 Subject: [PATCH 27/74] Update BlockState to remove legacy ID usage. --- .../bukkit/BukkitPlayerBlockBag.java | 30 ++--- .../java/com/sk89q/worldedit/EditSession.java | 2 +- .../java/com/sk89q/worldedit/WorldEdit.java | 10 +- .../worldedit/extent/ChangeSetExtent.java | 1 - .../worldedit/extent/inventory/BlockBag.java | 126 +++++++----------- .../extent/inventory/BlockBagExtent.java | 31 ++--- .../extent/inventory/OutOfSpaceException.java | 8 +- 7 files changed, 83 insertions(+), 125 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index a939c1ae0..bd544f620 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -19,10 +19,8 @@ package com.sk89q.worldedit.bukkit; -import com.sk89q.worldedit.blocks.BaseItem; -import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.ItemType; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBagException; import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; @@ -64,12 +62,8 @@ public class BukkitPlayerBlockBag extends BlockBag { } @Override - public void fetchItem(BaseItem item) throws BlockBagException { - final ItemType id = item.getType(); - int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; - assert(amount == 1); - - if (id == ItemTypes.AIR) { + public void fetchBlock(BlockState blockState) throws BlockBagException { + if (blockState.getBlockType() == BlockTypes.AIR) { throw new IllegalArgumentException("Can't fetch air block"); } @@ -84,7 +78,7 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (bukkitItem.getTypeId() != id.getLegacyId()) { + if (bukkitItem.getTypeId() != blockState.getBlockType().getLegacyId()) { // TODO Fix when bukkit gets not awful // Type id doesn't fit continue; @@ -113,12 +107,8 @@ public class BukkitPlayerBlockBag extends BlockBag { } @Override - public void storeItem(BaseItem item) throws BlockBagException { - final ItemType id = item.getType(); - int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; - assert(amount <= 64); - - if (id == ItemTypes.AIR) { + public void storeBlock(BlockState blockState, int amount) throws BlockBagException { + if (blockState.getBlockType() == BlockTypes.AIR) { throw new IllegalArgumentException("Can't store air block"); } @@ -139,7 +129,7 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (bukkitItem.getTypeId() != id.getLegacyId()) { + if (bukkitItem.getTypeId() != blockState.getBlockType().getLegacyId()) { // TODO Fix when bukkit gets not terrible // Type id doesn't fit continue; @@ -166,11 +156,11 @@ public class BukkitPlayerBlockBag extends BlockBag { } if (freeSlot > -1) { - items[freeSlot] = new ItemStack(id.getLegacyId(), amount); // TODO Ditto + items[freeSlot] = new ItemStack(blockState.getBlockType().getLegacyId(), amount); // TODO Ditto return; } - throw new OutOfSpaceException(id); + throw new OutOfSpaceException(blockState.getBlockType()); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 99d5a6033..5f733b086 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -375,7 +375,7 @@ public class EditSession implements Extent { * * @return a map of missing blocks */ - public Map popMissingBlocks() { + public Map popMissingBlocks() { return blockBagExtent.popMissing(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 9245a1e45..9e83eeba4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -479,7 +479,7 @@ public class WorldEdit { blockBag.flushChanges(); } - Map missingBlocks = editSession.popMissingBlocks(); + Map missingBlocks = editSession.popMissingBlocks(); if (!missingBlocks.isEmpty()) { StringBuilder str = new StringBuilder(); @@ -487,12 +487,8 @@ public class WorldEdit { int size = missingBlocks.size(); int i = 0; - for (Integer id : missingBlocks.keySet()) { - BlockType type = LegacyMapper.getInstance().getBlockFromLegacy(id).getBlockType(); - - str.append(type != null - ? type.getName() + " (" + id + ")" - : id.toString()); + for (BlockType id : missingBlocks.keySet()) { + str.append(id.getName()); str.append(" [Amt: ").append(missingBlocks.get(id)).append("]"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java index 021644153..639718531 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java index 2eb77c97c..eb2e6a9af 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.extent.inventory; -import com.sk89q.worldedit.blocks.*; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.util.Location; /** @@ -31,123 +31,95 @@ public abstract class BlockBag { /** * Stores a block as if it was mined. * - * @param id the type ID - * @param data the data value + * @param blockState the block state * @throws BlockBagException on error */ - public void storeDroppedBlock(int id, int data) throws BlockBagException { - BaseItem dropped = BlockType.getBlockBagItem(id, data); + public void storeDroppedBlock(BlockState blockState) throws BlockBagException { + BlockState dropped = blockState; // TODO BlockType.getBlockBagItem(id, data); if (dropped == null) return; - if (dropped.getType() == ItemTypes.AIR) return; + if (dropped.getBlockType() == BlockTypes.AIR) return; - storeItem(dropped); + storeBlock(dropped); } /** * Sets a block as if it was placed by hand. * - * @param id the type ID - * @param data the data value + * @param blockState The block state * @throws BlockBagException on error */ - public void fetchPlacedBlock(int id, int data) throws BlockBagException { + public void fetchPlacedBlock(BlockState blockState) throws BlockBagException { try { // Blocks that can't be fetched... - switch (id) { - case BlockID.BEDROCK: - case BlockID.GOLD_ORE: - case BlockID.IRON_ORE: - case BlockID.COAL_ORE: - case BlockID.DIAMOND_ORE: - case BlockID.TNT: - case BlockID.MOB_SPAWNER: - case BlockID.CROPS: - case BlockID.REDSTONE_ORE: - case BlockID.GLOWING_REDSTONE_ORE: - case BlockID.SNOW: - case BlockID.LIGHTSTONE: - case BlockID.PORTAL: - throw new UnplaceableBlockException(); - - case BlockID.WATER: - case BlockID.STATIONARY_WATER: - case BlockID.LAVA: - case BlockID.STATIONARY_LAVA: - // Override liquids - return; - - default: - fetchBlock(id); - break; - } - +// TODO switch (id) { +// case BlockID.BEDROCK: +// case BlockID.GOLD_ORE: +// case BlockID.IRON_ORE: +// case BlockID.COAL_ORE: +// case BlockID.DIAMOND_ORE: +// case BlockID.TNT: +// case BlockID.MOB_SPAWNER: +// case BlockID.CROPS: +// case BlockID.REDSTONE_ORE: +// case BlockID.GLOWING_REDSTONE_ORE: +// case BlockID.SNOW: +// case BlockID.LIGHTSTONE: +// case BlockID.PORTAL: +// throw new UnplaceableBlockException(); +// +// case BlockID.WATER: +// case BlockID.STATIONARY_WATER: +// case BlockID.LAVA: +// case BlockID.STATIONARY_LAVA: +// // Override liquids +// return; +// } + fetchBlock(blockState); } catch (OutOfBlocksException e) { - BaseItem placed = BlockType.getBlockBagItem(id, data); - if (placed == null) throw e; // TODO: check - if (placed.getType() == ItemTypes.AIR) throw e; // TODO: check + BlockState placed = blockState;// TODO BlockType.getBlockBagItem(id, data); + if (placed == null || placed.getBlockType() == BlockTypes.AIR) throw e; // TODO: check - fetchItem(placed); + fetchBlock(placed); } } /** * Get a block. * - *

Either this method or fetchItem needs to be overridden.

- * - * @param id the type ID + * @param blockState the block state * @throws BlockBagException on error */ - public void fetchBlock(int id) throws BlockBagException { - fetchItem(new BaseItem(id)); - } + public abstract void fetchBlock(BlockState blockState) throws BlockBagException; /** - * Get a block. + * Store a block. * - *

Either this method or fetchItem needs to be overridden.

- * - * @param item the item + * @param blockState The block state * @throws BlockBagException on error */ - public void fetchItem(BaseItem item) throws BlockBagException { - fetchBlock(item.getLegacyId()); + public void storeBlock(BlockState blockState) throws BlockBagException { + this.storeBlock(blockState, 1); } /** * Store a block. * - *

Either this method or fetchItem needs to be overridden.

- * - * @param id the type ID + * @param blockState The block state + * @param amount The amount * @throws BlockBagException on error */ - public void storeBlock(int id) throws BlockBagException { - storeItem(new BaseItem(id)); - } - - /** - * Store a block. - * - *

Either this method or fetchItem needs to be overridden.

- * - * @param item the item - * @throws BlockBagException on error - */ - public void storeItem(BaseItem item) throws BlockBagException { - storeBlock(item.getLegacyId()); - } + public abstract void storeBlock(BlockState blockState, int amount) throws BlockBagException; /** * Checks to see if a block exists without removing it. * - * @param id the type ID + * @param blockState the block state * @return whether the block exists */ - public boolean peekBlock(int id) { + public boolean peekBlock(BlockState blockState) { try { - fetchBlock(id); - storeBlock(id); + fetchBlock(blockState); + storeBlock(blockState); return true; } catch (BlockBagException e) { return false; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index aaed19d05..6e78fc016 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java @@ -21,21 +21,24 @@ package com.sk89q.worldedit.extent.inventory; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import javax.annotation.Nullable; import java.util.HashMap; import java.util.Map; +import javax.annotation.Nullable; + /** * Applies a {@link BlockBag} to operations. */ public class BlockBagExtent extends AbstractDelegateExtent { - private Map missingBlocks = new HashMap<>(); + private Map missingBlocks = new HashMap<>(); private BlockBag blockBag; /** @@ -73,8 +76,8 @@ public class BlockBagExtent extends AbstractDelegateExtent { * * @return a map of missing blocks */ - public Map popMissing() { - Map missingBlocks = this.missingBlocks; + public Map popMissing() { + Map missingBlocks = this.missingBlocks; this.missingBlocks = new HashMap<>(); return missingBlocks; } @@ -82,28 +85,26 @@ public class BlockBagExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector position, BlockStateHolder block) throws WorldEditException { if (blockBag != null) { - BaseBlock lazyBlock = getExtent().getLazyBlock(position); - int existing = lazyBlock.getBlockType().getLegacyId(); - final int type = block.getBlockType().getLegacyId(); + BlockState existing = getExtent().getBlock(position); - if (type > 0) { + if (block.getBlockType() != BlockTypes.AIR) { try { - blockBag.fetchPlacedBlock(type, 0); + blockBag.fetchPlacedBlock(block.toImmutableState()); } catch (UnplaceableBlockException e) { return false; } catch (BlockBagException e) { - if (!missingBlocks.containsKey(type)) { - missingBlocks.put(type, 1); + if (!missingBlocks.containsKey(block.getBlockType())) { + missingBlocks.put(block.getBlockType(), 1); } else { - missingBlocks.put(type, missingBlocks.get(type) + 1); + missingBlocks.put(block.getBlockType(), missingBlocks.get(block.getBlockType()) + 1); } return false; } } - if (existing > 0) { + if (existing.getBlockType() != BlockTypes.AIR) { try { - blockBag.storeDroppedBlock(existing, lazyBlock.getData()); + blockBag.storeDroppedBlock(existing); } catch (BlockBagException ignored) { } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java index f9a0900f3..c7058ea8c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java @@ -19,21 +19,21 @@ package com.sk89q.worldedit.extent.inventory; -import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.blocks.type.BlockType; /** * Thrown when the target inventory of a block bag is full. */ public class OutOfSpaceException extends BlockBagException { - private ItemType type; + private BlockType type; /** * Construct the object. * * @param type the type of the block */ - public OutOfSpaceException(ItemType type) { + public OutOfSpaceException(BlockType type) { this.type = type; } @@ -42,7 +42,7 @@ public class OutOfSpaceException extends BlockBagException { * * @return the type */ - public ItemType getType() { + public BlockType getType() { return this.type; } } From e291cccb94608d366440a51e1c46b555a8b5925d Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 1 Jul 2018 23:55:59 +1000 Subject: [PATCH 28/74] Move simulateBlockMine up to the platforms. --- .../com/sk89q/worldedit/blocks/BlockID.java | 36 -- .../com/sk89q/worldedit/blocks/BlockType.java | 466 ------------------ .../com/sk89q/worldedit/blocks/ItemID.java | 63 --- .../sk89q/worldedit/world/AbstractWorld.java | 23 - .../com/sk89q/worldedit/world/NullWorld.java | 4 + .../com/sk89q/worldedit/forge/ForgeWorld.java | 16 +- .../sk89q/worldedit/sponge/SpongeWorld.java | 5 + 7 files changed, 20 insertions(+), 593 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index f9e7c43b7..b396728c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -30,14 +30,10 @@ public final class BlockID { public static final int STONE = 1; public static final int GRASS = 2; public static final int DIRT = 3; - public static final int COBBLESTONE = 4; - public static final int WOOD = 5; // PLANKS public static final int SAPLING = 6; public static final int BEDROCK = 7; public static final int WATER = 8; // FLOWING_WATER public static final int STATIONARY_WATER = 9; // WATER - public static final int LAVA = 10; // FLOWING_LAVA - public static final int STATIONARY_LAVA = 11; // LAVA public static final int SAND = 12; public static final int GRAVEL = 13; public static final int GOLD_ORE = 14; @@ -45,13 +41,9 @@ public final class BlockID { public static final int COAL_ORE = 16; public static final int LOG = 17; public static final int LEAVES = 18; - public static final int SPONGE = 19; public static final int GLASS = 20; public static final int LAPIS_LAZULI_ORE = 21; // LAPIS_ORE - public static final int LAPIS_LAZULI_BLOCK = 22; // LAPIS_BLOCK public static final int DISPENSER = 23; - public static final int SANDSTONE = 24; - public static final int NOTE_BLOCK = 25; // NOTEBLOCK public static final int BED = 26; public static final int POWERED_RAIL = 27; // GOLDEN_RAIL public static final int DETECTOR_RAIL = 28; @@ -61,21 +53,13 @@ public final class BlockID { public static final int DEAD_BUSH = 32; // DEADBUSH public static final int PISTON_BASE = 33; // PISTON public static final int PISTON_EXTENSION = 34; // PISTON_HEAD - public static final int CLOTH = 35; // WOOL public static final int PISTON_MOVING_PIECE = 36; // PISTON_EXTENSION public static final int YELLOW_FLOWER = 37; public static final int RED_FLOWER = 38; public static final int BROWN_MUSHROOM = 39; public static final int RED_MUSHROOM = 40; - public static final int GOLD_BLOCK = 41; - public static final int IRON_BLOCK = 42; - public static final int DOUBLE_STEP = 43; // DOUBLE_STONE_SLAB public static final int STEP = 44; // STONE_SLAB - public static final int BRICK = 45; // BRICK_BLOCK public static final int TNT = 46; - public static final int BOOKCASE = 47; // BOOKSHELF - public static final int MOSSY_COBBLESTONE = 48; - public static final int OBSIDIAN = 49; public static final int TORCH = 50; public static final int FIRE = 51; public static final int MOB_SPAWNER = 52; @@ -85,10 +69,7 @@ public final class BlockID { public static final int CHEST = 54; public static final int REDSTONE_WIRE = 55; public static final int DIAMOND_ORE = 56; - public static final int DIAMOND_BLOCK = 57; - public static final int WORKBENCH = 58; // CRAFTING_TABLE public static final int CROPS = 59; // WHEAT - public static final int SOIL = 60; // FARMLAND public static final int FURNACE = 61; public static final int BURNING_FURNACE = 62; // LIT_FURNACE public static final int SIGN_POST = 63; // STANDING_SIGN @@ -108,11 +89,9 @@ public final class BlockID { public static final int STONE_BUTTON = 77; public static final int SNOW = 78; // SNOW_LAYER public static final int ICE = 79; - public static final int SNOW_BLOCK = 80; // SNOW public static final int CACTUS = 81; public static final int CLAY = 82; public static final int REED = 83; // REEDS - public static final int JUKEBOX = 84; public static final int FENCE = 85; public static final int PUMPKIN = 86; @Deprecated @@ -128,13 +107,10 @@ public final class BlockID { @Deprecated public static final int LOCKED_CHEST = 95; public static final int TRAP_DOOR = 96; // TRAPDOOR - public static final int SILVERFISH_BLOCK = 97; // MONSTER_EGG - public static final int STONE_BRICK = 98; // STONEBRICK public static final int BROWN_MUSHROOM_CAP = 99; // BROWN_MUSHROOM_BLOCK public static final int RED_MUSHROOM_CAP = 100; // RED_MUSHROOM_BLOCK public static final int IRON_BARS = 101; public static final int GLASS_PANE = 102; - public static final int MELON_BLOCK = 103; public static final int PUMPKIN_STEM = 104; public static final int MELON_STEM = 105; public static final int VINE = 106; @@ -143,19 +119,13 @@ public final class BlockID { public static final int STONE_BRICK_STAIRS = 109; public static final int MYCELIUM = 110; public static final int LILY_PAD = 111; // WATERLILY - public static final int NETHER_BRICK = 112; public static final int NETHER_BRICK_FENCE = 113; public static final int NETHER_BRICK_STAIRS = 114; public static final int NETHER_WART = 115; public static final int ENCHANTMENT_TABLE = 116; // ENCHANTING_TABLE public static final int BREWING_STAND = 117; public static final int CAULDRON = 118; - public static final int END_PORTAL = 119; public static final int END_PORTAL_FRAME = 120; - public static final int END_STONE = 121; - public static final int REDSTONE_LAMP_OFF = 123; // REDSTONE_LAMP - public static final int REDSTONE_LAMP_ON = 124; // LIT_REDSTONE_LAMP - public static final int DOUBLE_WOODEN_STEP = 125; // DOUBLE_WOODEN_SLAB public static final int WOODEN_STEP = 126; // WOODEN_SLAB public static final int COCOA_PLANT = 127; // COCOA public static final int SANDSTONE_STAIRS = 128; @@ -163,11 +133,9 @@ public final class BlockID { public static final int ENDER_CHEST = 130; public static final int TRIPWIRE_HOOK = 131; public static final int TRIPWIRE = 132; - public static final int EMERALD_BLOCK = 133; public static final int SPRUCE_WOOD_STAIRS = 134; // SPRUCE_STAIRS public static final int BIRCH_WOOD_STAIRS = 135; // BRUCE_STAIRS public static final int JUNGLE_WOOD_STAIRS = 136; // JUNGLE_STAIRS - public static final int COMMAND_BLOCK = 137; public static final int COBBLESTONE_WALL = 139; public static final int FLOWER_POT = 140; public static final int CARROTS = 141; @@ -181,10 +149,8 @@ public final class BlockID { public static final int COMPARATOR_OFF = 149; // UNPOWERED_COMPARATOR public static final int COMPARATOR_ON = 150; // COMPARATOR public static final int DAYLIGHT_SENSOR = 151; // DAYLIGHT_DETECTOR - public static final int REDSTONE_BLOCK = 152; public static final int QUARTZ_ORE = 153; public static final int HOPPER = 154; - public static final int QUARTZ_BLOCK = 155; public static final int QUARTZ_STAIRS = 156; public static final int ACTIVATOR_RAIL = 157; public static final int DROPPER = 158; @@ -198,8 +164,6 @@ public final class BlockID { public static final int IRON_TRAP_DOOR = 167; public static final int HAY_BLOCK = 170; public static final int CARPET = 171; - public static final int HARDENED_CLAY = 172; - public static final int COAL_BLOCK = 173; public static final int PACKED_ICE = 174; public static final int DOUBLE_PLANT = 175; public static final int STANDING_BANNER = 176; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 064562a82..44ccf731c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -27,11 +27,8 @@ import com.sk89q.worldedit.blocks.type.BlockStateHolder; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Random; import java.util.Set; -import javax.annotation.Nullable; - /** * Block types. * @@ -460,469 +457,6 @@ public enum BlockType { return isTranslucent.contains(id); } - /** - * HashMap for getBlockBagItem. - */ - private static final Map dataBlockBagItems = new HashMap<>(); - private static final Map nonDataBlockBagItems = new HashMap<>(); - private static final BaseItem doNotDestroy = new BaseItemStack(BlockID.AIR, 0); - static { - /* - * rules: - * - * 1. block yields itself => addIdentity - * 2. block is part of a 2-block object => drop an appropriate item for one of the 2 blocks - * 3. block can be placed by right-clicking an obtainable item on the ground => use that item - * 4. block yields more than one item => addIdentities - * 5. block yields exactly one item => use that item - * 6. block is a liquid => drop nothing - * 7. block is created from thin air by the game other than by the map generator => drop nothing - */ - - nonDataBlockBagItems.put(BlockID.STONE, new BaseItem(BlockID.COBBLESTONE)); // rule 5 - nonDataBlockBagItems.put(BlockID.GRASS, new BaseItem(BlockID.DIRT)); // rule 5 - addIdentities(BlockID.DIRT, 3); // rule 1 - addIdentity(BlockID.COBBLESTONE); // rule 1 - addIdentities(BlockID.WOOD, 6); // rule 1 - addIdentities(BlockID.SAPLING, 6); // rule 1 - nonDataBlockBagItems.put(BlockID.BEDROCK, doNotDestroy); // exception - // WATER, rule 6 - // STATIONARY_WATER, rule 6 - // LAVA, rule 6 - // STATIONARY_LAVA, rule 6 - addIdentity(BlockID.SAND); // rule 1 - addIdentity(BlockID.GRAVEL); // rule 1 - addIdentity(BlockID.GOLD_ORE); // rule 1 - addIdentity(BlockID.IRON_ORE); // rule 1 - nonDataBlockBagItems.put(BlockID.COAL_ORE, new BaseItem(ItemID.COAL)); // rule 5 - addIdentities(BlockID.LOG, 4); // rule 1 - addIdentities(BlockID.LEAVES, 4); // rule 1 with shears, otherwise rule 3 - addIdentity(BlockID.SPONGE); // rule 1 - addIdentity(BlockID.GLASS); // rule 3 - addIdentity(BlockID.LAPIS_LAZULI_ORE); // rule 4 - addIdentity(BlockID.LAPIS_LAZULI_BLOCK); // rule 1 - addIdentity(BlockID.DISPENSER); // rule 1 - addIdentity(BlockID.SANDSTONE); // rule 1 - addIdentity(BlockID.NOTE_BLOCK); // rule 1 - addIdentities(BlockID.BED, 8); // rule 2 - addIdentity(BlockID.POWERED_RAIL); // rule 1 - addIdentity(BlockID.DETECTOR_RAIL); // rule 1 - addIdentity(BlockID.PISTON_STICKY_BASE); - nonDataBlockBagItems.put(BlockID.WEB, new BaseItem(ItemID.STRING)); // rule 5 - // LONG_GRASS - // DEAD_BUSH - addIdentity(BlockID.PISTON_BASE); - // PISTON_EXTENSION, rule 7 - addIdentities(BlockID.CLOTH, 16); // rule 1 - // PISTON_MOVING_PIECE, rule 7 - addIdentity(BlockID.YELLOW_FLOWER); // rule 1 - addIdentity(BlockID.RED_FLOWER); // rule 1 - addIdentity(BlockID.BROWN_MUSHROOM); // rule 1 - addIdentity(BlockID.RED_MUSHROOM); // rule 1 - addIdentity(BlockID.GOLD_BLOCK); // rule 1 - addIdentity(BlockID.IRON_BLOCK); // rule 1 - addIdentities(BlockID.DOUBLE_STEP, 7); // rule 3 - addIdentities(BlockID.STEP, 7); // rule 1 - addIdentity(BlockID.BRICK); // rule 1 - addIdentity(BlockID.TNT); - addIdentity(BlockID.BOOKCASE); // rule 3 - addIdentity(BlockID.MOSSY_COBBLESTONE); // rule 1 - addIdentity(BlockID.OBSIDIAN); // rule 1 - addIdentity(BlockID.TORCH); // rule 1 - // FIRE - // MOB_SPAWNER - addIdentity(BlockID.OAK_WOOD_STAIRS); // rule 1 - addIdentity(BlockID.CHEST); // rule 1 - nonDataBlockBagItems.put(BlockID.REDSTONE_WIRE, new BaseItem(ItemID.REDSTONE_DUST)); // rule 3 - nonDataBlockBagItems.put(BlockID.DIAMOND_ORE, new BaseItem(ItemID.DIAMOND)); // rule 5 - addIdentity(BlockID.DIAMOND_BLOCK); // rule 1 - addIdentity(BlockID.WORKBENCH); // rule 1 - nonDataBlockBagItems.put(BlockID.CROPS, new BaseItem(ItemID.SEEDS)); // rule 3 - nonDataBlockBagItems.put(BlockID.SOIL, new BaseItem(BlockID.DIRT)); // rule 5 - addIdentity(BlockID.FURNACE); // rule 1 - nonDataBlockBagItems.put(BlockID.BURNING_FURNACE, new BaseItem(BlockID.FURNACE)); - nonDataBlockBagItems.put(BlockID.SIGN_POST, new BaseItem(ItemID.SIGN)); // rule 3 - addIdentities(BlockID.WOODEN_DOOR, 8); // rule 2 - addIdentity(BlockID.LADDER); // rule 1 - addIdentity(BlockID.MINECART_TRACKS); // rule 1 - addIdentity(BlockID.COBBLESTONE_STAIRS); // rule 3 - nonDataBlockBagItems.put(BlockID.WALL_SIGN, new BaseItem(ItemID.SIGN)); // rule 3 - addIdentity(BlockID.LEVER); // rule 1 - addIdentity(BlockID.STONE_PRESSURE_PLATE); // rule 1 - addIdentities(BlockID.IRON_DOOR, 8); // rule 2 - addIdentity(BlockID.WOODEN_PRESSURE_PLATE); // rule 1 - addIdentity(BlockID.REDSTONE_ORE); // rule 4 - nonDataBlockBagItems.put(BlockID.GLOWING_REDSTONE_ORE, new BaseItem(BlockID.REDSTONE_ORE)); // rule 4 - nonDataBlockBagItems.put(BlockID.REDSTONE_TORCH_OFF, new BaseItem(BlockID.REDSTONE_TORCH_ON)); // rule 3 - addIdentity(BlockID.REDSTONE_TORCH_ON); // rule 1 - addIdentity(BlockID.STONE_BUTTON); // rule 1 - addIdentity(BlockID.SNOW); // rule 1 - addIdentity(BlockID.ICE); // exception - addIdentity(BlockID.SNOW_BLOCK); // rule 3 - addIdentity(BlockID.CACTUS); - addIdentity(BlockID.CLAY); // rule 3 - nonDataBlockBagItems.put(BlockID.REED, new BaseItem(ItemID.SUGAR_CANE_ITEM)); // rule 3 - addIdentity(BlockID.JUKEBOX); // rule 1 - addIdentity(BlockID.FENCE); // rule 1 - addIdentity(BlockID.PUMPKIN); // rule 1 - addIdentity(BlockID.NETHERRACK); // rule 1 - addIdentity(BlockID.SLOW_SAND); // rule 1 - addIdentity(BlockID.LIGHTSTONE); // rule 4 - // PORTAL - addIdentity(BlockID.JACKOLANTERN); // rule 1 - nonDataBlockBagItems.put(BlockID.CAKE_BLOCK, new BaseItem(ItemID.CAKE_ITEM)); // rule 3 - nonDataBlockBagItems.put(BlockID.REDSTONE_REPEATER_OFF, new BaseItem(ItemID.REDSTONE_REPEATER)); // rule 3 - nonDataBlockBagItems.put(BlockID.REDSTONE_REPEATER_ON, new BaseItem(ItemID.REDSTONE_REPEATER)); // rule 3 - addIdentities(BlockID.STAINED_GLASS_PANE, 16); // ??? - addIdentity(BlockID.TRAP_DOOR); // rule 1 - nonDataBlockBagItems.put(BlockID.SILVERFISH_BLOCK, doNotDestroy); // exception - addIdentity(BlockID.STONE_BRICK); // rule 1 - addIdentity(BlockID.BROWN_MUSHROOM_CAP); - addIdentity(BlockID.RED_MUSHROOM_CAP); - addIdentity(BlockID.IRON_BARS); // rule 1 - addIdentity(BlockID.GLASS_PANE); // rule 1 - addIdentity(BlockID.MELON_BLOCK); // rule 3 - nonDataBlockBagItems.put(BlockID.PUMPKIN_STEM, new BaseItem(ItemID.PUMPKIN_SEEDS)); // rule 3 - nonDataBlockBagItems.put(BlockID.MELON_STEM, new BaseItem(ItemID.MELON_SEEDS)); // rule 3 - nonDataBlockBagItems.put(BlockID.VINE, doNotDestroy); // exception - addIdentity(BlockID.FENCE_GATE); // rule 1 - addIdentity(BlockID.BRICK_STAIRS); // rule 3 - addIdentity(BlockID.STONE_BRICK_STAIRS); // rule 3 - - // 1.9 blocks - nonDataBlockBagItems.put(BlockID.MYCELIUM, new BaseItem(BlockID.DIRT)); - addIdentity(BlockID.LILY_PAD); - addIdentity(BlockID.NETHER_BRICK); - addIdentity(BlockID.NETHER_BRICK_FENCE); - addIdentity(BlockID.NETHER_BRICK_STAIRS); - nonDataBlockBagItems.put(BlockID.NETHER_WART, new BaseItem(ItemID.NETHER_WART_SEED)); - addIdentity(BlockID.ENCHANTMENT_TABLE); - nonDataBlockBagItems.put(BlockID.BREWING_STAND, new BaseItem(ItemID.BREWING_STAND)); - nonDataBlockBagItems.put(BlockID.CAULDRON, new BaseItem(ItemID.CAULDRON)); - nonDataBlockBagItems.put(BlockID.END_PORTAL, doNotDestroy); - nonDataBlockBagItems.put(BlockID.END_PORTAL_FRAME, doNotDestroy); - addIdentity(BlockID.END_STONE); - - addIdentity(BlockID.REDSTONE_LAMP_OFF); - nonDataBlockBagItems.put(BlockID.REDSTONE_LAMP_ON, new BaseItem(BlockID.REDSTONE_LAMP_OFF)); - - addIdentities(BlockID.DOUBLE_WOODEN_STEP, 7); // rule 3 - addIdentities(BlockID.WOODEN_STEP, 7); // rule 1 - nonDataBlockBagItems.put(BlockID.COCOA_PLANT, new BaseItem(ItemID.INK_SACK)); // rule 3 TODO data removed - addIdentity(BlockID.SANDSTONE_STAIRS); // rule 1 - nonDataBlockBagItems.put(BlockID.EMERALD_ORE, new BaseItem(ItemID.EMERALD)); // rule 5 - addIdentity(BlockID.ENDER_CHEST); // rule 3 - addIdentity(BlockID.TRIPWIRE_HOOK); // rule 1 - nonDataBlockBagItems.put(BlockID.TRIPWIRE, new BaseItem(ItemID.STRING)); // rule 3 - addIdentity(BlockID.EMERALD_BLOCK); // rule 1 - addIdentity(BlockID.SPRUCE_WOOD_STAIRS); // rule 1 - addIdentity(BlockID.BIRCH_WOOD_STAIRS); // rule 1 - addIdentity(BlockID.JUNGLE_WOOD_STAIRS); // rule 1 - addIdentity(BlockID.COMMAND_BLOCK); // rule 1 - addIdentities(BlockID.COBBLESTONE_WALL, 1); // rule 4 - nonDataBlockBagItems.put(BlockID.FLOWER_POT, new BaseItemStack(ItemID.FLOWER_POT)); // rule 3 - nonDataBlockBagItems.put(BlockID.CARROTS, new BaseItemStack(ItemID.CARROT)); // rule 3 - nonDataBlockBagItems.put(BlockID.POTATOES, new BaseItemStack(ItemID.POTATO)); // rule 3 - addIdentity(BlockID.WOODEN_BUTTON); // rule 1 - nonDataBlockBagItems.put(BlockID.HEAD, doNotDestroy); // exception, can't handle TE data - addIdentities(BlockID.ANVIL, 2); // rule 4 - addIdentity(BlockID.TRAPPED_CHEST); // rule 1 - addIdentity(BlockID.PRESSURE_PLATE_LIGHT); // rule 1 - addIdentity(BlockID.PRESSURE_PLATE_HEAVY); // rule 1 - nonDataBlockBagItems.put(BlockID.COMPARATOR_OFF, new BaseItemStack(ItemID.COMPARATOR)); // rule 3 - nonDataBlockBagItems.put(BlockID.COMPARATOR_ON, new BaseItemStack(ItemID.COMPARATOR)); // rule 3 - addIdentity(BlockID.DAYLIGHT_SENSOR); // rule 1 - addIdentity(BlockID.REDSTONE_BLOCK); // rule 1 - nonDataBlockBagItems.put(BlockID.QUARTZ_ORE, new BaseItemStack(ItemID.NETHER_QUARTZ)); // rule 3 - addIdentity(BlockID.HOPPER); // rule 1 - addIdentities(BlockID.QUARTZ_BLOCK, 1); // rule 4 - for (int i = 2; i <= 4; i++) { - dataBlockBagItems.put(typeDataKey(BlockID.QUARTZ_BLOCK, i), new BaseItem(BlockID.QUARTZ_BLOCK)); // rule 4, quartz pillars TODO data - // removed - } - addIdentity(BlockID.QUARTZ_STAIRS); // rule 1 - addIdentity(BlockID.ACTIVATOR_RAIL); // rule 1 - addIdentity(BlockID.DROPPER); // rule 1 - - addIdentities(BlockID.STAINED_CLAY, 16); // rule 1 - addIdentity(BlockID.HAY_BLOCK); // rule 1 - addIdentities(BlockID.CARPET, 16); // rule 1 - addIdentity(BlockID.HARDENED_CLAY); // rule 1 - addIdentity(BlockID.COAL_BLOCK); // rule 1 - - addIdentities(BlockID.LOG2, 1); - addIdentities(BlockID.LEAVES2, 1); - addIdentity(BlockID.ACACIA_STAIRS); - addIdentity(BlockID.DARK_OAK_STAIRS); - addIdentity(BlockID.PACKED_ICE); - addIdentities(BlockID.STAINED_GLASS_PANE, 16); - addIdentities(BlockID.DOUBLE_PLANT, 6); - - addIdentities(BlockID.ACACIA_DOOR, 8); // rule 2 - addIdentities(BlockID.BIRCH_DOOR, 8); // rule 2 - addIdentities(BlockID.JUNGLE_DOOR, 8); // rule 2 - addIdentities(BlockID.DARK_OAK_DOOR, 8); // rule 2 - addIdentities(BlockID.SPRUCE_DOOR, 8); // rule 2 - } - - /** - * Get the block or item that this block can be constructed from. If nothing is - * dropped, a block with a BaseItemStack of type AIR and size 0 will be returned. - * If the block should not be destroyed (i.e. bedrock), null will be returned. - * - * @param type the type of of the block - * @param data the data value of the block - * @return the item or null - */ - @Nullable - public static BaseItem getBlockBagItem(int type, int data) { - BaseItem dropped = nonDataBlockBagItems.get(type); - if (dropped != null) return dropped; - - dropped = dataBlockBagItems.get(typeDataKey(type, data)); - - if (dropped == null) { - return new BaseItemStack(BlockID.AIR, 0); - } - - if (dropped == doNotDestroy) { - return null; - } - - return dropped; - } - - private static void addIdentity(int type) { - nonDataBlockBagItems.put(type, new BaseItem(type)); - } - - private static void addIdentities(int type, int maxData) { - for (int data = 0; data < maxData; ++data) { - dataBlockBagItems.put(typeDataKey(type, data), new BaseItem(type)); // TODO data removed - } - } - - private static final Random random = new Random(); - - /** - * Get the block drop for a block. - * - * @param id the type ID of the block - * @param data the data value - * @return an item or null - */ - @Nullable - public static BaseItemStack getBlockDrop(int id, short data) { - int store; - switch (id) { - case BlockID.STONE: - return new BaseItemStack(BlockID.COBBLESTONE); - - case BlockID.GRASS: - return new BaseItemStack(BlockID.DIRT); - - case BlockID.GRAVEL: - if (random.nextInt(10) == 0) { - return new BaseItemStack(ItemID.FLINT); - } else { - return new BaseItemStack(BlockID.GRAVEL); - } - - case BlockID.COAL_ORE: - return new BaseItemStack(ItemID.COAL); - - case BlockID.LEAVES: - if (random.nextDouble() > 0.95) { - return new BaseItemStack(BlockID.SAPLING, 1, data); - } else { - return null; - } - - case BlockID.LAPIS_LAZULI_ORE: - return new BaseItemStack(ItemID.INK_SACK, random.nextInt(5) + 4, (short) 4); - - case BlockID.BED: - return new BaseItemStack(ItemID.BED_ITEM); - - case BlockID.LONG_GRASS: - if (random.nextInt(8) == 0) { - return new BaseItemStack(ItemID.SEEDS); - } else { - return null; - } - - case BlockID.DOUBLE_STEP: - return new BaseItemStack(BlockID.STEP, 2, data); - - case BlockID.REDSTONE_WIRE: - return new BaseItemStack(ItemID.REDSTONE_DUST); - - case BlockID.DIAMOND_ORE: - return new BaseItemStack(ItemID.DIAMOND); - - case BlockID.CROPS: - if (data == 7) return new BaseItemStack(ItemID.WHEAT); - return new BaseItemStack(ItemID.SEEDS); - - case BlockID.SOIL: - return new BaseItemStack(BlockID.DIRT); - - case BlockID.BURNING_FURNACE: - return new BaseItemStack(BlockID.FURNACE); - - case BlockID.SIGN_POST: - return new BaseItemStack(ItemID.SIGN); - - case BlockID.WOODEN_DOOR: - return new BaseItemStack(ItemID.WOODEN_DOOR_ITEM); - - case BlockID.WALL_SIGN: - return new BaseItemStack(ItemID.SIGN); - - case BlockID.IRON_DOOR: - return new BaseItemStack(ItemID.IRON_DOOR_ITEM); - - case BlockID.REDSTONE_ORE: - case BlockID.GLOWING_REDSTONE_ORE: - return new BaseItemStack(ItemID.REDSTONE_DUST, (random.nextInt(2) + 4)); - - case BlockID.REDSTONE_TORCH_OFF: - return new BaseItemStack(BlockID.REDSTONE_TORCH_ON); - - case BlockID.CLAY: - return new BaseItemStack(ItemID.CLAY_BALL, 4); - - case BlockID.REED: - return new BaseItemStack(ItemID.SUGAR_CANE_ITEM); - - case BlockID.LIGHTSTONE: - return new BaseItemStack(ItemID.LIGHTSTONE_DUST, (random.nextInt(3) + 2)); - - case BlockID.REDSTONE_REPEATER_OFF: - case BlockID.REDSTONE_REPEATER_ON: - return new BaseItemStack(ItemID.REDSTONE_REPEATER); - - case BlockID.BROWN_MUSHROOM_CAP: - store = random.nextInt(10); - if (store == 0) { - return new BaseItemStack(BlockID.BROWN_MUSHROOM, 2); - } else if (store == 1) { - return new BaseItemStack(BlockID.BROWN_MUSHROOM); - } else { - return null; - } - - case BlockID.RED_MUSHROOM_CAP: - store = random.nextInt(10); - if (store == 0) { - return new BaseItemStack(BlockID.RED_MUSHROOM, 2); - } else if (store == 1) { - return new BaseItemStack(BlockID.RED_MUSHROOM); - } else { - return null; - } - - case BlockID.MELON_BLOCK: - return new BaseItemStack(ItemID.MELON, (random.nextInt(5) + 3)); - - case BlockID.PUMPKIN_STEM: - return new BaseItemStack(ItemID.PUMPKIN_SEEDS); - - case BlockID.MELON_STEM: - return new BaseItemStack(ItemID.MELON_SEEDS); - - case BlockID.MYCELIUM: - return new BaseItemStack(BlockID.DIRT); - - case BlockID.LILY_PAD: - return new BaseItemStack(BlockID.LILY_PAD); - - case BlockID.NETHER_WART: - return new BaseItemStack(ItemID.NETHER_WART_SEED, random.nextInt(3) + 1); - - case BlockID.BREWING_STAND: - return new BaseItemStack(ItemID.BREWING_STAND); - - case BlockID.CAULDRON: - return new BaseItemStack(ItemID.CAULDRON); - - case BlockID.REDSTONE_LAMP_ON: - return new BaseItemStack(BlockID.REDSTONE_LAMP_OFF); - - case BlockID.DOUBLE_WOODEN_STEP: - return new BaseItemStack(BlockID.WOODEN_STEP, 2, data); - - case BlockID.COCOA_PLANT: - return new BaseItemStack(ItemID.INK_SACK, (data >= 2 ? 3 : 1), (short) 3); - - case BlockID.EMERALD_ORE: - return new BaseItemStack(ItemID.EMERALD); - - case BlockID.TRIPWIRE: - return new BaseItemStack(ItemID.STRING); - - case BlockID.FLOWER_POT: - return new BaseItemStack(ItemID.FLOWER_POT); - - case BlockID.CARROTS: - return new BaseItemStack(ItemID.CARROT, random.nextInt(3) + 1); - - case BlockID.POTATOES: - return new BaseItemStack(ItemID.POTATO, random.nextInt(3) + 1); - - case BlockID.COMPARATOR_OFF: - case BlockID.COMPARATOR_ON: - return new BaseItemStack(ItemID.COMPARATOR); - - case BlockID.QUARTZ_ORE: - return new BaseItemStack(ItemID.NETHER_QUARTZ); - - case BlockID.QUARTZ_BLOCK: - return new BaseItemStack(BlockID.QUARTZ_BLOCK, 1, (data >= 2 ? 2 : data)); - - case BlockID.LOG: - return new BaseItemStack(BlockID.LOG, 1, (short) (data & 0x3)); // strip orientation data - - case BlockID.HAY_BLOCK: - return new BaseItemStack(BlockID.HAY_BLOCK); // strip orientation data - - case BlockID.OAK_WOOD_STAIRS: - case BlockID.COBBLESTONE_STAIRS: - case BlockID.BRICK_STAIRS: - case BlockID.STONE_BRICK_STAIRS: - case BlockID.NETHER_BRICK_STAIRS: - case BlockID.SPRUCE_WOOD_STAIRS: - case BlockID.BIRCH_WOOD_STAIRS: - case BlockID.JUNGLE_WOOD_STAIRS: - case BlockID.QUARTZ_STAIRS: - return new BaseItemStack(id); // strip data from stairs - - case BlockID.BEDROCK: - case BlockID.WATER: - case BlockID.STATIONARY_WATER: - case BlockID.LAVA: - case BlockID.STATIONARY_LAVA: - case BlockID.GLASS: - case BlockID.STAINED_GLASS_PANE: - case BlockID.PISTON_EXTENSION: - case BlockID.BOOKCASE: - case BlockID.FIRE: - case BlockID.MOB_SPAWNER: - case BlockID.SNOW: - case BlockID.ICE: - case BlockID.PORTAL: - case BlockID.AIR: - case BlockID.SILVERFISH_BLOCK: - case BlockID.VINE: - case BlockID.END_PORTAL: - case BlockID.END_PORTAL_FRAME: - case BlockID.HEAD: - return null; - } - - return new BaseItemStack(id); - } - private static final Map dataAttachments = new HashMap<>(); private static final Map nonDataAttachments = new HashMap<>(); static { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java deleted file mode 100644 index 92ccdd370..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ItemID.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -/** - * List of item IDs. - * - * {@deprecated Please use {@link com.sk89q.worldedit.blocks.type.ItemTypes}} - */ -@Deprecated -public final class ItemID { - - public static final int COAL = 263; - public static final int DIAMOND = 264; - public static final int STRING = 287; - public static final int SEEDS = 295; - public static final int WHEAT = 296; - public static final int FLINT = 318; - public static final int SIGN = 323; - public static final int WOODEN_DOOR_ITEM = 324; - public static final int IRON_DOOR_ITEM = 330; - public static final int REDSTONE_DUST = 331; - public static final int CLAY_BALL = 337; - public static final int SUGAR_CANE_ITEM = 338; - public static final int LIGHTSTONE_DUST = 348; - public static final int INK_SACK = 351; - public static final int CAKE_ITEM = 354; - public static final int BED_ITEM = 355; - public static final int REDSTONE_REPEATER = 356; - public static final int MELON = 360; - public static final int PUMPKIN_SEEDS = 361; - public static final int MELON_SEEDS = 362; - public static final int NETHER_WART_SEED = 372; - public static final int BREWING_STAND = 379; - public static final int CAULDRON = 380; - public static final int EMERALD = 388; - public static final int FLOWER_POT = 390; - public static final int CARROT = 391; - public static final int POTATO = 392; - public static final int COMPARATOR = 404; - public static final int NETHER_QUARTZ = 406; - - private ItemID() { - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index e838ff098..ce5b6fc8d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -22,10 +22,8 @@ package com.sk89q.worldedit.world; import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; @@ -77,27 +75,6 @@ public abstract class AbstractWorld implements World { } } - @Override - public void simulateBlockMine(Vector pt) { - BaseBlock block = getLazyBlock(pt); - BaseItemStack stack = BlockType.getBlockDrop(block.getId(), (short) block.getData()); - - if (stack != null) { - final int amount = stack.getAmount(); - if (amount > 1) { - dropItem(pt, new BaseItemStack(stack.getType(), stack.getNbtData(), 1), amount); - } else { - dropItem(pt, stack, amount); - } - } - - try { - setBlock(pt, BlockTypes.AIR.getDefaultState()); - } catch (WorldEditException e) { - throw new RuntimeException(e); - } - } - @Override public void checkLoadedChunk(Vector pt) { } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java index 9bfaa02fe..b50e2c3f4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -87,6 +87,10 @@ public class NullWorld extends AbstractWorld { public void dropItem(Vector position, BaseItemStack item) { } + @Override + public void simulateBlockMine(Vector position) { + } + @Override public boolean regenerate(Region region, EditSession editSession) { return false; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index f086e171d..2e30ab7f3 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.forge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.io.Files; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.BlockVector; @@ -45,8 +47,6 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.Registries; - import net.minecraft.block.Block; import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockOldLeaf; @@ -88,15 +88,13 @@ import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.DimensionManager; -import javax.annotation.Nullable; - import java.io.File; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; import java.util.Random; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * An adapter to Minecraft worlds for WorldEdit. @@ -267,6 +265,14 @@ public class ForgeWorld extends AbstractWorld { getWorld().spawnEntity(entity); } + @Override + public void simulateBlockMine(Vector position) { + BlockPos pos = ForgeAdapter.toBlockPos(position); + IBlockState state = getWorld().getBlockState(pos); + state.getBlock().dropBlockAsItem(getWorld(), pos, state, 0); + getWorld().setBlockToAir(pos); + } + @Override public boolean regenerate(Region region, EditSession editSession) { // Don't even try to regen if it's going to fail. diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index a0eb80ed9..33b2b6f5f 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -215,6 +215,11 @@ public abstract class SpongeWorld extends AbstractWorld { getWorld().spawnEntity(entity); } + @Override + public void simulateBlockMine(Vector position) { + // TODO + } + @Override public int hashCode() { return getWorld().hashCode(); From 57c13ef8f4b3e5aa77b0dd455a36fb6e98d7804c Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 2 Jul 2018 13:45:46 +1000 Subject: [PATCH 29/74] Continue moving out of legacy BlockType --- .../sk89q/worldedit/bukkit/BukkitWorld.java | 7 +- .../java/com/sk89q/worldedit/EditSession.java | 2 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 23 --- .../com/sk89q/worldedit/blocks/BlockID.java | 30 --- .../sk89q/worldedit/blocks/BlockMaterial.java | 13 ++ .../com/sk89q/worldedit/blocks/BlockType.java | 180 ------------------ .../validation/DataValidatorExtent.java | 1 - .../extent/world/BlockQuirkExtent.java | 13 +- .../extent/world/SurvivalModeExtent.java | 5 +- .../shape/WorldEditExpressionEnvironment.java | 6 +- .../com/sk89q/worldedit/util/TargetBlock.java | 3 +- .../sk89q/worldedit/world/AbstractWorld.java | 7 +- .../world/registry/SimpleBlockMaterial.java | 20 ++ .../com/sk89q/worldedit/forge/ForgeWorld.java | 15 +- 14 files changed, 57 insertions(+), 268 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 56654dc07..cf98f41d9 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -379,9 +379,7 @@ public class BukkitWorld extends AbstractWorld { @Override public LazyBlock getLazyBlock(Vector position) { - World world = getWorld(); - Block bukkitBlock = world.getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - return new LazyBlock(bukkitBlock.getTypeId(), bukkitBlock.getData(), this, position); + return new LazyBlock(getBlock(position), this, position); } @Override @@ -390,8 +388,7 @@ public class BukkitWorld extends AbstractWorld { if (adapter != null) { return adapter.getBlock(BukkitAdapter.adapt(getWorld(), position)); } else { - Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - return new BaseBlock(bukkitBlock.getTypeId(), bukkitBlock.getData()); + return new BaseBlock(getBlock(position)); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 5f733b086..d69a558ea 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -1529,7 +1529,7 @@ public class EditSession implements Extent { } // Snow should not cover these blocks - if (BlockType.isTranslucent(id.getLegacyId())) { + if (id.getMaterial().isTranslucent()) { // Add snow on leaves if (BlockCategories.LEAVES.contains(id)) { break; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 00a2832d4..df35b3043 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -114,19 +114,6 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { this(id); } - /** - * Construct a block with the given ID, data value and NBT data structure. - * - * @param id ID value - * @param data data value - * @param nbtData NBT data, which may be null - */ - @Deprecated - public BaseBlock(int id, int data, @Nullable CompoundTag nbtData) { - this(id); - this.nbtData = nbtData; - } - /** * Create a clone of another block. * @@ -136,16 +123,6 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { this(other.toImmutableState(), other.getNbtData()); } - /** - * Get the legacy numerical ID of the block. - * - * @return legacy numerical ID - */ - @Deprecated - public int getId() { - return this.blockState.getBlockType().getLegacyId(); - } - /** * Get the block's data value. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index b396728c3..a92eae5f3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -32,23 +32,18 @@ public final class BlockID { public static final int DIRT = 3; public static final int SAPLING = 6; public static final int BEDROCK = 7; - public static final int WATER = 8; // FLOWING_WATER - public static final int STATIONARY_WATER = 9; // WATER public static final int SAND = 12; public static final int GRAVEL = 13; public static final int GOLD_ORE = 14; public static final int IRON_ORE = 15; public static final int COAL_ORE = 16; public static final int LOG = 17; - public static final int LEAVES = 18; - public static final int GLASS = 20; public static final int LAPIS_LAZULI_ORE = 21; // LAPIS_ORE public static final int DISPENSER = 23; public static final int BED = 26; public static final int POWERED_RAIL = 27; // GOLDEN_RAIL public static final int DETECTOR_RAIL = 28; public static final int PISTON_STICKY_BASE = 29; // STICKY_PISTON - public static final int WEB = 30; public static final int LONG_GRASS = 31; // TALLGRASS public static final int DEAD_BUSH = 32; // DEADBUSH public static final int PISTON_BASE = 33; // PISTON @@ -62,7 +57,6 @@ public final class BlockID { public static final int TNT = 46; public static final int TORCH = 50; public static final int FIRE = 51; - public static final int MOB_SPAWNER = 52; @Deprecated public static final int WOODEN_STAIRS = 53; public static final int OAK_WOOD_STAIRS = 53; // OAK_STAIRS @@ -88,7 +82,6 @@ public final class BlockID { public static final int REDSTONE_TORCH_ON = 76; // LIT_REDSTONE_TORCH public static final int STONE_BUTTON = 77; public static final int SNOW = 78; // SNOW_LAYER - public static final int ICE = 79; public static final int CACTUS = 81; public static final int CLAY = 82; public static final int REED = 83; // REEDS @@ -109,8 +102,6 @@ public final class BlockID { public static final int TRAP_DOOR = 96; // TRAPDOOR public static final int BROWN_MUSHROOM_CAP = 99; // BROWN_MUSHROOM_BLOCK public static final int RED_MUSHROOM_CAP = 100; // RED_MUSHROOM_BLOCK - public static final int IRON_BARS = 101; - public static final int GLASS_PANE = 102; public static final int PUMPKIN_STEM = 104; public static final int MELON_STEM = 105; public static final int VINE = 106; @@ -119,7 +110,6 @@ public final class BlockID { public static final int STONE_BRICK_STAIRS = 109; public static final int MYCELIUM = 110; public static final int LILY_PAD = 111; // WATERLILY - public static final int NETHER_BRICK_FENCE = 113; public static final int NETHER_BRICK_STAIRS = 114; public static final int NETHER_WART = 115; public static final int ENCHANTMENT_TABLE = 116; // ENCHANTING_TABLE @@ -155,12 +145,9 @@ public final class BlockID { public static final int ACTIVATOR_RAIL = 157; public static final int DROPPER = 158; public static final int STAINED_CLAY = 159; // STAINED_HARDENED_CLAY - public static final int STAINED_GLASS_PANE = 160; - public static final int LEAVES2 = 161; public static final int LOG2 = 162; public static final int ACACIA_STAIRS = 163; public static final int DARK_OAK_STAIRS = 164; - public static final int BARRIER = 166; public static final int IRON_TRAP_DOOR = 167; public static final int HAY_BLOCK = 170; public static final int CARPET = 171; @@ -169,29 +156,12 @@ public final class BlockID { public static final int STANDING_BANNER = 176; public static final int WALL_BANNER = 177; public static final int DAYLIGHT_SENSOR_INVERTED = 178; - public static final int RED_SANDSTONE_STAIRS = 180; public static final int STEP2 = 182; - public static final int SPRUCE_FENCE_GATE = 183; - public static final int BIRCH_FENCE_GATE = 184; - public static final int JUNGLE_FENCE_GATE = 185; - public static final int DARK_OAK_FENCE_GATE = 186; - public static final int ACACIA_FENCE_GATE = 187; - public static final int SPRUCE_FENCE = 188; - public static final int BIRCH_FENCE = 189; - public static final int JUNGLE_FENCE = 190; - public static final int DARK_OAK_FENCE = 191; - public static final int ACACIA_FENCE = 192; public static final int SPRUCE_DOOR = 193; public static final int BIRCH_DOOR = 194; public static final int JUNGLE_DOOR = 195; public static final int ACACIA_DOOR = 196; public static final int DARK_OAK_DOOR = 197; - public static final int END_ROD = 198; - public static final int CHORUS_PLANT = 199; - public static final int CHORUS_FLOWER = 200; - public static final int PURPUR_STAIRS = 203; - public static final int PURPUR_SLAB = 205; - public static final int BEETROOTS = 207; private BlockID() { } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockMaterial.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockMaterial.java index bf9e3abb0..c894136da 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockMaterial.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockMaterial.java @@ -180,4 +180,17 @@ public interface BlockMaterial { */ boolean isReplacedDuringPlacement(); + /** + * Get whether this block is translucent. + * + * @return true if the block is translucent + */ + boolean isTranslucent(); + + /** + * Gets whether the block has a container (Item container) + * + * @return If it has a container + */ + boolean hasContainer(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 44ccf731c..a01569bcf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -232,32 +232,6 @@ public enum BlockType { return centralTopLimit(block.getBlockType().getLegacyId(), 0); } - /** - * HashSet for isContainerBlock. - */ - private static final Set isContainerBlock = new HashSet<>(); - static { - isContainerBlock.add(BlockID.DISPENSER); - isContainerBlock.add(BlockID.FURNACE); - isContainerBlock.add(BlockID.BURNING_FURNACE); - isContainerBlock.add(BlockID.CHEST); - isContainerBlock.add(BlockID.BREWING_STAND); - isContainerBlock.add(BlockID.TRAPPED_CHEST); - isContainerBlock.add(BlockID.HOPPER); - isContainerBlock.add(BlockID.DROPPER); - //isContainerBlock.add(BlockID.ENDER_CHEST); // ender chest has no own inventory, don't add this here - } - - /** - * Returns true if the block is a container block. - * - * @param id the block ID - * @return true if the block is a container - */ - public static boolean isContainerBlock(int id) { - return isContainerBlock.contains(id); - } - /** * HashSet for isNaturalBlock. */ @@ -292,18 +266,6 @@ public enum BlockType { isNaturalTerrainBlock.add(BlockID.EMERALD_ORE); } - /** - * Checks if the block type is naturally occurring. - * - * @param id the type ID of the block - * @return true if the block type is naturally occurring - * @deprecated Use {@link #isNaturalTerrainBlock(int, int)} - */ - @Deprecated - public static boolean isNaturalTerrainBlock(int id) { - return isNaturalTerrainBlock.contains(id); - } - /** * Checks if the block type is naturally occurring * @@ -315,148 +277,6 @@ public enum BlockType { return isNaturalTerrainBlock.contains(-16*id-data) || isNaturalTerrainBlock.contains(id); } - /** - * HashSet for isTranslucent. - */ - private static final Set isTranslucent = new HashSet<>(); - static { - isTranslucent.add(BlockID.AIR); - isTranslucent.add(BlockID.SAPLING); - isTranslucent.add(BlockID.WATER); - isTranslucent.add(BlockID.STATIONARY_WATER); - isTranslucent.add(BlockID.LEAVES); - isTranslucent.add(BlockID.GLASS); - isTranslucent.add(BlockID.BED); - isTranslucent.add(BlockID.POWERED_RAIL); - isTranslucent.add(BlockID.DETECTOR_RAIL); - //isTranslucent.add(BlockID.PISTON_STICKY_BASE); - isTranslucent.add(BlockID.WEB); - isTranslucent.add(BlockID.LONG_GRASS); - isTranslucent.add(BlockID.DEAD_BUSH); - //isTranslucent.add(BlockID.PISTON_BASE); - isTranslucent.add(BlockID.PISTON_EXTENSION); - //isTranslucent.add(BlockID.PISTON_MOVING_PIECE); - isTranslucent.add(BlockID.YELLOW_FLOWER); - isTranslucent.add(BlockID.RED_FLOWER); - isTranslucent.add(BlockID.BROWN_MUSHROOM); - isTranslucent.add(BlockID.RED_MUSHROOM); - isTranslucent.add(BlockID.STEP); - isTranslucent.add(BlockID.TORCH); - isTranslucent.add(BlockID.FIRE); - isTranslucent.add(BlockID.MOB_SPAWNER); - isTranslucent.add(BlockID.OAK_WOOD_STAIRS); - isTranslucent.add(BlockID.CHEST); - isTranslucent.add(BlockID.REDSTONE_WIRE); - isTranslucent.add(BlockID.CROPS); - isTranslucent.add(BlockID.SIGN_POST); - isTranslucent.add(BlockID.WOODEN_DOOR); - isTranslucent.add(BlockID.LADDER); - isTranslucent.add(BlockID.MINECART_TRACKS); - isTranslucent.add(BlockID.COBBLESTONE_STAIRS); - isTranslucent.add(BlockID.WALL_SIGN); - isTranslucent.add(BlockID.LEVER); - isTranslucent.add(BlockID.STONE_PRESSURE_PLATE); - isTranslucent.add(BlockID.IRON_DOOR); - isTranslucent.add(BlockID.WOODEN_PRESSURE_PLATE); - isTranslucent.add(BlockID.REDSTONE_TORCH_OFF); - isTranslucent.add(BlockID.REDSTONE_TORCH_ON); - isTranslucent.add(BlockID.STONE_BUTTON); - isTranslucent.add(BlockID.SNOW); - isTranslucent.add(BlockID.ICE); - isTranslucent.add(BlockID.CACTUS); - isTranslucent.add(BlockID.REED); - isTranslucent.add(BlockID.FENCE); - isTranslucent.add(BlockID.PORTAL); - isTranslucent.add(BlockID.CAKE_BLOCK); - isTranslucent.add(BlockID.REDSTONE_REPEATER_OFF); - isTranslucent.add(BlockID.REDSTONE_REPEATER_ON); - isTranslucent.add(BlockID.TRAP_DOOR); - isTranslucent.add(BlockID.IRON_BARS); - isTranslucent.add(BlockID.GLASS_PANE); - isTranslucent.add(BlockID.PUMPKIN_STEM); - isTranslucent.add(BlockID.MELON_STEM); - isTranslucent.add(BlockID.VINE); - isTranslucent.add(BlockID.FENCE_GATE); - isTranslucent.add(BlockID.BRICK_STAIRS); - isTranslucent.add(BlockID.STONE_BRICK_STAIRS); - isTranslucent.add(BlockID.LILY_PAD); - isTranslucent.add(BlockID.NETHER_BRICK_FENCE); - isTranslucent.add(BlockID.NETHER_BRICK_STAIRS); - isTranslucent.add(BlockID.NETHER_WART); - isTranslucent.add(BlockID.ENCHANTMENT_TABLE); - isTranslucent.add(BlockID.BREWING_STAND); - isTranslucent.add(BlockID.CAULDRON); - isTranslucent.add(BlockID.WOODEN_STEP); - isTranslucent.add(BlockID.COCOA_PLANT); - isTranslucent.add(BlockID.SANDSTONE_STAIRS); - isTranslucent.add(BlockID.ENDER_CHEST); - isTranslucent.add(BlockID.TRIPWIRE_HOOK); - isTranslucent.add(BlockID.TRIPWIRE); - isTranslucent.add(BlockID.SPRUCE_WOOD_STAIRS); - isTranslucent.add(BlockID.BIRCH_WOOD_STAIRS); - isTranslucent.add(BlockID.JUNGLE_WOOD_STAIRS); - isTranslucent.add(BlockID.COBBLESTONE_WALL); - isTranslucent.add(BlockID.FLOWER_POT); - isTranslucent.add(BlockID.CARROTS); - isTranslucent.add(BlockID.POTATOES); - isTranslucent.add(BlockID.WOODEN_BUTTON); - isTranslucent.add(BlockID.HEAD); - isTranslucent.add(BlockID.ANVIL); - isTranslucent.add(BlockID.TRAPPED_CHEST); - isTranslucent.add(BlockID.PRESSURE_PLATE_LIGHT); - isTranslucent.add(BlockID.PRESSURE_PLATE_HEAVY); - isTranslucent.add(BlockID.COMPARATOR_OFF); - isTranslucent.add(BlockID.COMPARATOR_ON); - isTranslucent.add(BlockID.DAYLIGHT_SENSOR); - isTranslucent.add(BlockID.HOPPER); - isTranslucent.add(BlockID.QUARTZ_STAIRS); - isTranslucent.add(BlockID.ACTIVATOR_RAIL); - isTranslucent.add(BlockID.ACACIA_STAIRS); - isTranslucent.add(BlockID.DARK_OAK_STAIRS); - isTranslucent.add(BlockID.BARRIER); - isTranslucent.add(BlockID.IRON_TRAP_DOOR); - isTranslucent.add(BlockID.CARPET); - isTranslucent.add(BlockID.LEAVES2); - isTranslucent.add(BlockID.STAINED_GLASS_PANE); - isTranslucent.add(BlockID.DOUBLE_PLANT); - isTranslucent.add(BlockID.STANDING_BANNER); - isTranslucent.add(BlockID.WALL_BANNER); - isTranslucent.add(BlockID.DAYLIGHT_SENSOR_INVERTED); - isTranslucent.add(BlockID.RED_SANDSTONE_STAIRS); - isTranslucent.add(BlockID.STEP2); - isTranslucent.add(BlockID.SPRUCE_FENCE_GATE); - isTranslucent.add(BlockID.BIRCH_FENCE_GATE); - isTranslucent.add(BlockID.JUNGLE_FENCE_GATE); - isTranslucent.add(BlockID.DARK_OAK_FENCE_GATE); - isTranslucent.add(BlockID.ACACIA_FENCE_GATE); - isTranslucent.add(BlockID.SPRUCE_FENCE); - isTranslucent.add(BlockID.BIRCH_FENCE); - isTranslucent.add(BlockID.JUNGLE_FENCE); - isTranslucent.add(BlockID.DARK_OAK_FENCE); - isTranslucent.add(BlockID.ACACIA_FENCE); - isTranslucent.add(BlockID.SPRUCE_DOOR); - isTranslucent.add(BlockID.BIRCH_DOOR); - isTranslucent.add(BlockID.JUNGLE_DOOR); - isTranslucent.add(BlockID.ACACIA_DOOR); - isTranslucent.add(BlockID.DARK_OAK_DOOR); - isTranslucent.add(BlockID.END_ROD); - isTranslucent.add(BlockID.CHORUS_PLANT); - isTranslucent.add(BlockID.CHORUS_FLOWER); - isTranslucent.add(BlockID.PURPUR_STAIRS); - isTranslucent.add(BlockID.PURPUR_SLAB); - isTranslucent.add(BlockID.BEETROOTS); - } - - /** - * Checks if the block type lets light through. - * - * @param id the type ID of the block - * @return true if the block type lets light through - */ - public static boolean isTranslucent(int id) { - return isTranslucent.contains(id); - } - private static final Map dataAttachments = new HashMap<>(); private static final Map nonDataAttachments = new HashMap<>(); static { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index 8356ef15e..3fcd53287 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.extent.validation; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.extent.AbstractDelegateExtent; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index 9f306fc5d..254dbbf34 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -19,19 +19,17 @@ package com.sk89q.worldedit.extent.world; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; -import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Handles various quirks when setting blocks, such as ice turning * into water or containers dropping their contents. @@ -54,10 +52,9 @@ public class BlockQuirkExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector position, BlockStateHolder block) throws WorldEditException { - BaseBlock lazyBlock = getExtent().getLazyBlock(position); - com.sk89q.worldedit.blocks.type.BlockType existing = lazyBlock.getBlockType(); + BlockType existing = getExtent().getBlock(position).getBlockType(); - if (BlockType.isContainerBlock(existing.getLegacyId())) { + if (existing.getMaterial().hasContainer()) { world.clearContainerBlockContents(position); // Clear the container block so that it doesn't drop items } else if (existing == BlockTypes.ICE) { world.setBlock(position, BlockTypes.AIR.getDefaultState()); // Ice turns until water so this has to be done first diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java index 3090cb972..68878d352 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java @@ -19,17 +19,16 @@ package com.sk89q.worldedit.extent.world; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Makes changes to the world as if a player had done so during survival mode. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java index 8dffdba77..6f5cb958a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java @@ -48,7 +48,7 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockType(double x, double y, double z) { - return editSession.getLazyBlock(toWorld(x, y, z)).getId(); + return editSession.getBlock(toWorld(x, y, z)).getBlockType().getLegacyId(); } @Override @@ -58,7 +58,7 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockTypeAbs(double x, double y, double z) { - return editSession.getLazyBlock(new Vector(x, y, z)).getId(); + return editSession.getBlock(toWorld(x, y, z)).getBlockType().getLegacyId(); } @Override @@ -68,7 +68,7 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockTypeRel(double x, double y, double z) { - return editSession.getLazyBlock(toWorldRel(x, y, z)).getId(); + return editSession.getBlock(toWorld(x, y, z)).getBlockType().getLegacyId(); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java index 8caecc3f2..f37229886 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java @@ -19,8 +19,7 @@ package com.sk89q.worldedit.util; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index ce5b6fc8d..aa01cd230 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -26,6 +26,7 @@ import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.blocks.type.BlockType; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.mask.BlockMask; @@ -93,7 +94,7 @@ public abstract class AbstractWorld implements World { } @Override - public boolean queueBlockBreakEffect(Platform server, Vector position, com.sk89q.worldedit.blocks.type.BlockType blockType, double priority) { + public boolean queueBlockBreakEffect(Platform server, Vector position, BlockType blockType, double priority) { if (taskId == -1) { taskId = server.schedule(0, 1, () -> { int max = Math.max(1, Math.min(30, effectQueue.size() / 3)); @@ -131,10 +132,10 @@ public abstract class AbstractWorld implements World { private class QueuedEffect implements Comparable { private final Vector position; - private final com.sk89q.worldedit.blocks.type.BlockType blockType; + private final BlockType blockType; private final double priority; - private QueuedEffect(Vector position, com.sk89q.worldedit.blocks.type.BlockType blockType, double priority) { + private QueuedEffect(Vector position, BlockType blockType, double priority) { this.position = position; this.blockType = blockType; this.priority = priority; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleBlockMaterial.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleBlockMaterial.java index 7b190c740..9ad54acf6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleBlockMaterial.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleBlockMaterial.java @@ -45,6 +45,8 @@ class SimpleBlockMaterial implements BlockMaterial { private boolean burnable; private boolean toolRequired; private boolean replacedDuringPlacement; + private boolean isTranslucent; + private boolean hasContainer; @Override public boolean isRenderedAsNormalBlock() { @@ -240,7 +242,25 @@ class SimpleBlockMaterial implements BlockMaterial { return replacedDuringPlacement; } + public void setTranslucent(boolean isTranslucent) { + this.isTranslucent = isTranslucent; + } + + @Override + public boolean isTranslucent() { + return this.isTranslucent; + } + public void setReplacedDuringPlacement(boolean replacedDuringPlacement) { this.replacedDuringPlacement = replacedDuringPlacement; } + + @Override + public boolean hasContainer() { + return this.hasContainer; + } + + public void setHasContainer(boolean hasContainer) { + this.hasContainer = hasContainer; + } } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 2e30ab7f3..04b900d06 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -35,7 +35,6 @@ import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.blocks.type.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -47,6 +46,7 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.registry.LegacyMapper; import net.minecraft.block.Block; import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockOldLeaf; @@ -356,15 +356,12 @@ public class ForgeWorld extends AbstractWorld { BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); IBlockState state = world.getBlockState(pos); - return BlockTypes.getBlockType(net.minecraftforge.fml.common.registry.ForgeRegistries.BLOCKS.getKey(state.getBlock()).toString()).getDefaultState(); // TODO Data + return LegacyMapper.getInstance().getBlockFromLegacy(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state)); } @Override public LazyBlock getLazyBlock(Vector position) { - World world = getWorld(); - BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - IBlockState state = world.getBlockState(pos); - return new LazyBlock(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state), this, position); + return new LazyBlock(getBlock(position), this, position); } @Override @@ -377,7 +374,7 @@ public class ForgeWorld extends AbstractWorld { if (tile != null) { return new TileEntityBaseBlock(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state), tile); } else { - return new BaseBlock(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state)); + return new BaseBlock(getBlock(position)); } } @@ -404,7 +401,7 @@ public class ForgeWorld extends AbstractWorld { @Override public List getEntities(Region region) { - List entities = new ArrayList(); + List entities = new ArrayList<>(); for (net.minecraft.entity.Entity entity : getWorld().loadedEntityList) { if (region.contains(new Vector(entity.posX, entity.posY, entity.posZ))) { entities.add(new ForgeEntity(entity)); @@ -415,7 +412,7 @@ public class ForgeWorld extends AbstractWorld { @Override public List getEntities() { - List entities = new ArrayList(); + List entities = new ArrayList<>(); for (net.minecraft.entity.Entity entity : getWorld().loadedEntityList) { entities.add(new ForgeEntity(entity)); } From efa09001c2f5143b69b4339e1d510aca0d43ad0f Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 3 Jul 2018 00:45:38 +1000 Subject: [PATCH 30/74] Remove the 'natural only' smooth brush feature due to inaccuracies. --- .../java/com/sk89q/worldedit/EditSession.java | 21 ++------- .../com/sk89q/worldedit/blocks/BlockID.java | 29 ------------ .../com/sk89q/worldedit/blocks/BlockType.java | 45 ------------------- .../worldedit/command/BrushCommands.java | 12 ++--- .../worldedit/command/RegionCommands.java | 8 ++-- .../command/tool/brush/SmoothBrush.java | 8 +--- .../worldedit/math/convolution/HeightMap.java | 15 +------ 7 files changed, 13 insertions(+), 125 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index d69a558ea..40c10aa45 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -416,34 +416,19 @@ public class EditSession implements Extent { } /** - * Returns the highest solid 'terrain' block which can occur naturally. - * - * @param x the X coordinate - * @param z the Z cooridnate - * @param minY minimal height - * @param maxY maximal height - * @return height of highest block found or 'minY' - */ - public int getHighestTerrainBlock(int x, int z, int minY, int maxY) { - return getHighestTerrainBlock(x, z, minY, maxY, false); - } - - /** - * Returns the highest solid 'terrain' block which can occur naturally. + * Returns the highest solid 'terrain' block. * * @param x the X coordinate * @param z the Z coordinate * @param minY minimal height * @param maxY maximal height - * @param naturalOnly look at natural blocks or all blocks * @return height of highest block found or 'minY' */ - public int getHighestTerrainBlock(int x, int z, int minY, int maxY, boolean naturalOnly) { + public int getHighestTerrainBlock(int x, int z, int minY, int maxY) { for (int y = maxY; y >= minY; --y) { Vector pt = new Vector(x, y, z); BlockState block = getBlock(pt); - int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(block); - if (naturalOnly ? BlockType.isNaturalTerrainBlock(datas[0], datas[1]) : block.getBlockType().getMaterial().isMovementBlocker()) { + if (block.getBlockType().getMaterial().isMovementBlocker()) { return y; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index a92eae5f3..920442231 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -26,19 +26,8 @@ package com.sk89q.worldedit.blocks; */ @Deprecated public final class BlockID { - public static final int AIR = 0; - public static final int STONE = 1; - public static final int GRASS = 2; - public static final int DIRT = 3; public static final int SAPLING = 6; - public static final int BEDROCK = 7; - public static final int SAND = 12; - public static final int GRAVEL = 13; - public static final int GOLD_ORE = 14; - public static final int IRON_ORE = 15; - public static final int COAL_ORE = 16; public static final int LOG = 17; - public static final int LAPIS_LAZULI_ORE = 21; // LAPIS_ORE public static final int DISPENSER = 23; public static final int BED = 26; public static final int POWERED_RAIL = 27; // GOLDEN_RAIL @@ -54,15 +43,11 @@ public final class BlockID { public static final int BROWN_MUSHROOM = 39; public static final int RED_MUSHROOM = 40; public static final int STEP = 44; // STONE_SLAB - public static final int TNT = 46; public static final int TORCH = 50; public static final int FIRE = 51; - @Deprecated - public static final int WOODEN_STAIRS = 53; public static final int OAK_WOOD_STAIRS = 53; // OAK_STAIRS public static final int CHEST = 54; public static final int REDSTONE_WIRE = 55; - public static final int DIAMOND_ORE = 56; public static final int CROPS = 59; // WHEAT public static final int FURNACE = 61; public static final int BURNING_FURNACE = 62; // LIT_FURNACE @@ -76,29 +61,20 @@ public final class BlockID { public static final int STONE_PRESSURE_PLATE = 70; public static final int IRON_DOOR = 71; public static final int WOODEN_PRESSURE_PLATE = 72; - public static final int REDSTONE_ORE = 73; // LIT_REDSTONE_ORE - public static final int GLOWING_REDSTONE_ORE = 74; // UNLIT_REDSTONE_ORE public static final int REDSTONE_TORCH_OFF = 75; // UNLIT_REDSTONE_TORCH public static final int REDSTONE_TORCH_ON = 76; // LIT_REDSTONE_TORCH public static final int STONE_BUTTON = 77; public static final int SNOW = 78; // SNOW_LAYER public static final int CACTUS = 81; - public static final int CLAY = 82; public static final int REED = 83; // REEDS public static final int FENCE = 85; public static final int PUMPKIN = 86; - @Deprecated - public static final int NETHERSTONE = 87; - public static final int NETHERRACK = 87; public static final int SLOW_SAND = 88; // SOUL_SAND - public static final int LIGHTSTONE = 89; // GLOWSTONE public static final int PORTAL = 90; public static final int JACKOLANTERN = 91; // LIT_PUMPKIN public static final int CAKE_BLOCK = 92; // CAKE public static final int REDSTONE_REPEATER_OFF = 93; // UNPOWERED_REPEATER public static final int REDSTONE_REPEATER_ON = 94; // POWERED_REPEATER - @Deprecated - public static final int LOCKED_CHEST = 95; public static final int TRAP_DOOR = 96; // TRAPDOOR public static final int BROWN_MUSHROOM_CAP = 99; // BROWN_MUSHROOM_BLOCK public static final int RED_MUSHROOM_CAP = 100; // RED_MUSHROOM_BLOCK @@ -108,7 +84,6 @@ public final class BlockID { public static final int FENCE_GATE = 107; public static final int BRICK_STAIRS = 108; public static final int STONE_BRICK_STAIRS = 109; - public static final int MYCELIUM = 110; public static final int LILY_PAD = 111; // WATERLILY public static final int NETHER_BRICK_STAIRS = 114; public static final int NETHER_WART = 115; @@ -119,7 +94,6 @@ public final class BlockID { public static final int WOODEN_STEP = 126; // WOODEN_SLAB public static final int COCOA_PLANT = 127; // COCOA public static final int SANDSTONE_STAIRS = 128; - public static final int EMERALD_ORE = 129; public static final int ENDER_CHEST = 130; public static final int TRIPWIRE_HOOK = 131; public static final int TRIPWIRE = 132; @@ -139,19 +113,16 @@ public final class BlockID { public static final int COMPARATOR_OFF = 149; // UNPOWERED_COMPARATOR public static final int COMPARATOR_ON = 150; // COMPARATOR public static final int DAYLIGHT_SENSOR = 151; // DAYLIGHT_DETECTOR - public static final int QUARTZ_ORE = 153; public static final int HOPPER = 154; public static final int QUARTZ_STAIRS = 156; public static final int ACTIVATOR_RAIL = 157; public static final int DROPPER = 158; - public static final int STAINED_CLAY = 159; // STAINED_HARDENED_CLAY public static final int LOG2 = 162; public static final int ACACIA_STAIRS = 163; public static final int DARK_OAK_STAIRS = 164; public static final int IRON_TRAP_DOOR = 167; public static final int HAY_BLOCK = 170; public static final int CARPET = 171; - public static final int PACKED_ICE = 174; public static final int DOUBLE_PLANT = 175; public static final int STANDING_BANNER = 176; public static final int WALL_BANNER = 177; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index a01569bcf..53d29d195 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -232,51 +232,6 @@ public enum BlockType { return centralTopLimit(block.getBlockType().getLegacyId(), 0); } - /** - * HashSet for isNaturalBlock. - */ - private static final Set isNaturalTerrainBlock = new HashSet<>(); - static { - isNaturalTerrainBlock.add(BlockID.STONE); - isNaturalTerrainBlock.add(BlockID.GRASS); - isNaturalTerrainBlock.add(BlockID.DIRT); - // isNaturalBlock.add(BlockID.COBBLESTONE); // technically can occur next to water and lava - isNaturalTerrainBlock.add(BlockID.BEDROCK); - isNaturalTerrainBlock.add(BlockID.SAND); - isNaturalTerrainBlock.add(BlockID.GRAVEL); - isNaturalTerrainBlock.add(BlockID.CLAY); - isNaturalTerrainBlock.add(BlockID.MYCELIUM); - isNaturalTerrainBlock.add(BlockID.PACKED_ICE); - isNaturalTerrainBlock.add(BlockID.STAINED_CLAY); - - // hell - isNaturalTerrainBlock.add(BlockID.NETHERRACK); - isNaturalTerrainBlock.add(BlockID.SLOW_SAND); - isNaturalTerrainBlock.add(BlockID.LIGHTSTONE); - isNaturalTerrainBlock.add(BlockID.QUARTZ_ORE); - - // ores - isNaturalTerrainBlock.add(BlockID.COAL_ORE); - isNaturalTerrainBlock.add(BlockID.IRON_ORE); - isNaturalTerrainBlock.add(BlockID.GOLD_ORE); - isNaturalTerrainBlock.add(BlockID.LAPIS_LAZULI_ORE); - isNaturalTerrainBlock.add(BlockID.DIAMOND_ORE); - isNaturalTerrainBlock.add(BlockID.REDSTONE_ORE); - isNaturalTerrainBlock.add(BlockID.GLOWING_REDSTONE_ORE); - isNaturalTerrainBlock.add(BlockID.EMERALD_ORE); - } - - /** - * Checks if the block type is naturally occurring - * - * @param id the type ID of the block - * @param data data value of the block - * @return true if the block type is naturally occurring - */ - public static boolean isNaturalTerrainBlock(int id, int data) { - return isNaturalTerrainBlock.contains(-16*id-data) || isNaturalTerrainBlock.contains(id); - } - private static final Map dataAttachments = new HashMap<>(); private static final Map nonDataAttachments = new HashMap<>(); static { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index eaf2ac45d..0b16988a5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -158,27 +158,23 @@ public class BrushCommands { @Command( aliases = { "smooth" }, usage = "[size] [iterations]", - flags = "n", desc = "Choose the terrain softener brush", help = - "Chooses the terrain softener brush.\n" + - "The -n flag makes it only consider naturally occurring blocks.", + "Chooses the terrain softener brush.", min = 0, max = 2 ) @CommandPermissions("worldedit.brush.smooth") public void smoothBrush(Player player, LocalSession session, EditSession editSession, - @Optional("2") double radius, @Optional("4") int iterations, @Switch('n') - boolean naturalBlocksOnly) throws WorldEditException { + @Optional("2") double radius, @Optional("4") int iterations) throws WorldEditException { worldEdit.checkMaxBrushRadius(radius); BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setSize(radius); - tool.setBrush(new SmoothBrush(iterations, naturalBlocksOnly), "worldedit.brush.smooth"); + tool.setBrush(new SmoothBrush(iterations), "worldedit.brush.smooth"); - player.print(String.format("Smooth brush equipped (%.0f x %dx, using " + (naturalBlocksOnly ? "natural blocks only" : "any block") + ").", - radius, iterations)); + player.print(String.format("Smooth brush equipped (%.0f x %dx, using any block).", radius, iterations)); } @Command( diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index cd78705be..61f2edb75 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -234,18 +234,16 @@ public class RegionCommands { @Command( aliases = { "/smooth" }, usage = "[iterations]", - flags = "n", desc = "Smooth the elevation in the selection", help = - "Smooths the elevation in the selection.\n" + - "The -n flag makes it only consider naturally occuring blocks.", + "Smooths the elevation in the selection.", min = 0, max = 1 ) @CommandPermissions("worldedit.region.smooth") @Logging(REGION) - public void smooth(Player player, EditSession editSession, @Selection Region region, @Optional("1") int iterations, @Switch('n') boolean affectNatural) throws WorldEditException { - HeightMap heightMap = new HeightMap(editSession, region, affectNatural); + public void smooth(Player player, EditSession editSession, @Selection Region region, @Optional("1") int iterations) throws WorldEditException { + HeightMap heightMap = new HeightMap(editSession, region); HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0)); int affected = heightMap.applyFilter(filter, iterations); player.print("Terrain's height map smoothed. " + affected + " block(s) changed."); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java index 6e8318889..d52ebbd4b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java @@ -33,15 +33,9 @@ import com.sk89q.worldedit.util.Location; public class SmoothBrush implements Brush { private int iterations; - private boolean naturalOnly; public SmoothBrush(int iterations) { - this(iterations, false); - } - - public SmoothBrush(int iterations, boolean naturalOnly) { this.iterations = iterations; - this.naturalOnly = naturalOnly; } @Override @@ -49,7 +43,7 @@ public class SmoothBrush implements Brush { Location min = new Location(editSession.getWorld(), position.subtract(size, size, size)); Vector max = position.add(size, size + 10, size); Region region = new CuboidRegion(editSession.getWorld(), min.toVector(), max); - HeightMap heightMap = new HeightMap(editSession, region, naturalOnly); + HeightMap heightMap = new HeightMap(editSession, region); HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0)); heightMap.applyFilter(filter, iterations); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index cc37ee0a6..79240507e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -44,22 +44,11 @@ public class HeightMap { /** * Constructs the HeightMap - * + * * @param session an edit session * @param region the region */ public HeightMap(EditSession session, Region region) { - this(session, region, false); - } - - /** - * Constructs the HeightMap - * - * @param session an edit session - * @param region the region - * @param naturalOnly ignore non-natural blocks - */ - public HeightMap(EditSession session, Region region, boolean naturalOnly) { checkNotNull(session); checkNotNull(region); @@ -78,7 +67,7 @@ public class HeightMap { data = new int[width * height]; for (int z = 0; z < height; ++z) { for (int x = 0; x < width; ++x) { - data[z * width + x] = session.getHighestTerrainBlock(x + minX, z + minZ, minY, maxY, naturalOnly); + data[z * width + x] = session.getHighestTerrainBlock(x + minX, z + minZ, minY, maxY); } } } From 7db443a69aeea9adacb81c7aa267c040c45537eb Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 5 Jul 2018 17:00:46 +1000 Subject: [PATCH 31/74] Migrate the logic for which pass a block goes into. Also updated it and made it use tags where possible. --- .../bukkit/adapter/BukkitImplAdapter.java | 21 --- .../com/sk89q/worldedit/blocks/LazyBlock.java | 17 --- .../com/sk89q/worldedit/blocks/BaseBlock.java | 28 ++-- .../com/sk89q/worldedit/blocks/BlockID.java | 4 - .../com/sk89q/worldedit/blocks/BlockType.java | 106 ---------------- .../com/sk89q/worldedit/blocks/Blocks.java | 120 ++++++++++++++++++ .../extent/reorder/MultiStageReorder.java | 52 +++----- .../sponge/adapter/SpongeImplAdapter.java | 20 --- 8 files changed, 147 insertions(+), 221 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 0431c690a..01d22a6da 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.block.Biome; import org.bukkit.entity.Entity; @@ -34,26 +33,6 @@ import javax.annotation.Nullable; */ public interface BukkitImplAdapter { - /** - * Get the block ID for the given material. - * - *

Returns 0 if it is not known or it doesn't exist.

- * - * @param material the material - * @return the block ID - */ - int getBlockId(Material material); - - /** - * Get the material for the given block ID. - * - *

Returns {@link Material#AIR} if it is not known or it doesn't exist.

- * - * @param id the block ID - * @return the material - */ - Material getMaterial(int id); - /** * Get the biome ID for the given biome. * diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java index 5baf31e4d..dd51998d8 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java @@ -74,23 +74,6 @@ public class LazyBlock extends BaseBlock { this.position = position; } - /** - * Create a new lazy block. - * - * @param type the block type - * @param data the data value - * @param extent the extent to later load the full block data from - * @param position the position to later load the full block data from - */ - @Deprecated - public LazyBlock(int type, int data, Extent extent, Vector position) { - super(type, data); - checkNotNull(extent); - checkNotNull(position); - this.extent = extent; - this.position = position; - } - @Override public CompoundTag getNbtData() { if (!loaded) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index df35b3043..f9ec27187 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -56,24 +56,6 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { @Nullable private CompoundTag nbtData; - /** - * Construct a block with the given ID and a data value of 0. - * - * @param id ID value - */ - @Deprecated - public BaseBlock(int id) { - try { - this.blockState = LegacyMapper.getInstance().getBlockFromLegacy(id); - if (this.blockState == null) { - this.blockState = BlockTypes.AIR.getDefaultState(); - } - } catch (Exception e) { - System.out.println(id); - e.printStackTrace(); - } - } - /** * Construct a block with a state. * @@ -111,7 +93,15 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { */ @Deprecated public BaseBlock(int id, int data) { - this(id); + try { + this.blockState = LegacyMapper.getInstance().getBlockFromLegacy(id, data); + if (this.blockState == null) { + this.blockState = BlockTypes.AIR.getDefaultState(); + } + } catch (Exception e) { + System.out.println(id); + e.printStackTrace(); + } } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index 920442231..4e4418157 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -37,14 +37,12 @@ public final class BlockID { public static final int DEAD_BUSH = 32; // DEADBUSH public static final int PISTON_BASE = 33; // PISTON public static final int PISTON_EXTENSION = 34; // PISTON_HEAD - public static final int PISTON_MOVING_PIECE = 36; // PISTON_EXTENSION public static final int YELLOW_FLOWER = 37; public static final int RED_FLOWER = 38; public static final int BROWN_MUSHROOM = 39; public static final int RED_MUSHROOM = 40; public static final int STEP = 44; // STONE_SLAB public static final int TORCH = 50; - public static final int FIRE = 51; public static final int OAK_WOOD_STAIRS = 53; // OAK_STAIRS public static final int CHEST = 54; public static final int REDSTONE_WIRE = 55; @@ -70,7 +68,6 @@ public final class BlockID { public static final int FENCE = 85; public static final int PUMPKIN = 86; public static final int SLOW_SAND = 88; // SOUL_SAND - public static final int PORTAL = 90; public static final int JACKOLANTERN = 91; // LIT_PUMPKIN public static final int CAKE_BLOCK = 92; // CAKE public static final int REDSTONE_REPEATER_OFF = 93; // UNPOWERED_REPEATER @@ -126,7 +123,6 @@ public final class BlockID { public static final int DOUBLE_PLANT = 175; public static final int STANDING_BANNER = 176; public static final int WALL_BANNER = 177; - public static final int DAYLIGHT_SENSOR_INVERTED = 178; public static final int STEP2 = 182; public static final int SPRUCE_DOOR = 193; public static final int BIRCH_DOOR = 194; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 53d29d195..200b68cc2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -25,9 +25,7 @@ import com.sk89q.worldedit.PlayerDirection; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; /** * Block types. @@ -39,110 +37,6 @@ public enum BlockType { ; - /** - * HashSet for shouldPlaceLast. - */ - private static final Set shouldPlaceLast = new HashSet<>(); - static { - shouldPlaceLast.add(BlockID.SAPLING); - shouldPlaceLast.add(BlockID.BED); - shouldPlaceLast.add(BlockID.POWERED_RAIL); - shouldPlaceLast.add(BlockID.DETECTOR_RAIL); - shouldPlaceLast.add(BlockID.LONG_GRASS); - shouldPlaceLast.add(BlockID.DEAD_BUSH); - shouldPlaceLast.add(BlockID.YELLOW_FLOWER); - shouldPlaceLast.add(BlockID.RED_FLOWER); - shouldPlaceLast.add(BlockID.BROWN_MUSHROOM); - shouldPlaceLast.add(BlockID.RED_MUSHROOM); - shouldPlaceLast.add(BlockID.TORCH); - shouldPlaceLast.add(BlockID.FIRE); - shouldPlaceLast.add(BlockID.REDSTONE_WIRE); - shouldPlaceLast.add(BlockID.CROPS); - shouldPlaceLast.add(BlockID.LADDER); - shouldPlaceLast.add(BlockID.MINECART_TRACKS); - shouldPlaceLast.add(BlockID.LEVER); - shouldPlaceLast.add(BlockID.STONE_PRESSURE_PLATE); - shouldPlaceLast.add(BlockID.WOODEN_PRESSURE_PLATE); - shouldPlaceLast.add(BlockID.REDSTONE_TORCH_OFF); - shouldPlaceLast.add(BlockID.REDSTONE_TORCH_ON); - shouldPlaceLast.add(BlockID.STONE_BUTTON); - shouldPlaceLast.add(BlockID.SNOW); - shouldPlaceLast.add(BlockID.PORTAL); - shouldPlaceLast.add(BlockID.REDSTONE_REPEATER_OFF); - shouldPlaceLast.add(BlockID.REDSTONE_REPEATER_ON); - shouldPlaceLast.add(BlockID.TRAP_DOOR); - shouldPlaceLast.add(BlockID.VINE); - shouldPlaceLast.add(BlockID.LILY_PAD); - shouldPlaceLast.add(BlockID.NETHER_WART); - shouldPlaceLast.add(BlockID.PISTON_BASE); - shouldPlaceLast.add(BlockID.PISTON_STICKY_BASE); - shouldPlaceLast.add(BlockID.PISTON_EXTENSION); - shouldPlaceLast.add(BlockID.PISTON_MOVING_PIECE); - shouldPlaceLast.add(BlockID.COCOA_PLANT); - shouldPlaceLast.add(BlockID.TRIPWIRE_HOOK); - shouldPlaceLast.add(BlockID.TRIPWIRE); - shouldPlaceLast.add(BlockID.FLOWER_POT); - shouldPlaceLast.add(BlockID.CARROTS); - shouldPlaceLast.add(BlockID.POTATOES); - shouldPlaceLast.add(BlockID.WOODEN_BUTTON); - shouldPlaceLast.add(BlockID.ANVIL); // becomes relevant with asynchronous placement - shouldPlaceLast.add(BlockID.PRESSURE_PLATE_LIGHT); - shouldPlaceLast.add(BlockID.PRESSURE_PLATE_HEAVY); - shouldPlaceLast.add(BlockID.COMPARATOR_OFF); - shouldPlaceLast.add(BlockID.COMPARATOR_ON); - shouldPlaceLast.add(BlockID.ACTIVATOR_RAIL); - shouldPlaceLast.add(BlockID.IRON_TRAP_DOOR); - shouldPlaceLast.add(BlockID.CARPET); - shouldPlaceLast.add(BlockID.DOUBLE_PLANT); - shouldPlaceLast.add(BlockID.DAYLIGHT_SENSOR_INVERTED); - } - - /** - * Checks to see whether a block should be placed last (when reordering - * blocks that are placed). - * - * @param id the block ID - * @return true if the block should be placed last - */ - public static boolean shouldPlaceLast(int id) { - return shouldPlaceLast.contains(id); - } - - /** - * HashSet for shouldPlaceLast. - */ - private static final Set shouldPlaceFinal = new HashSet<>(); - static { - shouldPlaceFinal.add(BlockID.SIGN_POST); - shouldPlaceFinal.add(BlockID.WOODEN_DOOR); - shouldPlaceFinal.add(BlockID.ACACIA_DOOR); - shouldPlaceFinal.add(BlockID.BIRCH_DOOR); - shouldPlaceFinal.add(BlockID.JUNGLE_DOOR); - shouldPlaceFinal.add(BlockID.DARK_OAK_DOOR); - shouldPlaceFinal.add(BlockID.SPRUCE_DOOR); - shouldPlaceFinal.add(BlockID.WALL_SIGN); - shouldPlaceFinal.add(BlockID.IRON_DOOR); - shouldPlaceFinal.add(BlockID.CACTUS); - shouldPlaceFinal.add(BlockID.REED); - shouldPlaceFinal.add(BlockID.CAKE_BLOCK); - shouldPlaceFinal.add(BlockID.PISTON_EXTENSION); - shouldPlaceFinal.add(BlockID.PISTON_MOVING_PIECE); - shouldPlaceFinal.add(BlockID.STANDING_BANNER); - shouldPlaceFinal.add(BlockID.WALL_BANNER); - } - - /** - * Checks to see whether a block should be placed in the final queue. - * - * This applies to blocks that can be attached to other blocks that have an attachment. - * - * @param id the type ID of the block - * @return whether the block is in the final queue - */ - public static boolean shouldPlaceFinal(int id) { - return shouldPlaceFinal.contains(id); - } - /** * HashSet for centralTopLimit. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java index 89f158745..bb47190e4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java @@ -19,9 +19,14 @@ package com.sk89q.worldedit.blocks; +import com.sk89q.worldedit.blocks.type.BlockCategories; import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.blocks.type.BlockTypes; import java.util.Collection; +import java.util.HashSet; +import java.util.Set; /** * Block-related utility methods. @@ -31,6 +36,121 @@ public final class Blocks { private Blocks() { } + /** + * HashSet for shouldPlaceLast. + */ + private static final Set shouldPlaceLast = new HashSet<>(); + static { + shouldPlaceLast.addAll(BlockCategories.SAPLINGS.getBlockTypes()); + shouldPlaceLast.addAll(BlockCategories.FLOWER_POTS.getBlockTypes()); + shouldPlaceLast.addAll(BlockCategories.BUTTONS.getBlockTypes()); + shouldPlaceLast.addAll(BlockCategories.ANVIL.getBlockTypes()); // becomes relevant with asynchronous placement + shouldPlaceLast.addAll(BlockCategories.WOODEN_PRESSURE_PLATES.getBlockTypes()); + shouldPlaceLast.addAll(BlockCategories.CARPETS.getBlockTypes()); + shouldPlaceLast.addAll(BlockCategories.RAILS.getBlockTypes()); + shouldPlaceLast.add(BlockTypes.BLACK_BED); + shouldPlaceLast.add(BlockTypes.BLUE_BED); + shouldPlaceLast.add(BlockTypes.BROWN_BED); + shouldPlaceLast.add(BlockTypes.CYAN_BED); + shouldPlaceLast.add(BlockTypes.GRAY_BED); + shouldPlaceLast.add(BlockTypes.GREEN_BED); + shouldPlaceLast.add(BlockTypes.LIGHT_BLUE_BED); + shouldPlaceLast.add(BlockTypes.LIGHT_GRAY_BED); + shouldPlaceLast.add(BlockTypes.LIME_BED); + shouldPlaceLast.add(BlockTypes.MAGENTA_BED); + shouldPlaceLast.add(BlockTypes.ORANGE_BED); + shouldPlaceLast.add(BlockTypes.PINK_BED); + shouldPlaceLast.add(BlockTypes.PURPLE_BED); + shouldPlaceLast.add(BlockTypes.RED_BED); + shouldPlaceLast.add(BlockTypes.WHITE_BED); + shouldPlaceLast.add(BlockTypes.YELLOW_BED); + shouldPlaceLast.add(BlockTypes.GRASS); + shouldPlaceLast.add(BlockTypes.TALL_GRASS); + shouldPlaceLast.add(BlockTypes.ROSE_BUSH); + shouldPlaceLast.add(BlockTypes.DANDELION); + shouldPlaceLast.add(BlockTypes.BROWN_MUSHROOM); + shouldPlaceLast.add(BlockTypes.RED_MUSHROOM); + shouldPlaceLast.add(BlockTypes.FERN); + shouldPlaceLast.add(BlockTypes.LARGE_FERN); + shouldPlaceLast.add(BlockTypes.OXEYE_DAISY); + shouldPlaceLast.add(BlockTypes.AZURE_BLUET); + shouldPlaceLast.add(BlockTypes.TORCH); + shouldPlaceLast.add(BlockTypes.WALL_TORCH); + shouldPlaceLast.add(BlockTypes.FIRE); + shouldPlaceLast.add(BlockTypes.REDSTONE_WIRE); + shouldPlaceLast.add(BlockTypes.CARROTS); + shouldPlaceLast.add(BlockTypes.POTATOES); + shouldPlaceLast.add(BlockTypes.WHEAT); + shouldPlaceLast.add(BlockTypes.BEETROOTS); + shouldPlaceLast.add(BlockTypes.COCOA); + shouldPlaceLast.add(BlockTypes.LADDER); + shouldPlaceLast.add(BlockTypes.LEVER); + shouldPlaceLast.add(BlockTypes.REDSTONE_TORCH); + shouldPlaceLast.add(BlockTypes.REDSTONE_WALL_TORCH); + shouldPlaceLast.add(BlockTypes.SNOW); + shouldPlaceLast.add(BlockTypes.PORTAL); + shouldPlaceLast.add(BlockTypes.END_PORTAL); + shouldPlaceLast.add(BlockTypes.REPEATER); + shouldPlaceLast.add(BlockTypes.VINE); + shouldPlaceLast.add(BlockTypes.LILY_PAD); + shouldPlaceLast.add(BlockTypes.NETHER_WART); + shouldPlaceLast.add(BlockTypes.PISTON); + shouldPlaceLast.add(BlockTypes.STICKY_PISTON); + shouldPlaceLast.add(BlockTypes.TRIPWIRE_HOOK); + shouldPlaceLast.add(BlockTypes.TRIPWIRE); + shouldPlaceLast.add(BlockTypes.STONE_PRESSURE_PLATE); + shouldPlaceLast.add(BlockTypes.HEAVY_WEIGHTED_PRESSURE_PLATE); + shouldPlaceLast.add(BlockTypes.LIGHT_WEIGHTED_PRESSURE_PLATE); + shouldPlaceLast.add(BlockTypes.COMPARATOR); + shouldPlaceLast.add(BlockTypes.IRON_TRAPDOOR); + shouldPlaceLast.add(BlockTypes.ACACIA_TRAPDOOR); + shouldPlaceLast.add(BlockTypes.BIRCH_TRAPDOOR); + shouldPlaceLast.add(BlockTypes.DARK_OAK_TRAPDOOR); + shouldPlaceLast.add(BlockTypes.JUNGLE_TRAPDOOR); + shouldPlaceLast.add(BlockTypes.OAK_TRAPDOOR); + shouldPlaceLast.add(BlockTypes.SPRUCE_TRAPDOOR); + shouldPlaceLast.add(BlockTypes.DAYLIGHT_DETECTOR); + } + + /** + * Checks to see whether a block should be placed last (when reordering + * blocks that are placed). + * + * @param type the block type + * @return true if the block should be placed last + */ + public static boolean shouldPlaceLast(BlockType type) { + return shouldPlaceLast.contains(type); + } + + /** + * HashSet for shouldPlaceLast. + */ + private static final Set shouldPlaceFinal = new HashSet<>(); + static { + shouldPlaceFinal.addAll(BlockCategories.DOORS.getBlockTypes()); + shouldPlaceFinal.addAll(BlockCategories.BANNERS.getBlockTypes()); + shouldPlaceFinal.add(BlockTypes.SIGN); + shouldPlaceFinal.add(BlockTypes.WALL_SIGN); + shouldPlaceFinal.add(BlockTypes.CACTUS); + shouldPlaceFinal.add(BlockTypes.SUGAR_CANE); + shouldPlaceFinal.add(BlockTypes.CAKE); + shouldPlaceFinal.add(BlockTypes.PISTON_HEAD); + shouldPlaceFinal.add(BlockTypes.MOVING_PISTON); + } + + /** + * Checks to see whether a block should be placed in the final queue. + * + * This applies to blocks that can be attached to other blocks that have an attachment. + * + * @param type the type of the block + * @return whether the block is in the final queue + */ + public static boolean shouldPlaceFinal(BlockType type) { + return shouldPlaceFinal.contains(type); + } + /** * Checks whether a given block is in a list of base blocks. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index f0bfc4326..8660ababd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -24,9 +24,10 @@ import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.PlayerDirection; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.blocks.Blocks; +import com.sk89q.worldedit.blocks.type.BlockCategories; +import com.sk89q.worldedit.blocks.type.BlockState; import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.blocks.type.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; @@ -89,27 +90,27 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder @Override public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { - BaseBlock lazyBlock = getLazyBlock(location); + BlockState existing = getBlock(location); if (!enabled) { return super.setBlock(location, block); } - if (BlockType.shouldPlaceLast(block.getBlockType().getLegacyId())) { + if (Blocks.shouldPlaceLast(block.getBlockType())) { // Place torches, etc. last stage2.put(location.toBlockVector(), block); - return !(lazyBlock.getBlockType() == block.getBlockType()); // TODO && lazyBlock.getData() == block.getData()); - } else if (BlockType.shouldPlaceFinal(block.getBlockType().getLegacyId())) { + return !existing.equalsFuzzy(block); + } else if (Blocks.shouldPlaceFinal(block.getBlockType())) { // Place signs, reed, etc even later stage3.put(location.toBlockVector(), block); - return !(lazyBlock.getBlockType() == block.getBlockType()); // TODO && lazyBlock.getData() == block.getData()); - } else if (BlockType.shouldPlaceLast(lazyBlock.getBlockType().getLegacyId())) { + return !existing.equalsFuzzy(block); + } else if (Blocks.shouldPlaceLast(existing.getBlockType())) { // Destroy torches, etc. first super.setBlock(location, BlockTypes.AIR.getDefaultState()); return super.setBlock(location, block); } else { stage1.put(location.toBlockVector(), block); - return !(lazyBlock.getBlockType() == block.getBlockType()); // TODO && lazyBlock.getData() == block.getData()); + return !existing.equalsFuzzy(block); } } @@ -149,19 +150,10 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder assert (blockTypes.containsKey(current)); - final BlockStateHolder baseBlock = blockTypes.get(current); - - final int type = baseBlock.getBlockType().getLegacyId(); + final BlockStateHolder blockStateHolder = blockTypes.get(current); // final int data = baseBlock.getData(); - switch (type) { - case BlockID.WOODEN_DOOR: - case BlockID.ACACIA_DOOR: - case BlockID.BIRCH_DOOR: - case BlockID.JUNGLE_DOOR: - case BlockID.DARK_OAK_DOOR: - case BlockID.SPRUCE_DOOR: - case BlockID.IRON_DOOR: + if (BlockCategories.DOORS.contains(blockStateHolder.getBlockType())) { // TODO if ((data & 0x8) == 0) { // // Deal with lower door halves being attached to the floor AND the upper half // BlockVector upperBlock = current.add(0, 1, 0).toBlockVector(); @@ -169,22 +161,14 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder // walked.addFirst(upperBlock); // } // } - break; - - case BlockID.MINECART_TRACKS: - case BlockID.POWERED_RAIL: - case BlockID.DETECTOR_RAIL: - case BlockID.ACTIVATOR_RAIL: - // Here, rails are hardcoded to be attached to the block below them. - // They're also attached to the block they're ascending towards via BlockType.getAttachment. - BlockVector lowerBlock = current.add(0, -1, 0).toBlockVector(); - if (blocks.contains(lowerBlock) && !walked.contains(lowerBlock)) { - walked.addFirst(lowerBlock); - } - break; + } else if (BlockCategories.RAILS.contains(blockStateHolder.getBlockType())) { + BlockVector lowerBlock = current.add(0, -1, 0).toBlockVector(); + if (blocks.contains(lowerBlock) && !walked.contains(lowerBlock)) { + walked.addFirst(lowerBlock); + } } - final PlayerDirection attachment = BlockType.getAttachment(type, 0); // TODO + final PlayerDirection attachment = BlockType.getAttachment(blockStateHolder.getBlockType().getLegacyId(), 0); // TODO if (attachment == null) { // Block is not attached to anything => we can place it break; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java index 9906d0c4d..5987a7335 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java @@ -37,22 +37,6 @@ import org.spongepowered.api.world.biome.BiomeType; */ public interface SpongeImplAdapter { - /** - * Resolves the numerical ID from this {@link ItemType} - * - * @param type The itemtype - * @return The numerical ID - */ - int resolve(ItemType type); - - /** - * Resolves the numerical ID from this {@link BlockType} - * - * @param type The blocktype - * @return The numerical ID - */ - int resolve(BlockType type); - /** * Resolves the numerical ID from this {@link BiomeType} * @@ -61,10 +45,6 @@ public interface SpongeImplAdapter { */ int resolve(BiomeType type); - ItemType resolveItem(int intID); - - BlockType resolveBlock(int intID); - BiomeType resolveBiome(int intID); BaseEntity createBaseEntity(Entity entity); From a48c319e7ea4bad4d67a0c1652e55a354084a42e Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 5 Jul 2018 01:15:51 -0700 Subject: [PATCH 32/74] package move --- .../bukkit/BukkitPlayerBlockBag.java | 4 +- .../sk89q/worldedit/bukkit/BukkitUtil.java | 4 +- .../sk89q/worldedit/bukkit/BukkitWorld.java | 4 +- .../EditSessionBlockChangeDelegate.java | 2 +- .../bukkit/adapter/BukkitImplAdapter.java | 2 +- .../com/sk89q/worldedit/blocks/LazyBlock.java | 4 +- .../worldedit/blocks/MobSpawnerBlock.java | 2 +- .../com/sk89q/worldedit/blocks/SignBlock.java | 2 +- .../sk89q/worldedit/blocks/SkullBlock.java | 2 +- .../com/sk89q/worldedit/CuboidClipboard.java | 4 +- .../java/com/sk89q/worldedit/EditSession.java | 37 +++++++++---------- .../sk89q/worldedit/LocalConfiguration.java | 4 +- .../com/sk89q/worldedit/LocalSession.java | 4 +- .../java/com/sk89q/worldedit/WorldEdit.java | 2 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 8 ++-- .../com/sk89q/worldedit/blocks/BaseItem.java | 4 +- .../sk89q/worldedit/blocks/BaseItemStack.java | 2 +- .../com/sk89q/worldedit/blocks/BlockID.java | 4 +- .../com/sk89q/worldedit/blocks/BlockType.java | 4 +- .../com/sk89q/worldedit/blocks/Blocks.java | 8 ++-- .../worldedit/command/BrushCommands.java | 2 +- .../worldedit/command/GeneralCommands.java | 4 +- .../worldedit/command/SelectionCommands.java | 5 +-- .../sk89q/worldedit/command/ToolCommands.java | 3 +- .../worldedit/command/UtilityCommands.java | 4 +- .../worldedit/command/tool/AreaPickaxe.java | 6 +-- .../command/tool/BlockDataCyler.java | 2 +- .../worldedit/command/tool/BlockReplacer.java | 4 +- .../command/tool/FloatingTreeRemover.java | 8 ++-- .../worldedit/command/tool/FloodFillTool.java | 4 +- .../tool/InvalidToolBindException.java | 2 +- .../command/tool/LongRangeBuildTool.java | 5 +-- .../worldedit/command/tool/QueryTool.java | 2 +- .../command/tool/RecursivePickaxe.java | 7 ++-- .../worldedit/command/tool/SinglePickaxe.java | 5 +-- .../command/tool/brush/CylinderBrush.java | 3 +- .../command/tool/brush/GravityBrush.java | 4 +- .../tool/brush/HollowCylinderBrush.java | 2 +- .../command/tool/brush/HollowSphereBrush.java | 2 +- .../command/tool/brush/SphereBrush.java | 2 +- .../event/extent/EditSessionEvent.java | 4 +- .../extension/factory/BlockFactory.java | 2 +- .../extension/factory/DefaultBlockParser.java | 8 ++-- .../factory/RandomPatternParser.java | 3 +- .../platform/AbstractPlayerActor.java | 14 +++---- .../extent/AbstractDelegateExtent.java | 4 +- .../worldedit/extent/ChangeSetExtent.java | 2 +- .../sk89q/worldedit/extent/InputExtent.java | 3 +- .../sk89q/worldedit/extent/MaskingExtent.java | 3 +- .../sk89q/worldedit/extent/NullExtent.java | 6 +-- .../sk89q/worldedit/extent/OutputExtent.java | 2 +- .../extent/buffer/ForgetfulExtentBuffer.java | 6 +-- .../extent/clipboard/BlockArrayClipboard.java | 6 +-- .../SignCompatibilityHandler.java | 2 +- .../worldedit/extent/inventory/BlockBag.java | 4 +- .../extent/inventory/BlockBagExtent.java | 8 ++-- .../extent/inventory/OutOfSpaceException.java | 2 +- .../extent/reorder/MultiStageReorder.java | 8 ++-- .../transform/BlockTransformExtent.java | 4 +- .../extent/validation/BlockChangeLimiter.java | 3 +- .../validation/DataValidatorExtent.java | 4 +- .../extent/world/BlockQuirkExtent.java | 6 +-- .../extent/world/ChunkLoadingExtent.java | 3 +- .../extent/world/FastModeExtent.java | 3 +- .../extent/world/SurvivalModeExtent.java | 4 +- .../function/block/ExtentBlockCopy.java | 1 - .../worldedit/function/block/Naturalizer.java | 5 +-- .../function/generator/FloraGenerator.java | 4 +- .../function/generator/ForestGenerator.java | 6 +-- .../generator/GardenPatchGenerator.java | 6 +-- .../worldedit/function/mask/BlockMask.java | 4 +- .../function/mask/ExistingBlockMask.java | 2 +- .../function/mask/FuzzyBlockMask.java | 2 +- .../function/mask/SolidBlockMask.java | 2 +- .../operation/BlockMapEntryPlacer.java | 2 +- .../function/pattern/BlockPattern.java | 2 +- .../function/pattern/ClipboardPattern.java | 3 +- .../worldedit/function/pattern/Pattern.java | 3 +- .../function/pattern/RandomPattern.java | 3 +- .../pattern/RepeatingExtentPattern.java | 3 +- .../worldedit/history/change/BlockChange.java | 3 +- .../changeset/BlockOptimizedHistory.java | 3 +- .../internal/command/WorldEditBinding.java | 2 +- .../worldedit/math/convolution/HeightMap.java | 4 +- .../regions/shape/ArbitraryShape.java | 2 +- .../worldedit/regions/shape/RegionShape.java | 3 +- .../scripting/CraftScriptContext.java | 3 +- .../com/sk89q/worldedit/util/TargetBlock.java | 2 +- .../sk89q/worldedit/util/TreeGenerator.java | 6 +-- .../sk89q/worldedit/world/AbstractWorld.java | 8 ++-- .../com/sk89q/worldedit/world/NullWorld.java | 6 +-- .../java/com/sk89q/worldedit/world/World.java | 5 +-- .../type => world/block}/BlockCategories.java | 2 +- .../type => world/block}/BlockCategory.java | 2 +- .../type => world/block}/BlockState.java | 2 +- .../block}/BlockStateHolder.java | 2 +- .../type => world/block}/BlockType.java | 4 +- .../type => world/block}/BlockTypes.java | 2 +- .../sk89q/worldedit/world/chunk/OldChunk.java | 2 +- .../type => world/fluid}/FluidCategories.java | 2 +- .../type => world/fluid}/FluidCategory.java | 2 +- .../type => world/fluid}/FluidType.java | 2 +- .../type => world/fluid}/FluidTypes.java | 2 +- .../type => world/item}/ItemCategories.java | 2 +- .../type => world/item}/ItemCategory.java | 4 +- .../{blocks/type => world/item}/ItemType.java | 4 +- .../type => world/item}/ItemTypes.java | 2 +- .../world/registry/BlockCategoryRegistry.java | 2 +- .../world/registry/BlockRegistry.java | 4 +- .../world/registry/BundledBlockRegistry.java | 6 +-- .../world/registry/BundledItemRegistry.java | 2 +- .../world/registry/ItemCategoryRegistry.java | 2 +- .../world/registry/LegacyMapper.java | 6 +-- .../registry/NullBlockCategoryRegistry.java | 2 +- .../registry/NullItemCategoryRegistry.java | 2 +- .../sk89q/worldedit/CuboidClipboardTest.java | 8 ---- .../transform/BlockTransformExtentTest.java | 4 +- .../worldedit/forge/ForgeItemRegistry.java | 2 +- .../sk89q/worldedit/forge/ForgePlayer.java | 2 +- .../com/sk89q/worldedit/forge/ForgeWorld.java | 6 +-- .../sk89q/worldedit/forge/ForgeWorldEdit.java | 4 +- .../sk89q/worldedit/sponge/SpongePlayer.java | 2 +- .../sk89q/worldedit/sponge/SpongeWorld.java | 7 ++-- .../worldedit/sponge/SpongeWorldEdit.java | 5 ++- 124 files changed, 232 insertions(+), 262 deletions(-) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/block}/BlockCategories.java (99%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/block}/BlockCategory.java (98%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/block}/BlockState.java (99%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/block}/BlockStateHolder.java (98%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/block}/BlockType.java (96%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/block}/BlockTypes.java (99%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/fluid}/FluidCategories.java (98%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/fluid}/FluidCategory.java (97%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/fluid}/FluidType.java (97%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/fluid}/FluidTypes.java (98%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/item}/ItemCategories.java (99%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/item}/ItemCategory.java (95%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/item}/ItemType.java (95%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{blocks/type => world/item}/ItemTypes.java (99%) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index bd544f620..1fe40ef5b 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.bukkit; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBagException; import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index fc003d783..4cb965341 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -24,8 +24,8 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.BlockTypes; -import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.registry.LegacyMapper; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index cf98f41d9..955c1cf9e 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -30,7 +30,7 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.history.change.BlockChange; @@ -357,7 +357,7 @@ public class BukkitWorld extends AbstractWorld { } @Override - public com.sk89q.worldedit.blocks.type.BlockState getBlock(Vector position) { + public com.sk89q.worldedit.world.block.BlockState getBlock(Vector position) { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); return LegacyMapper.getInstance().getBlockFromLegacy(bukkitBlock.getTypeId(), bukkitBlock.getData()); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java index 08d1c0841..df900feb5 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.bukkit; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.registry.LegacyMapper; import org.bukkit.BlockChangeDelegate; import com.sk89q.worldedit.EditSession; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 01d22a6da..a7952161d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -20,7 +20,7 @@ package com.sk89q.worldedit.bukkit.adapter; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import org.bukkit.Location; import org.bukkit.block.Biome; diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java index dd51998d8..feb85e932 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java @@ -23,8 +23,8 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.extent.Extent; /** diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java index 4fc2070d0..bcca8274a 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java @@ -25,7 +25,7 @@ import com.sk89q.jnbt.NBTUtils; import com.sk89q.jnbt.ShortTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.storage.InvalidFormatException; import java.util.HashMap; diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java index 8d71a662f..e4b7d28b8 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.util.gson.GsonUtil; import java.util.HashMap; diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java index fb651f9ab..c29d05132 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.world.block.BlockState; import java.util.HashMap; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java index 183a5d720..820426fbb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java @@ -22,8 +22,8 @@ package com.sk89q.worldedit; import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.command.ClipboardCommands; import com.sk89q.worldedit.command.SchematicCommands; import com.sk89q.worldedit.entity.Entity; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 40c10aa45..7d07a5a23 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -26,12 +26,12 @@ import static com.sk89q.worldedit.regions.Regions.maximumBlockY; import static com.sk89q.worldedit.regions.Regions.minimumBlockY; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.blocks.type.BlockCategories; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockCategories; +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.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.event.extent.EditSessionEvent; @@ -108,7 +108,6 @@ import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.world.NullWorld; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.LegacyMapper; import java.util.ArrayList; import java.util.Collections; @@ -375,7 +374,7 @@ public class EditSession implements Extent { * * @return a map of missing blocks */ - public Map popMissingBlocks() { + public Map popMissingBlocks() { return blockBagExtent.popMissing(); } @@ -727,7 +726,7 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int removeNear(Vector position, com.sk89q.worldedit.blocks.type.BlockType blockType, int apothem) throws MaxChangedBlocksException { + public int removeNear(Vector position, BlockType blockType, int apothem) throws MaxChangedBlocksException { checkNotNull(position); checkArgument(apothem >= 1, "apothem >= 1"); @@ -1143,7 +1142,7 @@ public class EditSession implements Extent { * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int fixLiquid(Vector origin, double radius, com.sk89q.worldedit.blocks.type.BlockType moving, com.sk89q.worldedit.blocks.type.BlockType stationary) throws MaxChangedBlocksException { + public int fixLiquid(Vector origin, double radius, BlockType moving, BlockType stationary) throws MaxChangedBlocksException { checkNotNull(origin); checkArgument(radius >= 0, "radius >= 0 required"); @@ -1449,7 +1448,7 @@ public class EditSession implements Extent { for (int y = world.getMaxY(); y >= 1; --y) { Vector pt = new Vector(x, y, z); - com.sk89q.worldedit.blocks.type.BlockType id = getBlock(pt).getBlockType(); + BlockType id = getBlock(pt).getBlockType(); if (id == BlockTypes.ICE) { if (setBlock(pt, water)) { @@ -1499,7 +1498,7 @@ public class EditSession implements Extent { for (int y = world.getMaxY(); y >= 1; --y) { Vector pt = new Vector(x, y, z); - com.sk89q.worldedit.blocks.type.BlockType id = getBlock(pt).getBlockType(); + BlockType id = getBlock(pt).getBlockType(); if (id == BlockTypes.AIR) { continue; @@ -1642,7 +1641,7 @@ public class EditSession implements Extent { for (int y = basePosition.getBlockY(); y >= basePosition.getBlockY() - 10; --y) { // Check if we hit the ground - com.sk89q.worldedit.blocks.type.BlockType t = getBlock(new Vector(x, y, z)).getBlockType(); + BlockType t = getBlock(new Vector(x, y, z)).getBlockType(); if (t == BlockTypes.GRASS_BLOCK || t == BlockTypes.DIRT) { treeType.generate(this, new Vector(x, y + 1, z)); ++affected; @@ -1665,9 +1664,9 @@ public class EditSession implements Extent { * @param region a region * @return the results */ - public List> getBlockDistribution(Region region) { - List> distribution = new ArrayList<>(); - Map> map = new HashMap<>(); + public List> getBlockDistribution(Region region) { + List> distribution = new ArrayList<>(); + Map> map = new HashMap<>(); if (region instanceof CuboidRegion) { // Doing this for speed @@ -1686,12 +1685,12 @@ public class EditSession implements Extent { for (int z = minZ; z <= maxZ; ++z) { Vector pt = new Vector(x, y, z); - com.sk89q.worldedit.blocks.type.BlockType type = getLazyBlock(pt).getBlockType(); + BlockType type = getLazyBlock(pt).getBlockType(); if (map.containsKey(type)) { map.get(type).increment(); } else { - Countable c = new Countable<>(type, 1); + Countable c = new Countable<>(type, 1); map.put(type, c); distribution.add(c); } @@ -1700,12 +1699,12 @@ public class EditSession implements Extent { } } else { for (Vector pt : region) { - com.sk89q.worldedit.blocks.type.BlockType type = getLazyBlock(pt).getBlockType(); + BlockType type = getLazyBlock(pt).getBlockType(); if (map.containsKey(type)) { map.get(type).increment(); } else { - Countable c = new Countable<>(type, 1); + Countable c = new Countable<>(type, 1); map.put(type, c); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java index f5611a2e4..8822c2a25 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit; -import com.sk89q.worldedit.blocks.type.BlockTypes; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.util.logging.LogFormat; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index 12779701a..1376e723d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -25,8 +25,8 @@ import com.sk89q.jchronic.Chronic; import com.sk89q.jchronic.Options; import com.sk89q.jchronic.utils.Span; import com.sk89q.jchronic.utils.Time; -import com.sk89q.worldedit.blocks.type.ItemType; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.command.tool.BlockTool; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.InvalidToolBindException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 9e83eeba4..4232679c0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -25,7 +25,7 @@ import static com.sk89q.worldedit.event.platform.Interaction.OPEN; import com.sk89q.worldedit.CuboidClipboard.FlipDirection; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; -import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.platform.BlockInteractEvent; import com.sk89q.worldedit.event.platform.InputType; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index f9ec27187..ac5b11564 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -22,10 +22,10 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.function.mask.Mask; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.registry.state.State; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java index 5f7e7f1b2..6a25186ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; -import com.sk89q.worldedit.blocks.type.ItemType; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.NbtValued; import com.sk89q.worldedit.world.registry.LegacyMapper; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java index acb97c04f..c9e69732b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java @@ -20,7 +20,7 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; -import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.world.item.ItemType; /** * Represents a stack of BaseItems. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index 4e4418157..eb145bf78 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -19,10 +19,12 @@ package com.sk89q.worldedit.blocks; +import com.sk89q.worldedit.world.block.BlockTypes; + /** * List of block IDs. * - * {@deprecated Please use {@link com.sk89q.worldedit.blocks.type.BlockTypes}} + * {@deprecated Please use {@link BlockTypes }} */ @Deprecated public final class BlockID { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 200b68cc2..8175bb278 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.blocks; import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.PlayerDirection; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.HashMap; import java.util.Map; @@ -30,7 +30,7 @@ import java.util.Map; /** * Block types. * - * {@deprecated Please use {@link com.sk89q.worldedit.blocks.type.BlockType}} + * {@deprecated Please use {@link com.sk89q.worldedit.world.block.BlockType }} */ @Deprecated public enum BlockType { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java index bb47190e4..e1b9b0ae0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.blocks; -import com.sk89q.worldedit.blocks.type.BlockCategories; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockCategories; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Collection; import java.util.HashSet; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index 0b16988a5..f1ce2ba38 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -30,7 +30,7 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.brush.ButcherBrush; import com.sk89q.worldedit.command.tool.brush.ClipboardBrush; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java index ec16ffab1..f86fb7928 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java @@ -24,8 +24,8 @@ import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.type.ItemType; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.function.mask.Mask; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 5a541c722..ed508789d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -33,10 +33,9 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 84dcd1861..806b6258a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -23,9 +23,8 @@ import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.command.tool.*; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 1a6a7d4c9..8230d1e87 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -33,8 +33,8 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.command.util.CreatureButcher; import com.sk89q.worldedit.command.util.EntityRemover; import com.sk89q.worldedit.entity.Entity; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java index f5bde5bf2..e5b638bd5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java @@ -24,9 +24,9 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java index 7894852e4..b99af7a3f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java @@ -25,7 +25,7 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockData; -import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java index 46df0b079..21095b28b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index b77710c58..5487b63d0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -24,10 +24,10 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.type.BlockCategories; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockCategories; +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.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java index 763bc9343..99a4d2857 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/InvalidToolBindException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/InvalidToolBindException.java index c2ba68882..7bda56799 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/InvalidToolBindException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/InvalidToolBindException.java @@ -20,7 +20,7 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.world.item.ItemType; public class InvalidToolBindException extends WorldEditException { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index df5d9702f..e0ab56643 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -23,9 +23,8 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index 5813b6b4d..435da2cdb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.blocks.MobSpawnerBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java index 7734b3c0c..c2f2b6bee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java @@ -20,10 +20,9 @@ package com.sk89q.worldedit.command.tool; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java index b8fc29c7f..40274abcb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java @@ -23,9 +23,8 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java index b860e4db9..3aa52262c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java @@ -22,8 +22,7 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java index 08f3ba017..2dcce3bea 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java @@ -23,8 +23,8 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.Pattern; import java.util.*; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java index 4c032eb28..dc6bd9459 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java index d3ed19ff8..2fa5d3902 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java index 988c0c5bd..120539b82 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java index 66c4fbc81..81f1f131b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java @@ -21,9 +21,7 @@ package com.sk89q.worldedit.event.extent; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java index 406377c54..90ff8d365 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.internal.registry.AbstractFactory; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 8edeb5dee..6b01c2756 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -29,10 +29,10 @@ import com.sk89q.worldedit.blocks.MobSpawnerBlock; import com.sk89q.worldedit.blocks.SignBlock; import com.sk89q.worldedit.blocks.SkullBlock; import com.sk89q.worldedit.blocks.metadata.MobType; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.entity.Player; import com.sk89q.worldedit.extension.input.DisallowedUsageException; import com.sk89q.worldedit.extension.input.InputParseException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java index 1eebb9688..87b3862fc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java @@ -20,8 +20,7 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.function.pattern.BlockPattern; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index 43eed2d19..70d989efd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -24,11 +24,11 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockType; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; -import com.sk89q.worldedit.blocks.type.ItemType; -import com.sk89q.worldedit.blocks.type.ItemTypes; +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.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.internal.cui.CUIEvent; @@ -169,7 +169,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { if (spots == 2) { final Vector platform = new Vector(x, y - 2, z); final BlockStateHolder block = world.getBlock(platform); - final com.sk89q.worldedit.blocks.type.BlockType type = block.getBlockType(); + final com.sk89q.worldedit.world.block.BlockType type = block.getBlockType(); // Don't get put in lava! if (type == BlockTypes.LAVA) { @@ -211,7 +211,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { while (y >= 0) { final Vector platform = new Vector(x, y, z); final BlockStateHolder block = world.getBlock(platform); - final com.sk89q.worldedit.blocks.type.BlockType type = block.getBlockType(); + final com.sk89q.worldedit.world.block.BlockType type = block.getBlockType(); // Don't want to end up in lava if (type != BlockTypes.AIR && type != BlockTypes.LAVA) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java index 38404981f..bb956d4ae 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java @@ -24,8 +24,8 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java index 639718531..e9c78e088 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.history.change.BlockChange; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java index 99af94b21..39e4bd12f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java @@ -23,8 +23,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.biome.BaseBiome; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java index d906369d9..ea8ca7c14 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java @@ -21,8 +21,7 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.function.mask.Mask; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java index 3616cc53c..f73152476 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java @@ -24,9 +24,9 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java index 2ebaeb925..424e84165 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.world.biome.BaseBiome; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java index 07ef43fe2..a8b5636ed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java @@ -24,9 +24,9 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index 6a5d86acd..8a0e19bfc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -24,9 +24,9 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java index 08605952e..4cff21c0c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java @@ -27,7 +27,7 @@ import com.google.gson.JsonSyntaxException; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java index eb2e6a9af..aeee7a339 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.extent.inventory; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.util.Location; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index 6e78fc016..894dda9d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java @@ -21,10 +21,10 @@ package com.sk89q.worldedit.extent.inventory; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java index c7058ea8c..fece9656c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfSpaceException.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.extent.inventory; -import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.world.block.BlockType; /** * Thrown when the target inventory of a block bag is full. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index 8660ababd..8edea8381 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -26,10 +26,10 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.Blocks; -import com.sk89q.worldedit.blocks.type.BlockCategories; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockCategories; +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.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.operation.BlockMapEntryPlacer; 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 224b1b220..431dcb305 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 @@ -26,8 +26,8 @@ import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java index 7a99f80fb..04266af6d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java @@ -22,8 +22,7 @@ package com.sk89q.worldedit.extent.validation; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index 3fcd53287..720a4d8a9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -21,8 +21,8 @@ package com.sk89q.worldedit.extent.validation; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index 254dbbf34..5e33b6455 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -23,9 +23,9 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java index 9a15d1142..e98e9d8dc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java @@ -21,8 +21,7 @@ package com.sk89q.worldedit.extent.world; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java index 7b7b0d256..b11210bdf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java @@ -22,8 +22,7 @@ package com.sk89q.worldedit.extent.world; import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java index 68878d352..c8f1b2741 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java @@ -23,8 +23,8 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java index d20043450..be1e39ec9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java @@ -24,7 +24,6 @@ import com.sk89q.jnbt.CompoundTagBuilder; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.internal.helper.MCDirections; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java index 3be5a2345..fd8cc5b7c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java @@ -23,9 +23,8 @@ import com.google.common.collect.Sets; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.LayerFunction; import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.Mask; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index 4833cc439..348e533d5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -22,8 +22,8 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index bb350b7ff..a76066adf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -22,9 +22,9 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.function.RegionFunction; import com.sk89q.worldedit.util.TreeGenerator; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index f53d9449d..866fe6735 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -23,9 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; 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 822443f97..772b64942 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 @@ -19,11 +19,9 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; import javax.annotation.Nullable; import java.util.Arrays; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java index 15d7c9067..c942ddc5c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.Vector; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java index b9f266512..bf6d904b2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.Blocks; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import java.util.Collection; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java index 016b32cb5..7137ca221 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java @@ -20,7 +20,7 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.type.BlockState; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.extent.Extent; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java index 8c2a2799c..6db38a2d8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.function.operation; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import java.util.Iterator; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java index 245701d06..66f112a61 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java index ccd030394..0c180c531 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java @@ -20,8 +20,7 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.clipboard.Clipboard; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Pattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Pattern.java index c28d40539..5b73f720b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Pattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/Pattern.java @@ -20,8 +20,7 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Returns a {@link BlockStateHolder} for a given position. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java index 2eefd0ca9..e27d0d274 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java @@ -20,8 +20,7 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.ArrayList; import java.util.List; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java index fbedc3d57..c833a289d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java @@ -20,8 +20,7 @@ package com.sk89q.worldedit.function.pattern; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java index d76c7b7ab..a1761f833 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java @@ -21,8 +21,7 @@ package com.sk89q.worldedit.history.change; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.history.UndoContext; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java index 11760efc6..982f8503d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java @@ -22,8 +22,7 @@ package com.sk89q.worldedit.history.changeset; import com.google.common.base.Function; import com.google.common.collect.Iterators; import com.sk89q.worldedit.BlockVector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.history.change.BlockChange; import com.sk89q.worldedit.history.change.Change; import com.sk89q.worldedit.util.collection.TupleArrayList; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java index 59d5f33b9..31e5f1a65 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java @@ -27,7 +27,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.NoMatchException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index 79240507e..a1bae435f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -24,8 +24,8 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.regions.Region; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java index 1f0979e96..c1eb744d6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.Region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java index ad6e06f08..ba5d8d587 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java @@ -20,8 +20,7 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.regions.Region; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java index 5fbd1c448..125220020 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java @@ -20,8 +20,7 @@ package com.sk89q.worldedit.scripting; import com.sk89q.worldedit.*; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.command.InsufficientArgumentsException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java index f37229886..03ba6f76c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java @@ -20,7 +20,7 @@ package com.sk89q.worldedit.util; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java index f905042e6..d0167bc73 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java @@ -23,9 +23,9 @@ import com.google.common.collect.Sets; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Collections; import java.util.EnumSet; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index aa01cd230..b506c20ce 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -24,10 +24,10 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.extension.platform.Platform; import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.Mask; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java index b50e2c3f4..e108aa94c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -27,9 +27,9 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.regions.Region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index 4bd434a78..5e03cfcd8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -26,15 +26,14 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.TreeGenerator; -import com.sk89q.worldedit.world.registry.Registries; /** * Represents a world (dimension). diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java similarity index 99% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java index 40cf4f07f..a71d44b12 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.block; import java.lang.reflect.Field; import java.util.Collection; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java similarity index 98% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategory.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java index ca7831ef9..a9a634a55 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.block; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.platform.Capability; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java similarity index 99% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java index 8fb84cfbb..2d46df770 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.block; import com.google.common.collect.ArrayTable; import com.google.common.collect.HashBasedTable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java similarity index 98% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java index 3c71c3e29..21fa25fe2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockStateHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.block; import com.sk89q.worldedit.world.registry.state.State; import com.sk89q.worldedit.world.registry.state.value.StateValue; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java similarity index 96% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java index 11660c745..5d67021d3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java @@ -17,11 +17,13 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.block; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.LegacyMapper; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java similarity index 99% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java index 8b1438050..8735b62af 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.block; import java.lang.reflect.Field; import java.util.Collection; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java index 188341e35..64df0dd88 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java @@ -28,7 +28,7 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.storage.InvalidFormatException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java similarity index 98% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategories.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java index 2a0a1f96e..aaf3ea945 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.fluid; import java.lang.reflect.Field; import java.util.Collection; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java similarity index 97% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategory.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java index d3e713961..1cb8c8af0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.fluid; import java.util.Collections; import java.util.Set; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java similarity index 97% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidType.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java index a1d541a1e..7b4fef0c0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.fluid; /** * Minecraft now has a 'fluid' system. This is a diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java similarity index 98% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidTypes.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java index 613e45d1a..03080775f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/FluidTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.fluid; import java.lang.reflect.Field; import java.util.Collection; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java similarity index 99% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java index f1454c867..d0af4f90a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.item; import java.lang.reflect.Field; import java.util.Collection; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java similarity index 95% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategory.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java index 6784be079..458116995 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java @@ -17,14 +17,12 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.item; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.extension.platform.Capability; -import java.util.Collections; -import java.util.HashSet; import java.util.Set; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java similarity index 95% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java index 68a7a59c0..b57a8da04 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java @@ -17,8 +17,10 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.item; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.registry.BundledItemData; import com.sk89q.worldedit.world.registry.LegacyMapper; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java similarity index 99% rename from worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java index 865bbd0d5..12c740220 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/type/ItemTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.blocks.type; +package com.sk89q.worldedit.world.item; import java.lang.reflect.Field; import java.util.Collection; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockCategoryRegistry.java index 9b08915c4..3ec851246 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockCategoryRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockCategoryRegistry.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.world.registry; -import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.world.block.BlockType; /** * A registry for BlockType categories. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index b4c452051..80c56c46c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BlockMaterial; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.registry.state.State; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 13a745075..0f82ab2e1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -20,9 +20,9 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BlockMaterial; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.BlockTypes; +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.registry.state.State; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java index d3692db76..67f9e4015 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java @@ -20,7 +20,7 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BaseItem; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.item.ItemTypes; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemCategoryRegistry.java index c80aea96a..94f32507f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemCategoryRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemCategoryRegistry.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.world.registry; -import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.world.item.ItemType; /** * A registry for ItemType categories. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index 823bb71e9..d85309bf3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -27,9 +27,9 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.ItemType; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.util.gson.VectorAdapter; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java index 3a45304e2..a58517d61 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.world.registry; -import com.sk89q.worldedit.blocks.type.BlockType; +import com.sk89q.worldedit.world.block.BlockType; import java.util.Collections; import java.util.Set; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java index c116e46cc..4c1cb39bf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.world.registry; -import com.sk89q.worldedit.blocks.type.ItemType; +import com.sk89q.worldedit.world.item.ItemType; import java.util.Collections; import java.util.Set; diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java index 871b260ca..64afecfe5 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java @@ -19,14 +19,6 @@ package com.sk89q.worldedit; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockID; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; -import org.junit.Test; - -import static org.junit.Assert.*; - // TODO FIX public class CuboidClipboardTest { // @Test diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java index f949710d4..740a6d653 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java @@ -21,8 +21,8 @@ package com.sk89q.worldedit.extent.transform; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockData; -import com.sk89q.worldedit.blocks.type.BlockType; -import com.sk89q.worldedit.blocks.type.BlockTypes; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.world.registry.BlockRegistry; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java index 44142e551..c7f93231f 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.blocks.BaseItem; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.ItemRegistry; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index 9fa198403..67f414137 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.forge; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 04b900d06..62756cbc8 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -33,9 +33,9 @@ import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.blocks.type.BlockState; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.internal.Constants; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index 3b1efe7eb..e5aded401 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -30,6 +30,8 @@ import com.sk89q.worldedit.event.platform.PlatformReadyEvent; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.forge.net.LeftClickAirEventMessage; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -123,7 +125,7 @@ public class ForgeWorldEdit { } for (Block block : REGISTRY) { - com.sk89q.worldedit.blocks.type.BlockTypes.registerBlock(new com.sk89q.worldedit.blocks.type.BlockType(REGISTRY.getNameForObject(block).toString())); + BlockTypes.registerBlock(new BlockType(REGISTRY.getNameForObject(block).toString())); } } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index d471f09b6..5e180016d 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -23,7 +23,7 @@ import com.flowpowered.math.vector.Vector3d; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index 33b2b6f5f..1cb94556b 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -27,15 +27,14 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.type.BlockStateHolder; -import com.sk89q.worldedit.blocks.type.ItemTypes; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.Registries; import com.sk89q.worldedit.world.registry.state.State; import com.sk89q.worldedit.world.registry.state.value.StateValue; import org.spongepowered.api.Sponge; @@ -115,7 +114,7 @@ public abstract class SpongeWorld extends AbstractWorld { @SuppressWarnings("WeakerAccess") protected BlockState getBlockState(BlockStateHolder block) { - if (block instanceof com.sk89q.worldedit.blocks.type.BlockState) { + if (block instanceof com.sk89q.worldedit.world.block.BlockState) { BlockState state = Sponge.getRegistry().getType(BlockType.class, block.getBlockType().getId()).orElse(BlockTypes.AIR).getDefaultState(); for (Map.Entry entry : block.getStates().entrySet()) { // TODO Convert across states diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java index e5cb50c3d..e09336309 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java @@ -33,6 +33,7 @@ import com.sk89q.worldedit.sponge.adapter.AdapterLoadException; import com.sk89q.worldedit.sponge.adapter.SpongeImplAdapter; import com.sk89q.worldedit.sponge.adapter.SpongeImplLoader; import com.sk89q.worldedit.sponge.config.SpongeConfiguration; +import com.sk89q.worldedit.world.item.ItemTypes; import org.slf4j.Logger; import org.spongepowered.api.Sponge; import org.spongepowered.api.block.BlockSnapshot; @@ -134,11 +135,11 @@ public class SpongeWorldEdit { for (BlockType blockType : Sponge.getRegistry().getAllOf(BlockType.class)) { // TODO Handle blockstate stuff - com.sk89q.worldedit.blocks.type.BlockTypes.registerBlock(new com.sk89q.worldedit.blocks.type.BlockType(blockType.getId())); + com.sk89q.worldedit.world.block.BlockTypes.registerBlock(new com.sk89q.worldedit.world.block.BlockType(blockType.getId())); } for (ItemType itemType : Sponge.getRegistry().getAllOf(ItemType.class)) { - com.sk89q.worldedit.blocks.type.ItemTypes.registerItem(new com.sk89q.worldedit.blocks.type.ItemType(itemType.getId())); + ItemTypes.registerItem(new com.sk89q.worldedit.world.item.ItemType(itemType.getId())); } WorldEdit.getInstance().getPlatformManager().register(platform); From d33e2e98aaf05935fbdd4b0bc08b7b6c6b9efe3b Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 5 Jul 2018 01:48:37 -0700 Subject: [PATCH 33/74] registry changes --- .../com/sk89q/worldedit/LocalSession.java | 4 +- .../worldedit/command/GeneralCommands.java | 2 +- .../worldedit/command/SelectionCommands.java | 2 +- .../extension/factory/DefaultBlockParser.java | 2 +- .../registry/NamespacedRegistry.java | 66 + .../world/block/BlockCategories.java | 96 +- .../worldedit/world/block/BlockCategory.java | 3 + .../worldedit/world/block/BlockType.java | 5 +- .../worldedit/world/block/BlockTypes.java | 1179 +++++++------ .../world/fluid/FluidCategories.java | 39 +- .../worldedit/world/fluid/FluidCategory.java | 4 + .../worldedit/world/fluid/FluidType.java | 4 + .../worldedit/world/fluid/FluidTypes.java | 46 +- .../worldedit/world/item/ItemCategories.java | 92 +- .../worldedit/world/item/ItemCategory.java | 3 + .../sk89q/worldedit/world/item/ItemType.java | 5 +- .../sk89q/worldedit/world/item/ItemTypes.java | 1454 ++++++++--------- .../world/registry/BundledBlockRegistry.java | 2 +- .../world/registry/BundledItemRegistry.java | 2 +- .../world/registry/LegacyMapper.java | 2 +- .../worldedit/forge/ForgeItemRegistry.java | 2 +- .../sk89q/worldedit/forge/ForgePlayer.java | 2 +- .../sk89q/worldedit/forge/ForgeWorldEdit.java | 2 +- .../sk89q/worldedit/sponge/SpongePlayer.java | 2 +- .../worldedit/sponge/SpongeWorldEdit.java | 4 +- 25 files changed, 1496 insertions(+), 1528 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index 1376e723d..6677c9579 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -557,9 +557,9 @@ public class LocalSession { public void setTool(ItemType item, @Nullable Tool tool) throws InvalidToolBindException { if (item.hasBlockType()) { throw new InvalidToolBindException(item, "Blocks can't be used"); - } else if (item == ItemTypes.getItemType(config.wandItem)) { + } else if (item == ItemTypes.get(config.wandItem)) { throw new InvalidToolBindException(item, "Already used for the wand"); - } else if (item == ItemTypes.getItemType(config.navigationWand)) { + } else if (item == ItemTypes.get(config.navigationWand)) { throw new InvalidToolBindException(item, "Already used for the navigation wand"); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java index f86fb7928..7da7dadb3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java @@ -163,7 +163,7 @@ public class GeneralCommands { boolean blocksOnly = args.hasFlag('b'); boolean itemsOnly = args.hasFlag('i'); - ItemType type = ItemTypes.getItemType(query); + ItemType type = ItemTypes.get(query); if (type != null) { actor.print(type.getId() + " (" + type.getName() + ")"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index ed508789d..9d118681c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -278,7 +278,7 @@ public class SelectionCommands { @CommandPermissions("worldedit.wand") public void wand(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - player.giveItem(new BaseItemStack(ItemTypes.getItemType(we.getConfiguration().wandItem), 1)); + player.giveItem(new BaseItemStack(ItemTypes.get(we.getConfiguration().wandItem), 1)); player.print("Left click: select pos #1; Right click: select pos #2"); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 6b01c2756..90a328744 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -232,7 +232,7 @@ class DefaultBlockParser extends InputParser { blockStates = blockInHand.getStates(); } else { // Attempt to lookup a block from ID or name. - blockType = BlockTypes.getBlockType(typeString); + blockType = BlockTypes.get(typeString); if (blockType == null) { throw new NoMatchException("Does not match a valid block type: '" + input + "'"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java new file mode 100644 index 000000000..fde3e5d6e --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java @@ -0,0 +1,66 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.registry; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import javax.annotation.Nullable; + +import static com.google.common.base.Preconditions.checkState; +import static java.util.Objects.requireNonNull; + +public final class NamespacedRegistry { + private static final String MINECRAFT_NAMESPACE = "minecraft"; + private final Map map = new HashMap<>(); + + public @Nullable V get(final String key) { + checkState(key.equals(key.toLowerCase()), "key must be lowercase"); + return this.map.get(this.orDefaultNamespace(key)); + } + + public V register(final String key, final V value) { + requireNonNull(key, "key"); + requireNonNull(value, "value"); + checkState(key.indexOf(':') > -1, "key is not namespaced"); + checkState(key.equals(key.toLowerCase()), "key must be lowercase"); + checkState(!this.map.containsKey(key), "key %s already has an entry", key); + this.map.put(key, value); + return value; + } + + public Set keySet() { + return Collections.unmodifiableSet(this.map.keySet()); + } + + public Collection values() { + return Collections.unmodifiableCollection(this.map.values()); + } + + private String orDefaultNamespace(final String key) { + if (key.indexOf(':') == -1) { + return MINECRAFT_NAMESPACE + ':' + key; + } + return key; + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java index a71d44b12..dc230b6fa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java @@ -34,71 +34,53 @@ public class BlockCategories { private BlockCategories() { } - public static final BlockCategory ACACIA_LOGS = new BlockCategory("minecraft:acacia_logs"); - public static final BlockCategory ANVIL = new BlockCategory("minecraft:anvil"); - public static final BlockCategory BANNERS = new BlockCategory("minecraft:banners"); - public static final BlockCategory BIRCH_LOGS = new BlockCategory("minecraft:birch_logs"); - public static final BlockCategory BUTTONS = new BlockCategory("minecraft:buttons"); - public static final BlockCategory CARPETS = new BlockCategory("minecraft:carpets"); - public static final BlockCategory CORAL = new BlockCategory("minecraft:coral"); - public static final BlockCategory CORAL_PLANTS = new BlockCategory("minecraft:coral_plants"); - public static final BlockCategory DARK_OAK_LOGS = new BlockCategory("minecraft:dark_oak_logs"); - public static final BlockCategory DOORS = new BlockCategory("minecraft:doors"); - public static final BlockCategory ENDERMAN_HOLDABLE = new BlockCategory("minecraft:enderman_holdable"); - public static final BlockCategory FLOWER_POTS = new BlockCategory("minecraft:flower_pots"); - public static final BlockCategory ICE = new BlockCategory("minecraft:ice"); - public static final BlockCategory JUNGLE_LOGS = new BlockCategory("minecraft:jungle_logs"); - public static final BlockCategory LEAVES = new BlockCategory("minecraft:leaves"); - public static final BlockCategory LOGS = new BlockCategory("minecraft:logs"); - public static final BlockCategory OAK_LOGS = new BlockCategory("minecraft:oak_logs"); - public static final BlockCategory PLANKS = new BlockCategory("minecraft:planks"); - public static final BlockCategory RAILS = new BlockCategory("minecraft:rails"); - public static final BlockCategory SAND = new BlockCategory("minecraft:sand"); - public static final BlockCategory SAPLINGS = new BlockCategory("minecraft:saplings"); - public static final BlockCategory SLABS = new BlockCategory("minecraft:slabs"); - public static final BlockCategory SPRUCE_LOGS = new BlockCategory("minecraft:spruce_logs"); - public static final BlockCategory STAIRS = new BlockCategory("minecraft:stairs"); - public static final BlockCategory STONE_BRICKS = new BlockCategory("minecraft:stone_bricks"); - public static final BlockCategory VALID_SPAWN = new BlockCategory("minecraft:valid_spawn"); - public static final BlockCategory WOODEN_BUTTONS = new BlockCategory("minecraft:wooden_buttons"); - public static final BlockCategory WOODEN_DOORS = new BlockCategory("minecraft:wooden_doors"); - public static final BlockCategory WOODEN_PRESSURE_PLATES = new BlockCategory("minecraft:wooden_pressure_plates"); - public static final BlockCategory WOODEN_SLABS = new BlockCategory("minecraft:wooden_slabs"); - public static final BlockCategory WOODEN_STAIRS = new BlockCategory("minecraft:wooden_stairs"); - public static final BlockCategory WOOL = new BlockCategory("minecraft:wool"); + public static final BlockCategory ACACIA_LOGS = register("minecraft:acacia_logs"); + public static final BlockCategory ANVIL = register("minecraft:anvil"); + public static final BlockCategory BANNERS = register("minecraft:banners"); + public static final BlockCategory BIRCH_LOGS = register("minecraft:birch_logs"); + public static final BlockCategory BUTTONS = register("minecraft:buttons"); + public static final BlockCategory CARPETS = register("minecraft:carpets"); + public static final BlockCategory CORAL = register("minecraft:coral"); + public static final BlockCategory CORAL_PLANTS = register("minecraft:coral_plants"); + public static final BlockCategory DARK_OAK_LOGS = register("minecraft:dark_oak_logs"); + public static final BlockCategory DOORS = register("minecraft:doors"); + public static final BlockCategory ENDERMAN_HOLDABLE = register("minecraft:enderman_holdable"); + public static final BlockCategory FLOWER_POTS = register("minecraft:flower_pots"); + public static final BlockCategory ICE = register("minecraft:ice"); + public static final BlockCategory JUNGLE_LOGS = register("minecraft:jungle_logs"); + public static final BlockCategory LEAVES = register("minecraft:leaves"); + public static final BlockCategory LOGS = register("minecraft:logs"); + public static final BlockCategory OAK_LOGS = register("minecraft:oak_logs"); + public static final BlockCategory PLANKS = register("minecraft:planks"); + public static final BlockCategory RAILS = register("minecraft:rails"); + public static final BlockCategory SAND = register("minecraft:sand"); + public static final BlockCategory SAPLINGS = register("minecraft:saplings"); + public static final BlockCategory SLABS = register("minecraft:slabs"); + public static final BlockCategory SPRUCE_LOGS = register("minecraft:spruce_logs"); + public static final BlockCategory STAIRS = register("minecraft:stairs"); + public static final BlockCategory STONE_BRICKS = register("minecraft:stone_bricks"); + public static final BlockCategory VALID_SPAWN = register("minecraft:valid_spawn"); + public static final BlockCategory WOODEN_BUTTONS = register("minecraft:wooden_buttons"); + public static final BlockCategory WOODEN_DOORS = register("minecraft:wooden_doors"); + public static final BlockCategory WOODEN_PRESSURE_PLATES = register("minecraft:wooden_pressure_plates"); + public static final BlockCategory WOODEN_SLABS = register("minecraft:wooden_slabs"); + public static final BlockCategory WOODEN_STAIRS = register("minecraft:wooden_stairs"); + public static final BlockCategory WOOL = register("minecraft:wool"); - private static final Map categoryMapping = new HashMap<>(); - - static { - for (Field field : BlockCategories.class.getFields()) { - if (field.getType() == BlockCategory.class) { - try { - registerCategory((BlockCategory) field.get(null)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } + private static BlockCategory register(final String id) { + return register(new BlockCategory(id)); } - public static void registerCategory(BlockCategory blockCategory) { - if (categoryMapping.containsKey(blockCategory.getId()) && !blockCategory.getId().startsWith("minecraft:")) { - throw new IllegalArgumentException("Existing category with this ID already registered"); - } - - categoryMapping.put(blockCategory.getId(), blockCategory); + public static BlockCategory register(final BlockCategory tag) { + return BlockCategory.REGISTRY.register(tag.getId(), tag); } @Nullable - public static BlockCategory getBlockCategory(String id) { - // If it has no namespace, assume minecraft. - if (id != null && !id.contains(":")) { - id = "minecraft:" + id; - } - return categoryMapping.get(id); + public static BlockCategory get(final String id) { + return BlockCategory.REGISTRY.get(id); } public static Collection values() { - return categoryMapping.values(); + return BlockCategory.REGISTRY.values(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java index a9a634a55..a37186cd0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.world.block; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.registry.NamespacedRegistry; import java.util.Set; @@ -30,6 +31,8 @@ import java.util.Set; */ public class BlockCategory { + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + private final String id; public BlockCategory(String id) { 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 5d67021d3..d0d83de14 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 @@ -22,6 +22,7 @@ package com.sk89q.worldedit.world.block; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.registry.NamespacedRegistry; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.BundledBlockData; @@ -33,6 +34,8 @@ import javax.annotation.Nullable; public class BlockType { + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + private String id; private BlockState defaultState; @@ -100,7 +103,7 @@ public class BlockType { */ @Nullable public ItemType getItemType() { - return ItemTypes.getItemType(this.id); + return ItemTypes.get(this.id); } /** 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 8735b62af..25645dece 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 @@ -19,10 +19,7 @@ package com.sk89q.worldedit.world.block; -import java.lang.reflect.Field; import java.util.Collection; -import java.util.HashMap; -import java.util.Map; import javax.annotation.Nullable; @@ -34,611 +31,593 @@ public class BlockTypes { private BlockTypes() { } - public static final BlockType ACACIA_BARK = new BlockType("minecraft:acacia_bark"); - public static final BlockType ACACIA_BUTTON = new BlockType("minecraft:acacia_button"); - public static final BlockType ACACIA_DOOR = new BlockType("minecraft:acacia_door"); - public static final BlockType ACACIA_FENCE = new BlockType("minecraft:acacia_fence"); - public static final BlockType ACACIA_FENCE_GATE = new BlockType("minecraft:acacia_fence_gate"); - public static final BlockType ACACIA_LEAVES = new BlockType("minecraft:acacia_leaves"); - public static final BlockType ACACIA_LOG = new BlockType("minecraft:acacia_log"); - public static final BlockType ACACIA_PLANKS = new BlockType("minecraft:acacia_planks"); - public static final BlockType ACACIA_PRESSURE_PLATE = new BlockType("minecraft:acacia_pressure_plate"); - public static final BlockType ACACIA_SAPLING = new BlockType("minecraft:acacia_sapling"); - public static final BlockType ACACIA_SLAB = new BlockType("minecraft:acacia_slab"); - public static final BlockType ACACIA_STAIRS = new BlockType("minecraft:acacia_stairs"); - public static final BlockType ACACIA_TRAPDOOR = new BlockType("minecraft:acacia_trapdoor"); - public static final BlockType ACTIVATOR_RAIL = new BlockType("minecraft:activator_rail"); - public static final BlockType AIR = new BlockType("minecraft:air"); - public static final BlockType ALLIUM = new BlockType("minecraft:allium"); - public static final BlockType ANDESITE = new BlockType("minecraft:andesite"); - public static final BlockType ANVIL = new BlockType("minecraft:anvil"); - public static final BlockType ATTACHED_MELON_STEM = new BlockType("minecraft:attached_melon_stem"); - public static final BlockType ATTACHED_PUMPKIN_STEM = new BlockType("minecraft:attached_pumpkin_stem"); - public static final BlockType AZURE_BLUET = new BlockType("minecraft:azure_bluet"); - public static final BlockType BARRIER = new BlockType("minecraft:barrier"); - public static final BlockType BEACON = new BlockType("minecraft:beacon"); - public static final BlockType BEDROCK = new BlockType("minecraft:bedrock"); - public static final BlockType BEETROOTS = new BlockType("minecraft:beetroots"); - public static final BlockType BIRCH_BARK = new BlockType("minecraft:birch_bark"); - public static final BlockType BIRCH_BUTTON = new BlockType("minecraft:birch_button"); - public static final BlockType BIRCH_DOOR = new BlockType("minecraft:birch_door"); - public static final BlockType BIRCH_FENCE = new BlockType("minecraft:birch_fence"); - public static final BlockType BIRCH_FENCE_GATE = new BlockType("minecraft:birch_fence_gate"); - public static final BlockType BIRCH_LEAVES = new BlockType("minecraft:birch_leaves"); - public static final BlockType BIRCH_LOG = new BlockType("minecraft:birch_log"); - public static final BlockType BIRCH_PLANKS = new BlockType("minecraft:birch_planks"); - public static final BlockType BIRCH_PRESSURE_PLATE = new BlockType("minecraft:birch_pressure_plate"); - public static final BlockType BIRCH_SAPLING = new BlockType("minecraft:birch_sapling"); - public static final BlockType BIRCH_SLAB = new BlockType("minecraft:birch_slab"); - public static final BlockType BIRCH_STAIRS = new BlockType("minecraft:birch_stairs"); - public static final BlockType BIRCH_TRAPDOOR = new BlockType("minecraft:birch_trapdoor"); - public static final BlockType BLACK_BANNER = new BlockType("minecraft:black_banner"); - public static final BlockType BLACK_BED = new BlockType("minecraft:black_bed"); - public static final BlockType BLACK_CARPET = new BlockType("minecraft:black_carpet"); - public static final BlockType BLACK_CONCRETE = new BlockType("minecraft:black_concrete"); - public static final BlockType BLACK_CONCRETE_POWDER = new BlockType("minecraft:black_concrete_powder"); - public static final BlockType BLACK_GLAZED_TERRACOTTA = new BlockType("minecraft:black_glazed_terracotta"); - public static final BlockType BLACK_SHULKER_BOX = new BlockType("minecraft:black_shulker_box"); - public static final BlockType BLACK_STAINED_GLASS = new BlockType("minecraft:black_stained_glass"); - public static final BlockType BLACK_STAINED_GLASS_PANE = new BlockType("minecraft:black_stained_glass_pane"); - public static final BlockType BLACK_TERRACOTTA = new BlockType("minecraft:black_terracotta"); - public static final BlockType BLACK_WALL_BANNER = new BlockType("minecraft:black_wall_banner"); - public static final BlockType BLACK_WOOL = new BlockType("minecraft:black_wool"); - public static final BlockType BLUE_BANNER = new BlockType("minecraft:blue_banner"); - public static final BlockType BLUE_BED = new BlockType("minecraft:blue_bed"); - public static final BlockType BLUE_CARPET = new BlockType("minecraft:blue_carpet"); - public static final BlockType BLUE_CONCRETE = new BlockType("minecraft:blue_concrete"); - public static final BlockType BLUE_CONCRETE_POWDER = new BlockType("minecraft:blue_concrete_powder"); - public static final BlockType BLUE_GLAZED_TERRACOTTA = new BlockType("minecraft:blue_glazed_terracotta"); - public static final BlockType BLUE_ICE = new BlockType("minecraft:blue_ice"); - public static final BlockType BLUE_ORCHID = new BlockType("minecraft:blue_orchid"); - public static final BlockType BLUE_SHULKER_BOX = new BlockType("minecraft:blue_shulker_box"); - public static final BlockType BLUE_STAINED_GLASS = new BlockType("minecraft:blue_stained_glass"); - public static final BlockType BLUE_STAINED_GLASS_PANE = new BlockType("minecraft:blue_stained_glass_pane"); - public static final BlockType BLUE_TERRACOTTA = new BlockType("minecraft:blue_terracotta"); - public static final BlockType BLUE_WALL_BANNER = new BlockType("minecraft:blue_wall_banner"); - public static final BlockType BLUE_WOOL = new BlockType("minecraft:blue_wool"); - public static final BlockType BONE_BLOCK = new BlockType("minecraft:bone_block"); - public static final BlockType BOOKSHELF = new BlockType("minecraft:bookshelf"); - public static final BlockType BRAIN_CORAL = new BlockType("minecraft:brain_coral"); - public static final BlockType BRAIN_CORAL_BLOCK = new BlockType("minecraft:brain_coral_block"); - public static final BlockType BRAIN_CORAL_FAN = new BlockType("minecraft:brain_coral_fan"); - public static final BlockType BREWING_STAND = new BlockType("minecraft:brewing_stand"); - public static final BlockType BRICK_SLAB = new BlockType("minecraft:brick_slab"); - public static final BlockType BRICK_STAIRS = new BlockType("minecraft:brick_stairs"); - public static final BlockType BRICKS = new BlockType("minecraft:bricks"); - public static final BlockType BROWN_BANNER = new BlockType("minecraft:brown_banner"); - public static final BlockType BROWN_BED = new BlockType("minecraft:brown_bed"); - public static final BlockType BROWN_CARPET = new BlockType("minecraft:brown_carpet"); - public static final BlockType BROWN_CONCRETE = new BlockType("minecraft:brown_concrete"); - public static final BlockType BROWN_CONCRETE_POWDER = new BlockType("minecraft:brown_concrete_powder"); - public static final BlockType BROWN_GLAZED_TERRACOTTA = new BlockType("minecraft:brown_glazed_terracotta"); - public static final BlockType BROWN_MUSHROOM = new BlockType("minecraft:brown_mushroom"); - public static final BlockType BROWN_MUSHROOM_BLOCK = new BlockType("minecraft:brown_mushroom_block"); - public static final BlockType BROWN_SHULKER_BOX = new BlockType("minecraft:brown_shulker_box"); - public static final BlockType BROWN_STAINED_GLASS = new BlockType("minecraft:brown_stained_glass"); - public static final BlockType BROWN_STAINED_GLASS_PANE = new BlockType("minecraft:brown_stained_glass_pane"); - public static final BlockType BROWN_TERRACOTTA = new BlockType("minecraft:brown_terracotta"); - public static final BlockType BROWN_WALL_BANNER = new BlockType("minecraft:brown_wall_banner"); - public static final BlockType BROWN_WOOL = new BlockType("minecraft:brown_wool"); - public static final BlockType BUBBLE_COLUMN = new BlockType("minecraft:bubble_column"); - public static final BlockType BUBBLE_CORAL = new BlockType("minecraft:bubble_coral"); - public static final BlockType BUBBLE_CORAL_BLOCK = new BlockType("minecraft:bubble_coral_block"); - public static final BlockType BUBBLE_CORAL_FAN = new BlockType("minecraft:bubble_coral_fan"); - public static final BlockType CACTUS = new BlockType("minecraft:cactus"); - public static final BlockType CAKE = new BlockType("minecraft:cake"); - public static final BlockType CARROTS = new BlockType("minecraft:carrots"); - public static final BlockType CARVED_PUMPKIN = new BlockType("minecraft:carved_pumpkin"); - public static final BlockType CAULDRON = new BlockType("minecraft:cauldron"); - public static final BlockType CAVE_AIR = new BlockType("minecraft:cave_air"); - public static final BlockType CHAIN_COMMAND_BLOCK = new BlockType("minecraft:chain_command_block"); - public static final BlockType CHEST = new BlockType("minecraft:chest"); - public static final BlockType CHIPPED_ANVIL = new BlockType("minecraft:chipped_anvil"); - public static final BlockType CHISELED_QUARTZ_BLOCK = new BlockType("minecraft:chiseled_quartz_block"); - public static final BlockType CHISELED_RED_SANDSTONE = new BlockType("minecraft:chiseled_red_sandstone"); - public static final BlockType CHISELED_SANDSTONE = new BlockType("minecraft:chiseled_sandstone"); - public static final BlockType CHISELED_STONE_BRICKS = new BlockType("minecraft:chiseled_stone_bricks"); - public static final BlockType CHORUS_FLOWER = new BlockType("minecraft:chorus_flower"); - public static final BlockType CHORUS_PLANT = new BlockType("minecraft:chorus_plant"); - public static final BlockType CLAY = new BlockType("minecraft:clay"); - public static final BlockType COAL_BLOCK = new BlockType("minecraft:coal_block"); - public static final BlockType COAL_ORE = new BlockType("minecraft:coal_ore"); - public static final BlockType COARSE_DIRT = new BlockType("minecraft:coarse_dirt"); - public static final BlockType COBBLESTONE = new BlockType("minecraft:cobblestone"); - public static final BlockType COBBLESTONE_SLAB = new BlockType("minecraft:cobblestone_slab"); - public static final BlockType COBBLESTONE_STAIRS = new BlockType("minecraft:cobblestone_stairs"); - public static final BlockType COBBLESTONE_WALL = new BlockType("minecraft:cobblestone_wall"); - public static final BlockType COBWEB = new BlockType("minecraft:cobweb"); - public static final BlockType COCOA = new BlockType("minecraft:cocoa"); - public static final BlockType COMMAND_BLOCK = new BlockType("minecraft:command_block"); - public static final BlockType COMPARATOR = new BlockType("minecraft:comparator"); - public static final BlockType CONDUIT = new BlockType("minecraft:conduit"); - public static final BlockType CRACKED_STONE_BRICKS = new BlockType("minecraft:cracked_stone_bricks"); - public static final BlockType CRAFTING_TABLE = new BlockType("minecraft:crafting_table"); - public static final BlockType CREEPER_HEAD = new BlockType("minecraft:creeper_head"); - public static final BlockType CREEPER_WALL_HEAD = new BlockType("minecraft:creeper_wall_head"); - public static final BlockType CUT_RED_SANDSTONE = new BlockType("minecraft:cut_red_sandstone"); - public static final BlockType CUT_SANDSTONE = new BlockType("minecraft:cut_sandstone"); - public static final BlockType CYAN_BANNER = new BlockType("minecraft:cyan_banner"); - public static final BlockType CYAN_BED = new BlockType("minecraft:cyan_bed"); - public static final BlockType CYAN_CARPET = new BlockType("minecraft:cyan_carpet"); - public static final BlockType CYAN_CONCRETE = new BlockType("minecraft:cyan_concrete"); - public static final BlockType CYAN_CONCRETE_POWDER = new BlockType("minecraft:cyan_concrete_powder"); - public static final BlockType CYAN_GLAZED_TERRACOTTA = new BlockType("minecraft:cyan_glazed_terracotta"); - public static final BlockType CYAN_SHULKER_BOX = new BlockType("minecraft:cyan_shulker_box"); - public static final BlockType CYAN_STAINED_GLASS = new BlockType("minecraft:cyan_stained_glass"); - public static final BlockType CYAN_STAINED_GLASS_PANE = new BlockType("minecraft:cyan_stained_glass_pane"); - public static final BlockType CYAN_TERRACOTTA = new BlockType("minecraft:cyan_terracotta"); - public static final BlockType CYAN_WALL_BANNER = new BlockType("minecraft:cyan_wall_banner"); - public static final BlockType CYAN_WOOL = new BlockType("minecraft:cyan_wool"); - public static final BlockType DAMAGED_ANVIL = new BlockType("minecraft:damaged_anvil"); - public static final BlockType DANDELION = new BlockType("minecraft:dandelion"); - public static final BlockType DARK_OAK_BARK = new BlockType("minecraft:dark_oak_bark"); - public static final BlockType DARK_OAK_BUTTON = new BlockType("minecraft:dark_oak_button"); - public static final BlockType DARK_OAK_DOOR = new BlockType("minecraft:dark_oak_door"); - public static final BlockType DARK_OAK_FENCE = new BlockType("minecraft:dark_oak_fence"); - public static final BlockType DARK_OAK_FENCE_GATE = new BlockType("minecraft:dark_oak_fence_gate"); - public static final BlockType DARK_OAK_LEAVES = new BlockType("minecraft:dark_oak_leaves"); - public static final BlockType DARK_OAK_LOG = new BlockType("minecraft:dark_oak_log"); - public static final BlockType DARK_OAK_PLANKS = new BlockType("minecraft:dark_oak_planks"); - public static final BlockType DARK_OAK_PRESSURE_PLATE = new BlockType("minecraft:dark_oak_pressure_plate"); - public static final BlockType DARK_OAK_SAPLING = new BlockType("minecraft:dark_oak_sapling"); - public static final BlockType DARK_OAK_SLAB = new BlockType("minecraft:dark_oak_slab"); - public static final BlockType DARK_OAK_STAIRS = new BlockType("minecraft:dark_oak_stairs"); - public static final BlockType DARK_OAK_TRAPDOOR = new BlockType("minecraft:dark_oak_trapdoor"); - public static final BlockType DARK_PRISMARINE = new BlockType("minecraft:dark_prismarine"); - public static final BlockType DARK_PRISMARINE_SLAB = new BlockType("minecraft:dark_prismarine_slab"); - public static final BlockType DARK_PRISMARINE_STAIRS = new BlockType("minecraft:dark_prismarine_stairs"); - public static final BlockType DAYLIGHT_DETECTOR = new BlockType("minecraft:daylight_detector"); - public static final BlockType DEAD_BRAIN_CORAL_BLOCK = new BlockType("minecraft:dead_brain_coral_block"); - public static final BlockType DEAD_BUBBLE_CORAL_BLOCK = new BlockType("minecraft:dead_bubble_coral_block"); - public static final BlockType DEAD_BUSH = new BlockType("minecraft:dead_bush"); - public static final BlockType DEAD_FIRE_CORAL_BLOCK = new BlockType("minecraft:dead_fire_coral_block"); - public static final BlockType DEAD_HORN_CORAL_BLOCK = new BlockType("minecraft:dead_horn_coral_block"); - public static final BlockType DEAD_TUBE_CORAL_BLOCK = new BlockType("minecraft:dead_tube_coral_block"); - public static final BlockType DETECTOR_RAIL = new BlockType("minecraft:detector_rail"); - public static final BlockType DIAMOND_BLOCK = new BlockType("minecraft:diamond_block"); - public static final BlockType DIAMOND_ORE = new BlockType("minecraft:diamond_ore"); - public static final BlockType DIORITE = new BlockType("minecraft:diorite"); - public static final BlockType DIRT = new BlockType("minecraft:dirt"); - public static final BlockType DISPENSER = new BlockType("minecraft:dispenser"); - public static final BlockType DRAGON_EGG = new BlockType("minecraft:dragon_egg"); - public static final BlockType DRAGON_HEAD = new BlockType("minecraft:dragon_head"); - public static final BlockType DRAGON_WALL_HEAD = new BlockType("minecraft:dragon_wall_head"); - public static final BlockType DRIED_KELP_BLOCK = new BlockType("minecraft:dried_kelp_block"); - public static final BlockType DROPPER = new BlockType("minecraft:dropper"); - public static final BlockType EMERALD_BLOCK = new BlockType("minecraft:emerald_block"); - public static final BlockType EMERALD_ORE = new BlockType("minecraft:emerald_ore"); - public static final BlockType ENCHANTING_TABLE = new BlockType("minecraft:enchanting_table"); - public static final BlockType END_GATEWAY = new BlockType("minecraft:end_gateway"); - public static final BlockType END_PORTAL = new BlockType("minecraft:end_portal"); - public static final BlockType END_PORTAL_FRAME = new BlockType("minecraft:end_portal_frame"); - public static final BlockType END_ROD = new BlockType("minecraft:end_rod"); - public static final BlockType END_STONE = new BlockType("minecraft:end_stone"); - public static final BlockType END_STONE_BRICKS = new BlockType("minecraft:end_stone_bricks"); - public static final BlockType ENDER_CHEST = new BlockType("minecraft:ender_chest"); - public static final BlockType FARMLAND = new BlockType("minecraft:farmland"); - public static final BlockType FERN = new BlockType("minecraft:fern"); - public static final BlockType FIRE = new BlockType("minecraft:fire"); - public static final BlockType FIRE_CORAL = new BlockType("minecraft:fire_coral"); - public static final BlockType FIRE_CORAL_BLOCK = new BlockType("minecraft:fire_coral_block"); - public static final BlockType FIRE_CORAL_FAN = new BlockType("minecraft:fire_coral_fan"); - public static final BlockType FLOWER_POT = new BlockType("minecraft:flower_pot"); - public static final BlockType FROSTED_ICE = new BlockType("minecraft:frosted_ice"); - public static final BlockType FURNACE = new BlockType("minecraft:furnace"); - public static final BlockType GLASS = new BlockType("minecraft:glass"); - public static final BlockType GLASS_PANE = new BlockType("minecraft:glass_pane"); - public static final BlockType GLOWSTONE = new BlockType("minecraft:glowstone"); - public static final BlockType GOLD_BLOCK = new BlockType("minecraft:gold_block"); - public static final BlockType GOLD_ORE = new BlockType("minecraft:gold_ore"); - public static final BlockType GRANITE = new BlockType("minecraft:granite"); - public static final BlockType GRASS = new BlockType("minecraft:grass"); - public static final BlockType GRASS_BLOCK = new BlockType("minecraft:grass_block"); - public static final BlockType GRASS_PATH = new BlockType("minecraft:grass_path"); - public static final BlockType GRAVEL = new BlockType("minecraft:gravel"); - public static final BlockType GRAY_BANNER = new BlockType("minecraft:gray_banner"); - public static final BlockType GRAY_BED = new BlockType("minecraft:gray_bed"); - public static final BlockType GRAY_CARPET = new BlockType("minecraft:gray_carpet"); - public static final BlockType GRAY_CONCRETE = new BlockType("minecraft:gray_concrete"); - public static final BlockType GRAY_CONCRETE_POWDER = new BlockType("minecraft:gray_concrete_powder"); - public static final BlockType GRAY_GLAZED_TERRACOTTA = new BlockType("minecraft:gray_glazed_terracotta"); - public static final BlockType GRAY_SHULKER_BOX = new BlockType("minecraft:gray_shulker_box"); - public static final BlockType GRAY_STAINED_GLASS = new BlockType("minecraft:gray_stained_glass"); - public static final BlockType GRAY_STAINED_GLASS_PANE = new BlockType("minecraft:gray_stained_glass_pane"); - public static final BlockType GRAY_TERRACOTTA = new BlockType("minecraft:gray_terracotta"); - public static final BlockType GRAY_WALL_BANNER = new BlockType("minecraft:gray_wall_banner"); - public static final BlockType GRAY_WOOL = new BlockType("minecraft:gray_wool"); - public static final BlockType GREEN_BANNER = new BlockType("minecraft:green_banner"); - public static final BlockType GREEN_BED = new BlockType("minecraft:green_bed"); - public static final BlockType GREEN_CARPET = new BlockType("minecraft:green_carpet"); - public static final BlockType GREEN_CONCRETE = new BlockType("minecraft:green_concrete"); - public static final BlockType GREEN_CONCRETE_POWDER = new BlockType("minecraft:green_concrete_powder"); - public static final BlockType GREEN_GLAZED_TERRACOTTA = new BlockType("minecraft:green_glazed_terracotta"); - public static final BlockType GREEN_SHULKER_BOX = new BlockType("minecraft:green_shulker_box"); - public static final BlockType GREEN_STAINED_GLASS = new BlockType("minecraft:green_stained_glass"); - public static final BlockType GREEN_STAINED_GLASS_PANE = new BlockType("minecraft:green_stained_glass_pane"); - public static final BlockType GREEN_TERRACOTTA = new BlockType("minecraft:green_terracotta"); - public static final BlockType GREEN_WALL_BANNER = new BlockType("minecraft:green_wall_banner"); - public static final BlockType GREEN_WOOL = new BlockType("minecraft:green_wool"); - public static final BlockType HAY_BLOCK = new BlockType("minecraft:hay_block"); - public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = new BlockType("minecraft:heavy_weighted_pressure_plate"); - public static final BlockType HOPPER = new BlockType("minecraft:hopper"); - public static final BlockType HORN_CORAL = new BlockType("minecraft:horn_coral"); - public static final BlockType HORN_CORAL_BLOCK = new BlockType("minecraft:horn_coral_block"); - public static final BlockType HORN_CORAL_FAN = new BlockType("minecraft:horn_coral_fan"); - public static final BlockType ICE = new BlockType("minecraft:ice"); - public static final BlockType INFESTED_CHISELED_STONE_BRICKS = new BlockType("minecraft:infested_chiseled_stone_bricks"); - public static final BlockType INFESTED_COBBLESTONE = new BlockType("minecraft:infested_cobblestone"); - public static final BlockType INFESTED_CRACKED_STONE_BRICKS = new BlockType("minecraft:infested_cracked_stone_bricks"); - public static final BlockType INFESTED_MOSSY_STONE_BRICKS = new BlockType("minecraft:infested_mossy_stone_bricks"); - public static final BlockType INFESTED_STONE = new BlockType("minecraft:infested_stone"); - public static final BlockType INFESTED_STONE_BRICKS = new BlockType("minecraft:infested_stone_bricks"); - public static final BlockType IRON_BARS = new BlockType("minecraft:iron_bars"); - public static final BlockType IRON_BLOCK = new BlockType("minecraft:iron_block"); - public static final BlockType IRON_DOOR = new BlockType("minecraft:iron_door"); - public static final BlockType IRON_ORE = new BlockType("minecraft:iron_ore"); - public static final BlockType IRON_TRAPDOOR = new BlockType("minecraft:iron_trapdoor"); - public static final BlockType JACK_O_LANTERN = new BlockType("minecraft:jack_o_lantern"); - public static final BlockType JUKEBOX = new BlockType("minecraft:jukebox"); - public static final BlockType JUNGLE_BARK = new BlockType("minecraft:jungle_bark"); - public static final BlockType JUNGLE_BUTTON = new BlockType("minecraft:jungle_button"); - public static final BlockType JUNGLE_DOOR = new BlockType("minecraft:jungle_door"); - public static final BlockType JUNGLE_FENCE = new BlockType("minecraft:jungle_fence"); - public static final BlockType JUNGLE_FENCE_GATE = new BlockType("minecraft:jungle_fence_gate"); - public static final BlockType JUNGLE_LEAVES = new BlockType("minecraft:jungle_leaves"); - public static final BlockType JUNGLE_LOG = new BlockType("minecraft:jungle_log"); - public static final BlockType JUNGLE_PLANKS = new BlockType("minecraft:jungle_planks"); - public static final BlockType JUNGLE_PRESSURE_PLATE = new BlockType("minecraft:jungle_pressure_plate"); - public static final BlockType JUNGLE_SAPLING = new BlockType("minecraft:jungle_sapling"); - public static final BlockType JUNGLE_SLAB = new BlockType("minecraft:jungle_slab"); - public static final BlockType JUNGLE_STAIRS = new BlockType("minecraft:jungle_stairs"); - public static final BlockType JUNGLE_TRAPDOOR = new BlockType("minecraft:jungle_trapdoor"); - public static final BlockType KELP = new BlockType("minecraft:kelp"); - public static final BlockType KELP_PLANT = new BlockType("minecraft:kelp_plant"); - public static final BlockType LADDER = new BlockType("minecraft:ladder"); - public static final BlockType LAPIS_BLOCK = new BlockType("minecraft:lapis_block"); - public static final BlockType LAPIS_ORE = new BlockType("minecraft:lapis_ore"); - public static final BlockType LARGE_FERN = new BlockType("minecraft:large_fern"); - public static final BlockType LAVA = new BlockType("minecraft:lava"); - public static final BlockType LEVER = new BlockType("minecraft:lever"); - public static final BlockType LIGHT_BLUE_BANNER = new BlockType("minecraft:light_blue_banner"); - public static final BlockType LIGHT_BLUE_BED = new BlockType("minecraft:light_blue_bed"); - public static final BlockType LIGHT_BLUE_CARPET = new BlockType("minecraft:light_blue_carpet"); - public static final BlockType LIGHT_BLUE_CONCRETE = new BlockType("minecraft:light_blue_concrete"); - public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = new BlockType("minecraft:light_blue_concrete_powder"); - public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = new BlockType("minecraft:light_blue_glazed_terracotta"); - public static final BlockType LIGHT_BLUE_SHULKER_BOX = new BlockType("minecraft:light_blue_shulker_box"); - public static final BlockType LIGHT_BLUE_STAINED_GLASS = new BlockType("minecraft:light_blue_stained_glass"); - public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = new BlockType("minecraft:light_blue_stained_glass_pane"); - public static final BlockType LIGHT_BLUE_TERRACOTTA = new BlockType("minecraft:light_blue_terracotta"); - public static final BlockType LIGHT_BLUE_WALL_BANNER = new BlockType("minecraft:light_blue_wall_banner"); - public static final BlockType LIGHT_BLUE_WOOL = new BlockType("minecraft:light_blue_wool"); - public static final BlockType LIGHT_GRAY_BANNER = new BlockType("minecraft:light_gray_banner"); - public static final BlockType LIGHT_GRAY_BED = new BlockType("minecraft:light_gray_bed"); - public static final BlockType LIGHT_GRAY_CARPET = new BlockType("minecraft:light_gray_carpet"); - public static final BlockType LIGHT_GRAY_CONCRETE = new BlockType("minecraft:light_gray_concrete"); - public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = new BlockType("minecraft:light_gray_concrete_powder"); - public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = new BlockType("minecraft:light_gray_glazed_terracotta"); - public static final BlockType LIGHT_GRAY_SHULKER_BOX = new BlockType("minecraft:light_gray_shulker_box"); - public static final BlockType LIGHT_GRAY_STAINED_GLASS = new BlockType("minecraft:light_gray_stained_glass"); - public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = new BlockType("minecraft:light_gray_stained_glass_pane"); - public static final BlockType LIGHT_GRAY_TERRACOTTA = new BlockType("minecraft:light_gray_terracotta"); - public static final BlockType LIGHT_GRAY_WALL_BANNER = new BlockType("minecraft:light_gray_wall_banner"); - public static final BlockType LIGHT_GRAY_WOOL = new BlockType("minecraft:light_gray_wool"); - public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = new BlockType("minecraft:light_weighted_pressure_plate"); - public static final BlockType LILAC = new BlockType("minecraft:lilac"); - public static final BlockType LILY_PAD = new BlockType("minecraft:lily_pad"); - public static final BlockType LIME_BANNER = new BlockType("minecraft:lime_banner"); - public static final BlockType LIME_BED = new BlockType("minecraft:lime_bed"); - public static final BlockType LIME_CARPET = new BlockType("minecraft:lime_carpet"); - public static final BlockType LIME_CONCRETE = new BlockType("minecraft:lime_concrete"); - public static final BlockType LIME_CONCRETE_POWDER = new BlockType("minecraft:lime_concrete_powder"); - public static final BlockType LIME_GLAZED_TERRACOTTA = new BlockType("minecraft:lime_glazed_terracotta"); - public static final BlockType LIME_SHULKER_BOX = new BlockType("minecraft:lime_shulker_box"); - public static final BlockType LIME_STAINED_GLASS = new BlockType("minecraft:lime_stained_glass"); - public static final BlockType LIME_STAINED_GLASS_PANE = new BlockType("minecraft:lime_stained_glass_pane"); - public static final BlockType LIME_TERRACOTTA = new BlockType("minecraft:lime_terracotta"); - public static final BlockType LIME_WALL_BANNER = new BlockType("minecraft:lime_wall_banner"); - public static final BlockType LIME_WOOL = new BlockType("minecraft:lime_wool"); - public static final BlockType MAGENTA_BANNER = new BlockType("minecraft:magenta_banner"); - public static final BlockType MAGENTA_BED = new BlockType("minecraft:magenta_bed"); - public static final BlockType MAGENTA_CARPET = new BlockType("minecraft:magenta_carpet"); - public static final BlockType MAGENTA_CONCRETE = new BlockType("minecraft:magenta_concrete"); - public static final BlockType MAGENTA_CONCRETE_POWDER = new BlockType("minecraft:magenta_concrete_powder"); - public static final BlockType MAGENTA_GLAZED_TERRACOTTA = new BlockType("minecraft:magenta_glazed_terracotta"); - public static final BlockType MAGENTA_SHULKER_BOX = new BlockType("minecraft:magenta_shulker_box"); - public static final BlockType MAGENTA_STAINED_GLASS = new BlockType("minecraft:magenta_stained_glass"); - public static final BlockType MAGENTA_STAINED_GLASS_PANE = new BlockType("minecraft:magenta_stained_glass_pane"); - public static final BlockType MAGENTA_TERRACOTTA = new BlockType("minecraft:magenta_terracotta"); - public static final BlockType MAGENTA_WALL_BANNER = new BlockType("minecraft:magenta_wall_banner"); - public static final BlockType MAGENTA_WOOL = new BlockType("minecraft:magenta_wool"); - public static final BlockType MAGMA_BLOCK = new BlockType("minecraft:magma_block"); - public static final BlockType MELON = new BlockType("minecraft:melon"); - public static final BlockType MELON_STEM = new BlockType("minecraft:melon_stem"); - public static final BlockType MOB_SPAWNER = new BlockType("minecraft:mob_spawner"); - public static final BlockType MOSSY_COBBLESTONE = new BlockType("minecraft:mossy_cobblestone"); - public static final BlockType MOSSY_COBBLESTONE_WALL = new BlockType("minecraft:mossy_cobblestone_wall"); - public static final BlockType MOSSY_STONE_BRICKS = new BlockType("minecraft:mossy_stone_bricks"); - public static final BlockType MOVING_PISTON = new BlockType("minecraft:moving_piston"); - public static final BlockType MUSHROOM_STEM = new BlockType("minecraft:mushroom_stem"); - public static final BlockType MYCELIUM = new BlockType("minecraft:mycelium"); - public static final BlockType NETHER_BRICK_FENCE = new BlockType("minecraft:nether_brick_fence"); - public static final BlockType NETHER_BRICK_SLAB = new BlockType("minecraft:nether_brick_slab"); - public static final BlockType NETHER_BRICK_STAIRS = new BlockType("minecraft:nether_brick_stairs"); - public static final BlockType NETHER_BRICKS = new BlockType("minecraft:nether_bricks"); - public static final BlockType NETHER_QUARTZ_ORE = new BlockType("minecraft:nether_quartz_ore"); - public static final BlockType NETHER_WART = new BlockType("minecraft:nether_wart"); - public static final BlockType NETHER_WART_BLOCK = new BlockType("minecraft:nether_wart_block"); - public static final BlockType NETHERRACK = new BlockType("minecraft:netherrack"); - public static final BlockType NOTE_BLOCK = new BlockType("minecraft:note_block"); - public static final BlockType OAK_BARK = new BlockType("minecraft:oak_bark"); - public static final BlockType OAK_BUTTON = new BlockType("minecraft:oak_button"); - public static final BlockType OAK_DOOR = new BlockType("minecraft:oak_door"); - public static final BlockType OAK_FENCE = new BlockType("minecraft:oak_fence"); - public static final BlockType OAK_FENCE_GATE = new BlockType("minecraft:oak_fence_gate"); - public static final BlockType OAK_LEAVES = new BlockType("minecraft:oak_leaves"); - public static final BlockType OAK_LOG = new BlockType("minecraft:oak_log"); - public static final BlockType OAK_PLANKS = new BlockType("minecraft:oak_planks"); - public static final BlockType OAK_PRESSURE_PLATE = new BlockType("minecraft:oak_pressure_plate"); - public static final BlockType OAK_SAPLING = new BlockType("minecraft:oak_sapling"); - public static final BlockType OAK_SLAB = new BlockType("minecraft:oak_slab"); - public static final BlockType OAK_STAIRS = new BlockType("minecraft:oak_stairs"); - public static final BlockType OAK_TRAPDOOR = new BlockType("minecraft:oak_trapdoor"); - public static final BlockType OBSERVER = new BlockType("minecraft:observer"); - public static final BlockType OBSIDIAN = new BlockType("minecraft:obsidian"); - public static final BlockType ORANGE_BANNER = new BlockType("minecraft:orange_banner"); - public static final BlockType ORANGE_BED = new BlockType("minecraft:orange_bed"); - public static final BlockType ORANGE_CARPET = new BlockType("minecraft:orange_carpet"); - public static final BlockType ORANGE_CONCRETE = new BlockType("minecraft:orange_concrete"); - public static final BlockType ORANGE_CONCRETE_POWDER = new BlockType("minecraft:orange_concrete_powder"); - public static final BlockType ORANGE_GLAZED_TERRACOTTA = new BlockType("minecraft:orange_glazed_terracotta"); - public static final BlockType ORANGE_SHULKER_BOX = new BlockType("minecraft:orange_shulker_box"); - public static final BlockType ORANGE_STAINED_GLASS = new BlockType("minecraft:orange_stained_glass"); - public static final BlockType ORANGE_STAINED_GLASS_PANE = new BlockType("minecraft:orange_stained_glass_pane"); - public static final BlockType ORANGE_TERRACOTTA = new BlockType("minecraft:orange_terracotta"); - public static final BlockType ORANGE_TULIP = new BlockType("minecraft:orange_tulip"); - public static final BlockType ORANGE_WALL_BANNER = new BlockType("minecraft:orange_wall_banner"); - public static final BlockType ORANGE_WOOL = new BlockType("minecraft:orange_wool"); - public static final BlockType OXEYE_DAISY = new BlockType("minecraft:oxeye_daisy"); - public static final BlockType PACKED_ICE = new BlockType("minecraft:packed_ice"); - public static final BlockType PEONY = new BlockType("minecraft:peony"); - public static final BlockType PETRIFIED_OAK_SLAB = new BlockType("minecraft:petrified_oak_slab"); - public static final BlockType PINK_BANNER = new BlockType("minecraft:pink_banner"); - public static final BlockType PINK_BED = new BlockType("minecraft:pink_bed"); - public static final BlockType PINK_CARPET = new BlockType("minecraft:pink_carpet"); - public static final BlockType PINK_CONCRETE = new BlockType("minecraft:pink_concrete"); - public static final BlockType PINK_CONCRETE_POWDER = new BlockType("minecraft:pink_concrete_powder"); - public static final BlockType PINK_GLAZED_TERRACOTTA = new BlockType("minecraft:pink_glazed_terracotta"); - public static final BlockType PINK_SHULKER_BOX = new BlockType("minecraft:pink_shulker_box"); - public static final BlockType PINK_STAINED_GLASS = new BlockType("minecraft:pink_stained_glass"); - public static final BlockType PINK_STAINED_GLASS_PANE = new BlockType("minecraft:pink_stained_glass_pane"); - public static final BlockType PINK_TERRACOTTA = new BlockType("minecraft:pink_terracotta"); - public static final BlockType PINK_TULIP = new BlockType("minecraft:pink_tulip"); - public static final BlockType PINK_WALL_BANNER = new BlockType("minecraft:pink_wall_banner"); - public static final BlockType PINK_WOOL = new BlockType("minecraft:pink_wool"); - public static final BlockType PISTON = new BlockType("minecraft:piston"); - public static final BlockType PISTON_HEAD = new BlockType("minecraft:piston_head"); - public static final BlockType PLAYER_HEAD = new BlockType("minecraft:player_head"); - public static final BlockType PLAYER_WALL_HEAD = new BlockType("minecraft:player_wall_head"); - public static final BlockType PODZOL = new BlockType("minecraft:podzol"); - public static final BlockType POLISHED_ANDESITE = new BlockType("minecraft:polished_andesite"); - public static final BlockType POLISHED_DIORITE = new BlockType("minecraft:polished_diorite"); - public static final BlockType POLISHED_GRANITE = new BlockType("minecraft:polished_granite"); - public static final BlockType POPPY = new BlockType("minecraft:poppy"); - public static final BlockType PORTAL = new BlockType("minecraft:portal"); - public static final BlockType POTATOES = new BlockType("minecraft:potatoes"); - public static final BlockType POTTED_ACACIA_SAPLING = new BlockType("minecraft:potted_acacia_sapling"); - public static final BlockType POTTED_ALLIUM = new BlockType("minecraft:potted_allium"); - public static final BlockType POTTED_AZURE_BLUET = new BlockType("minecraft:potted_azure_bluet"); - public static final BlockType POTTED_BIRCH_SAPLING = new BlockType("minecraft:potted_birch_sapling"); - public static final BlockType POTTED_BLUE_ORCHID = new BlockType("minecraft:potted_blue_orchid"); - public static final BlockType POTTED_BROWN_MUSHROOM = new BlockType("minecraft:potted_brown_mushroom"); - public static final BlockType POTTED_CACTUS = new BlockType("minecraft:potted_cactus"); - public static final BlockType POTTED_DANDELION = new BlockType("minecraft:potted_dandelion"); - public static final BlockType POTTED_DARK_OAK_SAPLING = new BlockType("minecraft:potted_dark_oak_sapling"); - public static final BlockType POTTED_DEAD_BUSH = new BlockType("minecraft:potted_dead_bush"); - public static final BlockType POTTED_FERN = new BlockType("minecraft:potted_fern"); - public static final BlockType POTTED_JUNGLE_SAPLING = new BlockType("minecraft:potted_jungle_sapling"); - public static final BlockType POTTED_OAK_SAPLING = new BlockType("minecraft:potted_oak_sapling"); - public static final BlockType POTTED_ORANGE_TULIP = new BlockType("minecraft:potted_orange_tulip"); - public static final BlockType POTTED_OXEYE_DAISY = new BlockType("minecraft:potted_oxeye_daisy"); - public static final BlockType POTTED_PINK_TULIP = new BlockType("minecraft:potted_pink_tulip"); - public static final BlockType POTTED_POPPY = new BlockType("minecraft:potted_poppy"); - public static final BlockType POTTED_RED_MUSHROOM = new BlockType("minecraft:potted_red_mushroom"); - public static final BlockType POTTED_RED_TULIP = new BlockType("minecraft:potted_red_tulip"); - public static final BlockType POTTED_SPRUCE_SAPLING = new BlockType("minecraft:potted_spruce_sapling"); - public static final BlockType POTTED_WHITE_TULIP = new BlockType("minecraft:potted_white_tulip"); - public static final BlockType POWERED_RAIL = new BlockType("minecraft:powered_rail"); - public static final BlockType PRISMARINE = new BlockType("minecraft:prismarine"); - public static final BlockType PRISMARINE_BRICK_SLAB = new BlockType("minecraft:prismarine_brick_slab"); - public static final BlockType PRISMARINE_BRICK_STAIRS = new BlockType("minecraft:prismarine_brick_stairs"); - public static final BlockType PRISMARINE_BRICKS = new BlockType("minecraft:prismarine_bricks"); - public static final BlockType PRISMARINE_SLAB = new BlockType("minecraft:prismarine_slab"); - public static final BlockType PRISMARINE_STAIRS = new BlockType("minecraft:prismarine_stairs"); - public static final BlockType PUMPKIN = new BlockType("minecraft:pumpkin"); - public static final BlockType PUMPKIN_STEM = new BlockType("minecraft:pumpkin_stem"); - public static final BlockType PURPLE_BANNER = new BlockType("minecraft:purple_banner"); - public static final BlockType PURPLE_BED = new BlockType("minecraft:purple_bed"); - public static final BlockType PURPLE_CARPET = new BlockType("minecraft:purple_carpet"); - public static final BlockType PURPLE_CONCRETE = new BlockType("minecraft:purple_concrete"); - public static final BlockType PURPLE_CONCRETE_POWDER = new BlockType("minecraft:purple_concrete_powder"); - public static final BlockType PURPLE_GLAZED_TERRACOTTA = new BlockType("minecraft:purple_glazed_terracotta"); - public static final BlockType PURPLE_SHULKER_BOX = new BlockType("minecraft:purple_shulker_box"); - public static final BlockType PURPLE_STAINED_GLASS = new BlockType("minecraft:purple_stained_glass"); - public static final BlockType PURPLE_STAINED_GLASS_PANE = new BlockType("minecraft:purple_stained_glass_pane"); - public static final BlockType PURPLE_TERRACOTTA = new BlockType("minecraft:purple_terracotta"); - public static final BlockType PURPLE_WALL_BANNER = new BlockType("minecraft:purple_wall_banner"); - public static final BlockType PURPLE_WOOL = new BlockType("minecraft:purple_wool"); - public static final BlockType PURPUR_BLOCK = new BlockType("minecraft:purpur_block"); - public static final BlockType PURPUR_PILLAR = new BlockType("minecraft:purpur_pillar"); - public static final BlockType PURPUR_SLAB = new BlockType("minecraft:purpur_slab"); - public static final BlockType PURPUR_STAIRS = new BlockType("minecraft:purpur_stairs"); - public static final BlockType QUARTZ_BLOCK = new BlockType("minecraft:quartz_block"); - public static final BlockType QUARTZ_PILLAR = new BlockType("minecraft:quartz_pillar"); - public static final BlockType QUARTZ_SLAB = new BlockType("minecraft:quartz_slab"); - public static final BlockType QUARTZ_STAIRS = new BlockType("minecraft:quartz_stairs"); - public static final BlockType RAIL = new BlockType("minecraft:rail"); - public static final BlockType RED_BANNER = new BlockType("minecraft:red_banner"); - public static final BlockType RED_BED = new BlockType("minecraft:red_bed"); - public static final BlockType RED_CARPET = new BlockType("minecraft:red_carpet"); - public static final BlockType RED_CONCRETE = new BlockType("minecraft:red_concrete"); - public static final BlockType RED_CONCRETE_POWDER = new BlockType("minecraft:red_concrete_powder"); - public static final BlockType RED_GLAZED_TERRACOTTA = new BlockType("minecraft:red_glazed_terracotta"); - public static final BlockType RED_MUSHROOM = new BlockType("minecraft:red_mushroom"); - public static final BlockType RED_MUSHROOM_BLOCK = new BlockType("minecraft:red_mushroom_block"); - public static final BlockType RED_NETHER_BRICKS = new BlockType("minecraft:red_nether_bricks"); - public static final BlockType RED_SAND = new BlockType("minecraft:red_sand"); - public static final BlockType RED_SANDSTONE = new BlockType("minecraft:red_sandstone"); - public static final BlockType RED_SANDSTONE_SLAB = new BlockType("minecraft:red_sandstone_slab"); - public static final BlockType RED_SANDSTONE_STAIRS = new BlockType("minecraft:red_sandstone_stairs"); - public static final BlockType RED_SHULKER_BOX = new BlockType("minecraft:red_shulker_box"); - public static final BlockType RED_STAINED_GLASS = new BlockType("minecraft:red_stained_glass"); - public static final BlockType RED_STAINED_GLASS_PANE = new BlockType("minecraft:red_stained_glass_pane"); - public static final BlockType RED_TERRACOTTA = new BlockType("minecraft:red_terracotta"); - public static final BlockType RED_TULIP = new BlockType("minecraft:red_tulip"); - public static final BlockType RED_WALL_BANNER = new BlockType("minecraft:red_wall_banner"); - public static final BlockType RED_WOOL = new BlockType("minecraft:red_wool"); - public static final BlockType REDSTONE_BLOCK = new BlockType("minecraft:redstone_block"); - public static final BlockType REDSTONE_LAMP = new BlockType("minecraft:redstone_lamp"); - public static final BlockType REDSTONE_ORE = new BlockType("minecraft:redstone_ore"); - public static final BlockType REDSTONE_TORCH = new BlockType("minecraft:redstone_torch"); - public static final BlockType REDSTONE_WALL_TORCH = new BlockType("minecraft:redstone_wall_torch"); - public static final BlockType REDSTONE_WIRE = new BlockType("minecraft:redstone_wire"); - public static final BlockType REPEATER = new BlockType("minecraft:repeater"); - public static final BlockType REPEATING_COMMAND_BLOCK = new BlockType("minecraft:repeating_command_block"); - public static final BlockType ROSE_BUSH = new BlockType("minecraft:rose_bush"); - public static final BlockType SAND = new BlockType("minecraft:sand"); - public static final BlockType SANDSTONE = new BlockType("minecraft:sandstone"); - public static final BlockType SANDSTONE_SLAB = new BlockType("minecraft:sandstone_slab"); - public static final BlockType SANDSTONE_STAIRS = new BlockType("minecraft:sandstone_stairs"); - public static final BlockType SEA_LANTERN = new BlockType("minecraft:sea_lantern"); - public static final BlockType SEA_PICKLE = new BlockType("minecraft:sea_pickle"); - public static final BlockType SEAGRASS = new BlockType("minecraft:seagrass"); - public static final BlockType SHULKER_BOX = new BlockType("minecraft:shulker_box"); - public static final BlockType SIGN = new BlockType("minecraft:sign"); - public static final BlockType SKELETON_SKULL = new BlockType("minecraft:skeleton_skull"); - public static final BlockType SKELETON_WALL_SKULL = new BlockType("minecraft:skeleton_wall_skull"); - public static final BlockType SLIME_BLOCK = new BlockType("minecraft:slime_block"); - public static final BlockType SMOOTH_QUARTZ = new BlockType("minecraft:smooth_quartz"); - public static final BlockType SMOOTH_RED_SANDSTONE = new BlockType("minecraft:smooth_red_sandstone"); - public static final BlockType SMOOTH_SANDSTONE = new BlockType("minecraft:smooth_sandstone"); - public static final BlockType SMOOTH_STONE = new BlockType("minecraft:smooth_stone"); - public static final BlockType SNOW = new BlockType("minecraft:snow"); - public static final BlockType SNOW_BLOCK = new BlockType("minecraft:snow_block"); - public static final BlockType SOUL_SAND = new BlockType("minecraft:soul_sand"); - public static final BlockType SPONGE = new BlockType("minecraft:sponge"); - public static final BlockType SPRUCE_BARK = new BlockType("minecraft:spruce_bark"); - public static final BlockType SPRUCE_BUTTON = new BlockType("minecraft:spruce_button"); - public static final BlockType SPRUCE_DOOR = new BlockType("minecraft:spruce_door"); - public static final BlockType SPRUCE_FENCE = new BlockType("minecraft:spruce_fence"); - public static final BlockType SPRUCE_FENCE_GATE = new BlockType("minecraft:spruce_fence_gate"); - public static final BlockType SPRUCE_LEAVES = new BlockType("minecraft:spruce_leaves"); - public static final BlockType SPRUCE_LOG = new BlockType("minecraft:spruce_log"); - public static final BlockType SPRUCE_PLANKS = new BlockType("minecraft:spruce_planks"); - public static final BlockType SPRUCE_PRESSURE_PLATE = new BlockType("minecraft:spruce_pressure_plate"); - public static final BlockType SPRUCE_SAPLING = new BlockType("minecraft:spruce_sapling"); - public static final BlockType SPRUCE_SLAB = new BlockType("minecraft:spruce_slab"); - public static final BlockType SPRUCE_STAIRS = new BlockType("minecraft:spruce_stairs"); - public static final BlockType SPRUCE_TRAPDOOR = new BlockType("minecraft:spruce_trapdoor"); - public static final BlockType STICKY_PISTON = new BlockType("minecraft:sticky_piston"); - public static final BlockType STONE = new BlockType("minecraft:stone"); - public static final BlockType STONE_BRICK_SLAB = new BlockType("minecraft:stone_brick_slab"); - public static final BlockType STONE_BRICK_STAIRS = new BlockType("minecraft:stone_brick_stairs"); - public static final BlockType STONE_BRICKS = new BlockType("minecraft:stone_bricks"); - public static final BlockType STONE_BUTTON = new BlockType("minecraft:stone_button"); - public static final BlockType STONE_PRESSURE_PLATE = new BlockType("minecraft:stone_pressure_plate"); - public static final BlockType STONE_SLAB = new BlockType("minecraft:stone_slab"); - public static final BlockType STRIPPED_ACACIA_LOG = new BlockType("minecraft:stripped_acacia_log"); - public static final BlockType STRIPPED_BIRCH_LOG = new BlockType("minecraft:stripped_birch_log"); - public static final BlockType STRIPPED_DARK_OAK_LOG = new BlockType("minecraft:stripped_dark_oak_log"); - public static final BlockType STRIPPED_JUNGLE_LOG = new BlockType("minecraft:stripped_jungle_log"); - public static final BlockType STRIPPED_OAK_LOG = new BlockType("minecraft:stripped_oak_log"); - public static final BlockType STRIPPED_SPRUCE_LOG = new BlockType("minecraft:stripped_spruce_log"); - public static final BlockType STRUCTURE_BLOCK = new BlockType("minecraft:structure_block"); - public static final BlockType STRUCTURE_VOID = new BlockType("minecraft:structure_void"); - public static final BlockType SUGAR_CANE = new BlockType("minecraft:sugar_cane"); - public static final BlockType SUNFLOWER = new BlockType("minecraft:sunflower"); - public static final BlockType TALL_GRASS = new BlockType("minecraft:tall_grass"); - public static final BlockType TALL_SEAGRASS = new BlockType("minecraft:tall_seagrass"); - public static final BlockType TERRACOTTA = new BlockType("minecraft:terracotta"); - public static final BlockType TNT = new BlockType("minecraft:tnt"); - public static final BlockType TORCH = new BlockType("minecraft:torch"); - public static final BlockType TRAPPED_CHEST = new BlockType("minecraft:trapped_chest"); - public static final BlockType TRIPWIRE = new BlockType("minecraft:tripwire"); - public static final BlockType TRIPWIRE_HOOK = new BlockType("minecraft:tripwire_hook"); - public static final BlockType TUBE_CORAL = new BlockType("minecraft:tube_coral"); - public static final BlockType TUBE_CORAL_BLOCK = new BlockType("minecraft:tube_coral_block"); - public static final BlockType TUBE_CORAL_FAN = new BlockType("minecraft:tube_coral_fan"); - public static final BlockType TURTLE_EGG = new BlockType("minecraft:turtle_egg"); - public static final BlockType VINE = new BlockType("minecraft:vine"); - public static final BlockType VOID_AIR = new BlockType("minecraft:void_air"); - public static final BlockType WALL_SIGN = new BlockType("minecraft:wall_sign"); - public static final BlockType WALL_TORCH = new BlockType("minecraft:wall_torch"); - public static final BlockType WATER = new BlockType("minecraft:water"); - public static final BlockType WET_SPONGE = new BlockType("minecraft:wet_sponge"); - public static final BlockType WHEAT = new BlockType("minecraft:wheat"); - public static final BlockType WHITE_BANNER = new BlockType("minecraft:white_banner"); - public static final BlockType WHITE_BED = new BlockType("minecraft:white_bed"); - public static final BlockType WHITE_CARPET = new BlockType("minecraft:white_carpet"); - public static final BlockType WHITE_CONCRETE = new BlockType("minecraft:white_concrete"); - public static final BlockType WHITE_CONCRETE_POWDER = new BlockType("minecraft:white_concrete_powder"); - public static final BlockType WHITE_GLAZED_TERRACOTTA = new BlockType("minecraft:white_glazed_terracotta"); - public static final BlockType WHITE_SHULKER_BOX = new BlockType("minecraft:white_shulker_box"); - public static final BlockType WHITE_STAINED_GLASS = new BlockType("minecraft:white_stained_glass"); - public static final BlockType WHITE_STAINED_GLASS_PANE = new BlockType("minecraft:white_stained_glass_pane"); - public static final BlockType WHITE_TERRACOTTA = new BlockType("minecraft:white_terracotta"); - public static final BlockType WHITE_TULIP = new BlockType("minecraft:white_tulip"); - public static final BlockType WHITE_WALL_BANNER = new BlockType("minecraft:white_wall_banner"); - public static final BlockType WHITE_WOOL = new BlockType("minecraft:white_wool"); - public static final BlockType WITHER_SKELETON_SKULL = new BlockType("minecraft:wither_skeleton_skull"); - public static final BlockType WITHER_SKELETON_WALL_SKULL = new BlockType("minecraft:wither_skeleton_wall_skull"); - public static final BlockType YELLOW_BANNER = new BlockType("minecraft:yellow_banner"); - public static final BlockType YELLOW_BED = new BlockType("minecraft:yellow_bed"); - public static final BlockType YELLOW_CARPET = new BlockType("minecraft:yellow_carpet"); - public static final BlockType YELLOW_CONCRETE = new BlockType("minecraft:yellow_concrete"); - public static final BlockType YELLOW_CONCRETE_POWDER = new BlockType("minecraft:yellow_concrete_powder"); - public static final BlockType YELLOW_GLAZED_TERRACOTTA = new BlockType("minecraft:yellow_glazed_terracotta"); - public static final BlockType YELLOW_SHULKER_BOX = new BlockType("minecraft:yellow_shulker_box"); - public static final BlockType YELLOW_STAINED_GLASS = new BlockType("minecraft:yellow_stained_glass"); - public static final BlockType YELLOW_STAINED_GLASS_PANE = new BlockType("minecraft:yellow_stained_glass_pane"); - public static final BlockType YELLOW_TERRACOTTA = new BlockType("minecraft:yellow_terracotta"); - public static final BlockType YELLOW_WALL_BANNER = new BlockType("minecraft:yellow_wall_banner"); - public static final BlockType YELLOW_WOOL = new BlockType("minecraft:yellow_wool"); - public static final BlockType ZOMBIE_HEAD = new BlockType("minecraft:zombie_head"); - public static final BlockType ZOMBIE_WALL_HEAD = new BlockType("minecraft:zombie_wall_head"); + public static final BlockType ACACIA_BARK = register("minecraft:acacia_bark"); + public static final BlockType ACACIA_BUTTON = register("minecraft:acacia_button"); + public static final BlockType ACACIA_DOOR = register("minecraft:acacia_door"); + public static final BlockType ACACIA_FENCE = register("minecraft:acacia_fence"); + public static final BlockType ACACIA_FENCE_GATE = register("minecraft:acacia_fence_gate"); + public static final BlockType ACACIA_LEAVES = register("minecraft:acacia_leaves"); + public static final BlockType ACACIA_LOG = register("minecraft:acacia_log"); + public static final BlockType ACACIA_PLANKS = register("minecraft:acacia_planks"); + public static final BlockType ACACIA_PRESSURE_PLATE = register("minecraft:acacia_pressure_plate"); + public static final BlockType ACACIA_SAPLING = register("minecraft:acacia_sapling"); + public static final BlockType ACACIA_SLAB = register("minecraft:acacia_slab"); + public static final BlockType ACACIA_STAIRS = register("minecraft:acacia_stairs"); + public static final BlockType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor"); + public static final BlockType ACTIVATOR_RAIL = register("minecraft:activator_rail"); + public static final BlockType AIR = register("minecraft:air"); + public static final BlockType ALLIUM = register("minecraft:allium"); + public static final BlockType ANDESITE = register("minecraft:andesite"); + public static final BlockType ANVIL = register("minecraft:anvil"); + public static final BlockType ATTACHED_MELON_STEM = register("minecraft:attached_melon_stem"); + public static final BlockType ATTACHED_PUMPKIN_STEM = register("minecraft:attached_pumpkin_stem"); + public static final BlockType AZURE_BLUET = register("minecraft:azure_bluet"); + public static final BlockType BARRIER = register("minecraft:barrier"); + public static final BlockType BEACON = register("minecraft:beacon"); + public static final BlockType BEDROCK = register("minecraft:bedrock"); + public static final BlockType BEETROOTS = register("minecraft:beetroots"); + public static final BlockType BIRCH_BARK = register("minecraft:birch_bark"); + public static final BlockType BIRCH_BUTTON = register("minecraft:birch_button"); + public static final BlockType BIRCH_DOOR = register("minecraft:birch_door"); + public static final BlockType BIRCH_FENCE = register("minecraft:birch_fence"); + public static final BlockType BIRCH_FENCE_GATE = register("minecraft:birch_fence_gate"); + public static final BlockType BIRCH_LEAVES = register("minecraft:birch_leaves"); + public static final BlockType BIRCH_LOG = register("minecraft:birch_log"); + public static final BlockType BIRCH_PLANKS = register("minecraft:birch_planks"); + public static final BlockType BIRCH_PRESSURE_PLATE = register("minecraft:birch_pressure_plate"); + public static final BlockType BIRCH_SAPLING = register("minecraft:birch_sapling"); + public static final BlockType BIRCH_SLAB = register("minecraft:birch_slab"); + public static final BlockType BIRCH_STAIRS = register("minecraft:birch_stairs"); + public static final BlockType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor"); + public static final BlockType BLACK_BANNER = register("minecraft:black_banner"); + public static final BlockType BLACK_BED = register("minecraft:black_bed"); + public static final BlockType BLACK_CARPET = register("minecraft:black_carpet"); + public static final BlockType BLACK_CONCRETE = register("minecraft:black_concrete"); + public static final BlockType BLACK_CONCRETE_POWDER = register("minecraft:black_concrete_powder"); + public static final BlockType BLACK_GLAZED_TERRACOTTA = register("minecraft:black_glazed_terracotta"); + public static final BlockType BLACK_SHULKER_BOX = register("minecraft:black_shulker_box"); + public static final BlockType BLACK_STAINED_GLASS = register("minecraft:black_stained_glass"); + public static final BlockType BLACK_STAINED_GLASS_PANE = register("minecraft:black_stained_glass_pane"); + public static final BlockType BLACK_TERRACOTTA = register("minecraft:black_terracotta"); + public static final BlockType BLACK_WALL_BANNER = register("minecraft:black_wall_banner"); + public static final BlockType BLACK_WOOL = register("minecraft:black_wool"); + public static final BlockType BLUE_BANNER = register("minecraft:blue_banner"); + public static final BlockType BLUE_BED = register("minecraft:blue_bed"); + public static final BlockType BLUE_CARPET = register("minecraft:blue_carpet"); + public static final BlockType BLUE_CONCRETE = register("minecraft:blue_concrete"); + public static final BlockType BLUE_CONCRETE_POWDER = register("minecraft:blue_concrete_powder"); + public static final BlockType BLUE_GLAZED_TERRACOTTA = register("minecraft:blue_glazed_terracotta"); + public static final BlockType BLUE_ICE = register("minecraft:blue_ice"); + public static final BlockType BLUE_ORCHID = register("minecraft:blue_orchid"); + public static final BlockType BLUE_SHULKER_BOX = register("minecraft:blue_shulker_box"); + public static final BlockType BLUE_STAINED_GLASS = register("minecraft:blue_stained_glass"); + public static final BlockType BLUE_STAINED_GLASS_PANE = register("minecraft:blue_stained_glass_pane"); + public static final BlockType BLUE_TERRACOTTA = register("minecraft:blue_terracotta"); + public static final BlockType BLUE_WALL_BANNER = register("minecraft:blue_wall_banner"); + public static final BlockType BLUE_WOOL = register("minecraft:blue_wool"); + public static final BlockType BONE_BLOCK = register("minecraft:bone_block"); + public static final BlockType BOOKSHELF = register("minecraft:bookshelf"); + public static final BlockType BRAIN_CORAL = register("minecraft:brain_coral"); + public static final BlockType BRAIN_CORAL_BLOCK = register("minecraft:brain_coral_block"); + public static final BlockType BRAIN_CORAL_FAN = register("minecraft:brain_coral_fan"); + public static final BlockType BREWING_STAND = register("minecraft:brewing_stand"); + public static final BlockType BRICK_SLAB = register("minecraft:brick_slab"); + public static final BlockType BRICK_STAIRS = register("minecraft:brick_stairs"); + public static final BlockType BRICKS = register("minecraft:bricks"); + public static final BlockType BROWN_BANNER = register("minecraft:brown_banner"); + public static final BlockType BROWN_BED = register("minecraft:brown_bed"); + public static final BlockType BROWN_CARPET = register("minecraft:brown_carpet"); + public static final BlockType BROWN_CONCRETE = register("minecraft:brown_concrete"); + public static final BlockType BROWN_CONCRETE_POWDER = register("minecraft:brown_concrete_powder"); + public static final BlockType BROWN_GLAZED_TERRACOTTA = register("minecraft:brown_glazed_terracotta"); + public static final BlockType BROWN_MUSHROOM = register("minecraft:brown_mushroom"); + public static final BlockType BROWN_MUSHROOM_BLOCK = register("minecraft:brown_mushroom_block"); + public static final BlockType BROWN_SHULKER_BOX = register("minecraft:brown_shulker_box"); + public static final BlockType BROWN_STAINED_GLASS = register("minecraft:brown_stained_glass"); + public static final BlockType BROWN_STAINED_GLASS_PANE = register("minecraft:brown_stained_glass_pane"); + public static final BlockType BROWN_TERRACOTTA = register("minecraft:brown_terracotta"); + public static final BlockType BROWN_WALL_BANNER = register("minecraft:brown_wall_banner"); + public static final BlockType BROWN_WOOL = register("minecraft:brown_wool"); + public static final BlockType BUBBLE_COLUMN = register("minecraft:bubble_column"); + public static final BlockType BUBBLE_CORAL = register("minecraft:bubble_coral"); + public static final BlockType BUBBLE_CORAL_BLOCK = register("minecraft:bubble_coral_block"); + public static final BlockType BUBBLE_CORAL_FAN = register("minecraft:bubble_coral_fan"); + public static final BlockType CACTUS = register("minecraft:cactus"); + public static final BlockType CAKE = register("minecraft:cake"); + public static final BlockType CARROTS = register("minecraft:carrots"); + public static final BlockType CARVED_PUMPKIN = register("minecraft:carved_pumpkin"); + public static final BlockType CAULDRON = register("minecraft:cauldron"); + public static final BlockType CAVE_AIR = register("minecraft:cave_air"); + public static final BlockType CHAIN_COMMAND_BLOCK = register("minecraft:chain_command_block"); + public static final BlockType CHEST = register("minecraft:chest"); + public static final BlockType CHIPPED_ANVIL = register("minecraft:chipped_anvil"); + public static final BlockType CHISELED_QUARTZ_BLOCK = register("minecraft:chiseled_quartz_block"); + public static final BlockType CHISELED_RED_SANDSTONE = register("minecraft:chiseled_red_sandstone"); + public static final BlockType CHISELED_SANDSTONE = register("minecraft:chiseled_sandstone"); + public static final BlockType CHISELED_STONE_BRICKS = register("minecraft:chiseled_stone_bricks"); + public static final BlockType CHORUS_FLOWER = register("minecraft:chorus_flower"); + public static final BlockType CHORUS_PLANT = register("minecraft:chorus_plant"); + public static final BlockType CLAY = register("minecraft:clay"); + public static final BlockType COAL_BLOCK = register("minecraft:coal_block"); + public static final BlockType COAL_ORE = register("minecraft:coal_ore"); + public static final BlockType COARSE_DIRT = register("minecraft:coarse_dirt"); + public static final BlockType COBBLESTONE = register("minecraft:cobblestone"); + public static final BlockType COBBLESTONE_SLAB = register("minecraft:cobblestone_slab"); + public static final BlockType COBBLESTONE_STAIRS = register("minecraft:cobblestone_stairs"); + public static final BlockType COBBLESTONE_WALL = register("minecraft:cobblestone_wall"); + public static final BlockType COBWEB = register("minecraft:cobweb"); + public static final BlockType COCOA = register("minecraft:cocoa"); + public static final BlockType COMMAND_BLOCK = register("minecraft:command_block"); + public static final BlockType COMPARATOR = register("minecraft:comparator"); + public static final BlockType CONDUIT = register("minecraft:conduit"); + public static final BlockType CRACKED_STONE_BRICKS = register("minecraft:cracked_stone_bricks"); + public static final BlockType CRAFTING_TABLE = register("minecraft:crafting_table"); + public static final BlockType CREEPER_HEAD = register("minecraft:creeper_head"); + public static final BlockType CREEPER_WALL_HEAD = register("minecraft:creeper_wall_head"); + public static final BlockType CUT_RED_SANDSTONE = register("minecraft:cut_red_sandstone"); + public static final BlockType CUT_SANDSTONE = register("minecraft:cut_sandstone"); + public static final BlockType CYAN_BANNER = register("minecraft:cyan_banner"); + public static final BlockType CYAN_BED = register("minecraft:cyan_bed"); + public static final BlockType CYAN_CARPET = register("minecraft:cyan_carpet"); + public static final BlockType CYAN_CONCRETE = register("minecraft:cyan_concrete"); + public static final BlockType CYAN_CONCRETE_POWDER = register("minecraft:cyan_concrete_powder"); + public static final BlockType CYAN_GLAZED_TERRACOTTA = register("minecraft:cyan_glazed_terracotta"); + public static final BlockType CYAN_SHULKER_BOX = register("minecraft:cyan_shulker_box"); + public static final BlockType CYAN_STAINED_GLASS = register("minecraft:cyan_stained_glass"); + public static final BlockType CYAN_STAINED_GLASS_PANE = register("minecraft:cyan_stained_glass_pane"); + public static final BlockType CYAN_TERRACOTTA = register("minecraft:cyan_terracotta"); + public static final BlockType CYAN_WALL_BANNER = register("minecraft:cyan_wall_banner"); + public static final BlockType CYAN_WOOL = register("minecraft:cyan_wool"); + public static final BlockType DAMAGED_ANVIL = register("minecraft:damaged_anvil"); + public static final BlockType DANDELION = register("minecraft:dandelion"); + public static final BlockType DARK_OAK_BARK = register("minecraft:dark_oak_bark"); + public static final BlockType DARK_OAK_BUTTON = register("minecraft:dark_oak_button"); + public static final BlockType DARK_OAK_DOOR = register("minecraft:dark_oak_door"); + public static final BlockType DARK_OAK_FENCE = register("minecraft:dark_oak_fence"); + public static final BlockType DARK_OAK_FENCE_GATE = register("minecraft:dark_oak_fence_gate"); + public static final BlockType DARK_OAK_LEAVES = register("minecraft:dark_oak_leaves"); + public static final BlockType DARK_OAK_LOG = register("minecraft:dark_oak_log"); + public static final BlockType DARK_OAK_PLANKS = register("minecraft:dark_oak_planks"); + public static final BlockType DARK_OAK_PRESSURE_PLATE = register("minecraft:dark_oak_pressure_plate"); + public static final BlockType DARK_OAK_SAPLING = register("minecraft:dark_oak_sapling"); + public static final BlockType DARK_OAK_SLAB = register("minecraft:dark_oak_slab"); + public static final BlockType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs"); + public static final BlockType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor"); + public static final BlockType DARK_PRISMARINE = register("minecraft:dark_prismarine"); + public static final BlockType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab"); + public static final BlockType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs"); + public static final BlockType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector"); + public static final BlockType DEAD_BRAIN_CORAL_BLOCK = register("minecraft:dead_brain_coral_block"); + public static final BlockType DEAD_BUBBLE_CORAL_BLOCK = register("minecraft:dead_bubble_coral_block"); + public static final BlockType DEAD_BUSH = register("minecraft:dead_bush"); + public static final BlockType DEAD_FIRE_CORAL_BLOCK = register("minecraft:dead_fire_coral_block"); + public static final BlockType DEAD_HORN_CORAL_BLOCK = register("minecraft:dead_horn_coral_block"); + public static final BlockType DEAD_TUBE_CORAL_BLOCK = register("minecraft:dead_tube_coral_block"); + public static final BlockType DETECTOR_RAIL = register("minecraft:detector_rail"); + public static final BlockType DIAMOND_BLOCK = register("minecraft:diamond_block"); + public static final BlockType DIAMOND_ORE = register("minecraft:diamond_ore"); + public static final BlockType DIORITE = register("minecraft:diorite"); + public static final BlockType DIRT = register("minecraft:dirt"); + public static final BlockType DISPENSER = register("minecraft:dispenser"); + public static final BlockType DRAGON_EGG = register("minecraft:dragon_egg"); + public static final BlockType DRAGON_HEAD = register("minecraft:dragon_head"); + public static final BlockType DRAGON_WALL_HEAD = register("minecraft:dragon_wall_head"); + public static final BlockType DRIED_KELP_BLOCK = register("minecraft:dried_kelp_block"); + public static final BlockType DROPPER = register("minecraft:dropper"); + public static final BlockType EMERALD_BLOCK = register("minecraft:emerald_block"); + public static final BlockType EMERALD_ORE = register("minecraft:emerald_ore"); + public static final BlockType ENCHANTING_TABLE = register("minecraft:enchanting_table"); + public static final BlockType END_GATEWAY = register("minecraft:end_gateway"); + public static final BlockType END_PORTAL = register("minecraft:end_portal"); + public static final BlockType END_PORTAL_FRAME = register("minecraft:end_portal_frame"); + public static final BlockType END_ROD = register("minecraft:end_rod"); + public static final BlockType END_STONE = register("minecraft:end_stone"); + public static final BlockType END_STONE_BRICKS = register("minecraft:end_stone_bricks"); + public static final BlockType ENDER_CHEST = register("minecraft:ender_chest"); + public static final BlockType FARMLAND = register("minecraft:farmland"); + public static final BlockType FERN = register("minecraft:fern"); + public static final BlockType FIRE = register("minecraft:fire"); + public static final BlockType FIRE_CORAL = register("minecraft:fire_coral"); + public static final BlockType FIRE_CORAL_BLOCK = register("minecraft:fire_coral_block"); + public static final BlockType FIRE_CORAL_FAN = register("minecraft:fire_coral_fan"); + public static final BlockType FLOWER_POT = register("minecraft:flower_pot"); + public static final BlockType FROSTED_ICE = register("minecraft:frosted_ice"); + public static final BlockType FURNACE = register("minecraft:furnace"); + public static final BlockType GLASS = register("minecraft:glass"); + public static final BlockType GLASS_PANE = register("minecraft:glass_pane"); + public static final BlockType GLOWSTONE = register("minecraft:glowstone"); + public static final BlockType GOLD_BLOCK = register("minecraft:gold_block"); + public static final BlockType GOLD_ORE = register("minecraft:gold_ore"); + public static final BlockType GRANITE = register("minecraft:granite"); + public static final BlockType GRASS = register("minecraft:grass"); + public static final BlockType GRASS_BLOCK = register("minecraft:grass_block"); + public static final BlockType GRASS_PATH = register("minecraft:grass_path"); + public static final BlockType GRAVEL = register("minecraft:gravel"); + public static final BlockType GRAY_BANNER = register("minecraft:gray_banner"); + public static final BlockType GRAY_BED = register("minecraft:gray_bed"); + public static final BlockType GRAY_CARPET = register("minecraft:gray_carpet"); + public static final BlockType GRAY_CONCRETE = register("minecraft:gray_concrete"); + public static final BlockType GRAY_CONCRETE_POWDER = register("minecraft:gray_concrete_powder"); + public static final BlockType GRAY_GLAZED_TERRACOTTA = register("minecraft:gray_glazed_terracotta"); + public static final BlockType GRAY_SHULKER_BOX = register("minecraft:gray_shulker_box"); + public static final BlockType GRAY_STAINED_GLASS = register("minecraft:gray_stained_glass"); + public static final BlockType GRAY_STAINED_GLASS_PANE = register("minecraft:gray_stained_glass_pane"); + public static final BlockType GRAY_TERRACOTTA = register("minecraft:gray_terracotta"); + public static final BlockType GRAY_WALL_BANNER = register("minecraft:gray_wall_banner"); + public static final BlockType GRAY_WOOL = register("minecraft:gray_wool"); + public static final BlockType GREEN_BANNER = register("minecraft:green_banner"); + public static final BlockType GREEN_BED = register("minecraft:green_bed"); + public static final BlockType GREEN_CARPET = register("minecraft:green_carpet"); + public static final BlockType GREEN_CONCRETE = register("minecraft:green_concrete"); + public static final BlockType GREEN_CONCRETE_POWDER = register("minecraft:green_concrete_powder"); + public static final BlockType GREEN_GLAZED_TERRACOTTA = register("minecraft:green_glazed_terracotta"); + public static final BlockType GREEN_SHULKER_BOX = register("minecraft:green_shulker_box"); + public static final BlockType GREEN_STAINED_GLASS = register("minecraft:green_stained_glass"); + public static final BlockType GREEN_STAINED_GLASS_PANE = register("minecraft:green_stained_glass_pane"); + public static final BlockType GREEN_TERRACOTTA = register("minecraft:green_terracotta"); + public static final BlockType GREEN_WALL_BANNER = register("minecraft:green_wall_banner"); + public static final BlockType GREEN_WOOL = register("minecraft:green_wool"); + public static final BlockType HAY_BLOCK = register("minecraft:hay_block"); + public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = register("minecraft:heavy_weighted_pressure_plate"); + public static final BlockType HOPPER = register("minecraft:hopper"); + public static final BlockType HORN_CORAL = register("minecraft:horn_coral"); + public static final BlockType HORN_CORAL_BLOCK = register("minecraft:horn_coral_block"); + public static final BlockType HORN_CORAL_FAN = register("minecraft:horn_coral_fan"); + public static final BlockType ICE = register("minecraft:ice"); + public static final BlockType INFESTED_CHISELED_STONE_BRICKS = register("minecraft:infested_chiseled_stone_bricks"); + public static final BlockType INFESTED_COBBLESTONE = register("minecraft:infested_cobblestone"); + public static final BlockType INFESTED_CRACKED_STONE_BRICKS = register("minecraft:infested_cracked_stone_bricks"); + public static final BlockType INFESTED_MOSSY_STONE_BRICKS = register("minecraft:infested_mossy_stone_bricks"); + public static final BlockType INFESTED_STONE = register("minecraft:infested_stone"); + public static final BlockType INFESTED_STONE_BRICKS = register("minecraft:infested_stone_bricks"); + public static final BlockType IRON_BARS = register("minecraft:iron_bars"); + public static final BlockType IRON_BLOCK = register("minecraft:iron_block"); + public static final BlockType IRON_DOOR = register("minecraft:iron_door"); + public static final BlockType IRON_ORE = register("minecraft:iron_ore"); + public static final BlockType IRON_TRAPDOOR = register("minecraft:iron_trapdoor"); + public static final BlockType JACK_O_LANTERN = register("minecraft:jack_o_lantern"); + public static final BlockType JUKEBOX = register("minecraft:jukebox"); + public static final BlockType JUNGLE_BARK = register("minecraft:jungle_bark"); + public static final BlockType JUNGLE_BUTTON = register("minecraft:jungle_button"); + public static final BlockType JUNGLE_DOOR = register("minecraft:jungle_door"); + public static final BlockType JUNGLE_FENCE = register("minecraft:jungle_fence"); + public static final BlockType JUNGLE_FENCE_GATE = register("minecraft:jungle_fence_gate"); + public static final BlockType JUNGLE_LEAVES = register("minecraft:jungle_leaves"); + public static final BlockType JUNGLE_LOG = register("minecraft:jungle_log"); + public static final BlockType JUNGLE_PLANKS = register("minecraft:jungle_planks"); + public static final BlockType JUNGLE_PRESSURE_PLATE = register("minecraft:jungle_pressure_plate"); + public static final BlockType JUNGLE_SAPLING = register("minecraft:jungle_sapling"); + public static final BlockType JUNGLE_SLAB = register("minecraft:jungle_slab"); + public static final BlockType JUNGLE_STAIRS = register("minecraft:jungle_stairs"); + public static final BlockType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor"); + public static final BlockType KELP = register("minecraft:kelp"); + public static final BlockType KELP_PLANT = register("minecraft:kelp_plant"); + public static final BlockType LADDER = register("minecraft:ladder"); + public static final BlockType LAPIS_BLOCK = register("minecraft:lapis_block"); + public static final BlockType LAPIS_ORE = register("minecraft:lapis_ore"); + public static final BlockType LARGE_FERN = register("minecraft:large_fern"); + public static final BlockType LAVA = register("minecraft:lava"); + public static final BlockType LEVER = register("minecraft:lever"); + public static final BlockType LIGHT_BLUE_BANNER = register("minecraft:light_blue_banner"); + public static final BlockType LIGHT_BLUE_BED = register("minecraft:light_blue_bed"); + public static final BlockType LIGHT_BLUE_CARPET = register("minecraft:light_blue_carpet"); + public static final BlockType LIGHT_BLUE_CONCRETE = register("minecraft:light_blue_concrete"); + public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = register("minecraft:light_blue_concrete_powder"); + public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = register("minecraft:light_blue_glazed_terracotta"); + public static final BlockType LIGHT_BLUE_SHULKER_BOX = register("minecraft:light_blue_shulker_box"); + public static final BlockType LIGHT_BLUE_STAINED_GLASS = register("minecraft:light_blue_stained_glass"); + public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = register("minecraft:light_blue_stained_glass_pane"); + public static final BlockType LIGHT_BLUE_TERRACOTTA = register("minecraft:light_blue_terracotta"); + public static final BlockType LIGHT_BLUE_WALL_BANNER = register("minecraft:light_blue_wall_banner"); + public static final BlockType LIGHT_BLUE_WOOL = register("minecraft:light_blue_wool"); + public static final BlockType LIGHT_GRAY_BANNER = register("minecraft:light_gray_banner"); + public static final BlockType LIGHT_GRAY_BED = register("minecraft:light_gray_bed"); + public static final BlockType LIGHT_GRAY_CARPET = register("minecraft:light_gray_carpet"); + public static final BlockType LIGHT_GRAY_CONCRETE = register("minecraft:light_gray_concrete"); + public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = register("minecraft:light_gray_concrete_powder"); + public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = register("minecraft:light_gray_glazed_terracotta"); + public static final BlockType LIGHT_GRAY_SHULKER_BOX = register("minecraft:light_gray_shulker_box"); + public static final BlockType LIGHT_GRAY_STAINED_GLASS = register("minecraft:light_gray_stained_glass"); + public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = register("minecraft:light_gray_stained_glass_pane"); + public static final BlockType LIGHT_GRAY_TERRACOTTA = register("minecraft:light_gray_terracotta"); + public static final BlockType LIGHT_GRAY_WALL_BANNER = register("minecraft:light_gray_wall_banner"); + public static final BlockType LIGHT_GRAY_WOOL = register("minecraft:light_gray_wool"); + public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = register("minecraft:light_weighted_pressure_plate"); + public static final BlockType LILAC = register("minecraft:lilac"); + public static final BlockType LILY_PAD = register("minecraft:lily_pad"); + public static final BlockType LIME_BANNER = register("minecraft:lime_banner"); + public static final BlockType LIME_BED = register("minecraft:lime_bed"); + public static final BlockType LIME_CARPET = register("minecraft:lime_carpet"); + public static final BlockType LIME_CONCRETE = register("minecraft:lime_concrete"); + public static final BlockType LIME_CONCRETE_POWDER = register("minecraft:lime_concrete_powder"); + public static final BlockType LIME_GLAZED_TERRACOTTA = register("minecraft:lime_glazed_terracotta"); + public static final BlockType LIME_SHULKER_BOX = register("minecraft:lime_shulker_box"); + public static final BlockType LIME_STAINED_GLASS = register("minecraft:lime_stained_glass"); + public static final BlockType LIME_STAINED_GLASS_PANE = register("minecraft:lime_stained_glass_pane"); + public static final BlockType LIME_TERRACOTTA = register("minecraft:lime_terracotta"); + public static final BlockType LIME_WALL_BANNER = register("minecraft:lime_wall_banner"); + public static final BlockType LIME_WOOL = register("minecraft:lime_wool"); + public static final BlockType MAGENTA_BANNER = register("minecraft:magenta_banner"); + public static final BlockType MAGENTA_BED = register("minecraft:magenta_bed"); + public static final BlockType MAGENTA_CARPET = register("minecraft:magenta_carpet"); + public static final BlockType MAGENTA_CONCRETE = register("minecraft:magenta_concrete"); + public static final BlockType MAGENTA_CONCRETE_POWDER = register("minecraft:magenta_concrete_powder"); + public static final BlockType MAGENTA_GLAZED_TERRACOTTA = register("minecraft:magenta_glazed_terracotta"); + public static final BlockType MAGENTA_SHULKER_BOX = register("minecraft:magenta_shulker_box"); + public static final BlockType MAGENTA_STAINED_GLASS = register("minecraft:magenta_stained_glass"); + public static final BlockType MAGENTA_STAINED_GLASS_PANE = register("minecraft:magenta_stained_glass_pane"); + public static final BlockType MAGENTA_TERRACOTTA = register("minecraft:magenta_terracotta"); + public static final BlockType MAGENTA_WALL_BANNER = register("minecraft:magenta_wall_banner"); + public static final BlockType MAGENTA_WOOL = register("minecraft:magenta_wool"); + public static final BlockType MAGMA_BLOCK = register("minecraft:magma_block"); + public static final BlockType MELON = register("minecraft:melon"); + public static final BlockType MELON_STEM = register("minecraft:melon_stem"); + public static final BlockType MOB_SPAWNER = register("minecraft:mob_spawner"); + public static final BlockType MOSSY_COBBLESTONE = register("minecraft:mossy_cobblestone"); + public static final BlockType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall"); + public static final BlockType MOSSY_STONE_BRICKS = register("minecraft:mossy_stone_bricks"); + public static final BlockType MOVING_PISTON = register("minecraft:moving_piston"); + public static final BlockType MUSHROOM_STEM = register("minecraft:mushroom_stem"); + public static final BlockType MYCELIUM = register("minecraft:mycelium"); + public static final BlockType NETHER_BRICK_FENCE = register("minecraft:nether_brick_fence"); + public static final BlockType NETHER_BRICK_SLAB = register("minecraft:nether_brick_slab"); + public static final BlockType NETHER_BRICK_STAIRS = register("minecraft:nether_brick_stairs"); + public static final BlockType NETHER_BRICKS = register("minecraft:nether_bricks"); + public static final BlockType NETHER_QUARTZ_ORE = register("minecraft:nether_quartz_ore"); + public static final BlockType NETHER_WART = register("minecraft:nether_wart"); + public static final BlockType NETHER_WART_BLOCK = register("minecraft:nether_wart_block"); + public static final BlockType NETHERRACK = register("minecraft:netherrack"); + public static final BlockType NOTE_BLOCK = register("minecraft:note_block"); + public static final BlockType OAK_BARK = register("minecraft:oak_bark"); + public static final BlockType OAK_BUTTON = register("minecraft:oak_button"); + public static final BlockType OAK_DOOR = register("minecraft:oak_door"); + public static final BlockType OAK_FENCE = register("minecraft:oak_fence"); + public static final BlockType OAK_FENCE_GATE = register("minecraft:oak_fence_gate"); + public static final BlockType OAK_LEAVES = register("minecraft:oak_leaves"); + public static final BlockType OAK_LOG = register("minecraft:oak_log"); + public static final BlockType OAK_PLANKS = register("minecraft:oak_planks"); + public static final BlockType OAK_PRESSURE_PLATE = register("minecraft:oak_pressure_plate"); + public static final BlockType OAK_SAPLING = register("minecraft:oak_sapling"); + public static final BlockType OAK_SLAB = register("minecraft:oak_slab"); + public static final BlockType OAK_STAIRS = register("minecraft:oak_stairs"); + public static final BlockType OAK_TRAPDOOR = register("minecraft:oak_trapdoor"); + public static final BlockType OBSERVER = register("minecraft:observer"); + public static final BlockType OBSIDIAN = register("minecraft:obsidian"); + public static final BlockType ORANGE_BANNER = register("minecraft:orange_banner"); + public static final BlockType ORANGE_BED = register("minecraft:orange_bed"); + public static final BlockType ORANGE_CARPET = register("minecraft:orange_carpet"); + public static final BlockType ORANGE_CONCRETE = register("minecraft:orange_concrete"); + public static final BlockType ORANGE_CONCRETE_POWDER = register("minecraft:orange_concrete_powder"); + public static final BlockType ORANGE_GLAZED_TERRACOTTA = register("minecraft:orange_glazed_terracotta"); + public static final BlockType ORANGE_SHULKER_BOX = register("minecraft:orange_shulker_box"); + public static final BlockType ORANGE_STAINED_GLASS = register("minecraft:orange_stained_glass"); + public static final BlockType ORANGE_STAINED_GLASS_PANE = register("minecraft:orange_stained_glass_pane"); + public static final BlockType ORANGE_TERRACOTTA = register("minecraft:orange_terracotta"); + public static final BlockType ORANGE_TULIP = register("minecraft:orange_tulip"); + public static final BlockType ORANGE_WALL_BANNER = register("minecraft:orange_wall_banner"); + public static final BlockType ORANGE_WOOL = register("minecraft:orange_wool"); + public static final BlockType OXEYE_DAISY = register("minecraft:oxeye_daisy"); + public static final BlockType PACKED_ICE = register("minecraft:packed_ice"); + public static final BlockType PEONY = register("minecraft:peony"); + public static final BlockType PETRIFIED_OAK_SLAB = register("minecraft:petrified_oak_slab"); + public static final BlockType PINK_BANNER = register("minecraft:pink_banner"); + public static final BlockType PINK_BED = register("minecraft:pink_bed"); + public static final BlockType PINK_CARPET = register("minecraft:pink_carpet"); + public static final BlockType PINK_CONCRETE = register("minecraft:pink_concrete"); + public static final BlockType PINK_CONCRETE_POWDER = register("minecraft:pink_concrete_powder"); + public static final BlockType PINK_GLAZED_TERRACOTTA = register("minecraft:pink_glazed_terracotta"); + public static final BlockType PINK_SHULKER_BOX = register("minecraft:pink_shulker_box"); + public static final BlockType PINK_STAINED_GLASS = register("minecraft:pink_stained_glass"); + public static final BlockType PINK_STAINED_GLASS_PANE = register("minecraft:pink_stained_glass_pane"); + public static final BlockType PINK_TERRACOTTA = register("minecraft:pink_terracotta"); + public static final BlockType PINK_TULIP = register("minecraft:pink_tulip"); + public static final BlockType PINK_WALL_BANNER = register("minecraft:pink_wall_banner"); + public static final BlockType PINK_WOOL = register("minecraft:pink_wool"); + public static final BlockType PISTON = register("minecraft:piston"); + public static final BlockType PISTON_HEAD = register("minecraft:piston_head"); + public static final BlockType PLAYER_HEAD = register("minecraft:player_head"); + public static final BlockType PLAYER_WALL_HEAD = register("minecraft:player_wall_head"); + public static final BlockType PODZOL = register("minecraft:podzol"); + public static final BlockType POLISHED_ANDESITE = register("minecraft:polished_andesite"); + public static final BlockType POLISHED_DIORITE = register("minecraft:polished_diorite"); + public static final BlockType POLISHED_GRANITE = register("minecraft:polished_granite"); + public static final BlockType POPPY = register("minecraft:poppy"); + public static final BlockType PORTAL = register("minecraft:portal"); + public static final BlockType POTATOES = register("minecraft:potatoes"); + public static final BlockType POTTED_ACACIA_SAPLING = register("minecraft:potted_acacia_sapling"); + public static final BlockType POTTED_ALLIUM = register("minecraft:potted_allium"); + public static final BlockType POTTED_AZURE_BLUET = register("minecraft:potted_azure_bluet"); + public static final BlockType POTTED_BIRCH_SAPLING = register("minecraft:potted_birch_sapling"); + public static final BlockType POTTED_BLUE_ORCHID = register("minecraft:potted_blue_orchid"); + public static final BlockType POTTED_BROWN_MUSHROOM = register("minecraft:potted_brown_mushroom"); + public static final BlockType POTTED_CACTUS = register("minecraft:potted_cactus"); + public static final BlockType POTTED_DANDELION = register("minecraft:potted_dandelion"); + public static final BlockType POTTED_DARK_OAK_SAPLING = register("minecraft:potted_dark_oak_sapling"); + public static final BlockType POTTED_DEAD_BUSH = register("minecraft:potted_dead_bush"); + public static final BlockType POTTED_FERN = register("minecraft:potted_fern"); + public static final BlockType POTTED_JUNGLE_SAPLING = register("minecraft:potted_jungle_sapling"); + public static final BlockType POTTED_OAK_SAPLING = register("minecraft:potted_oak_sapling"); + public static final BlockType POTTED_ORANGE_TULIP = register("minecraft:potted_orange_tulip"); + public static final BlockType POTTED_OXEYE_DAISY = register("minecraft:potted_oxeye_daisy"); + public static final BlockType POTTED_PINK_TULIP = register("minecraft:potted_pink_tulip"); + public static final BlockType POTTED_POPPY = register("minecraft:potted_poppy"); + public static final BlockType POTTED_RED_MUSHROOM = register("minecraft:potted_red_mushroom"); + public static final BlockType POTTED_RED_TULIP = register("minecraft:potted_red_tulip"); + public static final BlockType POTTED_SPRUCE_SAPLING = register("minecraft:potted_spruce_sapling"); + public static final BlockType POTTED_WHITE_TULIP = register("minecraft:potted_white_tulip"); + public static final BlockType POWERED_RAIL = register("minecraft:powered_rail"); + public static final BlockType PRISMARINE = register("minecraft:prismarine"); + public static final BlockType PRISMARINE_BRICK_SLAB = register("minecraft:prismarine_brick_slab"); + public static final BlockType PRISMARINE_BRICK_STAIRS = register("minecraft:prismarine_brick_stairs"); + public static final BlockType PRISMARINE_BRICKS = register("minecraft:prismarine_bricks"); + public static final BlockType PRISMARINE_SLAB = register("minecraft:prismarine_slab"); + public static final BlockType PRISMARINE_STAIRS = register("minecraft:prismarine_stairs"); + public static final BlockType PUMPKIN = register("minecraft:pumpkin"); + public static final BlockType PUMPKIN_STEM = register("minecraft:pumpkin_stem"); + public static final BlockType PURPLE_BANNER = register("minecraft:purple_banner"); + public static final BlockType PURPLE_BED = register("minecraft:purple_bed"); + public static final BlockType PURPLE_CARPET = register("minecraft:purple_carpet"); + public static final BlockType PURPLE_CONCRETE = register("minecraft:purple_concrete"); + public static final BlockType PURPLE_CONCRETE_POWDER = register("minecraft:purple_concrete_powder"); + public static final BlockType PURPLE_GLAZED_TERRACOTTA = register("minecraft:purple_glazed_terracotta"); + public static final BlockType PURPLE_SHULKER_BOX = register("minecraft:purple_shulker_box"); + public static final BlockType PURPLE_STAINED_GLASS = register("minecraft:purple_stained_glass"); + public static final BlockType PURPLE_STAINED_GLASS_PANE = register("minecraft:purple_stained_glass_pane"); + public static final BlockType PURPLE_TERRACOTTA = register("minecraft:purple_terracotta"); + public static final BlockType PURPLE_WALL_BANNER = register("minecraft:purple_wall_banner"); + public static final BlockType PURPLE_WOOL = register("minecraft:purple_wool"); + public static final BlockType PURPUR_BLOCK = register("minecraft:purpur_block"); + public static final BlockType PURPUR_PILLAR = register("minecraft:purpur_pillar"); + public static final BlockType PURPUR_SLAB = register("minecraft:purpur_slab"); + public static final BlockType PURPUR_STAIRS = register("minecraft:purpur_stairs"); + public static final BlockType QUARTZ_BLOCK = register("minecraft:quartz_block"); + public static final BlockType QUARTZ_PILLAR = register("minecraft:quartz_pillar"); + public static final BlockType QUARTZ_SLAB = register("minecraft:quartz_slab"); + public static final BlockType QUARTZ_STAIRS = register("minecraft:quartz_stairs"); + public static final BlockType RAIL = register("minecraft:rail"); + public static final BlockType RED_BANNER = register("minecraft:red_banner"); + public static final BlockType RED_BED = register("minecraft:red_bed"); + public static final BlockType RED_CARPET = register("minecraft:red_carpet"); + public static final BlockType RED_CONCRETE = register("minecraft:red_concrete"); + public static final BlockType RED_CONCRETE_POWDER = register("minecraft:red_concrete_powder"); + public static final BlockType RED_GLAZED_TERRACOTTA = register("minecraft:red_glazed_terracotta"); + public static final BlockType RED_MUSHROOM = register("minecraft:red_mushroom"); + public static final BlockType RED_MUSHROOM_BLOCK = register("minecraft:red_mushroom_block"); + public static final BlockType RED_NETHER_BRICKS = register("minecraft:red_nether_bricks"); + public static final BlockType RED_SAND = register("minecraft:red_sand"); + public static final BlockType RED_SANDSTONE = register("minecraft:red_sandstone"); + public static final BlockType RED_SANDSTONE_SLAB = register("minecraft:red_sandstone_slab"); + public static final BlockType RED_SANDSTONE_STAIRS = register("minecraft:red_sandstone_stairs"); + public static final BlockType RED_SHULKER_BOX = register("minecraft:red_shulker_box"); + public static final BlockType RED_STAINED_GLASS = register("minecraft:red_stained_glass"); + public static final BlockType RED_STAINED_GLASS_PANE = register("minecraft:red_stained_glass_pane"); + public static final BlockType RED_TERRACOTTA = register("minecraft:red_terracotta"); + public static final BlockType RED_TULIP = register("minecraft:red_tulip"); + public static final BlockType RED_WALL_BANNER = register("minecraft:red_wall_banner"); + public static final BlockType RED_WOOL = register("minecraft:red_wool"); + public static final BlockType REDSTONE_BLOCK = register("minecraft:redstone_block"); + public static final BlockType REDSTONE_LAMP = register("minecraft:redstone_lamp"); + public static final BlockType REDSTONE_ORE = register("minecraft:redstone_ore"); + public static final BlockType REDSTONE_TORCH = register("minecraft:redstone_torch"); + public static final BlockType REDSTONE_WALL_TORCH = register("minecraft:redstone_wall_torch"); + public static final BlockType REDSTONE_WIRE = register("minecraft:redstone_wire"); + public static final BlockType REPEATER = register("minecraft:repeater"); + public static final BlockType REPEATING_COMMAND_BLOCK = register("minecraft:repeating_command_block"); + public static final BlockType ROSE_BUSH = register("minecraft:rose_bush"); + public static final BlockType SAND = register("minecraft:sand"); + public static final BlockType SANDSTONE = register("minecraft:sandstone"); + public static final BlockType SANDSTONE_SLAB = register("minecraft:sandstone_slab"); + public static final BlockType SANDSTONE_STAIRS = register("minecraft:sandstone_stairs"); + public static final BlockType SEA_LANTERN = register("minecraft:sea_lantern"); + public static final BlockType SEA_PICKLE = register("minecraft:sea_pickle"); + public static final BlockType SEAGRASS = register("minecraft:seagrass"); + public static final BlockType SHULKER_BOX = register("minecraft:shulker_box"); + public static final BlockType SIGN = register("minecraft:sign"); + public static final BlockType SKELETON_SKULL = register("minecraft:skeleton_skull"); + public static final BlockType SKELETON_WALL_SKULL = register("minecraft:skeleton_wall_skull"); + public static final BlockType SLIME_BLOCK = register("minecraft:slime_block"); + public static final BlockType SMOOTH_QUARTZ = register("minecraft:smooth_quartz"); + public static final BlockType SMOOTH_RED_SANDSTONE = register("minecraft:smooth_red_sandstone"); + public static final BlockType SMOOTH_SANDSTONE = register("minecraft:smooth_sandstone"); + public static final BlockType SMOOTH_STONE = register("minecraft:smooth_stone"); + public static final BlockType SNOW = register("minecraft:snow"); + public static final BlockType SNOW_BLOCK = register("minecraft:snow_block"); + public static final BlockType SOUL_SAND = register("minecraft:soul_sand"); + public static final BlockType SPONGE = register("minecraft:sponge"); + public static final BlockType SPRUCE_BARK = register("minecraft:spruce_bark"); + public static final BlockType SPRUCE_BUTTON = register("minecraft:spruce_button"); + public static final BlockType SPRUCE_DOOR = register("minecraft:spruce_door"); + public static final BlockType SPRUCE_FENCE = register("minecraft:spruce_fence"); + public static final BlockType SPRUCE_FENCE_GATE = register("minecraft:spruce_fence_gate"); + public static final BlockType SPRUCE_LEAVES = register("minecraft:spruce_leaves"); + public static final BlockType SPRUCE_LOG = register("minecraft:spruce_log"); + public static final BlockType SPRUCE_PLANKS = register("minecraft:spruce_planks"); + public static final BlockType SPRUCE_PRESSURE_PLATE = register("minecraft:spruce_pressure_plate"); + public static final BlockType SPRUCE_SAPLING = register("minecraft:spruce_sapling"); + public static final BlockType SPRUCE_SLAB = register("minecraft:spruce_slab"); + public static final BlockType SPRUCE_STAIRS = register("minecraft:spruce_stairs"); + public static final BlockType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor"); + public static final BlockType STICKY_PISTON = register("minecraft:sticky_piston"); + public static final BlockType STONE = register("minecraft:stone"); + public static final BlockType STONE_BRICK_SLAB = register("minecraft:stone_brick_slab"); + public static final BlockType STONE_BRICK_STAIRS = register("minecraft:stone_brick_stairs"); + public static final BlockType STONE_BRICKS = register("minecraft:stone_bricks"); + public static final BlockType STONE_BUTTON = register("minecraft:stone_button"); + public static final BlockType STONE_PRESSURE_PLATE = register("minecraft:stone_pressure_plate"); + public static final BlockType STONE_SLAB = register("minecraft:stone_slab"); + public static final BlockType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log"); + public static final BlockType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log"); + public static final BlockType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log"); + public static final BlockType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log"); + public static final BlockType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log"); + public static final BlockType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log"); + public static final BlockType STRUCTURE_BLOCK = register("minecraft:structure_block"); + public static final BlockType STRUCTURE_VOID = register("minecraft:structure_void"); + public static final BlockType SUGAR_CANE = register("minecraft:sugar_cane"); + public static final BlockType SUNFLOWER = register("minecraft:sunflower"); + public static final BlockType TALL_GRASS = register("minecraft:tall_grass"); + public static final BlockType TALL_SEAGRASS = register("minecraft:tall_seagrass"); + public static final BlockType TERRACOTTA = register("minecraft:terracotta"); + public static final BlockType TNT = register("minecraft:tnt"); + public static final BlockType TORCH = register("minecraft:torch"); + public static final BlockType TRAPPED_CHEST = register("minecraft:trapped_chest"); + public static final BlockType TRIPWIRE = register("minecraft:tripwire"); + public static final BlockType TRIPWIRE_HOOK = register("minecraft:tripwire_hook"); + public static final BlockType TUBE_CORAL = register("minecraft:tube_coral"); + public static final BlockType TUBE_CORAL_BLOCK = register("minecraft:tube_coral_block"); + public static final BlockType TUBE_CORAL_FAN = register("minecraft:tube_coral_fan"); + public static final BlockType TURTLE_EGG = register("minecraft:turtle_egg"); + public static final BlockType VINE = register("minecraft:vine"); + public static final BlockType VOID_AIR = register("minecraft:void_air"); + public static final BlockType WALL_SIGN = register("minecraft:wall_sign"); + public static final BlockType WALL_TORCH = register("minecraft:wall_torch"); + public static final BlockType WATER = register("minecraft:water"); + public static final BlockType WET_SPONGE = register("minecraft:wet_sponge"); + public static final BlockType WHEAT = register("minecraft:wheat"); + public static final BlockType WHITE_BANNER = register("minecraft:white_banner"); + public static final BlockType WHITE_BED = register("minecraft:white_bed"); + public static final BlockType WHITE_CARPET = register("minecraft:white_carpet"); + public static final BlockType WHITE_CONCRETE = register("minecraft:white_concrete"); + public static final BlockType WHITE_CONCRETE_POWDER = register("minecraft:white_concrete_powder"); + public static final BlockType WHITE_GLAZED_TERRACOTTA = register("minecraft:white_glazed_terracotta"); + public static final BlockType WHITE_SHULKER_BOX = register("minecraft:white_shulker_box"); + public static final BlockType WHITE_STAINED_GLASS = register("minecraft:white_stained_glass"); + public static final BlockType WHITE_STAINED_GLASS_PANE = register("minecraft:white_stained_glass_pane"); + public static final BlockType WHITE_TERRACOTTA = register("minecraft:white_terracotta"); + public static final BlockType WHITE_TULIP = register("minecraft:white_tulip"); + public static final BlockType WHITE_WALL_BANNER = register("minecraft:white_wall_banner"); + public static final BlockType WHITE_WOOL = register("minecraft:white_wool"); + public static final BlockType WITHER_SKELETON_SKULL = register("minecraft:wither_skeleton_skull"); + public static final BlockType WITHER_SKELETON_WALL_SKULL = register("minecraft:wither_skeleton_wall_skull"); + public static final BlockType YELLOW_BANNER = register("minecraft:yellow_banner"); + public static final BlockType YELLOW_BED = register("minecraft:yellow_bed"); + public static final BlockType YELLOW_CARPET = register("minecraft:yellow_carpet"); + public static final BlockType YELLOW_CONCRETE = register("minecraft:yellow_concrete"); + public static final BlockType YELLOW_CONCRETE_POWDER = register("minecraft:yellow_concrete_powder"); + public static final BlockType YELLOW_GLAZED_TERRACOTTA = register("minecraft:yellow_glazed_terracotta"); + public static final BlockType YELLOW_SHULKER_BOX = register("minecraft:yellow_shulker_box"); + public static final BlockType YELLOW_STAINED_GLASS = register("minecraft:yellow_stained_glass"); + public static final BlockType YELLOW_STAINED_GLASS_PANE = register("minecraft:yellow_stained_glass_pane"); + public static final BlockType YELLOW_TERRACOTTA = register("minecraft:yellow_terracotta"); + public static final BlockType YELLOW_WALL_BANNER = register("minecraft:yellow_wall_banner"); + public static final BlockType YELLOW_WOOL = register("minecraft:yellow_wool"); + public static final BlockType ZOMBIE_HEAD = register("minecraft:zombie_head"); + public static final BlockType ZOMBIE_WALL_HEAD = register("minecraft:zombie_wall_head"); - private static final Map blockMapping = new HashMap<>(); - - static { - for (Field field : BlockTypes.class.getFields()) { - if (field.getType() == BlockType.class) { - try { - registerBlock((BlockType) field.get(null)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } + private static BlockType register(final String id) { + return register(new BlockType(id)); } - public static void registerBlock(BlockType blockType) { - if (blockMapping.containsKey(blockType.getId()) && !blockType.getId().startsWith("minecraft:")) { - throw new IllegalArgumentException("Existing block with this ID already registered"); - } - - blockMapping.put(blockType.getId(), blockType); + public static BlockType register(final BlockType block) { + return BlockType.REGISTRY.register(block.getId(), block); } @Nullable - public static BlockType getBlockType(String id) { - // If it has no namespace, assume minecraft. - if (id != null && !id.contains(":")) { - id = "minecraft:" + id; - } - return blockMapping.get(id); + public static BlockType get(final String id) { + return BlockType.REGISTRY.get(id); } public static Collection values() { - return blockMapping.values(); + return BlockType.REGISTRY.values(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java index aaf3ea945..2362c26c0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java @@ -19,10 +19,7 @@ package com.sk89q.worldedit.world.fluid; -import java.lang.reflect.Field; import java.util.Collection; -import java.util.HashMap; -import java.util.Map; import javax.annotation.Nullable; @@ -34,41 +31,23 @@ public class FluidCategories { private FluidCategories() { } - public static final FluidCategory LAVA = new FluidCategory("minecraft:lava"); - public static final FluidCategory WATER = new FluidCategory("minecraft:water"); + public static final FluidCategory LAVA = register("minecraft:lava"); + public static final FluidCategory WATER = register("minecraft:water"); - private static final Map categoryMapping = new HashMap<>(); - - static { - for (Field field : FluidCategories.class.getFields()) { - if (field.getType() == FluidCategory.class) { - try { - registerCategory((FluidCategory) field.get(null)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } + private static FluidCategory register(final String id) { + return register(new FluidCategory(id)); } - public static void registerCategory(FluidCategory fluidCategory) { - if (categoryMapping.containsKey(fluidCategory.getId()) && !fluidCategory.getId().startsWith("minecraft:")) { - throw new IllegalArgumentException("Existing category with this ID already registered"); - } - - categoryMapping.put(fluidCategory.getId(), fluidCategory); + public static FluidCategory register(final FluidCategory tag) { + return FluidCategory.REGISTRY.register(tag.getId(), tag); } @Nullable - public static FluidCategory getFluidCategory(String id) { - // If it has no namespace, assume minecraft. - if (id != null && !id.contains(":")) { - id = "minecraft:" + id; - } - return categoryMapping.get(id); + public static FluidCategory get(final String id) { + return FluidCategory.REGISTRY.get(id); } public static Collection values() { - return categoryMapping.values(); + return FluidCategory.REGISTRY.values(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java index 1cb8c8af0..0c359c2ce 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.world.fluid; +import com.sk89q.worldedit.registry.NamespacedRegistry; + import java.util.Collections; import java.util.Set; @@ -28,6 +30,8 @@ import java.util.Set; */ public class FluidCategory { + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + private final String id; public FluidCategory(String id) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java index 7b4fef0c0..11b1ea63f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java @@ -19,12 +19,16 @@ package com.sk89q.worldedit.world.fluid; +import com.sk89q.worldedit.registry.NamespacedRegistry; + /** * Minecraft now has a 'fluid' system. This is a * stub class to represent what it may be in the future. */ public class FluidType { + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + private String id; public FluidType(String id) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java index 03080775f..4dbc012c4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java @@ -19,10 +19,7 @@ package com.sk89q.worldedit.world.fluid; -import java.lang.reflect.Field; import java.util.Collection; -import java.util.HashMap; -import java.util.Map; import javax.annotation.Nullable; @@ -34,45 +31,26 @@ public class FluidTypes { private FluidTypes() { } - public static final FluidType EMPTY = new FluidType("minecraft:empty"); - public static final FluidType FLOWING_LAVA = new FluidType("minecraft:flowing_lava"); - public static final FluidType FLOWING_WATER = new FluidType("minecraft:flowing_water"); - public static final FluidType LAVA = new FluidType("minecraft:lava"); - public static final FluidType WATER = new FluidType("minecraft:water"); + public static final FluidType EMPTY = register("minecraft:empty"); + public static final FluidType FLOWING_LAVA = register("minecraft:flowing_lava"); + public static final FluidType FLOWING_WATER = register("minecraft:flowing_water"); + public static final FluidType LAVA = register("minecraft:lava"); + public static final FluidType WATER = register("minecraft:water"); - - private static final Map fluidMapping = new HashMap<>(); - - static { - for (Field field : FluidTypes.class.getFields()) { - if (field.getType() == FluidType.class) { - try { - registerFluid((FluidType) field.get(null)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } + private static FluidType register(final String id) { + return register(new FluidType(id)); } - public static void registerFluid(FluidType fluidType) { - if (fluidMapping.containsKey(fluidType.getId()) && !fluidType.getId().startsWith("minecraft:")) { - throw new IllegalArgumentException("Existing fluid with this ID already registered"); - } - - fluidMapping.put(fluidType.getId(), fluidType); + public static FluidType register(final FluidType fluid) { + return FluidType.REGISTRY.register(fluid.getId(), fluid); } @Nullable - public static FluidType getFluidType(String id) { - // If it has no namespace, assume minecraft. - if (id != null && !id.contains(":")) { - id = "minecraft:" + id; - } - return fluidMapping.get(id); + public static FluidType getFluidType(final String id) { + return FluidType.REGISTRY.get(id); } public static Collection values() { - return fluidMapping.values(); + return FluidType.REGISTRY.values(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java index d0af4f90a..2ec454bda 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java @@ -34,69 +34,51 @@ public class ItemCategories { private ItemCategories() { } - public static final ItemCategory ACACIA_LOGS = new ItemCategory("minecraft:acacia_logs"); - public static final ItemCategory ANVIL = new ItemCategory("minecraft:anvil"); - public static final ItemCategory BANNERS = new ItemCategory("minecraft:banners"); - public static final ItemCategory BIRCH_LOGS = new ItemCategory("minecraft:birch_logs"); - public static final ItemCategory BOATS = new ItemCategory("minecraft:boats"); - public static final ItemCategory BUTTONS = new ItemCategory("minecraft:buttons"); - public static final ItemCategory CARPETS = new ItemCategory("minecraft:carpets"); - public static final ItemCategory CORAL = new ItemCategory("minecraft:coral"); - public static final ItemCategory CORAL_PLANTS = new ItemCategory("minecraft:coral_plants"); - public static final ItemCategory DARK_OAK_LOGS = new ItemCategory("minecraft:dark_oak_logs"); - public static final ItemCategory DOORS = new ItemCategory("minecraft:doors"); - public static final ItemCategory FISHES = new ItemCategory("minecraft:fishes"); - public static final ItemCategory JUNGLE_LOGS = new ItemCategory("minecraft:jungle_logs"); - public static final ItemCategory LEAVES = new ItemCategory("minecraft:leaves"); - public static final ItemCategory LOGS = new ItemCategory("minecraft:logs"); - public static final ItemCategory OAK_LOGS = new ItemCategory("minecraft:oak_logs"); - public static final ItemCategory PLANKS = new ItemCategory("minecraft:planks"); - public static final ItemCategory RAILS = new ItemCategory("minecraft:rails"); - public static final ItemCategory SAND = new ItemCategory("minecraft:sand"); - public static final ItemCategory SAPLINGS = new ItemCategory("minecraft:saplings"); - public static final ItemCategory SLABS = new ItemCategory("minecraft:slabs"); - public static final ItemCategory SPRUCE_LOGS = new ItemCategory("minecraft:spruce_logs"); - public static final ItemCategory STAIRS = new ItemCategory("minecraft:stairs"); - public static final ItemCategory STONE_BRICKS = new ItemCategory("minecraft:stone_bricks"); - public static final ItemCategory WOODEN_BUTTONS = new ItemCategory("minecraft:wooden_buttons"); - public static final ItemCategory WOODEN_DOORS = new ItemCategory("minecraft:wooden_doors"); - public static final ItemCategory WOODEN_PRESSURE_PLATES = new ItemCategory("minecraft:wooden_pressure_plates"); - public static final ItemCategory WOODEN_SLABS = new ItemCategory("minecraft:wooden_slabs"); - public static final ItemCategory WOODEN_STAIRS = new ItemCategory("minecraft:wooden_stairs"); - public static final ItemCategory WOOL = new ItemCategory("minecraft:wool"); + public static final ItemCategory ACACIA_LOGS = register("minecraft:acacia_logs"); + public static final ItemCategory ANVIL = register("minecraft:anvil"); + public static final ItemCategory BANNERS = register("minecraft:banners"); + public static final ItemCategory BIRCH_LOGS = register("minecraft:birch_logs"); + public static final ItemCategory BOATS = register("minecraft:boats"); + public static final ItemCategory BUTTONS = register("minecraft:buttons"); + public static final ItemCategory CARPETS = register("minecraft:carpets"); + public static final ItemCategory CORAL = register("minecraft:coral"); + public static final ItemCategory CORAL_PLANTS = register("minecraft:coral_plants"); + public static final ItemCategory DARK_OAK_LOGS = register("minecraft:dark_oak_logs"); + public static final ItemCategory DOORS = register("minecraft:doors"); + public static final ItemCategory FISHES = register("minecraft:fishes"); + public static final ItemCategory JUNGLE_LOGS = register("minecraft:jungle_logs"); + public static final ItemCategory LEAVES = register("minecraft:leaves"); + public static final ItemCategory LOGS = register("minecraft:logs"); + public static final ItemCategory OAK_LOGS = register("minecraft:oak_logs"); + public static final ItemCategory PLANKS = register("minecraft:planks"); + public static final ItemCategory RAILS = register("minecraft:rails"); + public static final ItemCategory SAND = register("minecraft:sand"); + public static final ItemCategory SAPLINGS = register("minecraft:saplings"); + public static final ItemCategory SLABS = register("minecraft:slabs"); + public static final ItemCategory SPRUCE_LOGS = register("minecraft:spruce_logs"); + public static final ItemCategory STAIRS = register("minecraft:stairs"); + public static final ItemCategory STONE_BRICKS = register("minecraft:stone_bricks"); + public static final ItemCategory WOODEN_BUTTONS = register("minecraft:wooden_buttons"); + public static final ItemCategory WOODEN_DOORS = register("minecraft:wooden_doors"); + public static final ItemCategory WOODEN_PRESSURE_PLATES = register("minecraft:wooden_pressure_plates"); + public static final ItemCategory WOODEN_SLABS = register("minecraft:wooden_slabs"); + public static final ItemCategory WOODEN_STAIRS = register("minecraft:wooden_stairs"); + public static final ItemCategory WOOL = register("minecraft:wool"); - private static final Map categoryMapping = new HashMap<>(); - - static { - for (Field field : ItemCategories.class.getFields()) { - if (field.getType() == ItemCategory.class) { - try { - registerCategory((ItemCategory) field.get(null)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } + private static ItemCategory register(final String id) { + return register(new ItemCategory(id)); } - public static void registerCategory(ItemCategory itemCategory) { - if (categoryMapping.containsKey(itemCategory.getId()) && !itemCategory.getId().startsWith("minecraft:")) { - throw new IllegalArgumentException("Existing category with this ID already registered"); - } - - categoryMapping.put(itemCategory.getId(), itemCategory); + public static ItemCategory register(final ItemCategory tag) { + return ItemCategory.REGISTRY.register(tag.getId(), tag); } @Nullable - public static ItemCategory getItemCategory(String id) { - // If it has no namespace, assume minecraft. - if (id != null && !id.contains(":")) { - id = "minecraft:" + id; - } - return categoryMapping.get(id); + public static ItemCategory get(final String id) { + return ItemCategory.REGISTRY.get(id); } public static Collection values() { - return categoryMapping.values(); + return ItemCategory.REGISTRY.values(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java index 458116995..5e0240aad 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.world.item; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.registry.NamespacedRegistry; import java.util.Set; @@ -31,6 +32,8 @@ import java.util.Set; */ public class ItemCategory { + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + private final String id; public ItemCategory(String id) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java index b57a8da04..32d8b1008 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.world.item; +import com.sk89q.worldedit.registry.NamespacedRegistry; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.registry.BundledItemData; @@ -28,6 +29,8 @@ import javax.annotation.Nullable; public class ItemType { + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + private String id; public ItemType(String id) { @@ -73,7 +76,7 @@ public class ItemType { */ @Nullable public BlockType getBlockType() { - return BlockTypes.getBlockType(this.id); + return BlockTypes.get(this.id); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java index 12c740220..94a891739 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java @@ -31,750 +31,732 @@ public class ItemTypes { private ItemTypes() { } - public static final ItemType ACACIA_BARK = new ItemType("minecraft:acacia_bark"); - public static final ItemType ACACIA_BOAT = new ItemType("minecraft:acacia_boat"); - public static final ItemType ACACIA_BUTTON = new ItemType("minecraft:acacia_button"); - public static final ItemType ACACIA_FENCE = new ItemType("minecraft:acacia_fence"); - public static final ItemType ACACIA_FENCE_GATE = new ItemType("minecraft:acacia_fence_gate"); - public static final ItemType ACACIA_LEAVES = new ItemType("minecraft:acacia_leaves"); - public static final ItemType ACACIA_LOG = new ItemType("minecraft:acacia_log"); - public static final ItemType ACACIA_PLANKS = new ItemType("minecraft:acacia_planks"); - public static final ItemType ACACIA_PRESSURE_PLATE = new ItemType("minecraft:acacia_pressure_plate"); - public static final ItemType ACACIA_SAPLING = new ItemType("minecraft:acacia_sapling"); - public static final ItemType ACACIA_SLAB = new ItemType("minecraft:acacia_slab"); - public static final ItemType ACACIA_STAIRS = new ItemType("minecraft:acacia_stairs"); - public static final ItemType ACACIA_TRAPDOOR = new ItemType("minecraft:acacia_trapdoor"); - public static final ItemType ACTIVATOR_RAIL = new ItemType("minecraft:activator_rail"); - public static final ItemType AIR = new ItemType("minecraft:air"); - public static final ItemType ALLIUM = new ItemType("minecraft:allium"); - public static final ItemType ANDESITE = new ItemType("minecraft:andesite"); - public static final ItemType ANVIL = new ItemType("minecraft:anvil"); - public static final ItemType APPLE = new ItemType("minecraft:apple"); - public static final ItemType ARMOR_STAND = new ItemType("minecraft:armor_stand"); - public static final ItemType ARROW = new ItemType("minecraft:arrow"); - public static final ItemType AZURE_BLUET = new ItemType("minecraft:azure_bluet"); - public static final ItemType BAKED_POTATO = new ItemType("minecraft:baked_potato"); - public static final ItemType BARRIER = new ItemType("minecraft:barrier"); - public static final ItemType BAT_SPAWN_EGG = new ItemType("minecraft:bat_spawn_egg"); - public static final ItemType BEDROCK = new ItemType("minecraft:bedrock"); - public static final ItemType BEEF = new ItemType("minecraft:beef"); - public static final ItemType BEETROOT = new ItemType("minecraft:beetroot"); - public static final ItemType BEETROOT_SEEDS = new ItemType("minecraft:beetroot_seeds"); - public static final ItemType BEETROOT_SOUP = new ItemType("minecraft:beetroot_soup"); - public static final ItemType BIRCH_BARK = new ItemType("minecraft:birch_bark"); - public static final ItemType BIRCH_BOAT = new ItemType("minecraft:birch_boat"); - public static final ItemType BIRCH_BUTTON = new ItemType("minecraft:birch_button"); - public static final ItemType BIRCH_FENCE = new ItemType("minecraft:birch_fence"); - public static final ItemType BIRCH_FENCE_GATE = new ItemType("minecraft:birch_fence_gate"); - public static final ItemType BIRCH_LEAVES = new ItemType("minecraft:birch_leaves"); - public static final ItemType BIRCH_LOG = new ItemType("minecraft:birch_log"); - public static final ItemType BIRCH_PLANKS = new ItemType("minecraft:birch_planks"); - public static final ItemType BIRCH_PRESSURE_PLATE = new ItemType("minecraft:birch_pressure_plate"); - public static final ItemType BIRCH_SAPLING = new ItemType("minecraft:birch_sapling"); - public static final ItemType BIRCH_SLAB = new ItemType("minecraft:birch_slab"); - public static final ItemType BIRCH_STAIRS = new ItemType("minecraft:birch_stairs"); - public static final ItemType BIRCH_TRAPDOOR = new ItemType("minecraft:birch_trapdoor"); - public static final ItemType BLACK_BANNER = new ItemType("minecraft:black_banner"); - public static final ItemType BLACK_CARPET = new ItemType("minecraft:black_carpet"); - public static final ItemType BLACK_CONCRETE = new ItemType("minecraft:black_concrete"); - public static final ItemType BLACK_CONCRETE_POWDER = new ItemType("minecraft:black_concrete_powder"); - public static final ItemType BLACK_GLAZED_TERRACOTTA = new ItemType("minecraft:black_glazed_terracotta"); - public static final ItemType BLACK_STAINED_GLASS = new ItemType("minecraft:black_stained_glass"); - public static final ItemType BLACK_STAINED_GLASS_PANE = new ItemType("minecraft:black_stained_glass_pane"); - public static final ItemType BLACK_TERRACOTTA = new ItemType("minecraft:black_terracotta"); - public static final ItemType BLACK_WOOL = new ItemType("minecraft:black_wool"); - public static final ItemType BLAZE_POWDER = new ItemType("minecraft:blaze_powder"); - public static final ItemType BLAZE_ROD = new ItemType("minecraft:blaze_rod"); - public static final ItemType BLAZE_SPAWN_EGG = new ItemType("minecraft:blaze_spawn_egg"); - public static final ItemType BLUE_BANNER = new ItemType("minecraft:blue_banner"); - public static final ItemType BLUE_CARPET = new ItemType("minecraft:blue_carpet"); - public static final ItemType BLUE_CONCRETE = new ItemType("minecraft:blue_concrete"); - public static final ItemType BLUE_CONCRETE_POWDER = new ItemType("minecraft:blue_concrete_powder"); - public static final ItemType BLUE_GLAZED_TERRACOTTA = new ItemType("minecraft:blue_glazed_terracotta"); - public static final ItemType BLUE_ICE = new ItemType("minecraft:blue_ice"); - public static final ItemType BLUE_ORCHID = new ItemType("minecraft:blue_orchid"); - public static final ItemType BLUE_STAINED_GLASS = new ItemType("minecraft:blue_stained_glass"); - public static final ItemType BLUE_STAINED_GLASS_PANE = new ItemType("minecraft:blue_stained_glass_pane"); - public static final ItemType BLUE_TERRACOTTA = new ItemType("minecraft:blue_terracotta"); - public static final ItemType BLUE_WOOL = new ItemType("minecraft:blue_wool"); - public static final ItemType BONE = new ItemType("minecraft:bone"); - public static final ItemType BONE_BLOCK = new ItemType("minecraft:bone_block"); - public static final ItemType BONE_MEAL = new ItemType("minecraft:bone_meal"); - public static final ItemType BOOK = new ItemType("minecraft:book"); - public static final ItemType BOOKSHELF = new ItemType("minecraft:bookshelf"); - public static final ItemType BOW = new ItemType("minecraft:bow"); - public static final ItemType BOWL = new ItemType("minecraft:bowl"); - public static final ItemType BRAIN_CORAL = new ItemType("minecraft:brain_coral"); - public static final ItemType BRAIN_CORAL_BLOCK = new ItemType("minecraft:brain_coral_block"); - public static final ItemType BRAIN_CORAL_FAN = new ItemType("minecraft:brain_coral_fan"); - public static final ItemType BREAD = new ItemType("minecraft:bread"); - public static final ItemType BREWING_STAND = new ItemType("minecraft:brewing_stand"); - public static final ItemType BRICK = new ItemType("minecraft:brick"); - public static final ItemType BRICK_SLAB = new ItemType("minecraft:brick_slab"); - public static final ItemType BRICK_STAIRS = new ItemType("minecraft:brick_stairs"); - public static final ItemType BRICKS = new ItemType("minecraft:bricks"); - public static final ItemType BROWN_BANNER = new ItemType("minecraft:brown_banner"); - public static final ItemType BROWN_CARPET = new ItemType("minecraft:brown_carpet"); - public static final ItemType BROWN_CONCRETE = new ItemType("minecraft:brown_concrete"); - public static final ItemType BROWN_CONCRETE_POWDER = new ItemType("minecraft:brown_concrete_powder"); - public static final ItemType BROWN_GLAZED_TERRACOTTA = new ItemType("minecraft:brown_glazed_terracotta"); - public static final ItemType BROWN_MUSHROOM = new ItemType("minecraft:brown_mushroom"); - public static final ItemType BROWN_MUSHROOM_BLOCK = new ItemType("minecraft:brown_mushroom_block"); - public static final ItemType BROWN_STAINED_GLASS = new ItemType("minecraft:brown_stained_glass"); - public static final ItemType BROWN_STAINED_GLASS_PANE = new ItemType("minecraft:brown_stained_glass_pane"); - public static final ItemType BROWN_TERRACOTTA = new ItemType("minecraft:brown_terracotta"); - public static final ItemType BROWN_WOOL = new ItemType("minecraft:brown_wool"); - public static final ItemType BUBBLE_CORAL = new ItemType("minecraft:bubble_coral"); - public static final ItemType BUBBLE_CORAL_BLOCK = new ItemType("minecraft:bubble_coral_block"); - public static final ItemType BUBBLE_CORAL_FAN = new ItemType("minecraft:bubble_coral_fan"); - public static final ItemType BUCKET = new ItemType("minecraft:bucket"); - public static final ItemType CACTUS = new ItemType("minecraft:cactus"); - public static final ItemType CACTUS_GREEN = new ItemType("minecraft:cactus_green"); - public static final ItemType CARROT = new ItemType("minecraft:carrot"); - public static final ItemType CARROT_ON_A_STICK = new ItemType("minecraft:carrot_on_a_stick"); - public static final ItemType CARVED_PUMPKIN = new ItemType("minecraft:carved_pumpkin"); - public static final ItemType CAULDRON = new ItemType("minecraft:cauldron"); - public static final ItemType CAVE_SPIDER_SPAWN_EGG = new ItemType("minecraft:cave_spider_spawn_egg"); - public static final ItemType CHAINMAIL_BOOTS = new ItemType("minecraft:chainmail_boots"); - public static final ItemType CHAINMAIL_CHESTPLATE = new ItemType("minecraft:chainmail_chestplate"); - public static final ItemType CHAINMAIL_HELMET = new ItemType("minecraft:chainmail_helmet"); - public static final ItemType CHAINMAIL_LEGGINGS = new ItemType("minecraft:chainmail_leggings"); - public static final ItemType CHARCOAL = new ItemType("minecraft:charcoal"); - public static final ItemType CHEST = new ItemType("minecraft:chest"); - public static final ItemType CHEST_MINECART = new ItemType("minecraft:chest_minecart"); - public static final ItemType CHICKEN = new ItemType("minecraft:chicken"); - public static final ItemType CHICKEN_SPAWN_EGG = new ItemType("minecraft:chicken_spawn_egg"); - public static final ItemType CHIPPED_ANVIL = new ItemType("minecraft:chipped_anvil"); - public static final ItemType CHISELED_QUARTZ_BLOCK = new ItemType("minecraft:chiseled_quartz_block"); - public static final ItemType CHISELED_RED_SANDSTONE = new ItemType("minecraft:chiseled_red_sandstone"); - public static final ItemType CHISELED_SANDSTONE = new ItemType("minecraft:chiseled_sandstone"); - public static final ItemType CHISELED_STONE_BRICKS = new ItemType("minecraft:chiseled_stone_bricks"); - public static final ItemType CHORUS_FLOWER = new ItemType("minecraft:chorus_flower"); - public static final ItemType CHORUS_FRUIT = new ItemType("minecraft:chorus_fruit"); - public static final ItemType CHORUS_FRUIT_POPPED = new ItemType("minecraft:chorus_fruit_popped"); - public static final ItemType CHORUS_PLANT = new ItemType("minecraft:chorus_plant"); - public static final ItemType CLAY = new ItemType("minecraft:clay"); - public static final ItemType CLAY_BALL = new ItemType("minecraft:clay_ball"); - public static final ItemType CLOCK = new ItemType("minecraft:clock"); - public static final ItemType CLOWNFISH = new ItemType("minecraft:clownfish"); - public static final ItemType CLOWNFISH_BUCKET = new ItemType("minecraft:clownfish_bucket"); - public static final ItemType COAL = new ItemType("minecraft:coal"); - public static final ItemType COAL_BLOCK = new ItemType("minecraft:coal_block"); - public static final ItemType COAL_ORE = new ItemType("minecraft:coal_ore"); - public static final ItemType COARSE_DIRT = new ItemType("minecraft:coarse_dirt"); - public static final ItemType COBBLESTONE = new ItemType("minecraft:cobblestone"); - public static final ItemType COBBLESTONE_SLAB = new ItemType("minecraft:cobblestone_slab"); - public static final ItemType COBBLESTONE_STAIRS = new ItemType("minecraft:cobblestone_stairs"); - public static final ItemType COBBLESTONE_WALL = new ItemType("minecraft:cobblestone_wall"); - public static final ItemType COBWEB = new ItemType("minecraft:cobweb"); - public static final ItemType COCOA_BEANS = new ItemType("minecraft:cocoa_beans"); - public static final ItemType COD = new ItemType("minecraft:cod"); - public static final ItemType COD_BUCKET = new ItemType("minecraft:cod_bucket"); - public static final ItemType COD_SPAWN_EGG = new ItemType("minecraft:cod_spawn_egg"); - public static final ItemType COMMAND_BLOCK_MINECART = new ItemType("minecraft:command_block_minecart"); - public static final ItemType COMPARATOR = new ItemType("minecraft:comparator"); - public static final ItemType COMPASS = new ItemType("minecraft:compass"); - public static final ItemType COOKED_BEEF = new ItemType("minecraft:cooked_beef"); - public static final ItemType COOKED_CHICKEN = new ItemType("minecraft:cooked_chicken"); - public static final ItemType COOKED_COD = new ItemType("minecraft:cooked_cod"); - public static final ItemType COOKED_MUTTON = new ItemType("minecraft:cooked_mutton"); - public static final ItemType COOKED_PORKCHOP = new ItemType("minecraft:cooked_porkchop"); - public static final ItemType COOKED_RABBIT = new ItemType("minecraft:cooked_rabbit"); - public static final ItemType COOKED_SALMON = new ItemType("minecraft:cooked_salmon"); - public static final ItemType COOKIE = new ItemType("minecraft:cookie"); - public static final ItemType COW_SPAWN_EGG = new ItemType("minecraft:cow_spawn_egg"); - public static final ItemType CRACKED_STONE_BRICKS = new ItemType("minecraft:cracked_stone_bricks"); - public static final ItemType CRAFTING_TABLE = new ItemType("minecraft:crafting_table"); - public static final ItemType CREEPER_SPAWN_EGG = new ItemType("minecraft:creeper_spawn_egg"); - public static final ItemType CUT_RED_SANDSTONE = new ItemType("minecraft:cut_red_sandstone"); - public static final ItemType CUT_SANDSTONE = new ItemType("minecraft:cut_sandstone"); - public static final ItemType CYAN_BANNER = new ItemType("minecraft:cyan_banner"); - public static final ItemType CYAN_CARPET = new ItemType("minecraft:cyan_carpet"); - public static final ItemType CYAN_CONCRETE = new ItemType("minecraft:cyan_concrete"); - public static final ItemType CYAN_CONCRETE_POWDER = new ItemType("minecraft:cyan_concrete_powder"); - public static final ItemType CYAN_DYE = new ItemType("minecraft:cyan_dye"); - public static final ItemType CYAN_GLAZED_TERRACOTTA = new ItemType("minecraft:cyan_glazed_terracotta"); - public static final ItemType CYAN_STAINED_GLASS = new ItemType("minecraft:cyan_stained_glass"); - public static final ItemType CYAN_STAINED_GLASS_PANE = new ItemType("minecraft:cyan_stained_glass_pane"); - public static final ItemType CYAN_TERRACOTTA = new ItemType("minecraft:cyan_terracotta"); - public static final ItemType CYAN_WOOL = new ItemType("minecraft:cyan_wool"); - public static final ItemType DAMAGED_ANVIL = new ItemType("minecraft:damaged_anvil"); - public static final ItemType DANDELION = new ItemType("minecraft:dandelion"); - public static final ItemType DANDELION_YELLOW = new ItemType("minecraft:dandelion_yellow"); - public static final ItemType DARK_OAK_BARK = new ItemType("minecraft:dark_oak_bark"); - public static final ItemType DARK_OAK_BOAT = new ItemType("minecraft:dark_oak_boat"); - public static final ItemType DARK_OAK_BUTTON = new ItemType("minecraft:dark_oak_button"); - public static final ItemType DARK_OAK_FENCE = new ItemType("minecraft:dark_oak_fence"); - public static final ItemType DARK_OAK_FENCE_GATE = new ItemType("minecraft:dark_oak_fence_gate"); - public static final ItemType DARK_OAK_LEAVES = new ItemType("minecraft:dark_oak_leaves"); - public static final ItemType DARK_OAK_LOG = new ItemType("minecraft:dark_oak_log"); - public static final ItemType DARK_OAK_PLANKS = new ItemType("minecraft:dark_oak_planks"); - public static final ItemType DARK_OAK_PRESSURE_PLATE = new ItemType("minecraft:dark_oak_pressure_plate"); - public static final ItemType DARK_OAK_SAPLING = new ItemType("minecraft:dark_oak_sapling"); - public static final ItemType DARK_OAK_SLAB = new ItemType("minecraft:dark_oak_slab"); - public static final ItemType DARK_OAK_STAIRS = new ItemType("minecraft:dark_oak_stairs"); - public static final ItemType DARK_OAK_TRAPDOOR = new ItemType("minecraft:dark_oak_trapdoor"); - public static final ItemType DARK_PRISMARINE = new ItemType("minecraft:dark_prismarine"); - public static final ItemType DARK_PRISMARINE_SLAB = new ItemType("minecraft:dark_prismarine_slab"); - public static final ItemType DARK_PRISMARINE_STAIRS = new ItemType("minecraft:dark_prismarine_stairs"); - public static final ItemType DAYLIGHT_DETECTOR = new ItemType("minecraft:daylight_detector"); - public static final ItemType DEAD_BRAIN_CORAL_BLOCK = new ItemType("minecraft:dead_brain_coral_block"); - public static final ItemType DEAD_BUBBLE_CORAL_BLOCK = new ItemType("minecraft:dead_bubble_coral_block"); - public static final ItemType DEAD_BUSH = new ItemType("minecraft:dead_bush"); - public static final ItemType DEAD_FIRE_CORAL_BLOCK = new ItemType("minecraft:dead_fire_coral_block"); - public static final ItemType DEAD_HORN_CORAL_BLOCK = new ItemType("minecraft:dead_horn_coral_block"); - public static final ItemType DEAD_TUBE_CORAL_BLOCK = new ItemType("minecraft:dead_tube_coral_block"); - public static final ItemType DEBUG_STICK = new ItemType("minecraft:debug_stick"); - public static final ItemType DETECTOR_RAIL = new ItemType("minecraft:detector_rail"); - public static final ItemType DIAMOND = new ItemType("minecraft:diamond"); - public static final ItemType DIAMOND_AXE = new ItemType("minecraft:diamond_axe"); - public static final ItemType DIAMOND_BLOCK = new ItemType("minecraft:diamond_block"); - public static final ItemType DIAMOND_BOOTS = new ItemType("minecraft:diamond_boots"); - public static final ItemType DIAMOND_CHESTPLATE = new ItemType("minecraft:diamond_chestplate"); - public static final ItemType DIAMOND_HELMET = new ItemType("minecraft:diamond_helmet"); - public static final ItemType DIAMOND_HOE = new ItemType("minecraft:diamond_hoe"); - public static final ItemType DIAMOND_HORSE_ARMOR = new ItemType("minecraft:diamond_horse_armor"); - public static final ItemType DIAMOND_LEGGINGS = new ItemType("minecraft:diamond_leggings"); - public static final ItemType DIAMOND_ORE = new ItemType("minecraft:diamond_ore"); - public static final ItemType DIAMOND_PICKAXE = new ItemType("minecraft:diamond_pickaxe"); - public static final ItemType DIAMOND_SHOVEL = new ItemType("minecraft:diamond_shovel"); - public static final ItemType DIAMOND_SWORD = new ItemType("minecraft:diamond_sword"); - public static final ItemType DIORITE = new ItemType("minecraft:diorite"); - public static final ItemType DIRT = new ItemType("minecraft:dirt"); - public static final ItemType DISPENSER = new ItemType("minecraft:dispenser"); - public static final ItemType DOLPHIN_SPAWN_EGG = new ItemType("minecraft:dolphin_spawn_egg"); - public static final ItemType DONKEY_SPAWN_EGG = new ItemType("minecraft:donkey_spawn_egg"); - public static final ItemType DRAGON_BREATH = new ItemType("minecraft:dragon_breath"); - public static final ItemType DRIED_KELP = new ItemType("minecraft:dried_kelp"); - public static final ItemType DRIED_KELP_BLOCK = new ItemType("minecraft:dried_kelp_block"); - public static final ItemType DROPPER = new ItemType("minecraft:dropper"); - public static final ItemType DROWNED_SPAWN_EGG = new ItemType("minecraft:drowned_spawn_egg"); - public static final ItemType EGG = new ItemType("minecraft:egg"); - public static final ItemType ELDER_GUARDIAN_SPAWN_EGG = new ItemType("minecraft:elder_guardian_spawn_egg"); - public static final ItemType ELYTRA = new ItemType("minecraft:elytra"); - public static final ItemType EMERALD = new ItemType("minecraft:emerald"); - public static final ItemType EMERALD_BLOCK = new ItemType("minecraft:emerald_block"); - public static final ItemType EMERALD_ORE = new ItemType("minecraft:emerald_ore"); - public static final ItemType ENCHANTED_BOOK = new ItemType("minecraft:enchanted_book"); - public static final ItemType ENCHANTED_GOLDEN_APPLE = new ItemType("minecraft:enchanted_golden_apple"); - public static final ItemType ENCHANTING_TABLE = new ItemType("minecraft:enchanting_table"); - public static final ItemType END_CRYSTAL = new ItemType("minecraft:end_crystal"); - public static final ItemType END_PORTAL_FRAME = new ItemType("minecraft:end_portal_frame"); - public static final ItemType END_ROD = new ItemType("minecraft:end_rod"); - public static final ItemType END_STONE = new ItemType("minecraft:end_stone"); - public static final ItemType END_STONE_BRICKS = new ItemType("minecraft:end_stone_bricks"); - public static final ItemType ENDER_CHEST = new ItemType("minecraft:ender_chest"); - public static final ItemType ENDER_EYE = new ItemType("minecraft:ender_eye"); - public static final ItemType ENDER_PEARL = new ItemType("minecraft:ender_pearl"); - public static final ItemType ENDERMAN_SPAWN_EGG = new ItemType("minecraft:enderman_spawn_egg"); - public static final ItemType ENDERMITE_SPAWN_EGG = new ItemType("minecraft:endermite_spawn_egg"); - public static final ItemType EVOCATION_ILLAGER_SPAWN_EGG = new ItemType("minecraft:evocation_illager_spawn_egg"); - public static final ItemType EXPERIENCE_BOTTLE = new ItemType("minecraft:experience_bottle"); - public static final ItemType FARMLAND = new ItemType("minecraft:farmland"); - public static final ItemType FEATHER = new ItemType("minecraft:feather"); - public static final ItemType FERMENTED_SPIDER_EYE = new ItemType("minecraft:fermented_spider_eye"); - public static final ItemType FERN = new ItemType("minecraft:fern"); - public static final ItemType FILLED_MAP = new ItemType("minecraft:filled_map"); - public static final ItemType FIRE_CHARGE = new ItemType("minecraft:fire_charge"); - public static final ItemType FIRE_CORAL = new ItemType("minecraft:fire_coral"); - public static final ItemType FIRE_CORAL_BLOCK = new ItemType("minecraft:fire_coral_block"); - public static final ItemType FIRE_CORAL_FAN = new ItemType("minecraft:fire_coral_fan"); - public static final ItemType FIREWORK_ROCKET = new ItemType("minecraft:firework_rocket"); - public static final ItemType FIREWORK_STAR = new ItemType("minecraft:firework_star"); - public static final ItemType FISHING_ROD = new ItemType("minecraft:fishing_rod"); - public static final ItemType FLINT = new ItemType("minecraft:flint"); - public static final ItemType FLINT_AND_STEEL = new ItemType("minecraft:flint_and_steel"); - public static final ItemType FLOWER_POT = new ItemType("minecraft:flower_pot"); - public static final ItemType FURNACE = new ItemType("minecraft:furnace"); - public static final ItemType FURNACE_MINECART = new ItemType("minecraft:furnace_minecart"); - public static final ItemType GHAST_SPAWN_EGG = new ItemType("minecraft:ghast_spawn_egg"); - public static final ItemType GHAST_TEAR = new ItemType("minecraft:ghast_tear"); - public static final ItemType GLASS = new ItemType("minecraft:glass"); - public static final ItemType GLASS_BOTTLE = new ItemType("minecraft:glass_bottle"); - public static final ItemType GLASS_PANE = new ItemType("minecraft:glass_pane"); - public static final ItemType GLISTERING_MELON_SLICE = new ItemType("minecraft:glistering_melon_slice"); - public static final ItemType GLOWSTONE = new ItemType("minecraft:glowstone"); - public static final ItemType GLOWSTONE_DUST = new ItemType("minecraft:glowstone_dust"); - public static final ItemType GOLD_BLOCK = new ItemType("minecraft:gold_block"); - public static final ItemType GOLD_INGOT = new ItemType("minecraft:gold_ingot"); - public static final ItemType GOLD_NUGGET = new ItemType("minecraft:gold_nugget"); - public static final ItemType GOLD_ORE = new ItemType("minecraft:gold_ore"); - public static final ItemType GOLDEN_APPLE = new ItemType("minecraft:golden_apple"); - public static final ItemType GOLDEN_AXE = new ItemType("minecraft:golden_axe"); - public static final ItemType GOLDEN_BOOTS = new ItemType("minecraft:golden_boots"); - public static final ItemType GOLDEN_CARROT = new ItemType("minecraft:golden_carrot"); - public static final ItemType GOLDEN_CHESTPLATE = new ItemType("minecraft:golden_chestplate"); - public static final ItemType GOLDEN_HELMET = new ItemType("minecraft:golden_helmet"); - public static final ItemType GOLDEN_HOE = new ItemType("minecraft:golden_hoe"); - public static final ItemType GOLDEN_HORSE_ARMOR = new ItemType("minecraft:golden_horse_armor"); - public static final ItemType GOLDEN_LEGGINGS = new ItemType("minecraft:golden_leggings"); - public static final ItemType GOLDEN_PICKAXE = new ItemType("minecraft:golden_pickaxe"); - public static final ItemType GOLDEN_SHOVEL = new ItemType("minecraft:golden_shovel"); - public static final ItemType GOLDEN_SWORD = new ItemType("minecraft:golden_sword"); - public static final ItemType GRANITE = new ItemType("minecraft:granite"); - public static final ItemType GRASS = new ItemType("minecraft:grass"); - public static final ItemType GRASS_BLOCK = new ItemType("minecraft:grass_block"); - public static final ItemType GRASS_PATH = new ItemType("minecraft:grass_path"); - public static final ItemType GRAVEL = new ItemType("minecraft:gravel"); - public static final ItemType GRAY_BANNER = new ItemType("minecraft:gray_banner"); - public static final ItemType GRAY_CARPET = new ItemType("minecraft:gray_carpet"); - public static final ItemType GRAY_CONCRETE = new ItemType("minecraft:gray_concrete"); - public static final ItemType GRAY_CONCRETE_POWDER = new ItemType("minecraft:gray_concrete_powder"); - public static final ItemType GRAY_DYE = new ItemType("minecraft:gray_dye"); - public static final ItemType GRAY_GLAZED_TERRACOTTA = new ItemType("minecraft:gray_glazed_terracotta"); - public static final ItemType GRAY_STAINED_GLASS = new ItemType("minecraft:gray_stained_glass"); - public static final ItemType GRAY_STAINED_GLASS_PANE = new ItemType("minecraft:gray_stained_glass_pane"); - public static final ItemType GRAY_TERRACOTTA = new ItemType("minecraft:gray_terracotta"); - public static final ItemType GRAY_WOOL = new ItemType("minecraft:gray_wool"); - public static final ItemType GREEN_BANNER = new ItemType("minecraft:green_banner"); - public static final ItemType GREEN_CARPET = new ItemType("minecraft:green_carpet"); - public static final ItemType GREEN_CONCRETE = new ItemType("minecraft:green_concrete"); - public static final ItemType GREEN_CONCRETE_POWDER = new ItemType("minecraft:green_concrete_powder"); - public static final ItemType GREEN_GLAZED_TERRACOTTA = new ItemType("minecraft:green_glazed_terracotta"); - public static final ItemType GREEN_STAINED_GLASS = new ItemType("minecraft:green_stained_glass"); - public static final ItemType GREEN_STAINED_GLASS_PANE = new ItemType("minecraft:green_stained_glass_pane"); - public static final ItemType GREEN_TERRACOTTA = new ItemType("minecraft:green_terracotta"); - public static final ItemType GREEN_WOOL = new ItemType("minecraft:green_wool"); - public static final ItemType GUARDIAN_SPAWN_EGG = new ItemType("minecraft:guardian_spawn_egg"); - public static final ItemType GUNPOWDER = new ItemType("minecraft:gunpowder"); - public static final ItemType HAY_BLOCK = new ItemType("minecraft:hay_block"); - public static final ItemType HEART_OF_THE_SEA = new ItemType("minecraft:heart_of_the_sea"); - public static final ItemType HEAVY_WEIGHTED_PRESSURE_PLATE = new ItemType("minecraft:heavy_weighted_pressure_plate"); - public static final ItemType HOPPER = new ItemType("minecraft:hopper"); - public static final ItemType HOPPER_MINECART = new ItemType("minecraft:hopper_minecart"); - public static final ItemType HORN_CORAL = new ItemType("minecraft:horn_coral"); - public static final ItemType HORN_CORAL_BLOCK = new ItemType("minecraft:horn_coral_block"); - public static final ItemType HORN_CORAL_FAN = new ItemType("minecraft:horn_coral_fan"); - public static final ItemType HORSE_SPAWN_EGG = new ItemType("minecraft:horse_spawn_egg"); - public static final ItemType HUSK_SPAWN_EGG = new ItemType("minecraft:husk_spawn_egg"); - public static final ItemType ICE = new ItemType("minecraft:ice"); - public static final ItemType INFESTED_CHISELED_STONE_BRICKS = new ItemType("minecraft:infested_chiseled_stone_bricks"); - public static final ItemType INFESTED_COBBLESTONE = new ItemType("minecraft:infested_cobblestone"); - public static final ItemType INFESTED_CRACKED_STONE_BRICKS = new ItemType("minecraft:infested_cracked_stone_bricks"); - public static final ItemType INFESTED_MOSSY_STONE_BRICKS = new ItemType("minecraft:infested_mossy_stone_bricks"); - public static final ItemType INFESTED_STONE = new ItemType("minecraft:infested_stone"); - public static final ItemType INFESTED_STONE_BRICKS = new ItemType("minecraft:infested_stone_bricks"); - public static final ItemType INK_SAC = new ItemType("minecraft:ink_sac"); - public static final ItemType IRON_AXE = new ItemType("minecraft:iron_axe"); - public static final ItemType IRON_BARS = new ItemType("minecraft:iron_bars"); - public static final ItemType IRON_BLOCK = new ItemType("minecraft:iron_block"); - public static final ItemType IRON_BOOTS = new ItemType("minecraft:iron_boots"); - public static final ItemType IRON_CHESTPLATE = new ItemType("minecraft:iron_chestplate"); - public static final ItemType IRON_HELMET = new ItemType("minecraft:iron_helmet"); - public static final ItemType IRON_HOE = new ItemType("minecraft:iron_hoe"); - public static final ItemType IRON_HORSE_ARMOR = new ItemType("minecraft:iron_horse_armor"); - public static final ItemType IRON_INGOT = new ItemType("minecraft:iron_ingot"); - public static final ItemType IRON_LEGGINGS = new ItemType("minecraft:iron_leggings"); - public static final ItemType IRON_NUGGET = new ItemType("minecraft:iron_nugget"); - public static final ItemType IRON_ORE = new ItemType("minecraft:iron_ore"); - public static final ItemType IRON_PICKAXE = new ItemType("minecraft:iron_pickaxe"); - public static final ItemType IRON_SHOVEL = new ItemType("minecraft:iron_shovel"); - public static final ItemType IRON_SWORD = new ItemType("minecraft:iron_sword"); - public static final ItemType IRON_TRAPDOOR = new ItemType("minecraft:iron_trapdoor"); - public static final ItemType ITEM_FRAME = new ItemType("minecraft:item_frame"); - public static final ItemType JACK_O_LANTERN = new ItemType("minecraft:jack_o_lantern"); - public static final ItemType JUKEBOX = new ItemType("minecraft:jukebox"); - public static final ItemType JUNGLE_BARK = new ItemType("minecraft:jungle_bark"); - public static final ItemType JUNGLE_BOAT = new ItemType("minecraft:jungle_boat"); - public static final ItemType JUNGLE_BUTTON = new ItemType("minecraft:jungle_button"); - public static final ItemType JUNGLE_FENCE = new ItemType("minecraft:jungle_fence"); - public static final ItemType JUNGLE_FENCE_GATE = new ItemType("minecraft:jungle_fence_gate"); - public static final ItemType JUNGLE_LEAVES = new ItemType("minecraft:jungle_leaves"); - public static final ItemType JUNGLE_LOG = new ItemType("minecraft:jungle_log"); - public static final ItemType JUNGLE_PLANKS = new ItemType("minecraft:jungle_planks"); - public static final ItemType JUNGLE_PRESSURE_PLATE = new ItemType("minecraft:jungle_pressure_plate"); - public static final ItemType JUNGLE_SAPLING = new ItemType("minecraft:jungle_sapling"); - public static final ItemType JUNGLE_SLAB = new ItemType("minecraft:jungle_slab"); - public static final ItemType JUNGLE_STAIRS = new ItemType("minecraft:jungle_stairs"); - public static final ItemType JUNGLE_TRAPDOOR = new ItemType("minecraft:jungle_trapdoor"); - public static final ItemType KELP = new ItemType("minecraft:kelp"); - public static final ItemType KNOWLEDGE_BOOK = new ItemType("minecraft:knowledge_book"); - public static final ItemType LADDER = new ItemType("minecraft:ladder"); - public static final ItemType LAPIS_BLOCK = new ItemType("minecraft:lapis_block"); - public static final ItemType LAPIS_LAZULI = new ItemType("minecraft:lapis_lazuli"); - public static final ItemType LAPIS_ORE = new ItemType("minecraft:lapis_ore"); - public static final ItemType LAVA_BUCKET = new ItemType("minecraft:lava_bucket"); - public static final ItemType LEAD = new ItemType("minecraft:lead"); - public static final ItemType LEATHER = new ItemType("minecraft:leather"); - public static final ItemType LEATHER_BOOTS = new ItemType("minecraft:leather_boots"); - public static final ItemType LEATHER_CHESTPLATE = new ItemType("minecraft:leather_chestplate"); - public static final ItemType LEATHER_HELMET = new ItemType("minecraft:leather_helmet"); - public static final ItemType LEATHER_LEGGINGS = new ItemType("minecraft:leather_leggings"); - public static final ItemType LEVER = new ItemType("minecraft:lever"); - public static final ItemType LIGHT_BLUE_BANNER = new ItemType("minecraft:light_blue_banner"); - public static final ItemType LIGHT_BLUE_CARPET = new ItemType("minecraft:light_blue_carpet"); - public static final ItemType LIGHT_BLUE_CONCRETE = new ItemType("minecraft:light_blue_concrete"); - public static final ItemType LIGHT_BLUE_CONCRETE_POWDER = new ItemType("minecraft:light_blue_concrete_powder"); - public static final ItemType LIGHT_BLUE_DYE = new ItemType("minecraft:light_blue_dye"); - public static final ItemType LIGHT_BLUE_GLAZED_TERRACOTTA = new ItemType("minecraft:light_blue_glazed_terracotta"); - public static final ItemType LIGHT_BLUE_STAINED_GLASS = new ItemType("minecraft:light_blue_stained_glass"); - public static final ItemType LIGHT_BLUE_STAINED_GLASS_PANE = new ItemType("minecraft:light_blue_stained_glass_pane"); - public static final ItemType LIGHT_BLUE_TERRACOTTA = new ItemType("minecraft:light_blue_terracotta"); - public static final ItemType LIGHT_BLUE_WOOL = new ItemType("minecraft:light_blue_wool"); - public static final ItemType LIGHT_GRAY_BANNER = new ItemType("minecraft:light_gray_banner"); - public static final ItemType LIGHT_GRAY_CARPET = new ItemType("minecraft:light_gray_carpet"); - public static final ItemType LIGHT_GRAY_CONCRETE = new ItemType("minecraft:light_gray_concrete"); - public static final ItemType LIGHT_GRAY_CONCRETE_POWDER = new ItemType("minecraft:light_gray_concrete_powder"); - public static final ItemType LIGHT_GRAY_DYE = new ItemType("minecraft:light_gray_dye"); - public static final ItemType LIGHT_GRAY_GLAZED_TERRACOTTA = new ItemType("minecraft:light_gray_glazed_terracotta"); - public static final ItemType LIGHT_GRAY_STAINED_GLASS = new ItemType("minecraft:light_gray_stained_glass"); - public static final ItemType LIGHT_GRAY_STAINED_GLASS_PANE = new ItemType("minecraft:light_gray_stained_glass_pane"); - public static final ItemType LIGHT_GRAY_TERRACOTTA = new ItemType("minecraft:light_gray_terracotta"); - public static final ItemType LIGHT_GRAY_WOOL = new ItemType("minecraft:light_gray_wool"); - public static final ItemType LIGHT_WEIGHTED_PRESSURE_PLATE = new ItemType("minecraft:light_weighted_pressure_plate"); - public static final ItemType LIME_BANNER = new ItemType("minecraft:lime_banner"); - public static final ItemType LIME_CARPET = new ItemType("minecraft:lime_carpet"); - public static final ItemType LIME_CONCRETE = new ItemType("minecraft:lime_concrete"); - public static final ItemType LIME_CONCRETE_POWDER = new ItemType("minecraft:lime_concrete_powder"); - public static final ItemType LIME_DYE = new ItemType("minecraft:lime_dye"); - public static final ItemType LIME_GLAZED_TERRACOTTA = new ItemType("minecraft:lime_glazed_terracotta"); - public static final ItemType LIME_STAINED_GLASS = new ItemType("minecraft:lime_stained_glass"); - public static final ItemType LIME_STAINED_GLASS_PANE = new ItemType("minecraft:lime_stained_glass_pane"); - public static final ItemType LIME_TERRACOTTA = new ItemType("minecraft:lime_terracotta"); - public static final ItemType LIME_WOOL = new ItemType("minecraft:lime_wool"); - public static final ItemType LINGERING_POTION = new ItemType("minecraft:lingering_potion"); - public static final ItemType LLAMA_SPAWN_EGG = new ItemType("minecraft:llama_spawn_egg"); - public static final ItemType MAGENTA_BANNER = new ItemType("minecraft:magenta_banner"); - public static final ItemType MAGENTA_CARPET = new ItemType("minecraft:magenta_carpet"); - public static final ItemType MAGENTA_CONCRETE = new ItemType("minecraft:magenta_concrete"); - public static final ItemType MAGENTA_CONCRETE_POWDER = new ItemType("minecraft:magenta_concrete_powder"); - public static final ItemType MAGENTA_DYE = new ItemType("minecraft:magenta_dye"); - public static final ItemType MAGENTA_GLAZED_TERRACOTTA = new ItemType("minecraft:magenta_glazed_terracotta"); - public static final ItemType MAGENTA_STAINED_GLASS = new ItemType("minecraft:magenta_stained_glass"); - public static final ItemType MAGENTA_STAINED_GLASS_PANE = new ItemType("minecraft:magenta_stained_glass_pane"); - public static final ItemType MAGENTA_TERRACOTTA = new ItemType("minecraft:magenta_terracotta"); - public static final ItemType MAGENTA_WOOL = new ItemType("minecraft:magenta_wool"); - public static final ItemType MAGMA_BLOCK = new ItemType("minecraft:magma_block"); - public static final ItemType MAGMA_CREAM = new ItemType("minecraft:magma_cream"); - public static final ItemType MAGMA_CUBE_SPAWN_EGG = new ItemType("minecraft:magma_cube_spawn_egg"); - public static final ItemType MAP = new ItemType("minecraft:map"); - public static final ItemType MELON = new ItemType("minecraft:melon"); - public static final ItemType MELON_SEEDS = new ItemType("minecraft:melon_seeds"); - public static final ItemType MELON_SLICE = new ItemType("minecraft:melon_slice"); - public static final ItemType MILK_BUCKET = new ItemType("minecraft:milk_bucket"); - public static final ItemType MINECART = new ItemType("minecraft:minecart"); - public static final ItemType MOB_SPAWNER = new ItemType("minecraft:mob_spawner"); - public static final ItemType MOOSHROOM_SPAWN_EGG = new ItemType("minecraft:mooshroom_spawn_egg"); - public static final ItemType MOSSY_COBBLESTONE = new ItemType("minecraft:mossy_cobblestone"); - public static final ItemType MOSSY_COBBLESTONE_WALL = new ItemType("minecraft:mossy_cobblestone_wall"); - public static final ItemType MOSSY_STONE_BRICKS = new ItemType("minecraft:mossy_stone_bricks"); - public static final ItemType MULE_SPAWN_EGG = new ItemType("minecraft:mule_spawn_egg"); - public static final ItemType MUSHROOM_STEM = new ItemType("minecraft:mushroom_stem"); - public static final ItemType MUSHROOM_STEW = new ItemType("minecraft:mushroom_stew"); - public static final ItemType MUSIC_DISC_11 = new ItemType("minecraft:music_disc_11"); - public static final ItemType MUSIC_DISC_13 = new ItemType("minecraft:music_disc_13"); - public static final ItemType MUSIC_DISC_BLOCKS = new ItemType("minecraft:music_disc_blocks"); - public static final ItemType MUSIC_DISC_CAT = new ItemType("minecraft:music_disc_cat"); - public static final ItemType MUSIC_DISC_CHIRP = new ItemType("minecraft:music_disc_chirp"); - public static final ItemType MUSIC_DISC_FAR = new ItemType("minecraft:music_disc_far"); - public static final ItemType MUSIC_DISC_MALL = new ItemType("minecraft:music_disc_mall"); - public static final ItemType MUSIC_DISC_MELLOHI = new ItemType("minecraft:music_disc_mellohi"); - public static final ItemType MUSIC_DISC_STAL = new ItemType("minecraft:music_disc_stal"); - public static final ItemType MUSIC_DISC_STRAD = new ItemType("minecraft:music_disc_strad"); - public static final ItemType MUSIC_DISC_WAIT = new ItemType("minecraft:music_disc_wait"); - public static final ItemType MUSIC_DISC_WARD = new ItemType("minecraft:music_disc_ward"); - public static final ItemType MUTTON = new ItemType("minecraft:mutton"); - public static final ItemType MYCELIUM = new ItemType("minecraft:mycelium"); - public static final ItemType NAME_TAG = new ItemType("minecraft:name_tag"); - public static final ItemType NAUTILUS_SHELL = new ItemType("minecraft:nautilus_shell"); - public static final ItemType NETHER_BRICK = new ItemType("minecraft:nether_brick"); - public static final ItemType NETHER_BRICK_FENCE = new ItemType("minecraft:nether_brick_fence"); - public static final ItemType NETHER_BRICK_SLAB = new ItemType("minecraft:nether_brick_slab"); - public static final ItemType NETHER_BRICK_STAIRS = new ItemType("minecraft:nether_brick_stairs"); - public static final ItemType NETHER_BRICKS = new ItemType("minecraft:nether_bricks"); - public static final ItemType NETHER_QUARTZ_ORE = new ItemType("minecraft:nether_quartz_ore"); - public static final ItemType NETHER_STAR = new ItemType("minecraft:nether_star"); - public static final ItemType NETHER_WART = new ItemType("minecraft:nether_wart"); - public static final ItemType NETHER_WART_BLOCK = new ItemType("minecraft:nether_wart_block"); - public static final ItemType NETHERRACK = new ItemType("minecraft:netherrack"); - public static final ItemType NOTE_BLOCK = new ItemType("minecraft:note_block"); - public static final ItemType OAK_BARK = new ItemType("minecraft:oak_bark"); - public static final ItemType OAK_BOAT = new ItemType("minecraft:oak_boat"); - public static final ItemType OAK_BUTTON = new ItemType("minecraft:oak_button"); - public static final ItemType OAK_FENCE = new ItemType("minecraft:oak_fence"); - public static final ItemType OAK_FENCE_GATE = new ItemType("minecraft:oak_fence_gate"); - public static final ItemType OAK_LEAVES = new ItemType("minecraft:oak_leaves"); - public static final ItemType OAK_LOG = new ItemType("minecraft:oak_log"); - public static final ItemType OAK_PLANKS = new ItemType("minecraft:oak_planks"); - public static final ItemType OAK_PRESSURE_PLATE = new ItemType("minecraft:oak_pressure_plate"); - public static final ItemType OAK_SAPLING = new ItemType("minecraft:oak_sapling"); - public static final ItemType OAK_SLAB = new ItemType("minecraft:oak_slab"); - public static final ItemType OAK_STAIRS = new ItemType("minecraft:oak_stairs"); - public static final ItemType OAK_TRAPDOOR = new ItemType("minecraft:oak_trapdoor"); - public static final ItemType OBSERVER = new ItemType("minecraft:observer"); - public static final ItemType OBSIDIAN = new ItemType("minecraft:obsidian"); - public static final ItemType OCELOT_SPAWN_EGG = new ItemType("minecraft:ocelot_spawn_egg"); - public static final ItemType ORANGE_BANNER = new ItemType("minecraft:orange_banner"); - public static final ItemType ORANGE_CARPET = new ItemType("minecraft:orange_carpet"); - public static final ItemType ORANGE_CONCRETE = new ItemType("minecraft:orange_concrete"); - public static final ItemType ORANGE_CONCRETE_POWDER = new ItemType("minecraft:orange_concrete_powder"); - public static final ItemType ORANGE_DYE = new ItemType("minecraft:orange_dye"); - public static final ItemType ORANGE_GLAZED_TERRACOTTA = new ItemType("minecraft:orange_glazed_terracotta"); - public static final ItemType ORANGE_STAINED_GLASS = new ItemType("minecraft:orange_stained_glass"); - public static final ItemType ORANGE_STAINED_GLASS_PANE = new ItemType("minecraft:orange_stained_glass_pane"); - public static final ItemType ORANGE_TERRACOTTA = new ItemType("minecraft:orange_terracotta"); - public static final ItemType ORANGE_TULIP = new ItemType("minecraft:orange_tulip"); - public static final ItemType ORANGE_WOOL = new ItemType("minecraft:orange_wool"); - public static final ItemType OXEYE_DAISY = new ItemType("minecraft:oxeye_daisy"); - public static final ItemType PACKED_ICE = new ItemType("minecraft:packed_ice"); - public static final ItemType PAINTING = new ItemType("minecraft:painting"); - public static final ItemType PAPER = new ItemType("minecraft:paper"); - public static final ItemType PARROT_SPAWN_EGG = new ItemType("minecraft:parrot_spawn_egg"); - public static final ItemType PETRIFIED_OAK_SLAB = new ItemType("minecraft:petrified_oak_slab"); - public static final ItemType PHANTOM_MEMBRANE = new ItemType("minecraft:phantom_membrane"); - public static final ItemType PHANTOM_SPAWN_EGG = new ItemType("minecraft:phantom_spawn_egg"); - public static final ItemType PIG_SPAWN_EGG = new ItemType("minecraft:pig_spawn_egg"); - public static final ItemType PINK_BANNER = new ItemType("minecraft:pink_banner"); - public static final ItemType PINK_CARPET = new ItemType("minecraft:pink_carpet"); - public static final ItemType PINK_CONCRETE = new ItemType("minecraft:pink_concrete"); - public static final ItemType PINK_CONCRETE_POWDER = new ItemType("minecraft:pink_concrete_powder"); - public static final ItemType PINK_DYE = new ItemType("minecraft:pink_dye"); - public static final ItemType PINK_GLAZED_TERRACOTTA = new ItemType("minecraft:pink_glazed_terracotta"); - public static final ItemType PINK_STAINED_GLASS = new ItemType("minecraft:pink_stained_glass"); - public static final ItemType PINK_STAINED_GLASS_PANE = new ItemType("minecraft:pink_stained_glass_pane"); - public static final ItemType PINK_TERRACOTTA = new ItemType("minecraft:pink_terracotta"); - public static final ItemType PINK_TULIP = new ItemType("minecraft:pink_tulip"); - public static final ItemType PINK_WOOL = new ItemType("minecraft:pink_wool"); - public static final ItemType PISTON = new ItemType("minecraft:piston"); - public static final ItemType PODZOL = new ItemType("minecraft:podzol"); - public static final ItemType POISONOUS_POTATO = new ItemType("minecraft:poisonous_potato"); - public static final ItemType POLAR_BEAR_SPAWN_EGG = new ItemType("minecraft:polar_bear_spawn_egg"); - public static final ItemType POLISHED_ANDESITE = new ItemType("minecraft:polished_andesite"); - public static final ItemType POLISHED_DIORITE = new ItemType("minecraft:polished_diorite"); - public static final ItemType POLISHED_GRANITE = new ItemType("minecraft:polished_granite"); - public static final ItemType POPPY = new ItemType("minecraft:poppy"); - public static final ItemType PORKCHOP = new ItemType("minecraft:porkchop"); - public static final ItemType POTATO = new ItemType("minecraft:potato"); - public static final ItemType POTION = new ItemType("minecraft:potion"); - public static final ItemType POWERED_RAIL = new ItemType("minecraft:powered_rail"); - public static final ItemType PRISMARINE = new ItemType("minecraft:prismarine"); - public static final ItemType PRISMARINE_BRICK_SLAB = new ItemType("minecraft:prismarine_brick_slab"); - public static final ItemType PRISMARINE_BRICK_STAIRS = new ItemType("minecraft:prismarine_brick_stairs"); - public static final ItemType PRISMARINE_BRICKS = new ItemType("minecraft:prismarine_bricks"); - public static final ItemType PRISMARINE_CRYSTALS = new ItemType("minecraft:prismarine_crystals"); - public static final ItemType PRISMARINE_SHARD = new ItemType("minecraft:prismarine_shard"); - public static final ItemType PRISMARINE_SLAB = new ItemType("minecraft:prismarine_slab"); - public static final ItemType PRISMARINE_STAIRS = new ItemType("minecraft:prismarine_stairs"); - public static final ItemType PUFFERFISH = new ItemType("minecraft:pufferfish"); - public static final ItemType PUFFERFISH_BUCKET = new ItemType("minecraft:pufferfish_bucket"); - public static final ItemType PUFFERFISH_SPAWN_EGG = new ItemType("minecraft:pufferfish_spawn_egg"); - public static final ItemType PUMPKIN = new ItemType("minecraft:pumpkin"); - public static final ItemType PUMPKIN_PIE = new ItemType("minecraft:pumpkin_pie"); - public static final ItemType PUMPKIN_SEEDS = new ItemType("minecraft:pumpkin_seeds"); - public static final ItemType PURPLE_BANNER = new ItemType("minecraft:purple_banner"); - public static final ItemType PURPLE_CARPET = new ItemType("minecraft:purple_carpet"); - public static final ItemType PURPLE_CONCRETE = new ItemType("minecraft:purple_concrete"); - public static final ItemType PURPLE_CONCRETE_POWDER = new ItemType("minecraft:purple_concrete_powder"); - public static final ItemType PURPLE_DYE = new ItemType("minecraft:purple_dye"); - public static final ItemType PURPLE_GLAZED_TERRACOTTA = new ItemType("minecraft:purple_glazed_terracotta"); - public static final ItemType PURPLE_STAINED_GLASS = new ItemType("minecraft:purple_stained_glass"); - public static final ItemType PURPLE_STAINED_GLASS_PANE = new ItemType("minecraft:purple_stained_glass_pane"); - public static final ItemType PURPLE_TERRACOTTA = new ItemType("minecraft:purple_terracotta"); - public static final ItemType PURPLE_WOOL = new ItemType("minecraft:purple_wool"); - public static final ItemType PURPUR_BLOCK = new ItemType("minecraft:purpur_block"); - public static final ItemType PURPUR_PILLAR = new ItemType("minecraft:purpur_pillar"); - public static final ItemType PURPUR_SLAB = new ItemType("minecraft:purpur_slab"); - public static final ItemType PURPUR_STAIRS = new ItemType("minecraft:purpur_stairs"); - public static final ItemType QUARTZ = new ItemType("minecraft:quartz"); - public static final ItemType QUARTZ_BLOCK = new ItemType("minecraft:quartz_block"); - public static final ItemType QUARTZ_PILLAR = new ItemType("minecraft:quartz_pillar"); - public static final ItemType QUARTZ_SLAB = new ItemType("minecraft:quartz_slab"); - public static final ItemType QUARTZ_STAIRS = new ItemType("minecraft:quartz_stairs"); - public static final ItemType RABBIT = new ItemType("minecraft:rabbit"); - public static final ItemType RABBIT_FOOT = new ItemType("minecraft:rabbit_foot"); - public static final ItemType RABBIT_HIDE = new ItemType("minecraft:rabbit_hide"); - public static final ItemType RABBIT_SPAWN_EGG = new ItemType("minecraft:rabbit_spawn_egg"); - public static final ItemType RABBIT_STEW = new ItemType("minecraft:rabbit_stew"); - public static final ItemType RAIL = new ItemType("minecraft:rail"); - public static final ItemType RED_BANNER = new ItemType("minecraft:red_banner"); - public static final ItemType RED_CARPET = new ItemType("minecraft:red_carpet"); - public static final ItemType RED_CONCRETE = new ItemType("minecraft:red_concrete"); - public static final ItemType RED_CONCRETE_POWDER = new ItemType("minecraft:red_concrete_powder"); - public static final ItemType RED_GLAZED_TERRACOTTA = new ItemType("minecraft:red_glazed_terracotta"); - public static final ItemType RED_MUSHROOM = new ItemType("minecraft:red_mushroom"); - public static final ItemType RED_MUSHROOM_BLOCK = new ItemType("minecraft:red_mushroom_block"); - public static final ItemType RED_NETHER_BRICKS = new ItemType("minecraft:red_nether_bricks"); - public static final ItemType RED_SAND = new ItemType("minecraft:red_sand"); - public static final ItemType RED_SANDSTONE = new ItemType("minecraft:red_sandstone"); - public static final ItemType RED_SANDSTONE_SLAB = new ItemType("minecraft:red_sandstone_slab"); - public static final ItemType RED_SANDSTONE_STAIRS = new ItemType("minecraft:red_sandstone_stairs"); - public static final ItemType RED_STAINED_GLASS = new ItemType("minecraft:red_stained_glass"); - public static final ItemType RED_STAINED_GLASS_PANE = new ItemType("minecraft:red_stained_glass_pane"); - public static final ItemType RED_TERRACOTTA = new ItemType("minecraft:red_terracotta"); - public static final ItemType RED_TULIP = new ItemType("minecraft:red_tulip"); - public static final ItemType RED_WOOL = new ItemType("minecraft:red_wool"); - public static final ItemType REDSTONE = new ItemType("minecraft:redstone"); - public static final ItemType REDSTONE_BLOCK = new ItemType("minecraft:redstone_block"); - public static final ItemType REDSTONE_LAMP = new ItemType("minecraft:redstone_lamp"); - public static final ItemType REDSTONE_ORE = new ItemType("minecraft:redstone_ore"); - public static final ItemType REPEATER = new ItemType("minecraft:repeater"); - public static final ItemType ROSE_RED = new ItemType("minecraft:rose_red"); - public static final ItemType ROTTEN_FLESH = new ItemType("minecraft:rotten_flesh"); - public static final ItemType SADDLE = new ItemType("minecraft:saddle"); - public static final ItemType SALMON = new ItemType("minecraft:salmon"); - public static final ItemType SALMON_BUCKET = new ItemType("minecraft:salmon_bucket"); - public static final ItemType SALMON_SPAWN_EGG = new ItemType("minecraft:salmon_spawn_egg"); - public static final ItemType SAND = new ItemType("minecraft:sand"); - public static final ItemType SANDSTONE = new ItemType("minecraft:sandstone"); - public static final ItemType SANDSTONE_SLAB = new ItemType("minecraft:sandstone_slab"); - public static final ItemType SANDSTONE_STAIRS = new ItemType("minecraft:sandstone_stairs"); - public static final ItemType SCUTE = new ItemType("minecraft:scute"); - public static final ItemType SEA_LANTERN = new ItemType("minecraft:sea_lantern"); - public static final ItemType SEA_PICKLE = new ItemType("minecraft:sea_pickle"); - public static final ItemType SEAGRASS = new ItemType("minecraft:seagrass"); - public static final ItemType SHEARS = new ItemType("minecraft:shears"); - public static final ItemType SHEEP_SPAWN_EGG = new ItemType("minecraft:sheep_spawn_egg"); - public static final ItemType SHIELD = new ItemType("minecraft:shield"); - public static final ItemType SHULKER_SHELL = new ItemType("minecraft:shulker_shell"); - public static final ItemType SHULKER_SPAWN_EGG = new ItemType("minecraft:shulker_spawn_egg"); - public static final ItemType SIGN = new ItemType("minecraft:sign"); - public static final ItemType SILVERFISH_SPAWN_EGG = new ItemType("minecraft:silverfish_spawn_egg"); - public static final ItemType SKELETON_HORSE_SPAWN_EGG = new ItemType("minecraft:skeleton_horse_spawn_egg"); - public static final ItemType SKELETON_SPAWN_EGG = new ItemType("minecraft:skeleton_spawn_egg"); - public static final ItemType SLIME_BALL = new ItemType("minecraft:slime_ball"); - public static final ItemType SLIME_BLOCK = new ItemType("minecraft:slime_block"); - public static final ItemType SLIME_SPAWN_EGG = new ItemType("minecraft:slime_spawn_egg"); - public static final ItemType SMOOTH_QUARTZ = new ItemType("minecraft:smooth_quartz"); - public static final ItemType SMOOTH_RED_SANDSTONE = new ItemType("minecraft:smooth_red_sandstone"); - public static final ItemType SMOOTH_SANDSTONE = new ItemType("minecraft:smooth_sandstone"); - public static final ItemType SMOOTH_STONE = new ItemType("minecraft:smooth_stone"); - public static final ItemType SNOW = new ItemType("minecraft:snow"); - public static final ItemType SNOW_BLOCK = new ItemType("minecraft:snow_block"); - public static final ItemType SNOWBALL = new ItemType("minecraft:snowball"); - public static final ItemType SOUL_SAND = new ItemType("minecraft:soul_sand"); - public static final ItemType SPECTRAL_ARROW = new ItemType("minecraft:spectral_arrow"); - public static final ItemType SPIDER_EYE = new ItemType("minecraft:spider_eye"); - public static final ItemType SPIDER_SPAWN_EGG = new ItemType("minecraft:spider_spawn_egg"); - public static final ItemType SPLASH_POTION = new ItemType("minecraft:splash_potion"); - public static final ItemType SPONGE = new ItemType("minecraft:sponge"); - public static final ItemType SPRUCE_BARK = new ItemType("minecraft:spruce_bark"); - public static final ItemType SPRUCE_BOAT = new ItemType("minecraft:spruce_boat"); - public static final ItemType SPRUCE_BUTTON = new ItemType("minecraft:spruce_button"); - public static final ItemType SPRUCE_FENCE = new ItemType("minecraft:spruce_fence"); - public static final ItemType SPRUCE_FENCE_GATE = new ItemType("minecraft:spruce_fence_gate"); - public static final ItemType SPRUCE_LEAVES = new ItemType("minecraft:spruce_leaves"); - public static final ItemType SPRUCE_LOG = new ItemType("minecraft:spruce_log"); - public static final ItemType SPRUCE_PLANKS = new ItemType("minecraft:spruce_planks"); - public static final ItemType SPRUCE_PRESSURE_PLATE = new ItemType("minecraft:spruce_pressure_plate"); - public static final ItemType SPRUCE_SAPLING = new ItemType("minecraft:spruce_sapling"); - public static final ItemType SPRUCE_SLAB = new ItemType("minecraft:spruce_slab"); - public static final ItemType SPRUCE_STAIRS = new ItemType("minecraft:spruce_stairs"); - public static final ItemType SPRUCE_TRAPDOOR = new ItemType("minecraft:spruce_trapdoor"); - public static final ItemType SQUID_SPAWN_EGG = new ItemType("minecraft:squid_spawn_egg"); - public static final ItemType STICK = new ItemType("minecraft:stick"); - public static final ItemType STICKY_PISTON = new ItemType("minecraft:sticky_piston"); - public static final ItemType STONE = new ItemType("minecraft:stone"); - public static final ItemType STONE_AXE = new ItemType("minecraft:stone_axe"); - public static final ItemType STONE_BRICK_SLAB = new ItemType("minecraft:stone_brick_slab"); - public static final ItemType STONE_BRICK_STAIRS = new ItemType("minecraft:stone_brick_stairs"); - public static final ItemType STONE_BRICKS = new ItemType("minecraft:stone_bricks"); - public static final ItemType STONE_BUTTON = new ItemType("minecraft:stone_button"); - public static final ItemType STONE_HOE = new ItemType("minecraft:stone_hoe"); - public static final ItemType STONE_PICKAXE = new ItemType("minecraft:stone_pickaxe"); - public static final ItemType STONE_PRESSURE_PLATE = new ItemType("minecraft:stone_pressure_plate"); - public static final ItemType STONE_SHOVEL = new ItemType("minecraft:stone_shovel"); - public static final ItemType STONE_SLAB = new ItemType("minecraft:stone_slab"); - public static final ItemType STONE_SWORD = new ItemType("minecraft:stone_sword"); - public static final ItemType STRAY_SPAWN_EGG = new ItemType("minecraft:stray_spawn_egg"); - public static final ItemType STRING = new ItemType("minecraft:string"); - public static final ItemType STRIPPED_ACACIA_LOG = new ItemType("minecraft:stripped_acacia_log"); - public static final ItemType STRIPPED_BIRCH_LOG = new ItemType("minecraft:stripped_birch_log"); - public static final ItemType STRIPPED_DARK_OAK_LOG = new ItemType("minecraft:stripped_dark_oak_log"); - public static final ItemType STRIPPED_JUNGLE_LOG = new ItemType("minecraft:stripped_jungle_log"); - public static final ItemType STRIPPED_OAK_LOG = new ItemType("minecraft:stripped_oak_log"); - public static final ItemType STRIPPED_SPRUCE_LOG = new ItemType("minecraft:stripped_spruce_log"); - public static final ItemType STRUCTURE_VOID = new ItemType("minecraft:structure_void"); - public static final ItemType SUGAR = new ItemType("minecraft:sugar"); - public static final ItemType SUGAR_CANE = new ItemType("minecraft:sugar_cane"); - public static final ItemType TERRACOTTA = new ItemType("minecraft:terracotta"); - public static final ItemType TIPPED_ARROW = new ItemType("minecraft:tipped_arrow"); - public static final ItemType TNT = new ItemType("minecraft:tnt"); - public static final ItemType TNT_MINECART = new ItemType("minecraft:tnt_minecart"); - public static final ItemType TOTEM_OF_UNDYING = new ItemType("minecraft:totem_of_undying"); - public static final ItemType TRAPPED_CHEST = new ItemType("minecraft:trapped_chest"); - public static final ItemType TRIDENT = new ItemType("minecraft:trident"); - public static final ItemType TRIPWIRE_HOOK = new ItemType("minecraft:tripwire_hook"); - public static final ItemType TROPICAL_FISH_SPAWN_EGG = new ItemType("minecraft:tropical_fish_spawn_egg"); - public static final ItemType TUBE_CORAL = new ItemType("minecraft:tube_coral"); - public static final ItemType TUBE_CORAL_BLOCK = new ItemType("minecraft:tube_coral_block"); - public static final ItemType TUBE_CORAL_FAN = new ItemType("minecraft:tube_coral_fan"); - public static final ItemType TURTLE_EGG = new ItemType("minecraft:turtle_egg"); - public static final ItemType TURTLE_HELMET = new ItemType("minecraft:turtle_helmet"); - public static final ItemType TURTLE_SPAWN_EGG = new ItemType("minecraft:turtle_spawn_egg"); - public static final ItemType VEX_SPAWN_EGG = new ItemType("minecraft:vex_spawn_egg"); - public static final ItemType VILLAGER_SPAWN_EGG = new ItemType("minecraft:villager_spawn_egg"); - public static final ItemType VINDICATION_ILLAGER_SPAWN_EGG = new ItemType("minecraft:vindication_illager_spawn_egg"); - public static final ItemType VINE = new ItemType("minecraft:vine"); - public static final ItemType WATER_BUCKET = new ItemType("minecraft:water_bucket"); - public static final ItemType WET_SPONGE = new ItemType("minecraft:wet_sponge"); - public static final ItemType WHEAT = new ItemType("minecraft:wheat"); - public static final ItemType WHEAT_SEEDS = new ItemType("minecraft:wheat_seeds"); - public static final ItemType WHITE_BANNER = new ItemType("minecraft:white_banner"); - public static final ItemType WHITE_CARPET = new ItemType("minecraft:white_carpet"); - public static final ItemType WHITE_CONCRETE = new ItemType("minecraft:white_concrete"); - public static final ItemType WHITE_CONCRETE_POWDER = new ItemType("minecraft:white_concrete_powder"); - public static final ItemType WHITE_GLAZED_TERRACOTTA = new ItemType("minecraft:white_glazed_terracotta"); - public static final ItemType WHITE_STAINED_GLASS = new ItemType("minecraft:white_stained_glass"); - public static final ItemType WHITE_STAINED_GLASS_PANE = new ItemType("minecraft:white_stained_glass_pane"); - public static final ItemType WHITE_TERRACOTTA = new ItemType("minecraft:white_terracotta"); - public static final ItemType WHITE_TULIP = new ItemType("minecraft:white_tulip"); - public static final ItemType WHITE_WOOL = new ItemType("minecraft:white_wool"); - public static final ItemType WITCH_SPAWN_EGG = new ItemType("minecraft:witch_spawn_egg"); - public static final ItemType WITHER_SKELETON_SPAWN_EGG = new ItemType("minecraft:wither_skeleton_spawn_egg"); - public static final ItemType WOLF_SPAWN_EGG = new ItemType("minecraft:wolf_spawn_egg"); - public static final ItemType WOODEN_AXE = new ItemType("minecraft:wooden_axe"); - public static final ItemType WOODEN_HOE = new ItemType("minecraft:wooden_hoe"); - public static final ItemType WOODEN_PICKAXE = new ItemType("minecraft:wooden_pickaxe"); - public static final ItemType WOODEN_SHOVEL = new ItemType("minecraft:wooden_shovel"); - public static final ItemType WOODEN_SWORD = new ItemType("minecraft:wooden_sword"); - public static final ItemType WRITABLE_BOOK = new ItemType("minecraft:writable_book"); - public static final ItemType WRITTEN_BOOK = new ItemType("minecraft:written_book"); - public static final ItemType YELLOW_BANNER = new ItemType("minecraft:yellow_banner"); - public static final ItemType YELLOW_CARPET = new ItemType("minecraft:yellow_carpet"); - public static final ItemType YELLOW_CONCRETE = new ItemType("minecraft:yellow_concrete"); - public static final ItemType YELLOW_CONCRETE_POWDER = new ItemType("minecraft:yellow_concrete_powder"); - public static final ItemType YELLOW_GLAZED_TERRACOTTA = new ItemType("minecraft:yellow_glazed_terracotta"); - public static final ItemType YELLOW_STAINED_GLASS = new ItemType("minecraft:yellow_stained_glass"); - public static final ItemType YELLOW_STAINED_GLASS_PANE = new ItemType("minecraft:yellow_stained_glass_pane"); - public static final ItemType YELLOW_TERRACOTTA = new ItemType("minecraft:yellow_terracotta"); - public static final ItemType YELLOW_WOOL = new ItemType("minecraft:yellow_wool"); - public static final ItemType ZOMBIE_HORSE_SPAWN_EGG = new ItemType("minecraft:zombie_horse_spawn_egg"); - public static final ItemType ZOMBIE_PIGMAN_SPAWN_EGG = new ItemType("minecraft:zombie_pigman_spawn_egg"); - public static final ItemType ZOMBIE_SPAWN_EGG = new ItemType("minecraft:zombie_spawn_egg"); - public static final ItemType ZOMBIE_VILLAGER_SPAWN_EGG = new ItemType("minecraft:zombie_villager_spawn_egg"); + public static final ItemType ACACIA_BARK = register("minecraft:acacia_bark"); + public static final ItemType ACACIA_BOAT = register("minecraft:acacia_boat"); + public static final ItemType ACACIA_BUTTON = register("minecraft:acacia_button"); + public static final ItemType ACACIA_FENCE = register("minecraft:acacia_fence"); + public static final ItemType ACACIA_FENCE_GATE = register("minecraft:acacia_fence_gate"); + public static final ItemType ACACIA_LEAVES = register("minecraft:acacia_leaves"); + public static final ItemType ACACIA_LOG = register("minecraft:acacia_log"); + public static final ItemType ACACIA_PLANKS = register("minecraft:acacia_planks"); + public static final ItemType ACACIA_PRESSURE_PLATE = register("minecraft:acacia_pressure_plate"); + public static final ItemType ACACIA_SAPLING = register("minecraft:acacia_sapling"); + public static final ItemType ACACIA_SLAB = register("minecraft:acacia_slab"); + public static final ItemType ACACIA_STAIRS = register("minecraft:acacia_stairs"); + public static final ItemType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor"); + public static final ItemType ACTIVATOR_RAIL = register("minecraft:activator_rail"); + public static final ItemType AIR = register("minecraft:air"); + public static final ItemType ALLIUM = register("minecraft:allium"); + public static final ItemType ANDESITE = register("minecraft:andesite"); + public static final ItemType ANVIL = register("minecraft:anvil"); + public static final ItemType APPLE = register("minecraft:apple"); + public static final ItemType ARMOR_STAND = register("minecraft:armor_stand"); + public static final ItemType ARROW = register("minecraft:arrow"); + public static final ItemType AZURE_BLUET = register("minecraft:azure_bluet"); + public static final ItemType BAKED_POTATO = register("minecraft:baked_potato"); + public static final ItemType BARRIER = register("minecraft:barrier"); + public static final ItemType BAT_SPAWN_EGG = register("minecraft:bat_spawn_egg"); + public static final ItemType BEDROCK = register("minecraft:bedrock"); + public static final ItemType BEEF = register("minecraft:beef"); + public static final ItemType BEETROOT = register("minecraft:beetroot"); + public static final ItemType BEETROOT_SEEDS = register("minecraft:beetroot_seeds"); + public static final ItemType BEETROOT_SOUP = register("minecraft:beetroot_soup"); + public static final ItemType BIRCH_BARK = register("minecraft:birch_bark"); + public static final ItemType BIRCH_BOAT = register("minecraft:birch_boat"); + public static final ItemType BIRCH_BUTTON = register("minecraft:birch_button"); + public static final ItemType BIRCH_FENCE = register("minecraft:birch_fence"); + public static final ItemType BIRCH_FENCE_GATE = register("minecraft:birch_fence_gate"); + public static final ItemType BIRCH_LEAVES = register("minecraft:birch_leaves"); + public static final ItemType BIRCH_LOG = register("minecraft:birch_log"); + public static final ItemType BIRCH_PLANKS = register("minecraft:birch_planks"); + public static final ItemType BIRCH_PRESSURE_PLATE = register("minecraft:birch_pressure_plate"); + public static final ItemType BIRCH_SAPLING = register("minecraft:birch_sapling"); + public static final ItemType BIRCH_SLAB = register("minecraft:birch_slab"); + public static final ItemType BIRCH_STAIRS = register("minecraft:birch_stairs"); + public static final ItemType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor"); + public static final ItemType BLACK_BANNER = register("minecraft:black_banner"); + public static final ItemType BLACK_CARPET = register("minecraft:black_carpet"); + public static final ItemType BLACK_CONCRETE = register("minecraft:black_concrete"); + public static final ItemType BLACK_CONCRETE_POWDER = register("minecraft:black_concrete_powder"); + public static final ItemType BLACK_GLAZED_TERRACOTTA = register("minecraft:black_glazed_terracotta"); + public static final ItemType BLACK_STAINED_GLASS = register("minecraft:black_stained_glass"); + public static final ItemType BLACK_STAINED_GLASS_PANE = register("minecraft:black_stained_glass_pane"); + public static final ItemType BLACK_TERRACOTTA = register("minecraft:black_terracotta"); + public static final ItemType BLACK_WOOL = register("minecraft:black_wool"); + public static final ItemType BLAZE_POWDER = register("minecraft:blaze_powder"); + public static final ItemType BLAZE_ROD = register("minecraft:blaze_rod"); + public static final ItemType BLAZE_SPAWN_EGG = register("minecraft:blaze_spawn_egg"); + public static final ItemType BLUE_BANNER = register("minecraft:blue_banner"); + public static final ItemType BLUE_CARPET = register("minecraft:blue_carpet"); + public static final ItemType BLUE_CONCRETE = register("minecraft:blue_concrete"); + public static final ItemType BLUE_CONCRETE_POWDER = register("minecraft:blue_concrete_powder"); + public static final ItemType BLUE_GLAZED_TERRACOTTA = register("minecraft:blue_glazed_terracotta"); + public static final ItemType BLUE_ICE = register("minecraft:blue_ice"); + public static final ItemType BLUE_ORCHID = register("minecraft:blue_orchid"); + public static final ItemType BLUE_STAINED_GLASS = register("minecraft:blue_stained_glass"); + public static final ItemType BLUE_STAINED_GLASS_PANE = register("minecraft:blue_stained_glass_pane"); + public static final ItemType BLUE_TERRACOTTA = register("minecraft:blue_terracotta"); + public static final ItemType BLUE_WOOL = register("minecraft:blue_wool"); + public static final ItemType BONE = register("minecraft:bone"); + public static final ItemType BONE_BLOCK = register("minecraft:bone_block"); + public static final ItemType BONE_MEAL = register("minecraft:bone_meal"); + public static final ItemType BOOK = register("minecraft:book"); + public static final ItemType BOOKSHELF = register("minecraft:bookshelf"); + public static final ItemType BOW = register("minecraft:bow"); + public static final ItemType BOWL = register("minecraft:bowl"); + public static final ItemType BRAIN_CORAL = register("minecraft:brain_coral"); + public static final ItemType BRAIN_CORAL_BLOCK = register("minecraft:brain_coral_block"); + public static final ItemType BRAIN_CORAL_FAN = register("minecraft:brain_coral_fan"); + public static final ItemType BREAD = register("minecraft:bread"); + public static final ItemType BREWING_STAND = register("minecraft:brewing_stand"); + public static final ItemType BRICK = register("minecraft:brick"); + public static final ItemType BRICK_SLAB = register("minecraft:brick_slab"); + public static final ItemType BRICK_STAIRS = register("minecraft:brick_stairs"); + public static final ItemType BRICKS = register("minecraft:bricks"); + public static final ItemType BROWN_BANNER = register("minecraft:brown_banner"); + public static final ItemType BROWN_CARPET = register("minecraft:brown_carpet"); + public static final ItemType BROWN_CONCRETE = register("minecraft:brown_concrete"); + public static final ItemType BROWN_CONCRETE_POWDER = register("minecraft:brown_concrete_powder"); + public static final ItemType BROWN_GLAZED_TERRACOTTA = register("minecraft:brown_glazed_terracotta"); + public static final ItemType BROWN_MUSHROOM = register("minecraft:brown_mushroom"); + public static final ItemType BROWN_MUSHROOM_BLOCK = register("minecraft:brown_mushroom_block"); + public static final ItemType BROWN_STAINED_GLASS = register("minecraft:brown_stained_glass"); + public static final ItemType BROWN_STAINED_GLASS_PANE = register("minecraft:brown_stained_glass_pane"); + public static final ItemType BROWN_TERRACOTTA = register("minecraft:brown_terracotta"); + public static final ItemType BROWN_WOOL = register("minecraft:brown_wool"); + public static final ItemType BUBBLE_CORAL = register("minecraft:bubble_coral"); + public static final ItemType BUBBLE_CORAL_BLOCK = register("minecraft:bubble_coral_block"); + public static final ItemType BUBBLE_CORAL_FAN = register("minecraft:bubble_coral_fan"); + public static final ItemType BUCKET = register("minecraft:bucket"); + public static final ItemType CACTUS = register("minecraft:cactus"); + public static final ItemType CACTUS_GREEN = register("minecraft:cactus_green"); + public static final ItemType CARROT = register("minecraft:carrot"); + public static final ItemType CARROT_ON_A_STICK = register("minecraft:carrot_on_a_stick"); + public static final ItemType CARVED_PUMPKIN = register("minecraft:carved_pumpkin"); + public static final ItemType CAULDRON = register("minecraft:cauldron"); + public static final ItemType CAVE_SPIDER_SPAWN_EGG = register("minecraft:cave_spider_spawn_egg"); + public static final ItemType CHAINMAIL_BOOTS = register("minecraft:chainmail_boots"); + public static final ItemType CHAINMAIL_CHESTPLATE = register("minecraft:chainmail_chestplate"); + public static final ItemType CHAINMAIL_HELMET = register("minecraft:chainmail_helmet"); + public static final ItemType CHAINMAIL_LEGGINGS = register("minecraft:chainmail_leggings"); + public static final ItemType CHARCOAL = register("minecraft:charcoal"); + public static final ItemType CHEST = register("minecraft:chest"); + public static final ItemType CHEST_MINECART = register("minecraft:chest_minecart"); + public static final ItemType CHICKEN = register("minecraft:chicken"); + public static final ItemType CHICKEN_SPAWN_EGG = register("minecraft:chicken_spawn_egg"); + public static final ItemType CHIPPED_ANVIL = register("minecraft:chipped_anvil"); + public static final ItemType CHISELED_QUARTZ_BLOCK = register("minecraft:chiseled_quartz_block"); + public static final ItemType CHISELED_RED_SANDSTONE = register("minecraft:chiseled_red_sandstone"); + public static final ItemType CHISELED_SANDSTONE = register("minecraft:chiseled_sandstone"); + public static final ItemType CHISELED_STONE_BRICKS = register("minecraft:chiseled_stone_bricks"); + public static final ItemType CHORUS_FLOWER = register("minecraft:chorus_flower"); + public static final ItemType CHORUS_FRUIT = register("minecraft:chorus_fruit"); + public static final ItemType CHORUS_FRUIT_POPPED = register("minecraft:chorus_fruit_popped"); + public static final ItemType CHORUS_PLANT = register("minecraft:chorus_plant"); + public static final ItemType CLAY = register("minecraft:clay"); + public static final ItemType CLAY_BALL = register("minecraft:clay_ball"); + public static final ItemType CLOCK = register("minecraft:clock"); + public static final ItemType CLOWNFISH = register("minecraft:clownfish"); + public static final ItemType CLOWNFISH_BUCKET = register("minecraft:clownfish_bucket"); + public static final ItemType COAL = register("minecraft:coal"); + public static final ItemType COAL_BLOCK = register("minecraft:coal_block"); + public static final ItemType COAL_ORE = register("minecraft:coal_ore"); + public static final ItemType COARSE_DIRT = register("minecraft:coarse_dirt"); + public static final ItemType COBBLESTONE = register("minecraft:cobblestone"); + public static final ItemType COBBLESTONE_SLAB = register("minecraft:cobblestone_slab"); + public static final ItemType COBBLESTONE_STAIRS = register("minecraft:cobblestone_stairs"); + public static final ItemType COBBLESTONE_WALL = register("minecraft:cobblestone_wall"); + public static final ItemType COBWEB = register("minecraft:cobweb"); + public static final ItemType COCOA_BEANS = register("minecraft:cocoa_beans"); + public static final ItemType COD = register("minecraft:cod"); + public static final ItemType COD_BUCKET = register("minecraft:cod_bucket"); + public static final ItemType COD_SPAWN_EGG = register("minecraft:cod_spawn_egg"); + public static final ItemType COMMAND_BLOCK_MINECART = register("minecraft:command_block_minecart"); + public static final ItemType COMPARATOR = register("minecraft:comparator"); + public static final ItemType COMPASS = register("minecraft:compass"); + public static final ItemType COOKED_BEEF = register("minecraft:cooked_beef"); + public static final ItemType COOKED_CHICKEN = register("minecraft:cooked_chicken"); + public static final ItemType COOKED_COD = register("minecraft:cooked_cod"); + public static final ItemType COOKED_MUTTON = register("minecraft:cooked_mutton"); + public static final ItemType COOKED_PORKCHOP = register("minecraft:cooked_porkchop"); + public static final ItemType COOKED_RABBIT = register("minecraft:cooked_rabbit"); + public static final ItemType COOKED_SALMON = register("minecraft:cooked_salmon"); + public static final ItemType COOKIE = register("minecraft:cookie"); + public static final ItemType COW_SPAWN_EGG = register("minecraft:cow_spawn_egg"); + public static final ItemType CRACKED_STONE_BRICKS = register("minecraft:cracked_stone_bricks"); + public static final ItemType CRAFTING_TABLE = register("minecraft:crafting_table"); + public static final ItemType CREEPER_SPAWN_EGG = register("minecraft:creeper_spawn_egg"); + public static final ItemType CUT_RED_SANDSTONE = register("minecraft:cut_red_sandstone"); + public static final ItemType CUT_SANDSTONE = register("minecraft:cut_sandstone"); + public static final ItemType CYAN_BANNER = register("minecraft:cyan_banner"); + public static final ItemType CYAN_CARPET = register("minecraft:cyan_carpet"); + public static final ItemType CYAN_CONCRETE = register("minecraft:cyan_concrete"); + public static final ItemType CYAN_CONCRETE_POWDER = register("minecraft:cyan_concrete_powder"); + public static final ItemType CYAN_DYE = register("minecraft:cyan_dye"); + public static final ItemType CYAN_GLAZED_TERRACOTTA = register("minecraft:cyan_glazed_terracotta"); + public static final ItemType CYAN_STAINED_GLASS = register("minecraft:cyan_stained_glass"); + public static final ItemType CYAN_STAINED_GLASS_PANE = register("minecraft:cyan_stained_glass_pane"); + public static final ItemType CYAN_TERRACOTTA = register("minecraft:cyan_terracotta"); + public static final ItemType CYAN_WOOL = register("minecraft:cyan_wool"); + public static final ItemType DAMAGED_ANVIL = register("minecraft:damaged_anvil"); + public static final ItemType DANDELION = register("minecraft:dandelion"); + public static final ItemType DANDELION_YELLOW = register("minecraft:dandelion_yellow"); + public static final ItemType DARK_OAK_BARK = register("minecraft:dark_oak_bark"); + public static final ItemType DARK_OAK_BOAT = register("minecraft:dark_oak_boat"); + public static final ItemType DARK_OAK_BUTTON = register("minecraft:dark_oak_button"); + public static final ItemType DARK_OAK_FENCE = register("minecraft:dark_oak_fence"); + public static final ItemType DARK_OAK_FENCE_GATE = register("minecraft:dark_oak_fence_gate"); + public static final ItemType DARK_OAK_LEAVES = register("minecraft:dark_oak_leaves"); + public static final ItemType DARK_OAK_LOG = register("minecraft:dark_oak_log"); + public static final ItemType DARK_OAK_PLANKS = register("minecraft:dark_oak_planks"); + public static final ItemType DARK_OAK_PRESSURE_PLATE = register("minecraft:dark_oak_pressure_plate"); + public static final ItemType DARK_OAK_SAPLING = register("minecraft:dark_oak_sapling"); + public static final ItemType DARK_OAK_SLAB = register("minecraft:dark_oak_slab"); + public static final ItemType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs"); + public static final ItemType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor"); + public static final ItemType DARK_PRISMARINE = register("minecraft:dark_prismarine"); + public static final ItemType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab"); + public static final ItemType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs"); + public static final ItemType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector"); + public static final ItemType DEAD_BRAIN_CORAL_BLOCK = register("minecraft:dead_brain_coral_block"); + public static final ItemType DEAD_BUBBLE_CORAL_BLOCK = register("minecraft:dead_bubble_coral_block"); + public static final ItemType DEAD_BUSH = register("minecraft:dead_bush"); + public static final ItemType DEAD_FIRE_CORAL_BLOCK = register("minecraft:dead_fire_coral_block"); + public static final ItemType DEAD_HORN_CORAL_BLOCK = register("minecraft:dead_horn_coral_block"); + public static final ItemType DEAD_TUBE_CORAL_BLOCK = register("minecraft:dead_tube_coral_block"); + public static final ItemType DEBUG_STICK = register("minecraft:debug_stick"); + public static final ItemType DETECTOR_RAIL = register("minecraft:detector_rail"); + public static final ItemType DIAMOND = register("minecraft:diamond"); + public static final ItemType DIAMOND_AXE = register("minecraft:diamond_axe"); + public static final ItemType DIAMOND_BLOCK = register("minecraft:diamond_block"); + public static final ItemType DIAMOND_BOOTS = register("minecraft:diamond_boots"); + public static final ItemType DIAMOND_CHESTPLATE = register("minecraft:diamond_chestplate"); + public static final ItemType DIAMOND_HELMET = register("minecraft:diamond_helmet"); + public static final ItemType DIAMOND_HOE = register("minecraft:diamond_hoe"); + public static final ItemType DIAMOND_HORSE_ARMOR = register("minecraft:diamond_horse_armor"); + public static final ItemType DIAMOND_LEGGINGS = register("minecraft:diamond_leggings"); + public static final ItemType DIAMOND_ORE = register("minecraft:diamond_ore"); + public static final ItemType DIAMOND_PICKAXE = register("minecraft:diamond_pickaxe"); + public static final ItemType DIAMOND_SHOVEL = register("minecraft:diamond_shovel"); + public static final ItemType DIAMOND_SWORD = register("minecraft:diamond_sword"); + public static final ItemType DIORITE = register("minecraft:diorite"); + public static final ItemType DIRT = register("minecraft:dirt"); + public static final ItemType DISPENSER = register("minecraft:dispenser"); + public static final ItemType DOLPHIN_SPAWN_EGG = register("minecraft:dolphin_spawn_egg"); + public static final ItemType DONKEY_SPAWN_EGG = register("minecraft:donkey_spawn_egg"); + public static final ItemType DRAGON_BREATH = register("minecraft:dragon_breath"); + public static final ItemType DRIED_KELP = register("minecraft:dried_kelp"); + public static final ItemType DRIED_KELP_BLOCK = register("minecraft:dried_kelp_block"); + public static final ItemType DROPPER = register("minecraft:dropper"); + public static final ItemType DROWNED_SPAWN_EGG = register("minecraft:drowned_spawn_egg"); + public static final ItemType EGG = register("minecraft:egg"); + public static final ItemType ELDER_GUARDIAN_SPAWN_EGG = register("minecraft:elder_guardian_spawn_egg"); + public static final ItemType ELYTRA = register("minecraft:elytra"); + public static final ItemType EMERALD = register("minecraft:emerald"); + public static final ItemType EMERALD_BLOCK = register("minecraft:emerald_block"); + public static final ItemType EMERALD_ORE = register("minecraft:emerald_ore"); + public static final ItemType ENCHANTED_BOOK = register("minecraft:enchanted_book"); + public static final ItemType ENCHANTED_GOLDEN_APPLE = register("minecraft:enchanted_golden_apple"); + public static final ItemType ENCHANTING_TABLE = register("minecraft:enchanting_table"); + public static final ItemType END_CRYSTAL = register("minecraft:end_crystal"); + public static final ItemType END_PORTAL_FRAME = register("minecraft:end_portal_frame"); + public static final ItemType END_ROD = register("minecraft:end_rod"); + public static final ItemType END_STONE = register("minecraft:end_stone"); + public static final ItemType END_STONE_BRICKS = register("minecraft:end_stone_bricks"); + public static final ItemType ENDER_CHEST = register("minecraft:ender_chest"); + public static final ItemType ENDER_EYE = register("minecraft:ender_eye"); + public static final ItemType ENDER_PEARL = register("minecraft:ender_pearl"); + public static final ItemType ENDERMAN_SPAWN_EGG = register("minecraft:enderman_spawn_egg"); + public static final ItemType ENDERMITE_SPAWN_EGG = register("minecraft:endermite_spawn_egg"); + public static final ItemType EVOCATION_ILLAGER_SPAWN_EGG = register("minecraft:evocation_illager_spawn_egg"); + public static final ItemType EXPERIENCE_BOTTLE = register("minecraft:experience_bottle"); + public static final ItemType FARMLAND = register("minecraft:farmland"); + public static final ItemType FEATHER = register("minecraft:feather"); + public static final ItemType FERMENTED_SPIDER_EYE = register("minecraft:fermented_spider_eye"); + public static final ItemType FERN = register("minecraft:fern"); + public static final ItemType FILLED_MAP = register("minecraft:filled_map"); + public static final ItemType FIRE_CHARGE = register("minecraft:fire_charge"); + public static final ItemType FIRE_CORAL = register("minecraft:fire_coral"); + public static final ItemType FIRE_CORAL_BLOCK = register("minecraft:fire_coral_block"); + public static final ItemType FIRE_CORAL_FAN = register("minecraft:fire_coral_fan"); + public static final ItemType FIREWORK_ROCKET = register("minecraft:firework_rocket"); + public static final ItemType FIREWORK_STAR = register("minecraft:firework_star"); + public static final ItemType FISHING_ROD = register("minecraft:fishing_rod"); + public static final ItemType FLINT = register("minecraft:flint"); + public static final ItemType FLINT_AND_STEEL = register("minecraft:flint_and_steel"); + public static final ItemType FLOWER_POT = register("minecraft:flower_pot"); + public static final ItemType FURNACE = register("minecraft:furnace"); + public static final ItemType FURNACE_MINECART = register("minecraft:furnace_minecart"); + public static final ItemType GHAST_SPAWN_EGG = register("minecraft:ghast_spawn_egg"); + public static final ItemType GHAST_TEAR = register("minecraft:ghast_tear"); + public static final ItemType GLASS = register("minecraft:glass"); + public static final ItemType GLASS_BOTTLE = register("minecraft:glass_bottle"); + public static final ItemType GLASS_PANE = register("minecraft:glass_pane"); + public static final ItemType GLISTERING_MELON_SLICE = register("minecraft:glistering_melon_slice"); + public static final ItemType GLOWSTONE = register("minecraft:glowstone"); + public static final ItemType GLOWSTONE_DUST = register("minecraft:glowstone_dust"); + public static final ItemType GOLD_BLOCK = register("minecraft:gold_block"); + public static final ItemType GOLD_INGOT = register("minecraft:gold_ingot"); + public static final ItemType GOLD_NUGGET = register("minecraft:gold_nugget"); + public static final ItemType GOLD_ORE = register("minecraft:gold_ore"); + public static final ItemType GOLDEN_APPLE = register("minecraft:golden_apple"); + public static final ItemType GOLDEN_AXE = register("minecraft:golden_axe"); + public static final ItemType GOLDEN_BOOTS = register("minecraft:golden_boots"); + public static final ItemType GOLDEN_CARROT = register("minecraft:golden_carrot"); + public static final ItemType GOLDEN_CHESTPLATE = register("minecraft:golden_chestplate"); + public static final ItemType GOLDEN_HELMET = register("minecraft:golden_helmet"); + public static final ItemType GOLDEN_HOE = register("minecraft:golden_hoe"); + public static final ItemType GOLDEN_HORSE_ARMOR = register("minecraft:golden_horse_armor"); + public static final ItemType GOLDEN_LEGGINGS = register("minecraft:golden_leggings"); + public static final ItemType GOLDEN_PICKAXE = register("minecraft:golden_pickaxe"); + public static final ItemType GOLDEN_SHOVEL = register("minecraft:golden_shovel"); + public static final ItemType GOLDEN_SWORD = register("minecraft:golden_sword"); + public static final ItemType GRANITE = register("minecraft:granite"); + public static final ItemType GRASS = register("minecraft:grass"); + public static final ItemType GRASS_BLOCK = register("minecraft:grass_block"); + public static final ItemType GRASS_PATH = register("minecraft:grass_path"); + public static final ItemType GRAVEL = register("minecraft:gravel"); + public static final ItemType GRAY_BANNER = register("minecraft:gray_banner"); + public static final ItemType GRAY_CARPET = register("minecraft:gray_carpet"); + public static final ItemType GRAY_CONCRETE = register("minecraft:gray_concrete"); + public static final ItemType GRAY_CONCRETE_POWDER = register("minecraft:gray_concrete_powder"); + public static final ItemType GRAY_DYE = register("minecraft:gray_dye"); + public static final ItemType GRAY_GLAZED_TERRACOTTA = register("minecraft:gray_glazed_terracotta"); + public static final ItemType GRAY_STAINED_GLASS = register("minecraft:gray_stained_glass"); + public static final ItemType GRAY_STAINED_GLASS_PANE = register("minecraft:gray_stained_glass_pane"); + public static final ItemType GRAY_TERRACOTTA = register("minecraft:gray_terracotta"); + public static final ItemType GRAY_WOOL = register("minecraft:gray_wool"); + public static final ItemType GREEN_BANNER = register("minecraft:green_banner"); + public static final ItemType GREEN_CARPET = register("minecraft:green_carpet"); + public static final ItemType GREEN_CONCRETE = register("minecraft:green_concrete"); + public static final ItemType GREEN_CONCRETE_POWDER = register("minecraft:green_concrete_powder"); + public static final ItemType GREEN_GLAZED_TERRACOTTA = register("minecraft:green_glazed_terracotta"); + public static final ItemType GREEN_STAINED_GLASS = register("minecraft:green_stained_glass"); + public static final ItemType GREEN_STAINED_GLASS_PANE = register("minecraft:green_stained_glass_pane"); + public static final ItemType GREEN_TERRACOTTA = register("minecraft:green_terracotta"); + public static final ItemType GREEN_WOOL = register("minecraft:green_wool"); + public static final ItemType GUARDIAN_SPAWN_EGG = register("minecraft:guardian_spawn_egg"); + public static final ItemType GUNPOWDER = register("minecraft:gunpowder"); + public static final ItemType HAY_BLOCK = register("minecraft:hay_block"); + public static final ItemType HEART_OF_THE_SEA = register("minecraft:heart_of_the_sea"); + public static final ItemType HEAVY_WEIGHTED_PRESSURE_PLATE = register("minecraft:heavy_weighted_pressure_plate"); + public static final ItemType HOPPER = register("minecraft:hopper"); + public static final ItemType HOPPER_MINECART = register("minecraft:hopper_minecart"); + public static final ItemType HORN_CORAL = register("minecraft:horn_coral"); + public static final ItemType HORN_CORAL_BLOCK = register("minecraft:horn_coral_block"); + public static final ItemType HORN_CORAL_FAN = register("minecraft:horn_coral_fan"); + public static final ItemType HORSE_SPAWN_EGG = register("minecraft:horse_spawn_egg"); + public static final ItemType HUSK_SPAWN_EGG = register("minecraft:husk_spawn_egg"); + public static final ItemType ICE = register("minecraft:ice"); + public static final ItemType INFESTED_CHISELED_STONE_BRICKS = register("minecraft:infested_chiseled_stone_bricks"); + public static final ItemType INFESTED_COBBLESTONE = register("minecraft:infested_cobblestone"); + public static final ItemType INFESTED_CRACKED_STONE_BRICKS = register("minecraft:infested_cracked_stone_bricks"); + public static final ItemType INFESTED_MOSSY_STONE_BRICKS = register("minecraft:infested_mossy_stone_bricks"); + public static final ItemType INFESTED_STONE = register("minecraft:infested_stone"); + public static final ItemType INFESTED_STONE_BRICKS = register("minecraft:infested_stone_bricks"); + public static final ItemType INK_SAC = register("minecraft:ink_sac"); + public static final ItemType IRON_AXE = register("minecraft:iron_axe"); + public static final ItemType IRON_BARS = register("minecraft:iron_bars"); + public static final ItemType IRON_BLOCK = register("minecraft:iron_block"); + public static final ItemType IRON_BOOTS = register("minecraft:iron_boots"); + public static final ItemType IRON_CHESTPLATE = register("minecraft:iron_chestplate"); + public static final ItemType IRON_HELMET = register("minecraft:iron_helmet"); + public static final ItemType IRON_HOE = register("minecraft:iron_hoe"); + public static final ItemType IRON_HORSE_ARMOR = register("minecraft:iron_horse_armor"); + public static final ItemType IRON_INGOT = register("minecraft:iron_ingot"); + public static final ItemType IRON_LEGGINGS = register("minecraft:iron_leggings"); + public static final ItemType IRON_NUGGET = register("minecraft:iron_nugget"); + public static final ItemType IRON_ORE = register("minecraft:iron_ore"); + public static final ItemType IRON_PICKAXE = register("minecraft:iron_pickaxe"); + public static final ItemType IRON_SHOVEL = register("minecraft:iron_shovel"); + public static final ItemType IRON_SWORD = register("minecraft:iron_sword"); + public static final ItemType IRON_TRAPDOOR = register("minecraft:iron_trapdoor"); + public static final ItemType ITEM_FRAME = register("minecraft:item_frame"); + public static final ItemType JACK_O_LANTERN = register("minecraft:jack_o_lantern"); + public static final ItemType JUKEBOX = register("minecraft:jukebox"); + public static final ItemType JUNGLE_BARK = register("minecraft:jungle_bark"); + public static final ItemType JUNGLE_BOAT = register("minecraft:jungle_boat"); + public static final ItemType JUNGLE_BUTTON = register("minecraft:jungle_button"); + public static final ItemType JUNGLE_FENCE = register("minecraft:jungle_fence"); + public static final ItemType JUNGLE_FENCE_GATE = register("minecraft:jungle_fence_gate"); + public static final ItemType JUNGLE_LEAVES = register("minecraft:jungle_leaves"); + public static final ItemType JUNGLE_LOG = register("minecraft:jungle_log"); + public static final ItemType JUNGLE_PLANKS = register("minecraft:jungle_planks"); + public static final ItemType JUNGLE_PRESSURE_PLATE = register("minecraft:jungle_pressure_plate"); + public static final ItemType JUNGLE_SAPLING = register("minecraft:jungle_sapling"); + public static final ItemType JUNGLE_SLAB = register("minecraft:jungle_slab"); + public static final ItemType JUNGLE_STAIRS = register("minecraft:jungle_stairs"); + public static final ItemType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor"); + public static final ItemType KELP = register("minecraft:kelp"); + public static final ItemType KNOWLEDGE_BOOK = register("minecraft:knowledge_book"); + public static final ItemType LADDER = register("minecraft:ladder"); + public static final ItemType LAPIS_BLOCK = register("minecraft:lapis_block"); + public static final ItemType LAPIS_LAZULI = register("minecraft:lapis_lazuli"); + public static final ItemType LAPIS_ORE = register("minecraft:lapis_ore"); + public static final ItemType LAVA_BUCKET = register("minecraft:lava_bucket"); + public static final ItemType LEAD = register("minecraft:lead"); + public static final ItemType LEATHER = register("minecraft:leather"); + public static final ItemType LEATHER_BOOTS = register("minecraft:leather_boots"); + public static final ItemType LEATHER_CHESTPLATE = register("minecraft:leather_chestplate"); + public static final ItemType LEATHER_HELMET = register("minecraft:leather_helmet"); + public static final ItemType LEATHER_LEGGINGS = register("minecraft:leather_leggings"); + public static final ItemType LEVER = register("minecraft:lever"); + public static final ItemType LIGHT_BLUE_BANNER = register("minecraft:light_blue_banner"); + public static final ItemType LIGHT_BLUE_CARPET = register("minecraft:light_blue_carpet"); + public static final ItemType LIGHT_BLUE_CONCRETE = register("minecraft:light_blue_concrete"); + public static final ItemType LIGHT_BLUE_CONCRETE_POWDER = register("minecraft:light_blue_concrete_powder"); + public static final ItemType LIGHT_BLUE_DYE = register("minecraft:light_blue_dye"); + public static final ItemType LIGHT_BLUE_GLAZED_TERRACOTTA = register("minecraft:light_blue_glazed_terracotta"); + public static final ItemType LIGHT_BLUE_STAINED_GLASS = register("minecraft:light_blue_stained_glass"); + public static final ItemType LIGHT_BLUE_STAINED_GLASS_PANE = register("minecraft:light_blue_stained_glass_pane"); + public static final ItemType LIGHT_BLUE_TERRACOTTA = register("minecraft:light_blue_terracotta"); + public static final ItemType LIGHT_BLUE_WOOL = register("minecraft:light_blue_wool"); + public static final ItemType LIGHT_GRAY_BANNER = register("minecraft:light_gray_banner"); + public static final ItemType LIGHT_GRAY_CARPET = register("minecraft:light_gray_carpet"); + public static final ItemType LIGHT_GRAY_CONCRETE = register("minecraft:light_gray_concrete"); + public static final ItemType LIGHT_GRAY_CONCRETE_POWDER = register("minecraft:light_gray_concrete_powder"); + public static final ItemType LIGHT_GRAY_DYE = register("minecraft:light_gray_dye"); + public static final ItemType LIGHT_GRAY_GLAZED_TERRACOTTA = register("minecraft:light_gray_glazed_terracotta"); + public static final ItemType LIGHT_GRAY_STAINED_GLASS = register("minecraft:light_gray_stained_glass"); + public static final ItemType LIGHT_GRAY_STAINED_GLASS_PANE = register("minecraft:light_gray_stained_glass_pane"); + public static final ItemType LIGHT_GRAY_TERRACOTTA = register("minecraft:light_gray_terracotta"); + public static final ItemType LIGHT_GRAY_WOOL = register("minecraft:light_gray_wool"); + public static final ItemType LIGHT_WEIGHTED_PRESSURE_PLATE = register("minecraft:light_weighted_pressure_plate"); + public static final ItemType LIME_BANNER = register("minecraft:lime_banner"); + public static final ItemType LIME_CARPET = register("minecraft:lime_carpet"); + public static final ItemType LIME_CONCRETE = register("minecraft:lime_concrete"); + public static final ItemType LIME_CONCRETE_POWDER = register("minecraft:lime_concrete_powder"); + public static final ItemType LIME_DYE = register("minecraft:lime_dye"); + public static final ItemType LIME_GLAZED_TERRACOTTA = register("minecraft:lime_glazed_terracotta"); + public static final ItemType LIME_STAINED_GLASS = register("minecraft:lime_stained_glass"); + public static final ItemType LIME_STAINED_GLASS_PANE = register("minecraft:lime_stained_glass_pane"); + public static final ItemType LIME_TERRACOTTA = register("minecraft:lime_terracotta"); + public static final ItemType LIME_WOOL = register("minecraft:lime_wool"); + public static final ItemType LINGERING_POTION = register("minecraft:lingering_potion"); + public static final ItemType LLAMA_SPAWN_EGG = register("minecraft:llama_spawn_egg"); + public static final ItemType MAGENTA_BANNER = register("minecraft:magenta_banner"); + public static final ItemType MAGENTA_CARPET = register("minecraft:magenta_carpet"); + public static final ItemType MAGENTA_CONCRETE = register("minecraft:magenta_concrete"); + public static final ItemType MAGENTA_CONCRETE_POWDER = register("minecraft:magenta_concrete_powder"); + public static final ItemType MAGENTA_DYE = register("minecraft:magenta_dye"); + public static final ItemType MAGENTA_GLAZED_TERRACOTTA = register("minecraft:magenta_glazed_terracotta"); + public static final ItemType MAGENTA_STAINED_GLASS = register("minecraft:magenta_stained_glass"); + public static final ItemType MAGENTA_STAINED_GLASS_PANE = register("minecraft:magenta_stained_glass_pane"); + public static final ItemType MAGENTA_TERRACOTTA = register("minecraft:magenta_terracotta"); + public static final ItemType MAGENTA_WOOL = register("minecraft:magenta_wool"); + public static final ItemType MAGMA_BLOCK = register("minecraft:magma_block"); + public static final ItemType MAGMA_CREAM = register("minecraft:magma_cream"); + public static final ItemType MAGMA_CUBE_SPAWN_EGG = register("minecraft:magma_cube_spawn_egg"); + public static final ItemType MAP = register("minecraft:map"); + public static final ItemType MELON = register("minecraft:melon"); + public static final ItemType MELON_SEEDS = register("minecraft:melon_seeds"); + public static final ItemType MELON_SLICE = register("minecraft:melon_slice"); + public static final ItemType MILK_BUCKET = register("minecraft:milk_bucket"); + public static final ItemType MINECART = register("minecraft:minecart"); + public static final ItemType MOB_SPAWNER = register("minecraft:mob_spawner"); + public static final ItemType MOOSHROOM_SPAWN_EGG = register("minecraft:mooshroom_spawn_egg"); + public static final ItemType MOSSY_COBBLESTONE = register("minecraft:mossy_cobblestone"); + public static final ItemType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall"); + public static final ItemType MOSSY_STONE_BRICKS = register("minecraft:mossy_stone_bricks"); + public static final ItemType MULE_SPAWN_EGG = register("minecraft:mule_spawn_egg"); + public static final ItemType MUSHROOM_STEM = register("minecraft:mushroom_stem"); + public static final ItemType MUSHROOM_STEW = register("minecraft:mushroom_stew"); + public static final ItemType MUSIC_DISC_11 = register("minecraft:music_disc_11"); + public static final ItemType MUSIC_DISC_13 = register("minecraft:music_disc_13"); + public static final ItemType MUSIC_DISC_BLOCKS = register("minecraft:music_disc_blocks"); + public static final ItemType MUSIC_DISC_CAT = register("minecraft:music_disc_cat"); + public static final ItemType MUSIC_DISC_CHIRP = register("minecraft:music_disc_chirp"); + public static final ItemType MUSIC_DISC_FAR = register("minecraft:music_disc_far"); + public static final ItemType MUSIC_DISC_MALL = register("minecraft:music_disc_mall"); + public static final ItemType MUSIC_DISC_MELLOHI = register("minecraft:music_disc_mellohi"); + public static final ItemType MUSIC_DISC_STAL = register("minecraft:music_disc_stal"); + public static final ItemType MUSIC_DISC_STRAD = register("minecraft:music_disc_strad"); + public static final ItemType MUSIC_DISC_WAIT = register("minecraft:music_disc_wait"); + public static final ItemType MUSIC_DISC_WARD = register("minecraft:music_disc_ward"); + public static final ItemType MUTTON = register("minecraft:mutton"); + public static final ItemType MYCELIUM = register("minecraft:mycelium"); + public static final ItemType NAME_TAG = register("minecraft:name_tag"); + public static final ItemType NAUTILUS_SHELL = register("minecraft:nautilus_shell"); + public static final ItemType NETHER_BRICK = register("minecraft:nether_brick"); + public static final ItemType NETHER_BRICK_FENCE = register("minecraft:nether_brick_fence"); + public static final ItemType NETHER_BRICK_SLAB = register("minecraft:nether_brick_slab"); + public static final ItemType NETHER_BRICK_STAIRS = register("minecraft:nether_brick_stairs"); + public static final ItemType NETHER_BRICKS = register("minecraft:nether_bricks"); + public static final ItemType NETHER_QUARTZ_ORE = register("minecraft:nether_quartz_ore"); + public static final ItemType NETHER_STAR = register("minecraft:nether_star"); + public static final ItemType NETHER_WART = register("minecraft:nether_wart"); + public static final ItemType NETHER_WART_BLOCK = register("minecraft:nether_wart_block"); + public static final ItemType NETHERRACK = register("minecraft:netherrack"); + public static final ItemType NOTE_BLOCK = register("minecraft:note_block"); + public static final ItemType OAK_BARK = register("minecraft:oak_bark"); + public static final ItemType OAK_BOAT = register("minecraft:oak_boat"); + public static final ItemType OAK_BUTTON = register("minecraft:oak_button"); + public static final ItemType OAK_FENCE = register("minecraft:oak_fence"); + public static final ItemType OAK_FENCE_GATE = register("minecraft:oak_fence_gate"); + public static final ItemType OAK_LEAVES = register("minecraft:oak_leaves"); + public static final ItemType OAK_LOG = register("minecraft:oak_log"); + public static final ItemType OAK_PLANKS = register("minecraft:oak_planks"); + public static final ItemType OAK_PRESSURE_PLATE = register("minecraft:oak_pressure_plate"); + public static final ItemType OAK_SAPLING = register("minecraft:oak_sapling"); + public static final ItemType OAK_SLAB = register("minecraft:oak_slab"); + public static final ItemType OAK_STAIRS = register("minecraft:oak_stairs"); + public static final ItemType OAK_TRAPDOOR = register("minecraft:oak_trapdoor"); + public static final ItemType OBSERVER = register("minecraft:observer"); + public static final ItemType OBSIDIAN = register("minecraft:obsidian"); + public static final ItemType OCELOT_SPAWN_EGG = register("minecraft:ocelot_spawn_egg"); + public static final ItemType ORANGE_BANNER = register("minecraft:orange_banner"); + public static final ItemType ORANGE_CARPET = register("minecraft:orange_carpet"); + public static final ItemType ORANGE_CONCRETE = register("minecraft:orange_concrete"); + public static final ItemType ORANGE_CONCRETE_POWDER = register("minecraft:orange_concrete_powder"); + public static final ItemType ORANGE_DYE = register("minecraft:orange_dye"); + public static final ItemType ORANGE_GLAZED_TERRACOTTA = register("minecraft:orange_glazed_terracotta"); + public static final ItemType ORANGE_STAINED_GLASS = register("minecraft:orange_stained_glass"); + public static final ItemType ORANGE_STAINED_GLASS_PANE = register("minecraft:orange_stained_glass_pane"); + public static final ItemType ORANGE_TERRACOTTA = register("minecraft:orange_terracotta"); + public static final ItemType ORANGE_TULIP = register("minecraft:orange_tulip"); + public static final ItemType ORANGE_WOOL = register("minecraft:orange_wool"); + public static final ItemType OXEYE_DAISY = register("minecraft:oxeye_daisy"); + public static final ItemType PACKED_ICE = register("minecraft:packed_ice"); + public static final ItemType PAINTING = register("minecraft:painting"); + public static final ItemType PAPER = register("minecraft:paper"); + public static final ItemType PARROT_SPAWN_EGG = register("minecraft:parrot_spawn_egg"); + public static final ItemType PETRIFIED_OAK_SLAB = register("minecraft:petrified_oak_slab"); + public static final ItemType PHANTOM_MEMBRANE = register("minecraft:phantom_membrane"); + public static final ItemType PHANTOM_SPAWN_EGG = register("minecraft:phantom_spawn_egg"); + public static final ItemType PIG_SPAWN_EGG = register("minecraft:pig_spawn_egg"); + public static final ItemType PINK_BANNER = register("minecraft:pink_banner"); + public static final ItemType PINK_CARPET = register("minecraft:pink_carpet"); + public static final ItemType PINK_CONCRETE = register("minecraft:pink_concrete"); + public static final ItemType PINK_CONCRETE_POWDER = register("minecraft:pink_concrete_powder"); + public static final ItemType PINK_DYE = register("minecraft:pink_dye"); + public static final ItemType PINK_GLAZED_TERRACOTTA = register("minecraft:pink_glazed_terracotta"); + public static final ItemType PINK_STAINED_GLASS = register("minecraft:pink_stained_glass"); + public static final ItemType PINK_STAINED_GLASS_PANE = register("minecraft:pink_stained_glass_pane"); + public static final ItemType PINK_TERRACOTTA = register("minecraft:pink_terracotta"); + public static final ItemType PINK_TULIP = register("minecraft:pink_tulip"); + public static final ItemType PINK_WOOL = register("minecraft:pink_wool"); + public static final ItemType PISTON = register("minecraft:piston"); + public static final ItemType PODZOL = register("minecraft:podzol"); + public static final ItemType POISONOUS_POTATO = register("minecraft:poisonous_potato"); + public static final ItemType POLAR_BEAR_SPAWN_EGG = register("minecraft:polar_bear_spawn_egg"); + public static final ItemType POLISHED_ANDESITE = register("minecraft:polished_andesite"); + public static final ItemType POLISHED_DIORITE = register("minecraft:polished_diorite"); + public static final ItemType POLISHED_GRANITE = register("minecraft:polished_granite"); + public static final ItemType POPPY = register("minecraft:poppy"); + public static final ItemType PORKCHOP = register("minecraft:porkchop"); + public static final ItemType POTATO = register("minecraft:potato"); + public static final ItemType POTION = register("minecraft:potion"); + public static final ItemType POWERED_RAIL = register("minecraft:powered_rail"); + public static final ItemType PRISMARINE = register("minecraft:prismarine"); + public static final ItemType PRISMARINE_BRICK_SLAB = register("minecraft:prismarine_brick_slab"); + public static final ItemType PRISMARINE_BRICK_STAIRS = register("minecraft:prismarine_brick_stairs"); + public static final ItemType PRISMARINE_BRICKS = register("minecraft:prismarine_bricks"); + public static final ItemType PRISMARINE_CRYSTALS = register("minecraft:prismarine_crystals"); + public static final ItemType PRISMARINE_SHARD = register("minecraft:prismarine_shard"); + public static final ItemType PRISMARINE_SLAB = register("minecraft:prismarine_slab"); + public static final ItemType PRISMARINE_STAIRS = register("minecraft:prismarine_stairs"); + public static final ItemType PUFFERFISH = register("minecraft:pufferfish"); + public static final ItemType PUFFERFISH_BUCKET = register("minecraft:pufferfish_bucket"); + public static final ItemType PUFFERFISH_SPAWN_EGG = register("minecraft:pufferfish_spawn_egg"); + public static final ItemType PUMPKIN = register("minecraft:pumpkin"); + public static final ItemType PUMPKIN_PIE = register("minecraft:pumpkin_pie"); + public static final ItemType PUMPKIN_SEEDS = register("minecraft:pumpkin_seeds"); + public static final ItemType PURPLE_BANNER = register("minecraft:purple_banner"); + public static final ItemType PURPLE_CARPET = register("minecraft:purple_carpet"); + public static final ItemType PURPLE_CONCRETE = register("minecraft:purple_concrete"); + public static final ItemType PURPLE_CONCRETE_POWDER = register("minecraft:purple_concrete_powder"); + public static final ItemType PURPLE_DYE = register("minecraft:purple_dye"); + public static final ItemType PURPLE_GLAZED_TERRACOTTA = register("minecraft:purple_glazed_terracotta"); + public static final ItemType PURPLE_STAINED_GLASS = register("minecraft:purple_stained_glass"); + public static final ItemType PURPLE_STAINED_GLASS_PANE = register("minecraft:purple_stained_glass_pane"); + public static final ItemType PURPLE_TERRACOTTA = register("minecraft:purple_terracotta"); + public static final ItemType PURPLE_WOOL = register("minecraft:purple_wool"); + public static final ItemType PURPUR_BLOCK = register("minecraft:purpur_block"); + public static final ItemType PURPUR_PILLAR = register("minecraft:purpur_pillar"); + public static final ItemType PURPUR_SLAB = register("minecraft:purpur_slab"); + public static final ItemType PURPUR_STAIRS = register("minecraft:purpur_stairs"); + public static final ItemType QUARTZ = register("minecraft:quartz"); + public static final ItemType QUARTZ_BLOCK = register("minecraft:quartz_block"); + public static final ItemType QUARTZ_PILLAR = register("minecraft:quartz_pillar"); + public static final ItemType QUARTZ_SLAB = register("minecraft:quartz_slab"); + public static final ItemType QUARTZ_STAIRS = register("minecraft:quartz_stairs"); + public static final ItemType RABBIT = register("minecraft:rabbit"); + public static final ItemType RABBIT_FOOT = register("minecraft:rabbit_foot"); + public static final ItemType RABBIT_HIDE = register("minecraft:rabbit_hide"); + public static final ItemType RABBIT_SPAWN_EGG = register("minecraft:rabbit_spawn_egg"); + public static final ItemType RABBIT_STEW = register("minecraft:rabbit_stew"); + public static final ItemType RAIL = register("minecraft:rail"); + public static final ItemType RED_BANNER = register("minecraft:red_banner"); + public static final ItemType RED_CARPET = register("minecraft:red_carpet"); + public static final ItemType RED_CONCRETE = register("minecraft:red_concrete"); + public static final ItemType RED_CONCRETE_POWDER = register("minecraft:red_concrete_powder"); + public static final ItemType RED_GLAZED_TERRACOTTA = register("minecraft:red_glazed_terracotta"); + public static final ItemType RED_MUSHROOM = register("minecraft:red_mushroom"); + public static final ItemType RED_MUSHROOM_BLOCK = register("minecraft:red_mushroom_block"); + public static final ItemType RED_NETHER_BRICKS = register("minecraft:red_nether_bricks"); + public static final ItemType RED_SAND = register("minecraft:red_sand"); + public static final ItemType RED_SANDSTONE = register("minecraft:red_sandstone"); + public static final ItemType RED_SANDSTONE_SLAB = register("minecraft:red_sandstone_slab"); + public static final ItemType RED_SANDSTONE_STAIRS = register("minecraft:red_sandstone_stairs"); + public static final ItemType RED_STAINED_GLASS = register("minecraft:red_stained_glass"); + public static final ItemType RED_STAINED_GLASS_PANE = register("minecraft:red_stained_glass_pane"); + public static final ItemType RED_TERRACOTTA = register("minecraft:red_terracotta"); + public static final ItemType RED_TULIP = register("minecraft:red_tulip"); + public static final ItemType RED_WOOL = register("minecraft:red_wool"); + public static final ItemType REDSTONE = register("minecraft:redstone"); + public static final ItemType REDSTONE_BLOCK = register("minecraft:redstone_block"); + public static final ItemType REDSTONE_LAMP = register("minecraft:redstone_lamp"); + public static final ItemType REDSTONE_ORE = register("minecraft:redstone_ore"); + public static final ItemType REPEATER = register("minecraft:repeater"); + public static final ItemType ROSE_RED = register("minecraft:rose_red"); + public static final ItemType ROTTEN_FLESH = register("minecraft:rotten_flesh"); + public static final ItemType SADDLE = register("minecraft:saddle"); + public static final ItemType SALMON = register("minecraft:salmon"); + public static final ItemType SALMON_BUCKET = register("minecraft:salmon_bucket"); + public static final ItemType SALMON_SPAWN_EGG = register("minecraft:salmon_spawn_egg"); + public static final ItemType SAND = register("minecraft:sand"); + public static final ItemType SANDSTONE = register("minecraft:sandstone"); + public static final ItemType SANDSTONE_SLAB = register("minecraft:sandstone_slab"); + public static final ItemType SANDSTONE_STAIRS = register("minecraft:sandstone_stairs"); + public static final ItemType SCUTE = register("minecraft:scute"); + public static final ItemType SEA_LANTERN = register("minecraft:sea_lantern"); + public static final ItemType SEA_PICKLE = register("minecraft:sea_pickle"); + public static final ItemType SEAGRASS = register("minecraft:seagrass"); + public static final ItemType SHEARS = register("minecraft:shears"); + public static final ItemType SHEEP_SPAWN_EGG = register("minecraft:sheep_spawn_egg"); + public static final ItemType SHIELD = register("minecraft:shield"); + public static final ItemType SHULKER_SHELL = register("minecraft:shulker_shell"); + public static final ItemType SHULKER_SPAWN_EGG = register("minecraft:shulker_spawn_egg"); + public static final ItemType SIGN = register("minecraft:sign"); + public static final ItemType SILVERFISH_SPAWN_EGG = register("minecraft:silverfish_spawn_egg"); + public static final ItemType SKELETON_HORSE_SPAWN_EGG = register("minecraft:skeleton_horse_spawn_egg"); + public static final ItemType SKELETON_SPAWN_EGG = register("minecraft:skeleton_spawn_egg"); + public static final ItemType SLIME_BALL = register("minecraft:slime_ball"); + public static final ItemType SLIME_BLOCK = register("minecraft:slime_block"); + public static final ItemType SLIME_SPAWN_EGG = register("minecraft:slime_spawn_egg"); + public static final ItemType SMOOTH_QUARTZ = register("minecraft:smooth_quartz"); + public static final ItemType SMOOTH_RED_SANDSTONE = register("minecraft:smooth_red_sandstone"); + public static final ItemType SMOOTH_SANDSTONE = register("minecraft:smooth_sandstone"); + public static final ItemType SMOOTH_STONE = register("minecraft:smooth_stone"); + public static final ItemType SNOW = register("minecraft:snow"); + public static final ItemType SNOW_BLOCK = register("minecraft:snow_block"); + public static final ItemType SNOWBALL = register("minecraft:snowball"); + public static final ItemType SOUL_SAND = register("minecraft:soul_sand"); + public static final ItemType SPECTRAL_ARROW = register("minecraft:spectral_arrow"); + public static final ItemType SPIDER_EYE = register("minecraft:spider_eye"); + public static final ItemType SPIDER_SPAWN_EGG = register("minecraft:spider_spawn_egg"); + public static final ItemType SPLASH_POTION = register("minecraft:splash_potion"); + public static final ItemType SPONGE = register("minecraft:sponge"); + public static final ItemType SPRUCE_BARK = register("minecraft:spruce_bark"); + public static final ItemType SPRUCE_BOAT = register("minecraft:spruce_boat"); + public static final ItemType SPRUCE_BUTTON = register("minecraft:spruce_button"); + public static final ItemType SPRUCE_FENCE = register("minecraft:spruce_fence"); + public static final ItemType SPRUCE_FENCE_GATE = register("minecraft:spruce_fence_gate"); + public static final ItemType SPRUCE_LEAVES = register("minecraft:spruce_leaves"); + public static final ItemType SPRUCE_LOG = register("minecraft:spruce_log"); + public static final ItemType SPRUCE_PLANKS = register("minecraft:spruce_planks"); + public static final ItemType SPRUCE_PRESSURE_PLATE = register("minecraft:spruce_pressure_plate"); + public static final ItemType SPRUCE_SAPLING = register("minecraft:spruce_sapling"); + public static final ItemType SPRUCE_SLAB = register("minecraft:spruce_slab"); + public static final ItemType SPRUCE_STAIRS = register("minecraft:spruce_stairs"); + public static final ItemType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor"); + public static final ItemType SQUID_SPAWN_EGG = register("minecraft:squid_spawn_egg"); + public static final ItemType STICK = register("minecraft:stick"); + public static final ItemType STICKY_PISTON = register("minecraft:sticky_piston"); + public static final ItemType STONE = register("minecraft:stone"); + public static final ItemType STONE_AXE = register("minecraft:stone_axe"); + public static final ItemType STONE_BRICK_SLAB = register("minecraft:stone_brick_slab"); + public static final ItemType STONE_BRICK_STAIRS = register("minecraft:stone_brick_stairs"); + public static final ItemType STONE_BRICKS = register("minecraft:stone_bricks"); + public static final ItemType STONE_BUTTON = register("minecraft:stone_button"); + public static final ItemType STONE_HOE = register("minecraft:stone_hoe"); + public static final ItemType STONE_PICKAXE = register("minecraft:stone_pickaxe"); + public static final ItemType STONE_PRESSURE_PLATE = register("minecraft:stone_pressure_plate"); + public static final ItemType STONE_SHOVEL = register("minecraft:stone_shovel"); + public static final ItemType STONE_SLAB = register("minecraft:stone_slab"); + public static final ItemType STONE_SWORD = register("minecraft:stone_sword"); + public static final ItemType STRAY_SPAWN_EGG = register("minecraft:stray_spawn_egg"); + public static final ItemType STRING = register("minecraft:string"); + public static final ItemType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log"); + public static final ItemType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log"); + public static final ItemType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log"); + public static final ItemType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log"); + public static final ItemType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log"); + public static final ItemType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log"); + public static final ItemType STRUCTURE_VOID = register("minecraft:structure_void"); + public static final ItemType SUGAR = register("minecraft:sugar"); + public static final ItemType SUGAR_CANE = register("minecraft:sugar_cane"); + public static final ItemType TERRACOTTA = register("minecraft:terracotta"); + public static final ItemType TIPPED_ARROW = register("minecraft:tipped_arrow"); + public static final ItemType TNT = register("minecraft:tnt"); + public static final ItemType TNT_MINECART = register("minecraft:tnt_minecart"); + public static final ItemType TOTEM_OF_UNDYING = register("minecraft:totem_of_undying"); + public static final ItemType TRAPPED_CHEST = register("minecraft:trapped_chest"); + public static final ItemType TRIDENT = register("minecraft:trident"); + public static final ItemType TRIPWIRE_HOOK = register("minecraft:tripwire_hook"); + public static final ItemType TROPICAL_FISH_SPAWN_EGG = register("minecraft:tropical_fish_spawn_egg"); + public static final ItemType TUBE_CORAL = register("minecraft:tube_coral"); + public static final ItemType TUBE_CORAL_BLOCK = register("minecraft:tube_coral_block"); + public static final ItemType TUBE_CORAL_FAN = register("minecraft:tube_coral_fan"); + public static final ItemType TURTLE_EGG = register("minecraft:turtle_egg"); + public static final ItemType TURTLE_HELMET = register("minecraft:turtle_helmet"); + public static final ItemType TURTLE_SPAWN_EGG = register("minecraft:turtle_spawn_egg"); + public static final ItemType VEX_SPAWN_EGG = register("minecraft:vex_spawn_egg"); + public static final ItemType VILLAGER_SPAWN_EGG = register("minecraft:villager_spawn_egg"); + public static final ItemType VINDICATION_ILLAGER_SPAWN_EGG = register("minecraft:vindication_illager_spawn_egg"); + public static final ItemType VINE = register("minecraft:vine"); + public static final ItemType WATER_BUCKET = register("minecraft:water_bucket"); + public static final ItemType WET_SPONGE = register("minecraft:wet_sponge"); + public static final ItemType WHEAT = register("minecraft:wheat"); + public static final ItemType WHEAT_SEEDS = register("minecraft:wheat_seeds"); + public static final ItemType WHITE_BANNER = register("minecraft:white_banner"); + public static final ItemType WHITE_CARPET = register("minecraft:white_carpet"); + public static final ItemType WHITE_CONCRETE = register("minecraft:white_concrete"); + public static final ItemType WHITE_CONCRETE_POWDER = register("minecraft:white_concrete_powder"); + public static final ItemType WHITE_GLAZED_TERRACOTTA = register("minecraft:white_glazed_terracotta"); + public static final ItemType WHITE_STAINED_GLASS = register("minecraft:white_stained_glass"); + public static final ItemType WHITE_STAINED_GLASS_PANE = register("minecraft:white_stained_glass_pane"); + public static final ItemType WHITE_TERRACOTTA = register("minecraft:white_terracotta"); + public static final ItemType WHITE_TULIP = register("minecraft:white_tulip"); + public static final ItemType WHITE_WOOL = register("minecraft:white_wool"); + public static final ItemType WITCH_SPAWN_EGG = register("minecraft:witch_spawn_egg"); + public static final ItemType WITHER_SKELETON_SPAWN_EGG = register("minecraft:wither_skeleton_spawn_egg"); + public static final ItemType WOLF_SPAWN_EGG = register("minecraft:wolf_spawn_egg"); + public static final ItemType WOODEN_AXE = register("minecraft:wooden_axe"); + public static final ItemType WOODEN_HOE = register("minecraft:wooden_hoe"); + public static final ItemType WOODEN_PICKAXE = register("minecraft:wooden_pickaxe"); + public static final ItemType WOODEN_SHOVEL = register("minecraft:wooden_shovel"); + public static final ItemType WOODEN_SWORD = register("minecraft:wooden_sword"); + public static final ItemType WRITABLE_BOOK = register("minecraft:writable_book"); + public static final ItemType WRITTEN_BOOK = register("minecraft:written_book"); + public static final ItemType YELLOW_BANNER = register("minecraft:yellow_banner"); + public static final ItemType YELLOW_CARPET = register("minecraft:yellow_carpet"); + public static final ItemType YELLOW_CONCRETE = register("minecraft:yellow_concrete"); + public static final ItemType YELLOW_CONCRETE_POWDER = register("minecraft:yellow_concrete_powder"); + public static final ItemType YELLOW_GLAZED_TERRACOTTA = register("minecraft:yellow_glazed_terracotta"); + public static final ItemType YELLOW_STAINED_GLASS = register("minecraft:yellow_stained_glass"); + public static final ItemType YELLOW_STAINED_GLASS_PANE = register("minecraft:yellow_stained_glass_pane"); + public static final ItemType YELLOW_TERRACOTTA = register("minecraft:yellow_terracotta"); + public static final ItemType YELLOW_WOOL = register("minecraft:yellow_wool"); + public static final ItemType ZOMBIE_HORSE_SPAWN_EGG = register("minecraft:zombie_horse_spawn_egg"); + public static final ItemType ZOMBIE_PIGMAN_SPAWN_EGG = register("minecraft:zombie_pigman_spawn_egg"); + public static final ItemType ZOMBIE_SPAWN_EGG = register("minecraft:zombie_spawn_egg"); + public static final ItemType ZOMBIE_VILLAGER_SPAWN_EGG = register("minecraft:zombie_villager_spawn_egg"); - private static final Map itemMapping = new HashMap<>(); - - static { - for (Field field : ItemTypes.class.getFields()) { - if (field.getType() == ItemType.class) { - try { - registerItem((ItemType) field.get(null)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } + private static ItemType register(final String id) { + return register(new ItemType(id)); } - public static void registerItem(ItemType itemType) { - if (itemMapping.containsKey(itemType.getId()) && !itemType.getId().startsWith("minecraft:")) { - throw new IllegalArgumentException("Existing item with this ID already registered"); - } - - itemMapping.put(itemType.getId(), itemType); + public static ItemType register(final ItemType item) { + return ItemType.REGISTRY.register(item.getId(), item); } @Nullable - public static ItemType getItemType(String id) { - // If it has no namespace, assume minecraft. - if (id != null && !id.contains(":")) { - id = "minecraft:" + id; - } - return itemMapping.get(id); + public static ItemType get(final String id) { + return ItemType.REGISTRY.get(id); } public static Collection values() { - return itemMapping.values(); + return ItemType.REGISTRY.values(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 0f82ab2e1..707cfc554 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -38,7 +38,7 @@ public class BundledBlockRegistry implements BlockRegistry { @Nullable @Override public BlockState createFromId(String id) { - return BlockTypes.getBlockType(id).getDefaultState(); + return BlockTypes.get(id).getDefaultState(); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java index 67f9e4015..c40ce80ec 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java @@ -33,6 +33,6 @@ public class BundledItemRegistry implements ItemRegistry { @Nullable @Override public BaseItem createFromId(String id) { - return new BaseItem(ItemTypes.getItemType(id)); + return new BaseItem(ItemTypes.get(id)); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index d85309bf3..d827ceca3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -93,7 +93,7 @@ public class LegacyMapper { for (Map.Entry itemEntry : dataFile.items.entrySet()) { try { - itemMap.put(itemEntry.getKey(), ItemTypes.getItemType(itemEntry.getValue())); + itemMap.put(itemEntry.getKey(), ItemTypes.get(itemEntry.getValue())); } catch (Exception e) { log.warning("Unknown item: " + itemEntry.getValue()); } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java index c7f93231f..216657581 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java @@ -32,7 +32,7 @@ public class ForgeItemRegistry implements ItemRegistry { public BaseItem createFromId(String id) { Item match = Item.REGISTRY.getObject(new ResourceLocation(id)); if (match != null) { - return new BaseItem(ItemTypes.getItemType(id)); + return new BaseItem(ItemTypes.get(id)); } else { return null; } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index 67f414137..8de41de5d 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -62,7 +62,7 @@ public class ForgePlayer extends AbstractPlayerActor { @Override public BaseItemStack getItemInHand(HandSide handSide) { ItemStack is = this.player.getHeldItem(handSide == HandSide.MAIN_HAND ? EnumHand.MAIN_HAND : EnumHand.OFF_HAND); - return new BaseItemStack(ItemTypes.getItemType(ForgeRegistries.ITEMS.getKey(is.getItem()).toString())); + return new BaseItemStack(ItemTypes.get(ForgeRegistries.ITEMS.getKey(is.getItem()).toString())); } @Override diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index e5aded401..ea0ded3ff 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -125,7 +125,7 @@ public class ForgeWorldEdit { } for (Block block : REGISTRY) { - BlockTypes.registerBlock(new BlockType(REGISTRY.getNameForObject(block).toString())); + BlockTypes.register(new BlockType(REGISTRY.getNameForObject(block).toString())); } } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index 5e180016d..0bfaa3b6f 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -66,7 +66,7 @@ public class SpongePlayer extends AbstractPlayerActor { public BaseItemStack getItemInHand(HandSide handSide) { Optional is = this.player.getItemInHand(handSide == HandSide.MAIN_HAND ? HandTypes.MAIN_HAND : HandTypes.OFF_HAND); - return is.map(itemStack -> new BaseItemStack(ItemTypes.getItemType(itemStack.getType().getId()))).orElse(null); + return is.map(itemStack -> new BaseItemStack(ItemTypes.get(itemStack.getType().getId()))).orElse(null); } @Override diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java index e09336309..f2ba77982 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java @@ -135,11 +135,11 @@ public class SpongeWorldEdit { for (BlockType blockType : Sponge.getRegistry().getAllOf(BlockType.class)) { // TODO Handle blockstate stuff - com.sk89q.worldedit.world.block.BlockTypes.registerBlock(new com.sk89q.worldedit.world.block.BlockType(blockType.getId())); + com.sk89q.worldedit.world.block.BlockTypes.register(new com.sk89q.worldedit.world.block.BlockType(blockType.getId())); } for (ItemType itemType : Sponge.getRegistry().getAllOf(ItemType.class)) { - ItemTypes.registerItem(new com.sk89q.worldedit.world.item.ItemType(itemType.getId())); + ItemTypes.register(new com.sk89q.worldedit.world.item.ItemType(itemType.getId())); } WorldEdit.getInstance().getPlatformManager().register(platform); From e1c2ea3a3bddda1ce68b8a7277dc46631467b6da Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 5 Jul 2018 23:22:33 +1000 Subject: [PATCH 34/74] Update configs, and remove unused BlockData methods. --- .../src/main/resources/defaults/config.yml | 66 +- .../sk89q/worldedit/LocalConfiguration.java | 2 +- .../com/sk89q/worldedit/blocks/BlockData.java | 1050 ----------------- .../com/sk89q/worldedit/blocks/BlockID.java | 28 - .../command/tool/BlockDataCyler.java | 23 +- .../worldedit/util/YAMLConfiguration.java | 2 +- .../sk89q/worldedit/CuboidClipboardTest.java | 38 - .../sk89q/worldedit/blocks/BlockDataTest.java | 64 - .../transform/BlockTransformExtentTest.java | 90 -- .../com/sk89q/worldedit/forge/ForgeWorld.java | 4 +- .../worldedit/forge/TileEntityBaseBlock.java | 6 +- .../resources/defaults/worldedit.properties | 6 +- .../config/ConfigurateConfiguration.java | 2 +- 13 files changed, 83 insertions(+), 1298 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockData.java delete mode 100644 worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java delete mode 100644 worldedit-core/src/test/java/com/sk89q/worldedit/blocks/BlockDataTest.java delete mode 100644 worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java diff --git a/worldedit-bukkit/src/main/resources/defaults/config.yml b/worldedit-bukkit/src/main/resources/defaults/config.yml index a0e0013ee..fd931081f 100644 --- a/worldedit-bukkit/src/main/resources/defaults/config.yml +++ b/worldedit-bukkit/src/main/resources/defaults/config.yml @@ -30,7 +30,67 @@ limits: butcher-radius: default: -1 maximum: -1 - disallowed-blocks: [6, 7, 14, 15, 16, 26, 27, 28, 29, 39, 31, 32, 33, 34, 36, 37, 38, 39, 40, 46, 50, 51, 56, 59, 69, 73, 74, 75, 76, 77, 81, 83, 137, 210, 211, 255] + disallowed-blocks: + - "minecraft:oak_sapling" + - "minecraft:jungle_sapling" + - "minecraft:dark_oak_sapling:" + - "minecraft:spruce_sapling" + - "minecraft:birch_sapling" + - "minecraft:acacia_sapling" + - "minecraft:black_bed" + - "minecraft:blue_bed" + - "minecraft:brown_bed" + - "minecraft:cyan_bed" + - "minecraft:gray_bed" + - "minecraft:green_bed" + - "minecraft:light_blue_bed" + - "minecraft:light_gray_bed" + - "minecraft:lime_bed" + - "minecraft:magenta_bed" + - "minecraft:orange_bed" + - "minecraft:pink_bed" + - "minecraft:purple_bed" + - "minecraft:red_bed" + - "minecraft:white_bed" + - "minecraft:yellow_bed" + - "minecraft:powered_rail" + - "minecraft:detector_rail" + - "minecraft:grass" + - "minecraft:dead_bush" + - "minecraft:moving_piston" + - "minecraft:piston_head" + - "minecraft:sunflower" + - "minecraft:rose_bush" + - "minecraft:dandelion" + - "minecraft:poppy" + - "minecraft:brown_mushroom" + - "minecraft:red_mushroom" + - "minecraft:tnt" + - "minecraft:torch" + - "minecraft:fire" + - "minecraft:redstone_wire" + - "minecraft:wheat" + - "minecraft:potatoes" + - "minecraft:carrots" + - "minecraft:melon_stem" + - "minecraft:pumpkin_stem" + - "minecraft:beetroots" + - "minecraft:rail" + - "minecraft:lever" + - "minecraft:redstone_torch" + - "minecraft:redstone_wall_torch" + - "minecraft:repeater" + - "minecraft:comparator" + - "minecraft:stone_button" + - "minecraft:birch_button" + - "minecraft:acacia_button" + - "minecraft:dark_oak_button" + - "minecraft:jungle_button" + - "minecraft:oak_button" + - "minecraft:spruce_button" + - "minecraft:cactus" + - "minecraft:sugar_cane" + - "minecraft:bedrock" use-inventory: enable: false @@ -60,7 +120,7 @@ snapshots: directory: navigation-wand: - item: 345 + item: minecraft:compass max-distance: 100 scripting: @@ -77,7 +137,7 @@ history: size: 15 expiration: 10 -wand-item: 271 +wand-item: minecraft:wooden_axe shell-save-type: no-double-slash: false no-op-permissions: false diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java index 8822c2a25..f6c2e9209 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java @@ -126,7 +126,7 @@ public abstract class LocalConfiguration { public String navigationWand = ItemTypes.COMPASS.getId(); public int navigationWandMaxDistance = 50; public int scriptTimeout = 3000; - public Set allowedDataCycleBlocks = new HashSet<>(); + public Set allowedDataCycleBlocks = new HashSet<>(); public String saveDir = "schematics"; public String scriptsDir = "craftscripts"; public boolean showHelpInfo = true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockData.java deleted file mode 100644 index ebdfae894..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockData.java +++ /dev/null @@ -1,1050 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import com.sk89q.worldedit.CuboidClipboard.FlipDirection; - -/** - * Block data related classes. - */ -public final class BlockData { - - private BlockData() { - } - - /** - * Rotate a block's data value 90 degrees (north->east->south->west->north); - * - * @param type the type ID of the bock - * @param data the data ID of the block - * @return the new data value - */ - public static int rotate90(int type, int data) { - switch (type) { - case BlockID.TORCH: - case BlockID.REDSTONE_TORCH_OFF: - case BlockID.REDSTONE_TORCH_ON: - switch (data) { - case 1: return 3; - case 2: return 4; - case 3: return 2; - case 4: return 1; - } - break; - - case BlockID.MINECART_TRACKS: - switch (data) { - case 6: return 7; - case 7: return 8; - case 8: return 9; - case 9: return 6; - } - /* FALL-THROUGH */ - - case BlockID.POWERED_RAIL: - case BlockID.DETECTOR_RAIL: - case BlockID.ACTIVATOR_RAIL: - switch (data & 0x7) { - case 0: return 1 | (data & ~0x7); - case 1: return 0 | (data & ~0x7); - case 2: return 5 | (data & ~0x7); - case 3: return 4 | (data & ~0x7); - case 4: return 2 | (data & ~0x7); - case 5: return 3 | (data & ~0x7); - } - break; - - case BlockID.OAK_WOOD_STAIRS: - case BlockID.COBBLESTONE_STAIRS: - case BlockID.BRICK_STAIRS: - case BlockID.STONE_BRICK_STAIRS: - case BlockID.NETHER_BRICK_STAIRS: - case BlockID.SANDSTONE_STAIRS: - case BlockID.SPRUCE_WOOD_STAIRS: - case BlockID.BIRCH_WOOD_STAIRS: - case BlockID.JUNGLE_WOOD_STAIRS: - case BlockID.QUARTZ_STAIRS: - case BlockID.ACACIA_STAIRS: - case BlockID.DARK_OAK_STAIRS: - switch (data) { - case 0: return 2; - case 1: return 3; - case 2: return 1; - case 3: return 0; - case 4: return 6; - case 5: return 7; - case 6: return 5; - case 7: return 4; - } - break; - - case BlockID.STONE_BUTTON: - case BlockID.WOODEN_BUTTON: { - int thrown = data & 0x8; - switch (data & ~0x8) { - case 1: return 3 | thrown; - case 2: return 4 | thrown; - case 3: return 2 | thrown; - case 4: return 1 | thrown; - // 0 and 5 are vertical - } - break; - } - - case BlockID.LEVER: { - int thrown = data & 0x8; - switch (data & ~0x8) { - case 1: return 3 | thrown; - case 2: return 4 | thrown; - case 3: return 2 | thrown; - case 4: return 1 | thrown; - case 5: return 6 | thrown; - case 6: return 5 | thrown; - case 7: return 0 | thrown; - case 0: return 7 | thrown; - } - break; - } - - case BlockID.WOODEN_DOOR: - case BlockID.IRON_DOOR: - if ((data & 0x8) != 0) { - // door top halves contain no orientation information - break; - } - - /* FALL-THROUGH */ - - case BlockID.COCOA_PLANT: - case BlockID.TRIPWIRE_HOOK: { - int extra = data & ~0x3; - int withoutFlags = data & 0x3; - switch (withoutFlags) { - case 0: return 1 | extra; - case 1: return 2 | extra; - case 2: return 3 | extra; - case 3: return 0 | extra; - } - break; - } - case BlockID.SIGN_POST: - return (data + 4) % 16; - - case BlockID.LADDER: - case BlockID.WALL_SIGN: - case BlockID.CHEST: - case BlockID.FURNACE: - case BlockID.BURNING_FURNACE: - case BlockID.ENDER_CHEST: - case BlockID.TRAPPED_CHEST: - case BlockID.HOPPER: { - int extra = data & 0x8; - int withoutFlags = data & ~0x8; - switch (withoutFlags) { - case 2: return 5 | extra; - case 3: return 4 | extra; - case 4: return 2 | extra; - case 5: return 3 | extra; - } - break; - } - case BlockID.DISPENSER: - case BlockID.DROPPER: - int dispPower = data & 0x8; - switch (data & ~0x8) { - case 2: return 5 | dispPower; - case 3: return 4 | dispPower; - case 4: return 2 | dispPower; - case 5: return 3 | dispPower; - } - break; - - case BlockID.PUMPKIN: - case BlockID.JACKOLANTERN: - switch (data) { - case 0: return 1; - case 1: return 2; - case 2: return 3; - case 3: return 0; - } - break; - - case BlockID.HAY_BLOCK: - case BlockID.LOG: - case BlockID.LOG2: - if (data >= 4 && data <= 11) data ^= 0xc; - break; - - case BlockID.COMPARATOR_OFF: - case BlockID.COMPARATOR_ON: - case BlockID.REDSTONE_REPEATER_OFF: - case BlockID.REDSTONE_REPEATER_ON: - int dir = data & 0x03; - int delay = data - dir; - switch (dir) { - case 0: return 1 | delay; - case 1: return 2 | delay; - case 2: return 3 | delay; - case 3: return 0 | delay; - } - break; - - case BlockID.TRAP_DOOR: - case BlockID.IRON_TRAP_DOOR: - int withoutOrientation = data & ~0x3; - int orientation = data & 0x3; - switch (orientation) { - case 0: return 3 | withoutOrientation; - case 1: return 2 | withoutOrientation; - case 2: return 0 | withoutOrientation; - case 3: return 1 | withoutOrientation; - } - break; - - case BlockID.PISTON_BASE: - case BlockID.PISTON_STICKY_BASE: - case BlockID.PISTON_EXTENSION: - final int rest = data & ~0x7; - switch (data & 0x7) { - case 2: return 5 | rest; - case 3: return 4 | rest; - case 4: return 2 | rest; - case 5: return 3 | rest; - } - break; - - case BlockID.BROWN_MUSHROOM_CAP: - case BlockID.RED_MUSHROOM_CAP: - if (data >= 10) return data; - return (data * 3) % 10; - - case BlockID.VINE: - return ((data << 1) | (data >> 3)) & 0xf; - - case BlockID.FENCE_GATE: - return ((data + 1) & 0x3) | (data & ~0x3); - - case BlockID.ANVIL: - int damage = data & ~0x3; - switch (data & 0x3) { - case 0: return 3 | damage; - case 2: return 1 | damage; - case 1: return 0 | damage; - case 3: return 2 | damage; - } - break; - - case BlockID.BED: - return data & ~0x3 | (data + 1) & 0x3; - - case BlockID.HEAD: - switch (data) { - case 2: return 5; - case 3: return 4; - case 4: return 2; - case 5: return 3; - } - } - - return data; - } - - /** - * Rotate a block's data value -90 degrees (north<-east<-south<-west<-north); - * - * @param type the type ID of the bock - * @param data the data ID of the block - * @return the new data value - */ - public static int rotate90Reverse(int type, int data) { - // case ([0-9]+): return ([0-9]+) -> case \2: return \1 - - switch (type) { - case BlockID.TORCH: - case BlockID.REDSTONE_TORCH_OFF: - case BlockID.REDSTONE_TORCH_ON: - switch (data) { - case 3: return 1; - case 4: return 2; - case 2: return 3; - case 1: return 4; - } - break; - - case BlockID.MINECART_TRACKS: - switch (data) { - case 7: return 6; - case 8: return 7; - case 9: return 8; - case 6: return 9; - } - /* FALL-THROUGH */ - - case BlockID.POWERED_RAIL: - case BlockID.DETECTOR_RAIL: - case BlockID.ACTIVATOR_RAIL: - int power = data & ~0x7; - switch (data & 0x7) { - case 1: return 0 | power; - case 0: return 1 | power; - case 5: return 2 | power; - case 4: return 3 | power; - case 2: return 4 | power; - case 3: return 5 | power; - } - break; - - case BlockID.OAK_WOOD_STAIRS: - case BlockID.COBBLESTONE_STAIRS: - case BlockID.BRICK_STAIRS: - case BlockID.STONE_BRICK_STAIRS: - case BlockID.NETHER_BRICK_STAIRS: - case BlockID.SANDSTONE_STAIRS: - case BlockID.SPRUCE_WOOD_STAIRS: - case BlockID.BIRCH_WOOD_STAIRS: - case BlockID.JUNGLE_WOOD_STAIRS: - case BlockID.QUARTZ_STAIRS: - case BlockID.ACACIA_STAIRS: - case BlockID.DARK_OAK_STAIRS: - switch (data) { - case 2: return 0; - case 3: return 1; - case 1: return 2; - case 0: return 3; - case 6: return 4; - case 7: return 5; - case 5: return 6; - case 4: return 7; - } - break; - - case BlockID.STONE_BUTTON: - case BlockID.WOODEN_BUTTON: { - int thrown = data & 0x8; - switch (data & ~0x8) { - case 3: return 1 | thrown; - case 4: return 2 | thrown; - case 2: return 3 | thrown; - case 1: return 4 | thrown; - // 0 and 5 are vertical - } - break; - } - - case BlockID.LEVER: { - int thrown = data & 0x8; - switch (data & ~0x8) { - case 3: return 1 | thrown; - case 4: return 2 | thrown; - case 2: return 3 | thrown; - case 1: return 4 | thrown; - case 6: return 5 | thrown; - case 5: return 6 | thrown; - case 0: return 7 | thrown; - case 7: return 0 | thrown; - } - break; - } - - case BlockID.WOODEN_DOOR: - case BlockID.IRON_DOOR: - if ((data & 0x8) != 0) { - // door top halves contain no orientation information - break; - } - - /* FALL-THROUGH */ - - case BlockID.COCOA_PLANT: - case BlockID.TRIPWIRE_HOOK: { - int extra = data & ~0x3; - int withoutFlags = data & 0x3; - switch (withoutFlags) { - case 1: return 0 | extra; - case 2: return 1 | extra; - case 3: return 2 | extra; - case 0: return 3 | extra; - } - break; - } - case BlockID.SIGN_POST: - return (data + 12) % 16; - - case BlockID.LADDER: - case BlockID.WALL_SIGN: - case BlockID.CHEST: - case BlockID.FURNACE: - case BlockID.BURNING_FURNACE: - case BlockID.ENDER_CHEST: - case BlockID.TRAPPED_CHEST: - case BlockID.HOPPER: { - int extra = data & 0x8; - int withoutFlags = data & ~0x8; - switch (withoutFlags) { - case 5: return 2 | extra; - case 4: return 3 | extra; - case 2: return 4 | extra; - case 3: return 5 | extra; - } - break; - } - case BlockID.DISPENSER: - case BlockID.DROPPER: - int dispPower = data & 0x8; - switch (data & ~0x8) { - case 5: return 2 | dispPower; - case 4: return 3 | dispPower; - case 2: return 4 | dispPower; - case 3: return 5 | dispPower; - } - break; - case BlockID.PUMPKIN: - case BlockID.JACKOLANTERN: - switch (data) { - case 1: return 0; - case 2: return 1; - case 3: return 2; - case 0: return 3; - } - break; - - case BlockID.HAY_BLOCK: - case BlockID.LOG: - case BlockID.LOG2: - if (data >= 4 && data <= 11) data ^= 0xc; - break; - - case BlockID.COMPARATOR_OFF: - case BlockID.COMPARATOR_ON: - case BlockID.REDSTONE_REPEATER_OFF: - case BlockID.REDSTONE_REPEATER_ON: - int dir = data & 0x03; - int delay = data - dir; - switch (dir) { - case 1: return 0 | delay; - case 2: return 1 | delay; - case 3: return 2 | delay; - case 0: return 3 | delay; - } - break; - - case BlockID.TRAP_DOOR: - case BlockID.IRON_TRAP_DOOR: - int withoutOrientation = data & ~0x3; - int orientation = data & 0x3; - switch (orientation) { - case 3: return 0 | withoutOrientation; - case 2: return 1 | withoutOrientation; - case 0: return 2 | withoutOrientation; - case 1: return 3 | withoutOrientation; - } - - case BlockID.PISTON_BASE: - case BlockID.PISTON_STICKY_BASE: - case BlockID.PISTON_EXTENSION: - final int rest = data & ~0x7; - switch (data & 0x7) { - case 5: return 2 | rest; - case 4: return 3 | rest; - case 2: return 4 | rest; - case 3: return 5 | rest; - } - break; - - case BlockID.BROWN_MUSHROOM_CAP: - case BlockID.RED_MUSHROOM_CAP: - if (data >= 10) return data; - return (data * 7) % 10; - - case BlockID.VINE: - return ((data >> 1) | (data << 3)) & 0xf; - - case BlockID.FENCE_GATE: - return ((data + 3) & 0x3) | (data & ~0x3); - - case BlockID.ANVIL: - int damage = data & ~0x3; - switch (data & 0x3) { - case 0: return 1 | damage; - case 2: return 3 | damage; - case 1: return 2 | damage; - case 3: return 0 | damage; - } - break; - - case BlockID.BED: - return data & ~0x3 | (data - 1) & 0x3; - - case BlockID.HEAD: - switch (data) { - case 2: return 4; - case 3: return 5; - case 4: return 3; - case 5: return 2; - } - } - - return data; - } - - /** - * Flip a block's data value. - * - * @param type the type ID of the bock - * @param data the data ID of the block - * @return the new data value - */ - public static int flip(int type, int data) { - return rotate90(type, rotate90(type, data)); - } - - /** - * Flip a block's data value. - * - * @param type the type ID of the bock - * @param data the data ID of the block - * @param direction the direction to flip - * @return the new data value - */ - public static int flip(int type, int data, FlipDirection direction) { - int flipX = 0; - int flipY = 0; - int flipZ = 0; - - switch (direction) { - case NORTH_SOUTH: - flipZ = 1; - break; - - case WEST_EAST: - flipX = 1; - break; - - case UP_DOWN: - flipY = 1; - break; - } - - switch (type) { - case BlockID.TORCH: - case BlockID.REDSTONE_TORCH_OFF: - case BlockID.REDSTONE_TORCH_ON: - if (data < 1 || data > 4) break; - switch (data) { - case 1: return data + flipX; - case 2: return data - flipX; - case 3: return data + flipZ; - case 4: return data - flipZ; - } - break; - - case BlockID.STONE_BUTTON: - case BlockID.WOODEN_BUTTON: { - switch (data & ~0x8) { - case 1: return data + flipX; - case 2: return data - flipX; - case 3: return data + flipZ; - case 4: return data - flipZ; - case 0: - case 5: - return data ^ (flipY * 5); - } - break; - } - - case BlockID.LEVER: - switch (data & ~0x8) { - case 1: return data + flipX; - case 2: return data - flipX; - case 3: return data + flipZ; - case 4: return data - flipZ; - case 5: - case 7: - return data ^ flipY << 1; - case 6: - case 0: - return data ^ flipY * 6; - } - break; - - case BlockID.MINECART_TRACKS: - switch (data) { - case 6: return data + flipX + flipZ * 3; - case 7: return data - flipX + flipZ; - case 8: return data + flipX - flipZ; - case 9: return data - flipX - flipZ * 3; - } - /* FALL-THROUGH */ - - case BlockID.POWERED_RAIL: - case BlockID.DETECTOR_RAIL: - case BlockID.ACTIVATOR_RAIL: - switch (data & 0x7) { - case 0: - case 1: - return data; - case 2: - case 3: - return data ^ flipX; - case 4: - case 5: - return data ^ flipZ; - } - break; - - case BlockID.STEP: - case BlockID.WOODEN_STEP: - return data ^ (flipY << 3); - - case BlockID.OAK_WOOD_STAIRS: - case BlockID.COBBLESTONE_STAIRS: - case BlockID.BRICK_STAIRS: - case BlockID.STONE_BRICK_STAIRS: - case BlockID.NETHER_BRICK_STAIRS: - case BlockID.SANDSTONE_STAIRS: - case BlockID.SPRUCE_WOOD_STAIRS: - case BlockID.BIRCH_WOOD_STAIRS: - case BlockID.JUNGLE_WOOD_STAIRS: - case BlockID.QUARTZ_STAIRS: - case BlockID.ACACIA_STAIRS: - case BlockID.DARK_OAK_STAIRS: - data ^= flipY << 2; - switch (data) { - case 0: - case 1: - case 4: - case 5: - return data ^ flipX; - case 2: - case 3: - case 6: - case 7: - return data ^ flipZ; - } - break; - - case BlockID.WOODEN_DOOR: - case BlockID.IRON_DOOR: - if ((data & 0x8) != 0) { - // door top halves contain no orientation information - break; - } - - switch (data & 0x3) { - case 0: return data + flipX + flipZ * 3; - case 1: return data - flipX + flipZ; - case 2: return data + flipX - flipZ; - case 3: return data - flipX - flipZ * 3; - } - break; - - case BlockID.SIGN_POST: - switch (direction) { - case NORTH_SOUTH: - return (16 - data) & 0xf; - case WEST_EAST: - return (8 - data) & 0xf; - default: - } - break; - - case BlockID.LADDER: - case BlockID.WALL_SIGN: - case BlockID.CHEST: - case BlockID.FURNACE: - case BlockID.BURNING_FURNACE: - case BlockID.ENDER_CHEST: - case BlockID.TRAPPED_CHEST: - case BlockID.HOPPER: - int extra = data & 0x8; - int withoutFlags = data & ~0x8; - switch (withoutFlags) { - case 2: - case 3: - return (data ^ flipZ) | extra; - case 4: - case 5: - return (data ^ flipX) | extra; - } - break; - - case BlockID.DROPPER: - case BlockID.DISPENSER: - int dispPower = data & 0x8; - switch (data & ~0x8) { - case 2: - case 3: - return (data ^ flipZ) | dispPower; - case 4: - case 5: - return (data ^ flipX) | dispPower; - case 0: - case 1: - return (data ^ flipY) | dispPower; - } - break; - - case BlockID.PUMPKIN: - case BlockID.JACKOLANTERN: - if (data > 3) break; - /* FALL-THROUGH */ - - case BlockID.REDSTONE_REPEATER_OFF: - case BlockID.REDSTONE_REPEATER_ON: - case BlockID.COMPARATOR_OFF: - case BlockID.COMPARATOR_ON: - case BlockID.COCOA_PLANT: - case BlockID.TRIPWIRE_HOOK: - switch (data & 0x3) { - case 0: - case 2: - return data ^ (flipZ << 1); - case 1: - case 3: - return data ^ (flipX << 1); - } - break; - - case BlockID.TRAP_DOOR: - case BlockID.IRON_TRAP_DOOR: - switch (data & 0x3) { - case 0: - case 1: - return data ^ flipZ; - case 2: - case 3: - return data ^ flipX; - } - break; - - case BlockID.PISTON_BASE: - case BlockID.PISTON_STICKY_BASE: - case BlockID.PISTON_EXTENSION: - switch (data & ~0x8) { - case 0: - case 1: - return data ^ flipY; - case 2: - case 3: - return data ^ flipZ; - case 4: - case 5: - return data ^ flipX; - } - break; - - case BlockID.RED_MUSHROOM_CAP: - case BlockID.BROWN_MUSHROOM_CAP: - switch (data) { - case 1: - case 4: - case 7: - data += flipX * 2; - break; - case 3: - case 6: - case 9: - data -= flipX * 2; - break; - } - switch (data) { - case 1: - case 2: - case 3: - return data + flipZ * 6; - case 7: - case 8: - case 9: - return data - flipZ * 6; - } - break; - - case BlockID.VINE: - final int bit1, bit2; - switch (direction) { - case NORTH_SOUTH: - bit1 = 0x2; - bit2 = 0x8; - break; - case WEST_EAST: - bit1 = 0x1; - bit2 = 0x4; - break; - default: - return data; - } - int newData = data & ~(bit1 | bit2); - if ((data & bit1) != 0) newData |= bit2; - if ((data & bit2) != 0) newData |= bit1; - return newData; - - case BlockID.FENCE_GATE: - switch (data & 0x3) { - case 0: - case 2: - return data ^ flipZ << 1; - case 1: - case 3: - return data ^ flipX << 1; - } - break; - - case BlockID.BED: - switch (data & 0x3) { - case 0: - case 2: - return data ^ flipZ << 1; - case 1: - case 3: - return data ^ flipX << 1; - } - break; - - case BlockID.HEAD: - switch (data) { - case 2: - case 3: - return data ^ flipZ; - case 4: - case 5: - return data ^ flipX; - } - break; - - case BlockID.ANVIL: - switch (data & 0x3) { - case 0: - case 2: - return data ^ flipZ << 1; - case 1: - case 3: - return data ^ flipX << 1; - } - break; - - } - - return data; - } - - /** - * Cycle a block's data value. This usually goes through some rotational pattern - * depending on the block. If it returns -1, it means the id and data specified - * do not have anything to cycle to. - * - * @param type block id to be cycled - * @param data block data value that it starts at - * @param increment whether to go forward (1) or backward (-1) in the cycle - * @return the new data value for the block - */ - public static int cycle(int type, int data, int increment) { - return data + increment; - // TODO Fix -// if (increment != -1 && increment != 1) { -// throw new IllegalArgumentException("Increment must be 1 or -1."); -// } -// -// int store; -// switch (type) { -// -// // special case here, going to use "forward" for type and "backward" for orientation -// case BlockID.LOG: -// case BlockID.LOG2: -// if (increment == -1) { -// store = data & 0x3; // copy bottom (type) bits -// return mod((data & ~0x3) + 4, 16) | store; // switch orientation with top bits and reapply bottom bits; -// } else { -// store = data & ~0x3; // copy top (orientation) bits -// return mod((data & 0x3) + 1, 4) | store; // switch type with bottom bits and reapply top bits -// } -// -// // same here - screw you unit tests -// /*case BlockID.QUARTZ_BLOCK: -// if (increment == -1 && data > 2) { -// switch (data) { -// case 2: return 3; -// case 3: return 4; -// case 4: return 2; -// } -// } else if (increment == 1) { -// switch (data) { -// case 0: -// return 1; -// case 1: -// return 2; -// case 2: -// case 3: -// case 4: -// return 0; -// } -// } else { -// return -1; -// }*/ -// -// case BlockID.LONG_GRASS: -// case BlockID.SANDSTONE: -// case BlockID.DIRT: -// if (data > 2) return -1; -// return mod((data + increment), 3); -// -// case BlockID.TORCH: -// case BlockID.REDSTONE_TORCH_ON: -// case BlockID.REDSTONE_TORCH_OFF: -// if (data < 1 || data > 4) return -1; -// return mod((data - 1 + increment), 4) + 1; -// -// case BlockID.OAK_WOOD_STAIRS: -// case BlockID.COBBLESTONE_STAIRS: -// case BlockID.BRICK_STAIRS: -// case BlockID.STONE_BRICK_STAIRS: -// case BlockID.NETHER_BRICK_STAIRS: -// case BlockID.SANDSTONE_STAIRS: -// case BlockID.SPRUCE_WOOD_STAIRS: -// case BlockID.BIRCH_WOOD_STAIRS: -// case BlockID.JUNGLE_WOOD_STAIRS: -// case BlockID.QUARTZ_STAIRS: -// case BlockID.ACACIA_STAIRS: -// case BlockID.DARK_OAK_STAIRS: -// if (data > 7) return -1; -// return mod((data + increment), 8); -// -// case BlockID.STONE_BRICK: -// case BlockID.QUARTZ_BLOCK: -// case BlockID.PUMPKIN: -// case BlockID.JACKOLANTERN: -// case BlockID.NETHER_WART: -// case BlockID.CAULDRON: -// case BlockID.WOODEN_STEP: -// case BlockID.DOUBLE_WOODEN_STEP: -// case BlockID.HAY_BLOCK: -// if (data > 3) return -1; -// return mod((data + increment), 4); -// -// case BlockID.STEP: -// case BlockID.DOUBLE_STEP: -// case BlockID.CAKE_BLOCK: -// case BlockID.PISTON_BASE: -// case BlockID.PISTON_STICKY_BASE: -// case BlockID.SILVERFISH_BLOCK: -// if (data > 5) return -1; -// return mod((data + increment), 6); -// -// case BlockID.DOUBLE_PLANT: -// store = data & 0x8; // top half flag -// data &= ~0x8; -// if (data > 5) return -1; -// return mod((data + increment), 6) | store; -// -// case BlockID.CROPS: -// case BlockID.PUMPKIN_STEM: -// case BlockID.MELON_STEM: -// if (data > 6) return -1; -// return mod((data + increment), 7); -// -// case BlockID.SOIL: -// case BlockID.RED_FLOWER: -// if (data > 8) return -1; -// return mod((data + increment), 9); -// -// case BlockID.RED_MUSHROOM_CAP: -// case BlockID.BROWN_MUSHROOM_CAP: -// if (data > 10) return -1; -// return mod((data + increment), 11); -// -// case BlockID.CACTUS: -// case BlockID.REED: -// case BlockID.SIGN_POST: -// case BlockID.VINE: -// case BlockID.SNOW: -// case BlockID.COCOA_PLANT: -// if (data > 15) return -1; -// return mod((data + increment), 16); -// -// case BlockID.FURNACE: -// case BlockID.BURNING_FURNACE: -// case BlockID.WALL_SIGN: -// case BlockID.LADDER: -// case BlockID.CHEST: -// case BlockID.ENDER_CHEST: -// case BlockID.TRAPPED_CHEST: -// case BlockID.HOPPER: -// int extra = data & 0x8; -// int withoutFlags = data & ~0x8; -// if (withoutFlags < 2 || withoutFlags > 5) return -1; -// return (mod((withoutFlags - 2 + increment), 4) + 2) | extra; -// -// case BlockID.DISPENSER: -// case BlockID.DROPPER: -// store = data & 0x8; -// data &= ~0x8; -// if (data > 5) return -1; -// return mod((data + increment), 6) | store; -// -// case BlockID.REDSTONE_REPEATER_OFF: -// case BlockID.REDSTONE_REPEATER_ON: -// case BlockID.COMPARATOR_OFF: -// case BlockID.COMPARATOR_ON: -// case BlockID.TRAP_DOOR: -// case BlockID.FENCE_GATE: -// case BlockID.LEAVES: -// case BlockID.LEAVES2: -// if (data > 7) return -1; -// store = data & ~0x3; -// return mod(((data & 0x3) + increment), 4) | store; -// -// case BlockID.MINECART_TRACKS: -// if (data < 6 || data > 9) return -1; -// return mod((data - 6 + increment), 4) + 6; -// -// case BlockID.SAPLING: -// if ((data & 0x3) == 3 || data > 15) return -1; -// store = data & ~0x3; -// return mod(((data & 0x3) + increment), 3) | store; -// -// case BlockID.FLOWER_POT: -// if (data > 13) return -1; -// return mod((data + increment), 14); -// -// case BlockID.CLOTH: -// case BlockID.STAINED_CLAY: -// case BlockID.CARPET: -// case BlockID.STAINED_GLASS: -// case BlockID.STAINED_GLASS_PANE: -// if (increment == 1) { -// data = nextClothColor(data); -// } else if (increment == -1) { -// data = prevClothColor(data); -// } -// return data; -// -// default: -// return -1; -// } - } - - /** - * Better modulo, not just remainder. - */ - private static int mod(int x, int y) { - int res = x % y; - return res < 0 ? res + y : res; - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index eb145bf78..c9f382617 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -29,15 +29,11 @@ import com.sk89q.worldedit.world.block.BlockTypes; @Deprecated public final class BlockID { public static final int SAPLING = 6; - public static final int LOG = 17; - public static final int DISPENSER = 23; public static final int BED = 26; public static final int POWERED_RAIL = 27; // GOLDEN_RAIL public static final int DETECTOR_RAIL = 28; - public static final int PISTON_STICKY_BASE = 29; // STICKY_PISTON public static final int LONG_GRASS = 31; // TALLGRASS public static final int DEAD_BUSH = 32; // DEADBUSH - public static final int PISTON_BASE = 33; // PISTON public static final int PISTON_EXTENSION = 34; // PISTON_HEAD public static final int YELLOW_FLOWER = 37; public static final int RED_FLOWER = 38; @@ -45,17 +41,12 @@ public final class BlockID { public static final int RED_MUSHROOM = 40; public static final int STEP = 44; // STONE_SLAB public static final int TORCH = 50; - public static final int OAK_WOOD_STAIRS = 53; // OAK_STAIRS - public static final int CHEST = 54; public static final int REDSTONE_WIRE = 55; public static final int CROPS = 59; // WHEAT - public static final int FURNACE = 61; - public static final int BURNING_FURNACE = 62; // LIT_FURNACE public static final int SIGN_POST = 63; // STANDING_SIGN public static final int WOODEN_DOOR = 64; // WOODEN_DOOR public static final int LADDER = 65; public static final int MINECART_TRACKS = 66; // RAIL - public static final int COBBLESTONE_STAIRS = 67; // STONE_STAIRS public static final int WALL_SIGN = 68; public static final int LEVER = 69; public static final int STONE_PRESSURE_PLATE = 70; @@ -68,23 +59,16 @@ public final class BlockID { public static final int CACTUS = 81; public static final int REED = 83; // REEDS public static final int FENCE = 85; - public static final int PUMPKIN = 86; public static final int SLOW_SAND = 88; // SOUL_SAND - public static final int JACKOLANTERN = 91; // LIT_PUMPKIN public static final int CAKE_BLOCK = 92; // CAKE public static final int REDSTONE_REPEATER_OFF = 93; // UNPOWERED_REPEATER public static final int REDSTONE_REPEATER_ON = 94; // POWERED_REPEATER public static final int TRAP_DOOR = 96; // TRAPDOOR - public static final int BROWN_MUSHROOM_CAP = 99; // BROWN_MUSHROOM_BLOCK - public static final int RED_MUSHROOM_CAP = 100; // RED_MUSHROOM_BLOCK public static final int PUMPKIN_STEM = 104; public static final int MELON_STEM = 105; public static final int VINE = 106; public static final int FENCE_GATE = 107; - public static final int BRICK_STAIRS = 108; - public static final int STONE_BRICK_STAIRS = 109; public static final int LILY_PAD = 111; // WATERLILY - public static final int NETHER_BRICK_STAIRS = 114; public static final int NETHER_WART = 115; public static final int ENCHANTMENT_TABLE = 116; // ENCHANTING_TABLE public static final int BREWING_STAND = 117; @@ -92,13 +76,8 @@ public final class BlockID { public static final int END_PORTAL_FRAME = 120; public static final int WOODEN_STEP = 126; // WOODEN_SLAB public static final int COCOA_PLANT = 127; // COCOA - public static final int SANDSTONE_STAIRS = 128; - public static final int ENDER_CHEST = 130; public static final int TRIPWIRE_HOOK = 131; public static final int TRIPWIRE = 132; - public static final int SPRUCE_WOOD_STAIRS = 134; // SPRUCE_STAIRS - public static final int BIRCH_WOOD_STAIRS = 135; // BRUCE_STAIRS - public static final int JUNGLE_WOOD_STAIRS = 136; // JUNGLE_STAIRS public static final int COBBLESTONE_WALL = 139; public static final int FLOWER_POT = 140; public static final int CARROTS = 141; @@ -106,21 +85,14 @@ public final class BlockID { public static final int WOODEN_BUTTON = 143; public static final int HEAD = 144; // SKULL public static final int ANVIL = 145; - public static final int TRAPPED_CHEST = 146; public static final int PRESSURE_PLATE_LIGHT = 147; // LIGHT_WEIGHTED_PRESSURE_PLATE public static final int PRESSURE_PLATE_HEAVY = 148; // HEAVY_WEIGHTED_PRESSURE_PLATE public static final int COMPARATOR_OFF = 149; // UNPOWERED_COMPARATOR public static final int COMPARATOR_ON = 150; // COMPARATOR public static final int DAYLIGHT_SENSOR = 151; // DAYLIGHT_DETECTOR public static final int HOPPER = 154; - public static final int QUARTZ_STAIRS = 156; public static final int ACTIVATOR_RAIL = 157; - public static final int DROPPER = 158; - public static final int LOG2 = 162; - public static final int ACACIA_STAIRS = 163; - public static final int DARK_OAK_STAIRS = 164; public static final int IRON_TRAP_DOOR = 167; - public static final int HAY_BLOCK = 170; public static final int CARPET = 171; public static final int DOUBLE_PLANT = 175; public static final int STANDING_BANNER = 176; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java index b99af7a3f..4e025ff7e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java @@ -23,15 +23,12 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockData; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; -import com.sk89q.worldedit.world.registry.LegacyMapper; +import com.sk89q.worldedit.world.block.BlockState; /** * A mode that cycles the data values of supported blocks. @@ -49,24 +46,24 @@ public class BlockDataCyler implements DoubleActionBlockTool { World world = (World) clicked.getExtent(); BlockState block = world.getBlock(clicked.toVector()); - int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(block); - int type = datas[0]; - int data = datas[1]; if (!config.allowedDataCycleBlocks.isEmpty() && !player.hasPermission("worldedit.override.data-cycler") - && !config.allowedDataCycleBlocks.contains(type)) { + && !config.allowedDataCycleBlocks.contains(block.getBlockType().getId())) { player.printError("You are not permitted to cycle the data value of that block."); return true; } - int increment = forward ? 1 : -1; - BaseBlock newBlock = new BaseBlock(type, BlockData.cycle(type, data, increment)); - EditSession editSession = session.createEditSession(player); - - if (newBlock.getData() < 0) { + if (block.getStates().keySet().isEmpty()) { player.printError("That block's data cannot be cycled!"); } else { + BlockState newBlock = block; + + // TODO Forward = cycle value, Backward = Next property + // int increment = forward ? 1 : -1; + // BaseBlock newBlock = new BaseBlock(type, BlockData.cycle(type, data, increment)); + EditSession editSession = session.createEditSession(player); + try { editSession.setBlock(clicked.toVector(), newBlock); } catch (MaxChangedBlocksException e) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index 24705db26..b6c3a0f1e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -84,7 +84,7 @@ public class YAMLConfiguration extends LocalConfiguration { butcherMaxRadius = Math.max(-1, config.getInt("limits.butcher-radius.maximum", butcherMaxRadius)); disallowedBlocks = new HashSet<>(config.getStringList("limits.disallowed-blocks", Lists.newArrayList(defaultDisallowedBlocks))); - allowedDataCycleBlocks = new HashSet<>(config.getIntList("limits.allowed-data-cycle-blocks", null)); + allowedDataCycleBlocks = new HashSet<>(config.getStringList("limits.allowed-data-cycle-blocks", null)); registerHelp = config.getBoolean("register-help", true); logCommands = config.getBoolean("logging.log-commands", logCommands); diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java deleted file mode 100644 index 64afecfe5..000000000 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/CuboidClipboardTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -// TODO FIX -public class CuboidClipboardTest { -// @Test -// public void testFlipCenterPlane() throws Exception { -// testFlip(0, 1, CuboidClipboard.FlipDirection.UP_DOWN); -// testFlip(2, 3, CuboidClipboard.FlipDirection.NORTH_SOUTH); -// testFlip(4, 5, CuboidClipboard.FlipDirection.WEST_EAST); -// } -// -// private void testFlip(int data, int expectedDataAfterFlip, CuboidClipboard.FlipDirection flipDirection) { -// BlockType blockType = new BlockType("minecraft:piston_base"); -// final CuboidClipboard clipboard = new CuboidClipboard(new Vector(1, 1, 1)); -// clipboard.setBlock(Vector.ZERO, new BaseBlock(blockType, data)); -// clipboard.flip(flipDirection); -// assertEquals(expectedDataAfterFlip, clipboard.getBlock(Vector.ZERO).getData()); -// } -} diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/blocks/BlockDataTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/blocks/BlockDataTest.java deleted file mode 100644 index 1a44ddeb0..000000000 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/blocks/BlockDataTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import com.sk89q.worldedit.CuboidClipboard.FlipDirection; -import org.junit.Test; - -import java.util.TreeSet; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class BlockDataTest { - - @Test - public void testRotateFlip() { - for (int type = 0; type < 256; ++type) { - for (int data = 0; data < 16; ++data) { - final String message = type + "/" + data; - - //Test r90(r-90(x))==x - assertEquals(message, data, BlockData.rotate90(type, BlockData.rotate90Reverse(type, data))); - //Test r-90(r90(x))==x - assertEquals(message, data, BlockData.rotate90Reverse(type, BlockData.rotate90(type, data))); - - final int flipped = BlockData.flip(type, BlockData.flip(type, data, FlipDirection.WEST_EAST), FlipDirection.NORTH_SOUTH); - - //Test r90(r90(x))==flipNS(flipWE(x)) - assertEquals(message, flipped, BlockData.rotate90(type, BlockData.rotate90(type, data))); - //Test r-90(r-90(x))==flipNS(flipWE(x)) - assertEquals(message, flipped, BlockData.rotate90Reverse(type, BlockData.rotate90Reverse(type, data))); - - //Test flipNS(flipNS(x))==x - assertEquals(message, data, BlockData.flip(type, BlockData.flip(type, data, FlipDirection.NORTH_SOUTH), FlipDirection.NORTH_SOUTH)); - //Test flipWE(flipWE(x))==x - assertEquals(message, data, BlockData.flip(type, BlockData.flip(type, data, FlipDirection.WEST_EAST), FlipDirection.WEST_EAST)); - //Test flipUD(flipUD(x))==x - assertEquals(message, data, BlockData.flip(type, BlockData.flip(type, data, FlipDirection.UP_DOWN), FlipDirection.UP_DOWN)); - - //Test r90(r90(r90(r90(x))))==x - assertEquals(message, data, BlockData.rotate90(type, BlockData.rotate90(type, BlockData.rotate90(type, BlockData.rotate90(type, data))))); - //Test r-90(r-90(r-90(r-90(x))))==x - assertEquals(message, data, BlockData.rotate90Reverse(type, BlockData.rotate90Reverse(type, BlockData.rotate90Reverse(type, BlockData.rotate90Reverse(type, data))))); - } - } - } -} diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java deleted file mode 100644 index 740a6d653..000000000 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/extent/transform/BlockTransformExtentTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.extent.transform; - -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BlockData; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.math.transform.AffineTransform; -import com.sk89q.worldedit.math.transform.Transform; -import com.sk89q.worldedit.world.registry.BlockRegistry; -import com.sk89q.worldedit.world.registry.BundledBlockRegistry; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -import java.util.HashSet; -import java.util.Set; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; - -@Ignore("Old BlockData class needs to be updated manually. Current block definitions are in blocks.json, " + - "which is automatically generated and generally accurate.") -public class BlockTransformExtentTest { - - private static final Transform ROTATE_90 = new AffineTransform().rotateY(-90); - private static final Transform ROTATE_NEG_90 = new AffineTransform().rotateY(90); - private final Set ignored = new HashSet<>(); - - @Before - public void setUp() throws Exception { - ignored.add(BlockTypes.BLACK_BED); // Broken in existing rotation code? - ignored.add(BlockTypes.BLUE_BED); // Complicated - ignored.add(BlockTypes.BROWN_BED); // Complicated - ignored.add(BlockTypes.CYAN_BED); // Complicated - ignored.add(BlockTypes.GRAY_BED); // Complicated - ignored.add(BlockTypes.GREEN_BED); // Complicated - ignored.add(BlockTypes.LIGHT_BLUE_BED); // Complicated - ignored.add(BlockTypes.LIGHT_GRAY_BED); // Complicated - ignored.add(BlockTypes.LIME_BED); // Complicated - ignored.add(BlockTypes.OAK_DOOR); // Complicated - ignored.add(BlockTypes.IRON_DOOR); // Complicated - ignored.add(BlockTypes.END_PORTAL); // Not supported in existing rotation code - } - - @Test - public void testTransform() throws Exception { - BlockRegistry blockRegistry = new BundledBlockRegistry(); - for (BlockType type : BlockTypes.values()) { - if (ignored.contains(type)) { - continue; - } - - BaseBlock orig = new BaseBlock(type); - for (int i = 1; i < 4; i++) { - BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_90); - BaseBlock reference = new BaseBlock(orig.getBlockType().getLegacyId(), BlockData.rotate90(orig.getBlockType().getLegacyId(), orig.getData())); - assertThat(type + "#" + type.getId() + " rotated " + (90 * i) + " degrees did not match BlockData.rotate90()'s expected result", rotated, - equalTo(reference)); - orig = rotated; - } - - orig = new BaseBlock(type); - for (int i = 0; i < 4; i++) { - BaseBlock rotated = BlockTransformExtent.transform(new BaseBlock(orig), ROTATE_NEG_90); - BaseBlock reference = new BaseBlock(orig.getBlockType().getLegacyId(), BlockData.rotate90Reverse(orig.getBlockType().getLegacyId(), orig.getData())); - assertThat(type + "#" + type.getId() + " rotated " + (-90 * i) + " degrees did not match BlockData.rotate90Reverse()'s expected result", rotated, equalTo(reference)); - orig = rotated; - } - } - } -} \ No newline at end of file diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 62756cbc8..7a3400b82 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -366,13 +366,11 @@ public class ForgeWorld extends AbstractWorld { @Override public BaseBlock getFullBlock(Vector position) { - World world = getWorld(); BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - IBlockState state = world.getBlockState(pos); TileEntity tile = getWorld().getTileEntity(pos); if (tile != null) { - return new TileEntityBaseBlock(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state), tile); + return new TileEntityBaseBlock(getBlock(position), tile); } else { return new BaseBlock(getBlock(position)); } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityBaseBlock.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityBaseBlock.java index 068482408..6aa0ff73a 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityBaseBlock.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityBaseBlock.java @@ -21,14 +21,14 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.TileEntityBlock; +import com.sk89q.worldedit.world.block.BlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; public class TileEntityBaseBlock extends BaseBlock implements TileEntityBlock { - public TileEntityBaseBlock(int type, int data, TileEntity tile) { - super(type, data); - setNbtData(NBTConverter.fromNative(copyNbtData(tile))); + public TileEntityBaseBlock(BlockState state, TileEntity tile) { + super(state, NBTConverter.fromNative(copyNbtData(tile))); } private static NBTTagCompound copyNbtData(TileEntity tile) { diff --git a/worldedit-forge/src/main/resources/defaults/worldedit.properties b/worldedit-forge/src/main/resources/defaults/worldedit.properties index d84d56faf..4fa5671d5 100644 --- a/worldedit-forge/src/main/resources/defaults/worldedit.properties +++ b/worldedit-forge/src/main/resources/defaults/worldedit.properties @@ -4,15 +4,15 @@ schematic-save-dir=schematics allow-extra-data-values=false super-pickaxe-many-drop-items=true register-help=true -nav-wand-item=345 +nav-wand-item=minecraft:compass profile=false super-pickaxe-drop-items=true -disallowed-blocks=6,26,27,28,31,32,34,36,37,38,39,40,46,50,51,55,59,66,69,75,76,93,94,77,81,83,7,14,15,16,56 +disallowed-blocks=minecraft:oak_sapling,minecraft:jungle_sapling,minecraft:dark_oak_sapling:,minecraft:spruce_sapling,minecraft:birch_sapling,minecraft:acacia_sapling,minecraft:black_bed,minecraft:blue_bed,minecraft:brown_bed,minecraft:cyan_bed,minecraft:gray_bed,minecraft:green_bed,minecraft:light_blue_bed,minecraft:light_gray_bed,minecraft:lime_bed,minecraft:magenta_bed,minecraft:orange_bed,minecraft:pink_bed,minecraft:purple_bed,minecraft:red_bed,minecraft:white_bed,minecraft:yellow_bed,minecraft:powered_rail,minecraft:detector_rail,minecraft:grass,minecraft:dead_bush,minecraft:moving_piston,minecraft:piston_head,minecraft:sunflower,minecraft:rose_bush,minecraft:dandelion,minecraft:poppy,minecraft:brown_mushroom,minecraft:red_mushroom,minecraft:tnt,minecraft:torch,minecraft:fire,minecraft:redstone_wire,minecraft:wheat,minecraft:potatoes,minecraft:carrots,minecraft:melon_stem,minecraft:pumpkin_stem,minecraft:beetroots,minecraft:rail,minecraft:lever,minecraft:redstone_torch,minecraft:redstone_wall_torch,minecraft:repeater,minecraft:comparator,minecraft:stone_button,minecraft:birch_button,minecraft:acacia_button,minecraft:dark_oak_button,minecraft:jungle_button,minecraft:oak_button,minecraft:spruce_button,minecraft:cactus,minecraft:sugar_cane,minecraft:bedrock max-super-pickaxe-size=5 max-brush-radius=10 craftscript-dir=craftscripts no-double-slash=false -wand-item=271 +wand-item=minecraft:wooden_axe shell-save-type= scripting-timeout=3000 snapshots-dir= diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java index 80ff1e0e9..e38140bb4 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/config/ConfigurateConfiguration.java @@ -83,7 +83,7 @@ public class ConfigurateConfiguration extends LocalConfiguration { logger.warn("Error loading WorldEdit configuration", e); } try { - allowedDataCycleBlocks = new HashSet<>(node.getNode("limits", "allowed-data-cycle-blocks").getList(TypeToken.of(Integer.class))); + allowedDataCycleBlocks = new HashSet<>(node.getNode("limits", "allowed-data-cycle-blocks").getList(TypeToken.of(String.class))); } catch (ObjectMappingException e) { logger.warn("Error loading WorldEdit configuration", e); } From 70208c38fdccac5b4afeed65a9246d22585d80c5 Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 5 Jul 2018 11:09:45 -0700 Subject: [PATCH 35/74] category changes --- .../com/sk89q/worldedit/blocks/Blocks.java | 18 +++--- .../worldedit/command/GeneralCommands.java | 2 +- .../sk89q/worldedit/registry/Category.java | 62 +++++++++++++++++++ .../registry/NamespacedRegistry.java | 15 ++++- .../world/block/BlockCategories.java | 20 ++---- .../worldedit/world/block/BlockCategory.java | 33 +++------- .../worldedit/world/block/BlockType.java | 2 +- .../worldedit/world/block/BlockTypes.java | 17 ++--- .../world/fluid/FluidCategories.java | 17 ++--- .../worldedit/world/fluid/FluidCategory.java | 29 +++------ .../worldedit/world/fluid/FluidType.java | 2 +- .../worldedit/world/fluid/FluidTypes.java | 17 ++--- .../worldedit/world/item/ItemCategories.java | 20 ++---- .../worldedit/world/item/ItemCategory.java | 33 +++------- .../sk89q/worldedit/world/item/ItemType.java | 2 +- .../sk89q/worldedit/world/item/ItemTypes.java | 20 ++---- .../world/registry/CategoryRegistry.java | 4 ++ .../registry/NullBlockCategoryRegistry.java | 6 ++ .../registry/NullItemCategoryRegistry.java | 6 ++ 19 files changed, 159 insertions(+), 166 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/registry/Category.java diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java index e1b9b0ae0..8e128f57d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java @@ -41,13 +41,13 @@ public final class Blocks { */ private static final Set shouldPlaceLast = new HashSet<>(); static { - shouldPlaceLast.addAll(BlockCategories.SAPLINGS.getBlockTypes()); - shouldPlaceLast.addAll(BlockCategories.FLOWER_POTS.getBlockTypes()); - shouldPlaceLast.addAll(BlockCategories.BUTTONS.getBlockTypes()); - shouldPlaceLast.addAll(BlockCategories.ANVIL.getBlockTypes()); // becomes relevant with asynchronous placement - shouldPlaceLast.addAll(BlockCategories.WOODEN_PRESSURE_PLATES.getBlockTypes()); - shouldPlaceLast.addAll(BlockCategories.CARPETS.getBlockTypes()); - shouldPlaceLast.addAll(BlockCategories.RAILS.getBlockTypes()); + shouldPlaceLast.addAll(BlockCategories.SAPLINGS.getAll()); + shouldPlaceLast.addAll(BlockCategories.FLOWER_POTS.getAll()); + shouldPlaceLast.addAll(BlockCategories.BUTTONS.getAll()); + shouldPlaceLast.addAll(BlockCategories.ANVIL.getAll()); // becomes relevant with asynchronous placement + shouldPlaceLast.addAll(BlockCategories.WOODEN_PRESSURE_PLATES.getAll()); + shouldPlaceLast.addAll(BlockCategories.CARPETS.getAll()); + shouldPlaceLast.addAll(BlockCategories.RAILS.getAll()); shouldPlaceLast.add(BlockTypes.BLACK_BED); shouldPlaceLast.add(BlockTypes.BLUE_BED); shouldPlaceLast.add(BlockTypes.BROWN_BED); @@ -128,8 +128,8 @@ public final class Blocks { */ private static final Set shouldPlaceFinal = new HashSet<>(); static { - shouldPlaceFinal.addAll(BlockCategories.DOORS.getBlockTypes()); - shouldPlaceFinal.addAll(BlockCategories.BANNERS.getBlockTypes()); + shouldPlaceFinal.addAll(BlockCategories.DOORS.getAll()); + shouldPlaceFinal.addAll(BlockCategories.BANNERS.getAll()); shouldPlaceFinal.add(BlockTypes.SIGN); shouldPlaceFinal.add(BlockTypes.WALL_SIGN); shouldPlaceFinal.add(BlockTypes.CACTUS); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java index 7da7dadb3..adf0ced28 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java @@ -186,7 +186,7 @@ public class GeneralCommands { int found = 0; - for (ItemType searchType : ItemTypes.values()) { + for (ItemType searchType : ItemType.REGISTRY) { if (found >= 15) { actor.print("Too many results!"); break; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Category.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Category.java new file mode 100644 index 000000000..ee077cd70 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Category.java @@ -0,0 +1,62 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.registry; + +import java.util.HashSet; +import java.util.Set; + +public abstract class Category { + private final Set set = new HashSet<>(); + protected final String id; + private boolean empty = true; + + protected Category(final String id) { + this.id = id; + } + + public final String getId() { + return this.id; + } + + public final Set getAll() { + if (this.empty) { + this.set.addAll(this.load()); + this.empty = false; + } + return this.set; + } + + protected abstract Set load(); + + /** + * Checks if this category contains {@code object}. + * + * @param object the object + * @return {@code true} if this category contains the object + */ + public boolean contains(final T object) { + return this.getAll().contains(object); + } + + public void invalidateCache() { + this.set.clear(); + this.empty = true; + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java index fde3e5d6e..9ac26a808 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.registry; import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -30,9 +31,14 @@ import javax.annotation.Nullable; import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; -public final class NamespacedRegistry { +public final class NamespacedRegistry implements Iterable { private static final String MINECRAFT_NAMESPACE = "minecraft"; private final Map map = new HashMap<>(); + private final String name; + + public NamespacedRegistry(final String name) { + this.name = name; + } public @Nullable V get(final String key) { checkState(key.equals(key.toLowerCase()), "key must be lowercase"); @@ -44,7 +50,7 @@ public final class NamespacedRegistry { requireNonNull(value, "value"); checkState(key.indexOf(':') > -1, "key is not namespaced"); checkState(key.equals(key.toLowerCase()), "key must be lowercase"); - checkState(!this.map.containsKey(key), "key %s already has an entry", key); + checkState(!this.map.containsKey(key), "key '%s' already has an associated %s", key, this.name); this.map.put(key, value); return value; } @@ -63,4 +69,9 @@ public final class NamespacedRegistry { } return key; } + + @Override + public Iterator iterator() { + return this.map.values().iterator(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java index dc230b6fa..d60c96985 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java @@ -19,20 +19,12 @@ package com.sk89q.worldedit.world.block; -import java.lang.reflect.Field; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - import javax.annotation.Nullable; /** * Stores a list of categories of Block Types. */ -public class BlockCategories { - - private BlockCategories() { - } +public final class BlockCategories { public static final BlockCategory ACACIA_LOGS = register("minecraft:acacia_logs"); public static final BlockCategory ANVIL = register("minecraft:anvil"); @@ -67,6 +59,9 @@ public class BlockCategories { public static final BlockCategory WOODEN_STAIRS = register("minecraft:wooden_stairs"); public static final BlockCategory WOOL = register("minecraft:wool"); + private BlockCategories() { + } + private static BlockCategory register(final String id) { return register(new BlockCategory(id)); } @@ -75,12 +70,7 @@ public class BlockCategories { return BlockCategory.REGISTRY.register(tag.getId(), tag); } - @Nullable - public static BlockCategory get(final String id) { + public static @Nullable BlockCategory get(final String id) { return BlockCategory.REGISTRY.get(id); } - - public static Collection values() { - return BlockCategory.REGISTRY.values(); - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java index a37186cd0..8debc2c47 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.world.block; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.registry.Category; import com.sk89q.worldedit.registry.NamespacedRegistry; import java.util.Set; @@ -29,35 +30,19 @@ import java.util.Set; * A category of blocks. This is due to the splitting up of * blocks such as wool into separate ids. */ -public class BlockCategory { +public class BlockCategory extends Category { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("block tag"); - private final String id; - - public BlockCategory(String id) { - this.id = id; + public BlockCategory(final String id) { + super(id); } - public String getId() { - return this.id; - } - - public Set getBlockTypes() { + @Override + protected Set load() { return WorldEdit.getInstance().getPlatformManager() .queryCapability(Capability.GAME_HOOKS).getRegistries() - .getBlockCategoryRegistry().getCategorisedByName(this.id); - } - - /** - * Checks whether the BlocKType is contained within - * this category. - * - * @param blockType The blocktype - * @return If it's a part of this category - */ - public boolean contains(BlockType blockType) { - return getBlockTypes().contains(blockType); + .getBlockCategoryRegistry().getAll(this); } /** @@ -68,6 +53,6 @@ public class BlockCategory { * @return If it's a part of this category */ public boolean contains(BlockStateHolder blockStateHolder) { - return getBlockTypes().contains(blockStateHolder.getBlockType()); + return this.getAll().contains(blockStateHolder.getBlockType()); } } 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 d0d83de14..3dc01ea1a 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 @@ -34,7 +34,7 @@ import javax.annotation.Nullable; public class BlockType { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("block type"); private String id; private BlockState defaultState; 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 25645dece..877b113ff 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 @@ -19,17 +19,12 @@ package com.sk89q.worldedit.world.block; -import java.util.Collection; - import javax.annotation.Nullable; /** * Stores a list of common Block String IDs. */ -public class BlockTypes { - - private BlockTypes() { - } +public final class BlockTypes { public static final BlockType ACACIA_BARK = register("minecraft:acacia_bark"); public static final BlockType ACACIA_BUTTON = register("minecraft:acacia_button"); @@ -604,6 +599,9 @@ public class BlockTypes { public static final BlockType ZOMBIE_HEAD = register("minecraft:zombie_head"); public static final BlockType ZOMBIE_WALL_HEAD = register("minecraft:zombie_wall_head"); + private BlockTypes() { + } + private static BlockType register(final String id) { return register(new BlockType(id)); } @@ -612,12 +610,7 @@ public class BlockTypes { return BlockType.REGISTRY.register(block.getId(), block); } - @Nullable - public static BlockType get(final String id) { + public static @Nullable BlockType get(final String id) { return BlockType.REGISTRY.get(id); } - - public static Collection values() { - return BlockType.REGISTRY.values(); - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java index 2362c26c0..c86c9f487 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategories.java @@ -19,21 +19,19 @@ package com.sk89q.worldedit.world.fluid; -import java.util.Collection; - import javax.annotation.Nullable; /** * Stores a list of categories of Block Types. */ -public class FluidCategories { - - private FluidCategories() { - } +public final class FluidCategories { public static final FluidCategory LAVA = register("minecraft:lava"); public static final FluidCategory WATER = register("minecraft:water"); + private FluidCategories() { + } + private static FluidCategory register(final String id) { return register(new FluidCategory(id)); } @@ -42,12 +40,7 @@ public class FluidCategories { return FluidCategory.REGISTRY.register(tag.getId(), tag); } - @Nullable - public static FluidCategory get(final String id) { + public static @Nullable FluidCategory get(final String id) { return FluidCategory.REGISTRY.get(id); } - - public static Collection values() { - return FluidCategory.REGISTRY.values(); - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java index 0c359c2ce..52685cb56 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.world.fluid; +import com.sk89q.worldedit.registry.Category; import com.sk89q.worldedit.registry.NamespacedRegistry; import java.util.Collections; @@ -28,35 +29,19 @@ import java.util.Set; * A category of fluids. This is due to the splitting up of * blocks such as wool into separate ids. */ -public class FluidCategory { +public class FluidCategory extends Category { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("fluid tag"); - private final String id; - - public FluidCategory(String id) { - this.id = id; + public FluidCategory(final String id) { + super(id); } - public String getId() { - return this.id; - } - - public Set getFluidTypes() { + @Override + protected Set load() { return Collections.emptySet(); // TODO Make this work. // return WorldEdit.getInstance().getPlatformManager() // .queryCapability(Capability.GAME_HOOKS).getRegistries() // .getBlockCategoryRegistry().getCategorisedByName(this.id); } - - /** - * Checks whether the FluidType is contained within - * this category. - * - * @param fluidType The fluidType - * @return If it's a part of this category - */ - public boolean contains(FluidType fluidType) { - return getFluidTypes().contains(fluidType); - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java index 11b1ea63f..3207619ca 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java @@ -27,7 +27,7 @@ import com.sk89q.worldedit.registry.NamespacedRegistry; */ public class FluidType { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("fluid type"); private String id; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java index 4dbc012c4..0e18a4355 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidTypes.java @@ -19,17 +19,12 @@ package com.sk89q.worldedit.world.fluid; -import java.util.Collection; - import javax.annotation.Nullable; /** * Stores a list of common Fluid String IDs. */ -public class FluidTypes { - - private FluidTypes() { - } +public final class FluidTypes { public static final FluidType EMPTY = register("minecraft:empty"); public static final FluidType FLOWING_LAVA = register("minecraft:flowing_lava"); @@ -37,6 +32,9 @@ public class FluidTypes { public static final FluidType LAVA = register("minecraft:lava"); public static final FluidType WATER = register("minecraft:water"); + private FluidTypes() { + } + private static FluidType register(final String id) { return register(new FluidType(id)); } @@ -45,12 +43,7 @@ public class FluidTypes { return FluidType.REGISTRY.register(fluid.getId(), fluid); } - @Nullable - public static FluidType getFluidType(final String id) { + public static @Nullable FluidType get(final String id) { return FluidType.REGISTRY.get(id); } - - public static Collection values() { - return FluidType.REGISTRY.values(); - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java index 2ec454bda..68f232d7b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategories.java @@ -19,20 +19,12 @@ package com.sk89q.worldedit.world.item; -import java.lang.reflect.Field; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - import javax.annotation.Nullable; /** * Stores a list of categories of Item Types. */ -public class ItemCategories { - - private ItemCategories() { - } +public final class ItemCategories { public static final ItemCategory ACACIA_LOGS = register("minecraft:acacia_logs"); public static final ItemCategory ANVIL = register("minecraft:anvil"); @@ -65,6 +57,9 @@ public class ItemCategories { public static final ItemCategory WOODEN_STAIRS = register("minecraft:wooden_stairs"); public static final ItemCategory WOOL = register("minecraft:wool"); + private ItemCategories() { + } + private static ItemCategory register(final String id) { return register(new ItemCategory(id)); } @@ -73,12 +68,7 @@ public class ItemCategories { return ItemCategory.REGISTRY.register(tag.getId(), tag); } - @Nullable - public static ItemCategory get(final String id) { + public static @Nullable ItemCategory get(final String id) { return ItemCategory.REGISTRY.get(id); } - - public static Collection values() { - return ItemCategory.REGISTRY.values(); - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java index 5e0240aad..c5efdb4b9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.world.item; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.registry.Category; import com.sk89q.worldedit.registry.NamespacedRegistry; import java.util.Set; @@ -30,35 +31,19 @@ import java.util.Set; * A category of items. This is due to the splitting up of * items such as wool into separate ids. */ -public class ItemCategory { +public class ItemCategory extends Category { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("item tag"); - private final String id; - - public ItemCategory(String id) { - this.id = id; + public ItemCategory(final String id) { + super(id); } - public String getId() { - return this.id; - } - - public Set getItemTypes() { + @Override + protected Set load() { return WorldEdit.getInstance().getPlatformManager() .queryCapability(Capability.GAME_HOOKS).getRegistries() - .getItemCategoryRegistry().getCategorisedByName(this.id); - } - - /** - * Checks whether the ItemType is contained within - * this category. - * - * @param itemType The itemType - * @return If it's a part of this category - */ - public boolean contains(ItemType itemType) { - return getItemTypes().contains(itemType); + .getItemCategoryRegistry().getAll(this); } /** @@ -69,6 +54,6 @@ public class ItemCategory { * @return If it's a part of this category */ public boolean contains(BaseItem baseItem) { - return getItemTypes().contains(baseItem.getType()); + return this.getAll().contains(baseItem.getType()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java index 32d8b1008..d49f28ddc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java @@ -29,7 +29,7 @@ import javax.annotation.Nullable; public class ItemType { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>(); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("item type"); private String id; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java index 94a891739..cd66a0174 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java @@ -19,17 +19,9 @@ package com.sk89q.worldedit.world.item; -import java.lang.reflect.Field; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - import javax.annotation.Nullable; -public class ItemTypes { - - private ItemTypes() { - } +public final class ItemTypes { public static final ItemType ACACIA_BARK = register("minecraft:acacia_bark"); public static final ItemType ACACIA_BOAT = register("minecraft:acacia_boat"); @@ -743,6 +735,9 @@ public class ItemTypes { public static final ItemType ZOMBIE_SPAWN_EGG = register("minecraft:zombie_spawn_egg"); public static final ItemType ZOMBIE_VILLAGER_SPAWN_EGG = register("minecraft:zombie_villager_spawn_egg"); + private ItemTypes() { + } + private static ItemType register(final String id) { return register(new ItemType(id)); } @@ -751,12 +746,7 @@ public class ItemTypes { return ItemType.REGISTRY.register(item.getId(), item); } - @Nullable - public static ItemType get(final String id) { + public static @Nullable ItemType get(final String id) { return ItemType.REGISTRY.get(id); } - - public static Collection values() { - return ItemType.REGISTRY.values(); - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/CategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/CategoryRegistry.java index 066231d17..1a54c7961 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/CategoryRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/CategoryRegistry.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.world.registry; +import com.sk89q.worldedit.registry.Category; + import java.util.Set; /** @@ -34,6 +36,8 @@ public interface CategoryRegistry { */ Set getCategorisedByName(String category); + Set getAll(final Category category); + /** * Gets a list of categories given to a value. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java index a58517d61..b26286498 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.world.registry; +import com.sk89q.worldedit.registry.Category; import com.sk89q.worldedit.world.block.BlockType; import java.util.Collections; @@ -31,6 +32,11 @@ public class NullBlockCategoryRegistry implements BlockCategoryRegistry { return Collections.emptySet(); } + @Override + public Set getAll(final Category category) { + return Collections.emptySet(); + } + @Override public Set getCategories(BlockType categorised) { return Collections.emptySet(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java index 4c1cb39bf..d047706c2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.world.registry; +import com.sk89q.worldedit.registry.Category; import com.sk89q.worldedit.world.item.ItemType; import java.util.Collections; @@ -31,6 +32,11 @@ public class NullItemCategoryRegistry implements ItemCategoryRegistry { return Collections.emptySet(); } + @Override + public Set getAll(final Category category) { + return Collections.emptySet(); + } + @Override public Set getCategories(ItemType categorised) { return Collections.emptySet(); From 40a665a5098fc0df51de2f3ff44a751b60da800c Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 5 Jul 2018 16:03:50 -0700 Subject: [PATCH 36/74] package move --- .../src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java | 4 ++-- .../worldedit/extension/factory/DefaultBlockParser.java | 4 ++-- .../worldedit/extent/transform/BlockTransformExtent.java | 6 +++--- .../{world => }/registry/state/DirectionalState.java | 4 ++-- .../worldedit/{world => }/registry/state/SimpleState.java | 4 ++-- .../sk89q/worldedit/{world => }/registry/state/State.java | 4 ++-- .../registry/state/value/DirectionalStateValue.java | 2 +- .../{world => }/registry/state/value/SimpleStateValue.java | 2 +- .../{world => }/registry/state/value/StateValue.java | 2 +- .../java/com/sk89q/worldedit/world/block/BlockState.java | 4 ++-- .../com/sk89q/worldedit/world/block/BlockStateHolder.java | 4 ++-- .../com/sk89q/worldedit/world/registry/BlockRegistry.java | 2 +- .../sk89q/worldedit/world/registry/BundledBlockData.java | 4 ++-- .../worldedit/world/registry/BundledBlockRegistry.java | 2 +- .../main/java/com/sk89q/worldedit/sponge/SpongeWorld.java | 4 ++-- 15 files changed, 26 insertions(+), 26 deletions(-) rename worldedit-core/src/main/java/com/sk89q/worldedit/{world => }/registry/state/DirectionalState.java (88%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{world => }/registry/state/SimpleState.java (93%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{world => }/registry/state/State.java (92%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{world => }/registry/state/value/DirectionalStateValue.java (94%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{world => }/registry/state/value/SimpleStateValue.java (96%) rename worldedit-core/src/main/java/com/sk89q/worldedit/{world => }/registry/state/value/StateValue.java (95%) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index ac5b11564..67324b934 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -28,8 +28,8 @@ import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.world.registry.LegacyMapper; -import com.sk89q.worldedit.world.registry.state.State; -import com.sk89q.worldedit.world.registry.state.value.StateValue; +import com.sk89q.worldedit.registry.state.State; +import com.sk89q.worldedit.registry.state.value.StateValue; import java.util.Map; import java.util.Objects; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 90a328744..6ce02d530 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -44,8 +44,8 @@ import com.sk89q.worldedit.internal.registry.InputParser; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.registry.BundledBlockData; -import com.sk89q.worldedit.world.registry.state.State; -import com.sk89q.worldedit.world.registry.state.value.StateValue; +import com.sk89q.worldedit.registry.state.State; +import com.sk89q.worldedit.registry.state.value.StateValue; import java.util.HashMap; import java.util.Map; 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 431dcb305..45aa2d97c 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 @@ -32,9 +32,9 @@ import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.transform.Transform; -import com.sk89q.worldedit.world.registry.state.DirectionalState; -import com.sk89q.worldedit.world.registry.state.State; -import com.sk89q.worldedit.world.registry.state.value.DirectionalStateValue; +import com.sk89q.worldedit.registry.state.DirectionalState; +import com.sk89q.worldedit.registry.state.State; +import com.sk89q.worldedit.registry.state.value.DirectionalStateValue; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalState.java similarity index 88% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalState.java index 0f9967c48..a4c83dd41 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/DirectionalState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalState.java @@ -17,9 +17,9 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.world.registry.state; +package com.sk89q.worldedit.registry.state; -import com.sk89q.worldedit.world.registry.state.value.DirectionalStateValue; +import com.sk89q.worldedit.registry.state.value.DirectionalStateValue; import java.util.List; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/SimpleState.java similarity index 93% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/SimpleState.java index fb66705b5..c31716d8f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/SimpleState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/SimpleState.java @@ -17,9 +17,9 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.world.registry.state; +package com.sk89q.worldedit.registry.state; -import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue; +import com.sk89q.worldedit.registry.state.value.SimpleStateValue; import java.util.Collections; import java.util.List; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/State.java similarity index 92% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/State.java index c6c2fc0c1..ad6c819e6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/State.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/State.java @@ -17,9 +17,9 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.world.registry.state; +package com.sk89q.worldedit.registry.state; -import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue; +import com.sk89q.worldedit.registry.state.value.SimpleStateValue; import java.util.List; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/DirectionalStateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java similarity index 94% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/DirectionalStateValue.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java index f440dd2ac..8923d7616 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/DirectionalStateValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.world.registry.state.value; +package com.sk89q.worldedit.registry.state.value; import com.sk89q.worldedit.Vector; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/SimpleStateValue.java similarity index 96% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/SimpleStateValue.java index e0e87c7b6..6558a0e71 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/SimpleStateValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/SimpleStateValue.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.world.registry.state.value; +package com.sk89q.worldedit.registry.state.value; import java.util.Objects; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/StateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/StateValue.java similarity index 95% rename from worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/StateValue.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/StateValue.java index c6dcf902d..3cc989f66 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/state/value/StateValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/StateValue.java @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.world.registry.state.value; +package com.sk89q.worldedit.registry.state.value; import javax.annotation.Nullable; 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 2d46df770..2a0271e93 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 @@ -23,8 +23,8 @@ import com.google.common.collect.ArrayTable; import com.google.common.collect.HashBasedTable; import com.google.common.collect.Maps; import com.google.common.collect.Table; -import com.sk89q.worldedit.world.registry.state.State; -import com.sk89q.worldedit.world.registry.state.value.StateValue; +import com.sk89q.worldedit.registry.state.State; +import com.sk89q.worldedit.registry.state.value.StateValue; import java.util.ArrayList; import java.util.Collections; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java index 21fa25fe2..e1382ec04 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.world.block; -import com.sk89q.worldedit.world.registry.state.State; -import com.sk89q.worldedit.world.registry.state.value.StateValue; +import com.sk89q.worldedit.registry.state.State; +import com.sk89q.worldedit.registry.state.value.StateValue; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index 80c56c46c..6320c2efc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.registry.state.State; +import com.sk89q.worldedit.registry.state.State; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 549bfe37a..a839bb179 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -26,8 +26,8 @@ import com.google.gson.reflect.TypeToken; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.util.gson.VectorAdapter; -import com.sk89q.worldedit.world.registry.state.SimpleState; -import com.sk89q.worldedit.world.registry.state.State; +import com.sk89q.worldedit.registry.state.SimpleState; +import com.sk89q.worldedit.registry.state.State; import javax.annotation.Nullable; import java.io.IOException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 707cfc554..588df83c7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.blocks.BlockMaterial; 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.registry.state.State; +import com.sk89q.worldedit.registry.state.State; import java.util.Map; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index 1cb94556b..52730b518 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -35,8 +35,8 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.state.State; -import com.sk89q.worldedit.world.registry.state.value.StateValue; +import com.sk89q.worldedit.registry.state.State; +import com.sk89q.worldedit.registry.state.value.StateValue; import org.spongepowered.api.Sponge; import org.spongepowered.api.block.BlockSnapshot; import org.spongepowered.api.block.BlockState; From ee6af8ee768ea1d7a49bbb622925ea7a79ae351b Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 5 Jul 2018 16:16:52 -0700 Subject: [PATCH 37/74] state stuff --- .../com/sk89q/worldedit/blocks/BaseBlock.java | 15 ++--- .../extension/factory/DefaultBlockParser.java | 13 ++-- .../transform/BlockTransformExtent.java | 20 +++--- ...eStateValue.java => AbstractProperty.java} | 39 +++++------ ...nalState.java => DirectionalProperty.java} | 14 +++- .../state/{State.java => Property.java} | 4 +- .../worldedit/registry/state/SimpleState.java | 66 ------------------- .../state/value/DirectionalStateValue.java | 2 +- .../registry/state/value/StateValue.java | 49 -------------- .../worldedit/world/block/BlockState.java | 59 ++++++++--------- .../world/block/BlockStateHolder.java | 13 ++-- .../world/registry/BlockRegistry.java | 4 +- .../world/registry/BundledBlockData.java | 10 +-- .../world/registry/BundledBlockRegistry.java | 4 +- .../sk89q/worldedit/sponge/SpongeWorld.java | 5 +- 15 files changed, 99 insertions(+), 218 deletions(-) rename worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/{value/SimpleStateValue.java => AbstractProperty.java} (59%) rename worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/{DirectionalState.java => DirectionalProperty.java} (74%) rename worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/{State.java => Property.java} (92%) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/SimpleState.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/StateValue.java diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 67324b934..10e0814d1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -22,14 +22,13 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.registry.state.Property; 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.function.mask.Mask; import com.sk89q.worldedit.world.registry.LegacyMapper; -import com.sk89q.worldedit.registry.state.State; -import com.sk89q.worldedit.registry.state.value.StateValue; import java.util.Map; import java.util.Objects; @@ -131,7 +130,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { * @return The state map */ @Override - public Map getStates() { + public Map, Object> getStates() { return this.blockState.getStates(); } @@ -141,19 +140,19 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { } @Override - public BaseBlock with(State state, StateValue value) { - return new BaseBlock(this.blockState.with(state, value), getNbtData()); + public BaseBlock with(Property property, V value) { + return new BaseBlock(this.blockState.with(property, value), getNbtData()); } /** * Gets the State for this Block. * - * @param state The state to get the value for + * @param property The state to get the value for * @return The state value */ @Override - public StateValue getState(State state) { - return this.blockState.getState(state); + public V getState(Property property) { + return this.blockState.getState(property); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 6ce02d530..cd73b31f3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -44,8 +44,7 @@ import com.sk89q.worldedit.internal.registry.InputParser; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.registry.BundledBlockData; -import com.sk89q.worldedit.registry.state.State; -import com.sk89q.worldedit.registry.state.value.StateValue; +import com.sk89q.worldedit.registry.state.Property; import java.util.HashMap; import java.util.Map; @@ -163,16 +162,16 @@ class DefaultBlockParser extends InputParser { throw new NoMatchException("Bad state format in " + parseableData); } - State stateKey = BundledBlockData.getInstance().findById(state.getBlockType().getId()).states.get(parts[0]); - if (stateKey == null) { + Property propertyKey = BundledBlockData.getInstance().findById(state.getBlockType().getId()).states.get(parts[0]); + if (propertyKey == null) { throw new NoMatchException("Unknown state " + parts[0] + " for block " + state.getBlockType().getName()); } - StateValue value = stateKey.getValueFor(parts[1]); + Object value = propertyKey.getValueFor(parts[1]); if (value == null) { throw new NoMatchException("Unknown value " + parts[1] + " for state " + parts[0]); } - state = state.with(stateKey, value); + state = state.with(propertyKey, value); } catch (NoMatchException e) { throw e; // Pass-through } catch (Exception e) { @@ -186,7 +185,7 @@ class DefaultBlockParser extends InputParser { private BlockStateHolder parseLogic(String input, ParserContext context) throws InputParseException { BlockType blockType; - Map blockStates = new HashMap<>(); + Map, Object> blockStates = new HashMap<>(); String[] blockAndExtraData = input.trim().split("\\|"); blockAndExtraData[0] = woolMapper(blockAndExtraData[0]); Matcher matcher = blockStatePattern.matcher(blockAndExtraData[0]); 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 45aa2d97c..a04c25cfb 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 @@ -32,8 +32,8 @@ import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.transform.Transform; -import com.sk89q.worldedit.registry.state.DirectionalState; -import com.sk89q.worldedit.registry.state.State; +import com.sk89q.worldedit.registry.state.DirectionalProperty; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.registry.state.value.DirectionalStateValue; import java.util.Map; @@ -128,20 +128,20 @@ public class BlockTransformExtent extends AbstractDelegateExtent { checkNotNull(block); checkNotNull(transform); - Map states = WorldEdit.getInstance().getPlatformManager() + Map states = WorldEdit.getInstance().getPlatformManager() .queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getStates(block); if (states == null) { return changedBlock; } - for (State state : states.values()) { - if (state instanceof DirectionalState) { - DirectionalStateValue value = (DirectionalStateValue) block.getState(state); - if (value != null && value.getData() != null) { - DirectionalStateValue newValue = getNewStateValue((DirectionalState) state, transform, value.getDirection()); + for (Property property : states.values()) { + if (property instanceof DirectionalProperty) { + DirectionalStateValue value = (DirectionalStateValue) block.getState(property); + if (value != null) { + DirectionalStateValue newValue = getNewStateValue((DirectionalProperty) property, transform, value.getDirection()); if (newValue != null) { - changedBlock.with(state, newValue); + changedBlock.with(property, newValue); } } } @@ -159,7 +159,7 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * @return a new state or null if none could be found */ @Nullable - private static DirectionalStateValue getNewStateValue(DirectionalState state, Transform transform, Vector oldDirection) { + private static DirectionalStateValue getNewStateValue(DirectionalProperty state, Transform transform, Vector oldDirection) { Vector newDirection = transform.apply(oldDirection).subtract(transform.apply(Vector.ZERO)).normalize(); DirectionalStateValue newValue = null; double closest = -2; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/SimpleStateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java similarity index 59% rename from worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/SimpleStateValue.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java index 6558a0e71..91589ea84 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/SimpleStateValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java @@ -17,36 +17,31 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.registry.state.value; +package com.sk89q.worldedit.registry.state; -import java.util.Objects; +import static com.google.common.base.Preconditions.checkState; -public class SimpleStateValue implements StateValue { +public abstract class AbstractProperty implements Property { - private String data; + private String name; - @Override - public boolean isSet() { - return data != null; + public AbstractProperty() { + } + + public AbstractProperty(final String name) { + this.name = name; } @Override - public void set(String data) { - this.data = data; + public String getName() { + return this.name; } - @Override - public String getData() { - return this.data; - } - - @Override - public boolean equals(Object obj) { - return obj instanceof StateValue && Objects.equals(((StateValue) obj).getData(), getData()); - } - - @Override - public int hashCode() { - return this.data.hashCode(); + /** + * Internal method for name setting post-deserialise. Do not use. + */ + public void setName(final String name) { + checkState(this.name == null, "name already set"); + this.name = name; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java similarity index 74% rename from worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalState.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java index a4c83dd41..c165fdfff 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java @@ -23,9 +23,17 @@ import com.sk89q.worldedit.registry.state.value.DirectionalStateValue; import java.util.List; -public class DirectionalState extends SimpleState { +import javax.annotation.Nullable; - public DirectionalState(List values) { - super(values); +public class DirectionalProperty extends AbstractProperty { + @Override + public List getValues() { + return null; + } + + @Nullable + @Override + public DirectionalStateValue getValueFor(final String string) { + return null; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/State.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/Property.java similarity index 92% rename from worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/State.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/Property.java index ad6c819e6..069b279c5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/State.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/Property.java @@ -19,8 +19,6 @@ package com.sk89q.worldedit.registry.state; -import com.sk89q.worldedit.registry.state.value.SimpleStateValue; - import java.util.List; import javax.annotation.Nullable; @@ -31,7 +29,7 @@ import javax.annotation.Nullable; *

Example states include "variant" (indicating material or type) and * "facing" (indicating orientation).

*/ -public interface State { +public interface Property { /** * Returns the name of this state. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/SimpleState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/SimpleState.java deleted file mode 100644 index c31716d8f..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/SimpleState.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.registry.state; - -import com.sk89q.worldedit.registry.state.value.SimpleStateValue; - -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -import javax.annotation.Nullable; - -public class SimpleState implements State { - - private String name; - private List values; - - /** - * Creates a state with values - * - * @param values The values - */ - public SimpleState(List values) { - this.name = "Unknown"; - this.values = values; - } - - /** - * Internal method for name setting post-deserialise. Do not use. - */ - public void setName(String name) { - this.name = name; - } - - public String getName() { - return this.name; - } - - @Override - public List getValues() { - return Collections.unmodifiableList(values); - } - - @Nullable - @Override - public T getValueFor(String string) { - return values.stream().filter(value -> Objects.equals(value.getData(), string)).findFirst().orElse(null); - } -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java index 8923d7616..69d3e1ef4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.registry.state.value; import com.sk89q.worldedit.Vector; -public class DirectionalStateValue extends SimpleStateValue { +public class DirectionalStateValue { public Vector getDirection() { return new Vector(); // TODO diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/StateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/StateValue.java deleted file mode 100644 index 3cc989f66..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/StateValue.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.registry.state.value; - -import javax.annotation.Nullable; - -/** - * Describes a possible value for a {@code State}. - */ -public interface StateValue { - - /** - * Return whether this state is set on the given block. - * - * @return true if this value is set - */ - boolean isSet(); - - /** - * Set the state to the given value. - */ - void set(String data); - - /** - * Returns the data associated with this value. - * - * @return The data, otherwise null - */ - @Nullable - String getData(); - -} 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 2a0271e93..5297179f2 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 @@ -23,8 +23,7 @@ import com.google.common.collect.ArrayTable; import com.google.common.collect.HashBasedTable; import com.google.common.collect.Maps; import com.google.common.collect.Table; -import com.sk89q.worldedit.registry.state.State; -import com.sk89q.worldedit.registry.state.value.StateValue; +import com.sk89q.worldedit.registry.state.Property; import java.util.ArrayList; import java.util.Collections; @@ -39,11 +38,11 @@ import java.util.Map; public class BlockState implements BlockStateHolder { private final BlockType blockType; - private final Map values; + private final Map, Object> values; private final boolean fuzzy; // Neighbouring state table. - private Table states; + private Table, Object, BlockState> states; BlockState(BlockType blockType) { this.blockType = blockType; @@ -57,21 +56,21 @@ public class BlockState implements BlockStateHolder { * @param blockType The block type * @param values The block state values */ - public BlockState(BlockType blockType, Map values) { + public BlockState(BlockType blockType, Map, Object> values) { this.blockType = blockType; this.values = values; this.fuzzy = true; } - public void populate(Map, BlockState> stateMap) { - final Table states = HashBasedTable.create(); + public void populate(Map, Object>, BlockState> stateMap) { + final Table, Object, BlockState> states = HashBasedTable.create(); - for(final Map.Entry entry : this.values.entrySet()) { - final State state = entry.getKey(); + for(final Map.Entry, Object> entry : this.values.entrySet()) { + final Property property = entry.getKey(); - state.getValues().forEach(value -> { + property.getValues().forEach(value -> { if(value != entry.getValue()) { - states.put(state, (StateValue) value, stateMap.get(this.withValue(state, (StateValue) value))); + states.put(property, value, stateMap.get(this.withValue(property, value))); } }); } @@ -79,8 +78,8 @@ public class BlockState implements BlockStateHolder { this.states = states.isEmpty() ? states : ArrayTable.create(states); } - private Map withValue(final State property, final StateValue value) { - final Map values = Maps.newHashMap(this.values); + private Map, Object> withValue(final Property property, final V value) { + final Map, Object> values = Maps.newHashMap(this.values); values.put(property, value); return values; } @@ -91,22 +90,22 @@ public class BlockState implements BlockStateHolder { } @Override - public BlockState with(State state, StateValue value) { + public BlockState with(final Property property, final V value) { if (fuzzy) { - return setState(state, value); + return setState(property, value); } else { - BlockState result = states.get(state, value); + BlockState result = states.get(property, value); return result == null ? this : result; } } @Override - public StateValue getState(State state) { - return this.values.get(state); + public V getState(final Property property) { + return (V) this.values.get(property); } @Override - public Map getStates() { + public Map, Object> getStates() { return Collections.unmodifiableMap(this.values); } @@ -120,20 +119,20 @@ public class BlockState implements BlockStateHolder { return false; } - List differingStates = new ArrayList<>(); + List differingProperties = new ArrayList<>(); for (Object state : o.getStates().keySet()) { - if (getState((State) state) == null) { - differingStates.add((State) state); + if (getState((Property) state) == null) { + differingProperties.add((Property) state); } } - for (State state : getStates().keySet()) { - if (o.getState(state) == null) { - differingStates.add(state); + for (Property property : getStates().keySet()) { + if (o.getState(property) == null) { + differingProperties.add(property); } } - for (State state : differingStates) { - if (!getState(state).equals(o.getState(state))) { + for (Property property : differingProperties) { + if (!getState(property).equals(o.getState(property))) { return false; } } @@ -151,12 +150,12 @@ public class BlockState implements BlockStateHolder { * * Sets a value. DO NOT USE THIS. * - * @param state The state + * @param property The state * @param value The value * @return The blockstate, for chaining */ - private BlockState setState(State state, StateValue value) { - this.values.put(state, value); + private BlockState setState(final Property property, final V value) { + this.values.put(property, value); return this; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java index e1382ec04..10f171177 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java @@ -19,8 +19,7 @@ package com.sk89q.worldedit.world.block; -import com.sk89q.worldedit.registry.state.State; -import com.sk89q.worldedit.registry.state.value.StateValue; +import com.sk89q.worldedit.registry.state.Property; import java.util.Map; @@ -36,26 +35,26 @@ public interface BlockStateHolder { /** * Returns a BlockState with the given state and value applied. * - * @param state The state + * @param property The state * @param value The value * @return The modified state, or same if could not be applied */ - T with(State state, StateValue value); + T with(final Property property, final V value); /** * Gets the value at the given state * - * @param state The state + * @param property The state * @return The value */ - StateValue getState(State state); + V getState(Property property); /** * Gets an immutable collection of the states. * * @return The states */ - Map getStates(); + Map, Object> getStates(); /** * Checks if the type is the same, and if the matched states are the same. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index 6320c2efc..02a50c1ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.registry.state.State; +import com.sk89q.worldedit.registry.state.Property; import java.util.Map; @@ -58,6 +58,6 @@ public interface BlockRegistry { * @return a map of states where the key is the state's ID */ @Nullable - Map getStates(BlockStateHolder block); + Map getStates(BlockStateHolder block); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index a839bb179..e17ebc99a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -25,9 +25,9 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BlockMaterial; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.gson.VectorAdapter; -import com.sk89q.worldedit.registry.state.SimpleState; -import com.sk89q.worldedit.registry.state.State; +import com.sk89q.worldedit.registry.state.AbstractProperty; import javax.annotation.Nullable; import java.io.IOException; @@ -128,7 +128,7 @@ public class BundledBlockData { * @return the block's states, or null if no information is available */ @Nullable - public Map getStatesById(String id) { + public Map getStatesById(String id) { BlockEntry entry = findById(id); if (entry != null) { return entry.states; @@ -151,11 +151,11 @@ public class BundledBlockData { private String unlocalizedName; public String localizedName; private List aliases; - public Map states = new HashMap<>(); + public Map states = new HashMap<>(); private SimpleBlockMaterial material = new SimpleBlockMaterial(); void postDeserialization() { - for (Map.Entry state : states.entrySet()) { + for (Map.Entry state : states.entrySet()) { state.getValue().setName(state.getKey()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 588df83c7..0d57ad7aa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -20,10 +20,10 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BlockMaterial; +import com.sk89q.worldedit.registry.state.Property; 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.registry.state.State; import java.util.Map; @@ -49,7 +49,7 @@ public class BundledBlockRegistry implements BlockRegistry { @Nullable @Override - public Map getStates(BlockStateHolder block) { + public Map getStates(BlockStateHolder block) { return BundledBlockData.getInstance().getStatesById(block.getBlockType().getId()); } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index 52730b518..0129d9d0e 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; @@ -35,8 +36,6 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.registry.state.State; -import com.sk89q.worldedit.registry.state.value.StateValue; import org.spongepowered.api.Sponge; import org.spongepowered.api.block.BlockSnapshot; import org.spongepowered.api.block.BlockState; @@ -116,7 +115,7 @@ public abstract class SpongeWorld extends AbstractWorld { protected BlockState getBlockState(BlockStateHolder block) { if (block instanceof com.sk89q.worldedit.world.block.BlockState) { BlockState state = Sponge.getRegistry().getType(BlockType.class, block.getBlockType().getId()).orElse(BlockTypes.AIR).getDefaultState(); - for (Map.Entry entry : block.getStates().entrySet()) { + for (Map.Entry, Object> entry : block.getStates().entrySet()) { // TODO Convert across states } return state; From 724661d9032228df29e2fc57b5b53ae83606d2aa Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 9 Jul 2018 17:17:10 +1000 Subject: [PATCH 38/74] Fixed DefaultBlockParser not working for things with _ --- .../sk89q/worldedit/extension/factory/DefaultBlockParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index cd73b31f3..a1b18a251 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -99,7 +99,7 @@ class DefaultBlockParser extends InputParser { } } - private static Pattern blockStatePattern = Pattern.compile("([a-z:]+)(?:\\[([a-zA-Z0-9=, ]+)])?", Pattern.CASE_INSENSITIVE); + private static Pattern blockStatePattern = Pattern.compile("([a-z:_]+)(?:\\[([a-zA-Z0-9=, _]+)])?", Pattern.CASE_INSENSITIVE); private static String[] EMPTY_STRING_ARRAY = new String[]{}; /** From ca06a05117c2e7acbc3393371c9e6ed20df50f05 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 12 Jul 2018 22:23:03 +1000 Subject: [PATCH 39/74] Update the Bukkit adapter to the Spigot API Preview --- worldedit-bukkit/build.gradle | 4 +- .../bukkit/util/CommandRegistration.java | 2 +- .../util/CommandsManagerRegistration.java | 4 +- .../ConfigurationPermissionsResolver.java | 14 +-- .../com/sk89q/wepif/DinnerPermsResolver.java | 4 +- .../wepif/FlatFilePermissionsResolver.java | 14 +-- .../sk89q/wepif/NijiPermissionsResolver.java | 2 +- .../com/sk89q/wepif/PermissionsProvider.java | 16 +-- .../com/sk89q/wepif/PermissionsResolver.java | 4 +- .../wepif/PermissionsResolverManager.java | 6 +- .../worldedit/bukkit/BukkitEntityType.java | 2 +- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 6 +- .../bukkit/BukkitPlayerBlockBag.java | 12 +- .../bukkit/BukkitServerInterface.java | 6 +- .../sk89q/worldedit/bukkit/BukkitUtil.java | 35 ++++-- .../sk89q/worldedit/bukkit/BukkitWorld.java | 22 ++-- .../EditSessionBlockChangeDelegate.java | 93 +++++++------- .../worldedit/bukkit/WorldEditPlugin.java | 71 +---------- .../bukkit/adapter/BukkitImplLoader.java | 2 +- .../bukkit/selections/CuboidSelection.java | 70 ----------- .../bukkit/selections/CylinderSelection.java | 79 ------------ .../selections/Polygonal2DSelection.java | 62 --------- .../bukkit/selections/RegionSelection.java | 118 ------------------ .../bukkit/selections/Selection.java | 113 ----------------- .../sk89q/wepif/TestOfflinePermissible.java | 9 +- .../worldedit/bukkit/BukkitWorldTest.java | 7 +- .../generator/GardenPatchGenerator.java | 8 +- .../sk89q/worldedit/forge/ForgeWorldEdit.java | 2 +- .../worldedit/sponge/CUIChannelHandler.java | 2 +- 29 files changed, 139 insertions(+), 650 deletions(-) delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CylinderSelection.java delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/RegionSelection.java delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Selection.java diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index d396a2574..1d6e5428e 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -10,8 +10,8 @@ repositories { dependencies { compile project(':worldedit-core') compile 'com.sk89q:dummypermscompat:1.8' -// compile 'org.bukkit:bukkit:18w15a-R0.1-SNAPSHOT' // zzz - compile 'org.bukkit:bukkit:1.9.4-R0.1-SNAPSHOT' // zzz + compile 'org.bukkit:bukkit:1.13-pre5-R0.1-SNAPSHOT' // zzz +// compile 'org.bukkit:bukkit:1.9.4-R0.1-SNAPSHOT' // zzz testCompile 'org.mockito:mockito-core:1.9.0-rc1' } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandRegistration.java b/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandRegistration.java index 2417b2ced..e7df6832c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandRegistration.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandRegistration.java @@ -82,7 +82,7 @@ public class CommandRegistration { public boolean unregisterCommands() { CommandMap commandMap = getCommandMap(); - List toRemove = new ArrayList(); + List toRemove = new ArrayList<>(); Map knownCommands = ReflectionUtil.getField(commandMap, "knownCommands"); Set aliases = ReflectionUtil.getField(commandMap, "aliases"); if (knownCommands == null || aliases == null) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandsManagerRegistration.java b/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandsManagerRegistration.java index 175c51c6d..5f8bfbc8c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandsManagerRegistration.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandsManagerRegistration.java @@ -50,7 +50,7 @@ public class CommandsManagerRegistration extends CommandRegistration { } public boolean registerAll(List registered) { - List toRegister = new ArrayList(); + List toRegister = new ArrayList<>(); for (Command command : registered) { List permissions = null; Method cmdMethod = commands.getMethods().get(null).get(command.aliases()[0]); @@ -59,7 +59,7 @@ public class CommandsManagerRegistration extends CommandRegistration { if (cmdMethod != null && cmdMethod.isAnnotationPresent(CommandPermissions.class)) { permissions = Arrays.asList(cmdMethod.getAnnotation(CommandPermissions.class).value()); } else if (cmdMethod != null && childMethods != null && !childMethods.isEmpty()) { - permissions = new ArrayList(); + permissions = new ArrayList<>(); for (Method m : childMethods.values()) { if (m.isAnnotationPresent(CommandPermissions.class)) { permissions.addAll(Arrays.asList(m.getAnnotation(CommandPermissions.class).value())); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java index 75beabdf2..b309265d6 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java @@ -52,11 +52,11 @@ public class ConfigurationPermissionsResolver implements PermissionsResolver { @Override public void load() { - userGroups = new HashMap>(); - userPermissionsCache = new HashMap>(); - defaultPermissionsCache = new HashSet(); + userGroups = new HashMap<>(); + userPermissionsCache = new HashMap<>(); + defaultPermissionsCache = new HashSet<>(); - Map> userGroupPermissions = new HashMap>(); + Map> userGroupPermissions = new HashMap<>(); List groupKeys = config.getStringList("permissions.groups", null); @@ -66,7 +66,7 @@ public class ConfigurationPermissionsResolver implements PermissionsResolver { config.getStringList("permissions.groups." + key + ".permissions", null); if (!permissions.isEmpty()) { - Set groupPerms = new HashSet(permissions); + Set groupPerms = new HashSet<>(permissions); userGroupPermissions.put(key, groupPerms); if (key.equals("default")) { @@ -80,7 +80,7 @@ public class ConfigurationPermissionsResolver implements PermissionsResolver { if (userKeys != null) { for (String key : userKeys) { - Set permsCache = new HashSet(); + Set permsCache = new HashSet<>(); List permissions = config.getStringList("permissions.users." + key + ".permissions", null); @@ -103,7 +103,7 @@ public class ConfigurationPermissionsResolver implements PermissionsResolver { } userPermissionsCache.put(key.toLowerCase(), permsCache); - userGroups.put(key.toLowerCase(), new HashSet(groups)); + userGroups.put(key.toLowerCase(), new HashSet<>(groups)); } } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/DinnerPermsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/DinnerPermsResolver.java index 4e8199f9b..d5f9c7fc6 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/DinnerPermsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/DinnerPermsResolver.java @@ -114,13 +114,13 @@ public class DinnerPermsResolver implements PermissionsResolver { if (perms == null) { return new String[0]; } - List groupNames = new ArrayList(); + List groupNames = new ArrayList<>(); for (PermissionAttachmentInfo permAttach : perms.getEffectivePermissions()) { String perm = permAttach.getPermission(); if (!(perm.startsWith(GROUP_PREFIX) && permAttach.getValue())) { continue; } - groupNames.add(perm.substring(GROUP_PREFIX.length(), perm.length())); + groupNames.add(perm.substring(GROUP_PREFIX.length())); } return groupNames.toArray(new String[groupNames.size()]); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java index 704694c9f..3f2324596 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java @@ -67,7 +67,7 @@ public class FlatFilePermissionsResolver implements PermissionsResolver { } public Map> loadGroupPermissions() { - Map> userGroupPermissions = new HashMap>(); + Map> userGroupPermissions = new HashMap<>(); BufferedReader buff = null; @@ -93,7 +93,7 @@ public class FlatFilePermissionsResolver implements PermissionsResolver { if (parts.length > 1) { String[] perms = parts[1].split(","); - Set groupPerms = new HashSet(Arrays.asList(perms)); + Set groupPerms = new HashSet<>(Arrays.asList(perms)); userGroupPermissions.put(key, groupPerms); } } @@ -113,9 +113,9 @@ public class FlatFilePermissionsResolver implements PermissionsResolver { @Override public void load() { - userGroups = new HashMap>(); - userPermissionsCache = new HashMap>(); - defaultPermissionsCache = new HashSet(); + userGroups = new HashMap<>(); + userPermissionsCache = new HashMap<>(); + defaultPermissionsCache = new HashSet<>(); Map> userGroupPermissions = loadGroupPermissions(); @@ -131,7 +131,7 @@ public class FlatFilePermissionsResolver implements PermissionsResolver { String line; while ((line = buff.readLine()) != null) { - Set permsCache = new HashSet(); + Set permsCache = new HashSet<>(); line = line.trim(); @@ -160,7 +160,7 @@ public class FlatFilePermissionsResolver implements PermissionsResolver { } userPermissionsCache.put(key.toLowerCase(), permsCache); - userGroups.put(key.toLowerCase(), new HashSet(Arrays.asList(groups))); + userGroups.put(key.toLowerCase(), new HashSet<>(Arrays.asList(groups))); } } } catch (IOException e) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java index f3502d460..182a29faf 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java @@ -50,7 +50,7 @@ public class NijiPermissionsResolver implements PermissionsResolver { Plugin plugin = pluginManager.getPlugin("Permissions"); // Check if plugin is loaded and has Permissions interface - if (plugin == null || !(plugin instanceof Permissions)) { + if (!(plugin instanceof Permissions)) { return null; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsProvider.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsProvider.java index 2d9be46a3..8332a519b 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsProvider.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsProvider.java @@ -22,19 +22,19 @@ package com.sk89q.wepif; import org.bukkit.OfflinePlayer; public interface PermissionsProvider { - public boolean hasPermission(String name, String permission); + boolean hasPermission(String name, String permission); - public boolean hasPermission(String worldName, String name, String permission); + boolean hasPermission(String worldName, String name, String permission); - public boolean inGroup(String player, String group); + boolean inGroup(String player, String group); - public String[] getGroups(String player); + String[] getGroups(String player); - public boolean hasPermission(OfflinePlayer player, String permission); + boolean hasPermission(OfflinePlayer player, String permission); - public boolean hasPermission(String worldName, OfflinePlayer player, String permission); + boolean hasPermission(String worldName, OfflinePlayer player, String permission); - public boolean inGroup(OfflinePlayer player, String group); + boolean inGroup(OfflinePlayer player, String group); - public String[] getGroups(OfflinePlayer player); + String[] getGroups(OfflinePlayer player); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolver.java index 1423ede23..918c1bc23 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolver.java @@ -20,7 +20,7 @@ package com.sk89q.wepif; public interface PermissionsResolver extends PermissionsProvider { - public void load(); + void load(); - public String getDetectionMessage(); + String getDetectionMessage(); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java index babc4a4cf..01f04546b 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java @@ -86,7 +86,7 @@ public class PermissionsResolverManager implements PermissionsResolver { private PermissionsResolver permissionResolver; private YAMLProcessor config; private Logger logger = Logger.getLogger(getClass().getCanonicalName()); - private List> enabledResolvers = new ArrayList>(); + private List> enabledResolvers = new ArrayList<>(); @SuppressWarnings("unchecked") protected Class[] availableResolvers = new Class[] { @@ -213,7 +213,7 @@ public class PermissionsResolverManager implements PermissionsResolver { if (!keys.contains("resolvers")) { //List resolverKeys = config.getKeys("resolvers"); - List resolvers = new ArrayList(); + List resolvers = new ArrayList<>(); for (Class clazz : availableResolvers) { resolvers.add(clazz.getSimpleName()); } @@ -221,7 +221,7 @@ public class PermissionsResolverManager implements PermissionsResolver { config.setProperty("resolvers.enabled", resolvers); isUpdated = true; } else { - List disabledResolvers = config.getStringList("resolvers.disabled", new ArrayList()); + List disabledResolvers = config.getStringList("resolvers.disabled", new ArrayList<>()); List stagedEnabled = config.getStringList("resolvers.enabled", null); for (Iterator i = stagedEnabled.iterator(); i.hasNext();) { String nextName = i.next(); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityType.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityType.java index 43d20b6b9..67ec4d2c8 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityType.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityType.java @@ -138,7 +138,7 @@ class BukkitEntityType implements EntityType { @Override public boolean isTagged() { - return entity instanceof LivingEntity && ((LivingEntity) entity).getCustomName() != null; + return entity instanceof LivingEntity && entity.getCustomName() != null; } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index 1b5b140d4..983e61770 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -69,7 +69,7 @@ public class BukkitPlayer extends AbstractPlayerActor { ItemStack itemStack = handSide == HandSide.MAIN_HAND ? player.getInventory().getItemInMainHand() : player.getInventory().getItemInOffHand(); - return BukkitUtil.toBlock(itemStack); + return new BaseBlock(BukkitUtil.toBlock(itemStack)); } @Override @@ -79,7 +79,7 @@ public class BukkitPlayer extends AbstractPlayerActor { @Override public void giveItem(BaseItemStack itemStack) { - player.getInventory().addItem(new ItemStack(itemStack.getLegacyId(), itemStack.getAmount())); + player.getInventory().addItem(BukkitUtil.toItemStack(itemStack)); } @Override @@ -223,7 +223,7 @@ public class BukkitPlayer extends AbstractPlayerActor { // CopyOnWrite list for the list of players, but the Bukkit // specification doesn't require thread safety (though the // spec is extremely incomplete) - return Bukkit.getServer().getPlayerExact(name) != null; + return Bukkit.getServer().getPlayer(uuid) != null; } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index 1fe40ef5b..05f3d4609 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.bukkit; +import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.inventory.BlockBag; @@ -78,8 +79,7 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (bukkitItem.getTypeId() != blockState.getBlockType().getLegacyId()) { - // TODO Fix when bukkit gets not awful + if (!bukkitItem.getType().getKey().toString().equals(blockState.getBlockType().getId())) { // Type id doesn't fit continue; } @@ -111,6 +111,9 @@ public class BukkitPlayerBlockBag extends BlockBag { if (blockState.getBlockType() == BlockTypes.AIR) { throw new IllegalArgumentException("Can't store air block"); } + if (!blockState.getBlockType().hasItemType()) { + throw new IllegalArgumentException("This block cannot be stored"); + } loadInventory(); @@ -129,8 +132,7 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (bukkitItem.getTypeId() != blockState.getBlockType().getLegacyId()) { - // TODO Fix when bukkit gets not terrible + if (!bukkitItem.getType().getKey().toString().equals(blockState.getBlockType().getId())) { // Type id doesn't fit continue; } @@ -156,7 +158,7 @@ public class BukkitPlayerBlockBag extends BlockBag { } if (freeSlot > -1) { - items[freeSlot] = new ItemStack(blockState.getBlockType().getLegacyId(), amount); // TODO Ditto + items[freeSlot] = new ItemStack(BukkitUtil.toItemStack(new BaseItemStack(blockState.getBlockType().getItemType(), amount))); return; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java index 8c125dc9b..e66fdaa40 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java @@ -117,7 +117,7 @@ public class BukkitServerInterface implements MultiUserPlatform { @Override public void registerCommands(Dispatcher dispatcher) { - List toRegister = new ArrayList(); + List toRegister = new ArrayList<>(); BukkitCommandInspector inspector = new BukkitCommandInspector(plugin, dispatcher); for (CommandMapping command : dispatcher.getCommands()) { @@ -159,7 +159,7 @@ public class BukkitServerInterface implements MultiUserPlatform { @Override public Map getCapabilities() { - Map capabilities = new EnumMap(Capability.class); + Map capabilities = new EnumMap<>(Capability.class); capabilities.put(Capability.CONFIGURATION, Preference.NORMAL); capabilities.put(Capability.WORLDEDIT_CUI, Preference.NORMAL); capabilities.put(Capability.GAME_HOOKS, Preference.PREFERRED); @@ -175,7 +175,7 @@ public class BukkitServerInterface implements MultiUserPlatform { @Override public Collection getConnectedUsers() { - List users = new ArrayList(); + List users = new ArrayList<>(); for (org.bukkit.entity.Player player : Bukkit.getServer().getOnlinePlayers()) { users.add(new BukkitPlayer(plugin, player)); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index 4cb965341..9f8f7a969 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -22,17 +22,19 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; -import com.sk89q.worldedit.world.registry.LegacyMapper; +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.item.ItemTypes; +import org.bukkit.Bukkit; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.block.data.BlockData; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -121,17 +123,28 @@ public final class BukkitUtil { return ((BukkitWorld) world).getWorld(); } - public static BaseBlock toBlock(ItemStack itemStack) throws WorldEditException { - ItemType itemType = LegacyMapper.getInstance().getItemFromLegacy(itemStack.getTypeId(), itemStack.getData().getData()); - if (itemType.hasBlockType()) { - return new BaseBlock(itemType.getBlockType().getDefaultState()); + public static BlockState toBlock(BlockData blockData) { + return null; // TODO BLOCKING + } + + public static BlockData toBlock(BlockStateHolder block) { + return Bukkit.createBlockData(block.toString()); // TODO BLOCKING + } + + public static BlockState toBlock(ItemStack itemStack) throws WorldEditException { + if (itemStack.getType().isBlock()) { + return toBlock(itemStack.getType().createBlockData()); } else { - return new BaseBlock(BlockTypes.AIR.getDefaultState()); + return BlockTypes.AIR.getDefaultState(); } } public static BaseItemStack toBaseItemStack(ItemStack itemStack) { - ItemType itemType = LegacyMapper.getInstance().getItemFromLegacy(itemStack.getTypeId(), itemStack.getData().getData()); - return new BaseItemStack(itemType, itemStack.getAmount()); + return new BaseItemStack(ItemTypes.get(itemStack.getType().getKey().toString()), itemStack.getAmount()); + } + + public static ItemStack toItemStack(BaseItemStack item) { + BlockData blockData = Bukkit.createBlockData(item.getType().getId()); + return new ItemStack(blockData.getMaterial(), item.getAmount()); } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 955c1cf9e..4333cd7af 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -30,7 +30,6 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.history.change.BlockChange; @@ -38,7 +37,7 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; -import com.sk89q.worldedit.world.registry.LegacyMapper; +import com.sk89q.worldedit.world.block.BlockStateHolder; import org.bukkit.Effect; import org.bukkit.TreeType; import org.bukkit.World; @@ -49,7 +48,6 @@ import org.bukkit.block.Chest; import org.bukkit.entity.Entity; import org.bukkit.inventory.DoubleChestInventory; import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -286,15 +284,16 @@ public class BukkitWorld extends AbstractWorld { public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Vector pt) { World world = getWorld(); TreeType bukkitType = toBukkitTreeType(type); - return type != null && world.generateTree(BukkitUtil.toLocation(world, pt), bukkitType, - new EditSessionBlockChangeDelegate(editSession)); + return type != null && world.generateTree(BukkitUtil.toLocation(world, pt), bukkitType); +// return type != null && world.generateTree(BukkitUtil.toLocation(world, pt), bukkitType, +// new EditSessionBlockChangeDelegate(editSession)); + // TODO } @Override public void dropItem(Vector pt, BaseItemStack item) { World world = getWorld(); - ItemStack bukkitItem = new ItemStack(item.getLegacyId(), item.getAmount()); // TODO Add data. - world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem); + world.dropItemNaturally(BukkitUtil.toLocation(world, pt), BukkitUtil.toItemStack(item)); } @Override @@ -359,7 +358,7 @@ public class BukkitWorld extends AbstractWorld { @Override public com.sk89q.worldedit.world.block.BlockState getBlock(Vector position) { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - return LegacyMapper.getInstance().getBlockFromLegacy(bukkitBlock.getTypeId(), bukkitBlock.getData()); + return BukkitUtil.toBlock(bukkitBlock.getBlockData()); } @Override @@ -369,11 +368,8 @@ public class BukkitWorld extends AbstractWorld { return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight); } else { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(block.toImmutableState()); - if (datas == null) { - throw new WorldEditException("Unknown block"){}; // TODO Remove. - } - return bukkitBlock.setTypeIdAndData(datas[0], (byte) datas[1], notifyAndLight); + bukkitBlock.setData(BukkitUtil.toBlock(block), notifyAndLight); + return true; } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java index df900feb5..9a9bfc219 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java @@ -19,17 +19,12 @@ package com.sk89q.worldedit.bukkit; -import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.world.registry.LegacyMapper; -import org.bukkit.BlockChangeDelegate; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.MaxChangedBlocksException; /** * Proxy class to catch calls to set blocks. */ -public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { +public class EditSessionBlockChangeDelegate {//implements BlockChangeDelegate { private EditSession editSession; @@ -37,48 +32,50 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { this.editSession = editSession; } - @Override - public boolean setRawTypeId(int x, int y, int z, int typeId) { - try { - return editSession.setBlock(new Vector(x, y, z), LegacyMapper.getInstance().getBlockFromLegacy(typeId)); - } catch (MaxChangedBlocksException ex) { - return false; - } - } + // TODO This needs a fix in Spigot itself - @Override - public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data) { - try { - return editSession.setBlock(new Vector(x, y, z), LegacyMapper.getInstance().getBlockFromLegacy(typeId, data)); - } catch (MaxChangedBlocksException ex) { - return false; - } - } - - @Override - public boolean setTypeId(int x, int y, int z, int typeId) { - return setRawTypeId(x, y, z, typeId); - } - - @Override - public boolean setTypeIdAndData(int x, int y, int z, int typeId, int data) { - return setRawTypeIdAndData(x, y, z, typeId, data); - } - - @Override - public int getTypeId(int x, int y, int z) { - int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(editSession.getBlock(new Vector(x, y, z))); - return datas[0]; - } - - @Override - public int getHeight() { - return editSession.getWorld().getMaxY() + 1; - } - - @Override - public boolean isEmpty(int x, int y, int z) { - return editSession.getBlock(new Vector(x, y, z)).getBlockType() == BlockTypes.AIR; - } +// @Override +// public boolean setRawTypeId(int x, int y, int z, int typeId) { +// try { +// return editSession.setBlock(new Vector(x, y, z), LegacyMapper.getInstance().getBlockFromLegacy(typeId)); +// } catch (MaxChangedBlocksException ex) { +// return false; +// } +// } +// +// @Override +// public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data) { +// try { +// return editSession.setBlock(new Vector(x, y, z), LegacyMapper.getInstance().getBlockFromLegacy(typeId, data)); +// } catch (MaxChangedBlocksException ex) { +// return false; +// } +// } +// +// @Override +// public boolean setTypeId(int x, int y, int z, int typeId) { +// return setRawTypeId(x, y, z, typeId); +// } +// +// @Override +// public boolean setTypeIdAndData(int x, int y, int z, int typeId, int data) { +// return setRawTypeIdAndData(x, y, z, typeId, data); +// } +// +// @Override +// public int getTypeId(int x, int y, int z) { +// int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(editSession.getBlock(new Vector(x, y, z))); +// return datas[0]; +// } +// +// @Override +// public int getHeight() { +// return editSession.getWorld().getMaxY() + 1; +// } +// +// @Override +// public boolean isEmpty(int x, int y, int z) { +// return editSession.getBlock(new Vector(x, y, z)).getBlockType() == BlockTypes.AIR; +// } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 4910db731..0122352ae 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -25,16 +25,11 @@ import com.google.common.base.Joiner; import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.wepif.PermissionsResolverManager; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.bukkit.adapter.AdapterLoadException; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.bukkit.adapter.BukkitImplLoader; -import com.sk89q.worldedit.bukkit.selections.CuboidSelection; -import com.sk89q.worldedit.bukkit.selections.CylinderSelection; -import com.sk89q.worldedit.bukkit.selections.Polygonal2DSelection; -import com.sk89q.worldedit.bukkit.selections.Selection; import com.sk89q.worldedit.event.platform.CommandEvent; import com.sk89q.worldedit.event.platform.CommandSuggestionEvent; import com.sk89q.worldedit.event.platform.PlatformReadyEvent; @@ -42,12 +37,6 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.inventory.BlockBag; -import com.sk89q.worldedit.regions.CuboidRegion; -import com.sk89q.worldedit.regions.CylinderRegion; -import com.sk89q.worldedit.regions.Polygonal2DRegion; -import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.regions.RegionSelector; -import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; @@ -73,7 +62,7 @@ import javax.annotation.Nullable; public class WorldEditPlugin extends JavaPlugin implements TabCompleter { private static final Logger log = Logger.getLogger(WorldEditPlugin.class.getCanonicalName()); - public static final String CUI_PLUGIN_CHANNEL = "WECUI"; + public static final String CUI_PLUGIN_CHANNEL = "worldedit:cui"; private static WorldEditPlugin INSTANCE; private BukkitImplAdapter bukkitAdapter; @@ -346,64 +335,6 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { return WorldEdit.getInstance(); } - /** - * Gets the region selection for the player. - * - * @param player aplayer - * @return the selection or null if there was none - */ - public Selection getSelection(Player player) { - if (player == null) { - throw new IllegalArgumentException("Null player not allowed"); - } - if (!player.isOnline()) { - throw new IllegalArgumentException("Offline player not allowed"); - } - - LocalSession session = WorldEdit.getInstance().getSessionManager().get(wrapPlayer(player)); - RegionSelector selector = session.getRegionSelector(BukkitUtil.getWorld(player.getWorld())); - - try { - Region region = selector.getRegion(); - World world = BukkitAdapter.asBukkitWorld(session.getSelectionWorld()).getWorld(); - - if (region instanceof CuboidRegion) { - return new CuboidSelection(world, selector, (CuboidRegion) region); - } else if (region instanceof Polygonal2DRegion) { - return new Polygonal2DSelection(world, selector, (Polygonal2DRegion) region); - } else if (region instanceof CylinderRegion) { - return new CylinderSelection(world, selector, (CylinderRegion) region); - } else { - return null; - } - } catch (IncompleteRegionException e) { - return null; - } - } - - /** - * Sets the region selection for a player. - * - * @param player the player - * @param selection a selection - */ - public void setSelection(Player player, Selection selection) { - if (player == null) { - throw new IllegalArgumentException("Null player not allowed"); - } - if (!player.isOnline()) { - throw new IllegalArgumentException("Offline player not allowed"); - } - if (selection == null) { - throw new IllegalArgumentException("Null selection not allowed"); - } - - LocalSession session = WorldEdit.getInstance().getSessionManager().get(wrapPlayer(player)); - RegionSelector sel = selection.getRegionSelector(); - session.setRegionSelector(BukkitUtil.getWorld(player.getWorld()), sel); - session.dispatchCUISelection(wrapPlayer(player)); - } - /** * Gets the instance of this plugin. * diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java index 1bb953421..40a94baf1 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java @@ -38,7 +38,7 @@ import java.util.logging.Logger; public class BukkitImplLoader { private static final Logger log = Logger.getLogger(BukkitImplLoader.class.getCanonicalName()); - private final List adapterCandidates = new ArrayList(); + private final List adapterCandidates = new ArrayList<>(); private String customCandidate; private static final String SEARCH_PACKAGE = "com.sk89q.worldedit.bukkit.adapter.impl"; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java deleted file mode 100644 index 9f1783dde..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit.selections; - -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.bukkit.BukkitUtil; -import com.sk89q.worldedit.regions.CuboidRegion; -import com.sk89q.worldedit.regions.RegionSelector; -import com.sk89q.worldedit.regions.selector.CuboidRegionSelector; -import com.sk89q.worldedit.regions.selector.limit.PermissiveSelectorLimits; -import org.bukkit.Location; -import org.bukkit.World; - -public class CuboidSelection extends RegionSelection { - - protected CuboidRegion cuboid; - - public CuboidSelection(World world, Location pt1, Location pt2) { - this(world, BukkitUtil.toVector(pt1), BukkitUtil.toVector(pt2)); - } - - public CuboidSelection(World world, Vector pt1, Vector pt2) { - super(world); - - // Validate input - if (pt1 == null) { - throw new IllegalArgumentException("Null point 1 not permitted"); - } - - if (pt2 == null) { - throw new IllegalArgumentException("Null point 2 not permitted"); - } - - // Create new selector - CuboidRegionSelector sel = new CuboidRegionSelector(BukkitUtil.getWorld(world)); - - // set up selector - sel.selectPrimary(pt1, PermissiveSelectorLimits.getInstance()); - sel.selectSecondary(pt2, PermissiveSelectorLimits.getInstance()); - - // set up CuboidSelection - cuboid = sel.getIncompleteRegion(); - - // set up RegionSelection - setRegionSelector(sel); - setRegion(cuboid); - } - - public CuboidSelection(World world, RegionSelector sel, CuboidRegion region) { - super(world, sel, region); - this.cuboid = region; - } -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CylinderSelection.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CylinderSelection.java deleted file mode 100644 index 2a5282146..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/CylinderSelection.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit.selections; - -import com.sk89q.worldedit.regions.selector.CylinderRegionSelector; -import org.bukkit.World; - -import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.bukkit.BukkitUtil; -import com.sk89q.worldedit.regions.CylinderRegion; -import com.sk89q.worldedit.regions.RegionSelector; - -/** - * A selection representing a {@link CylinderRegion} - */ -public class CylinderSelection extends RegionSelection { - - private CylinderRegion cylRegion; - - public CylinderSelection(World world, RegionSelector selector, CylinderRegion region) { - super(world, selector, region); - this.cylRegion = region; - } - - public CylinderSelection(World world, BlockVector2D center, BlockVector2D radius, int minY, int maxY) { - super(world); - com.sk89q.worldedit.world.World lWorld = BukkitUtil.getWorld(world); - - // Validate input - minY = Math.min(Math.max(0, minY), world.getMaxHeight()); - maxY = Math.min(Math.max(0, maxY), world.getMaxHeight()); - - // Create and set up new selector - CylinderRegionSelector sel = new CylinderRegionSelector(lWorld, center, radius, minY, maxY); - - // set up selection - cylRegion = sel.getIncompleteRegion(); - - // set up RegionSelection - setRegionSelector(sel); - setRegion(cylRegion); - } - - /** - * Returns the center vector of the cylinder - * - * @return the center - */ - public BlockVector2D getCenter() { - return cylRegion.getCenter().toVector2D().toBlockVector2D(); - } - - /** - * Returns the radius vector of the cylinder - * - * @return the radius - */ - public BlockVector2D getRadius() { - return cylRegion.getRadius().toBlockVector2D(); - } - -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java deleted file mode 100644 index a7034a842..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit.selections; - -import java.util.Collections; -import java.util.List; - -import com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector; -import org.bukkit.World; -import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.bukkit.BukkitUtil; -import com.sk89q.worldedit.regions.*; - -public class Polygonal2DSelection extends RegionSelection { - - protected Polygonal2DRegion poly2d; - - public Polygonal2DSelection(World world, RegionSelector sel, Polygonal2DRegion region) { - super(world, sel, region); - this.poly2d = region; - } - - public Polygonal2DSelection(World world, List points, int minY, int maxY) { - super(world); - com.sk89q.worldedit.world.World lWorld = BukkitUtil.getWorld(world); - - // Validate input - minY = Math.min(Math.max(0, minY), world.getMaxHeight()); - maxY = Math.min(Math.max(0, maxY), world.getMaxHeight()); - - // Create and set up new selector - Polygonal2DRegionSelector sel = new Polygonal2DRegionSelector(lWorld, points, minY, maxY); - - // set up CuboidSelection - poly2d = sel.getIncompleteRegion(); - - // set up RegionSelection - setRegionSelector(sel); - setRegion(poly2d); - } - - public List getNativePoints() { - return Collections.unmodifiableList(poly2d.getPoints()); - } -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/RegionSelection.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/RegionSelection.java deleted file mode 100644 index db705a8be..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/RegionSelection.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit.selections; - -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.regions.RegionSelector; -import org.bukkit.Location; -import org.bukkit.World; - -import static com.sk89q.worldedit.bukkit.BukkitUtil.toLocation; -import static com.sk89q.worldedit.bukkit.BukkitUtil.toVector; - -public abstract class RegionSelection implements Selection { - - private World world; - private RegionSelector selector; - private Region region; - - public RegionSelection(World world) { - this.world = world; - } - - public RegionSelection(World world, RegionSelector selector, Region region) { - this.world = world; - this.region = region; - this.selector = selector; - } - - protected Region getRegion() { - return region; - } - - protected void setRegion(Region region) { - this.region = region; - } - - @Override - public RegionSelector getRegionSelector() { - return selector; - } - - protected void setRegionSelector(RegionSelector selector) { - this.selector = selector; - } - - @Override - public Location getMinimumPoint() { - return toLocation(world, region.getMinimumPoint()); - } - - @Override - public Vector getNativeMinimumPoint() { - return region.getMinimumPoint(); - } - - @Override - public Location getMaximumPoint() { - return toLocation(world, region.getMaximumPoint()); - } - - @Override - public Vector getNativeMaximumPoint() { - return region.getMaximumPoint(); - } - - @Override - public World getWorld() { - return world; - } - - @Override - public int getArea() { - return region.getArea(); - } - - @Override - public int getWidth() { - return region.getWidth(); - } - - @Override - public int getHeight() { - return region.getHeight(); - } - - @Override - public int getLength() { - return region.getLength(); - } - - @Override - public boolean contains(Location position) { - if (!position.getWorld().equals(world)) { - return false; - } - - return region.contains(toVector(position)); - } - -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Selection.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Selection.java deleted file mode 100644 index c3788affc..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/selections/Selection.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit.selections; - -import org.bukkit.Location; -import org.bukkit.World; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.regions.RegionSelector; - -import javax.annotation.Nullable; - -/** - * An abstraction of WorldEdit regions, which do not use Bukkit objects. - */ -public interface Selection { - - /** - * Get the lower point of a region. - * - * @return min. point - */ - public Location getMinimumPoint(); - - /** - * Get the lower point of a region. - * - * @return min. point - */ - public Vector getNativeMinimumPoint(); - - /** - * Get the upper point of a region. - * - * @return max. point - */ - public Location getMaximumPoint(); - - /** - * Get the upper point of a region. - * - * @return max. point - */ - public Vector getNativeMaximumPoint(); - - /** - * Get the region selector. This is for internal use. - * - * @return the region selector - */ - public RegionSelector getRegionSelector(); - - /** - * Get the world. - * - * @return the world, which may be null - */ - @Nullable - public World getWorld(); - - /** - * Get the number of blocks in the region. - * - * @return number of blocks - */ - public int getArea(); - - /** - * Get X-size. - * - * @return width - */ - public int getWidth(); - - /** - * Get Y-size. - * - * @return height - */ - public int getHeight(); - - /** - * Get Z-size. - * - * @return length - */ - public int getLength(); - - /** - * Returns true based on whether the region contains the point, - * - * @param position a vector - * @return true if it is contained - */ - public boolean contains(Location position); - -} diff --git a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java index 81e41e9d7..a67351cd5 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java @@ -34,7 +34,7 @@ public class TestOfflinePermissible implements OfflinePlayer, Permissible { private boolean op; private UUID randomUuid = UUID.randomUUID(); - private final Map assignedPermissions = new HashMap(); + private final Map assignedPermissions = new HashMap<>(); @Override public boolean isOp() { @@ -101,7 +101,7 @@ public class TestOfflinePermissible implements OfflinePlayer, Permissible { @Override public Set getEffectivePermissions() { - Set ret = new HashSet(); + Set ret = new HashSet<>(); for (Map.Entry entry : assignedPermissions.entrySet()) { ret.add(new PermissionAttachmentInfo(this, entry.getKey(), null, entry.getValue())); } @@ -141,11 +141,6 @@ public class TestOfflinePermissible implements OfflinePlayer, Permissible { throw new UnsupportedOperationException("Not supported yet."); } - @Override - public void setBanned(boolean b) { - throw new UnsupportedOperationException("Not supported yet."); - } - @Override public boolean isWhitelisted() { throw new UnsupportedOperationException("Not supported yet."); diff --git a/worldedit-bukkit/src/test/java/com/sk89q/worldedit/bukkit/BukkitWorldTest.java b/worldedit-bukkit/src/test/java/com/sk89q/worldedit/bukkit/BukkitWorldTest.java index 6ad440d8f..bc5f7f882 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/worldedit/bukkit/BukkitWorldTest.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/worldedit/bukkit/BukkitWorldTest.java @@ -27,10 +27,9 @@ public class BukkitWorldTest { @Test public void testTreeTypeMapping() { - // TODO - // for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) { -// Assert.assertFalse("No mapping for: " + type, BukkitWorld.toBukkitTreeType(type) == null); -// } + for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) { +// Assert.assertNotNull("No mapping for: " + type, BukkitWorld.toBukkitTreeType(type)); // TODO + } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index 866fe6735..3abc89a32 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; @@ -30,6 +31,7 @@ import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.RandomPattern; +import com.sun.xml.internal.bind.v2.TODO; import java.util.Random; @@ -188,11 +190,7 @@ public class GardenPatchGenerator implements RegionFunction { * @return a pumpkin pattern */ public static Pattern getPumpkinPattern() { - RandomPattern pattern = new RandomPattern(); - for (int i = 0; i < 4; i++) { -// TODO pattern.add(new BlockPattern(new BaseBlock(BlockTypes.CARVED_PUMPKIN, i)), 100); - } - return pattern; + return new BlockPattern(BlockTypes.CARVED_PUMPKIN.getDefaultState()); } /** diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index ea0ded3ff..66b57ff78 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -67,7 +67,7 @@ public class ForgeWorldEdit { public static Logger logger; public static final String MOD_ID = "worldedit"; - public static final String CUI_PLUGIN_CHANNEL = "WECUI"; + public static final String CUI_PLUGIN_CHANNEL = "worldedit:cui"; private ForgePermissionsProvider provider; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java index 1be22b0b0..863e48e9c 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java @@ -28,7 +28,7 @@ import org.spongepowered.api.network.*; import java.nio.charset.StandardCharsets; public class CUIChannelHandler implements RawDataListener { - public static final String CUI_PLUGIN_CHANNEL = "WECUI"; + public static final String CUI_PLUGIN_CHANNEL = "worldedit:cui"; private static ChannelBinding.RawDataChannel channel; From 39c6a5e958724937c1aee7c9ac0dc71c9b9669d6 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 12 Jul 2018 22:42:50 +1000 Subject: [PATCH 40/74] Fixed items not being registered --- .../worldedit/forge/ForgePermissionsProvider.java | 8 ++++---- .../com/sk89q/worldedit/forge/ForgeWorldEdit.java | 11 ++++++++--- .../sk89q/worldedit/sponge/SpongeEntityType.java | 13 ++++++++----- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java index 1b80998dd..15f4d6657 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java @@ -28,11 +28,11 @@ import net.minecraftforge.fml.common.FMLCommonHandler; public interface ForgePermissionsProvider { - public boolean hasPermission(EntityPlayerMP player, String permission); + boolean hasPermission(EntityPlayerMP player, String permission); - public void registerPermission(ICommand command, String permission); + void registerPermission(ICommand command, String permission); - public static class VanillaPermissionsProvider implements ForgePermissionsProvider { + class VanillaPermissionsProvider implements ForgePermissionsProvider { private ForgePlatform platform; @@ -52,7 +52,7 @@ public interface ForgePermissionsProvider { public void registerPermission(ICommand command, String permission) {} } - public static class SpongePermissionsProvider implements ForgePermissionsProvider { + class SpongePermissionsProvider implements ForgePermissionsProvider { @Override public boolean hasPermission(EntityPlayerMP player, String permission) { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index 66b57ff78..bf17292cd 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.forge; import static com.google.common.base.Preconditions.checkNotNull; -import static net.minecraft.block.Block.REGISTRY; import com.google.common.base.Joiner; import com.sk89q.worldedit.LocalSession; @@ -32,6 +31,8 @@ import com.sk89q.worldedit.forge.net.LeftClickAirEventMessage; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -124,8 +125,12 @@ public class ForgeWorldEdit { this.provider = new ForgePermissionsProvider.VanillaPermissionsProvider(platform); } - for (Block block : REGISTRY) { - BlockTypes.register(new BlockType(REGISTRY.getNameForObject(block).toString())); + for (Block block : Block.REGISTRY) { + BlockTypes.register(new BlockType(Block.REGISTRY.getNameForObject(block).toString())); + } + + for (Item item : Item.REGISTRY) { + ItemTypes.register(new ItemType(Item.REGISTRY.getNameForObject(item).toString())); } } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityType.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityType.java index 4dcab172c..834994bc7 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityType.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityType.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.sponge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.metadata.EntityType; import org.spongepowered.api.data.key.Keys; import org.spongepowered.api.entity.Entity; @@ -28,7 +30,11 @@ import org.spongepowered.api.entity.Item; import org.spongepowered.api.entity.explosive.PrimedTNT; import org.spongepowered.api.entity.hanging.ItemFrame; import org.spongepowered.api.entity.hanging.Painting; -import org.spongepowered.api.entity.living.*; +import org.spongepowered.api.entity.living.Ambient; +import org.spongepowered.api.entity.living.ArmorStand; +import org.spongepowered.api.entity.living.Humanoid; +import org.spongepowered.api.entity.living.Living; +import org.spongepowered.api.entity.living.Villager; import org.spongepowered.api.entity.living.animal.Animal; import org.spongepowered.api.entity.living.complex.ComplexLivingPart; import org.spongepowered.api.entity.living.golem.Golem; @@ -39,9 +45,6 @@ import org.spongepowered.api.entity.vehicle.minecart.Minecart; import org.spongepowered.api.text.Text; import java.util.Optional; -import java.util.UUID; - -import static com.google.common.base.Preconditions.checkNotNull; public class SpongeEntityType implements EntityType { @@ -129,7 +132,7 @@ public class SpongeEntityType implements EntityType { @Override public boolean isTamed() { - return entity.get(Keys.TAMED_OWNER).orElse(Optional.empty()).isPresent(); + return entity.get(Keys.TAMED_OWNER).orElse(Optional.empty()).isPresent(); } @Override From 59ca29577ccff0765330d0f56ee66ead7b2e4942 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 13 Jul 2018 22:45:28 +1000 Subject: [PATCH 41/74] Remove weird TODO import and moved BlockType == Material to BukkitUtil --- .../com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java | 4 ++-- .../main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java | 7 +++++++ .../function/generator/GardenPatchGenerator.java | 9 +++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index 05f3d4609..6c13a12c8 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -79,7 +79,7 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (!bukkitItem.getType().getKey().toString().equals(blockState.getBlockType().getId())) { + if (!BukkitUtil.equals(blockState.getBlockType(), bukkitItem.getType())) { // Type id doesn't fit continue; } @@ -132,7 +132,7 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (!bukkitItem.getType().getKey().toString().equals(blockState.getBlockType().getId())) { + if (!BukkitUtil.equals(blockState.getBlockType(), bukkitItem.getType())) { // Type id doesn't fit continue; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index 9f8f7a969..f5744f6ea 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -27,9 +27,11 @@ import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; 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.item.ItemTypes; import org.bukkit.Bukkit; +import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.block.Block; @@ -39,6 +41,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import java.util.List; +import java.util.Objects; public final class BukkitUtil { @@ -108,6 +111,10 @@ public final class BukkitUtil { return true; } + public static boolean equals(BlockType blockType, Material type) { + return Objects.equals(blockType.getId(), type.getKey().toString()); + } + public static final double EQUALS_PRECISION = 0.0001; public static org.bukkit.Location toLocation(Location location) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index 3abc89a32..ad9d906fb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -23,15 +23,12 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.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.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.function.pattern.RandomPattern; -import com.sun.xml.internal.bind.v2.TODO; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Random; From 3e1d43856596449af5ec548c5a34eaa3e203c7f0 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 16 Jul 2018 00:21:32 +1000 Subject: [PATCH 42/74] Get it to a point where it works minimally on 1.13 Spigot. --- worldedit-bukkit/build.gradle | 4 +- .../worldedit/bukkit/BukkitBlockRegistry.java | 68 + .../worldedit/bukkit/BukkitRegistries.java | 7 + .../sk89q/worldedit/bukkit/BukkitUtil.java | 36 +- .../sk89q/worldedit/bukkit/BukkitWorld.java | 8 +- .../EditSessionBlockChangeDelegate.java | 74 +- .../src/main/resources/plugin.yml | 1 + .../sk89q/worldedit/LocalConfiguration.java | 20 + .../worldedit/util/YAMLConfiguration.java | 12 +- .../world/block/BlockStateHolder.java | 10 + .../world/registry/BundledBlockData.java | 2 +- .../world/registry/BundledBlockRegistry.java | 2 +- .../world/registry/BundledItemData.java | 2 +- .../world/registry/LegacyMapper.java | 2 +- .../registry/PassthroughBlockMaterial.java | 249 ++ .../worldedit/world/registry/legacy.json | 2324 +++++++++++++++++ 16 files changed, 2751 insertions(+), 70 deletions(-) create mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/PassthroughBlockMaterial.java create mode 100644 worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 1d6e5428e..ff4da1ee2 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -10,7 +10,7 @@ repositories { dependencies { compile project(':worldedit-core') compile 'com.sk89q:dummypermscompat:1.8' - compile 'org.bukkit:bukkit:1.13-pre5-R0.1-SNAPSHOT' // zzz + compile 'org.bukkit:bukkit:1.13-pre7-R0.1-SNAPSHOT' // zzz // compile 'org.bukkit:bukkit:1.9.4-R0.1-SNAPSHOT' // zzz testCompile 'org.mockito:mockito-core:1.9.0-rc1' } @@ -36,7 +36,7 @@ jar { shadowJar { dependencies { include(dependency(':worldedit-core')) - include(dependency('com.google.code.gson:gson:2.2.4')) + include(dependency('com.google.code.gson:gson')) } relocate('com.google.gson', 'com.sk89q.worldedit.internal.gson') diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java new file mode 100644 index 000000000..9fa65db93 --- /dev/null +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java @@ -0,0 +1,68 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.bukkit; + +import com.sk89q.worldedit.blocks.BlockMaterial; +import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.registry.BundledBlockRegistry; +import com.sk89q.worldedit.world.registry.PassthroughBlockMaterial; +import org.bukkit.Material; + +import java.util.EnumMap; +import java.util.Map; + +import javax.annotation.Nullable; + +public class BukkitBlockRegistry extends BundledBlockRegistry { + + private Map materialMap = new EnumMap<>(Material.class); + + @Nullable + @Override + public BlockMaterial getMaterial(String id) { + return materialMap.computeIfAbsent(BukkitUtil.toMaterial(BlockTypes.get(id)), + material -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(id), material)); + } + + public static class BukkitBlockMaterial extends PassthroughBlockMaterial { + + private final Material material; + + public BukkitBlockMaterial(@Nullable BlockMaterial material, Material bukkitMaterial) { + super(material); + this.material = bukkitMaterial; + } + + @Override + public boolean isSolid() { + return material.isSolid(); + } + + @Override + public boolean isBurnable() { + return material.isBurnable(); + } + + @Override + public boolean isTranslucent() { + return material.isTransparent(); + } + } +} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitRegistries.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitRegistries.java index 65346d683..6ed0999c7 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitRegistries.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitRegistries.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.world.registry.BiomeRegistry; +import com.sk89q.worldedit.world.registry.BlockRegistry; import com.sk89q.worldedit.world.registry.BundledRegistries; /** @@ -28,6 +29,7 @@ import com.sk89q.worldedit.world.registry.BundledRegistries; class BukkitRegistries extends BundledRegistries { private static final BukkitRegistries INSTANCE = new BukkitRegistries(); + private final BlockRegistry blockRegistry = new BukkitBlockRegistry(); private final BiomeRegistry biomeRegistry = new BukkitBiomeRegistry(); /** @@ -36,6 +38,11 @@ class BukkitRegistries extends BundledRegistries { BukkitRegistries() { } + @Override + public BlockRegistry getBlockRegistry() { + return blockRegistry; + } + @Override public BiomeRegistry getBiomeRegistry() { return biomeRegistry; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index f5744f6ea..bb981c79c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -21,14 +21,18 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; 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.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -48,6 +52,12 @@ public final class BukkitUtil { private BukkitUtil() { } + private static final ParserContext TO_BLOCK_CONTEXT = new ParserContext(); + + static { + TO_BLOCK_CONTEXT.setRestricted(false); + } + public static com.sk89q.worldedit.world.World getWorld(World w) { return new BukkitWorld(w); } @@ -130,12 +140,31 @@ public final class BukkitUtil { return ((BukkitWorld) world).getWorld(); } + public static Material toMaterial(ItemType itemType) { + if (!itemType.getId().startsWith("minecraft:")) { + throw new IllegalArgumentException("Bukkit only supports Minecraft items"); + } + return Material.getMaterial(itemType.getId().replace("minecraft:", "").toUpperCase()); + } + + public static Material toMaterial(BlockType blockType) { + if (!blockType.getId().startsWith("minecraft:")) { + throw new IllegalArgumentException("Bukkit only supports Minecraft blocks"); + } + return Material.getMaterial(blockType.getId().replace("minecraft:", "").toUpperCase()); + } + public static BlockState toBlock(BlockData blockData) { - return null; // TODO BLOCKING + try { + return WorldEdit.getInstance().getBlockFactory().parseFromInput(blockData.getAsString(), TO_BLOCK_CONTEXT).toImmutableState(); + } catch (InputParseException e) { + e.printStackTrace(); + } + return null; } public static BlockData toBlock(BlockStateHolder block) { - return Bukkit.createBlockData(block.toString()); // TODO BLOCKING + return Bukkit.createBlockData(block.getAsString()); } public static BlockState toBlock(ItemStack itemStack) throws WorldEditException { @@ -151,7 +180,6 @@ public final class BukkitUtil { } public static ItemStack toItemStack(BaseItemStack item) { - BlockData blockData = Bukkit.createBlockData(item.getType().getId()); - return new ItemStack(blockData.getMaterial(), item.getAmount()); + return new ItemStack(toMaterial(item.getType()), item.getAmount()); } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 4333cd7af..60219b6c9 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -284,10 +284,8 @@ public class BukkitWorld extends AbstractWorld { public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Vector pt) { World world = getWorld(); TreeType bukkitType = toBukkitTreeType(type); - return type != null && world.generateTree(BukkitUtil.toLocation(world, pt), bukkitType); -// return type != null && world.generateTree(BukkitUtil.toLocation(world, pt), bukkitType, -// new EditSessionBlockChangeDelegate(editSession)); - // TODO + return type != null && world.generateTree(BukkitUtil.toLocation(world, pt), bukkitType, + new EditSessionBlockChangeDelegate(editSession)); } @Override @@ -368,7 +366,7 @@ public class BukkitWorld extends AbstractWorld { return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight); } else { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - bukkitBlock.setData(BukkitUtil.toBlock(block), notifyAndLight); + bukkitBlock.setBlockData(BukkitUtil.toBlock(block), notifyAndLight); return true; } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java index 9a9bfc219..c492d8158 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java @@ -20,11 +20,16 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.world.block.BlockTypes; +import org.bukkit.BlockChangeDelegate; +import org.bukkit.block.data.BlockData; /** * Proxy class to catch calls to set blocks. */ -public class EditSessionBlockChangeDelegate {//implements BlockChangeDelegate { +public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { private EditSession editSession; @@ -32,50 +37,29 @@ public class EditSessionBlockChangeDelegate {//implements BlockChangeDelegate { this.editSession = editSession; } - // TODO This needs a fix in Spigot itself + @Override + public boolean setBlockData(int x, int y, int z, BlockData blockData) { + try { + editSession.setBlock(new Vector(x, y, z), BukkitUtil.toBlock(blockData)); + } catch (MaxChangedBlocksException e) { + return false; + } + return true; + } -// @Override -// public boolean setRawTypeId(int x, int y, int z, int typeId) { -// try { -// return editSession.setBlock(new Vector(x, y, z), LegacyMapper.getInstance().getBlockFromLegacy(typeId)); -// } catch (MaxChangedBlocksException ex) { -// return false; -// } -// } -// -// @Override -// public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data) { -// try { -// return editSession.setBlock(new Vector(x, y, z), LegacyMapper.getInstance().getBlockFromLegacy(typeId, data)); -// } catch (MaxChangedBlocksException ex) { -// return false; -// } -// } -// -// @Override -// public boolean setTypeId(int x, int y, int z, int typeId) { -// return setRawTypeId(x, y, z, typeId); -// } -// -// @Override -// public boolean setTypeIdAndData(int x, int y, int z, int typeId, int data) { -// return setRawTypeIdAndData(x, y, z, typeId, data); -// } -// -// @Override -// public int getTypeId(int x, int y, int z) { -// int[] datas = LegacyMapper.getInstance().getLegacyFromBlock(editSession.getBlock(new Vector(x, y, z))); -// return datas[0]; -// } -// -// @Override -// public int getHeight() { -// return editSession.getWorld().getMaxY() + 1; -// } -// -// @Override -// public boolean isEmpty(int x, int y, int z) { -// return editSession.getBlock(new Vector(x, y, z)).getBlockType() == BlockTypes.AIR; -// } + @Override + public BlockData getBlockData(int x, int y, int z) { + return BukkitUtil.toBlock(editSession.getBlock(new Vector(x, y, z))); + } + + @Override + public int getHeight() { + return editSession.getWorld().getMaxY() + 1; + } + + @Override + public boolean isEmpty(int x, int y, int z) { + return editSession.getBlock(new Vector(x, y, z)).getBlockType() == BlockTypes.AIR; + } } diff --git a/worldedit-bukkit/src/main/resources/plugin.yml b/worldedit-bukkit/src/main/resources/plugin.yml index d071c6f04..9afc2c5a5 100644 --- a/worldedit-bukkit/src/main/resources/plugin.yml +++ b/worldedit-bukkit/src/main/resources/plugin.yml @@ -2,6 +2,7 @@ name: WorldEdit main: com.sk89q.worldedit.bukkit.WorldEditPlugin version: "${internalVersion}" softdepend: [Spout] #hack to fix trove errors +api-version: 1.13 # Permissions aren't here. Read http://wiki.sk89q.com/wiki/WEPIF/DinnerPerms # for how WorldEdit permissions actually work. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java index f6c2e9209..6b5e54de4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.util.logging.LogFormat; +import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import java.io.File; @@ -148,4 +149,23 @@ public abstract class LocalConfiguration { return new File("."); } + public String convertLegacyItem(String legacy) { + String item = legacy; + try { + String[] splitter = item.split(":", 2); + int id = 0; + byte data = 0; + if (splitter.length == 1) { + id = Integer.parseInt(item); + } else { + id = Integer.parseInt(splitter[0]); + data = Byte.parseByte(splitter[1]); + } + item = LegacyMapper.getInstance().getItemFromLegacy(id, data).getId(); + } catch (Throwable e) { + } + + return item; + } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index b6c3a0f1e..2b7939363 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -56,11 +56,7 @@ public class YAMLConfiguration extends LocalConfiguration { } profile = config.getBoolean("debug", profile); - wandItem = config.getString("wand-item", wandItem); - try { - wandItem = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(wandItem)).getId(); - } catch (Throwable e) { - } + wandItem = convertLegacyItem(config.getString("wand-item", wandItem)); defaultChangeLimit = Math.max(-1, config.getInt( "limits.max-blocks-changed.default", defaultChangeLimit)); @@ -104,11 +100,7 @@ public class YAMLConfiguration extends LocalConfiguration { useInventoryCreativeOverride = config.getBoolean("use-inventory.creative-mode-overrides", useInventoryCreativeOverride); - navigationWand = config.getString("navigation-wand.item", navigationWand); - try { - navigationWand = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(navigationWand)).getId(); - } catch (Throwable e) { - } + navigationWand = convertLegacyItem(config.getString("navigation-wand.item", navigationWand)); navigationWandMaxDistance = config.getInt("navigation-wand.max-distance", navigationWandMaxDistance); navigationUseGlass = config.getBoolean("navigation.use-glass", navigationUseGlass); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java index 10f171177..b8c2a9bee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.world.block; import com.sk89q.worldedit.registry.state.Property; import java.util.Map; +import java.util.stream.Collectors; public interface BlockStateHolder { @@ -70,4 +71,13 @@ public interface BlockStateHolder { * @return A BlockState */ BlockState toImmutableState(); + + default String getAsString() { + if (getStates().isEmpty()) { + return this.getBlockType().getId(); + } else { + String properties = getStates().entrySet().stream().map(entry -> entry.getKey() + "=" + entry.getValue()).collect(Collectors.joining(",")); + return this.getBlockType().getId() + "[" + properties + "]"; + } + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index e17ebc99a..cedb6aa4d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -63,7 +63,7 @@ public class BundledBlockData { private BundledBlockData() { try { loadFromResource(); - } catch (IOException e) { + } catch (Throwable e) { log.log(Level.WARNING, "Failed to load the built-in block registry", e); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 0d57ad7aa..10c3e11a3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -44,7 +44,7 @@ public class BundledBlockRegistry implements BlockRegistry { @Nullable @Override public BlockMaterial getMaterial(String id) { - return BundledBlockData.getInstance().getMaterialById(id); + return new PassthroughBlockMaterial(BundledBlockData.getInstance().getMaterialById(id)); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java index 725367d40..bedbf6a19 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java @@ -61,7 +61,7 @@ public class BundledItemData { private BundledItemData() { try { loadFromResource(); - } catch (IOException e) { + } catch (Throwable e) { log.log(Level.WARNING, "Failed to load the built-in item registry", e); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index d827ceca3..f24ffe1e3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -57,7 +57,7 @@ public class LegacyMapper { private LegacyMapper() { try { loadFromResource(); - } catch (IOException e) { + } catch (Throwable e) { log.log(Level.WARNING, "Failed to load the built-in legacy id registry", e); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/PassthroughBlockMaterial.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/PassthroughBlockMaterial.java new file mode 100644 index 000000000..d606efabc --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/PassthroughBlockMaterial.java @@ -0,0 +1,249 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.registry; + +import com.sk89q.worldedit.blocks.BlockMaterial; + +import javax.annotation.Nullable; + +public class PassthroughBlockMaterial implements BlockMaterial { + + @Nullable private final BlockMaterial blockMaterial; + + public PassthroughBlockMaterial(@Nullable BlockMaterial material) { + this.blockMaterial = material; + } + + @Override + public boolean isRenderedAsNormalBlock() { + if (blockMaterial == null) { + return true; + } else { + return blockMaterial.isRenderedAsNormalBlock(); + } + } + + @Override + public boolean isFullCube() { + if (blockMaterial == null) { + return true; + } else { + return blockMaterial.isFullCube(); + } + } + + @Override + public boolean isOpaque() { + if (blockMaterial == null) { + return true; + } else { + return blockMaterial.isOpaque(); + } + } + + @Override + public boolean isPowerSource() { + if (blockMaterial == null) { + return false; + } else { + return blockMaterial.isPowerSource(); + } + } + + @Override + public boolean isLiquid() { + if (blockMaterial == null) { + return false; + } else { + return blockMaterial.isLiquid(); + } + } + + @Override + public boolean isSolid() { + if (blockMaterial == null) { + return true; + } else { + return blockMaterial.isSolid(); + } + } + + @Override + public float getHardness() { + if (blockMaterial == null) { + return 0; + } else { + return blockMaterial.getHardness(); + } + } + + @Override + public float getResistance() { + if (blockMaterial == null) { + return 0; + } else { + return blockMaterial.getResistance(); + } + } + + @Override + public float getSlipperiness() { + if (blockMaterial == null) { + return 0; + } else { + return blockMaterial.getSlipperiness(); + } + } + + @Override + public boolean isGrassBlocking() { + if (blockMaterial == null) { + return true; + } else { + return blockMaterial.isGrassBlocking(); + } + } + + @Override + public float getAmbientOcclusionLightValue() { + if (blockMaterial == null) { + return 0; + } else { + return blockMaterial.getAmbientOcclusionLightValue(); + } + } + + @Override + public int getLightOpacity() { + if (blockMaterial == null) { + return 0; + } else { + return blockMaterial.getLightOpacity(); + } + } + + @Override + public int getLightValue() { + if (blockMaterial == null) { + return 0; + } else { + return blockMaterial.getLightValue(); + } + } + + @Override + public boolean isFragileWhenPushed() { + if (blockMaterial == null) { + return false; + } else { + return blockMaterial.isFragileWhenPushed(); + } + } + + @Override + public boolean isUnpushable() { + if (blockMaterial == null) { + return false; + } else { + return blockMaterial.isUnpushable(); + } + } + + @Override + public boolean isAdventureModeExempt() { + if (blockMaterial == null) { + return false; + } else { + return blockMaterial.isAdventureModeExempt(); + } + } + + @Override + public boolean isTicksRandomly() { + if (blockMaterial == null) { + return true; + } else { + return blockMaterial.isTicksRandomly(); + } + } + + @Override + public boolean isUsingNeighborLight() { + if (blockMaterial == null) { + return false; + } else { + return blockMaterial.isUsingNeighborLight(); + } + } + + @Override + public boolean isMovementBlocker() { + if (blockMaterial == null) { + return true; + } else { + return blockMaterial.isMovementBlocker(); + } + } + + @Override + public boolean isBurnable() { + if (blockMaterial == null) { + return true; + } else { + return blockMaterial.isOpaque(); + } + } + + @Override + public boolean isToolRequired() { + if (blockMaterial == null) { + return true; + } else { + return blockMaterial.isToolRequired(); + } + } + + @Override + public boolean isReplacedDuringPlacement() { + if (blockMaterial == null) { + return false; + } else { + return blockMaterial.isReplacedDuringPlacement(); + } + } + + @Override + public boolean isTranslucent() { + if (blockMaterial == null) { + return !isOpaque(); + } else { + return blockMaterial.isTranslucent(); + } + } + + @Override + public boolean hasContainer() { + if (blockMaterial == null) { + return false; + } else { + return blockMaterial.hasContainer(); + } + } +} diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json new file mode 100644 index 000000000..08fbfb150 --- /dev/null +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json @@ -0,0 +1,2324 @@ +{ + "blocks": { + "0:0": "minecraft:air", + "1:0": "minecraft:stone", + "1:1": "minecraft:granite", + "1:2": "minecraft:polished_granite", + "1:3": "minecraft:diorite", + "1:4": "minecraft:polished_diorite", + "1:5": "minecraft:andesite", + "1:6": "minecraft:polished_andesite", + "2:0": "minecraft:grass[snowy=false]", + "3:0": "minecraft:dirt[variant=dirt,snowy=false]", + "3:1": "minecraft:dirt[variant=coarse_dirt,snowy=false]", + "3:2": "minecraft:dirt[variant=podzol,snowy=false]", + "4:0": "minecraft:cobblestone", + "5:0": "minecraft:oak_planks", + "5:1": "minecraft:spruce_planks", + "5:2": "minecraft:birch_planks", + "5:3": "minecraft:jungle_planks", + "5:4": "minecraft:acacia_planks", + "5:5": "minecraft:dark_oak_planks", + "6:0": "minecraft:oak_sapling[stage=0]", + "6:1": "minecraft:spruce_sapling[stage=0]", + "6:2": "minecraft:birch_sapling[stage=0]", + "6:3": "minecraft:jungle_sapling[stage=0]", + "6:4": "minecraft:acacia_sapling[stage=0]", + "6:5": "minecraft:dark_oak_sapling[stage=0]", + "6:8": "minecraft:oak_sapling[stage=1]", + "6:9": "minecraft:spruce_sapling[stage=1]", + "6:10": "minecraft:birch_sapling[stage=1]", + "6:11": "minecraft:jungle_sapling[stage=1]", + "6:12": "minecraft:acacia_sapling[stage=1]", + "6:13": "minecraft:dark_oak_sapling[stage=1]", + "7:0": "minecraft:bedrock", + "8:0": "minecraft:water[level=0]", + "8:1": "minecraft:water[level=1]", + "8:2": "minecraft:water[level=2]", + "8:3": "minecraft:water[level=3]", + "8:4": "minecraft:water[level=4]", + "8:5": "minecraft:water[level=5]", + "8:6": "minecraft:water[level=6]", + "8:7": "minecraft:water[level=7]", + "8:8": "minecraft:water[level=8]", + "8:9": "minecraft:water[level=9]", + "8:10": "minecraft:water[level=10]", + "8:11": "minecraft:water[level=11]", + "8:12": "minecraft:water[level=12]", + "8:13": "minecraft:water[level=13]", + "8:14": "minecraft:water[level=14]", + "8:15": "minecraft:water[level=15]", + "9:0": "minecraft:water[level=0]", + "9:1": "minecraft:water[level=1]", + "9:2": "minecraft:water[level=2]", + "9:3": "minecraft:water[level=3]", + "9:4": "minecraft:water[level=4]", + "9:5": "minecraft:water[level=5]", + "9:6": "minecraft:water[level=6]", + "9:7": "minecraft:water[level=7]", + "9:8": "minecraft:water[level=8]", + "9:9": "minecraft:water[level=9]", + "9:10": "minecraft:water[level=10]", + "9:11": "minecraft:water[level=11]", + "9:12": "minecraft:water[level=12]", + "9:13": "minecraft:water[level=13]", + "9:14": "minecraft:water[level=14]", + "9:15": "minecraft:water[level=15]", + "10:0": "minecraft:lava[level=0]", + "10:1": "minecraft:lava[level=1]", + "10:2": "minecraft:lava[level=2]", + "10:3": "minecraft:lava[level=3]", + "10:4": "minecraft:lava[level=4]", + "10:5": "minecraft:lava[level=5]", + "10:6": "minecraft:lava[level=6]", + "10:7": "minecraft:lava[level=7]", + "10:8": "minecraft:lava[level=8]", + "10:9": "minecraft:lava[level=9]", + "10:10": "minecraft:lava[level=10]", + "10:11": "minecraft:lava[level=11]", + "10:12": "minecraft:lava[level=12]", + "10:13": "minecraft:lava[level=13]", + "10:14": "minecraft:lava[level=14]", + "10:15": "minecraft:lava[level=15]", + "11:0": "minecraft:lava[level=0]", + "11:1": "minecraft:lava[level=1]", + "11:2": "minecraft:lava[level=2]", + "11:3": "minecraft:lava[level=3]", + "11:4": "minecraft:lava[level=4]", + "11:5": "minecraft:lava[level=5]", + "11:6": "minecraft:lava[level=6]", + "11:7": "minecraft:lava[level=7]", + "11:8": "minecraft:lava[level=8]", + "11:9": "minecraft:lava[level=9]", + "11:10": "minecraft:lava[level=10]", + "11:11": "minecraft:lava[level=11]", + "11:12": "minecraft:lava[level=12]", + "11:13": "minecraft:lava[level=13]", + "11:14": "minecraft:lava[level=14]", + "11:15": "minecraft:lava[level=15]", + "12:0": "minecraft:sand", + "12:1": "minecraft:red_sand", + "13:0": "minecraft:gravel", + "14:0": "minecraft:gold_ore", + "15:0": "minecraft:iron_ore", + "16:0": "minecraft:coal_ore", + "17:0": "minecraft:log[variant=oak,axis=y]", + "17:1": "minecraft:log[variant=spruce,axis=y]", + "17:2": "minecraft:log[variant=birch,axis=y]", + "17:3": "minecraft:log[variant=jungle,axis=y]", + "17:4": "minecraft:log[variant=oak,axis=x]", + "17:5": "minecraft:log[variant=spruce,axis=x]", + "17:6": "minecraft:log[variant=birch,axis=x]", + "17:7": "minecraft:log[variant=jungle,axis=x]", + "17:8": "minecraft:log[variant=oak,axis=z]", + "17:9": "minecraft:log[variant=spruce,axis=z]", + "17:10": "minecraft:log[variant=birch,axis=z]", + "17:11": "minecraft:log[variant=jungle,axis=z]", + "17:12": "minecraft:log[variant=oak,axis=none]", + "17:13": "minecraft:log[variant=spruce,axis=none]", + "17:14": "minecraft:log[variant=birch,axis=none]", + "17:15": "minecraft:log[variant=jungle,axis=none]", + "18:0": "minecraft:oak_leaves[check_decay=false,decayable=true]", + "18:1": "minecraft:spruce_leaves[check_decay=false,decayable=true]", + "18:2": "minecraft:birch_leaves[check_decay=false,decayable=true]", + "18:3": "minecraft:jungle_leaves[check_decay=false,decayable=true]", + "18:4": "minecraft:oak_leaves[check_decay=false,decayable=false]", + "18:5": "minecraft:spruce_leaves[check_decay=false,decayable=false]", + "18:6": "minecraft:birch_leaves[check_decay=false,decayable=false]", + "18:7": "minecraft:jungle_leaves[check_decay=false,decayable=false]", + "18:8": "minecraft:oak_leaves[check_decay=true,decayable=true]", + "18:9": "minecraft:spruce_leaves[check_decay=true,decayable=true]", + "18:10": "minecraft:birch_leaves[check_decay=true,decayable=true]", + "18:11": "minecraft:jungle_leaves[check_decay=true,decayable=true]", + "18:12": "minecraft:oak_leaves[check_decay=true,decayable=false]", + "18:13": "minecraft:spruce_leaves[check_decay=true,decayable=false]", + "18:14": "minecraft:birch_leaves[check_decay=true,decayable=false]", + "18:15": "minecraft:jungle_leaves[check_decay=true,decayable=false]", + "19:0": "minecraft:sponge", + "19:1": "minecraft:wet_sponge", + "20:0": "minecraft:glass", + "21:0": "minecraft:lapis_ore", + "22:0": "minecraft:lapis_block", + "23:0": "minecraft:dispenser[triggered=false,facing=down]", + "23:1": "minecraft:dispenser[triggered=false,facing=up]", + "23:2": "minecraft:dispenser[triggered=false,facing=north]", + "23:3": "minecraft:dispenser[triggered=false,facing=south]", + "23:4": "minecraft:dispenser[triggered=false,facing=west]", + "23:5": "minecraft:dispenser[triggered=false,facing=east]", + "23:8": "minecraft:dispenser[triggered=true,facing=down]", + "23:9": "minecraft:dispenser[triggered=true,facing=up]", + "23:10": "minecraft:dispenser[triggered=true,facing=north]", + "23:11": "minecraft:dispenser[triggered=true,facing=south]", + "23:12": "minecraft:dispenser[triggered=true,facing=west]", + "23:13": "minecraft:dispenser[triggered=true,facing=east]", + "24:0": "minecraft:sandstone", + "24:1": "minecraft:chiseled_sandstone", + "24:2": "minecraft:cut_sandstone", + "25:0": "minecraft:note_block", + "26:0": "minecraft:bed[part=foot,facing=south,occupied=false]", + "26:1": "minecraft:bed[part=foot,facing=west,occupied=false]", + "26:2": "minecraft:bed[part=foot,facing=north,occupied=false]", + "26:3": "minecraft:bed[part=foot,facing=east,occupied=false]", + "26:8": "minecraft:bed[part=head,facing=south,occupied=false]", + "26:9": "minecraft:bed[part=head,facing=west,occupied=false]", + "26:10": "minecraft:bed[part=head,facing=north,occupied=false]", + "26:11": "minecraft:bed[part=head,facing=east,occupied=false]", + "26:12": "minecraft:bed[part=head,facing=south,occupied=true]", + "26:13": "minecraft:bed[part=head,facing=west,occupied=true]", + "26:14": "minecraft:bed[part=head,facing=north,occupied=true]", + "26:15": "minecraft:bed[part=head,facing=east,occupied=true]", + "27:0": "minecraft:golden_rail[shape=north_south,powered=false]", + "27:1": "minecraft:golden_rail[shape=east_west,powered=false]", + "27:2": "minecraft:golden_rail[shape=ascending_east,powered=false]", + "27:3": "minecraft:golden_rail[shape=ascending_west,powered=false]", + "27:4": "minecraft:golden_rail[shape=ascending_north,powered=false]", + "27:5": "minecraft:golden_rail[shape=ascending_south,powered=false]", + "27:8": "minecraft:golden_rail[shape=north_south,powered=true]", + "27:9": "minecraft:golden_rail[shape=east_west,powered=true]", + "27:10": "minecraft:golden_rail[shape=ascending_east,powered=true]", + "27:11": "minecraft:golden_rail[shape=ascending_west,powered=true]", + "27:12": "minecraft:golden_rail[shape=ascending_north,powered=true]", + "27:13": "minecraft:golden_rail[shape=ascending_south,powered=true]", + "28:0": "minecraft:detector_rail[shape=north_south,powered=false]", + "28:1": "minecraft:detector_rail[shape=east_west,powered=false]", + "28:2": "minecraft:detector_rail[shape=ascending_east,powered=false]", + "28:3": "minecraft:detector_rail[shape=ascending_west,powered=false]", + "28:4": "minecraft:detector_rail[shape=ascending_north,powered=false]", + "28:5": "minecraft:detector_rail[shape=ascending_south,powered=false]", + "28:8": "minecraft:detector_rail[shape=north_south,powered=true]", + "28:9": "minecraft:detector_rail[shape=east_west,powered=true]", + "28:10": "minecraft:detector_rail[shape=ascending_east,powered=true]", + "28:11": "minecraft:detector_rail[shape=ascending_west,powered=true]", + "28:12": "minecraft:detector_rail[shape=ascending_north,powered=true]", + "28:13": "minecraft:detector_rail[shape=ascending_south,powered=true]", + "29:0": "minecraft:sticky_piston[facing=down,extended=false]", + "29:1": "minecraft:sticky_piston[facing=up,extended=false]", + "29:2": "minecraft:sticky_piston[facing=north,extended=false]", + "29:3": "minecraft:sticky_piston[facing=south,extended=false]", + "29:4": "minecraft:sticky_piston[facing=west,extended=false]", + "29:5": "minecraft:sticky_piston[facing=east,extended=false]", + "29:8": "minecraft:sticky_piston[facing=down,extended=true]", + "29:9": "minecraft:sticky_piston[facing=up,extended=true]", + "29:10": "minecraft:sticky_piston[facing=north,extended=true]", + "29:11": "minecraft:sticky_piston[facing=south,extended=true]", + "29:12": "minecraft:sticky_piston[facing=west,extended=true]", + "29:13": "minecraft:sticky_piston[facing=east,extended=true]", + "30:0": "minecraft:cobweb", + "31:0": "minecraft:dead_bush", + "31:1": "minecraft:grass", + "31:2": "minecraft:fern", + "32:0": "minecraft:dead_bush", + "33:0": "minecraft:piston[facing=down,extended=false]", + "33:1": "minecraft:piston[facing=up,extended=false]", + "33:2": "minecraft:piston[facing=north,extended=false]", + "33:3": "minecraft:piston[facing=south,extended=false]", + "33:4": "minecraft:piston[facing=west,extended=false]", + "33:5": "minecraft:piston[facing=east,extended=false]", + "33:8": "minecraft:piston[facing=down,extended=true]", + "33:9": "minecraft:piston[facing=up,extended=true]", + "33:10": "minecraft:piston[facing=north,extended=true]", + "33:11": "minecraft:piston[facing=south,extended=true]", + "33:12": "minecraft:piston[facing=west,extended=true]", + "33:13": "minecraft:piston[facing=east,extended=true]", + "34:0": "minecraft:piston_head[short=false,facing=down,type=normal]", + "34:1": "minecraft:piston_head[short=false,facing=up,type=normal]", + "34:2": "minecraft:piston_head[short=false,facing=north,type=normal]", + "34:3": "minecraft:piston_head[short=false,facing=south,type=normal]", + "34:4": "minecraft:piston_head[short=false,facing=west,type=normal]", + "34:5": "minecraft:piston_head[short=false,facing=east,type=normal]", + "34:8": "minecraft:piston_head[short=false,facing=down,type=sticky]", + "34:9": "minecraft:piston_head[short=false,facing=up,type=sticky]", + "34:10": "minecraft:piston_head[short=false,facing=north,type=sticky]", + "34:11": "minecraft:piston_head[short=false,facing=south,type=sticky]", + "34:12": "minecraft:piston_head[short=false,facing=west,type=sticky]", + "34:13": "minecraft:piston_head[short=false,facing=east,type=sticky]", + "35:0": "minecraft:white_wool", + "35:1": "minecraft:orange_wool", + "35:2": "minecraft:magenta_wool", + "35:3": "minecraft:wool[color=lightblue]", + "35:4": "minecraft:yellow_wool", + "35:5": "minecraft:lime_wool", + "35:6": "minecraft:pink_wool", + "35:7": "minecraft:gray_wool", + "35:8": "minecraft:light_gray_wool", + "35:9": "minecraft:cyan_wool", + "35:10": "minecraft:purple_wool", + "35:11": "minecraft:blue_wool", + "35:12": "minecraft:brown_wool", + "35:13": "minecraft:green_wool", + "35:14": "minecraft:red_wool", + "35:15": "minecraft:black_wool", + "36:0": "minecraft:moving_piston[facing=down,type=normal]", + "36:1": "minecraft:moving_piston[facing=up,type=normal]", + "36:2": "minecraft:moving_piston[facing=north,type=normal]", + "36:3": "minecraft:moving_piston[facing=south,type=normal]", + "36:4": "minecraft:moving_piston[facing=west,type=normal]", + "36:5": "minecraft:moving_piston[facing=east,type=normal]", + "36:8": "minecraft:moving_piston[facing=down,type=sticky]", + "36:9": "minecraft:moving_piston[facing=up,type=sticky]", + "36:10": "minecraft:moving_piston[facing=north,type=sticky]", + "36:11": "minecraft:moving_piston[facing=south,type=sticky]", + "36:12": "minecraft:moving_piston[facing=west,type=sticky]", + "36:13": "minecraft:moving_piston[facing=east,type=sticky]", + "37:0": "minecraft:dandelion", + "38:0": "minecraft:poppy", + "38:1": "minecraft:blue_orchid", + "38:2": "minecraft:allium", + "38:3": "minecraft:azure_bluet", + "38:4": "minecraft:red_tulip", + "38:5": "minecraft:orange_tulip", + "38:6": "minecraft:white_tulip", + "38:7": "minecraft:pink_tulip", + "38:8": "minecraft:oxeye_daisy", + "39:0": "minecraft:brown_mushroom", + "40:0": "minecraft:red_mushroom", + "41:0": "minecraft:gold_block", + "42:0": "minecraft:iron_block", + "43:0": "minecraft:stone_slab[type=double]", + "43:1": "minecraft:sandstone_slab[type=double]", + "43:2": "minecraft:petrified_oak_slab[type=double]", + "43:3": "minecraft:cobblestone_slab[type=double]", + "43:4": "minecraft:brick_slab[type=double]", + "43:5": "minecraft:stone_brick_slab[type=double]", + "43:6": "minecraft:nether_brick_slab[type=double]", + "43:7": "minecraft:quartz_slab[type=double]", + "43:8": "minecraft:smooth_stone", + "43:9": "minecraft:smooth_sandstone", + "43:10": "minecraft:petrified_oak_slab[type=double]", + "43:11": "minecraft:cobblestone_slab[type=double]", + "43:12": "minecraft:brick_slab[type=double]", + "43:13": "minecraft:stone_brick_slab[type=double]", + "43:14": "minecraft:nether_brick_slab[type=double]", + "43:15": "minecraft:smooth_quartz", + "44:0": "minecraft:stone_slab[type=bottom]", + "44:1": "minecraft:sandstone_slab[type=bottom]", + "44:2": "minecraft:petrified_oak_slab[type=bottom]", + "44:3": "minecraft:cobblestone_slab[type=bottom]", + "44:4": "minecraft:brick_slab[type=bottom]", + "44:5": "minecraft:stone_brick_slab[type=bottom]", + "44:6": "minecraft:nether_brick_slab[type=bottom]", + "44:7": "minecraft:quartz_slab[type=bottom]", + "44:8": "minecraft:stone_slab[type=top]", + "44:9": "minecraft:sandstone_slab[type=top]", + "44:10": "minecraft:petrified_oak_slab[type=top]", + "44:11": "minecraft:cobblestone_slab[type=top]", + "44:12": "minecraft:brick_slab[type=top]", + "44:13": "minecraft:stone_brick_slab[type=top]", + "44:14": "minecraft:nether_brick_slab[type=top]", + "44:15": "minecraft:quartz_slab[type=top]", + "45:0": "minecraft:bricks", + "46:0": "minecraft:tnt[explode=false]", + "46:1": "minecraft:tnt[explode=true]", + "47:0": "minecraft:bookshelf", + "48:0": "minecraft:mossy_cobblestone", + "49:0": "minecraft:obsidian", + "50:1": "minecraft:wall_torch[facing=east]", + "50:2": "minecraft:wall_torch[facing=west]", + "50:3": "minecraft:wall_torch[facing=south]", + "50:4": "minecraft:wall_torch[facing=north]", + "50:5": "minecraft:torch", + "51:0": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=0]", + "51:1": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=1]", + "51:2": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=2]", + "51:3": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=3]", + "51:4": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=4]", + "51:5": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=5]", + "51:6": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=6]", + "51:7": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=7]", + "51:8": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=8]", + "51:9": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=9]", + "51:10": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=10]", + "51:11": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=11]", + "51:12": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=12]", + "51:13": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=13]", + "51:14": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=14]", + "51:15": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=15]", + "52:0": "minecraft:mob_spawner", + "53:0": "minecraft:oak_stairs[half=bottom,shape=outer_right,facing=east]", + "53:1": "minecraft:oak_stairs[half=bottom,shape=outer_right,facing=west]", + "53:2": "minecraft:oak_stairs[half=bottom,shape=outer_right,facing=south]", + "53:3": "minecraft:oak_stairs[half=bottom,shape=outer_right,facing=north]", + "53:4": "minecraft:oak_stairs[half=top,shape=outer_right,facing=east]", + "53:5": "minecraft:oak_stairs[half=top,shape=outer_right,facing=west]", + "53:6": "minecraft:oak_stairs[half=top,shape=outer_right,facing=south]", + "53:7": "minecraft:oak_stairs[half=top,shape=outer_right,facing=north]", + "54:2": "minecraft:chest[facing=north,type=single]", + "54:3": "minecraft:chest[facing=south,type=single]", + "54:4": "minecraft:chest[facing=west,type=single]", + "54:5": "minecraft:chest[facing=east,type=single]", + "55:0": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=0]", + "55:1": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=1]", + "55:2": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=2]", + "55:3": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=3]", + "55:4": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=4]", + "55:5": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=5]", + "55:6": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=6]", + "55:7": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=7]", + "55:8": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=8]", + "55:9": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=9]", + "55:10": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=10]", + "55:11": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=11]", + "55:12": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=12]", + "55:13": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=13]", + "55:14": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=14]", + "55:15": "minecraft:redstone_wire[east=none,south=none,north=none,west=none,power=15]", + "56:0": "minecraft:diamond_ore", + "57:0": "minecraft:diamond_block", + "58:0": "minecraft:crafting_table", + "59:0": "minecraft:wheat[age=0]", + "59:1": "minecraft:wheat[age=1]", + "59:2": "minecraft:wheat[age=2]", + "59:3": "minecraft:wheat[age=3]", + "59:4": "minecraft:wheat[age=4]", + "59:5": "minecraft:wheat[age=5]", + "59:6": "minecraft:wheat[age=6]", + "59:7": "minecraft:wheat[age=7]", + "60:0": "minecraft:farmland[moisture=0]", + "60:1": "minecraft:farmland[moisture=1]", + "60:2": "minecraft:farmland[moisture=2]", + "60:3": "minecraft:farmland[moisture=3]", + "60:4": "minecraft:farmland[moisture=4]", + "60:5": "minecraft:farmland[moisture=5]", + "60:6": "minecraft:farmland[moisture=6]", + "60:7": "minecraft:farmland[moisture=7]", + "61:2": "minecraft:furnace[facing=north,lit=false]", + "61:3": "minecraft:furnace[facing=south,lit=false]", + "61:4": "minecraft:furnace[facing=west,lit=false]", + "61:5": "minecraft:furnace[facing=east,lit=false]", + "62:2": "minecraft:furnace[facing=north,lit=true]", + "62:3": "minecraft:furnace[facing=south,lit=true]", + "62:4": "minecraft:furnace[facing=west,lit=true]", + "62:5": "minecraft:furnace[facing=east,lit=true]", + "63:0": "minecraft:sign[rotation=0]", + "63:1": "minecraft:sign[rotation=1]", + "63:2": "minecraft:sign[rotation=2]", + "63:3": "minecraft:sign[rotation=3]", + "63:4": "minecraft:sign[rotation=4]", + "63:5": "minecraft:sign[rotation=5]", + "63:6": "minecraft:sign[rotation=6]", + "63:7": "minecraft:sign[rotation=7]", + "63:8": "minecraft:sign[rotation=8]", + "63:9": "minecraft:sign[rotation=9]", + "63:10": "minecraft:sign[rotation=10]", + "63:11": "minecraft:sign[rotation=11]", + "63:12": "minecraft:sign[rotation=12]", + "63:13": "minecraft:sign[rotation=13]", + "63:14": "minecraft:sign[rotation=14]", + "63:15": "minecraft:sign[rotation=15]", + "64:0": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=east,open=false]", + "64:1": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=south,open=false]", + "64:2": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=west,open=false]", + "64:3": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=north,open=false]", + "64:4": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=east,open=true]", + "64:5": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=south,open=true]", + "64:6": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=west,open=true]", + "64:7": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=north,open=true]", + "64:8": "minecraft:wooden_door[hinge=left,half=upper,powered=false,facing=east,open=false]", + "64:9": "minecraft:wooden_door[hinge=right,half=upper,powered=false,facing=east,open=false]", + "64:10": "minecraft:wooden_door[hinge=left,half=upper,powered=true,facing=east,open=false]", + "64:11": "minecraft:wooden_door[hinge=right,half=upper,powered=true,facing=east,open=false]", + "65:2": "minecraft:ladder[facing=north]", + "65:3": "minecraft:ladder[facing=south]", + "65:4": "minecraft:ladder[facing=west]", + "65:5": "minecraft:ladder[facing=east]", + "66:0": "minecraft:rail[shape=north_south]", + "66:1": "minecraft:rail[shape=east_west]", + "66:2": "minecraft:rail[shape=ascending_east]", + "66:3": "minecraft:rail[shape=ascending_west]", + "66:4": "minecraft:rail[shape=ascending_north]", + "66:5": "minecraft:rail[shape=ascending_south]", + "66:6": "minecraft:rail[shape=south_east]", + "66:7": "minecraft:rail[shape=south_west]", + "66:8": "minecraft:rail[shape=north_west]", + "66:9": "minecraft:rail[shape=north_east]", + "67:0": "minecraft:stone_stairs[half=bottom,shape=outer_right,facing=east]", + "67:1": "minecraft:stone_stairs[half=bottom,shape=outer_right,facing=west]", + "67:2": "minecraft:stone_stairs[half=bottom,shape=outer_right,facing=south]", + "67:3": "minecraft:stone_stairs[half=bottom,shape=outer_right,facing=north]", + "67:4": "minecraft:stone_stairs[half=top,shape=outer_right,facing=east]", + "67:5": "minecraft:stone_stairs[half=top,shape=outer_right,facing=west]", + "67:6": "minecraft:stone_stairs[half=top,shape=outer_right,facing=south]", + "67:7": "minecraft:stone_stairs[half=top,shape=outer_right,facing=north]", + "68:2": "minecraft:wall_sign[facing=north]", + "68:3": "minecraft:wall_sign[facing=south]", + "68:4": "minecraft:wall_sign[facing=west]", + "68:5": "minecraft:wall_sign[facing=east]", + "69:0": "minecraft:lever[powered=false,facing=down_x]", + "69:1": "minecraft:lever[powered=false,facing=east]", + "69:2": "minecraft:lever[powered=false,facing=west]", + "69:3": "minecraft:lever[powered=false,facing=south]", + "69:4": "minecraft:lever[powered=false,facing=north]", + "69:5": "minecraft:lever[powered=false,facing=up_z]", + "69:6": "minecraft:lever[powered=false,facing=up_x]", + "69:7": "minecraft:lever[powered=false,facing=down_z]", + "69:8": "minecraft:lever[powered=true,facing=down_x]", + "69:9": "minecraft:lever[powered=true,facing=east]", + "69:10": "minecraft:lever[powered=true,facing=west]", + "69:11": "minecraft:lever[powered=true,facing=south]", + "69:12": "minecraft:lever[powered=true,facing=north]", + "69:13": "minecraft:lever[powered=true,facing=up_z]", + "69:14": "minecraft:lever[powered=true,facing=up_x]", + "69:15": "minecraft:lever[powered=true,facing=down_z]", + "70:0": "minecraft:stone_pressure_plate[powered=false]", + "70:1": "minecraft:stone_pressure_plate[powered=true]", + "71:0": "minecraft:iron_door[hinge=right,half=lower,powered=false,facing=east,open=false]", + "71:1": "minecraft:iron_door[hinge=right,half=lower,powered=false,facing=south,open=false]", + "71:2": "minecraft:iron_door[hinge=right,half=lower,powered=false,facing=west,open=false]", + "71:3": "minecraft:iron_door[hinge=right,half=lower,powered=false,facing=north,open=false]", + "71:4": "minecraft:iron_door[hinge=right,half=lower,powered=false,facing=east,open=true]", + "71:5": "minecraft:iron_door[hinge=right,half=lower,powered=false,facing=south,open=true]", + "71:6": "minecraft:iron_door[hinge=right,half=lower,powered=false,facing=west,open=true]", + "71:7": "minecraft:iron_door[hinge=right,half=lower,powered=false,facing=north,open=true]", + "71:8": "minecraft:iron_door[hinge=left,half=upper,powered=false,facing=east,open=false]", + "71:9": "minecraft:iron_door[hinge=right,half=upper,powered=false,facing=east,open=false]", + "71:10": "minecraft:iron_door[hinge=left,half=upper,powered=true,facing=east,open=false]", + "71:11": "minecraft:iron_door[hinge=right,half=upper,powered=true,facing=east,open=false]", + "72:0": "minecraft:oak_pressure_plate[powered=false]", + "72:1": "minecraft:oak_pressure_plate[powered=true]", + "73:0": "minecraft:redstone_ore[lit=false]", + "74:0": "minecraft:redstone_ore[lit=true]", + "75:1": "minecraft:redstone_wall_torch[facing=east,lit=false]", + "75:2": "minecraft:redstone_wall_torch[facing=west,lit=false]", + "75:3": "minecraft:redstone_wall_torch[facing=south,lit=false]", + "75:4": "minecraft:redstone_wall_torch[facing=north,lit=false]", + "75:5": "minecraft:redstone_torch[lit=false]", + "76:1": "minecraft:redstone_wall_torch[facing=east,lit=true]", + "76:2": "minecraft:redstone_wall_torch[facing=west,lit=true]", + "76:3": "minecraft:redstone_wall_torch[facing=south,lit=true]", + "76:4": "minecraft:redstone_wall_torch[facing=north,lit=true]", + "76:5": "minecraft:redstone_torch[lit=true]", + "77:0": "minecraft:stone_button[powered=false,facing=down]", + "77:1": "minecraft:stone_button[powered=false,facing=east]", + "77:2": "minecraft:stone_button[powered=false,facing=west]", + "77:3": "minecraft:stone_button[powered=false,facing=south]", + "77:4": "minecraft:stone_button[powered=false,facing=north]", + "77:5": "minecraft:stone_button[powered=false,facing=up]", + "77:8": "minecraft:stone_button[powered=true,facing=down]", + "77:9": "minecraft:stone_button[powered=true,facing=east]", + "77:10": "minecraft:stone_button[powered=true,facing=west]", + "77:11": "minecraft:stone_button[powered=true,facing=south]", + "77:12": "minecraft:stone_button[powered=true,facing=north]", + "77:13": "minecraft:stone_button[powered=true,facing=up]", + "78:0": "minecraft:snow[layers=1]", + "78:1": "minecraft:snow[layers=2]", + "78:2": "minecraft:snow[layers=3]", + "78:3": "minecraft:snow[layers=4]", + "78:4": "minecraft:snow[layers=5]", + "78:5": "minecraft:snow[layers=6]", + "78:6": "minecraft:snow[layers=7]", + "78:7": "minecraft:snow[layers=8]", + "79:0": "minecraft:ice", + "80:0": "minecraft:snow_block", + "81:0": "minecraft:cactus[age=0]", + "81:1": "minecraft:cactus[age=1]", + "81:2": "minecraft:cactus[age=2]", + "81:3": "minecraft:cactus[age=3]", + "81:4": "minecraft:cactus[age=4]", + "81:5": "minecraft:cactus[age=5]", + "81:6": "minecraft:cactus[age=6]", + "81:7": "minecraft:cactus[age=7]", + "81:8": "minecraft:cactus[age=8]", + "81:9": "minecraft:cactus[age=9]", + "81:10": "minecraft:cactus[age=10]", + "81:11": "minecraft:cactus[age=11]", + "81:12": "minecraft:cactus[age=12]", + "81:13": "minecraft:cactus[age=13]", + "81:14": "minecraft:cactus[age=14]", + "81:15": "minecraft:cactus[age=15]", + "82:0": "minecraft:clay", + "83:0": "minecraft:sugar_cane[age=0]", + "83:1": "minecraft:sugar_cane[age=1]", + "83:2": "minecraft:sugar_cane[age=2]", + "83:3": "minecraft:sugar_cane[age=3]", + "83:4": "minecraft:sugar_cane[age=4]", + "83:5": "minecraft:sugar_cane[age=5]", + "83:6": "minecraft:sugar_cane[age=6]", + "83:7": "minecraft:sugar_cane[age=7]", + "83:8": "minecraft:sugar_cane[age=8]", + "83:9": "minecraft:sugar_cane[age=9]", + "83:10": "minecraft:sugar_cane[age=10]", + "83:11": "minecraft:sugar_cane[age=11]", + "83:12": "minecraft:sugar_cane[age=12]", + "83:13": "minecraft:sugar_cane[age=13]", + "83:14": "minecraft:sugar_cane[age=14]", + "83:15": "minecraft:sugar_cane[age=15]", + "84:0": "minecraft:jukebox[has_record=false]", + "84:1": "minecraft:jukebox[has_record=true]", + "85:0": "minecraft:fence[east=false,south=false,north=false,west=false]", + "86:0": "minecraft:carved_pumpkin[facing=south]", + "86:1": "minecraft:carved_pumpkin[facing=west]", + "86:2": "minecraft:carved_pumpkin[facing=north]", + "86:3": "minecraft:carved_pumpkin[facing=east]", + "87:0": "minecraft:netherrack", + "88:0": "minecraft:soul_sand", + "89:0": "minecraft:glowstone", + "90:1": "minecraft:portal[axis=x]", + "90:2": "minecraft:portal[axis=z]", + "91:0": "minecraft:jack_o_lantern[facing=south]", + "91:1": "minecraft:jack_o_lantern[facing=west]", + "91:2": "minecraft:jack_o_lantern[facing=north]", + "91:3": "minecraft:jack_o_lantern[facing=east]", + "92:0": "minecraft:cake[bites=0]", + "92:1": "minecraft:cake[bites=1]", + "92:2": "minecraft:cake[bites=2]", + "92:3": "minecraft:cake[bites=3]", + "92:4": "minecraft:cake[bites=4]", + "92:5": "minecraft:cake[bites=5]", + "92:6": "minecraft:cake[bites=6]", + "93:0": "minecraft:unpowered_repeater[delay=1,facing=south,locked=false]", + "93:1": "minecraft:unpowered_repeater[delay=1,facing=west,locked=false]", + "93:2": "minecraft:unpowered_repeater[delay=1,facing=north,locked=false]", + "93:3": "minecraft:unpowered_repeater[delay=1,facing=east,locked=false]", + "93:4": "minecraft:unpowered_repeater[delay=2,facing=south,locked=false]", + "93:5": "minecraft:unpowered_repeater[delay=2,facing=west,locked=false]", + "93:6": "minecraft:unpowered_repeater[delay=2,facing=north,locked=false]", + "93:7": "minecraft:unpowered_repeater[delay=2,facing=east,locked=false]", + "93:8": "minecraft:unpowered_repeater[delay=3,facing=south,locked=false]", + "93:9": "minecraft:unpowered_repeater[delay=3,facing=west,locked=false]", + "93:10": "minecraft:unpowered_repeater[delay=3,facing=north,locked=false]", + "93:11": "minecraft:unpowered_repeater[delay=3,facing=east,locked=false]", + "93:12": "minecraft:unpowered_repeater[delay=4,facing=south,locked=false]", + "93:13": "minecraft:unpowered_repeater[delay=4,facing=west,locked=false]", + "93:14": "minecraft:unpowered_repeater[delay=4,facing=north,locked=false]", + "93:15": "minecraft:unpowered_repeater[delay=4,facing=east,locked=false]", + "94:0": "minecraft:powered_repeater[delay=1,facing=south,locked=false]", + "94:1": "minecraft:powered_repeater[delay=1,facing=west,locked=false]", + "94:2": "minecraft:powered_repeater[delay=1,facing=north,locked=false]", + "94:3": "minecraft:powered_repeater[delay=1,facing=east,locked=false]", + "94:4": "minecraft:powered_repeater[delay=2,facing=south,locked=false]", + "94:5": "minecraft:powered_repeater[delay=2,facing=west,locked=false]", + "94:6": "minecraft:powered_repeater[delay=2,facing=north,locked=false]", + "94:7": "minecraft:powered_repeater[delay=2,facing=east,locked=false]", + "94:8": "minecraft:powered_repeater[delay=3,facing=south,locked=false]", + "94:9": "minecraft:powered_repeater[delay=3,facing=west,locked=false]", + "94:10": "minecraft:powered_repeater[delay=3,facing=north,locked=false]", + "94:11": "minecraft:powered_repeater[delay=3,facing=east,locked=false]", + "94:12": "minecraft:powered_repeater[delay=4,facing=south,locked=false]", + "94:13": "minecraft:powered_repeater[delay=4,facing=west,locked=false]", + "94:14": "minecraft:powered_repeater[delay=4,facing=north,locked=false]", + "94:15": "minecraft:powered_repeater[delay=4,facing=east,locked=false]", + "95:0": "minecraft:white_stained_glass", + "95:1": "minecraft:orange_stained_glass", + "95:2": "minecraft:magenta_stained_glass", + "95:3": "minecraft:stained_glass[color=lightblue]", + "95:4": "minecraft:yellow_stained_glass", + "95:5": "minecraft:lime_stained_glass", + "95:6": "minecraft:pink_stained_glass", + "95:7": "minecraft:gray_stained_glass", + "95:8": "minecraft:light_gray_stained_glass", + "95:9": "minecraft:cyan_stained_glass", + "95:10": "minecraft:purple_stained_glass", + "95:11": "minecraft:blue_stained_glass", + "95:12": "minecraft:brown_stained_glass", + "95:13": "minecraft:green_stained_glass", + "95:14": "minecraft:red_stained_glass", + "95:15": "minecraft:black_stained_glass", + "96:0": "minecraft:trapdoor[half=bottom,facing=north,open=false]", + "96:1": "minecraft:trapdoor[half=bottom,facing=south,open=false]", + "96:2": "minecraft:trapdoor[half=bottom,facing=west,open=false]", + "96:3": "minecraft:trapdoor[half=bottom,facing=east,open=false]", + "96:4": "minecraft:trapdoor[half=bottom,facing=north,open=true]", + "96:5": "minecraft:trapdoor[half=bottom,facing=south,open=true]", + "96:6": "minecraft:trapdoor[half=bottom,facing=west,open=true]", + "96:7": "minecraft:trapdoor[half=bottom,facing=east,open=true]", + "96:8": "minecraft:trapdoor[half=top,facing=north,open=false]", + "96:9": "minecraft:trapdoor[half=top,facing=south,open=false]", + "96:10": "minecraft:trapdoor[half=top,facing=west,open=false]", + "96:11": "minecraft:trapdoor[half=top,facing=east,open=false]", + "96:12": "minecraft:trapdoor[half=top,facing=north,open=true]", + "96:13": "minecraft:trapdoor[half=top,facing=south,open=true]", + "96:14": "minecraft:trapdoor[half=top,facing=west,open=true]", + "96:15": "minecraft:trapdoor[half=top,facing=east,open=true]", + "97:0": "minecraft:infested_stone", + "97:1": "minecraft:infested_cobblestone", + "97:2": "minecraft:infested_stone_bricks", + "97:3": "minecraft:infested_mossy_stone_bricks", + "97:4": "minecraft:infested_cracked_stone_bricks", + "97:5": "minecraft:infested_chiseled_stone_bricks", + "98:0": "minecraft:stone_bricks", + "98:1": "minecraft:mossy_stone_bricks", + "98:2": "minecraft:cracked_stone_bricks", + "98:3": "minecraft:chiseled_stone_bricks", + "99:0": "minecraft:brown_mushroom_block[north=false,east=false,south=false,west=false,up=false,down=false]", + "99:1": "minecraft:brown_mushroom_block[north=true,east=false,south=false,west=true,up=true,down=false]", + "99:2": "minecraft:brown_mushroom_block[north=true,east=false,south=false,west=false,up=true,down=false]", + "99:3": "minecraft:brown_mushroom_block[north=true,east=true,south=false,west=false,up=true,down=false]", + "99:4": "minecraft:brown_mushroom_block[north=false,east=false,south=false,west=true,up=true,down=false]", + "99:5": "minecraft:brown_mushroom_block[north=false,east=false,south=false,west=false,up=true,down=false]", + "99:6": "minecraft:brown_mushroom_block[north=false,east=true,south=false,west=false,up=true,down=false]", + "99:7": "minecraft:brown_mushroom_block[north=false,east=false,south=true,west=true,up=true,down=false]", + "99:8": "minecraft:brown_mushroom_block[north=false,east=false,south=true,west=false,up=true,down=false]", + "99:9": "minecraft:brown_mushroom_block[north=false,east=true,south=true,west=false,up=true,down=false]", + "99:10": "minecraft:mushroom_stem[north=true,east=true,south=true,west=true,up=false,down=false]", + "99:14": "minecraft:brown_mushroom_block[north=true,east=true,south=true,west=true,up=true,down=true]", + "99:15": "minecraft:mushroom_stem[north=true,east=true,south=true,west=true,up=true,down=true]", + "100:0": "minecraft:red_mushroom_block[north=false,east=false,south=false,west=false,up=false,down=false]", + "100:1": "minecraft:red_mushroom_block[north=true,east=false,south=false,west=true,up=true,down=false]", + "100:2": "minecraft:red_mushroom_block[north=true,east=false,south=false,west=false,up=true,down=false]", + "100:3": "minecraft:red_mushroom_block[north=true,east=true,south=false,west=false,up=true,down=false]", + "100:4": "minecraft:red_mushroom_block[north=false,east=false,south=false,west=true,up=true,down=false]", + "100:5": "minecraft:red_mushroom_block[north=false,east=false,south=false,west=false,up=true,down=false]", + "100:6": "minecraft:red_mushroom_block[north=false,east=true,south=false,west=false,up=true,down=false]", + "100:7": "minecraft:red_mushroom_block[north=false,east=false,south=true,west=true,up=true,down=false]", + "100:8": "minecraft:red_mushroom_block[north=false,east=false,south=true,west=false,up=true,down=false]", + "100:9": "minecraft:red_mushroom_block[north=false,east=true,south=true,west=false,up=true,down=false]", + "100:10": "minecraft:mushroom_stem[north=true,east=true,south=true,west=true,up=false,down=false]", + "100:14": "minecraft:red_mushroom_block[north=true,east=true,south=true,west=true,up=true,down=true]", + "100:15": "minecraft:mushroom_stem[north=true,east=true,south=true,west=true,up=true,down=true]", + "101:0": "minecraft:iron_bars[east=false,south=false,north=false,west=false]", + "102:0": "minecraft:glass_pane[east=false,south=false,north=false,west=false]", + "103:0": "minecraft:melon_block", + "104:0": "minecraft:pumpkin_stem[facing=east,age=0]", + "104:1": "minecraft:pumpkin_stem[facing=east,age=1]", + "104:2": "minecraft:pumpkin_stem[facing=east,age=2]", + "104:3": "minecraft:pumpkin_stem[facing=east,age=3]", + "104:4": "minecraft:pumpkin_stem[facing=east,age=4]", + "104:5": "minecraft:pumpkin_stem[facing=east,age=5]", + "104:6": "minecraft:pumpkin_stem[facing=east,age=6]", + "104:7": "minecraft:pumpkin_stem[facing=east,age=7]", + "105:0": "minecraft:melon_stem[facing=east,age=0]", + "105:1": "minecraft:melon_stem[facing=east,age=1]", + "105:2": "minecraft:melon_stem[facing=east,age=2]", + "105:3": "minecraft:melon_stem[facing=east,age=3]", + "105:4": "minecraft:melon_stem[facing=east,age=4]", + "105:5": "minecraft:melon_stem[facing=east,age=5]", + "105:6": "minecraft:melon_stem[facing=east,age=6]", + "105:7": "minecraft:melon_stem[facing=east,age=7]", + "106:0": "minecraft:vine[east=false,south=false,north=false,west=false,up=false]", + "106:1": "minecraft:vine[east=false,south=true,north=false,west=false,up=false]", + "106:2": "minecraft:vine[east=false,south=false,north=false,west=true,up=false]", + "106:3": "minecraft:vine[east=false,south=true,north=false,west=true,up=false]", + "106:4": "minecraft:vine[east=false,south=false,north=true,west=false,up=false]", + "106:5": "minecraft:vine[east=false,south=true,north=true,west=false,up=false]", + "106:6": "minecraft:vine[east=false,south=false,north=true,west=true,up=false]", + "106:7": "minecraft:vine[east=false,south=true,north=true,west=true,up=false]", + "106:8": "minecraft:vine[east=true,south=false,north=false,west=false,up=false]", + "106:9": "minecraft:vine[east=true,south=true,north=false,west=false,up=false]", + "106:10": "minecraft:vine[east=true,south=false,north=false,west=true,up=false]", + "106:11": "minecraft:vine[east=true,south=true,north=false,west=true,up=false]", + "106:12": "minecraft:vine[east=true,south=false,north=true,west=false,up=false]", + "106:13": "minecraft:vine[east=true,south=true,north=true,west=false,up=false]", + "106:14": "minecraft:vine[east=true,south=false,north=true,west=true,up=false]", + "106:15": "minecraft:vine[east=true,south=true,north=true,west=true,up=false]", + "107:0": "minecraft:fence_gate[in_wall=false,powered=false,facing=south,open=false]", + "107:1": "minecraft:fence_gate[in_wall=false,powered=false,facing=west,open=false]", + "107:2": "minecraft:fence_gate[in_wall=false,powered=false,facing=north,open=false]", + "107:3": "minecraft:fence_gate[in_wall=false,powered=false,facing=east,open=false]", + "107:4": "minecraft:fence_gate[in_wall=false,powered=false,facing=south,open=true]", + "107:5": "minecraft:fence_gate[in_wall=false,powered=false,facing=west,open=true]", + "107:6": "minecraft:fence_gate[in_wall=false,powered=false,facing=north,open=true]", + "107:7": "minecraft:fence_gate[in_wall=false,powered=false,facing=east,open=true]", + "107:8": "minecraft:fence_gate[in_wall=false,powered=true,facing=south,open=false]", + "107:9": "minecraft:fence_gate[in_wall=false,powered=true,facing=west,open=false]", + "107:10": "minecraft:fence_gate[in_wall=false,powered=true,facing=north,open=false]", + "107:11": "minecraft:fence_gate[in_wall=false,powered=true,facing=east,open=false]", + "107:12": "minecraft:fence_gate[in_wall=false,powered=true,facing=south,open=true]", + "107:13": "minecraft:fence_gate[in_wall=false,powered=true,facing=west,open=true]", + "107:14": "minecraft:fence_gate[in_wall=false,powered=true,facing=north,open=true]", + "107:15": "minecraft:fence_gate[in_wall=false,powered=true,facing=east,open=true]", + "108:0": "minecraft:brick_stairs[half=bottom,shape=outer_right,facing=east]", + "108:1": "minecraft:brick_stairs[half=bottom,shape=outer_right,facing=west]", + "108:2": "minecraft:brick_stairs[half=bottom,shape=outer_right,facing=south]", + "108:3": "minecraft:brick_stairs[half=bottom,shape=outer_right,facing=north]", + "108:4": "minecraft:brick_stairs[half=top,shape=outer_right,facing=east]", + "108:5": "minecraft:brick_stairs[half=top,shape=outer_right,facing=west]", + "108:6": "minecraft:brick_stairs[half=top,shape=outer_right,facing=south]", + "108:7": "minecraft:brick_stairs[half=top,shape=outer_right,facing=north]", + "109:0": "minecraft:stone_brick_stairs[half=bottom,shape=outer_right,facing=east]", + "109:1": "minecraft:stone_brick_stairs[half=bottom,shape=outer_right,facing=west]", + "109:2": "minecraft:stone_brick_stairs[half=bottom,shape=outer_right,facing=south]", + "109:3": "minecraft:stone_brick_stairs[half=bottom,shape=outer_right,facing=north]", + "109:4": "minecraft:stone_brick_stairs[half=top,shape=outer_right,facing=east]", + "109:5": "minecraft:stone_brick_stairs[half=top,shape=outer_right,facing=west]", + "109:6": "minecraft:stone_brick_stairs[half=top,shape=outer_right,facing=south]", + "109:7": "minecraft:stone_brick_stairs[half=top,shape=outer_right,facing=north]", + "110:0": "minecraft:mycelium[snowy=false]", + "111:0": "minecraft:lily_pad", + "112:0": "minecraft:nether_bricks", + "113:0": "minecraft:nether_brick_fence[east=false,south=false,north=false,west=false]", + "114:0": "minecraft:nether_brick_stairs[half=bottom,shape=outer_right,facing=east]", + "114:1": "minecraft:nether_brick_stairs[half=bottom,shape=outer_right,facing=west]", + "114:2": "minecraft:nether_brick_stairs[half=bottom,shape=outer_right,facing=south]", + "114:3": "minecraft:nether_brick_stairs[half=bottom,shape=outer_right,facing=north]", + "114:4": "minecraft:nether_brick_stairs[half=top,shape=outer_right,facing=east]", + "114:5": "minecraft:nether_brick_stairs[half=top,shape=outer_right,facing=west]", + "114:6": "minecraft:nether_brick_stairs[half=top,shape=outer_right,facing=south]", + "114:7": "minecraft:nether_brick_stairs[half=top,shape=outer_right,facing=north]", + "115:0": "minecraft:nether_wart[age=0]", + "115:1": "minecraft:nether_wart[age=1]", + "115:2": "minecraft:nether_wart[age=2]", + "115:3": "minecraft:nether_wart[age=3]", + "116:0": "minecraft:enchanting_table", + "117:0": "minecraft:brewing_stand[has_bottle_0=false,has_bottle_1=false,has_bottle_2=false]", + "117:1": "minecraft:brewing_stand[has_bottle_0=true,has_bottle_1=false,has_bottle_2=false]", + "117:2": "minecraft:brewing_stand[has_bottle_0=false,has_bottle_1=true,has_bottle_2=false]", + "117:3": "minecraft:brewing_stand[has_bottle_0=true,has_bottle_1=true,has_bottle_2=false]", + "117:4": "minecraft:brewing_stand[has_bottle_0=false,has_bottle_1=false,has_bottle_2=true]", + "117:5": "minecraft:brewing_stand[has_bottle_0=true,has_bottle_1=false,has_bottle_2=true]", + "117:6": "minecraft:brewing_stand[has_bottle_0=false,has_bottle_1=true,has_bottle_2=true]", + "117:7": "minecraft:brewing_stand[has_bottle_0=true,has_bottle_1=true,has_bottle_2=true]", + "118:0": "minecraft:cauldron[level=0]", + "118:1": "minecraft:cauldron[level=1]", + "118:2": "minecraft:cauldron[level=2]", + "118:3": "minecraft:cauldron[level=3]", + "119:0": "minecraft:end_portal", + "120:0": "minecraft:end_portal_frame[eye=false,facing=south]", + "120:1": "minecraft:end_portal_frame[eye=false,facing=west]", + "120:2": "minecraft:end_portal_frame[eye=false,facing=north]", + "120:3": "minecraft:end_portal_frame[eye=false,facing=east]", + "120:4": "minecraft:end_portal_frame[eye=true,facing=south]", + "120:5": "minecraft:end_portal_frame[eye=true,facing=west]", + "120:6": "minecraft:end_portal_frame[eye=true,facing=north]", + "120:7": "minecraft:end_portal_frame[eye=true,facing=east]", + "121:0": "minecraft:end_stone", + "122:0": "minecraft:dragon_egg", + "123:0": "minecraft:redstone_lamp[lit=false]", + "124:0": "minecraft:redstone_lamp[lit=true]", + "125:0": "minecraft:oak_slab[type=double]", + "125:1": "minecraft:spruce_slab[type=double]", + "125:2": "minecraft:birch_slab[type=double]", + "125:3": "minecraft:jungle_slab[type=double]", + "125:4": "minecraft:acacia_slab[type=double]", + "125:5": "minecraft:dark_oak_slab[type=double]", + "126:0": "minecraft:oak_slab[type=bottom]", + "126:1": "minecraft:spruce_slab[type=bottom]", + "126:2": "minecraft:birch_slab[type=bottom]", + "126:3": "minecraft:jungle_slab[type=bottom]", + "126:4": "minecraft:acacia_slab[type=bottom]", + "126:5": "minecraft:dark_oak_slab[type=bottom]", + "126:8": "minecraft:oak_slab[type=top]", + "126:9": "minecraft:spruce_slab[type=top]", + "126:10": "minecraft:birch_slab[type=top]", + "126:11": "minecraft:jungle_slab[type=top]", + "126:12": "minecraft:acacia_slab[type=top]", + "126:13": "minecraft:dark_oak_slab[type=top]", + "127:0": "minecraft:cocoa[facing=south,age=0]", + "127:1": "minecraft:cocoa[facing=west,age=0]", + "127:2": "minecraft:cocoa[facing=north,age=0]", + "127:3": "minecraft:cocoa[facing=east,age=0]", + "127:4": "minecraft:cocoa[facing=south,age=1]", + "127:5": "minecraft:cocoa[facing=west,age=1]", + "127:6": "minecraft:cocoa[facing=north,age=1]", + "127:7": "minecraft:cocoa[facing=east,age=1]", + "127:8": "minecraft:cocoa[facing=south,age=2]", + "127:9": "minecraft:cocoa[facing=west,age=2]", + "127:10": "minecraft:cocoa[facing=north,age=2]", + "127:11": "minecraft:cocoa[facing=east,age=2]", + "128:0": "minecraft:sandstone_stairs[half=bottom,shape=outer_right,facing=east]", + "128:1": "minecraft:sandstone_stairs[half=bottom,shape=outer_right,facing=west]", + "128:2": "minecraft:sandstone_stairs[half=bottom,shape=outer_right,facing=south]", + "128:3": "minecraft:sandstone_stairs[half=bottom,shape=outer_right,facing=north]", + "128:4": "minecraft:sandstone_stairs[half=top,shape=outer_right,facing=east]", + "128:5": "minecraft:sandstone_stairs[half=top,shape=outer_right,facing=west]", + "128:6": "minecraft:sandstone_stairs[half=top,shape=outer_right,facing=south]", + "128:7": "minecraft:sandstone_stairs[half=top,shape=outer_right,facing=north]", + "129:0": "minecraft:emerald_ore", + "130:2": "minecraft:ender_chest[facing=north]", + "130:3": "minecraft:ender_chest[facing=south]", + "130:4": "minecraft:ender_chest[facing=west]", + "130:5": "minecraft:ender_chest[facing=east]", + "131:0": "minecraft:tripwire_hook[powered=false,attached=false,facing=south]", + "131:1": "minecraft:tripwire_hook[powered=false,attached=false,facing=west]", + "131:2": "minecraft:tripwire_hook[powered=false,attached=false,facing=north]", + "131:3": "minecraft:tripwire_hook[powered=false,attached=false,facing=east]", + "131:4": "minecraft:tripwire_hook[powered=false,attached=true,facing=south]", + "131:5": "minecraft:tripwire_hook[powered=false,attached=true,facing=west]", + "131:6": "minecraft:tripwire_hook[powered=false,attached=true,facing=north]", + "131:7": "minecraft:tripwire_hook[powered=false,attached=true,facing=east]", + "131:8": "minecraft:tripwire_hook[powered=true,attached=false,facing=south]", + "131:9": "minecraft:tripwire_hook[powered=true,attached=false,facing=west]", + "131:10": "minecraft:tripwire_hook[powered=true,attached=false,facing=north]", + "131:11": "minecraft:tripwire_hook[powered=true,attached=false,facing=east]", + "131:12": "minecraft:tripwire_hook[powered=true,attached=true,facing=south]", + "131:13": "minecraft:tripwire_hook[powered=true,attached=true,facing=west]", + "131:14": "minecraft:tripwire_hook[powered=true,attached=true,facing=north]", + "131:15": "minecraft:tripwire_hook[powered=true,attached=true,facing=east]", + "132:0": "minecraft:tripwire[disarmed=false,east=false,powered=false,south=false,north=false,west=false,attached=false]", + "132:1": "minecraft:tripwire[disarmed=false,east=false,powered=true,south=false,north=false,west=false,attached=false]", + "132:4": "minecraft:tripwire[disarmed=false,east=false,powered=false,south=false,north=false,west=false,attached=true]", + "132:5": "minecraft:tripwire[disarmed=false,east=false,powered=true,south=false,north=false,west=false,attached=true]", + "132:8": "minecraft:tripwire[disarmed=true,east=false,powered=false,south=false,north=false,west=false,attached=false]", + "132:9": "minecraft:tripwire[disarmed=true,east=false,powered=true,south=false,north=false,west=false,attached=false]", + "132:12": "minecraft:tripwire[disarmed=true,east=false,powered=false,south=false,north=false,west=false,attached=true]", + "132:13": "minecraft:tripwire[disarmed=true,east=false,powered=true,south=false,north=false,west=false,attached=true]", + "133:0": "minecraft:emerald_block", + "134:0": "minecraft:spruce_stairs[half=bottom,shape=outer_right,facing=east]", + "134:1": "minecraft:spruce_stairs[half=bottom,shape=outer_right,facing=west]", + "134:2": "minecraft:spruce_stairs[half=bottom,shape=outer_right,facing=south]", + "134:3": "minecraft:spruce_stairs[half=bottom,shape=outer_right,facing=north]", + "134:4": "minecraft:spruce_stairs[half=top,shape=outer_right,facing=east]", + "134:5": "minecraft:spruce_stairs[half=top,shape=outer_right,facing=west]", + "134:6": "minecraft:spruce_stairs[half=top,shape=outer_right,facing=south]", + "134:7": "minecraft:spruce_stairs[half=top,shape=outer_right,facing=north]", + "135:0": "minecraft:birch_stairs[half=bottom,shape=outer_right,facing=east]", + "135:1": "minecraft:birch_stairs[half=bottom,shape=outer_right,facing=west]", + "135:2": "minecraft:birch_stairs[half=bottom,shape=outer_right,facing=south]", + "135:3": "minecraft:birch_stairs[half=bottom,shape=outer_right,facing=north]", + "135:4": "minecraft:birch_stairs[half=top,shape=outer_right,facing=east]", + "135:5": "minecraft:birch_stairs[half=top,shape=outer_right,facing=west]", + "135:6": "minecraft:birch_stairs[half=top,shape=outer_right,facing=south]", + "135:7": "minecraft:birch_stairs[half=top,shape=outer_right,facing=north]", + "136:0": "minecraft:jungle_stairs[half=bottom,shape=outer_right,facing=east]", + "136:1": "minecraft:jungle_stairs[half=bottom,shape=outer_right,facing=west]", + "136:2": "minecraft:jungle_stairs[half=bottom,shape=outer_right,facing=south]", + "136:3": "minecraft:jungle_stairs[half=bottom,shape=outer_right,facing=north]", + "136:4": "minecraft:jungle_stairs[half=top,shape=outer_right,facing=east]", + "136:5": "minecraft:jungle_stairs[half=top,shape=outer_right,facing=west]", + "136:6": "minecraft:jungle_stairs[half=top,shape=outer_right,facing=south]", + "136:7": "minecraft:jungle_stairs[half=top,shape=outer_right,facing=north]", + "137:0": "minecraft:command_block[conditional=false,facing=down]", + "137:1": "minecraft:command_block[conditional=false,facing=up]", + "137:2": "minecraft:command_block[conditional=false,facing=north]", + "137:3": "minecraft:command_block[conditional=false,facing=south]", + "137:4": "minecraft:command_block[conditional=false,facing=west]", + "137:5": "minecraft:command_block[conditional=false,facing=east]", + "137:8": "minecraft:command_block[conditional=true,facing=down]", + "137:9": "minecraft:command_block[conditional=true,facing=up]", + "137:10": "minecraft:command_block[conditional=true,facing=north]", + "137:11": "minecraft:command_block[conditional=true,facing=south]", + "137:12": "minecraft:command_block[conditional=true,facing=west]", + "137:13": "minecraft:command_block[conditional=true,facing=east]", + "138:0": "minecraft:beacon", + "139:0": "minecraft:cobblestone_wall[east=false,south=false,north=false,west=false,variant=cobblestone,up=false]", + "139:1": "minecraft:cobblestone_wall[east=false,south=false,north=false,west=false,variant=mossy_cobblestone,up=false]", + "140:0": "minecraft:flower_pot[contents=cactus,legacy_data=0]", + "140:1": "minecraft:flower_pot[contents=cactus,legacy_data=1]", + "140:2": "minecraft:flower_pot[contents=cactus,legacy_data=2]", + "140:3": "minecraft:flower_pot[contents=cactus,legacy_data=3]", + "140:4": "minecraft:flower_pot[contents=cactus,legacy_data=4]", + "140:5": "minecraft:flower_pot[contents=cactus,legacy_data=5]", + "140:6": "minecraft:flower_pot[contents=cactus,legacy_data=6]", + "140:7": "minecraft:flower_pot[contents=cactus,legacy_data=7]", + "140:8": "minecraft:flower_pot[contents=cactus,legacy_data=8]", + "140:9": "minecraft:flower_pot[contents=cactus,legacy_data=9]", + "140:10": "minecraft:flower_pot[contents=cactus,legacy_data=10]", + "140:11": "minecraft:flower_pot[contents=cactus,legacy_data=11]", + "140:12": "minecraft:flower_pot[contents=cactus,legacy_data=12]", + "140:13": "minecraft:flower_pot[contents=cactus,legacy_data=13]", + "140:14": "minecraft:flower_pot[contents=cactus,legacy_data=14]", + "140:15": "minecraft:flower_pot[contents=cactus,legacy_data=15]", + "141:0": "minecraft:carrots[age=0]", + "141:1": "minecraft:carrots[age=1]", + "141:2": "minecraft:carrots[age=2]", + "141:3": "minecraft:carrots[age=3]", + "141:4": "minecraft:carrots[age=4]", + "141:5": "minecraft:carrots[age=5]", + "141:6": "minecraft:carrots[age=6]", + "141:7": "minecraft:carrots[age=7]", + "142:0": "minecraft:potatoes[age=0]", + "142:1": "minecraft:potatoes[age=1]", + "142:2": "minecraft:potatoes[age=2]", + "142:3": "minecraft:potatoes[age=3]", + "142:4": "minecraft:potatoes[age=4]", + "142:5": "minecraft:potatoes[age=5]", + "142:6": "minecraft:potatoes[age=6]", + "142:7": "minecraft:potatoes[age=7]", + "143:0": "minecraft:wooden_button[powered=false,facing=down]", + "143:1": "minecraft:wooden_button[powered=false,facing=east]", + "143:2": "minecraft:wooden_button[powered=false,facing=west]", + "143:3": "minecraft:wooden_button[powered=false,facing=south]", + "143:4": "minecraft:wooden_button[powered=false,facing=north]", + "143:5": "minecraft:wooden_button[powered=false,facing=up]", + "143:8": "minecraft:wooden_button[powered=true,facing=down]", + "143:9": "minecraft:wooden_button[powered=true,facing=east]", + "143:10": "minecraft:wooden_button[powered=true,facing=west]", + "143:11": "minecraft:wooden_button[powered=true,facing=south]", + "143:12": "minecraft:wooden_button[powered=true,facing=north]", + "143:13": "minecraft:wooden_button[powered=true,facing=up]", + "144:0": "minecraft:skull[nodrop=false,facing=down]", + "144:1": "minecraft:skull[nodrop=false,facing=up]", + "144:2": "minecraft:skull[nodrop=false,facing=north]", + "144:3": "minecraft:skull[nodrop=false,facing=south]", + "144:4": "minecraft:skull[nodrop=false,facing=west]", + "144:5": "minecraft:skull[nodrop=false,facing=east]", + "144:8": "minecraft:skull[nodrop=true,facing=down]", + "144:9": "minecraft:skull[nodrop=true,facing=up]", + "144:10": "minecraft:skull[nodrop=true,facing=north]", + "144:11": "minecraft:skull[nodrop=true,facing=south]", + "144:12": "minecraft:skull[nodrop=true,facing=west]", + "144:13": "minecraft:skull[nodrop=true,facing=east]", + "145:0": "minecraft:anvil[facing=south]", + "145:1": "minecraft:anvil[facing=west]", + "145:2": "minecraft:anvil[facing=north]", + "145:3": "minecraft:anvil[facing=east]", + "145:4": "minecraft:chipped_anvil[facing=south]", + "145:5": "minecraft:chipped_anvil[facing=west]", + "145:6": "minecraft:chipped_anvil[facing=north]", + "145:7": "minecraft:chipped_anvil[facing=east]", + "145:8": "minecraft:damaged_anvil[facing=south]", + "145:9": "minecraft:damaged_anvil[facing=west]", + "145:10": "minecraft:damaged_anvil[facing=north]", + "145:11": "minecraft:damaged_anvil[facing=east]", + "146:2": "minecraft:trapped_chest[facing=north,type=single]", + "146:3": "minecraft:trapped_chest[facing=south,type=single]", + "146:4": "minecraft:trapped_chest[facing=west,type=single]", + "146:5": "minecraft:trapped_chest[facing=east,type=single]", + "147:0": "minecraft:light_weighted_pressure_plate[power=0]", + "147:1": "minecraft:light_weighted_pressure_plate[power=1]", + "147:2": "minecraft:light_weighted_pressure_plate[power=2]", + "147:3": "minecraft:light_weighted_pressure_plate[power=3]", + "147:4": "minecraft:light_weighted_pressure_plate[power=4]", + "147:5": "minecraft:light_weighted_pressure_plate[power=5]", + "147:6": "minecraft:light_weighted_pressure_plate[power=6]", + "147:7": "minecraft:light_weighted_pressure_plate[power=7]", + "147:8": "minecraft:light_weighted_pressure_plate[power=8]", + "147:9": "minecraft:light_weighted_pressure_plate[power=9]", + "147:10": "minecraft:light_weighted_pressure_plate[power=10]", + "147:11": "minecraft:light_weighted_pressure_plate[power=11]", + "147:12": "minecraft:light_weighted_pressure_plate[power=12]", + "147:13": "minecraft:light_weighted_pressure_plate[power=13]", + "147:14": "minecraft:light_weighted_pressure_plate[power=14]", + "147:15": "minecraft:light_weighted_pressure_plate[power=15]", + "148:0": "minecraft:heavy_weighted_pressure_plate[power=0]", + "148:1": "minecraft:heavy_weighted_pressure_plate[power=1]", + "148:2": "minecraft:heavy_weighted_pressure_plate[power=2]", + "148:3": "minecraft:heavy_weighted_pressure_plate[power=3]", + "148:4": "minecraft:heavy_weighted_pressure_plate[power=4]", + "148:5": "minecraft:heavy_weighted_pressure_plate[power=5]", + "148:6": "minecraft:heavy_weighted_pressure_plate[power=6]", + "148:7": "minecraft:heavy_weighted_pressure_plate[power=7]", + "148:8": "minecraft:heavy_weighted_pressure_plate[power=8]", + "148:9": "minecraft:heavy_weighted_pressure_plate[power=9]", + "148:10": "minecraft:heavy_weighted_pressure_plate[power=10]", + "148:11": "minecraft:heavy_weighted_pressure_plate[power=11]", + "148:12": "minecraft:heavy_weighted_pressure_plate[power=12]", + "148:13": "minecraft:heavy_weighted_pressure_plate[power=13]", + "148:14": "minecraft:heavy_weighted_pressure_plate[power=14]", + "148:15": "minecraft:heavy_weighted_pressure_plate[power=15]", + "149:0": "minecraft:unpowered_comparator[mode=compare,powered=false,facing=south]", + "149:1": "minecraft:unpowered_comparator[mode=compare,powered=false,facing=west]", + "149:2": "minecraft:unpowered_comparator[mode=compare,powered=false,facing=north]", + "149:3": "minecraft:unpowered_comparator[mode=compare,powered=false,facing=east]", + "149:4": "minecraft:unpowered_comparator[mode=subtract,powered=false,facing=south]", + "149:5": "minecraft:unpowered_comparator[mode=subtract,powered=false,facing=west]", + "149:6": "minecraft:unpowered_comparator[mode=subtract,powered=false,facing=north]", + "149:7": "minecraft:unpowered_comparator[mode=subtract,powered=false,facing=east]", + "149:8": "minecraft:unpowered_comparator[mode=compare,powered=true,facing=south]", + "149:9": "minecraft:unpowered_comparator[mode=compare,powered=true,facing=west]", + "149:10": "minecraft:unpowered_comparator[mode=compare,powered=true,facing=north]", + "149:11": "minecraft:unpowered_comparator[mode=compare,powered=true,facing=east]", + "149:12": "minecraft:unpowered_comparator[mode=subtract,powered=true,facing=south]", + "149:13": "minecraft:unpowered_comparator[mode=subtract,powered=true,facing=west]", + "149:14": "minecraft:unpowered_comparator[mode=subtract,powered=true,facing=north]", + "149:15": "minecraft:unpowered_comparator[mode=subtract,powered=true,facing=east]", + "150:0": "minecraft:powered_comparator[mode=compare,powered=false,facing=south]", + "150:1": "minecraft:powered_comparator[mode=compare,powered=false,facing=west]", + "150:2": "minecraft:powered_comparator[mode=compare,powered=false,facing=north]", + "150:3": "minecraft:powered_comparator[mode=compare,powered=false,facing=east]", + "150:4": "minecraft:powered_comparator[mode=subtract,powered=false,facing=south]", + "150:5": "minecraft:powered_comparator[mode=subtract,powered=false,facing=west]", + "150:6": "minecraft:powered_comparator[mode=subtract,powered=false,facing=north]", + "150:7": "minecraft:powered_comparator[mode=subtract,powered=false,facing=east]", + "150:8": "minecraft:powered_comparator[mode=compare,powered=true,facing=south]", + "150:9": "minecraft:powered_comparator[mode=compare,powered=true,facing=west]", + "150:10": "minecraft:powered_comparator[mode=compare,powered=true,facing=north]", + "150:11": "minecraft:powered_comparator[mode=compare,powered=true,facing=east]", + "150:12": "minecraft:powered_comparator[mode=subtract,powered=true,facing=south]", + "150:13": "minecraft:powered_comparator[mode=subtract,powered=true,facing=west]", + "150:14": "minecraft:powered_comparator[mode=subtract,powered=true,facing=north]", + "150:15": "minecraft:powered_comparator[mode=subtract,powered=true,facing=east]", + "151:0": "minecraft:daylight_detector[inverted=false,power=0]", + "151:1": "minecraft:daylight_detector[inverted=false,power=1]", + "151:2": "minecraft:daylight_detector[inverted=false,power=2]", + "151:3": "minecraft:daylight_detector[inverted=false,power=3]", + "151:4": "minecraft:daylight_detector[inverted=false,power=4]", + "151:5": "minecraft:daylight_detector[inverted=false,power=5]", + "151:6": "minecraft:daylight_detector[inverted=false,power=6]", + "151:7": "minecraft:daylight_detector[inverted=false,power=7]", + "151:8": "minecraft:daylight_detector[inverted=false,power=8]", + "151:9": "minecraft:daylight_detector[inverted=false,power=9]", + "151:10": "minecraft:daylight_detector[inverted=false,power=10]", + "151:11": "minecraft:daylight_detector[inverted=false,power=11]", + "151:12": "minecraft:daylight_detector[inverted=false,power=12]", + "151:13": "minecraft:daylight_detector[inverted=false,power=13]", + "151:14": "minecraft:daylight_detector[inverted=false,power=14]", + "151:15": "minecraft:daylight_detector[inverted=false,power=15]", + "152:0": "minecraft:redstone_block", + "153:0": "minecraft:nether_quartz_ore", + "154:0": "minecraft:hopper[facing=down,enabled=true]", + "154:2": "minecraft:hopper[facing=north,enabled=true]", + "154:3": "minecraft:hopper[facing=south,enabled=true]", + "154:4": "minecraft:hopper[facing=west,enabled=true]", + "154:5": "minecraft:hopper[facing=east,enabled=true]", + "154:8": "minecraft:hopper[facing=down,enabled=false]", + "154:10": "minecraft:hopper[facing=north,enabled=false]", + "154:11": "minecraft:hopper[facing=south,enabled=false]", + "154:12": "minecraft:hopper[facing=west,enabled=false]", + "154:13": "minecraft:hopper[facing=east,enabled=false]", + "155:0": "minecraft:quartz_block", + "155:1": "minecraft:chiseled_quartz_block", + "155:2": "minecraft:quartz_block[variant=lines]", + "155:3": "minecraft:quartz_block[variant=lines]", + "155:4": "minecraft:quartz_block[variant=lines]", + "156:0": "minecraft:quartz_stairs[half=bottom,shape=outer_right,facing=east]", + "156:1": "minecraft:quartz_stairs[half=bottom,shape=outer_right,facing=west]", + "156:2": "minecraft:quartz_stairs[half=bottom,shape=outer_right,facing=south]", + "156:3": "minecraft:quartz_stairs[half=bottom,shape=outer_right,facing=north]", + "156:4": "minecraft:quartz_stairs[half=top,shape=outer_right,facing=east]", + "156:5": "minecraft:quartz_stairs[half=top,shape=outer_right,facing=west]", + "156:6": "minecraft:quartz_stairs[half=top,shape=outer_right,facing=south]", + "156:7": "minecraft:quartz_stairs[half=top,shape=outer_right,facing=north]", + "157:0": "minecraft:activator_rail[shape=north_south,powered=false]", + "157:1": "minecraft:activator_rail[shape=east_west,powered=false]", + "157:2": "minecraft:activator_rail[shape=ascending_east,powered=false]", + "157:3": "minecraft:activator_rail[shape=ascending_west,powered=false]", + "157:4": "minecraft:activator_rail[shape=ascending_north,powered=false]", + "157:5": "minecraft:activator_rail[shape=ascending_south,powered=false]", + "157:8": "minecraft:activator_rail[shape=north_south,powered=true]", + "157:9": "minecraft:activator_rail[shape=east_west,powered=true]", + "157:10": "minecraft:activator_rail[shape=ascending_east,powered=true]", + "157:11": "minecraft:activator_rail[shape=ascending_west,powered=true]", + "157:12": "minecraft:activator_rail[shape=ascending_north,powered=true]", + "157:13": "minecraft:activator_rail[shape=ascending_south,powered=true]", + "158:0": "minecraft:dropper[triggered=false,facing=down]", + "158:1": "minecraft:dropper[triggered=false,facing=up]", + "158:2": "minecraft:dropper[triggered=false,facing=north]", + "158:3": "minecraft:dropper[triggered=false,facing=south]", + "158:4": "minecraft:dropper[triggered=false,facing=west]", + "158:5": "minecraft:dropper[triggered=false,facing=east]", + "158:8": "minecraft:dropper[triggered=true,facing=down]", + "158:9": "minecraft:dropper[triggered=true,facing=up]", + "158:10": "minecraft:dropper[triggered=true,facing=north]", + "158:11": "minecraft:dropper[triggered=true,facing=south]", + "158:12": "minecraft:dropper[triggered=true,facing=west]", + "158:13": "minecraft:dropper[triggered=true,facing=east]", + "159:0": "minecraft:white_terracotta", + "159:1": "minecraft:orange_terracotta", + "159:2": "minecraft:magenta_terracotta", + "159:3": "minecraft:stained_hardened_clay[color=lightblue]", + "159:4": "minecraft:yellow_terracotta", + "159:5": "minecraft:lime_terracotta", + "159:6": "minecraft:pink_terracotta", + "159:7": "minecraft:gray_terracotta", + "159:8": "minecraft:light_gray_terracotta", + "159:9": "minecraft:cyan_terracotta", + "159:10": "minecraft:purple_terracotta", + "159:11": "minecraft:blue_terracotta", + "159:12": "minecraft:brown_terracotta", + "159:13": "minecraft:green_terracotta", + "159:14": "minecraft:red_terracotta", + "159:15": "minecraft:black_terracotta", + "160:0": "minecraft:stained_glass_pane[east=false,color=white,south=false,north=false,west=false]", + "160:1": "minecraft:stained_glass_pane[east=false,color=orange,south=false,north=false,west=false]", + "160:2": "minecraft:stained_glass_pane[east=false,color=magenta,south=false,north=false,west=false]", + "160:3": "minecraft:stained_glass_pane[east=false,color=lightblue,south=false,north=false,west=false]", + "160:4": "minecraft:stained_glass_pane[east=false,color=yellow,south=false,north=false,west=false]", + "160:5": "minecraft:stained_glass_pane[east=false,color=lime,south=false,north=false,west=false]", + "160:6": "minecraft:stained_glass_pane[east=false,color=pink,south=false,north=false,west=false]", + "160:7": "minecraft:stained_glass_pane[east=false,color=gray,south=false,north=false,west=false]", + "160:8": "minecraft:stained_glass_pane[east=false,color=silver,south=false,north=false,west=false]", + "160:9": "minecraft:stained_glass_pane[east=false,color=cyan,south=false,north=false,west=false]", + "160:10": "minecraft:stained_glass_pane[east=false,color=purple,south=false,north=false,west=false]", + "160:11": "minecraft:stained_glass_pane[east=false,color=blue,south=false,north=false,west=false]", + "160:12": "minecraft:stained_glass_pane[east=false,color=brown,south=false,north=false,west=false]", + "160:13": "minecraft:stained_glass_pane[east=false,color=green,south=false,north=false,west=false]", + "160:14": "minecraft:stained_glass_pane[east=false,color=red,south=false,north=false,west=false]", + "160:15": "minecraft:stained_glass_pane[east=false,color=black,south=false,north=false,west=false]", + "161:0": "minecraft:acacia_leaves[check_decay=false,decayable=true]", + "161:1": "minecraft:dark_oak_leaves[check_decay=false,decayable=true]", + "161:4": "minecraft:acacia_leaves[check_decay=false,decayable=false]", + "161:5": "minecraft:dark_oak_leaves[check_decay=false,decayable=false]", + "161:8": "minecraft:acacia_leaves[check_decay=true,decayable=true]", + "161:9": "minecraft:dark_oak_leaves[check_decay=true,decayable=true]", + "161:12": "minecraft:acacia_leaves[check_decay=true,decayable=false]", + "161:13": "minecraft:dark_oak_leaves[check_decay=true,decayable=false]", + "162:0": "minecraft:log2[variant=acacia,axis=y]", + "162:1": "minecraft:log2[variant=dark_oak,axis=y]", + "162:4": "minecraft:log2[variant=acacia,axis=x]", + "162:5": "minecraft:log2[variant=dark_oak,axis=x]", + "162:8": "minecraft:log2[variant=acacia,axis=z]", + "162:9": "minecraft:log2[variant=dark_oak,axis=z]", + "162:12": "minecraft:log2[variant=acacia,axis=none]", + "162:13": "minecraft:log2[variant=dark_oak,axis=none]", + "163:0": "minecraft:acacia_stairs[half=bottom,shape=outer_right,facing=east]", + "163:1": "minecraft:acacia_stairs[half=bottom,shape=outer_right,facing=west]", + "163:2": "minecraft:acacia_stairs[half=bottom,shape=outer_right,facing=south]", + "163:3": "minecraft:acacia_stairs[half=bottom,shape=outer_right,facing=north]", + "163:4": "minecraft:acacia_stairs[half=top,shape=outer_right,facing=east]", + "163:5": "minecraft:acacia_stairs[half=top,shape=outer_right,facing=west]", + "163:6": "minecraft:acacia_stairs[half=top,shape=outer_right,facing=south]", + "163:7": "minecraft:acacia_stairs[half=top,shape=outer_right,facing=north]", + "164:0": "minecraft:dark_oak_stairs[half=bottom,shape=outer_right,facing=east]", + "164:1": "minecraft:dark_oak_stairs[half=bottom,shape=outer_right,facing=west]", + "164:2": "minecraft:dark_oak_stairs[half=bottom,shape=outer_right,facing=south]", + "164:3": "minecraft:dark_oak_stairs[half=bottom,shape=outer_right,facing=north]", + "164:4": "minecraft:dark_oak_stairs[half=top,shape=outer_right,facing=east]", + "164:5": "minecraft:dark_oak_stairs[half=top,shape=outer_right,facing=west]", + "164:6": "minecraft:dark_oak_stairs[half=top,shape=outer_right,facing=south]", + "164:7": "minecraft:dark_oak_stairs[half=top,shape=outer_right,facing=north]", + "165:0": "minecraft:slime_block", + "166:0": "minecraft:barrier", + "167:0": "minecraft:iron_trapdoor[half=bottom,facing=north,open=false]", + "167:1": "minecraft:iron_trapdoor[half=bottom,facing=south,open=false]", + "167:2": "minecraft:iron_trapdoor[half=bottom,facing=west,open=false]", + "167:3": "minecraft:iron_trapdoor[half=bottom,facing=east,open=false]", + "167:4": "minecraft:iron_trapdoor[half=bottom,facing=north,open=true]", + "167:5": "minecraft:iron_trapdoor[half=bottom,facing=south,open=true]", + "167:6": "minecraft:iron_trapdoor[half=bottom,facing=west,open=true]", + "167:7": "minecraft:iron_trapdoor[half=bottom,facing=east,open=true]", + "167:8": "minecraft:iron_trapdoor[half=top,facing=north,open=false]", + "167:9": "minecraft:iron_trapdoor[half=top,facing=south,open=false]", + "167:10": "minecraft:iron_trapdoor[half=top,facing=west,open=false]", + "167:11": "minecraft:iron_trapdoor[half=top,facing=east,open=false]", + "167:12": "minecraft:iron_trapdoor[half=top,facing=north,open=true]", + "167:13": "minecraft:iron_trapdoor[half=top,facing=south,open=true]", + "167:14": "minecraft:iron_trapdoor[half=top,facing=west,open=true]", + "167:15": "minecraft:iron_trapdoor[half=top,facing=east,open=true]", + "168:0": "minecraft:prismarine", + "168:1": "minecraft:prismarine_bricks", + "168:2": "minecraft:dark_prismarine", + "169:0": "minecraft:sea_lantern", + "170:0": "minecraft:hay_block[axis=y]", + "170:4": "minecraft:hay_block[axis=x]", + "170:8": "minecraft:hay_block[axis=z]", + "171:0": "minecraft:white_carpet", + "171:1": "minecraft:orange_carpet", + "171:2": "minecraft:magenta_carpet", + "171:3": "minecraft:carpet[color=lightblue]", + "171:4": "minecraft:yellow_carpet", + "171:5": "minecraft:lime_carpet", + "171:6": "minecraft:pink_carpet", + "171:7": "minecraft:gray_carpet", + "171:8": "minecraft:light_gray_carpet", + "171:9": "minecraft:cyan_carpet", + "171:10": "minecraft:purple_carpet", + "171:11": "minecraft:blue_carpet", + "171:12": "minecraft:brown_carpet", + "171:13": "minecraft:green_carpet", + "171:14": "minecraft:red_carpet", + "171:15": "minecraft:black_carpet", + "172:0": "minecraft:terracotta", + "173:0": "minecraft:coal_block", + "174:0": "minecraft:packed_ice", + "175:0": "minecraft:double_plant[half=lower,variant=sunflower,facing=east]", + "175:1": "minecraft:double_plant[half=lower,variant=syringa,facing=east]", + "175:2": "minecraft:double_plant[half=lower,variant=double_grass,facing=east]", + "175:3": "minecraft:double_plant[half=lower,variant=double_fern,facing=east]", + "175:4": "minecraft:double_plant[half=lower,variant=double_rose,facing=east]", + "175:5": "minecraft:double_plant[half=lower,variant=paeonia,facing=east]", + "175:8": "minecraft:double_plant[half=upper,variant=paeonia,facing=south]", + "175:9": "minecraft:double_plant[half=upper,variant=paeonia,facing=west]", + "175:10": "minecraft:double_plant[half=upper,variant=paeonia,facing=north]", + "175:11": "minecraft:double_plant[half=upper,variant=paeonia,facing=east]", + "176:0": "minecraft:white_banner[rotation=0]", + "176:1": "minecraft:white_banner[rotation=1]", + "176:2": "minecraft:white_banner[rotation=2]", + "176:3": "minecraft:white_banner[rotation=3]", + "176:4": "minecraft:white_banner[rotation=4]", + "176:5": "minecraft:white_banner[rotation=5]", + "176:6": "minecraft:white_banner[rotation=6]", + "176:7": "minecraft:white_banner[rotation=7]", + "176:8": "minecraft:white_banner[rotation=8]", + "176:9": "minecraft:white_banner[rotation=9]", + "176:10": "minecraft:white_banner[rotation=10]", + "176:11": "minecraft:white_banner[rotation=11]", + "176:12": "minecraft:white_banner[rotation=12]", + "176:13": "minecraft:white_banner[rotation=13]", + "176:14": "minecraft:white_banner[rotation=14]", + "176:15": "minecraft:white_banner[rotation=15]", + "177:2": "minecraft:white_wall_banner[facing=north]", + "177:3": "minecraft:white_wall_banner[facing=south]", + "177:4": "minecraft:white_wall_banner[facing=west]", + "177:5": "minecraft:white_wall_banner[facing=east]", + "178:0": "minecraft:daylight_detector[inverted=true,power=0]", + "178:1": "minecraft:daylight_detector[inverted=true,power=1]", + "178:2": "minecraft:daylight_detector[inverted=true,power=2]", + "178:3": "minecraft:daylight_detector[inverted=true,power=3]", + "178:4": "minecraft:daylight_detector[inverted=true,power=4]", + "178:5": "minecraft:daylight_detector[inverted=true,power=5]", + "178:6": "minecraft:daylight_detector[inverted=true,power=6]", + "178:7": "minecraft:daylight_detector[inverted=true,power=7]", + "178:8": "minecraft:daylight_detector[inverted=true,power=8]", + "178:9": "minecraft:daylight_detector[inverted=true,power=9]", + "178:10": "minecraft:daylight_detector[inverted=true,power=10]", + "178:11": "minecraft:daylight_detector[inverted=true,power=11]", + "178:12": "minecraft:daylight_detector[inverted=true,power=12]", + "178:13": "minecraft:daylight_detector[inverted=true,power=13]", + "178:14": "minecraft:daylight_detector[inverted=true,power=14]", + "178:15": "minecraft:daylight_detector[inverted=true,power=15]", + "179:0": "minecraft:red_sandstone", + "179:1": "minecraft:chiseled_red_sandstone", + "179:2": "minecraft:cut_red_sandstone", + "180:0": "minecraft:red_sandstone_stairs[half=bottom,shape=outer_right,facing=east]", + "180:1": "minecraft:red_sandstone_stairs[half=bottom,shape=outer_right,facing=west]", + "180:2": "minecraft:red_sandstone_stairs[half=bottom,shape=outer_right,facing=south]", + "180:3": "minecraft:red_sandstone_stairs[half=bottom,shape=outer_right,facing=north]", + "180:4": "minecraft:red_sandstone_stairs[half=top,shape=outer_right,facing=east]", + "180:5": "minecraft:red_sandstone_stairs[half=top,shape=outer_right,facing=west]", + "180:6": "minecraft:red_sandstone_stairs[half=top,shape=outer_right,facing=south]", + "180:7": "minecraft:red_sandstone_stairs[half=top,shape=outer_right,facing=north]", + "181:0": "minecraft:red_sandstone_slab[type=double]", + "181:8": "minecraft:smooth_red_sandstone", + "182:0": "minecraft:red_sandstone_slab[type=bottom]", + "182:8": "minecraft:red_sandstone_slab[type=top]", + "183:0": "minecraft:spruce_fence_gate[in_wall=false,powered=false,facing=south,open=false]", + "183:1": "minecraft:spruce_fence_gate[in_wall=false,powered=false,facing=west,open=false]", + "183:2": "minecraft:spruce_fence_gate[in_wall=false,powered=false,facing=north,open=false]", + "183:3": "minecraft:spruce_fence_gate[in_wall=false,powered=false,facing=east,open=false]", + "183:4": "minecraft:spruce_fence_gate[in_wall=false,powered=false,facing=south,open=true]", + "183:5": "minecraft:spruce_fence_gate[in_wall=false,powered=false,facing=west,open=true]", + "183:6": "minecraft:spruce_fence_gate[in_wall=false,powered=false,facing=north,open=true]", + "183:7": "minecraft:spruce_fence_gate[in_wall=false,powered=false,facing=east,open=true]", + "183:8": "minecraft:spruce_fence_gate[in_wall=false,powered=true,facing=south,open=false]", + "183:9": "minecraft:spruce_fence_gate[in_wall=false,powered=true,facing=west,open=false]", + "183:10": "minecraft:spruce_fence_gate[in_wall=false,powered=true,facing=north,open=false]", + "183:11": "minecraft:spruce_fence_gate[in_wall=false,powered=true,facing=east,open=false]", + "183:12": "minecraft:spruce_fence_gate[in_wall=false,powered=true,facing=south,open=true]", + "183:13": "minecraft:spruce_fence_gate[in_wall=false,powered=true,facing=west,open=true]", + "183:14": "minecraft:spruce_fence_gate[in_wall=false,powered=true,facing=north,open=true]", + "183:15": "minecraft:spruce_fence_gate[in_wall=false,powered=true,facing=east,open=true]", + "184:0": "minecraft:birch_fence_gate[in_wall=false,powered=false,facing=south,open=false]", + "184:1": "minecraft:birch_fence_gate[in_wall=false,powered=false,facing=west,open=false]", + "184:2": "minecraft:birch_fence_gate[in_wall=false,powered=false,facing=north,open=false]", + "184:3": "minecraft:birch_fence_gate[in_wall=false,powered=false,facing=east,open=false]", + "184:4": "minecraft:birch_fence_gate[in_wall=false,powered=false,facing=south,open=true]", + "184:5": "minecraft:birch_fence_gate[in_wall=false,powered=false,facing=west,open=true]", + "184:6": "minecraft:birch_fence_gate[in_wall=false,powered=false,facing=north,open=true]", + "184:7": "minecraft:birch_fence_gate[in_wall=false,powered=false,facing=east,open=true]", + "184:8": "minecraft:birch_fence_gate[in_wall=false,powered=true,facing=south,open=false]", + "184:9": "minecraft:birch_fence_gate[in_wall=false,powered=true,facing=west,open=false]", + "184:10": "minecraft:birch_fence_gate[in_wall=false,powered=true,facing=north,open=false]", + "184:11": "minecraft:birch_fence_gate[in_wall=false,powered=true,facing=east,open=false]", + "184:12": "minecraft:birch_fence_gate[in_wall=false,powered=true,facing=south,open=true]", + "184:13": "minecraft:birch_fence_gate[in_wall=false,powered=true,facing=west,open=true]", + "184:14": "minecraft:birch_fence_gate[in_wall=false,powered=true,facing=north,open=true]", + "184:15": "minecraft:birch_fence_gate[in_wall=false,powered=true,facing=east,open=true]", + "185:0": "minecraft:jungle_fence_gate[in_wall=false,powered=false,facing=south,open=false]", + "185:1": "minecraft:jungle_fence_gate[in_wall=false,powered=false,facing=west,open=false]", + "185:2": "minecraft:jungle_fence_gate[in_wall=false,powered=false,facing=north,open=false]", + "185:3": "minecraft:jungle_fence_gate[in_wall=false,powered=false,facing=east,open=false]", + "185:4": "minecraft:jungle_fence_gate[in_wall=false,powered=false,facing=south,open=true]", + "185:5": "minecraft:jungle_fence_gate[in_wall=false,powered=false,facing=west,open=true]", + "185:6": "minecraft:jungle_fence_gate[in_wall=false,powered=false,facing=north,open=true]", + "185:7": "minecraft:jungle_fence_gate[in_wall=false,powered=false,facing=east,open=true]", + "185:8": "minecraft:jungle_fence_gate[in_wall=false,powered=true,facing=south,open=false]", + "185:9": "minecraft:jungle_fence_gate[in_wall=false,powered=true,facing=west,open=false]", + "185:10": "minecraft:jungle_fence_gate[in_wall=false,powered=true,facing=north,open=false]", + "185:11": "minecraft:jungle_fence_gate[in_wall=false,powered=true,facing=east,open=false]", + "185:12": "minecraft:jungle_fence_gate[in_wall=false,powered=true,facing=south,open=true]", + "185:13": "minecraft:jungle_fence_gate[in_wall=false,powered=true,facing=west,open=true]", + "185:14": "minecraft:jungle_fence_gate[in_wall=false,powered=true,facing=north,open=true]", + "185:15": "minecraft:jungle_fence_gate[in_wall=false,powered=true,facing=east,open=true]", + "186:0": "minecraft:dark_oak_fence_gate[in_wall=false,powered=false,facing=south,open=false]", + "186:1": "minecraft:dark_oak_fence_gate[in_wall=false,powered=false,facing=west,open=false]", + "186:2": "minecraft:dark_oak_fence_gate[in_wall=false,powered=false,facing=north,open=false]", + "186:3": "minecraft:dark_oak_fence_gate[in_wall=false,powered=false,facing=east,open=false]", + "186:4": "minecraft:dark_oak_fence_gate[in_wall=false,powered=false,facing=south,open=true]", + "186:5": "minecraft:dark_oak_fence_gate[in_wall=false,powered=false,facing=west,open=true]", + "186:6": "minecraft:dark_oak_fence_gate[in_wall=false,powered=false,facing=north,open=true]", + "186:7": "minecraft:dark_oak_fence_gate[in_wall=false,powered=false,facing=east,open=true]", + "186:8": "minecraft:dark_oak_fence_gate[in_wall=false,powered=true,facing=south,open=false]", + "186:9": "minecraft:dark_oak_fence_gate[in_wall=false,powered=true,facing=west,open=false]", + "186:10": "minecraft:dark_oak_fence_gate[in_wall=false,powered=true,facing=north,open=false]", + "186:11": "minecraft:dark_oak_fence_gate[in_wall=false,powered=true,facing=east,open=false]", + "186:12": "minecraft:dark_oak_fence_gate[in_wall=false,powered=true,facing=south,open=true]", + "186:13": "minecraft:dark_oak_fence_gate[in_wall=false,powered=true,facing=west,open=true]", + "186:14": "minecraft:dark_oak_fence_gate[in_wall=false,powered=true,facing=north,open=true]", + "186:15": "minecraft:dark_oak_fence_gate[in_wall=false,powered=true,facing=east,open=true]", + "187:0": "minecraft:acacia_fence_gate[in_wall=false,powered=false,facing=south,open=false]", + "187:1": "minecraft:acacia_fence_gate[in_wall=false,powered=false,facing=west,open=false]", + "187:2": "minecraft:acacia_fence_gate[in_wall=false,powered=false,facing=north,open=false]", + "187:3": "minecraft:acacia_fence_gate[in_wall=false,powered=false,facing=east,open=false]", + "187:4": "minecraft:acacia_fence_gate[in_wall=false,powered=false,facing=south,open=true]", + "187:5": "minecraft:acacia_fence_gate[in_wall=false,powered=false,facing=west,open=true]", + "187:6": "minecraft:acacia_fence_gate[in_wall=false,powered=false,facing=north,open=true]", + "187:7": "minecraft:acacia_fence_gate[in_wall=false,powered=false,facing=east,open=true]", + "187:8": "minecraft:acacia_fence_gate[in_wall=false,powered=true,facing=south,open=false]", + "187:9": "minecraft:acacia_fence_gate[in_wall=false,powered=true,facing=west,open=false]", + "187:10": "minecraft:acacia_fence_gate[in_wall=false,powered=true,facing=north,open=false]", + "187:11": "minecraft:acacia_fence_gate[in_wall=false,powered=true,facing=east,open=false]", + "187:12": "minecraft:acacia_fence_gate[in_wall=false,powered=true,facing=south,open=true]", + "187:13": "minecraft:acacia_fence_gate[in_wall=false,powered=true,facing=west,open=true]", + "187:14": "minecraft:acacia_fence_gate[in_wall=false,powered=true,facing=north,open=true]", + "187:15": "minecraft:acacia_fence_gate[in_wall=false,powered=true,facing=east,open=true]", + "188:0": "minecraft:spruce_fence[east=false,south=false,north=false,west=false]", + "189:0": "minecraft:birch_fence[east=false,south=false,north=false,west=false]", + "190:0": "minecraft:jungle_fence[east=false,south=false,north=false,west=false]", + "191:0": "minecraft:dark_oak_fence[east=false,south=false,north=false,west=false]", + "192:0": "minecraft:acacia_fence[east=false,south=false,north=false,west=false]", + "193:0": "minecraft:spruce_door[hinge=right,half=lower,powered=false,facing=east,open=false]", + "193:1": "minecraft:spruce_door[hinge=right,half=lower,powered=false,facing=south,open=false]", + "193:2": "minecraft:spruce_door[hinge=right,half=lower,powered=false,facing=west,open=false]", + "193:3": "minecraft:spruce_door[hinge=right,half=lower,powered=false,facing=north,open=false]", + "193:4": "minecraft:spruce_door[hinge=right,half=lower,powered=false,facing=east,open=true]", + "193:5": "minecraft:spruce_door[hinge=right,half=lower,powered=false,facing=south,open=true]", + "193:6": "minecraft:spruce_door[hinge=right,half=lower,powered=false,facing=west,open=true]", + "193:7": "minecraft:spruce_door[hinge=right,half=lower,powered=false,facing=north,open=true]", + "193:8": "minecraft:spruce_door[hinge=left,half=upper,powered=false,facing=east,open=false]", + "193:9": "minecraft:spruce_door[hinge=right,half=upper,powered=false,facing=east,open=false]", + "193:10": "minecraft:spruce_door[hinge=left,half=upper,powered=true,facing=east,open=false]", + "193:11": "minecraft:spruce_door[hinge=right,half=upper,powered=true,facing=east,open=false]", + "194:0": "minecraft:birch_door[hinge=right,half=lower,powered=false,facing=east,open=false]", + "194:1": "minecraft:birch_door[hinge=right,half=lower,powered=false,facing=south,open=false]", + "194:2": "minecraft:birch_door[hinge=right,half=lower,powered=false,facing=west,open=false]", + "194:3": "minecraft:birch_door[hinge=right,half=lower,powered=false,facing=north,open=false]", + "194:4": "minecraft:birch_door[hinge=right,half=lower,powered=false,facing=east,open=true]", + "194:5": "minecraft:birch_door[hinge=right,half=lower,powered=false,facing=south,open=true]", + "194:6": "minecraft:birch_door[hinge=right,half=lower,powered=false,facing=west,open=true]", + "194:7": "minecraft:birch_door[hinge=right,half=lower,powered=false,facing=north,open=true]", + "194:8": "minecraft:birch_door[hinge=left,half=upper,powered=false,facing=east,open=false]", + "194:9": "minecraft:birch_door[hinge=right,half=upper,powered=false,facing=east,open=false]", + "194:10": "minecraft:birch_door[hinge=left,half=upper,powered=true,facing=east,open=false]", + "194:11": "minecraft:birch_door[hinge=right,half=upper,powered=true,facing=east,open=false]", + "195:0": "minecraft:jungle_door[hinge=right,half=lower,powered=false,facing=east,open=false]", + "195:1": "minecraft:jungle_door[hinge=right,half=lower,powered=false,facing=south,open=false]", + "195:2": "minecraft:jungle_door[hinge=right,half=lower,powered=false,facing=west,open=false]", + "195:3": "minecraft:jungle_door[hinge=right,half=lower,powered=false,facing=north,open=false]", + "195:4": "minecraft:jungle_door[hinge=right,half=lower,powered=false,facing=east,open=true]", + "195:5": "minecraft:jungle_door[hinge=right,half=lower,powered=false,facing=south,open=true]", + "195:6": "minecraft:jungle_door[hinge=right,half=lower,powered=false,facing=west,open=true]", + "195:7": "minecraft:jungle_door[hinge=right,half=lower,powered=false,facing=north,open=true]", + "195:8": "minecraft:jungle_door[hinge=left,half=upper,powered=false,facing=east,open=false]", + "195:9": "minecraft:jungle_door[hinge=right,half=upper,powered=false,facing=east,open=false]", + "195:10": "minecraft:jungle_door[hinge=left,half=upper,powered=true,facing=east,open=false]", + "195:11": "minecraft:jungle_door[hinge=right,half=upper,powered=true,facing=east,open=false]", + "196:0": "minecraft:acacia_door[hinge=right,half=lower,powered=false,facing=east,open=false]", + "196:1": "minecraft:acacia_door[hinge=right,half=lower,powered=false,facing=south,open=false]", + "196:2": "minecraft:acacia_door[hinge=right,half=lower,powered=false,facing=west,open=false]", + "196:3": "minecraft:acacia_door[hinge=right,half=lower,powered=false,facing=north,open=false]", + "196:4": "minecraft:acacia_door[hinge=right,half=lower,powered=false,facing=east,open=true]", + "196:5": "minecraft:acacia_door[hinge=right,half=lower,powered=false,facing=south,open=true]", + "196:6": "minecraft:acacia_door[hinge=right,half=lower,powered=false,facing=west,open=true]", + "196:7": "minecraft:acacia_door[hinge=right,half=lower,powered=false,facing=north,open=true]", + "196:8": "minecraft:acacia_door[hinge=left,half=upper,powered=false,facing=east,open=false]", + "196:9": "minecraft:acacia_door[hinge=right,half=upper,powered=false,facing=east,open=false]", + "196:10": "minecraft:acacia_door[hinge=left,half=upper,powered=true,facing=east,open=false]", + "196:11": "minecraft:acacia_door[hinge=right,half=upper,powered=true,facing=east,open=false]", + "197:0": "minecraft:dark_oak_door[hinge=right,half=lower,powered=false,facing=east,open=false]", + "197:1": "minecraft:dark_oak_door[hinge=right,half=lower,powered=false,facing=south,open=false]", + "197:2": "minecraft:dark_oak_door[hinge=right,half=lower,powered=false,facing=west,open=false]", + "197:3": "minecraft:dark_oak_door[hinge=right,half=lower,powered=false,facing=north,open=false]", + "197:4": "minecraft:dark_oak_door[hinge=right,half=lower,powered=false,facing=east,open=true]", + "197:5": "minecraft:dark_oak_door[hinge=right,half=lower,powered=false,facing=south,open=true]", + "197:6": "minecraft:dark_oak_door[hinge=right,half=lower,powered=false,facing=west,open=true]", + "197:7": "minecraft:dark_oak_door[hinge=right,half=lower,powered=false,facing=north,open=true]", + "197:8": "minecraft:dark_oak_door[hinge=left,half=upper,powered=false,facing=east,open=false]", + "197:9": "minecraft:dark_oak_door[hinge=right,half=upper,powered=false,facing=east,open=false]", + "197:10": "minecraft:dark_oak_door[hinge=left,half=upper,powered=true,facing=east,open=false]", + "197:11": "minecraft:dark_oak_door[hinge=right,half=upper,powered=true,facing=east,open=false]", + "198:0": "minecraft:end_rod[facing=down]", + "198:1": "minecraft:end_rod[facing=up]", + "198:2": "minecraft:end_rod[facing=north]", + "198:3": "minecraft:end_rod[facing=south]", + "198:4": "minecraft:end_rod[facing=west]", + "198:5": "minecraft:end_rod[facing=east]", + "199:0": "minecraft:chorus_plant[east=false,south=false,north=false,west=false,up=false,down=false]", + "200:0": "minecraft:chorus_flower[age=0]", + "200:1": "minecraft:chorus_flower[age=1]", + "200:2": "minecraft:chorus_flower[age=2]", + "200:3": "minecraft:chorus_flower[age=3]", + "200:4": "minecraft:chorus_flower[age=4]", + "200:5": "minecraft:chorus_flower[age=5]", + "201:0": "minecraft:purpur_block", + "202:0": "minecraft:purpur_pillar[axis=y]", + "202:4": "minecraft:purpur_pillar[axis=x]", + "202:8": "minecraft:purpur_pillar[axis=z]", + "203:0": "minecraft:purpur_stairs[half=bottom,shape=outer_right,facing=east]", + "203:1": "minecraft:purpur_stairs[half=bottom,shape=outer_right,facing=west]", + "203:2": "minecraft:purpur_stairs[half=bottom,shape=outer_right,facing=south]", + "203:3": "minecraft:purpur_stairs[half=bottom,shape=outer_right,facing=north]", + "203:4": "minecraft:purpur_stairs[half=top,shape=outer_right,facing=east]", + "203:5": "minecraft:purpur_stairs[half=top,shape=outer_right,facing=west]", + "203:6": "minecraft:purpur_stairs[half=top,shape=outer_right,facing=south]", + "203:7": "minecraft:purpur_stairs[half=top,shape=outer_right,facing=north]", + "204:0": "minecraft:purpur_slab[type=double]", + "205:0": "minecraft:purpur_slab[type=bottom]", + "205:8": "minecraft:purpur_slab[type=top]", + "206:0": "minecraft:end_stone_bricks", + "207:0": "minecraft:beetroots[age=0]", + "207:1": "minecraft:beetroots[age=1]", + "207:2": "minecraft:beetroots[age=2]", + "207:3": "minecraft:beetroots[age=3]", + "208:0": "minecraft:grass_path", + "209:0": "minecraft:end_gateway", + "210:0": "minecraft:repeating_command_block[conditional=false,facing=down]", + "210:1": "minecraft:repeating_command_block[conditional=false,facing=up]", + "210:2": "minecraft:repeating_command_block[conditional=false,facing=north]", + "210:3": "minecraft:repeating_command_block[conditional=false,facing=south]", + "210:4": "minecraft:repeating_command_block[conditional=false,facing=west]", + "210:5": "minecraft:repeating_command_block[conditional=false,facing=east]", + "210:8": "minecraft:repeating_command_block[conditional=true,facing=down]", + "210:9": "minecraft:repeating_command_block[conditional=true,facing=up]", + "210:10": "minecraft:repeating_command_block[conditional=true,facing=north]", + "210:11": "minecraft:repeating_command_block[conditional=true,facing=south]", + "210:12": "minecraft:repeating_command_block[conditional=true,facing=west]", + "210:13": "minecraft:repeating_command_block[conditional=true,facing=east]", + "211:0": "minecraft:chain_command_block[conditional=false,facing=down]", + "211:1": "minecraft:chain_command_block[conditional=false,facing=up]", + "211:2": "minecraft:chain_command_block[conditional=false,facing=north]", + "211:3": "minecraft:chain_command_block[conditional=false,facing=south]", + "211:4": "minecraft:chain_command_block[conditional=false,facing=west]", + "211:5": "minecraft:chain_command_block[conditional=false,facing=east]", + "211:8": "minecraft:chain_command_block[conditional=true,facing=down]", + "211:9": "minecraft:chain_command_block[conditional=true,facing=up]", + "211:10": "minecraft:chain_command_block[conditional=true,facing=north]", + "211:11": "minecraft:chain_command_block[conditional=true,facing=south]", + "211:12": "minecraft:chain_command_block[conditional=true,facing=west]", + "211:13": "minecraft:chain_command_block[conditional=true,facing=east]", + "212:0": "minecraft:frosted_ice[age=0]", + "212:1": "minecraft:frosted_ice[age=1]", + "212:2": "minecraft:frosted_ice[age=2]", + "212:3": "minecraft:frosted_ice[age=3]", + "213:0": "minecraft:magma_block", + "214:0": "minecraft:nether_wart_block", + "215:0": "minecraft:red_nether_bricks", + "216:0": "minecraft:bone_block[axis=y]", + "216:4": "minecraft:bone_block[axis=x]", + "216:8": "minecraft:bone_block[axis=z]", + "217:0": "minecraft:structure_void", + "218:0": "minecraft:observer[powered=false,facing=down]", + "218:1": "minecraft:observer[powered=false,facing=up]", + "218:2": "minecraft:observer[powered=false,facing=north]", + "218:3": "minecraft:observer[powered=false,facing=south]", + "218:4": "minecraft:observer[powered=false,facing=west]", + "218:5": "minecraft:observer[powered=false,facing=east]", + "218:8": "minecraft:observer[powered=true,facing=down]", + "218:9": "minecraft:observer[powered=true,facing=up]", + "218:10": "minecraft:observer[powered=true,facing=north]", + "218:11": "minecraft:observer[powered=true,facing=south]", + "218:12": "minecraft:observer[powered=true,facing=west]", + "218:13": "minecraft:observer[powered=true,facing=east]", + "219:0": "minecraft:white_shulker_box[facing=down]", + "219:1": "minecraft:white_shulker_box[facing=up]", + "219:2": "minecraft:white_shulker_box[facing=north]", + "219:3": "minecraft:white_shulker_box[facing=south]", + "219:4": "minecraft:white_shulker_box[facing=west]", + "219:5": "minecraft:white_shulker_box[facing=east]", + "220:0": "minecraft:orange_shulker_box[facing=down]", + "220:1": "minecraft:orange_shulker_box[facing=up]", + "220:2": "minecraft:orange_shulker_box[facing=north]", + "220:3": "minecraft:orange_shulker_box[facing=south]", + "220:4": "minecraft:orange_shulker_box[facing=west]", + "220:5": "minecraft:orange_shulker_box[facing=east]", + "221:0": "minecraft:magenta_shulker_box[facing=down]", + "221:1": "minecraft:magenta_shulker_box[facing=up]", + "221:2": "minecraft:magenta_shulker_box[facing=north]", + "221:3": "minecraft:magenta_shulker_box[facing=south]", + "221:4": "minecraft:magenta_shulker_box[facing=west]", + "221:5": "minecraft:magenta_shulker_box[facing=east]", + "222:0": "minecraft:light_blue_shulker_box[facing=down]", + "222:1": "minecraft:light_blue_shulker_box[facing=up]", + "222:2": "minecraft:light_blue_shulker_box[facing=north]", + "222:3": "minecraft:light_blue_shulker_box[facing=south]", + "222:4": "minecraft:light_blue_shulker_box[facing=west]", + "222:5": "minecraft:light_blue_shulker_box[facing=east]", + "223:0": "minecraft:yellow_shulker_box[facing=down]", + "223:1": "minecraft:yellow_shulker_box[facing=up]", + "223:2": "minecraft:yellow_shulker_box[facing=north]", + "223:3": "minecraft:yellow_shulker_box[facing=south]", + "223:4": "minecraft:yellow_shulker_box[facing=west]", + "223:5": "minecraft:yellow_shulker_box[facing=east]", + "224:0": "minecraft:lime_shulker_box[facing=down]", + "224:1": "minecraft:lime_shulker_box[facing=up]", + "224:2": "minecraft:lime_shulker_box[facing=north]", + "224:3": "minecraft:lime_shulker_box[facing=south]", + "224:4": "minecraft:lime_shulker_box[facing=west]", + "224:5": "minecraft:lime_shulker_box[facing=east]", + "225:0": "minecraft:pink_shulker_box[facing=down]", + "225:1": "minecraft:pink_shulker_box[facing=up]", + "225:2": "minecraft:pink_shulker_box[facing=north]", + "225:3": "minecraft:pink_shulker_box[facing=south]", + "225:4": "minecraft:pink_shulker_box[facing=west]", + "225:5": "minecraft:pink_shulker_box[facing=east]", + "226:0": "minecraft:gray_shulker_box[facing=down]", + "226:1": "minecraft:gray_shulker_box[facing=up]", + "226:2": "minecraft:gray_shulker_box[facing=north]", + "226:3": "minecraft:gray_shulker_box[facing=south]", + "226:4": "minecraft:gray_shulker_box[facing=west]", + "226:5": "minecraft:gray_shulker_box[facing=east]", + "227:0": "minecraft:light_gray_shulker_box[facing=down]", + "227:1": "minecraft:light_gray_shulker_box[facing=up]", + "227:2": "minecraft:light_gray_shulker_box[facing=north]", + "227:3": "minecraft:light_gray_shulker_box[facing=south]", + "227:4": "minecraft:light_gray_shulker_box[facing=west]", + "227:5": "minecraft:light_gray_shulker_box[facing=east]", + "228:0": "minecraft:cyan_shulker_box[facing=down]", + "228:1": "minecraft:cyan_shulker_box[facing=up]", + "228:2": "minecraft:cyan_shulker_box[facing=north]", + "228:3": "minecraft:cyan_shulker_box[facing=south]", + "228:4": "minecraft:cyan_shulker_box[facing=west]", + "228:5": "minecraft:cyan_shulker_box[facing=east]", + "229:0": "minecraft:purple_shulker_box[facing=down]", + "229:1": "minecraft:purple_shulker_box[facing=up]", + "229:2": "minecraft:purple_shulker_box[facing=north]", + "229:3": "minecraft:purple_shulker_box[facing=south]", + "229:4": "minecraft:purple_shulker_box[facing=west]", + "229:5": "minecraft:purple_shulker_box[facing=east]", + "230:0": "minecraft:blue_shulker_box[facing=down]", + "230:1": "minecraft:blue_shulker_box[facing=up]", + "230:2": "minecraft:blue_shulker_box[facing=north]", + "230:3": "minecraft:blue_shulker_box[facing=south]", + "230:4": "minecraft:blue_shulker_box[facing=west]", + "230:5": "minecraft:blue_shulker_box[facing=east]", + "231:0": "minecraft:brown_shulker_box[facing=down]", + "231:1": "minecraft:brown_shulker_box[facing=up]", + "231:2": "minecraft:brown_shulker_box[facing=north]", + "231:3": "minecraft:brown_shulker_box[facing=south]", + "231:4": "minecraft:brown_shulker_box[facing=west]", + "231:5": "minecraft:brown_shulker_box[facing=east]", + "232:0": "minecraft:green_shulker_box[facing=down]", + "232:1": "minecraft:green_shulker_box[facing=up]", + "232:2": "minecraft:green_shulker_box[facing=north]", + "232:3": "minecraft:green_shulker_box[facing=south]", + "232:4": "minecraft:green_shulker_box[facing=west]", + "232:5": "minecraft:green_shulker_box[facing=east]", + "233:0": "minecraft:red_shulker_box[facing=down]", + "233:1": "minecraft:red_shulker_box[facing=up]", + "233:2": "minecraft:red_shulker_box[facing=north]", + "233:3": "minecraft:red_shulker_box[facing=south]", + "233:4": "minecraft:red_shulker_box[facing=west]", + "233:5": "minecraft:red_shulker_box[facing=east]", + "234:0": "minecraft:black_shulker_box[facing=down]", + "234:1": "minecraft:black_shulker_box[facing=up]", + "234:2": "minecraft:black_shulker_box[facing=north]", + "234:3": "minecraft:black_shulker_box[facing=south]", + "234:4": "minecraft:black_shulker_box[facing=west]", + "234:5": "minecraft:black_shulker_box[facing=east]", + "235:0": "minecraft:white_glazed_terracotta[facing=south]", + "235:1": "minecraft:white_glazed_terracotta[facing=west]", + "235:2": "minecraft:white_glazed_terracotta[facing=north]", + "235:3": "minecraft:white_glazed_terracotta[facing=east]", + "236:0": "minecraft:orange_glazed_terracotta[facing=south]", + "236:1": "minecraft:orange_glazed_terracotta[facing=west]", + "236:2": "minecraft:orange_glazed_terracotta[facing=north]", + "236:3": "minecraft:orange_glazed_terracotta[facing=east]", + "237:0": "minecraft:magenta_glazed_terracotta[facing=south]", + "237:1": "minecraft:magenta_glazed_terracotta[facing=west]", + "237:2": "minecraft:magenta_glazed_terracotta[facing=north]", + "237:3": "minecraft:magenta_glazed_terracotta[facing=east]", + "238:0": "minecraft:light_blue_glazed_terracotta[facing=south]", + "238:1": "minecraft:light_blue_glazed_terracotta[facing=west]", + "238:2": "minecraft:light_blue_glazed_terracotta[facing=north]", + "238:3": "minecraft:light_blue_glazed_terracotta[facing=east]", + "239:0": "minecraft:yellow_glazed_terracotta[facing=south]", + "239:1": "minecraft:yellow_glazed_terracotta[facing=west]", + "239:2": "minecraft:yellow_glazed_terracotta[facing=north]", + "239:3": "minecraft:yellow_glazed_terracotta[facing=east]", + "240:0": "minecraft:lime_glazed_terracotta[facing=south]", + "240:1": "minecraft:lime_glazed_terracotta[facing=west]", + "240:2": "minecraft:lime_glazed_terracotta[facing=north]", + "240:3": "minecraft:lime_glazed_terracotta[facing=east]", + "241:0": "minecraft:pink_glazed_terracotta[facing=south]", + "241:1": "minecraft:pink_glazed_terracotta[facing=west]", + "241:2": "minecraft:pink_glazed_terracotta[facing=north]", + "241:3": "minecraft:pink_glazed_terracotta[facing=east]", + "242:0": "minecraft:gray_glazed_terracotta[facing=south]", + "242:1": "minecraft:gray_glazed_terracotta[facing=west]", + "242:2": "minecraft:gray_glazed_terracotta[facing=north]", + "242:3": "minecraft:gray_glazed_terracotta[facing=east]", + "243:0": "minecraft:light_gray_glazed_terracotta[facing=south]", + "243:1": "minecraft:light_gray_glazed_terracotta[facing=west]", + "243:2": "minecraft:light_gray_glazed_terracotta[facing=north]", + "243:3": "minecraft:light_gray_glazed_terracotta[facing=east]", + "244:0": "minecraft:cyan_glazed_terracotta[facing=south]", + "244:1": "minecraft:cyan_glazed_terracotta[facing=west]", + "244:2": "minecraft:cyan_glazed_terracotta[facing=north]", + "244:3": "minecraft:cyan_glazed_terracotta[facing=east]", + "245:0": "minecraft:purple_glazed_terracotta[facing=south]", + "245:1": "minecraft:purple_glazed_terracotta[facing=west]", + "245:2": "minecraft:purple_glazed_terracotta[facing=north]", + "245:3": "minecraft:purple_glazed_terracotta[facing=east]", + "246:0": "minecraft:blue_glazed_terracotta[facing=south]", + "246:1": "minecraft:blue_glazed_terracotta[facing=west]", + "246:2": "minecraft:blue_glazed_terracotta[facing=north]", + "246:3": "minecraft:blue_glazed_terracotta[facing=east]", + "247:0": "minecraft:brown_glazed_terracotta[facing=south]", + "247:1": "minecraft:brown_glazed_terracotta[facing=west]", + "247:2": "minecraft:brown_glazed_terracotta[facing=north]", + "247:3": "minecraft:brown_glazed_terracotta[facing=east]", + "248:0": "minecraft:green_glazed_terracotta[facing=south]", + "248:1": "minecraft:green_glazed_terracotta[facing=west]", + "248:2": "minecraft:green_glazed_terracotta[facing=north]", + "248:3": "minecraft:green_glazed_terracotta[facing=east]", + "249:0": "minecraft:red_glazed_terracotta[facing=south]", + "249:1": "minecraft:red_glazed_terracotta[facing=west]", + "249:2": "minecraft:red_glazed_terracotta[facing=north]", + "249:3": "minecraft:red_glazed_terracotta[facing=east]", + "250:0": "minecraft:black_glazed_terracotta[facing=south]", + "250:1": "minecraft:black_glazed_terracotta[facing=west]", + "250:2": "minecraft:black_glazed_terracotta[facing=north]", + "250:3": "minecraft:black_glazed_terracotta[facing=east]", + "251:0": "minecraft:white_concrete", + "251:1": "minecraft:orange_concrete", + "251:2": "minecraft:magenta_concrete", + "251:3": "minecraft:concrete[color=lightblue]", + "251:4": "minecraft:yellow_concrete", + "251:5": "minecraft:lime_concrete", + "251:6": "minecraft:pink_concrete", + "251:7": "minecraft:gray_concrete", + "251:8": "minecraft:light_gray_concrete", + "251:9": "minecraft:cyan_concrete", + "251:10": "minecraft:purple_concrete", + "251:11": "minecraft:blue_concrete", + "251:12": "minecraft:brown_concrete", + "251:13": "minecraft:green_concrete", + "251:14": "minecraft:red_concrete", + "251:15": "minecraft:black_concrete", + "252:0": "minecraft:white_concrete_powder", + "252:1": "minecraft:orange_concrete_powder", + "252:2": "minecraft:magenta_concrete_powder", + "252:3": "minecraft:concrete_powder[color=lightblue]", + "252:4": "minecraft:yellow_concrete_powder", + "252:5": "minecraft:lime_concrete_powder", + "252:6": "minecraft:pink_concrete_powder", + "252:7": "minecraft:gray_concrete_powder", + "252:8": "minecraft:light_gray_concrete_powder", + "252:9": "minecraft:cyan_concrete_powder", + "252:10": "minecraft:purple_concrete_powder", + "252:11": "minecraft:blue_concrete_powder", + "252:12": "minecraft:brown_concrete_powder", + "252:13": "minecraft:green_concrete_powder", + "252:14": "minecraft:red_concrete_powder", + "252:15": "minecraft:black_concrete_powder", + "255:0": "minecraft:structure_block[mode=save]", + "255:1": "minecraft:structure_block[mode=load]", + "255:2": "minecraft:structure_block[mode=corner]", + "255:3": "minecraft:structure_block[mode=data]" + }, + "items": { + "0:0": "minecraft:air", + "1:0": "minecraft:stone", + "1:1": "minecraft:granite", + "1:2": "minecraft:polished_granite", + "1:3": "minecraft:diorite", + "1:4": "minecraft:polished_diorite", + "1:5": "minecraft:andesite", + "1:6": "minecraft:polished_andesite", + "2:0": "minecraft:grass_block", + "3:0": "minecraft:dirt", + "3:1": "minecraft:coarse_dirt", + "3:2": "minecraft:podzol", + "4:0": "minecraft:cobblestone", + "5:0": "minecraft:oak_planks", + "5:1": "minecraft:spruce_planks", + "5:2": "minecraft:birch_planks", + "5:3": "minecraft:jungle_planks", + "5:4": "minecraft:acacia_planks", + "5:5": "minecraft:dark_oak_planks", + "6:0": "minecraft:oak_sapling", + "6:1": "minecraft:spruce_sapling", + "6:2": "minecraft:birch_sapling", + "6:3": "minecraft:jungle_sapling", + "6:4": "minecraft:acacia_sapling", + "6:5": "minecraft:dark_oak_sapling", + "7:0": "minecraft:bedrock", + "12:0": "minecraft:sand", + "12:1": "minecraft:red_sand", + "13:0": "minecraft:gravel", + "14:0": "minecraft:gold_ore", + "15:0": "minecraft:iron_ore", + "16:0": "minecraft:coal_ore", + "17:0": "minecraft:oak_log", + "17:1": "minecraft:spruce_log", + "17:2": "minecraft:birch_log", + "17:3": "minecraft:jungle_log", + "18:0": "minecraft:oak_leaves", + "18:1": "minecraft:spruce_leaves", + "18:2": "minecraft:birch_leaves", + "18:3": "minecraft:jungle_leaves", + "19:0": "minecraft:sponge", + "19:1": "minecraft:wet_sponge", + "20:0": "minecraft:glass", + "21:0": "minecraft:lapis_ore", + "22:0": "minecraft:lapis_block", + "23:0": "minecraft:dispenser", + "24:0": "minecraft:sandstone", + "24:1": "minecraft:chiseled_sandstone", + "24:2": "minecraft:cut_sandstone", + "25:0": "minecraft:note_block", + "27:0": "minecraft:powered_rail", + "28:0": "minecraft:detector_rail", + "29:0": "minecraft:sticky_piston", + "30:0": "minecraft:cobweb", + "31:1": "minecraft:grass", + "31:2": "minecraft:fern", + "32:0": "minecraft:dead_bush", + "33:0": "minecraft:piston", + "35:0": "minecraft:white_wool", + "35:1": "minecraft:orange_wool", + "35:2": "minecraft:magenta_wool", + "35:3": "minecraft:light_blue_wool", + "35:4": "minecraft:yellow_wool", + "35:5": "minecraft:lime_wool", + "35:6": "minecraft:pink_wool", + "35:7": "minecraft:gray_wool", + "35:8": "minecraft:light_gray_wool", + "35:9": "minecraft:cyan_wool", + "35:10": "minecraft:purple_wool", + "35:11": "minecraft:blue_wool", + "35:12": "minecraft:brown_wool", + "35:13": "minecraft:green_wool", + "35:14": "minecraft:red_wool", + "35:15": "minecraft:black_wool", + "37:0": "minecraft:dandelion", + "38:0": "minecraft:poppy", + "38:1": "minecraft:blue_orchid", + "38:2": "minecraft:allium", + "38:3": "minecraft:azure_bluet", + "38:4": "minecraft:red_tulip", + "38:5": "minecraft:orange_tulip", + "38:6": "minecraft:white_tulip", + "38:7": "minecraft:pink_tulip", + "38:8": "minecraft:oxeye_daisy", + "39:0": "minecraft:brown_mushroom", + "40:0": "minecraft:red_mushroom", + "41:0": "minecraft:gold_block", + "42:0": "minecraft:iron_block", + "44:0": "minecraft:stone_slab", + "44:1": "minecraft:sandstone_slab", + "44:3": "minecraft:cobblestone_slab", + "44:4": "minecraft:brick_slab", + "44:5": "minecraft:stone_brick_slab", + "44:6": "minecraft:nether_brick_slab", + "44:7": "minecraft:quartz_slab", + "45:0": "minecraft:bricks", + "46:0": "minecraft:tnt", + "47:0": "minecraft:bookshelf", + "48:0": "minecraft:mossy_cobblestone", + "49:0": "minecraft:obsidian", + "50:0": "minecraft:torch", + "52:0": "minecraft:mob_spawner", + "53:0": "minecraft:oak_stairs", + "54:0": "minecraft:chest", + "56:0": "minecraft:diamond_ore", + "57:0": "minecraft:diamond_block", + "58:0": "minecraft:crafting_table", + "60:0": "minecraft:farmland", + "61:0": "minecraft:furnace", + "65:0": "minecraft:ladder", + "66:0": "minecraft:rail", + "67:0": "minecraft:cobblestone_stairs", + "69:0": "minecraft:lever", + "70:0": "minecraft:stone_pressure_plate", + "72:0": "minecraft:oak_pressure_plate", + "73:0": "minecraft:redstone_ore", + "76:0": "minecraft:redstone_torch", + "77:0": "minecraft:stone_button", + "78:0": "minecraft:snow", + "79:0": "minecraft:ice", + "80:0": "minecraft:snow_block", + "81:0": "minecraft:cactus", + "82:0": "minecraft:clay", + "84:0": "minecraft:jukebox", + "85:0": "minecraft:oak_fence", + "86:0": "minecraft:carved_pumpkin", + "87:0": "minecraft:netherrack", + "88:0": "minecraft:soul_sand", + "89:0": "minecraft:glowstone", + "91:0": "minecraft:jack_o_lantern", + "95:0": "minecraft:white_stained_glass", + "95:1": "minecraft:orange_stained_glass", + "95:2": "minecraft:magenta_stained_glass", + "95:3": "minecraft:light_blue_stained_glass", + "95:4": "minecraft:yellow_stained_glass", + "95:5": "minecraft:lime_stained_glass", + "95:6": "minecraft:pink_stained_glass", + "95:7": "minecraft:gray_stained_glass", + "95:8": "minecraft:light_gray_stained_glass", + "95:9": "minecraft:cyan_stained_glass", + "95:10": "minecraft:purple_stained_glass", + "95:11": "minecraft:blue_stained_glass", + "95:12": "minecraft:brown_stained_glass", + "95:13": "minecraft:green_stained_glass", + "95:14": "minecraft:red_stained_glass", + "95:15": "minecraft:black_stained_glass", + "96:0": "minecraft:oak_trapdoor", + "97:0": "minecraft:infested_stone", + "97:1": "minecraft:infested_cobblestone", + "97:2": "minecraft:infested_stone_bricks", + "97:3": "minecraft:infested_mossy_stone_bricks", + "97:4": "minecraft:infested_cracked_stone_bricks", + "97:5": "minecraft:infested_chiseled_stone_bricks", + "98:0": "minecraft:stone_bricks", + "98:1": "minecraft:mossy_stone_bricks", + "98:2": "minecraft:cracked_stone_bricks", + "98:3": "minecraft:chiseled_stone_bricks", + "99:0": "minecraft:brown_mushroom_block", + "100:0": "minecraft:red_mushroom_block", + "101:0": "minecraft:iron_bars", + "102:0": "minecraft:glass_pane", + "103:0": "minecraft:melon_block", + "106:0": "minecraft:vine", + "107:0": "minecraft:oak_fence_gate", + "108:0": "minecraft:brick_stairs", + "109:0": "minecraft:stone_brick_stairs", + "110:0": "minecraft:mycelium", + "111:0": "minecraft:lily_pad", + "112:0": "minecraft:nether_bricks", + "113:0": "minecraft:nether_brick_fence", + "114:0": "minecraft:nether_brick_stairs", + "116:0": "minecraft:enchanting_table", + "120:0": "minecraft:end_portal_frame", + "121:0": "minecraft:end_stone", + "122:0": "minecraft:dragon_egg", + "123:0": "minecraft:redstone_lamp", + "126:0": "minecraft:oak_slab", + "126:1": "minecraft:spruce_slab", + "126:2": "minecraft:birch_slab", + "126:3": "minecraft:jungle_slab", + "126:4": "minecraft:acacia_slab", + "126:5": "minecraft:dark_oak_slab", + "128:0": "minecraft:sandstone_stairs", + "129:0": "minecraft:emerald_ore", + "130:0": "minecraft:ender_chest", + "131:0": "minecraft:tripwire_hook", + "133:0": "minecraft:emerald_block", + "134:0": "minecraft:spruce_stairs", + "135:0": "minecraft:birch_stairs", + "136:0": "minecraft:jungle_stairs", + "137:0": "minecraft:command_block", + "138:0": "minecraft:beacon", + "139:0": "minecraft:cobblestone_wall", + "139:1": "minecraft:mossy_cobblestone_wall", + "143:0": "minecraft:oak_button", + "145:0": "minecraft:anvil", + "145:1": "minecraft:chipped_anvil", + "145:2": "minecraft:damaged_anvil", + "146:0": "minecraft:trapped_chest", + "147:0": "minecraft:light_weighted_pressure_plate", + "148:0": "minecraft:heavy_weighted_pressure_plate", + "151:0": "minecraft:daylight_detector", + "152:0": "minecraft:redstone_block", + "153:0": "minecraft:nether_quartz_ore", + "154:0": "minecraft:hopper", + "155:0": "minecraft:quartz_block", + "155:1": "minecraft:chiseled_quartz_block", + "155:2": "minecraft:quartz_pillar", + "156:0": "minecraft:quartz_stairs", + "157:0": "minecraft:activator_rail", + "158:0": "minecraft:dropper", + "159:0": "minecraft:white_terracotta", + "159:1": "minecraft:orange_terracotta", + "159:2": "minecraft:magenta_terracotta", + "159:3": "minecraft:light_blue_terracotta", + "159:4": "minecraft:yellow_terracotta", + "159:5": "minecraft:lime_terracotta", + "159:6": "minecraft:pink_terracotta", + "159:7": "minecraft:gray_terracotta", + "159:8": "minecraft:light_gray_terracotta", + "159:9": "minecraft:cyan_terracotta", + "159:10": "minecraft:purple_terracotta", + "159:11": "minecraft:blue_terracotta", + "159:12": "minecraft:brown_terracotta", + "159:13": "minecraft:green_terracotta", + "159:14": "minecraft:red_terracotta", + "159:15": "minecraft:black_terracotta", + "160:0": "minecraft:white_stained_glass_pane", + "160:1": "minecraft:orange_stained_glass_pane", + "160:2": "minecraft:magenta_stained_glass_pane", + "160:3": "minecraft:light_blue_stained_glass_pane", + "160:4": "minecraft:yellow_stained_glass_pane", + "160:5": "minecraft:lime_stained_glass_pane", + "160:6": "minecraft:pink_stained_glass_pane", + "160:7": "minecraft:gray_stained_glass_pane", + "160:8": "minecraft:light_gray_stained_glass_pane", + "160:9": "minecraft:cyan_stained_glass_pane", + "160:10": "minecraft:purple_stained_glass_pane", + "160:11": "minecraft:blue_stained_glass_pane", + "160:12": "minecraft:brown_stained_glass_pane", + "160:13": "minecraft:green_stained_glass_pane", + "160:14": "minecraft:red_stained_glass_pane", + "160:15": "minecraft:black_stained_glass_pane", + "161:0": "minecraft:acacia_leaves", + "161:1": "minecraft:dark_oak_leaves", + "162:0": "minecraft:acacia_log", + "162:1": "minecraft:dark_oak_log", + "163:0": "minecraft:acacia_stairs", + "164:0": "minecraft:dark_oak_stairs", + "165:0": "minecraft:slime_block", + "166:0": "minecraft:barrier", + "167:0": "minecraft:iron_trapdoor", + "168:0": "minecraft:prismarine", + "168:1": "minecraft:prismarine_bricks", + "168:2": "minecraft:dark_prismarine", + "169:0": "minecraft:sea_lantern", + "170:0": "minecraft:hay_block", + "171:0": "minecraft:white_carpet", + "171:1": "minecraft:orange_carpet", + "171:2": "minecraft:magenta_carpet", + "171:3": "minecraft:light_blue_carpet", + "171:4": "minecraft:yellow_carpet", + "171:5": "minecraft:lime_carpet", + "171:6": "minecraft:pink_carpet", + "171:7": "minecraft:gray_carpet", + "171:8": "minecraft:light_gray_carpet", + "171:9": "minecraft:cyan_carpet", + "171:10": "minecraft:purple_carpet", + "171:11": "minecraft:blue_carpet", + "171:12": "minecraft:brown_carpet", + "171:13": "minecraft:green_carpet", + "171:14": "minecraft:red_carpet", + "171:15": "minecraft:black_carpet", + "172:0": "minecraft:terracotta", + "173:0": "minecraft:coal_block", + "174:0": "minecraft:packed_ice", + "175:0": "minecraft:sunflower", + "175:1": "minecraft:lilac", + "175:2": "minecraft:tall_grass", + "175:3": "minecraft:large_fern", + "175:4": "minecraft:rose_bush", + "175:5": "minecraft:peony", + "179:0": "minecraft:red_sandstone", + "179:1": "minecraft:chiseled_red_sandstone", + "179:2": "minecraft:cut_red_sandstone", + "180:0": "minecraft:red_sandstone_stairs", + "182:0": "minecraft:red_sandstone_slab", + "183:0": "minecraft:spruce_fence_gate", + "184:0": "minecraft:birch_fence_gate", + "185:0": "minecraft:jungle_fence_gate", + "186:0": "minecraft:dark_oak_fence_gate", + "187:0": "minecraft:acacia_fence_gate", + "188:0": "minecraft:spruce_fence", + "189:0": "minecraft:birch_fence", + "190:0": "minecraft:jungle_fence", + "191:0": "minecraft:dark_oak_fence", + "192:0": "minecraft:acacia_fence", + "198:0": "minecraft:end_rod", + "199:0": "minecraft:chorus_plant", + "200:0": "minecraft:chorus_flower", + "201:0": "minecraft:purpur_block", + "202:0": "minecraft:purpur_pillar", + "203:0": "minecraft:purpur_stairs", + "205:0": "minecraft:purpur_slab", + "206:0": "minecraft:end_stone_bricks", + "208:0": "minecraft:grass_path", + "210:0": "minecraft:repeating_command_block", + "211:0": "minecraft:chain_command_block", + "213:0": "minecraft:magma_block", + "214:0": "minecraft:nether_wart_block", + "215:0": "minecraft:red_nether_bricks", + "216:0": "minecraft:bone_block", + "217:0": "minecraft:structure_void", + "218:0": "minecraft:observer", + "219:0": "minecraft:white_shulker_box", + "220:0": "minecraft:orange_shulker_box", + "221:0": "minecraft:magenta_shulker_box", + "222:0": "minecraft:light_blue_shulker_box", + "223:0": "minecraft:yellow_shulker_box", + "224:0": "minecraft:lime_shulker_box", + "225:0": "minecraft:pink_shulker_box", + "226:0": "minecraft:gray_shulker_box", + "227:0": "minecraft:light_gray_shulker_box", + "228:0": "minecraft:cyan_shulker_box", + "229:0": "minecraft:purple_shulker_box", + "230:0": "minecraft:blue_shulker_box", + "231:0": "minecraft:brown_shulker_box", + "232:0": "minecraft:green_shulker_box", + "233:0": "minecraft:red_shulker_box", + "234:0": "minecraft:black_shulker_box", + "235:0": "minecraft:white_glazed_terracotta", + "236:0": "minecraft:orange_glazed_terracotta", + "237:0": "minecraft:magenta_glazed_terracotta", + "238:0": "minecraft:light_blue_glazed_terracotta", + "239:0": "minecraft:yellow_glazed_terracotta", + "240:0": "minecraft:lime_glazed_terracotta", + "241:0": "minecraft:pink_glazed_terracotta", + "242:0": "minecraft:gray_glazed_terracotta", + "243:0": "minecraft:light_gray_glazed_terracotta", + "244:0": "minecraft:cyan_glazed_terracotta", + "245:0": "minecraft:purple_glazed_terracotta", + "246:0": "minecraft:blue_glazed_terracotta", + "247:0": "minecraft:brown_glazed_terracotta", + "248:0": "minecraft:green_glazed_terracotta", + "249:0": "minecraft:red_glazed_terracotta", + "250:0": "minecraft:black_glazed_terracotta", + "251:0": "minecraft:white_concrete", + "251:1": "minecraft:orange_concrete", + "251:2": "minecraft:magenta_concrete", + "251:3": "minecraft:light_blue_concrete", + "251:4": "minecraft:yellow_concrete", + "251:5": "minecraft:lime_concrete", + "251:6": "minecraft:pink_concrete", + "251:7": "minecraft:gray_concrete", + "251:8": "minecraft:light_gray_concrete", + "251:9": "minecraft:cyan_concrete", + "251:10": "minecraft:purple_concrete", + "251:11": "minecraft:blue_concrete", + "251:12": "minecraft:brown_concrete", + "251:13": "minecraft:green_concrete", + "251:14": "minecraft:red_concrete", + "251:15": "minecraft:black_concrete", + "252:0": "minecraft:white_concrete_powder", + "252:1": "minecraft:orange_concrete_powder", + "252:2": "minecraft:magenta_concrete_powder", + "252:3": "minecraft:light_blue_concrete_powder", + "252:4": "minecraft:yellow_concrete_powder", + "252:5": "minecraft:lime_concrete_powder", + "252:6": "minecraft:pink_concrete_powder", + "252:7": "minecraft:gray_concrete_powder", + "252:8": "minecraft:light_gray_concrete_powder", + "252:9": "minecraft:cyan_concrete_powder", + "252:10": "minecraft:purple_concrete_powder", + "252:11": "minecraft:blue_concrete_powder", + "252:12": "minecraft:brown_concrete_powder", + "252:13": "minecraft:green_concrete_powder", + "252:14": "minecraft:red_concrete_powder", + "252:15": "minecraft:black_concrete_powder", + "255:0": "minecraft:structure_block", + "256:0": "minecraft:iron_shovel", + "257:0": "minecraft:iron_pickaxe", + "258:0": "minecraft:iron_axe", + "259:0": "minecraft:flint_and_steel", + "260:0": "minecraft:apple", + "261:0": "minecraft:bow", + "262:0": "minecraft:arrow", + "263:0": "minecraft:coal", + "263:1": "minecraft:charcoal", + "264:0": "minecraft:diamond", + "265:0": "minecraft:iron_ingot", + "266:0": "minecraft:gold_ingot", + "267:0": "minecraft:iron_sword", + "268:0": "minecraft:wooden_sword", + "269:0": "minecraft:wooden_shovel", + "270:0": "minecraft:wooden_pickaxe", + "271:0": "minecraft:wooden_axe", + "272:0": "minecraft:stone_sword", + "273:0": "minecraft:stone_shovel", + "274:0": "minecraft:stone_pickaxe", + "275:0": "minecraft:stone_axe", + "276:0": "minecraft:diamond_sword", + "277:0": "minecraft:diamond_shovel", + "278:0": "minecraft:diamond_pickaxe", + "279:0": "minecraft:diamond_axe", + "280:0": "minecraft:stick", + "281:0": "minecraft:bowl", + "282:0": "minecraft:mushroom_stew", + "283:0": "minecraft:golden_sword", + "284:0": "minecraft:golden_shovel", + "285:0": "minecraft:golden_pickaxe", + "286:0": "minecraft:golden_axe", + "287:0": "minecraft:string", + "288:0": "minecraft:feather", + "289:0": "minecraft:gunpowder", + "290:0": "minecraft:wooden_hoe", + "291:0": "minecraft:stone_hoe", + "292:0": "minecraft:iron_hoe", + "293:0": "minecraft:diamond_hoe", + "294:0": "minecraft:golden_hoe", + "295:0": "minecraft:wheat_seeds", + "296:0": "minecraft:wheat", + "297:0": "minecraft:bread", + "298:0": "minecraft:leather_helmet", + "299:0": "minecraft:leather_chestplate", + "300:0": "minecraft:leather_leggings", + "301:0": "minecraft:leather_boots", + "302:0": "minecraft:chainmail_helmet", + "303:0": "minecraft:chainmail_chestplate", + "304:0": "minecraft:chainmail_leggings", + "305:0": "minecraft:chainmail_boots", + "306:0": "minecraft:iron_helmet", + "307:0": "minecraft:iron_chestplate", + "308:0": "minecraft:iron_leggings", + "309:0": "minecraft:iron_boots", + "310:0": "minecraft:diamond_helmet", + "311:0": "minecraft:diamond_chestplate", + "312:0": "minecraft:diamond_leggings", + "313:0": "minecraft:diamond_boots", + "314:0": "minecraft:golden_helmet", + "315:0": "minecraft:golden_chestplate", + "316:0": "minecraft:golden_leggings", + "317:0": "minecraft:golden_boots", + "318:0": "minecraft:flint", + "319:0": "minecraft:porkchop", + "320:0": "minecraft:cooked_porkchop", + "321:0": "minecraft:painting", + "322:0": "minecraft:golden_apple", + "322:1": "minecraft:enchanted_golden_apple", + "323:0": "minecraft:sign", + "324:0": "minecraft:oak_door", + "325:0": "minecraft:bucket", + "326:0": "minecraft:water_bucket", + "327:0": "minecraft:lava_bucket", + "328:0": "minecraft:minecart", + "329:0": "minecraft:saddle", + "330:0": "minecraft:iron_door", + "331:0": "minecraft:redstone", + "332:0": "minecraft:snowball", + "333:0": "minecraft:oak_boat", + "334:0": "minecraft:leather", + "335:0": "minecraft:milk_bucket", + "336:0": "minecraft:brick", + "337:0": "minecraft:clay_ball", + "338:0": "minecraft:sugar_cane", + "339:0": "minecraft:paper", + "340:0": "minecraft:book", + "341:0": "minecraft:slime_ball", + "342:0": "minecraft:chest_minecart", + "343:0": "minecraft:furnace_minecart", + "344:0": "minecraft:egg", + "345:0": "minecraft:compass", + "346:0": "minecraft:fishing_rod", + "347:0": "minecraft:clock", + "348:0": "minecraft:glowstone_dust", + "349:0": "minecraft:cod", + "349:1": "minecraft:salmon", + "349:2": "minecraft:clownfish", + "349:3": "minecraft:pufferfish", + "350:0": "minecraft:cooked_cod", + "350:1": "minecraft:cooked_salmon", + "351:0": "minecraft:ink_sac", + "351:1": "minecraft:rose_red", + "351:2": "minecraft:cactus_green", + "351:3": "minecraft:cocoa_beans", + "351:4": "minecraft:lapis_lazuli", + "351:5": "minecraft:purple_dye", + "351:6": "minecraft:cyan_dye", + "351:7": "minecraft:light_gray_dye", + "351:8": "minecraft:gray_dye", + "351:9": "minecraft:pink_dye", + "351:10": "minecraft:lime_dye", + "351:11": "minecraft:dandelion_yellow", + "351:12": "minecraft:light_blue_dye", + "351:13": "minecraft:magenta_dye", + "351:14": "minecraft:orange_dye", + "351:15": "minecraft:bone_meal", + "352:0": "minecraft:bone", + "353:0": "minecraft:sugar", + "354:0": "minecraft:cake", + "355:0": "minecraft:white_bed", + "355:1": "minecraft:orange_bed", + "355:2": "minecraft:magenta_bed", + "355:3": "minecraft:light_blue_bed", + "355:4": "minecraft:yellow_bed", + "355:5": "minecraft:lime_bed", + "355:6": "minecraft:pink_bed", + "355:7": "minecraft:gray_bed", + "355:8": "minecraft:light_gray_bed", + "355:9": "minecraft:cyan_bed", + "355:10": "minecraft:purple_bed", + "355:11": "minecraft:blue_bed", + "355:12": "minecraft:brown_bed", + "355:13": "minecraft:green_bed", + "355:14": "minecraft:red_bed", + "355:15": "minecraft:black_bed", + "356:0": "minecraft:repeater", + "357:0": "minecraft:cookie", + "358:0": "minecraft:filled_map", + "359:0": "minecraft:shears", + "360:0": "minecraft:melon", + "361:0": "minecraft:pumpkin_seeds", + "362:0": "minecraft:melon_seeds", + "363:0": "minecraft:beef", + "364:0": "minecraft:cooked_beef", + "365:0": "minecraft:chicken", + "366:0": "minecraft:cooked_chicken", + "367:0": "minecraft:rotten_flesh", + "368:0": "minecraft:ender_pearl", + "369:0": "minecraft:blaze_rod", + "370:0": "minecraft:ghast_tear", + "371:0": "minecraft:gold_nugget", + "372:0": "minecraft:nether_wart", + "373:0": "minecraft:potion", + "374:0": "minecraft:glass_bottle", + "375:0": "minecraft:spider_eye", + "376:0": "minecraft:fermented_spider_eye", + "377:0": "minecraft:blaze_powder", + "378:0": "minecraft:magma_cream", + "379:0": "minecraft:brewing_stand", + "380:0": "minecraft:cauldron", + "381:0": "minecraft:ender_eye", + "382:0": "minecraft:speckled_melon", + "383:0": "minecraft:spawn_egg", + "384:0": "minecraft:experience_bottle", + "385:0": "minecraft:fire_charge", + "386:0": "minecraft:writable_book", + "387:0": "minecraft:written_book", + "388:0": "minecraft:emerald", + "389:0": "minecraft:item_frame", + "390:0": "minecraft:flower_pot", + "391:0": "minecraft:carrot", + "392:0": "minecraft:potato", + "393:0": "minecraft:baked_potato", + "394:0": "minecraft:poisonous_potato", + "395:0": "minecraft:map", + "396:0": "minecraft:golden_carrot", + "397:0": "minecraft:skeleton_skull", + "397:1": "minecraft:wither_skeleton_skull", + "397:2": "minecraft:zombie_head", + "397:3": "minecraft:player_head", + "397:4": "minecraft:creeper_head", + "397:5": "minecraft:dragon_head", + "398:0": "minecraft:carrot_on_a_stick", + "399:0": "minecraft:nether_star", + "400:0": "minecraft:pumpkin_pie", + "401:0": "minecraft:firework_rocket", + "402:0": "minecraft:firework_star", + "403:0": "minecraft:enchanted_book", + "404:0": "minecraft:comparator", + "405:0": "minecraft:nether_brick", + "406:0": "minecraft:quartz", + "407:0": "minecraft:tnt_minecart", + "408:0": "minecraft:hopper_minecart", + "409:0": "minecraft:prismarine_shard", + "410:0": "minecraft:prismarine_crystals", + "411:0": "minecraft:rabbit", + "412:0": "minecraft:cooked_rabbit", + "413:0": "minecraft:rabbit_stew", + "414:0": "minecraft:rabbit_foot", + "415:0": "minecraft:rabbit_hide", + "416:0": "minecraft:armor_stand", + "417:0": "minecraft:iron_horse_armor", + "418:0": "minecraft:golden_horse_armor", + "419:0": "minecraft:diamond_horse_armor", + "420:0": "minecraft:lead", + "421:0": "minecraft:name_tag", + "422:0": "minecraft:command_block_minecart", + "423:0": "minecraft:mutton", + "424:0": "minecraft:cooked_mutton", + "425:0": "minecraft:black_banner", + "425:1": "minecraft:red_banner", + "425:2": "minecraft:green_banner", + "425:3": "minecraft:brown_banner", + "425:4": "minecraft:blue_banner", + "425:5": "minecraft:purple_banner", + "425:6": "minecraft:cyan_banner", + "425:7": "minecraft:light_gray_banner", + "425:8": "minecraft:gray_banner", + "425:9": "minecraft:pink_banner", + "425:10": "minecraft:lime_banner", + "425:11": "minecraft:yellow_banner", + "425:12": "minecraft:light_blue_banner", + "425:13": "minecraft:magenta_banner", + "425:14": "minecraft:orange_banner", + "425:15": "minecraft:white_banner", + "426:0": "minecraft:end_crystal", + "427:0": "minecraft:spruce_door", + "428:0": "minecraft:birch_door", + "429:0": "minecraft:jungle_door", + "430:0": "minecraft:acacia_door", + "431:0": "minecraft:dark_oak_door", + "432:0": "minecraft:chorus_fruit", + "433:0": "minecraft:chorus_fruit_popped", + "434:0": "minecraft:beetroot", + "435:0": "minecraft:beetroot_seeds", + "436:0": "minecraft:beetroot_soup", + "437:0": "minecraft:dragon_breath", + "438:0": "minecraft:splash_potion", + "439:0": "minecraft:spectral_arrow", + "440:0": "minecraft:tipped_arrow", + "441:0": "minecraft:lingering_potion", + "442:0": "minecraft:shield", + "443:0": "minecraft:elytra", + "444:0": "minecraft:spruce_boat", + "445:0": "minecraft:birch_boat", + "446:0": "minecraft:jungle_boat", + "447:0": "minecraft:acacia_boat", + "448:0": "minecraft:dark_oak_boat", + "449:0": "minecraft:totem_of_undying", + "450:0": "minecraft:shulker_shell", + "452:0": "minecraft:iron_nugget", + "453:0": "minecraft:knowledge_book", + "2256:0": "minecraft:music_disc_13", + "2257:0": "minecraft:music_disc_cat", + "2258:0": "minecraft:music_disc_blocks", + "2259:0": "minecraft:music_disc_chirp", + "2260:0": "minecraft:music_disc_far", + "2261:0": "minecraft:music_disc_mall", + "2262:0": "minecraft:music_disc_mellohi", + "2263:0": "minecraft:music_disc_stal", + "2264:0": "minecraft:music_disc_strad", + "2265:0": "minecraft:music_disc_ward", + "2266:0": "minecraft:music_disc_11", + "2267:0": "minecraft:music_disc_wait" + } +} \ No newline at end of file From 4938f419ad73257136c3d4a0b895147f2589545a Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 17 Jul 2018 17:31:07 +1000 Subject: [PATCH 43/74] Almost finished the state system. Just got to have it actually load in the values. --- .../worldedit/bukkit/BukkitBlockRegistry.java | 20 +++++++++ .../bukkit/adapter/BukkitImplAdapter.java | 20 +++++++++ .../adapter/impl/CraftBukkit_v1_6_R3.class | Bin 16230 -> 0 bytes .../adapter/impl/CraftBukkit_v1_7_R2.class | Bin 15174 -> 0 bytes .../adapter/impl/CraftBukkit_v1_7_R3.class | Bin 15174 -> 0 bytes .../adapter/impl/CraftBukkit_v1_7_R4.class | Bin 15184 -> 0 bytes .../bukkit/adapter/impl/Spigot_v1_10_R1.class | Bin 14963 -> 0 bytes .../bukkit/adapter/impl/Spigot_v1_11_R1.class | Bin 15331 -> 0 bytes .../bukkit/adapter/impl/Spigot_v1_12_R1.class | Bin 15350 -> 0 bytes .../bukkit/adapter/impl/Spigot_v1_12_R2.class | Bin 15357 -> 0 bytes .../bukkit/adapter/impl/Spigot_v1_13_R1.class | Bin 0 -> 18415 bytes .../bukkit/adapter/impl/Spigot_v1_8_R1.class | Bin 14837 -> 0 bytes .../bukkit/adapter/impl/Spigot_v1_8_R2.class | Bin 14811 -> 0 bytes .../bukkit/adapter/impl/Spigot_v1_8_R3.class | Bin 14811 -> 0 bytes .../bukkit/adapter/impl/Spigot_v1_9_R1.class | Bin 14795 -> 0 bytes .../bukkit/adapter/impl/Spigot_v1_9_R2.class | Bin 14892 -> 0 bytes .../extension/factory/DefaultBlockParser.java | 17 ++++---- .../transform/BlockTransformExtent.java | 25 +++++------- .../registry/state/BooleanProperty.java | 38 ++++++++++++++++++ .../registry/state/DirectionalProperty.java | 8 ++-- ...ionalStateValue.java => EnumProperty.java} | 19 ++++++--- .../registry/state/IntegerProperty.java | 38 ++++++++++++++++++ .../world/registry/BlockRegistry.java | 27 ++++++------- .../world/registry/BundledBlockData.java | 29 +------------ .../world/registry/BundledBlockRegistry.java | 21 +++++----- 25 files changed, 179 insertions(+), 83 deletions(-) delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/CraftBukkit_v1_6_R3.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/CraftBukkit_v1_7_R2.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/CraftBukkit_v1_7_R3.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/CraftBukkit_v1_7_R4.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_10_R1.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_11_R1.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_12_R1.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_12_R2.class create mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_8_R1.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_8_R2.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_8_R3.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_9_R1.class delete mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_9_R2.class create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/BooleanProperty.java rename worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/{value/DirectionalStateValue.java => EnumProperty.java} (71%) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/IntegerProperty.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java index 9fa65db93..0b880cb18 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java @@ -20,12 +20,15 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.blocks.BlockMaterial; +import com.sk89q.worldedit.registry.state.Property; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.registry.BundledBlockRegistry; import com.sk89q.worldedit.world.registry.PassthroughBlockMaterial; import org.bukkit.Material; import java.util.EnumMap; +import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -41,6 +44,23 @@ public class BukkitBlockRegistry extends BundledBlockRegistry { material -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(id), material)); } + @Override + public List getPropertyValues(BlockType blockType, Property property) { + if (WorldEditPlugin.getInstance().getBukkitImplAdapter() != null) { + return WorldEditPlugin.getInstance().getBukkitImplAdapter().getPropertyValues(blockType, property); + } + return super.getPropertyValues(blockType, property); + } + + @Nullable + @Override + public Map getProperties(BlockType blockType) { + if (WorldEditPlugin.getInstance().getBukkitImplAdapter() != null) { + return WorldEditPlugin.getInstance().getBukkitImplAdapter().getProperties(blockType); + } + return super.getProperties(blockType); + } + public static class BukkitBlockMaterial extends PassthroughBlockMaterial { private final Material material; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index a7952161d..942bbe625 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -20,12 +20,17 @@ package com.sk89q.worldedit.bukkit.adapter; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; +import com.sk89q.worldedit.world.block.BlockType; import org.bukkit.Location; import org.bukkit.block.Biome; import org.bukkit.entity.Entity; +import java.util.List; +import java.util.Map; + import javax.annotation.Nullable; /** @@ -91,4 +96,19 @@ public interface BukkitImplAdapter { Entity createEntity(Location location, BaseEntity state); + /** + * Get a list of values for a property. + * + * @param property The property + * @return The list of values + */ + List getPropertyValues(BlockType blockType, Property property); + + /** + * Get a map of string -> properties + * + * @param blockType The block type + * @return The properties map + */ + Map getProperties(BlockType blockType); } diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/CraftBukkit_v1_6_R3.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/CraftBukkit_v1_6_R3.class deleted file mode 100644 index 4f3c4dab7eda442b26fb3ca6ecd8fea8e75c49fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16230 zcmbVT3w#vS^*-nBW@mRYycPm1L5%VW0gQkm21Fr%Mng~&!AKQ1$&#!jyO?Z(fEBCO z3RgNliX?W9+Qg2u$OtS+drxMsB|~_+=6QJ8AWMG36Dx{XuT8%I!6|y)G{LV}Sp}Z^(#m%GbC2 z{AWM^#m{g1`5iyM>*v4v`EP#yyPx0l^ZS1Oho3+2^M`)^r%40(UoyZ)a{Jief14B+ ze-!hcLqkf%>_`BVPPq#69V!Cx5sWq{iFE0fmnAw!X&I6&)^GHJc?7|Ls?oB&;- zd?syBhN1k13IymfWtw!k$~BY~pgC%QNmr_Yh8kq3!2#N+hM2TT1)+i(YN%lWm8XXL z)d+x0jWkrqP@_z`LA2Ve@(nfGP=^KRW;Mp7Th!r(DlpU$0otmLG-;a}Yp8LC8XutT zYJy2S)I>uS8fubBck+5e6&Y%>N%!!2znX$iHC1j$nRK_B2&k%JLmh2WKuyC;sOfT> z0jt$9uwNaUt7h^6Lmih(9cq@`jyF^ZoS;_42VO8fmO!3fWy6!)V$ZS=kt=O%&@Y^a!FyX>%l;h@j8n zNTMN*4$c@^9qc;v@Xd+FqKUaop2A5>nY^X(x(L&t@@Onl(b`lKX|4*_G@>L}9u3FR_Z>n0m zI#LEhCKi@WDvw1H#ZAzzRzwxIM4HuqRyFj8hfi6s3#x$TZ5w2aeIK0}?IS=ls zgLleeiFj4CF|sh0h$hxDRTuUyx?+A6dX>hTR>xaob+dbKoDn=*yy{7W>zStZ-ly9D za0@_@R<94kT>~=NCZ;=UOGSacOmqqPpHvkSb1`AID`lpR@57mP%h{7$P_9fg1N?%> zh%+POdso7dfq*!(6+N0FOQS7OU~^t97EgpVnwawS2p1KH(}l$qt&NR>VGI?l)v;nr z5~PXl=N5iltKKzPCYXmYy+Sjsu8Lxi;Md1s%F)5YG_H3^_Hax?Tu8R1Go96kZ z_kkRhWqS2k_V+ZL`WnmW-uoEc6q2#bRP4)aj4UjVH`k}gWHFcx4AeM#5+d8*9&lCmm_ zhg%}E4Hbq(V!16nzniYv1L%gL7sxkDSz&2`KG4`BCrh7}Vi_?-m3|cIF5SGCmIUW$ zuGO$(n(Q`PS2#qU;$Y43DU9+(U}3N;uft^64fVi1yHB)3SmtPBnI`nt29=2Dm9++m zrlD$)R~ib~@wYgO2-Ar@d#Qf|oHOYhrh#CU=*qS8Vs+)w`i2BdLZMOHfMqy>u>vtT zu}zj;rqM337hpv$POTcKosBdWtX3*)bCo(;Nzp2)KM&@j&2vT4s%gvumXJ=WG22ek3$O=tIh4kp& zSXg2%rv=Q8&x!q%3DdRPDs`H`RMa~eY1GmSJWl6W>6MJ5z+fU?p^?Efrw=j!6>2JQhpvW?zy?@b8E=k6>thlZy{E6l*i>OX05gnejnm;O=)Aer3HFS=+<>kPuhsH+^Eu>=S=RoDGnX5 zZ^QY5p)N2K7AtcllB`rb^oY*Ps+FFfzRlNR19pHDn}N?9M67&TWwBVKS!*a*bl{Z2 z;yB$3<}kc6vbzD9>2aely-`886I|{B*lclb#PkX|y?I^^k5tB6n`>`)>&%3x){l7Um|33u;STdif{laWVljKj-kG3sY^IwsSWB< zi(aGG4fQQUU1q7v)fHIDE%j}6rKP^3t~AtD_@w_>Y9oD#Rmf7CP{T{5=4wk_qrPjg z$vDfn)>7B0?;)wO=qq~9QrD}^mbyXRXsDYkb+cMys2WS%qHaZS^~ZU7VX)K|$X8qC zwoOLLQ@6qX3}Q1Yv`%1Lc@~lqOMPEDZdW@nnd){+?NoPQL9x`G>MmqeeR&a%OJxxj zeN6whu(v%G%YJ5b9WSXiXl|*y)jcvGM%|_EwbT#PeN1F=6U!RXj{%YCi>~)u>H+nj zMgO1=EcK9j*i!B45lih>KV+KLhxZVX*j?NEe#9G|#qbV`4q_77%Q;NrGbUsl==2lp zINhMgqvFH3MPJC=CoR>c{FaP+$gLb_iPParK17ianOvr=GOb zPvrJfxjm(xw$y&PJ)@pA)bp15x%!2rUQoZZ)UVWwAm^%iC$Cr-lWbC+=C76XBOs5J z4e@3$hi(8*IStC=F(6zwSkxE~qu7+j3*xQ%7-e8e$clN*&0%nquC>)nNzgQHNyF4^ zA{UXb7$wzh(7f2%0vym_H&k1ogUUFo;jIT*Yyf}9JU4*^Yzu9nt zulsE1Vn^KjBJLmkLrW?EyQ9S}cP8(U2z;V{)TtSxI}T6?QA|f>=BNxQZ+*CNUUNNS zIhIK07fd5EjchIEw?=WYiZkOe3*xbfiGo$J_?m(ST$s$J@Ty3Gy#p<<)CcNAOZ^i} ziTK7MKQKc8ddk$lWJ&n7`p8lrtAAVSpu&3kiTcz~pJh#QI;pYL=jt(O2XYN|Lx=Xw zLG^{DzO+}iucV>4%0qbau;Edb#{;fKiC0Q;43E#k>xieN#4jZQ!(&>WT+!;F$CBa! z@-z_oc?QYTV8b)S@&r9YrEZv%zz~TC6$ZWvff`|K5<|-Pdi@@^0DbCJVy?MZ35G>?9{_sRekzG*bJ|ybVozT=L;97NJw;inr=%a*E3BQ9O>fOwIk_Icy!T@o-5N8;IQTuf@1r3Q zZE5P|lQ@NI`idVr%H-u4HosY~I_9snG0H2mDIjxHo&(p45qK+zllEd4a(dce+9Y9b zUgZoIFsYGa?5ennYvyO24m!MIpQ`uaC~4$u@qJn@?3vV;cU_%qWkiCb5EGQ?eJa!4 zv%99t}*{ z(|6mJfD9?4!WD8Bo0c{PrexOL?t5a4J-i2k&<^on6fF5YRQK+i^pPo?YCwjqpx;(d z^z+$o4)CD;gl4|h)phzD+t96KIwtlt1$H#UfN4Ex*o(;`eL|*wP5K3WG=_yV7RFn7 zz%&t#C4kjX#gY}JOHQv|v9O}5tg3nij9am&Y+?C=N&q*SUU-K?+ss0iT9Bcf(GYH_ zh+G6m0&TF}8`EF17sK>o;%kmH#oGYDydG>4y}g)P1Oa3%u)iP*q)fbukLobeTU0Kx zqw4f%qP77i%$S5sGUG2?uwcQWMU$2qo-s@_T}&2fL&jZ<%RZsNuO?cXBbBSeYhnwf zW}JRJGZJozzl9itjek-*j&$YFRK58K)5Opu5(^3FrD8A9XXT#{~b(bVi5dg zCkD1KreiUQE_d`q>}luVw-$~LSb1uZ#$*8?lWf5*4+df?>1js$7f2AXx)ma3xkWgb zajoRNWhp_YtIm~>8fqHxBIZDY3=;Gf&KG#8<(d$e>n|)2D_kJuI6c85Fe4wD9Mp0w zgE@uE^%pyV$@BR6M_+jL>WG|e^_9ZeS~xpUSb(=$b`eCi zMAzvE&Uy!y4sj1q-YvdU69-VrTDVkR6(O0+LX^xIs)4`ewUvUW>}nLD+Liw6HbMz_ zt%PJJB`cjXqIIAKCr!>^JuLzn1m40)f{77suR2p;qa>Tj?9(I&cbz$=PM&h>^qF5T zBWkQ=Zz%L}66Cp#$WzCNE9E$`7ik)Le~I zN|H*FXAgNFrJSH|4;e}FFDnWLf@YF(A0?}(gDh{71{4Jc1_yZ`qrugl-87^!Nx?^H zC@P1da@Zq~r|3=Gk0d|t=aQGIpvMZzry80-wR9A%q*AJ<)2M;oLJP~*f&NT?!MC?@ z`5@sPdY4T4EBy_%qH6`pMAxCCw$b2GLk80w6xdC9qo%iWJBmGe$btAIx{z|InTAlp zC4MOVo!&#;`?@U;fo!~@aAePgY=sKnWcXls#sX89ZlD~xRErvJx1tZ}pJ*+5{);|> z3{zgRbeB~$IY}eB%i0K8o3dny1Y4F!61u8Gfop-VW_;(=`Ks0mfu}g2V^~(CCj!}Y_*-n>|=ql=yg0k#nv2%8vOts z+)jJkB__u~9GbEpKYkW_@jkG-nEX9-Sa**-)w39ReW=A)JirlChfl#|5RMYX1QDA=zeEK73K9Auji3W*1%mL3Js3o# zRS7vJI$<;dBj@pOdt^Qt;!FsP!`360!Tn?R(YVF<96uMg2{XO8Pn;?9Qdr{aqDj>u z-(D(0`h$3%(RV~7u7;DEtn4IXFkcxEi~7J@>g(O-nSd3zQG0QE<>f0m}583dJ1c$vg!p7)ozxWO$*`YZ@6j(CcN5 z3?H<6Q6s~Ej(d12dibH~Za#{Ofi#JvBPr()-AiT)4-7#qijoim7|(^+#fNtl~Mh!e4QAn{i;$Kc}(o@Foyn@e~$+JnCNTIeF4-}yDX zS4;)AOT4i3GgAocOsdCq$x9|i%RfU9|&cd}6mr&T*xT=$MPRJX|*-gun^o?a9aMQVN z_bo!ML73JYo(lIBQxLN@5|cHaj{&_MOGm>A$MSKsfM-!1%w5GL6obL7JeRKJlV}Ui zqa9qT-TMugUq=SdfwKaD$u#X~gO0}E^9W#M+IOa1zB3KVoqPhM2{m1(p(xa}kxztl zF93KkM)(xdCC;Bp-a}x(H2KU2)(kGyQ-PmfEiibYBoc>zM!wH5YuU>`ekovMP&1tbB8;%vYr*tras81!vi2Cl1cNzQmRF5%#7 zaS0Z#$CZogMqIVHZV8^(9$e8LJik2{ZV%S92W#7db?w1OdvIlYu)aOm&>oDo2QO$3 zuF9+pbAd+UGbq88_=~5rXdN#DH&oN5yqqrQbLmQ60f&X@8m@&4Bea?8=_ZcSt-Ol1 zag&}LJ5$}xr-0|}R5C~dKc|Fp|05;8wz0iL^I*4lV1OhxjeDqRawo;QWfQz!3%8TY z0qMCNz^8FJ#E7`Xwm9`R+$N!V?UZMLw)QDcQt=jA(M54AkgF@EfV`7*p)kN+!k$gS z!$JLYc>?MsOa%Fcv<)G_Zz=Ill?BxZ`JvffN_c45u0zjv(TwV;ozyBrv~8ha7p(8ZnfO)0%Zmu`^KOFHP%PWqOVUZzVgm(t5R=!#DIwv^7% zrB_PnoDTXDc#sXS9j7iQX1GolZ#M(U)ky1j#L@1&hl zddC*Z?V>v&^RD(Ty1TlI?!oh};Jr!u0XRlBN_a}reVugw6PTTkb+&yi;Qc11`)0%( z@m1vIjmV>~M&5P}2=%)(hOeU%{vOTa>#3YKBaOI$&gUB`$~Vz!zL_@gEdb)J0Nxh5 zjknVMybTM*ZS*96pPuFISWwG)C&pYX3zLUP>yXY&vn{)Xd9?kdiSo|sBbiR*| z=ll5-et?(ogZQ1tL->8{!}ulFBWZ@2N29p{3}a9^4MD4Ngk1@!{&WP04`f}%XCh2I zNNP^wDg=ucjlZSjOw(Eb09<5XB-XoeMJQZ zFE{ubpqkHU)~Co0^uHwrpF0Lm12yK)gA`d1z*m|SmOE3tShk^vrU&-XgB8IYCCDgp z@`Sb@x`T?5`|PEM71(`XiLZ!dC5Qp+A!9GKD_SOqS0&yna(LIF7X&yV?-YRy6tgF; zNce{Lk)MA`!}uxC_|y0+)BQA!pTWdEOQrlAor<#4`RCf1XF|1U6yg;y-Uk;BrVsgi zxHTVyFDxM}w>;%8S`H_L0Tw@1!of8#a2TD86Ve*EX(VLVfp@%V7uu~>qLp1&@3?R@ zsY4jRr?Z6ygQNQY1(=1;=or0!Hqr7O@Ydao&4B!b&!!L0Z0HD{Y7bSdb*SLOY!C{w4jRu zi0Nm<@XcatlAg7*g$!?wad;C}mH4Jgk}SDJlAhaj=yh$~EqdUawfI|-^n8+j)=58? z5w_`?t-5Agl75k-7dq*eQnN!d&URs(9ZC9CC%q`8cW$A>r8We9q<9kd3@f z_54Th&!50QZ(t#OlQ!{Nw3Yvig!wPj!EaL+ze6wZyYw6WE4|BqqYwD+bco->j{AM= zOaH;c_yeBFAL69^pS+O&#V7MeT)`jXP4&OIfe-R}{ty1J{1d(&e|>x_e-0-4g4_8^ z-i>wfErf?;Jae%Lc=vRA*R-7Y8r=g oicl!;T!Syd`3XxJqwvQ`7veLBuk^xowfo^(JrN zjRtSZ!WYWrB9kxXt#Y}<Dw)r#|`cp( zs%)c>d4S#6xM+X1aq$d8@ zq$q!4@b3)%y-8>AA54n#rv`r};{Va47JkIwKN7k(%^p@{4bNv7p~6Ze;fQCgTFFqGw(NP3x93!HwJ%e(#8CpNn81Vp~z5d(q&4S zbh*kgl*dqBldj~jp?roiOuB}{xhfZ*Do-w^Nmr{Jlk&h8Z&3M$vhbk#K&z^+T>6=+ zzd8u=s{&|34aipq^D~Aj%%{85A#yp?P(@IO@|%3N8YtR%AKFlZL@ysg59%;e4OT-$ zEuTOQYN)A(so|oPPoW4k!c>Q=kx+peCCY#v^0csOwD55R#8kzm8ly@?>aQWC8f&U? zYP<-2K!lti;zH7ZtUnPBqK-7wq+B)GP)8Z+XeM7I*4P+|GYza<6I>q*v?RijfV739 zje$ztSH?6TT9>E{Hz$?^8|7nOI237M^4n7)K@5$DRz*VfiGc3Hi~`J<9S;Q)A602W3FCJ@JvT0qY z0)iY-Trs9H8cGD3z+JtN3N(k}>p|S170^>a(UZUwCaz#AggP3ajf!X@wj>-0&5b6) ziA_wk#od#tE?9hdU01%|v>p@W0f+-Qx zleMJ6Ku;pNi2P5iiir6zkgZCw%(NbqX^$)$AQzHt>P#o~p!iN8>wY1JWihW_%YIJ7si(D^ z>D{lN4qo}wt7H>=ik19kmM4U+37|&bCYrpVltZQ^?0Tp%%Mk>2b%?qeQFZH`n6TTbvl?D zYAPfYP1vgq>co5Yf_k9viQt>XyhLen1)#Ibm@IRe1HwTnROX^dPwAx9G$klY$65_T zrm=1{=nf~)r(&><@hQymMnqvmTRs!Uu?OmfyH=-g2hDi3uuP+SD}zde^v*gBxuc;< zkt!MrbaI=WO@!&VuC>&=1x^`r3R7Q1neeJjv!V@^;l|Yoh=fL?el@n?5OA9pg%a1x zw##&wi|iWg$br-@g5EM@rWl=$o=mf|SPSW37)ZIIi;@l&dS`XUh!vf2vdO!Eo=pUr z*LJeUGEH_5?aG4AbZyA=0=Z4~_B~QzLrq6c%VfFZDbvYWlB5CDOBu3U)nOsMx+fYG zAM`dO(&O`pUebilS+t+NHdMW(8Wc9>sTTc}KCsxMR#~c1tu|EHQfpMT zp{7}Ct%|_CdZRoYoGsM^`YI}y7%uEn>mYvyIGJ5iClRh(2Z@2D&X9?5)eK`QsIo<^ zM^Lxa28BFjY)@K*;!-=gMW4{`EIx*jwGGUyuH7g#2E#42Nu6oYyY!x{ilxs|XIttV z^#cpp!*V!$FP239E!>`KsUNEIEc!M5#!~02A6e=Gwb@cz)P+n(_MktwD$cz2=^KuS zdlCI2i+&F?(wFp4rcoIoGAeZD33{AqVB})a;yjD~EY{y@sY`f~r7l&MVPCY=hTy9i18R}+B-KuW0)a~jH zOWmpNLa@wKNsbRTuZF8z>Tb0iJAkF`QTJjqu+)9(e$mqdz4NH@O_E0(l95`QPFl6u zR@e}EkZD{mOeE80#p6MQ!9iV6)LokF-RdFX@nJx|7i8zeT6FEDs1r@QT@%~^^?~3c zIC=Df;JipIi1>SGCwjVBliLX!fZU^q-<`$)g?hwes;+mQf(edFI{Qbe$I-|xSuttx z30#SiR|Yldtiw=kmTFhKkyy_QB1Sh1OT>oN$D%0wB!*?SUQ0c$I=*jGXA?=0)*F&$ zOgd!gCwd2%%2*VseP_T(t0TvgLhPyD8KP!&EZ&77bhD5{G<{mg?dcs*YzM>M)yZgf zyXNm1aoN|@RlSQjbE7!YbcO&LL5gWa#zqy$8XJR=S@FgeNtV)EGccAJWOGs85=LPV zCC?#qV$mZK!`4P)8-}gMKaANFTpJo@AE1U=>Zj^iOFajE;o8_A`(}J!n@l|~f%G1= z*HSO27Y+3@OTDCiZmE6hWlOyxLE+UbW2f^1OTDJ9ka37k1)Vgdb+k`mfBz*sA7dVp z%j<^vm8IU05VcReX{fg>^|nN*ed--Uy=$rWgp+-0mt5W#c0Q21UmFS``a|`kJbYxR z-&*Qpm=h24vcjUB%UbFa^*c-bUi~4(wceCnsvPuR6johTGmNP$BS|K3J4f1uE8(vTDtdo+|>9Qb$)C$zCf{7U5-Y3%tBqI6EJZFwL*f%l? zs|nS&#IZ-alr=2Vn{v7O`cQMTYlxJDbS4Ll6}tq@~ic6`rxdA zwx42TQHI6rcM^8t!hS!&G{JoeaV9$pcl|!&AeYT-P}u}i`YQxGt|94zxTiiS=cdu_ z^_+vCTTrLTmUK?2J`#+F8l0CVOYs>=dGRSy z#I&Q7re&uVo+Y)5<|1=})>FKsUdYVsf|=#tI}W-0 z=;}med%b;HlfohFUMIEFB{5g0MIgPPcVPxx%r{jn6Jyqb#V^hGD*zbq%_RTGCs&g!mCX8O?TlNOWXZLUf}8p*}j(zajks zIUL0%8V%yDF@T*2MiW4{zk1<{*$Wrdu9#cBq+&_!3dp}=Ud7zXIW>TKIKAl}0&X*# zSZXr{bH?gmb9HDVbPasMSe~eU$leIk8;LI-YKpA~WDC2HN%;1_)^Hopnqxn}Z=?;B zefX#iZqS{``(%4w6i(EyMimxz$|N$m#dGG&nKy6DQbT>pG{qJ4LhF%I2k>v7-SJkx zB_66-7u*n?D?KCi?cz|dITi)ctS8^>lWLYMtYVt#-cbJsf>2dnu)!&PGp+0)fH}th z|1Kt$=m!PaNr6p_>1Y_yrH-!lfV6V(T>ys%Y*O{ucC!Fb6OzJs4pv|)?aGwBb25-v z*8&n#-6R~axVG=^Qj-E_YN{@(BaWxIT!X22%yJzvm+MEyQOi?2M|v2j@e~6ixW)eH z!9Z+~-s0stcG$T}cFF})BlsK3W-YF+sGgtx(#ZD*iC&Q8>9TpoW727#&?$4t=A=%p zmh>@Qi!#!!8awlJIij53>@P?Zk69pcED(|4J@8&nag98v;0pLoaNW9)96@_Z+iZ56 zqa{SaYZp{iAqigUt_{FyFjN|bQ&cdM^n?% zLTCVL7@)GzLr`(=ZD|5}38}hZQCH4wS7-7f=;%^BU0KN%&#A$f%~FeTCK>C+SPLaX zg-^O9m7E^aec|Z(*jiWDW`=hd774#62=}3B!o+YNAQ4STzn+AN1 zvp|af`V&=pd=5ZAUQLjqU*hRXGVn}PS<*&aQj#Q>_W0ubqq}$r}fTwG5l51j-) zR?;AU3#PdCP0guL`VeSm&b%HPi985ph5<{Jwk56Q4->ejQ#OXp|`huEX&L;47#g^}OV z$DmFuo@5!Q@ zQJU~7g5qsKXIi4PL7izm0$Mw>XxY*VkG9g7{zdrG23EvTG$Xy^<-f*YrwWdnHizu|xsDk>|r#O{^S)EF+ddy@&6ikyZE{ zH3OH?Q#`mHF-7!VTfRC|EZ8Wab7?-5+g9|-{-Xu*Z&GqN*rQsbE zsBNQ(rFs5be_lHs={HLJd2KXl4^2+eQGP?%w-q&o`r!U`u>S_`-bC1Vi;55mh9D4( zL?|eOPglUJs{xB;@TSw@pAmSbgppNXeHj&Mz~qS#X`y4B%Xtv757n{B`M^s7oyHav zkpt?>xDW0;SmQ+Qi#sn?I)VFfe}J!yj^cy30AaF%M)Lr8a;`Sb5aI(^IM3jN4K6hJ z5N0;`P=kvM_G4}4fjr1os`6mAg|;uXQem#NW=ln%qqIIpPw{Ep8h*sk@rB+(U!iF7 z=ysZdk7II@G<8ZY?xsPBd3)&;*D%qu={NV%T&>m8JrpR-_vaUsb%=KJ`X_}^eTvHY3PZ-kD~me0rR`8sL~kiSf0;7bPsXww!I2m6u_ip}{8EqKvzJDtT*f=z?`@~! zJE)@8?Xae)2cr?7EAAUb@1VVWZY&Qn>`kXvk-oC`&5x&(`Z15O^ zOCZ}=9*6M~Lbiez(fqdWp}l%MkX`D5q$kK-J5`o?{ocKlKucAr&+pqy$CdbjPmN$> zCspsJg*byDhU}(AOs(XXyAzrA&||i5#G#c_Pi^BWWd1 zqDG#KpGq8sZ~q^IA1qA6&k;)LMxL%!dn!aV?7G%QCWZ=x;qqG@@8+^3EQwaVu zbU*p_!(#4@UCH+koQU)`ERWQTw~l=Qgm;X6h61g$yn{|hlwMIa76BwlE33!vCY0s` zkB<5$${o}%W)lzpuoPSTboh)#uQ%?FaUC(B#^2ZPXy-L#CeUtc})5>lwN=F0E%Iskx03(mGwYwn*#r zB&~0w4br+%w{DWwjY&GQjn0zRyjB`pf+lP{XYZ&&whB!Apx|79?}r_9UTwju4muz5 z|EP^Fkl~v(ku5@GbCND>ql={VV%@q`S}#u0C2e%6v|grLFPGNKlJw&?`iZn&(MtIp zbR}qBwWEWsuI->}aDQ#VbxFD&$dptYcS&k(qZ^)vWxmik$~iE)B+u8v^!QBzJZ=H` zxDts$6@0py2J<4C$|ursyqFen4b}1zI+aht&sLUFgqP7-d@_D+Q%hIyDRezAr|ox;w*-weQ9i9{ozNdr_*b_^?d%#AbT41=4S_RzLc>}TFWi5fTGP9yzD zS$5Mc3elx+sc)Q)L_qVcik4mAzqFK0~&zDdYU#f$I=^myFp zFnt%oy#$TBb<8f2+wF3D4}v_BlI;gx8z-K!s+9^mC?x)~DoOVy>Ap6)Upm%k#|lfw znj}5YMh{ABR1a^G)@YI*O47q^v_m@Ly5kJ#h$rchB<*aYN2Q}hcTAU#mLxrvq+Q5* zq+^p_V54+wN>Z|o+NAZoRzh-=2XAc`DbJIgYqz}_WuoC>PBerxrCz`VTQg*OeEWe9 zwM<*|lADF{mLzo~>4`RaQiyNW9T!W-)+9ZZq^H|xk91tFdAUqFE>F@kZS+%Vy|R@C z%h8%~-hQ?=2dDGraNvF(Al*^LS#jlsuHy=yE5DYcy$)7yr(#(2TEvy>5La4(#2XM- zZX`e71n<3(%6JW0>1@6O+tZ!+Dc)VM_1$zoZ%0hI2QlSd zdXw*?5BPriGe1E8;0Nhzeh7z)hj}>fKxXg=;>k{IXOChBdJMm^+Qo}FiI;S$QL->gTk|)9^ z>JTZe!&5oe!vlcYlt1y~@TZ^?W2D$%(`|6FnMqXO`<8~;+vk3ow4b=Bu&Ai0P=_11 tOGt;C5ja1h@ic>1;i%1x@Ee6%>*@F`z*<2xowrs^(JrN zjRtSZ!WYWrB9kxXt#Y}<$Anxlt}R$z_|tH|O&$e5+h;GifZ} zZqg{e!{j^pE`#qjDIkKq$lK*|kHPoKnET{%nY7$5cMr(u2j%V|X?r-AErWNMG=m?J z`8#vDPcHYBu196$V{+LgmxRIXCe7mx>Dw)r#|`c@shppX%ahXbl-xa($4~Q~eA>p( zs%)c>dEq`e6M+X1aq$d8@ zqzHdv@b3)%y-8>AA54nzrv`r};{Va4R({0bKN7k(%^p@{4bNv7p~6Ze;fQCgTFFqGw(NP3x93!HwJ%e(#8CpNn81Vp~z5d(q&4S zbh*kgl*dqBldj~jp?roiOuB}{xhfZ*Do-w^Nmr{Jlk&h8Z&3M$vhbk#K&z^+T>6=+ zzd8u=s{&|34aipq^D~Aj%%{85A#yp?Py?Y3+0U$+>EZp^h@t(M-O^XhTCN#x$s6ZE$@s&>9an2Ba+< zX$Vy4zEY+Ek=l4gxFxFrxr7=EOq5cnEVU zL-93HOmNo7m|*u|hHpkV5{}Pg$|)MVjL9=6S|4KSR}qecs#=?BL$Rg7+D5b#R7C57 zjmv_uusl1Bp7@$@3)8U`bL2 z49tlISI5hA$IA6bt~_Stk}2T9oVT$q)Eo~-BQ1uSYN%tdTtg^c))=i@H$N6_TDqw@ zR1QIoC@LRY5edZuP2jFhNCjF#vGpMC&0OHJH5GS(rw3Psv`6=^z)9ZR$)X^`Q7HkafS1!?KuHuVp`{;MCJv z&h+lr$YMy=GLyb8))-h+5sft@gGVJI86r+&=~#GjZj#dbrP;--V4`MQ!>hyS~9?YRfl?7V_jD4!(!Mb&o!Dbyy z4K)oCiYDyU250e}xu6~>d?NT}FfUPBTmk6pGA7HMmVj`O43)WP(o?dunxX_{=~$~_ z$TZHa2HoKV`eY2&F+Pb|-iRoSXv=59IQBrjaM$V-?w}d37M5vDZ)H&NkltCRBX=}Z z2~tHvflh9VvxzVr*R_^;%@bCF$(9XXKPMbKM{%oL+j(UWOT25TW53fS=p>RXwgwQ7RAL8nt6K#}4QX&VC4NeMO8`jb_vFHY83pE@PGCdF+z=@CZG`72s8Dt*V~(#Cdt&_C4|$I)Vn;wc6E)={y{Fa%xMg^ zv|!OOSyN~HH$}Nq7Cm{!xUPrdB#+~hp=KMZ41s(#avm3M(_2K!3_VM#!3xX@uQ^Ncc44rvy>M!&Gs95vTc^VEDpEwI$_s@$TN=;wg0 zEBtm9Q#DmPv>0lkrA|;4ma0@$h-JM*D}qEL@MEb(YOzK8=w(BlXsIQt8VO`iB*bRe zb?ktq_o#mQ+^Nrm+Gd7YYN?aB+EUBZa*JM}R}FQtp=vBHqxZ0zTIv+F!cwQI6^1$u zpY#VyolbwjPGG5(=;1QyS!Jo9sA&_v(%Eba1v*6X>gmT%x$JPc=jSG;q?pq)sASxegKoOPwJTW2yzlR8VEB zT92S^sSOHw%DA4i2*o9La*IBp-&uSNBWoL!UR}FUatwxBYLhzCqIc;%Srtp4rOvk0 zIqC-%vWFFL_+BiD{9Cv^*HS-J=UMb?`i-T|S3k1U1!}XUwx|o4j_g5ya8;an?bA0L z5%(hcMHc-YW~49apG>3ELZnsb%oFrD)4<5ZqQ&_Z{aLKP)l!%6VoP1BF2lZPsms-m zE%g(11;St&V73!l>PmH$MSrJ%Sn6tZjis)Y%XM0EK$QW2&}yo`MOEO0xYU+2d$rm#mnu z_yn#%$t#VTRMugrc1v}r-AJtG2N9#|hsUGC>!J}9e&WN^Td$=aSDoKCsk4bBN$U+s zGbSCf^b@@UOhq(;)IJ+9((1_Zq!4?mcZR556ODCY2;D5?5KW&Ja(j9Q6x+eDcV!vP zZrA)hBQE=zx~g|EXI=zHnrsN55u}(#rfpP?tg#{3I6KzRD#=o6YX-*BgKRF!TEi#| zqU1SrZZvX4eE7OZbi?p9_=ho@g6l%V?E}l2y=u62~qphn}&MJQg2I?+Na(z)Vr2?PdM49cFE;^Vdn$6`?aAEqCZqm%EL#7 z`mLothB@&tKO-#KxvZr=QNOd)@6{iYT4J zSaqnbHHJOfrL5uU-lWUb)rDGGTtlQJq%%2atjJwx)s4uN`^$h}BpL~$kYA;b(+6h^ zwEYw#2c}ufd?#TSF6{RcOcULw5NEQpaM$lM4szMd29-@PslP(7;~J7WhKcQwP`&fgWP*EcCa)RqMUpR4T;VI@9SiJcM_7$!Pw?P9vn`X zz(w~)Nlnji05`kNA*Uf4ZDTm^Bkne-3?yx-(Bzt-fm>v%TCOo#P)?sT{QFfIf32< z;UW$yy|yIdWx?(_*7_?2ThNuf&PXjc6tbqb*zDsWnDYQz&`%B)#a`Y;VCa6~WJOSD z7@%QuoGTpL-1zLWHOhioZ5ZZjZLZfv)Z*UCCB%>D$!NCYL!u+Q5~3R&2=y`P{tc-Y z$l(Y!(MS+)jREXLX85OAB` z#FCpam^0P{TdG1Ep=;n1#_~k;L*_=9+DLq{P*Ze0AY0glOv1MZwuak))?E7mej{z5 z?88S*aD(nd-Y47h;&8lf4XUuPQ#z5!Et)%b?)>>$I)H!s?2fnk zt+7ybb8tgsp7e~;w@X67mS_Y-GoE~NPO4tIsFG=#dqe#n2trkP!Fs3k&9thA0OlC~ z|GSu2q8}7wCj~Y!rlVm*mpZ!I15(PtcL5w8uu0Wn+syz#bw~>1Iaq;k{BO+aVHF+o2|_`qu#yX@K!hPdi) z$vRSgy)Gy@^D<8fx(0-4uDY;OEizY2)ySD7DSBF)sN{t3H6~263v`-Ar%~c@Bsnc5 zga)970V*3k1Qqw*mLi~+kg5w7b>-Z4btbP79bJm2D=V4eIW-uwMQSn5BxAi8YmsEA z@JW}XlG9_lFC1APT?cF83omIkIKXkI@JTFve^lnHf*wLL9Z4_Jv&8f>%Ao>z(}1sW z7D(}5f1*l{&jIMis|ix{OFUgk2A+v3ira~cixZ?0l+!_;UF0qBb&!#u+~vguc?D*I z@^_I{{1{oD1obH{=v&aw^Cb1J$=OKY&0M zxUm=U>Bg9gkeA-4572K)`P-R16QdQ{eB&VGA!!y(-Fh~8=^Rbr5PKATNFQOeF!Eda z7&J^N;b+q-9+#j)vuSMstqU_~2?d*$P!(FJq+^{7p^7_bV75?KWC-;seFiFj)J!q` z37@8v)g3}5_|yUxkLw_RHl=MD4E>cp7k(hz7xXtUlt~jc_iRB$X@jx_-3~$T$)KB7 zn(!)u;%z}TEm7LwY+8?i*3JxCwzR^dtu&^8(Z3y9)A1>?dO_;22XNy?LZ^$2*MSs< z(tqeHOk;W5luc%E2Mx*A*faly3|>xYGT+d*4w-s<=75O;D1K<=_`PI~e~gB0Cr^&B zmZLqvhS^@Q@q(s1+@6tQuYkUz1EAxjKHw43vB-y6-%x*pb7o1ShrP~<70!w#7$06a zzJo@jxwlu^2TCuyRx(p7neuu~ujI8?0%add6aXA~0escO%2CKNayis{_#PTniOmC8E#KTAyR4`m}BhKVs;FLT{n3P&9dT z2TjGtF*ymEHZ>P_)1kz?y>yCenCRK`n|o=V)@sQf3Y6sg^9xElX+}+nvM#1LYRxwvpixNKe)G#Y5U?jB99u=D405wi7hBFgNW2 z%U~G^UtWYR6Jcurfapgc8ipV=8X;#k9DD&>yaFD2Dtt6Z-$23N(%Ep0OW_eSA&)Z?K$L{!Hk%k&e-p&&TWqI%*4$zf57^O9umJ(-sv6`;rgiA;7=@ z`bgu#1CHL)xbT9nH#9DM;On(IflJ@}JL1q#S1AzrW z1U^O(4TAqp03t^6;Wi@h!rTjN5zVySY!A(=gwp0$P3WKnB_6+LFO5#RjCX?H+d;>7 zQhANvQ|yN|#cSGW;SNrF%@_jSfl@CYOePmnKR%QSfx|&OhzKO?FT-_9dxwRFLCK4{4c}51h13vUy~4D z@q2gDiUggy+>fYqnp<`A=^!vY8mb!u)fG_zkEMY;jz+^|#XONFae$8INi>U(q*Xkb z8h8qRDsdFP{eKL8urM7zM<}5id4^W)sSte?8JPJw?q(q$6D1ooiPmYbh{?C5)V(bQ z$Zb3kt4L6~M8i;m(q^876+HmoMy&c7_!FQ_AkP6>m<~HrfHQ-S(qI_?D!-ZAbO3bfIRPC6Y?dS&G}1ds%+s+zEyP?{4w zI_jS!cTm5WO-$gEk$zu-Y7zDQzG6RO$>iNsmqW|9AK2GPQ)kQr6Dy=gT zw7#7-Nb5%3x=C6$Cg{v|I!jvf+Gt!cny~Sly`vJ@DlqYbf^z}BA9m7tH3h3X>3qol zqjtJLhHutHwg{2U3A(VIE|S)Zb?a7Xy*NRaw9}>1dYNv$Tv{(n(2v{cC(?RF8|8P> zm7samj!wF|rjxG0{j~+xCFpt}Q&Mf*C8({PZg?7&`9kL?=fLQaJYNgb<2MQLxP|27 z3M2-V@aZZV!i#AdpGe2?5?aXBRKrW@R6YqmTUkbpyqwPBlksz#8oGi{q3d}CZRbDtecL^cmOE7hF$YaftS#%x<8BFc4o~8^&t^$8~%(e!nx9oA9PR zg0G)M@eZIFy>_0x1n4;q(PcV-?gJkCaS4|K=+kHf&){Q$u0lBMOg;{v9zw_SES`-R zvY&=>8P7qRLic5@bLzh1Lyl`>Q~sA z^xqvjAvg7Z0$PLbioi;-= zTaYbWh&Xx?&Bpx#zJx0IQXM2jcSngeA+-1L0Rp@!-Pz-pV!YjVk`p!tkvf2-e0qOcX7F-YdpY(~i4k(# zGC}Qa;O1)JM#-0r>^PA#5F8?C@#CpDF{O=`I9rp%38Zhg@5Z)FyXj6Qi5NOgPr!{1 z({~}H%@&rB8PCu2_E8A#@ z9IYAW?PqIpa5{eu2kz$q(jAqY5m#R5ItOYEDuP9?MO?WKaitANya93L zM)LDb@ZKA#l(!)xzL`$pTM$=nr8>S1Kli(x&gMI?J>7|);@t&X-%a=PcEpr>5L51@ zH~BvLfbXY2^8@q`evrQAhj6%fm`CsqWCo8Qp6tYS_9%9s$M7qwUA&kRcsbaPc+!FI z{O<;boqR1nfgd(L$!)wR1*@F`zdwOac-FBPdLgAq+`oa57nmBf5<<|lZr*K7kQ^#?l$-y8FQ~(E|Zq~4x*m~{kILmSxg-p3H)%e1NZ%g0JZ^BON#*>6T%MGcr{wOzTz;DO=Ftv* zCXau@&&uUFgP#}j`()G$BFu|&`Ker9lFQHJ^0Fvte=fhmugZ$A$>Yxr{)I`Wi(tk4 zdLI9hpOL#a^7u`D%cQCNw!!Zh{H{qMe$S+}{Jy~-82l@f!u)HK*7Ju3e`N4)Olszj zO^Wa*2LIOJ-f04_7<-hs) z?}C;u4gQD0|1{}*;p#m8m%;xw_$!mP@&S{!@z(}_WAJ}Wx|qK;X*(Y@6d8(5x=bmP zE>}5*@)*i%(v=)Gl+RFxNmp~&ul)E_xpFa0x=Q7klnb_algcxcg$LCKT2+1J($7@= z)d0w^@}UVeFi#!A&lsv8kM2~5%H=Ra4T3sUz~r;lVA0O|(1sc!difA~P=}jps2V0} z`2=cE!%a0pjTEhX3Pq?aeQ3mvotA$l#g^wd4rYbbmI8`K4e+?L^1^@vEtZnr5h@nS4#rhK5j#X>i5*;KpEaYdqXkEN$UP zLve-fD`grOsf|~JTjI-t4f3%d9BQg(3fNPcf*2YLt!)a`#fxqAWaD#DRaRcmu?D7GwE+k}?s;`f$9swzaVlAHn+IhIlAe9B$sw zR6I8pTpKUb9jiAUwfdOVOQ(ScbN=SK(1v(88fh`qbVD73havWMTQZibyD4+zjsOgj8`$D7F#A9a_bD3MhKwn8L*6Oa)L!J+x6CiAR@(n?my= z@o;<#Q%zy_q^io6VbRK=< zVrsIMR2b+H0&iB%CX4+gSTDVCYhgEH-rrQ=-Ct&Yb4c0pjsvB;S2nQ&;p0hYF6 zMssL+xFrlM&WS{#@t{Tz(-6JF=Hg(gvAC+WsYx)4rSj{vZ`hOsS;G5ih2Q0>drnpe z#vx3%P)xC_!dN8#yK69cwX-md?w*pp9Mb?7l5OftC-)-sd6F4h=SSP_jiB!fpKA{io1Q|UN(vcK7R0^++IWTP@UM`$5lbVbcs zGaPN!ab-xxnza&kip!)^FYB$9TTpY8at~rMn(Op{N`@pU0QFLa3|DnnNUiRP z1jPrvEr|5^JhGQGA-YyuwN4Y5inj`lQ&MhB^)>4MQPY^2ei9+Tctx zd+>QgJnivrkJP9TG$2=K48cD$6RvxOQC37MXe z5hCGovch9rbg}MC7bR!YcUdo`iCI{<$Tc&~k(+=c<*ZUe9dD@FIGg~5Nn1#gto^Ac zB|`HuHX}%CMx1OLtQeuDP%}^nZG@S6*z4_0O_OBm?-IgkO6px6VY|8}Xn%l9EpwZK zEiG7dY}VA7|4mWultoXTIlk+mILYJqWT-iYDnlS&i=4-W+w>NZGDFXjYB0kUp_~|y z>xFyBr&S(_gkqW*0iT1PB=|<_QGzWf;E=9(l^r3ApR_gHXiOazKdU6*peG z1)LmZ)fA|uI@%hm3oSqf4K8%p%RHk@l0%wBuhGvfHCN5E)O@wTPzx<}f-1M@CHfhl z>k7YJ#Z*nz4lRaSWT_KXg{3N06=GR0(TX6^1pHWPv07r$%e3E6Cs}H#szw6Y6A7^y zb{#vQ={>5SK6mOfp|+W!mRag#uC~;2wZfuT=v70VVyGHRol5UvH?`DCwaQYbsa1wL z9iQ}jORc6qV<)iG8uW0P^aL$ctLiK|KwlfG-clj87Kx2Tf1wX7_NWF+ty4JmueVgA zsxs6JOEsxxxL0qKr-QSlBA~CLa@l|j`_vhbKMkDpE~%3USFVG^z)~@p*rMVvrfRj+ zMzsk+-BOzs5InvoEkbe0o!p{N=(iRh!^qkOr&rf*lpKTMmO4|NWzoCzo~(+c&sOJH z>U-*33)#a;ID9XbME)(@e&15(sq-!R75&;$KTsD~YOC62sSDLbOh@&gKe#H+y!PoE zj);2^{bGxL2Q$)_^be*nX(7@obmj?qoM~WWyJ&HNMSl|OUt+0Cd5NViQIS*osCF3YW=q|wZnMJCfYsqR9sOjk)x2)3+)t6OTPx*I!yrS4JpVl%MRed>PE(*wQpsIo1RM;w}#TANN< zwb|C#5P6VkLN81t)8@otL4asT7Zi1uCc9HTBs}f{Mh*F9D#dU;~hQ6!AN23{a>?Jf`Y;=P8)rs3hAzl0A+_60%~u z#V2wFN?vKyq_Pe}by#YTdK`)Mf*@ja{fKyUL|rt3!cTledh4}Rr+VVMCUrKEBx$`N zX~v{OmVUB#fT@T^klJShMp_*?o)ThD_s$U2>!PtP456Ea9HQx7A@@x0fMPos_O2|W z+3lLYpNPx8rmpH;%$Xm-ktQ1gXap&yQE3~MBWr93HqD7Ov`Vs++M0o}^dOsyveqyP zgD80pn-`5786VLYiEbLP4*xJ_bFeWq!ahKau++2aIZHhce&O2KAN!_#Uz<$rlR$cp zdcjgJs-GI_B}@HGy=J>}9Dna433}dJA0!#f|T`A)bo$|9ZrFFDl{lZeO!}Brb zA-Vk0P;Xf3O$kx^)mw&o+fwgHl-jS}H55Yn`@+e7m5|E^!p^Vc?$?I;&{7|%r{v)` zhWgl2pTL}WSdbAG?OfJUzg54p)bG`&Nv`##>{8{B|Dv#}%IXnJrD;jhf!jHf2YaZ! zGEM8nY&#b!NBwq=O%FCqTem7&-CDO!7oc4{56>Q87o1%qy5IUzg%T*mwYeqFlyF2> ztKRAD+HX(3oGy7X9no#Xv^Tt-+*v0j$UpYmH%#b}4H_x;N=^b#P#0DCAe^Uzp8ShwNPZX8rXyr@s8A*BJ zsZzwWqm-s)rxu=NHB06rb8+#Kd?7Qt3uab+=Q!vVEy+XbwT*3}4Azs>M|BHpr}}1q zt+FjraOEJ=>^9Fc7< zM$l+cL*e3)(OJq1>-;$jELHU zx3IiifFp~X5RBA|?@R!(Zq?xmuOQzCQ{4f45=i#+Mld}d1WfpDRjtF;@WSkRLlWS? zx_*t<7sEvy)O>A8Cdh)_bFB4O3bvptd9jgNZWv@uZ?@S7MKI?9wxFLJEQ(#dixAQM z!pYj8&@e#5=GZSB+uZo<0yYYST5TBSYu!+<%c(`Zl}m^p*^|+1$A?5mbtObMIuPn( z)BT%Luad(NY^RYR-X8Fq4JErU5@U9hDpv>CbvK4C0RL_cJ1iK#8c7Yj8(-$j3p=G#8h_!udGi)57`NO|pD|5$1-;NlB-h3G zw@>kSzuy`QRc{Dxip-au(fW32DA*E>fM~{(Z|=#}%NAEM9qZm&{|AClRc^4}DS|Vt z=^=nQ#{d5=CYI<21=;C=O^oSi7}2GUuJ(YGa`3GHhX-s@II9lG06=v}O5{0MfvKb` zQ})iuKw?8HNF3`X;ef@pk$0D*JcVT%OoiiC>X5loKQazop2B(3!$6Iv z5E#KN_D2r}VuSP+uGF!^&RQ~)FPIv^-&iqcX;pdE!qnGCzB@?tf^<(8(9<51N&tmU zsY^B|iE_214(wW#(Qeh)IjGAK)ynea7n8`*Y4h6z4@Eh9#bY>hF^s|Hyys$wIl|*tX%f!UoTGXB#!kMwl zt`cF0s}h&2DCO1b(vmYT^Sq#|L73*M5Ic1vbFI{moJo?br?rWiP6%IU!Zf>7r&)9w zB_2nT(^5ic0BRVZ#?eDiaqn#@0(uFlzhF^U_HEZ`a+}c6rFgo=k|~~3jWJuKD&tHt zHj1$pONI)cbV(}NJ*NA@k&V$tSQB4;NvpvDjysu8V(Gi1GG7|>5R&OAdXb(brk_#{ z<;yzeTXI>_@FdGmc8WF*MH zq9{K%-%L>6V`LRQN|q-_vRKG3FxVrT6Ir^qW!$cP7umXoWW4cnEoDnnhE$o=sjlM^iY|9z`G0 zM;I-P{DwXT4O5Ew*|dtrC+M(jTH8SD!VFqM!KNitg%)b+SSLfMq7E9AEz}hmLVZe~ zfyy5=Q%rxvrzr(?hfoPVwSYzAJ1CG%X-5V_f1%HX9|-pa{S^#l(nR$=TToHj;A}y6 zLeRT2=%$q>yo#WBZ;(w(lr|)r*2AE+JA;-jt?+0ojp?8CFNf9)e2T1IkUIQ++_;g@ z=_2EGAcdjyZ~6+;Sl&BjlNr)ML$fvZ%zq(+*HoI!H}oHeOg%nxz(hV2Kdf@XJ~Agf zO2c=OCr4Pz(Vk$#Y#-QoLDL;!&q%SCPv6o((D70q@CfNxdbdC{g<^4cqbvX3PS0FJy6zG`CSC}bJ60_r_t zFO9Cm=a^ZzjGgYm^~mX>_reliCylEK`1Vi{G6sB%XKJSjCB}pVO&nU_Dexv}Qi(s{ z-$x@msko+{CYR&}{DIsKIx1ik1#;VI%3hk9plJa^*tZomo%-PZb+G>i?%qV$c#8%h z6bwTk7>!U+3ZE{AS62ZRE8tD1!#|tgnG#0Ug7pJlU^JGmQ8k7S1*J z5Q7U0K9rdaKFr`j1_!V<^I#rgD^+%A@Cc-*>-(aiZ8X+3G(mG+PY&A& znpfaYyTEc-M#7gDq02 z(J%;D5Jcc(B++2_??fPC6dz$D0FofhrlwAYL!;2kLS@*!k$0rlg~y!LrO!l=u;jI4ozTw43CAE^usR+jzlQWf$he@UZ0ak%iEXuTf+Cd z3Jo4-a1mr1&l50SLdbUTBAVav9kf?X1hPv!kn}{k>!6AfZ@{~c;%KQX@dbSQ==h=l z@Tn1O?53(cv>0bF#E?C-gsF`Ja(5EbURnw_Fao&=s@{3wXficwu!zZb zq}0751;`yd39Cp@xRO(f4jT9ghuQ-L#sr)e{cH27$P zrxW~V_yO`AfW_P!yOM7rI1%Y>SRSbvZy)~x2=5yI3>CN0%1$~RQF?Xdcm$9Ht*M&0 zhftamJUZ&1EO$`9m`zOJlaT>mf@%@<1HPgFV#$;}RF^|5b{>4Wlcv^8Xs3E1A8Mog zPFh=o384fvw9`6i4eQqR(i%=sV>>lTYqM^RNNaO~qV2RnTF=m}F=;&`K`reRm)4oO zwN+YYCTL?jZIaf_x^;`RZcfmd?R1v3=C;xJA~a#+IeS+nvQ=Q>d->-AeBbY+^J?$2kA4er7yUizTyxaK$+b@31JYv$TpnU1CEV+G=9l5 zkDKw%J%TTyMDY$_1A6T|dnwR!Jfh1C0Nn>X_Tv&R1<;SBkvx-+1G);}u(SAhfO;sM zz_WP{V#om+#$`MgZ4xEyWFL1}r4$ilK4g~c+n%`~HFF{5Xy}io{=RQ%n87C)Tn?Nc zpy^*>XVQO*4PG=1cYTpK;X4ADE0Jh4G--h9DUM+!kGWx%oMCWt<6hcPg8j@}AW`F{ z+h}wEDa#(ZSs}XgE%8mzkqBtMMbU~2yu9<^J3~9@))KE^CEx|HFOc|a+scl==OH&Z zA9mUb&1^%qa3SL8MKlNZ3;7bN@4^>hgF9ia;Dc#xQmtnl!cd`>U29r97rF?pST5j+PSbGKb zQ;89B+%iG!ZQ$lA;6};Uj_f#*GYA|aXz}BzI5D-2mO5LL#0jKtx9!2UOnc}KCW#n2 zPEW**4%2rc+)L27OULXYx!ozZcO%FnDcO1OwF%-WYul)xlS1M@YZG)&g6?gn`=n#N zcC4^;tWVJW?eu`OM)dGzX^kZ4!2~_jPP?QdraR7%j#z>oPSEaldPF)}b;nHUXidU$~Pmf+(LDHD}MNQ8=cL!V|%&-Kgzokw!Vw*7czr~5l?nwJ9`8>(4+Xh)nmMb6L>k; zj(F06Z~yNBhn;*4KY^b(KFMvoH{~a#bU3d<%<>>AEYzE+;*r><*C2j*ks}^WAHq)* zkUSYaQHw}%EuPA_4jus1CjE&Yhd%|K7$e07n{K_6%}k+u-+yR?y?q{_DF=uL6$~0Q zs6dAsxJyWfn^8DFqVY6?*W#$n4e%R}%+lOY+H%;01az_o6m z;J%~cF1U+UC&3iOrPx|qZEIWYYVF?I)vDE2`Tpm=H#2WSWYQ0QdGp>~&OOWjEcd>d z*S~oF1tL0Ly=&5o9FR-1NkchkatntF=v7{0aI48}9G2#_2CvKKh}^bIXVl~vuQ&MI ze2yF3QNRiAl+G^c++gxXUT^XyK2I*^n|uLZD3^;&zL>u%mrG2(lrNLZT*<$L6Eufg}p*!$&jnOq)_`47t7Lo#4zK6?$`WzsBuSf)Ob&%S&% zr0Y?GA2X?nAD4$GVYs3D?~x1j4;WDCB3*fjYue zN2=kFUin22P(gu~Q;iT7MnXb$l&MCk(IW8QAfOs!suDF;(_@{V~N#W(^gNLx_a3( ztZy#d7!0jXgk#YTLzNk75>qh*XaWD#(L}5v90@IqCc=qLOsh(3qM<~2J6H?G18WlH z9iey^D5t2E*HtxO+Wc7i`dDYQr839p4CzXdJTDPwWjZd$q&`c4e^@TfVOfsZt|e1q zre|wug@v4Ax~Sw>uMf8(W?^e6VJoy6(5T3zQhR9SL>K1j6LFwapc8ToGa&~X4iP|i zStq8nhn9ys!a&iyXf&1xXxlT5)JtqE52PE*>pCM5L7M{2Z(F;Yn6AfvKuUEVxdLGQ6}V7H>^?e=R~0LPn%=Vl`8KyYmF__dCdjXKIen zs-E~I0~z%6y5U%RNY)*hwQjSpQ(h&VdTDR7+=8N;oO=+H(H_*}nR3BH5334v2rviL zCj!BBwSo0IBpPZm#1wVd%Z=4z$|AMn0PK zls>9WQ-Zd1(A0Qjn(Wqt?r_3&I+)Iv5Sv0TiaA0VM|>VkWRKJ<_peZ44?KCbv`iBQ zDuhaebb_3MiqBBTp};d#Ib`c_;Kekje>Dwkft3?iG7Uz^39s2SFWOQQZf#3IBs3bq zHe}NfP*f0w7P};SG9Be2yB3MHJe66{TZuXnqtn5ZX?_-KAsrgaQ!eSEq~nH8kj@w} zqccu&waa<3i9qw(Q1)1+>F%NZn$VfAEty^+zddN*qnb6;RFtJmmOHvKt;iB34WR)F zk>#-t3+dH8(SW$2w*zq>pT`c6CS=!otJfKyX;O|LrEzNy79X|6Ye~udl%b|!XJDw~ z0j@->PMci&;Gxq3LZ9|}w^wRl2p~{9HN%o3)4-^px>6Oi%>U%xjy@e<76{s(Hry~OP!=nw$w~jVW>(=%~GdWw4Yu>R<>I(^$vHOQ2fs#SHCTB4R3>MNF7M!&RFJ^dCz-ck+d z;hEBNhNYIPMvMMQ9~x?frJB@AR4p=hl|`ScGc9$NI@?gIEp?8nGSn1H1ynQKYe0I_ zao18oETCHC5|X73s5MOEGJwgXKwTlYDj8&bOSQ_xHWh{;)mlrfQxTZ$(0bFw$kJFx zSgIzO*NzZxsi=yf)H(E2J1(SByG1{vpIbbYry&<-IMzOw8Uv$PYP~vFm;|SB)nTcG z>a=(n*CYH7WH}V&!ey7GHmHpj{fK_dbbKxi!-=sEE_bDKQO+idegR9<2lN-fE5mX| z$LMgXOI@tKYN<=qr3jQ6?Aa;7QkSXAE&3Dv z*-}@i&6e6Cmn-FRmD*~lZF0Fw3uEhVkmN_X2Rx`%1XK+GcZ=EdUygvgQo zkknn8?rrK`;Swca*+A$nh;`~il;M4d+U=U+{m>vNK7ifFKqxMX!~%%UNA@A8n}r@P zgdITdK}7dHV}Lz9Vy0>wpmSh`qm{lck?PSRJfwEYlDjOf;`une%0MSwml*0{OFg0< zMRC0-fDqnNl8BWAV^JLABuX+F+ES0H#}78ElVeh(b-vP!Nrx=`!~juK6N@6Q_C<}f zI)XeY)SeokE$Z81@qTQfn>D=#wOi;tJwUYBj)olD$8dJLrudAw?i=dz0fw7}QEYAc z;sA}H#dLJWPSue}s5KCo7jNy9!YZA;0kq5@n~kc@FwXfwgQYDu9ntIk!&w*iew}i{>l1c|>B7wG@O4?oBmg-S^4E4OFdezr0wO74h zsTbAlStd^x50=`eE|ozDR7HK1rPZ`oy=1AE5d$#hUb(zts8=oZ4T)BJ)qX?0W~pyV zz}l;jqhGhww}p+pz%edw2rnok_Nwn1>P<_%rJj_B?-}a*mihrqiie7<2)U$rEe>NX z^|tz_`{Y$OqLLme0|L=lG>m;+o!(F%o;A>RQH&g(;Whj1f_-*jziGg! zw|kS~Om-IT|INfOm%VI6*#uLHD+W8RA?cmCCm4`z)dcr?w%24GF*{ARqzgj9NFW|+ zabAB+anH@>HR}yW>XnEqa%H_Of#GnjG*2sE4x_PuFI_38nRaZ_wCw7_)6leZA*vT> zJ;h7v)ymv{m|1nuZqaSS6c6baFt&-ZSWi*s0MoRA?Um=JUV4ZGo{m5lcUgM8#g;{ z=<3)B9z&bu6t*Ge3P0JWbWW(TPl-EBGxv<%>oHPA9hEn;4Q7L z7EsHWQv=Z!@zg0Gc4&RL!Z;Z8frchBNES-Ja${=BX-MHPwXw|k-Y7#Fi<$^8bL)_w&|T`>NQji?)U@s8SQe2gliQrYd?-eR{Dh1k8`3Y1!%^hgXdr^~_9)JYqX}Tr zU$woY5BOs0(d`LVzm3 z(G%4V*=aMKc6{+rdrU%TaX&H%-yRqQUX=n~ zJ!1prDXr3&DxJ7W$GcVf5nsDP&jPy#FoAT4jvfp`M)8)e(mrk%H`z5Btc|E`G|pRA zS6#O_{e6*x2f@~Ps0wv<$v92AP82$oF4qD|#%~j{w>^R#{h=Lb6b`$7zgwNB?i?o~JHtpSc z0C*qQPT37`?0fKoNaKn_y7ZP;0P-CK3D=SovzAE}=~Bfnmp40oA&E_cunPdkHvyh@ z#K0RK)JG}kri)K;$7UQ#IfSyqm3?}IA+AHZ)Jaoei#~F4=4Edq^dS+Zxz3fH<0Ny9 z94k4Kq=wIE4<|h#d}9gI>{C3=qSGiLIGUQ47D59~n;qvKx#EaB=cFmHRf6O*ue!2vs;-`N}5s(D1&LZgw%`quTf&K_u*)(yw zj<$oe=I<-$-O$=SS#&d66JAA7ycck2Wod21L0Wql%sk>EW;o(zw8r#T`kO;+CO*ZS zURYq{0ruew$;(<_-UzewQ4e|sgS1Aw5W z%yqDX3CdlNWo#qVd-Og!rWT*$X5%t`h6mRPGeqylR``0Uw8`(=Llcqb@lnRqO_M5& z$w`{rOH-Og6?=-k-E>@%$}95y`TJ>XFHLRgrfC%g{(OHy4;}9}%KQc0bizKGo}?4~ zhDc%SYXz>j#T)m-c?_7xkBo=v~G zpB8GZR_vpx6@~u7qRL*H)g+cUB}udKJV!tK($91CGbq^oezS+>73XKLyNHH?>t8`1 z??bb{p~Db#{6Ntdgpu)Z@CvxrTsYT4=&ABh?H;A{;KXFnBadyNu%JwRs4Uc+E5u^B!_U>W9-e3Wf20L}}8A$QoWu#c*0 zq5k=GQ+jAYg~#vNPvcW~_D=D8duU-VEo$<6%KT8ZK)Rb2@8%4oCx8XwJo18V6ATaG zd@9EG%0~cJ#{g0jc@Vw_KSZl(Hda0cB1%N{3J+=J%%=AkLckEyc{Gm!gojW$m%u!E zfc!)q+dW#;!NgzCEQ7}ye6+#GK(=u_9^(-}cq@1jrSCWhigi-}s|pV!Jyq^{sJg=I z_wJ_zT28C*`F;CoPMIIz(eN^!q0{$J4Zh0@2j4^3`)wz`+|@Ddqa}c<;V($i(p?9B zjXUV*D}IR`%kWo^zXtrBfxqQRYV>>j-e+hj*7Wj`P@SKOV65RV z)Oa3^s51sXNGPEbc`VK4qv;%o+REeb?fUU_E|=oF@MUxhPog_{idOBJ5d9o7cmmK{ z0CY^#N;YUJew-jU5tHvot9wTpi#zyOP?LzUO(Reu#uYpf)IGr6MywznB2jw^c@EHN znV2vc5HlFxD})(F7>utLmJ?iJ%xC2L3>JGIQ&JgS$;*Eme`-I-8L-vnNv}ch-IHFT zsoSZsmsTN!o>@By-kqeg>Za^L+#BX>vCOgmm+ED(a0D`@rCa0DIx9&X-IS2lPTkrit({5Q&`leqwO~6u~T|7tf~BEv7$L@pB|mnP}*Zn{ERH|y3d(z-cGS9a4?(z;c* zZj;unNxHh5u94Pjw^Ly+T?d-i@9w1=ntJI*+}~7mbCPZWDi!Kk+$HJOZn{ls;|~zv zK0*ld=#+jV(gSe?dAO2%dYdTSybVtIP>WYUVvn>kOI7j+ITT-;8XF7 zm1=~p)97YCogUyCdX#Hv4-)S_UP5m&k{W-7e#^_~18$&?_ze1(mjiH(d^k5DI<4d~ zUd7Y+OrFbU@nSw3y{mC|4!(}ptO0&1P_qcp<#;{;xT-{anGUFX5glsyM4kZ%kD>*9 z5}%BS@iC3&nUDb?mN%zB&zrdtbD3uWnNktkGfzp+oQ;_R^l>!Q_XUkMc#gqyf$Gob z_)jUnSpQpM@VwEu8%#>x$YZX=opI0|Fik5QQ%YrV`)t`7;AZZe2p{Vh4FYh|=?x-HRyTU8z@OuH}OC;Lb*0H1QxrE<`!7`oD zLKhPE21Lz`G!OTS`Fw<{3$(_TAx%ujs0CVMqYzRgl}X%Pks)5F(F>$)U8nxx0N>2c|Z>5iy$#FF$xlAi3Qr=%mUJ7!5oJW0Eg^fU?( z>FCl6bV^58lAh_NuSx4g+X;0_0sQk>k@6zRQ_tC{ClmXQO2@tjE4+XU5;0^-?mFg}elOUE|N%U0>wmZZJi^n$crx1C1G zj+L>EeX%JouZQ+wANvwOy1SOMBFQWLM-u$74!<3wmmRF$Po>)bJiG;wDV_%I*gIGVDgWfNw%Fx*0!MyM-PEy~p@A+RL}otGpdi zV$kMXViIN!!k@OD%&QoMVO%7{!~^CyK`+DX-urjqDTY9r%d?lBa_1 zO3DLI3NdCCJOHRo`4c}6e`<1KjO^iUx@Ur}M3&>J$oDyw*vS%Mtlnz5;$(U8}C2>;FG~JVl8B diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_11_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_11_R1.class deleted file mode 100644 index c8b7a3fc6292c8f854ca3dcc6e59536831a45a52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15331 zcmbVT34Bvk)<5Sq>1$sfi@_=Z*%Yu8u;2pPB2XyBN?VYYrGh}(rfnciFii`n<2H%| ziVLo&xC?HhxTVF8iVlM_&Z4vFIF7S9&g$&D8{hxj_maGnN;+SEzrMV8mvhhZKg+!@ zdHu5&ULvAX)z3|Om0RV~X3|g&nY^Ai$Hn`p72uG!Pqrn&EaZGMIq%&@ECwCdV zDUUZByd|G6;)|v866ySc$(M4M$(Qlva=F6fEBT8i`S~h?ua?iP(sGT-U*c_Y*>3W+ ze4Si&n0!6oVDgQ8lU#PnhwqikeI`xj z`%Rk24;cKQNz?ctlON_i2JbcLG!gVQenc*h8vK}yeOxZr$>j-||7E#*QU*Mg$CknS zOq#<_%hYG`cu*b>mabSw!5^8ljXySNJAY#Erv`s!(hfds z()GO6P-G}JX(zWDN*OB0q+7W)PkHdEyz+3BNw)wol&^9DI%OCtPag82Rb|Shz*LqR z1o_oqXhID!)X)NYNF5^=pP`096Y5x#FH(h~n0KHEb)2Z=J*Yq(Z>r(SFBF5H)mYI3RFJRbRO5t&6Ct5G$yDRj1QGZ@5Kv7t)yb+zPfJ#8A_ia>LQq)?kcjMD_YWSD>Ub9txL8TPV_6Qmy;S zn1)3fEZkrzRM0i(-Pa zM#coY4>NLSg(9K&Y^I!|Nz0i$^P|l{rXkg#NU*lEy)hW84>X3+;;W7}1;Wb%v5-7F zjh=X0sDtUO>ZWLWNymmW&$_T=Q#2NC4mOA4C5@dMHsB-B9M~8S#!5o%8^a}a8$+$p z_}Z@NYo||NyL39%Hy3Pf3T}*tqLB_mO*ho3Oob4j8T?m8;?eq0IJh7Z55>1IttzUH z1mh*`V67<@Xo;6}1Y=#GoTOG#JFgzo=11E%Mmr;;*QaXE@jo@qrki}t}pmZco71vz>(`#FWxtgAWm zv#ipGCt1w|PUnTAO&i20!;7k;vDRcnsX=%{7z&q7s$$A(cb?!-{SLArpPVDKswRET zKn6X%ZYbIwlyygDtlKE;l+2S(y|lMcZb8va&OM09Xm8TvnX9eQ z+vG>~VK{RIJx~~9Iy-|~iPz!=0A|0@S>|+<$ckFc@P|A!=_!3wnW6;k=)kM-C+_Pq zitcbiekvf(moS|~D{p3Ecs+_nDzHcDmHStqum_&JT3V)w0~JEWgF4Bcj;hg6XP`(l z)C|bh;lPP$PXB5e*aGKII-hAULQJS-OL?TZI@H=0he&8Nn%a<&gFsDw1X}Ep49s+b zi|l$N=aOW0LT?#rQH)LnWTyEUtOa#=ElIkdi;|8LI>|a?#Ei~3$@eb1WD zOsBht_G?0CzP4m)g}nAA`yLgsp=KhmyF)3{$_zPD_!*!C8Sd$(5ssxvLQi9IL!Y8?Af|Y(| z&PE_CH58oWkHA+_$x;V1RSYc2$>5Cer&(|+YA|60!@+g{40;GLWh>t7B&BIG4R!JF zGTHDS z7F0AYWTulq$`ILdQWCCkH)tt_*zJV}$fs2mi3DSs8v&jJp(OCe>rnzPXyDlXn3b5{ zhoQ7t+<;8&4nXZ}m&O2ZdzF5W)0eV17tn+)tC|YE)I~dEO~FbO-e9iJhU664jal>t zy=kf0YL2Dms&Yfkv($W5VbM3}bwmzVaP2o@>QHHi4nr-lRHa&IsdE%+i=wQ44OVU3 zc*1~>rOs80EczyW%TU#ps!_G54YSga2!pg@hb$08T+n+=z5mlDGt^>BE#dPlb)H&k z(YNV4hN?rFv{b!XW~t?Bg`rl;LxZKxSLJYxqc7^N)1f@IO6IOcVzAT&Ajors;2KM< zRqHJJh(0z{z*3E>36+kFY_`~=f|hDgI1FgBR7h1B>U2x3S14+V2c&Ktt}PYD0;*ju z5nMP|MVZE@ah6V-x~gzhKd2NewNWNssA3{Qho$1G6V^Vu*p@l6iwMAVdOoG#k)g_ktg1Xe=mE3@= zF_7g@xC@t;S?Y3ig+=eskC{%*reXL#_TMG05Ut07J`X^ACW;v~7XI{EC zk)^*VdM>xKf!yOMOXgv($EVE#hk$vUVo1)OElW{f+)^sU7Ni zOWh!s8|8A7+G(kq<#LO<)lj!vYL~jxQg^AlEwx+SgYcU^V>u_#(T3Pzse9FZNG_JT zUp;_4W2pz#L&Dy}1N72)Tcr9pE-kjUl(cFq?Xgj`muc!i%p&v3W3d1t>&Sjc>Ml+9 zUiFA@`Dj*`w9!=&?bL@i!}}1m+cm|)b)O+fu zNv?ICcj8BKJA3ZbaEVR0aeh(MSlJz*@cgJ~m^Z?VT7oJk4w7yA1o3!+x)UGj{im#+mFa z-2Z!!V_f#K5oHrhDy|UhxQ3**?VhH9?7=3w*R#DQ<3QVKvL&quHiZMRV6*eGWvY8_ zCa)RqQ<5)WTtO@2-3$ze6R2{nd^x7ZX20lsIp?%vlcr_Y6rTEqB@0lqKdvw-Ad-u);0LNL6jRB;#erzGy*phAK43b%NpuxZIr|4`lu_mW*$~LanwE>&mvZe2vj;H zo4(S6h4m?N7=HB7o1OrVZWM-O2jZ}<&sYaKKO?HR1$1_mt8Z3r)tkXj`ypLv1uJubqG&m_geVCl8r1%eJ%~*0jo3y6&;NlT%{dj+5pQ znNuCcoC9+iC{7^OHgI1Nh{La8_jx$IDXOXxjLMjE0+D73LsLQQ==yNwDA+3(G&GSx zvQX;nB~wFILkfqeDir%7W`6S1?l(UE0LQQrfeWRO6-(64fbVz{jX9MRhf0NeBQ z*}c5qNs$^2;bA@J)pg&^HWu~(Zctbb2r|v;$K|u=4qFQWpXRD4tEN+qj4+%|+)max z8l%GF#IzurQt#kH5fl=UKp3wbA~-RR#DPhF?c%lb7cXg8yP&qds=i?@cwAdqwV=A9 z4gd|M3XkK!ZaSYQ3liwWXbW`I1~)??Ko#KViRg#Snjn=^b7R5wsN@F^6c12iPKEsd zR7)Eu_tut|4T+Fr6G6mM$7VJZ}#uG{j8Dk>@}D<>^C)X$h^xT09FD;SBF;NL!| zz!xAoW5K$OflZMG(lcJ)E)51cq7e|yc*>o>tge1>4bz$K8sdK-2$kdqnw@t8Oo42E z;8^+pyPBwc2oz=)LN+ld1J-isqu;2WQV(9rIZPmDG@;hWFm;`NGmwKNn9BMAVzzjZ z#5~Nou@f}TbklHf;ez+k3NoKFHF>bC{fM!F^c2k#%zKI^t9Xed?X0%>c!|=T)%2E7s_}gS_yNuUAM&mc*B_ zOmdeYsd2fy$Lb45?0Uds9>5#h0%+RN0`If12~WZ{RXvLGPsY`J9s_vqMgpoJmHPSZA@6 zm~cLqsIqOr^xROSE4l&ZJIjq`2Py7dN)kLS5-F^?Py4fkV46;^(W}Jtb;=>1yqm!n zTYd7fM1SI?hW=!EnL~=ci>IArU_4QEaW`>sae`EWa(c+~Jb8V&J!B*(Z$+^$-)APM z;CZr&pCikYph3mH!M-7$7inli&NFmOU4nei(=c=nL+7zigPx-A;d&zF;ku4Iv;urI z(nt!@L~5Z^C`9vVJuRXQ^nHx5Y#!(b^g}$oh5uYoc$MjNKkU+Ays&m@f(31~Y)(cjifcr^e_6iL+mVkip*Xpck~muam)I=i;UO7lBo7S^j}P4dCk_B%*Y-Z z(^qA^pF`$P^ob_(DShUUX~t&`nD9aKV{4`yB6CU)joV9}9AV9E_XA+#6-{@nJtM`Q zj}F65NWwITnFZj20HEa)8ftLPTrkca_Btz8J1d%C{KOipc2b&q8)1h)={46%W@;r9 z<`)UPx-< zcRx)*L4XguLhhzhN{uNAD(R(Z4WkM@h2CzOo}g1p^Za>-Xk0Iy*3eC-m*)HP{P{g} zhTkam=XcYL12i*1XZj71!q(RefRph4)r%lC2w}q%lekAqGPKHlKr2K%u# z^9Ua4==OflvCy_h>lRi^DY#VBda_n)(TrTJVu>5Y(BxV8FTH8hek$|Oj66Kdg7)$c zQNWKFtJPfSEzB)696g(U^AIi2T0Q#!omN`lFYwLor8x~^iMa_X$MZb>oSS-{ub)A| z?)RHLR8g3h#%?7Y1FnAseS84T{)UFpZ^@5{GzNiV0zybB0>)gp`U3dpYPeYdjuwWS zT>?kD4tl(sKBWhlwQVkf2EsH`+ok}c7wU*Ah})C0(jLc3Xwy0uPv65Q@F-Ym7~QNb z=K%*hwB@|u;~H(bTyS%RwwwW;!aN!?^1xXOkKwVDukAHT?DZg-NqY^4wZvxl7>8w; zPvnzqb0JH5VKC$y+Z7Jbf*Pp5vUX|@EiCo;J%?yQ63^bLes2$*(@RwieowI~J1K6JWGrJ`q1^If>4ITITWuS_h@HLLuw92)|mGjNe#H#g8UV zp}TmRR_$ttz7DB*3X)(x&@o*r*`R5(LE}VBzB`4*-6<^Y=Bc0}5#w5oK#3Sva|x(= zfV<5+U3-W`?WyEBOy{O!!l{6m!KaBCc$~rb{^c12_ZagL<$eTX4`Qxd`r z*lH^(2`}%P{0g16i&pf~8idfbHIw1p30hY>bwA-0OYrEZe~R2W>i5bh(Pm?5?i9aQ z+ik{vYRaJ%dk??aOEVj$bW^jC4(=jfFSRsaLNGzC-P9(nA>F!OT0;ri&`n`!ZP%?4 zX>CtXw3{|c>xH^CCao7HsH2MFqXI6Ett$*GsoF^wO=kzs+}hg6;q+r3S`b zf_8P&oiD>GAL@GM3oy7;wL6g>h|eYu!&`YS5_dWLc^-}83M7jKRLPaJj29xAoC6b8 zQ5&C2n|Kjj%GC&6HTV%vEyChrdW@IQem;*5@KSn%>*y`6rw@1;eaI{D1(KEYFMNk3 z2j8PTmRIvgz5rglhNtsdp3CcaAzn=^=SH+P;R}mF4e)b-no2~MGx;n;kut=WQb65{ z=upjNJPQyWMHPHDxXwXIHJayucZ68pngl&><#Nnr$U-Dlv^{fvYGwsy3ed;X(A>{x zw80Aut^}$-qEr7%d4>9KvB3*R<8Cl1`SJngO57O_-2v0I(lMn}7I)2-?F4S_K0v!m zJvlSHg%Ts~d4R_IQ9$gcdlh2IU?4b&-}@A;xXR0W55F_2hwd-+3Of8=K=~?(wzhTb zXd9A)cIK}Y4OxY1GJAp~~`5fAGKT`aeI12ExV|&mxAIkEeU!gL63IR zW74r+yHZFx)+gxkZhAsmBYJqdv_=y2W(?m z(V3uU6Z9Mk5b4;W7uYNvTN3nqHzlO?id{6fm-6AC-6G``lBas?)RT^VC!}KE-cm2% zfOYd;N1(UzZS*wPm zWIH0sbwJ_{M3U?A!_XUO96rnVMq0r)(fPcSR`bo&#JAx0h_})upm8nVj^7I2K@agR zdYtd17x^wa$af=(?56kl9z>CQ>F<0Wea!b`5Agtx;|F;%Kg6f-!#s`m;9GTj@ztP5 zfZ9h9M;^o1eILiq5uN~tPvTdXPx0-%k9YC2I%dJo}upsRB6n^AR} Jx?`^Y{{YZS#H9cL diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_12_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_12_R1.class deleted file mode 100644 index 18c65486b418bb1cc98e0ac77fe7a3e74de0e461..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15350 zcmbVT34B!5)j#KECNFt;Y=c1t1W^G)03)a<2?8Myj3xm|AVv_FBttT0G82~&OPh@oO|EQ zo1Z`bA`#70ADFbCLvlIaqyla?Im{jT^ae)^j+)%b7f5rL!QFWrGq}g#UTIiw@P<6z zD7Twr^k$PUM1s#aA2r75ThITDF+H zm9Lcx23*J6T2nH~0gCe{NEg ze_>K5e`xS84gQr$-TZ5lV*HW8zY%$VYtnjt#^B!>{Ckr&@y8}@=06C(e>C_{`TS@8 zOCJAK{N-;3|J~q!m~^>tbs7KD;C~tXZ-ic(DMRI$bTfwx#FfonWYvJawX>W*BNFQ*Jog+8XR)8dH6Kpf^y`6AOh)q%9O_ zEveRhWlSR@O|j}wcdS0pDj$`hV7P_JZ%+vaFtjVUE*xx*mFOyqs3PpZ4QK2 z1iC`<>@<2}ZJ}Lf#*%v1;gTEKr*Bo?g?g@cPCu~2Ly z)5@aiNHA8?0oIzk0_$QW-NCM2P)<@Ssa;TyX%*3q&S+1hr7X+nH0d&tJSP@tWjZ0t zq<%|)e^@TXVR4q(t|gOVrejr;FzET3b)?wbRdz)?L?dg84iz;E zn+@XfP|@L?Go=I-!ZN-?S7Gw%;9;7Sg_OM@(+F3f*yNcSvRSmBPh?rj;aWULuVz1| zd^PK8&ipK^^y5iZGvTKT!qMh-G0Nzo>S$MM5>aXZZ-Ak2*_0}#ybk9H0X5(t+vSsU zgjUs*FBr(6r`HWdJA$(A*o<|Xgq@NF(y5pBHpwk0y2-f*F&Q1rdOTA$_t3)@1iFJ| zhB^geiTF18vHcj%TtN>M#+Xje;8yTj!T^prAUeyO?h;v1s~Pc-hbBFxpDI(7pdAgo z+W#bcT}IIz4&8-qhi4pa@2_~^e>Xippps)v?yjohO$%7R_#ezD?&O*s( zs8dlPqLPJd-Htmk%^O%vgInO-Dd#c`1;m8bZ7h$pREJvIVh{<9Mspi7au8mVAAuHo zB?B`ZwJ1iX0GX*GgSDWB*OFuix+rO!&`H)ABW85QNxpa4C6fp= zuMK67WjfhCbU+h2^R*>YE97-F+xMu54RsoT-3_Ho=VZu{@}EIUkP)8F`l+Qok$}XU zw;Ldj&*KM46M}1{)#;LfX=)Zk(oSm+mds;|*OCromA`&C(r14Vl{;2=@fx|DBq-;2akvr%G^{Cne}yEPR}6 zCRiC@=3D?F{?EbI1OAm%vedy$3kR3vWN-%jX%?J{8cZ0$aIgao20etBvK4Q3lF~Gp zhP(K8nmjQmCarR5g@u~KQ2Yp&Vk*Lc?rtnTxgUi&U!*E`L82$mnL6-L?9j1GGSumY zLOpM;Lq+5A%ybe+86sOwO1dk;4O;2~c6$*4@@Z8?BEc@rjX0j;LP^J)s7Hx=K?6q& z#H?U`KZep~aXVyccK~XqyEF#(wpSUzbNW-3;DR?{%c@GCm%3Mc==rB~Jr539*ELEk>WGXs* zT&L@LXfA+o)>}ipZPS`Y#yvcN%reSSXQ}F}i>AFA_!EZDTB=6XTJ$aYwxO0-YNlG1=f(uY@CF`4YkZtbzEoBTl5`6)mt1>%PqA+H5lp~d1$oMxoQET?(n4DTL9Qa zt(3W|kaH|`o?33G)s|YL)>`x#{ntD zD3yu_Wkj6>EEUEAszWXjTsTifnI@*aH=T@it>UVwP=8peQzl-Zx`g{~OT|#}HRv^ymAo6JL|nQf`{YJ){Tr(aln8qY?WPqUySy29D_Li?85s5Z%}SbDR%&{7wv zFIgy3RwB6^ereksP~Xe47hCEQb*V+~(odOYW>Xm;0^9TwSEV4*e%YcA>6aG$ll}!i zO0%5Snlmq5!pPE>iQ*Pm^hf%Wp)R-76%1dzQeB0VYpJW%S1fgn+5#9(hlrhUEVUIr zLVu@!Sn67Jou#(P<$Af?pl-C(O>((e-D0TQEVW(TVW~USU6$IR?gmPyk7CXUbhiOw zEOn2%7dgmM_o@4ljx6yKj9Fw}c~@5e z06ca8lDbRNy+=JPTt1RDylitXjP~d=p3(h?+U=U+qtGBIK8B6VU^uM|M+3nABl{85 z%|efBU`CZC1FwY2M`svbk_ zw$xMVY1HkN0VIf)39;ye=4b?`OtA@Rq_osC>e)lh>SVAaX`Kx_9^X?`Jr>T~mBskbO`{vnYZM zQ-2pgBgilvn>JBZI2>#Zgv+~Hd!%AZl?Cvz^dOsq1wA30K%y=lzc3m(J~p8}5?w!` z4S%p@N1#18!QP%tuvDM=nx%FMNZu#ud1yNRwZ+s6cGruRdP(gw)XSE7MZIdN{p#zM zI-u^&Fm$RQvD9m7iwpuh`TD6yD`&rY-BNEL@-gONxx8tpZ&>P^f>Ha`w+!`dOT8s9 zwO=7~e%Dgp6E^n4dvW=`@bUw>`=O!Uw$zVQTpoUGsCO*&6BrT?(7g*6mo%M^6Jkrf ztA1*!_tejlTE2}YG&cvkyIn)% z@W?4GM;5uycy%L6?%^^Z5Q#=Y*Z|h*o%azL1MQH*$kAzDGv8y_Cmi-W4V*}a|}3K@slP7{(pBwZM64hOn|Ey))r z^WBpjW>+4vm2>MY`93D~dPNkNB9_zcN#3C}1czGX+NN^yjrzUl zTsbp>eEv#p##GK&s0G-PGckp-K@b(s*B zKJ50w{p27UFZXb^eWEK+2Hd*ZD5ooU2kM45$su%o)CHEAhm;O5+K1v<#7Yr?N~dMh zS9-9pK1~k64-dQP3Bau;VMw+V4(s}Cb+Gd@5XCK^v+rw-Mq9(d5+t^cXrx3A?Mjw* z1yLvBwWqwuWSob#1)JMzqcM5i1pk23Ghtc*D$5NQ#tm=0ox*M}=V!Ctwbp@|HUg;H-V znHsYiQaDWRX0tkVnlu(Q0dTcVjx0wP^*`82f&}nFzrr1k;kFKNG;b>aY%kDf_VQjQ zMQS{RhxMFS*8O+SSl9!1gTit^kZH~UA)iHe*ei(hX|9U0YC09jfZ=q~b`s9v7!@8T zrv+J`diNfRpooYB!g$>f!AW@}2A}lTE?HBtWNG7?MYZ)+^^I%50_rgM3+7=ccVwm^4na03(quYx;zBKje-9!TZW+^%3pRPuudiicBU&O-YEUM+2) zkc*GTzxch=AXJhcXmQ>NFa@&3fn(+W z?`op*VNjS|1lh!(3|Pyhj{#9Vr5?PDbC^KRXhzMGVd^^lMj!`EFqIA9h}rNW>GLpW zXAfwc=BDBJh0DDUSB&|bsmTLn9Y>5Ep{HnpEcS774^#v{Hw(T}@@ynlL&*+Gr?WR$EoOIQ0#iLkGd+IjC-RGD*iss@@ekWiAnu z5uA?c)JcPuXrfy~cFFAuJ=ufmVF(@UPCZ3uib!}syn2f2^R$F0lDtbCIo1qq}DWxsR+)2bN8!vk~V`Y_CJ7v^<7w__YLx*L%voakSvKWW0~X* zLsH`kd4JX49kJs9k9lz3u8nX_8!hl23%ly1+onof3B@KHjyZ%fA<1?P3~_CWlkQT` zqL03ud6|14eOQHQu48!TSj$`|$6L-M*?^?AhZCnDzSxCn_GzMK(POU$nBJru^2s|He67_d z?<@2tUN`7ZmX|oB==*ruMFz$bomZS7E-sFfic`)W@;pagU+x|<;*{6m%lDa{7pR~y z$7j{WX-Gq{Z>VoroQ6L~BZ{A;5uP~tihUz}N7#d&ra~F@9F0QfD0CkA6c$kQ16(Il zKCWxYLk(c8iN;b3O`}#imD*??wNpKXX%%(Q4>8KJ8Kbx9M|k=%{&GR(9r_8rEQw=x z^ojs;(WaztDwrRgUdhz0z2v3!n%XFP6un13!)T%PK79ZhCgHV#Lu;Nx%P5{2Cx1hK zVwYgjr7mKICLzQOO;(8EKp#Yeu~i@{jQNW9;A;m{Un7H|Y!Dv18?8B79X69&z~r?q zx<2|9{TgGuG=x5)-+<0<@nn(ujD{HWy9$GTPamTt7d?N#rzx)joK?#~Symm=M@Kcn zrsJmWq4Bbyt$&$9wB5DX5c)Iy1#Or@f2F^nKa(_G7ohDBO&{G~IS+u{2VHb?U78kg zL^*iT;n2#^^n^n+{RCut(nZX0G?Lad)4%CI4zbzz6q&tH?lF(!#w}~YMaJv+lBo6* z`V`Yx-j4MrGj|f+MrAybk3ifnrO8|fAj#7f8c%!>3+Ed=%HSgn9t}Gh z>^FFf!DF#D^HDs`(d~VpW1(%Q)-9}-QgErLwOFfl>a1L?V!@5+&}13@=G-uDFP-k8 zS$TMv3+?3}pnxAZtJPfSEzB)696g(U^8hWEqJ=>g8sw%G&?gaQ5n$^{s`SR<-<+|HDhb~;u-71Th0qUuF{sv1vi&!%NgJ)%o8vp51g&zWB6F4A&Ds10?d$^wAUC| zOKgUZC&O_LlByKni4p<1r$AIPIcm#f{;iEZlF>&F!Sot`JC~ETR zXFDfK&#!ngI5g>GKAwx2}UdCi9nu7bPCimpO43HLyGVdhbeSE7t;k0 z_!=&uTlhq}lV@txu7c=mk(y6H63mBp%+N|U=tTS+Li|Kbz9Z#}J5s*5gG)d~5Mzt> zKtYTvcm}9?;CCDNBpo5*W7ElVkj_kF!pU$kgHI7N@Nov?%b2GU!sO^rDEAXs>|;!k zEG>y$$+sD7|5FEGc>}h(5|xCPcTatptnJj$M{5D0ftsm^?l?8oPTxz|yox_M>YpZe zj{3baO0?Nhnmf(!)pk2=F9ma`Vb{U$^wI3bX$e{uaDXqF`+e1p#+^Tt?jxs zEUoQv>PS#TTBEwPQ(B{Ox*$Pa(%P+CW766kr=A4$N^7}pT`#TWaoUiejncYFw{Di! zO>w#~K^IBu(Csv}7)?VH^rhW3C?(+!m-sG)<9)f0E^G9)_0i>!{fY!#DZ{VQM6MPh zSHM0y~eM;@L}xx4_0y8`jNkj8N( zlEq@GqXDMLuYo%78C(;ObtWLp7hyQaz8Og**>j=K!?Fb2)ei#PXF%r^m0-DlnHJ3z1aO z_RK}8nU$C+jy{ow=YCG(4PI>U8Sv^)Xy$(?uTcM6VsO=X+zo|K<0}T3E4VWex`R*C zIgTl%ve+?KwiLLzdmr6X>dBeqEfkEn_kNn_M**>y?o+^$k?`Q8|K6{t;c_qUI{41G zJ@i1SSG>dTg)3hvXlq-?M%!M>(%PwqN2RqhPG61F?gTw09WmX} zEgi8qJsqcK67;Netk)go(y=~H&&4T@0z^7C>jgGR$L2UC60}EJFWXM2V}>F=_llI4 zNuGM%PCaStJ1T{JkCb}hE=a_Xsc+Z85422I>m{!e%2&tfYjJuZK`#pNt-522bZm{& zOL5wlpqHiNdd9{^luO#SIX}x(njgy@&WBa?mF$cTnuVepv08YBQhBJ`l^?{Lu zFXmhLR(j3x)%&Rk7Tp3Q*$O1N4xYFTNOC>-`35=$pJjX_HSkSzF5gV6_!a>Et<=M} z(S>|FlF@d$k?)`f`A&L_@1hrY2Y$_ZH&EmrdXMh~irhzkdOXTY`7z+hET=2&b9(RiN0>u@Fj{F4mY#;ft^ W!+JaMqtNqm@dHwItGa!@|Nj7)=FIm1 diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_12_R2.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_12_R2.class deleted file mode 100644 index 4f8ddbc79a3a43b32b11f96aa948d0c86635c83b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15357 zcmbVT34Bvk)<5Sq>1$sfTd+t#78S4*u!4%xB2Ws&YFm&NY6Zcx4Q*_i)HW@f>$r}f zxGO5|!nh7@3D{9_!(|qo%^AmWbjF!+7H8kpk?()*dr4kOC7q8SeR=OL=brU{&b=>r z^NVMnC!$&E=O(?vA-SAuQUSM{9OjOEdV?bdM@{bJ^Q5`U;O;z*8Qf!VuQaSTctaj< zl-o@*db7#r^92T9n8z38^Tm9LG=9b8OZftm^7%5kTyF9ee5FZ8@KpwXRX(qlmMtc4 zG5J=$&E)NTyTNzJ=bdudA(y-4a<{?v6!5)# zpIq)Y=~#Ziq^bO%!8=Vlo_Cr2HGaq>OT>MHAC}7_20tnTACt>AxjZhDzb<#XWxx}8 zJk;PPO)BT7Wa`s-JS>lgOV=|7$4y$o33=Efm%Ro*Ytrf5Czo$X%X4zKJD;ED7YgWZ z-dDgc@=J1g+2B`%-m5Zdzi|JWTwa&U8*+J5F5eWbd@G;7&EFB`-;&3-4gRi4=ZFv% zf3JYQ&->)=2L=2?e#fLa{3C;ZZ1B4#wen9)YUB3|{;9$5o7B!fGbzj;82q8ZuzQq$ zVNxf5WbiKy{*_7H{A-h9{IS8m5qW=W(t3W%;NKbidy_WtCnjy?KM22nH26>X{Ad14 z9{*MRpe;NF5ldk0dm~<6?YVcZ2V zrr4zG_-aEbL*5fC`k~RAbaw(a1;8 zfI7ldPSehjuJgU1w*x*>S$qM5+qcUO*KUwBLaU40acNyrmA9* z_Y26Ura@8>a=NTP13{sVHB?ESI?hlt4K<4?Hymwk4R$e&sXjN*8z||Cg~BD$7K*f% zRO`Mnrje1RSaqm7Rv&1UkIGOm+`{Cyr-TC-+7(ETirzRL{ zi(-PaM#coY4>NM-h9aTZJf@tYsVkX0715R;)3EALBv{+i(G={e4>X0*;;W7}2f`}@ zT_JgP8a=VLP&d<@>gH%iNq76nbIvPSAMFaa1Y1I}lBS;ac6$7%S-jYt3DOb+MA}U{^0FJJe>D)Gn;Yw2Ej)XS65MQkG?Onsk{+o)ZhSG98;` zQokj@KP;ExusF+X*OEywQ?s?S!a`OtT~xBH*N_Y zfQ^pe%20O*o>?A=L}LN%PfTMq+Z##(sm7Apo^V(^81#J2I#O)zD!ZZ`qLH;l2aB48 z%?5FKsOZqnnNorZVHw}St1x+W@GwozLdsr{X@o0KZ1PME*(}=6C$cQ%a4nvrSF@i} zzM6G4XMUDd`tc;Inefwv;b?Qa7-e)(b+oHBi6}LIH^5N1Y-$x#UWfC9fEsX+?efVv zLaS=(mkeak)9Z$!9YI-lY{t4x!cNIT>C{Vmo8%T0-Q?VZn2e5QJ)S9>d+1>c1Kq(g zL!Ah*M0}h4*nSLWuAm1BV@#)Ha4UE%VF1S*5S?XCcZsa1)r@$^LzAA;Pn9W3(2fRP z?SB%!E~DrU2l7*ZTp=)>^j6-$#E5#{1e4e!^~wV)P}l=cUM(%tl)(z2VnLl`XQN~^ z)JdoiQOQEKZpWRN<`1lgDB;UL2l1T)b z*M_pkGM(TaI-m)i`P!1H74kZo?R!+jhB_I*?uJsPGc)8!`OhFF$Ouno{nXN)NI+uF z+YOM%=P`q%3Bk3}>U7D#G%X7vX{WUZOXjh~Ye@?ItfA&$Uu39KcvdW0tL?1=@X$E` zIHyD09g^BB#2Zk2HNlJ`)8MF}X6cThhRp2^gnNQ;@?myT(ZwXvBq$cFi*^M=tq~;9 ze*Ja982TB@6}nPUeOp&_y^|gdXD-tyv0%FP+t`_`|4zzWaITAzQzf{}lM-|u7CzcF z6RZp{a~^;Y|L0=s0sl%WS?XY>MT1LnGB^YNGz(5e4JM3WIM@LPgC0Um*@`ziNokr) z!(IG4O`aGOlUBL3!a~hqD1L-XF%{uJcQ+QF(vQO2FH@DfAkmZOP8)bAcIen88R`^6 zp`JI_p`vklW;zL^43RA-CEXR_1}${~yS<12`LwDckzkkRMjX#^p`_zY(xb$^pn<~% zVpcG}A46%gxE(UJI{>v)TpELW+p7%VIsGY1aKW3fWmP56OI@_5t2tPS!W+!>+mIY9 zyD^KtOW(89e6_$*J^erHV3tR_8ObwMbbQr4AQcKjSma0;xF%=y; zuG4irpdcI#Ae9W$yFh1*)HM%7yMZTgO(mRf3= zIs-Ln)^!Ehkj`wVgw74M+){O1XVF{qwxQ}Rj;R%vTB#Zgb*7~n)mfHWr4}Oa4o%v< z3xH|VYMFaB(vGFps1=43poq6<1k>62wyH$;2+zE!;!7J*pRO zbZDV_dibe0yPnl+AQyEYKJM|J*u^`f3YSBmZON;(V z|AHT-Sx#%snU}6&Wa-O9aSJW_BmK!xms{!zhA&>Ju0qze)K}HjmfE7W0*TWhV&@!7 zT>~GXztcY~b*g%%PZi`Rj({a9*cAZq= zW2h%A^`v?VrF&%nIih7^EIP3{8o@zRY+@QIE%mf|=3uirNi0cPCq&JdbjZ^2L3&Mf zG=kkjf3J~NN05Y2+cQX8)U`#s2C#*0*7Vk>y+ZHVL3)cFXh`Dy3}?4%ihY9YgF>3c z5hS|)E`UamVLB>pqN;E>*cu3zceVCN(Uz(V;A81QHU|rPLO6s(X*_;WG;&OAVtXXI zeqtN`V9Sm`dvKz?Lz`%+Z>Z-iwM#(qKFQES)A6q@rk=OEUa-_Y^`fC(vee7!6-&LU z_FL*Tb#I2DQ#FaDURPUX5a7wzPeoceuc|jJ^(G=8V;+*rHx2bIOMP1~>Q#lT`wQA0)Zfb%jfhW4}aOwKa7UnNCVel1A=99P(n9If$7H^=WYx4vEX{17jF3 zZPwaoT~BkHKIL}tJE8vo`&8RCB8vm24qc!TS8hvgSP_7(R-M{QbYe#GKQsiQ0Mn-_8CiR9z6qqFIyuz6=0M&tLBwy>e04_=1p)>^NTIJfNa`=t< zz341CJ+*O6$G2U7coQ?1edg_j3(9#m-tpmx`#4vy47h`}kxp0f4%`iIlC$Xgs0%PN&ng{ow9m$~h?OD& zl}^v5uk>JHeY%{59~yeo6M$V!!jNn$9M<&_>tN?+po&{SXYbb7IbUM{D}5(r{#Lx3j`Lp;Fls0h48RaFwTGUn7kq($&z28bP6AFdn)d*yfYRqa#;V`+Q&Fa)?(pc04$kjGEvP>xIf4-9h3SfqQlRF&4Z5`l*-c|tEUZ{`m z<@HXA)OZLF>p5?(`|qH!um|o2h2?-C)7$|KIyMry0&8Jvc|QGYwN4(8`pxzwUt$is~6S5 zK|`s+V-(m;=ksJi0-YFbf$rMi1}Fqx1$XpB^h0J%kjkmKUBQm1CF_u@fXwjm|%Bd?2^&!)27m5XYgOOMX{_N8S zeE*@RD_GYVSRYv|J(Kk9@?fAl8UfLar`(Dab@fYYm`--r5dQ-~s3bqo;=CGQ3S^4| z$IAcT)kNjPpfI}-vWY<%u$D_71EP9LJ$NVQFoB%WjJhYo)OGsBKn|8*DjUENv*AV3 z=V8vy9?&@1O~dgEmwO+oAoDp>ljq7hju^W_PtihMeiThzrEzVQe#{GWCyy~aMT_hK z@D>OOF!W$75{S2Gl@4jUqROl{VRV4B(NMm;wyJhX>Wel94}!^aP~qxil8%v7%`0@u zTp}hTI33fe(*`ZkB)5j_vfCAUvJch65IWeQdWudHk???c^%T{~gKA!jC<=6T24yRq zt+=$=akj_;a^0a#2+%@Ft!Wlh5u5|(?pN<5Z3b8De+UKZyRb&@9prt7e7iy*SrT8y zGRa+rq{fx<8mqrMV%Gy6^WeN)8{wKZTHtjScGgL^O_jM4icL5ma|mTZlI5aC-d~@91?0AZM$CPv)7m1XwxzFUYKrqduH|P~&dXsXv(TS-<)A-V-sO;@@8f9~85mD=c5#BZxHwKKPC0wX^9*@?xqHZnQ(l8F-)DNB zqk_g9pH&y9Aq~a8p}t{p8vYE8D1Mqoc;e(M_Kox%W)FIj3T4zYGzy)g(0TY1SU}Ma zaGgT=xSm5EY5-$RG?rRuIYl)JEB(=zaPbMhmSE=tIyj39k+uTJs%RM)9;b z`5XEZyBL!$aS<~#2_a@^vO)}p`XC~Vtp-tH%vZbz-#(c38W{{_gYekhXwA{;u$kNf zCa-bP_0g~B*BIlaA@ni*26TRlCyUhQG{m6aRT%Vp`UEYx==lRaO?e&QtXdArvg(jN zI-(Ia9XD+cjh6*&{mT@h?XJa!(4XlqXu}lxEBy`qnWXW`0Br|pdP0BY+z)miaM8_m zXl8L#6@ zqS{aCGfZQ7L)M?n*gbSqf0aG=C1n0gUuZH1pjTT>E%?j<6FzAE=$h&K$(+82Cha0m zj0Fh02k zt4&FBZ+qD5p!9}oB{Q{>3G<5tUh+CCG3Rli^x2~K8Kt>>bZnzPcQ4_6vV0uJl%ScV#`HMN>Z9Wu#}#@Cy$L!YPA8V;`SbSE zk$q$}CTMnPzCX{OzlTop8^!+o1f9H(=ESMgZ=~a7Hk_02%G3+w8UpO{LGICrpz)An z65yc>ps);}umZ5K296g*kar`n1xD6Ef;CjA-BG}&Hzj*7n_K`%hfs(u9s(`7^ez6 zFVfGssprM|85Hb(zqyAh3-i*xTS+6p^{=6ikD=M$(n$Ip`GH6i034G6A*BF}1qk)U zh|kpsvj74uj4(SNfwmQTyps;l{hXt1vk4jq1N;S)3ov?#MpW^*ohd8rbgYCnt#gU= zojjf=z)B-S)RxNyH|*6EPzXoUP*{`6#3zi740t%#fM1 z*BDq!Y=)1c(ak)GC)?&i3iZNZ$TxNHOr`3Ls-}@w; z9j7%7es7%Cx>ct=5b@;YBcQtRq6x9Izq(9W{~FqotDOg6X0S7pD1SFqYcJ)GEX9e$%IcS_fuHx z6HJjTEs0&pHyUjJQ~P0g1Gc&Xm4ugfPkWK9?bOgm=Kw+jHPaB?acZiav6rxU6@PTp zKV9w|^?PNMXtSj>ce>xJ?RN5B3g%G5t^;rP(VWKV30fzlTep+1kJ=hBp*2pS1f46b z?YcEAt?hB@NKiytqq?+O1n-(%K!To&@zuYq@S+FRkTq+K`})(z;2v zZkES?KG_zO+yoO;qDrglJJL%eV4%TzS2jRHu~E7=rYKDd4jHx;a6%R zR|%0T2`RfLSc-%INgz;J70iRK9R3e&_yt~RJJ!DJrK_)4==MKyFGlI%6S6upzrNsQ)cBxN1D^hQg=uH3Q5Q+?fR3 z!Kdj=$COf8?3gE83f$bakM1t@A5HS3fY?j-DqzV-cyQ8x?^D!pnU{AR zcz4_$y1&#b-r@Jcm9G%AwXI{LZ7=2VdRS%?w6Gb8`+T701^AKIW?I4*Qw`h2{c@y< z6ELb;Yit}KrADWJ@R`&JtXKiNVb@B_pv9$-X9#}dwhZHPXbjEcGtlOt8YUCQJ|?KW%V*-}UyaZpzOiJZLe6N| z6cEMFrchzdc3SQvB0&XIQV;B<2bnZ52tH_3o`D;U3OfPr0uj43LKn*|zIL;Z9s;DJ zJ^(IEm)L0APKABcDiPBbr-$S8NP-@fj<61;cIgPm>9GVoF0Gw?@)01&}DnU<6$9mmSE*N&d zNXOPVy%48;33^dFuG741laA}+^iqOeme!lL(>U4bGPb|3H0EIU{3`ap`{AU!Yd8Z* zULP1q_#(cUZ=u&5U%iitV9_l=lC40JYvGC8fF#$EpRcDQ@ma<h?$Kl77C-Fo0!NJc_RXKZc(uJPrpZHLnHdg(%*nK2dxmlJYqmfM8QerU;8Ou(nh^o;+GITOvxujF zgE6x2x9PTku0+Qy^5y=QCfdmou<|MK=)%#XM;B_iLAV4p+#H1sAsWv%cpc6JfPa!f a+jtE=eOPZNej9prE`CRI2TfYZ z56RubCV!pxn>2|ZG5COdJ}M)R$+O4hg86aoF}aufh@fFYt>dS;Fg^{F1@nlh2n8{=P}``3G|O zp{)9mtbawmzA6)boXbT9|HPy!eoa>YG?ypm@`>{3X9mA6pFfw&FARReq}BXOxx6VO zzmmIG^Z3{Nn|$iwxAOV7{5!e)-rzq7sQ-~!e-xVEmdl^y@@KjHMJ|683H&XO|IYsq z(*J4lJNz$`|IPoA%e(pf9=~t$2mE0^wem+MA5ml~R!YV`%2ytK%TQiJ`3#j~(pJ9C zP==v$O=_3hJVTi#b;xbLp)8X+<#vdnhMKgUugg`#@TrDFyK01tJYrH8KMG8$AYYAC zqYPDO(q$q_OO4J~WB4t(8*9=+rV3J!*oXCK_szNmr>Nlde{i4RxZS zrkHfCnrhN@YMP;@8)}A0H>hHhZd5Z3RRU?NQj>1t*9=u=s97f6s!lSgTa`m(YPO-~ zd=lp%xmd!lb(ujQbw7$WW&lYOzW8snbomUoA0I zm7$jA(@0fq(!>0yp_UnHxk(3v^A#oyRV!i5YL%gCTpJF?%G*I&Q#7z8R^Azm zZU^K9wDS6;>#?jl(%up23O83~nVkY%DV%#^fflBdvMd^a0`x<3NeWA{tahPHu$f$~ zxfK$!vgv}71>XQ_h0XkyV9XY14NRjVn@H`cl`~y7*AR=sO2u@7j$)=~A;ST}WF>XC zEeM5{Wm#93(DWI>UBEY_Ar@%bRu|~d)`v8O*bR4B*99`#gJ*|2L$J)Ma5xeRXnSHB zugTt79!L(B*LStGi3I~*L6i0ro4OUzNV`a6Q}NNPW+8Kfm^?&uY~xG{L4|;(;AkvN zKJ7eA)3SiF5i*T%If@OQX+t)R4zP(Vs2r-rax^ykd(u|3VsqAK!7_j*!Dhlvmxdzk zK~c*1;@U{GB@t0Jw?&$^mFtI{8pRSj#Ux=Q86%~v=`0tlOXU`}nTt=o1aZQRGzke3(m_z$ zg1C}PK>C3bev`qmT0&;Ra(E{b!vpyuL@yPt18@F8)|8VjqpZ8L7sWZ$jVfm#!*nm z$?}9RWkl-C5gTykN#b@XH5~}lrnPL(Wje(@HKYEW_1X-Q7;@X2?0b~YhJry@?wH7Q zP8uIc;~OLgY3}0SPonmQ1LCwZ1_=ucYrQn+oX=F6C8TVSplnZuqKDXQH7A&T!%!Dt zw}JhWp)N*fgX-2sBOSqLY}eU=wyq$mkgdfTDLcwI*6->FR%V8qPi*ViuJwh7hvVUM|e`g1m-M3!J?x3aNei|4Uth$|--68e8Pb z-fK2*MFn0d3=Bz`QAkW^(ecpa#(^3K;7mug8rCoyr6$3Cyf%HrO_Nii9ghmYfT1qY z+tg1oUHX5ZJOd$_P5R?3Q$(2?i`45du2bo;D=SnFI$^t$s}A;dkoRszOqD=0I4IZ& zz-dw4Zg&Df{+38I2tz{=3Z1(3&=3^gWdJX98N~Y5Xk>>|Vj9j`ruoOCtt9m#iYcy@ zz?eb2qPk155l8q=h)v=O)3U)8gE|NuB|RCnC1?cOg6)Xk;5EdQZIfdcb539z?jqh9 z^2T(SONdoQA@im-2zP`_jMZ&{&Q7pDeE@_-E~`$Hle=)&ix;`g&NUU?GISFRb(x_) z1uxrz%HL&csoO-QDPpc-3psJ~nfZ&)(!ilHqSzOI@q3%ZfK;*n$^kYpLti=Pi1Reru>3 zEOn#$0`_iM@k*>h#dWdYhWe_d?ofAH>TBvsxZ<&qx%badmb%MQcdL6WwNKq*sCzASpSmBL92tDT;xXz$ zOFg6>Hq_TGwO@VCP+gXKL>&N@L1|JKT$XxNJ!YxL1 z!p)Pgk7LuWtBkdg&XDYzg!rdWvRUeBb?lQYialpZYLg&XziX)%)Rh+JFq+CQTIwZ+O24OG zMrCWM@2ekJ>WAt_Ov6(yVwVS&dIc8277wx1tLn#=`iWd#lgm%l&n)%2Tz;;8VW?kP z>R0O5mimoCAN#kK`kgrY?=AHQ1^54>dfQN+6syGGpTwB{Y^lGfzZ&XqmioK;hoSyy zsdv=B4E1m9zK<@(fHFY?)>(8_ptBV@&Qc$$k5B|z>WGKn6doRAG+(+) zIvS%>a@O%dMkO|Ql*c2`yx3eF+f3{@AnU54(Eu|4_zWQRBMsN*$q~3l)(~#PT^8xm zP57|`fZF34VlMm^5c9J7m<@3S@+OLoF#`bVVS&d{ct7BoC|U;0fidVAt?IEsrdh0T zq%trNC!PpE^%qaRptLNGa0j-hDf3B|)P`q>*8$C#Cv7HU2;{e6k;{wq$MyiKFrMBf^lve{y0D}O-G;vuZJR?@LEgacV)QW#l zMtfjeu*mMf!GT|Z|EMEU(+y4etgWH3QX?Gk_$|*k&v?Ugg5{aunP_C0;hAZ9N?_XfQfhe0 zEYB>EfiL-TIZ0?Km%G`9XO88W>lrCuPBuKJSe{d%1R#doT$$9~{9B%Rp81w%foEZY zYF&xCLgDz25mbF$LlO3dDNa(keh|lJX!{Lf^&NW@hLB|3<39@pq*soKhQ@`H(IVo8hTsOB=$?7>gA`?shY zj~&RdCDVtESt=Esz!JU4f|PC7;HWbYiy+4hNe#k$QSW9VbwF{FO0cfg*z+Tuq!iK+ zZ0d@FMwc>*Qcn}urd7>VP1 zSH+Y7??4)Y(~>H!Q#s_s{q6{bgsCNg~6RJ*}q6->t zXJ9*!e&TqSW^cJ6XeTjY8xIlMnoqdlymXysY$Q0lBG*O=#w4dPs{-L>5mqsP494rR zjMt*n8{~9p*Gq>gOQ^6}(UWly39@YGYRo1~*Sf5S%kG^%C_?wtwqd01OeP4G%C>k{ zHWGA{%k~~c8t%ahdJCer%bPQ5)=mssu}*dvuFrbcM_l8qVAHnxNK9UTfPKIUwQkYbOLs6^?!(r?{r3Mna{W0l6ELS>0T-kZ5#eHQ5ws5Q%g1 zOhv`VFy)#%unDGLfGR&OXu|7R$FssYKhI#x12hGzL9)|g5rcp|WY?}vhVsft{pOgx zXd+B4C7h!emJF)(Bob;c?y|LRAf7YTyPCa`0F|dp9#GfQ7$onnRQ*%?c z8A6998Vt#%+-W`98pkTF2W!AE0Y zhX%O9jx1|Kv8Gm>*F&#*|KFTR?Ixx@Km6I=8F8m?MUF|$s~@K7jdB5&=J@X zUM^3j>f3d}K&N!x^3%TMRG-zbeoYH(RNiG*7Yj33WY&b`1Z}ZQeZCKan+;1E1aduH_Vo~G z+40P0I{m+()YT^jLWYFKrdfP-1WifZtHt9PBJlJS*gZKkB4wNJ)Jq_NPT&&EA?%2eqF z??l&ZW|au9=<~Rh0nzD*%jiBKge^rJDqbq#l$+#s=D8U06`!kzas!=-#;Lb>nN0E) zBLLa+P|;wXP676=OY1thCq)dA3S&dny84>>mC2W`kDdgXdaz2@b17Y=!KrkKGLc(S z=_1+N)O<~Ki^|@byCS*vFyR2KuNFR5J6{m~y~PdkMQz@M`_9ls2p@$~q^2+>5a_b}_}(kxOVizghRpoptFg58dU)GS{iG(+@YdNMGDp zl=Mlxk4CFn4otAjK7McyO7aaSmL-|c#^MCUl5CkJVegV6k`OcwX)6P(YpZX!pYz)A zAR~XebDYkf(_=O}rPu5%GPcVbE)wrX!iQXj;s`z`6y6@$20KbiCXS`JnaY;#> zRGd7$3DG%2U@=^;3i_&ZQqo&{hPN;Ql@rvLT$yq8uz? zlk)*G9W;))9WkYe{KSD$dK4mm%mp{cC30a0Qj!CD2UeQMryM2nC&AlOE?|Zuk(9`p zhw}&rSTjC7V4$G1m!{U09VWA^m!|C_ujfIGx+Q%WL_VkC7TGHtE5lkY;E{migBV6} zAt^0$=;s3(Zt&0(^U=6P|QHP46ZNfkN%oIWaN>ZREgMp>NZ z^wZqN35DK5Uk{xer&B6&{kex}dOul>J#=bCo$269HLKEqyG?jivv*{PKoZg_-^h;_${Mm@;(~g)U zF1!USG|)J00b*M_lFaYm6LWiu%k_6au%C;f zR(Mn9yBcyLL~kErj0qW!ghc%akdqJ~r$NpqLmm|fY1Ig7tKck~;Bn1#gd%YF%OI!g zS-Qd}X$hP5&GP$tsivP+H~PILe#qB0=`;3o%9M5XK^XHP z{FpqPhH(KE@+cYyKcB**X(o@MMKCup-NnE>1+0i*B(^S23SlvQ$O}NBNvH5au7D7R z!TBm7Xb%+vhJ;bC=4B}HN3_Ub{C^r^HB4|ZOTa^V;H!}d#lQC+WrFpyU`rKVa9S&O zy;N7>^ZO1{3?ud8>xb#|5gM(?M#0vm5@rIIZ7z zJ(WcNU z9&?C7-88J9wjvR1tMKh3M6N^BrpMYb7M8I(8H?z#4vbwWV+&<0s>eDp7LzeJUsq#4 zZO8W=1v}%kOQN8P(?z(A)5Se>$Zw3wL!v&Y zu9R2M$-I(I=T!*sH3;{s>0D@{g=-PK>gZy~YcC}A5G1u9@<|xdBFIN%>7%vDyXNHG z&g9)*8t%+1rORPRXKLLXNb2T*qZ==NL*2+5A#c%$)S&jrxfl`6O(5e#8e{Nzu%QoV zhQa5L969m>nr!eV{sXVDRkaC|FW>+c!`0QZAkF}zyHWf3cz@|3vbt$QKV1gFeX6b$ znITS}7KL37FNTsF&1u;=UhI=u;*?iZ7mcc=v8|3Y8kyMPS^C%=VbI+J$jvtUK^+Dd+75rdV?OlQATfw(-(T^i!xfJ zM{knRsyN-;L$}E2t$MUuMsJPNZ9R0mj1KLl(h>{}?V&I2ufr|?VdcvOUqSr(YCql4 zSg@y`?gZ~&>!G`3`rR7HJp$zJIPL49du8-KJ$k>4-WR6_dgwtJeW;s8^wYzQrG4~u zrXJcagO7Amem@-m$VXAZq-^pr7$RH)Ch19;B$V>+O|ZfXD2F$r z?rTC;Xr>9gg(|s)R&Xnw#UVO}x5D?g;SUtF(GG5>OF2x}a)iFf9rQK6knZOw^>HU1 zCQy<=GgqgjC*wHfr}P$jZdGXka$Ii?oBn1F@C7MJlBQ0PJUoXD-95fwl0PS`YH zZN*wn#uj_!w&cn-c!${ZR2rW15lz%a-445ckLJEhxrO?_H3o+#78Z^g3X{fLWlr>& z3faM==^RIs5`i9HESo{x#1B$Wh1WCBS16gL_fDGXM=9DzeF_uny(Q zDVTMkme>R&rYKAC2s#ro5iLST=rHhi5`S^xQb-VQMB72ZVI;WhGps+Ab-{>Q}=dI&HGM>*$#Pg?6B1o)wTIcx^xjiVihfo-xwA^>( z68;PrJp9_QdI%ar#ydJtGgU*8X*sJh(be&-Tz^8NE(Vzg9-Ci_>#)`gRX} zM;_d$AKV}hZj96Oar$l#y&w;6(hsWS!A)^`F-|X`c9jR+8o{mdpgT_A>!Fur^p0+- z>ZhUb)$a?JcSyDK1G|7pg}w>GjShW>Dts^(lyl(ehe#i9Xr}JbIPVtF_r&Q(aeAeP zUKQx~>j(GAgZtz3<2e1KhhCEh4{Kr`k_QjR>8CyPGZ{V5O%tR^!RTDP-snN&j)+L$B3SZ`1`1|<9@DKPl zekJKBm2?7v&y}FO5LLfaV2UTh?02&?P2Q(@2wI&OBbo!J_zXhDt@zf;pM?v+Y!eQ} z{lK)x2{Mu{ZMauCCGcD-$oY`)M`xtwLR>+sWo+Ttv11E$yn(-5t;eUli}A6A=No(t h+By6=xUAx9`3ig%0N+z;BwwC`KOdvsP;V~r|1ZKwx9I=? literal 0 HcmV?d00001 diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_8_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_8_R1.class deleted file mode 100644 index 22d0efe3526a86111d3586350f84391aef469af6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14837 zcmbVT34B!5)j#KEW?u60*n&X@WKkAF00Rn$0Rtp}29tn<#Q+MEWJrcgW^ghI;957R z;J%|`6)R}n(CQ=@MYM{o)mCd=yJ_uWce~k7tn&TOeQ##ogqY-4_~p%ecRBYg|8wrS z=gqwO)iVc(=w$UXlMZsdT!JPIK++lFd=M-6);sn;hd7 zgX7uUYH(W)Z{p3;xkWlJF!@4mG5I3CST2{Cd?|lJE|-~nIbR`{D^0$Nx5{Ok$=~Fw zb9g)NFmbs?97Y4Ec` z?>QNDKm>SRE(hiEf?Qsd%lAYvFXiydd`S3zMIOIz@DEH{EkaD;S9AG?+#z?bt?>IhgMXjHpYR{D`HupQKN%W_1Sy`pNizdCf&$~P0CRUI8#}M^2mc1T2(%|7^ccrIgnqO(1gm( zRTg&`s$VYcR{iBNz)%CB4mHT+O)5{c^A@zB28&+ag&x!~rpi}CL@jWDs5;hELzQ2& z@+&Ap4KvknbsSWnMu;+?ha4@e8Yz5?f|zQwsg74Ch}8dplxmEr#;S25^k)!KjTdnb z8|p+^zX1NACK#$PTTL|7BtuPR@`a-f4Z#@Gu!;?Vwm?y9JQOaHwos&@s6zM6Vj3K& zjaP(P;>!XJ^06=!4A(RH?J3~^hQ@;H!@;_Ek?z8bJj^JI1q1OQ=2QmbjZsW+*2tJ( z_hE)_b|?~xmoQ}&OjyC>DT~$znFdsZBEhQG=GtIvS)ewImb{8+T_C(75DUq()98se zhFX|rR@6nCi&~myo_2oGrf4i&AFL0>i)ve&n(z^*4{VGFV@09njp3r|jiH8Ud~Ms* zwKLZ)or>kn1)J-F8{?s9q{UDt8LEgWAN<#Y{qjgWx-1k9E{McK@hwa>1r?ECyr>zR z)x`qq<3%mOSQ`jC#EPm)mtj^}w0UE+HBvvT=fP>hvqbEyc%Xr4a?f+RECA+VwG?|3 zdY29sB#n`vy%lzqOpdgw^t(cAVh>`O(Fukxw98NdG^HahvLwUqmQ9ZGgL9+ z`Ff;3F8HQ*ij*~a7g%E&9tj=A0AMe?L_V$ZNF*53%m@Y@7$q?{R*w>hK>^2f$E$1% zUHC~G#SO|-whwBjyA%e**{ir=(+~Z_ z%~G>1b-F4s)ErCARr4%*g}x8)x&m-_QB{XiJGdCC)KXq}L3! z1pBC^&Q?n;Rjrm9Y8gK1LrX2E-(e51)C%APpvi7I!guALPJfpRIRFmWA#O8IxJhN9`sdEF6(h&QrK$8rm>RVA9ecR z%5snrSgKJbhSUZaQ8igAteRo69<`TJZ`eoX0^qlcj-N* zsl8|yzKip4k!zzD#av*~uV7^Q3;mU8T$HR zGt>>1x=Gz^saw>omby*dj_8>#d7K$&X@u`v>JGINJAfkq|UCAB&~NS&6sq^(vS5GFcr}V;!sz>NUI~q<3em--waXR7>#vf2;D5?5Nn?h za!>XRD7J%POYLGbyIu45U2)mh)m429G7BO&>U4zw8bONbgtU#ykxe!P!t-Jct&&8g z_G(}(J;>&wv^9h(AL^GQ=SL$a#z!|rqMJrH;t$4b4m1Tv+Xt)BmU>D(ZK(wK#kPYO zd8cfh{nG(J+fB9GT^*L%ubwefr=^}%&spk#dfrk8B{IB_VewS9V5t|?6*3MXDzA&W zw4x5E?^)_4xIf0+E0>oIb;we$NSr#LzHg`>Sn5>?RR`1$4fUF(UKdUdsJ(JQ*05jw zSnl31)SH(2iF#Zf-ZIorE%i2RiU$-6#srQpy>;2lL&*5LAwW`YM z(M&ValBA<|@6}YMX?>Vjs;jc)D8|mS3$w6c+PYQI>ejkOT}^heJF4pdyL#*z(eqxH zDxg3guFWlZ)`TOvT6G>!q_^?jd^ueXWg63C#I!fO-rQNIEXh-6UK*t3sA&b_QNX=l zx)C5mHk^J=AAPWIq!m^jtZR*7vvnzJbhjVmKN6#DHZAb4jL0|aW83S!U#mJ#)7BgQk*aZ#yWdqYm?qi8F*;%;zmlK0rHnTxx6HMwa zAMCh>qz>qwx_}&{#=F;Z4v20+Qzv7Qbbhcd9Eb($oi`wp-E%W}&3MU?d@JG#Ul}h< zU{4gA=4s_iVH&A=!73?m+5t+_vQrDsvYI6ekh!>cNxof~+YK|Tk2)W^MN9IKdIw{h zD1-GRbq+91>AhBgU{{uW@gV|mZEsk&Jz^P-xH#}-l-WzS*m&agneLh{(|Vx>DZ%2E z5vsC9E-QC;gt8r4r>l-v53H4P>9VLRE|g|ep_~|CS95!=uB2!H>Jz2>+G8AWkG8px zblBm930(AXdIq-L>^i5LhG?`Q94taWZjMHZYOzSsl2{OV4&IE(%PuLyH3sXNs-kgu z-CmK=AsvV`xVVP4M#+(YR3>1Tl=?p<~AP#iFh^43m z6qJ_>aAeGxfk?eL!z2*vQ5~*$3I2Q_p=tD!by6?4m{#_tRpBprWb5rMO`0&4G~vEg zwT>X83cA)Hk}d)7&~Nz$Vz{jU6ohT*!E~vv6wAAX6seJrJiV88J@a8<50D0JWq}~m ztZpJe&x%Wy1ckc$m_iswQnGHp-p+y2=l(-|P%|_yYqrYnL z+Oow3PXK>q{{Qq?^vBUr<$ljoBVocLvL>Kqn1?`k_ z@LI^>0lNxnKZ7y=P#u)wbrx1&D(=pdee(m5*w_jZGunzvxJc5gdx$V`8L9Ykwm<-Da; zstt0i@0)}oActH#a(U5+TnDEo^H1rrvD z9E(IGcn`eSQ&24rDzFy56WF*hD96FxQYf1p=a>gk@an{F0=<^d1=@45*`_nulxt@J z-Cg`TX*YneYefZN#ubEgRx9;%dDSnGS~kOsWs>=?c>M}_WzrRqNXvy?;5W7f=*&pj z^|OQzyh=gRlSFbV&%?x=T2y}=!kMwluG3(M>%5n&>Ezby;*K*fGh^5F7)*0jZk@`F zxn3$b&Ll~f)7nH;C5Z0_VVYem(=0lT5|1OvX(=Hz05uFyW#}cSxVN7a0lkD&K(MGQ z|FtV6Ibn2kE1s@$WQyn1L(CSbi#U^vHZj&>Nh#rzE=eW7#&lmO(iUxkHSxuiv>F`X zxYOw*mX02kSjq2=IX9Sx^C8c+3f5;ag6HPTrWqBk+ZvU#AN z&|7%=DgJz*@HV}Jug;--j9%fj1Z_(CCW6oW^eU!qjggmHG_@i2D0-hhz-XcMGx|Ab zm{R@jN~>^Uf`)XZbrEP?oIy({*tCSI&_ZDv>j+;(corRc3p?o8eYmlO_vyxME&;vt z5&atdALCDYe}hj`s?-jlVti@=3nzBa(5{qj&S2>G^a*AQoj=eYK`WCcO4w*SN@@PC zg6@K#_hisbD@}M6K~a3~N=uYBtSha(p!Hw|En8aQ(N-GM-{@0^)@k?@S-l`N{1M!^ zmG*>-jMqU0hSJ~ZADG7SYNsoi;T?2bSB)%(qulP|2Smo@tFlC@}T$;m6HyU zIq4}HxtBay!djLFvkkLn!Nzl%?r3{PioHDgKl&VWywr~l(-#ovznF_z|D}NjeK}Vc z|B8;_Dt4*Br>tm#@llnNI%ss7dwZo9LFs$0mCV#iro79-d@ugnD=~-*eNg5q=-UM4 zHpp`PN~rgQgEXcRpJPjK88^d&>-ZU>_Y;eKom5cc_wA<%*!1y%caQBfvDlcDph=xH zxn@MZC*RvnCncz;INP6nh>q{1DK+ghwK&J0?a%3;ll?}aKc}5eIY`qIG~I8A6t=!* zKo5lA(tZ?T4|}2IJgR3O^pOSX=dpo157sz`vvKFeN=rEhU%vHWy;+>g76RT9 z8qfXU(AnBTBZ-e-;T(he8$7_^fy`|1AcOM^9*nh_kKuerxA%dLg|?d2SzfFIFPt2y7B@5?tFJ)3^>5G~MJ zEj~z7igW$Bd9ylcc8yr#^aPdQd5(VerJm>NXHc;F{bmQv%g;_@cOeY|*B?S3A3?Jp z(_q9NKO)a4#GY}86~*w(x$w;eaIH0Pt^jlwrqAdic*r%t_1!@B{q&`_%>~dvm`>HU z$;Ie1ba)lS?MYc_k7FgYX`PFw@8KbQEUYw`Zq}CbfP-tb<-Fiyo3@+}++3zDXMm?L z55`d^>m%rSCclidB;Vt6~o%JyY&FsJz(g_a34+ zS{4=i{Jujpr_c}ZXm}Y<(pmed0!JM<_^<@^?x3Ty z{SrHt;;$Ni%kZ}xe=8ES((mzmpQLjVRI}3WP0%X0>NEo3M_wKR)eWUQ_R~-pY#fYL z2z5;1Q8XROmGC(x~2NO$oht=csZeH|I-`2=@!k@kp^ z4Vr=<0|-vUK;d%LH*Y-l_-8Pd5+McbWE5G zh#7p6Hp6g(iwvGZ2)&~YlkYGr=H7f2ygNbXR!!cIxJ80TNBvXe4(b=Pi3xl%((g;qT0~~Quh0)iKV?6y%c7NgkG$4N z(`qKQQ$Wbq?xeg(&NoU7w)Fb_z-B2Hn~uts4>)Zl`8xjp){> zv_=xNv7OGB*4er>Catp*)Y49IX>HZ5ZPMDBpiS+xSz2>;(!@eEVOQ9)uM$ZiFmYkt zMF8K$opeb}UR@_$3i-d$PM68>%QcZJgvjLyy0V?FlGd%db(^$qP0%;n>1t`+u3L9V z>-Gd)(@xh)>vcORx09|1%^UW0(v3BpbQA7x&buW+w*r}x(c&&ax3$yl&%-jG>W%sW z82t^H`Zk!J_%!lxG5L5l_2bjw(R3c~@L9B%E9fz5_EnY$&@Y(bSUP_ z?8%zp&6lWg*KQi?M@q4u?pBB{{fm8*bR+_rcPUzVrI+^}d4EI)-BauptoXeE_GJ=( zZCly#_k7Cc80^#v&9q@F--I~2ndagC489Nn?4p$JreV|>klF|B6vAGT5P;95PLL#& zz=Ak?YAr5;JpJe_*iw>-VN}8uu&swGDVOnWBzSOAclP+j7;pD2al*zhQb({9esG0U z;%tML!rDu5G>{k}ry3K~-sWmxW*IbyFVxs^B5No(M9|`AQgLG1PFm`0O%f-NTYYOk z-OIF}?qiaOQ7LhHGH!I3-i>fCLF0ZMvkT?++j9E=f;=*Yy+_`dB%V^Ylkz*MR{Wm>!qV1K@YXlccisR58oiIO$mB9L65Z4qtX%89TDk>Cg`yQJ>E|H zq$8#~W=lsbK~E&;Nu(sw(WVz@m5#OqeYc&SlGaOh5;B(@c89Sx6j zq9LRy_5v>0njusB-XkAsnXb@FUM`fcNKi+D_P5hBLVTO<*eV^{64aTXXWQvH>DZxp z*)APB5_F)Qo|o3^chU$s!7`4u2Wzr$2z~+Q+7|)ReU+RMS6=EquHeUjxAJXB*=?-u zrUF=WE8@yF#FeXo#O;VHJIK%1z*$_qA8hqwqz1{ek Q;5k10q)=V2Zk+4?f1^VryZ`_I diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_8_R2.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_8_R2.class deleted file mode 100644 index 4364089e01c6f5c256ae8b284fe826b48c49a0ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14811 zcmbVT33yc16+Y)?CNFt;Y{4kQ8Z}@DU_cQyi3kCL(Ig-V#E6QM$&d`0%;01az_qTZ zxbLXA3$86%odn~8)naRHU25&#TD!M)ueRDM{m*@GX5I`j$yfOD=DoX|dzSy4d+vEN zuYdmBi$rvk`hiI=aX>C@CXMBw$?Lg2pI+q-gF_~7;7(}{8{C!05xI>@=SGvy;h4eQ zc^o&mC!c$HlXPyD&MhXN%Q2JBQt z@D7vj;d>3f&!o8`+pB!PTplp^K^gmyTrQW(!!m!T-0hM9kL0n};73iW;>Tp_<9VE$ z$A)x0VepeCRr8nS;VW|4ZSYej)$r4D`Kq)$BX_&<`B_dB(4E{@!2P^OF3%Y}AoQM> zQ7?!9FUsX5x$Kq8%X0aeDCU)XewDv2{O^;;*9`uKNoz%jx%|xnex3W|?pp=?27lY6 z`TQM&-!%9wlUn(0lLGvX!QVCbU6a=H_e^T%_YD5N!7%a${-H^o{3C;ZZ17J^ittZO zit^74{<+BezDY5D%-~-b{DDb5{7aL1`B%d4uMPf9KL3_~m&d;saQwmGKN|d@Nf!xM z7xJGB{diipUdZdTojpfBY$F2zGC1^DMRJRg9lnwUb*C&Xv>5ADj%9qrlAT7 z=ze9%Wt5>tLlbI@$-Qc+Oy_zI?fC}=poNBVLFa;8-sivByibdeRK|pn=sSZW(-0 z+vTGs6b!d9`RplSKZeGF>%+l7yj*u-Mj>V_i3R=fAm-Eu;~h~*M9! z!B{T{JH*Nxs+%xtNwjNYv?tP5IrQK(;YtxZC+=@&nltpAtOdY4td?SL=FpQ}3noQO zP1ceM1H*~vA~N)9S*(hP1?|DOt;$+p;`m{dX^*U&>B3rLJO*?MWP*-GrVq`8Lj#Ci z)q@#b!8M`o5WurI5{btB+U87?^a`8H{i(+ChMsU(Kqhz&XfWH9YGTnY;r-0g1GyTS zlV$-Wgc%Y)DRxx|ixeKX29sB#o2g`IO7?P0<6KC#sWYt}M)6se8+sv!WihW_%YIJ5 zX}GnV=|iuP#gMFJ0!r24XrNQ9F`=|B8f#B_dp$xALPWT7W-U`*m-7U~4?4(3Wpa+t zs-5`-0~z%6x}j)SP}ZH4v2LrdQ(i5ddTDQ~+=8N;oO=+H(G}3+nT9cm9#!q{7C??_ zjQazf_5O`I0vhT_NGaN|SDTc@f98UEpzz6bLI(2^TE!iJ&_M&K%;_!{4z$+6Mjo2< zlq}7rC_z~|NNOlD&2pbuuum|de2Un+X2bR2ASf&{x zl|jXWdOIvferKq;NaqYS52AHD;9@#)a4n5&fzxN6&NLd4CbWLb;z(OvsJ$Z&k;xEd#0b}eTC_?V_1@1^HgxdP zh_=UKu~D|0W?eKCRkFBpB1o2S5`0iQ z!KJX&Duci#o3c0-poBxGDur4aqdl=eum<@v&PbU@iX-JXWzie-ZA%@mDlAp0stk34 zr536aE!sz~A!N8>?qGpbM^HOv7;2HF7OQGYEm2Dmq(+EW#DFlMW2t4T#-eY~Hx0Gi zQYR^-FeSs05OZOxu_G1aMnKRfM16YG<}%dDmO6#&Emf!LEqa~4WvB*hot9dmR$A&* zwbD?l@JTBwR%`VIZlqR-S?OP!(4 zG}Kv^TBnv8s@zg%D?c1-BudlK)>5sYuL5#ula=->2vm~BN_tDw8G|daK^9=C^)j(t zb-;)!WT_1b=~CH{TGP47%4l~;awwS=MqIa4mx>_q8FHo_50V?bML(gRT6`2Ajh#8o zulBX%7+AzoQMFN61fS=qn5DW^+~Ou)jeszM)sUSFk3E*^Rhuk&kG{_|Zy4>ucX0$R zckS(>n9Uab3`V98=}%14(+sB-?93BP!J$DyR^B2yuCnM?f{k-6bspDR>U?zpwn0l> zs4lY9m(;}wk7?N1+kmAmQI}fu2l}I>E>o9V>I%7RmCKdtDob50mu>1ALtSU78`O=K zx=Gz^saw>oh@R;x$4UO~4*0&MZd12oXRy>AYCARwOWmpN687#MnV(f}k+k99wA9*6 z(yC3=WCLgi)9ex0M5Zl{#r%kilLn!vyENI`)IGxEy>N&TkX;(>(Y2EaSv2i-P4GUb z4+QVWA!GyuYr;`K0`ehQ^mMZ(_W*1Fa!6K-vc>>*dc;Gjd1PLJ364s#eIeQ7Xyjp8 zai_&gc^SfS8a1gj#8A5|^@w^DId+X7LA$Lu9xV<;BPia)i_=@Or5;m{A81l%S4ooA zJCtTjI%Mf5Mh2L=XavDD8!*!9$nm5Q`|`*P(by4<4Ppr0EaVVtzar#zj|?cbgJDa} zGMe44`Fl!S_6>FE$b!tW2u?TI5I`eHF&&n+QEfOJZ1;y3$J%=&iAwF&z*u^a%|&%j z2!%als#BLnBS*xGJ0sCe#U1#AF}wVo!D9O?RcxuJ)mJU`4EV*igBW>-Y@MUi0YKYL zJ!^L*EY+v_4YkKo`RJ+EG{)Qjr&40ESa1xvl8E|x)vPlZ{!(pq|6?X}d)@O_NA zM=oD8)GL;HRf5#>>g$HuXQ|gDPCc)_VW@9f>UCk`dG)Ydz9qc8A$Q+4)ORfPrg~By z-ZIqNmU;&U#Y0s_U|i9<0o7MaeOJ9}sqd-xl3eS}+NI1%U!byv`o?0W1!+mrp?mo1 zDbxHBOsv*b*jf}{7u$tc7%*+xhG=6?phH)WUF=TF9$;6CT_c9x=u!m}=)<+MCC`@d zLRYI!0?PFsKAa<`%bz%V3>hx%-EKHv*7-{EBw3h7X!3lD6Jxp&Ak28ifd{)qT2qa| zKu-)?tV>J9>E5KH1p>kDZr2d03F)j3sw#C?TXiE+=CLxsABjdnIK4IK^YlR(18wib z$O&m)Gv6fGl?(f=0@IQ1!-zB4S$Ocb5aV3Nve9G{Oe(Gj?6`)cPTQVX_r6o5^d&+l=Jv4_DC2cryaSp{lf4D_<(mNYG19mrAA` zmNYFpq3|@dti(1p4q8w0l6;M_Xb@)B9&jpj+c3#P>Sc>O6Emkej5(!PAs_}9(;0$fe;nw75vy_jFRiT=;K-Ph{E;?shS?xC zq&i%I68z2S|gqazK!&a*zlxwBnH63hp#hM+~QB z+f%XVyusEPf=%IYM!J7f>J@A#f=X+|A4V-ZfJ zmR{hBQo&v%wdMG;PtSNS-V+NpZuD=8ER&uReY+~??~bBWP>}JIyJU4^(~5d|x&8kU zgsSrWZBDJ3>Fi;A!!iEyF4D@Ah&^9rqV_-xV_k#uPlydO?$Ke6HN&s761^^m$ zr8x&HFjWj@%8~g2Y`L)qB#v{FaKPf)N{31l3Z1FRQl<7SPieIVQ|ZjLI>xQlkBq~P zr*x_GFi_(u1x9d-sOZ5!>}cN7wc5Syydg9F0d^3rjpoIx8fqJsr@nS^;2;<}2ML!h zXs10Um4XSKN|$U-8sln79h9{wC2rN&S)j`i`u&68Fwd*1IVRQ^Co~~tNisw{4%xo5ANhP1g^xROSH`)p7;TtDuH8?DtMNxvS-NhBxn@cMi-9pyg*}Ha-ODfjR`7zmd2xZJbDj$3M3W1iR)pM zhwD1>&>FDfr^(btr4*#O)Il{Aq6XSPZ()RGvq5juJ9zpo{&GR#UHTrr42L=~dWGGE zXj9TR3#=BUS21;KH+d!l_tE3ps2EE(-Ngk z%%=4SXg!)i%a&Gnw3Wv6XZnjn>v(*MtX`0s^aO6)N_*Nx#_OO0L+P*dH%w!Bhm%ca zQa?@3)>!`+kijb-P39x|*dfz~&m1sO2*ppSpS_RF+0W3_UF69T)^aqMZJ50PHeS?p zi|rXH_6q4=^l#Ad(kS|bK7~O4!CcJxFO4Okd!^ zb;bhG`wj6k<*x2U;$qHugdv zIiP+P=i<(THBMs#cV4Wtit{)hI;o^ee51AiF>fW!U<(eNr!6#%6g{ZYet9AN=1OB9=HIK@0JG zqJGXzJulMFpkVj=%zj#2l$XYC4UGfWzkohIfM$P1;}LUwK+!Zrk?HX73b@uHIM*`h z>Y&}n4ALVO%O%Z!NNM_Pr z<6teZ89pXr8Rkhm*)|sd=Y_$rbJ(u1m#XWb{v{1_`e|u}$LHBc)024i&hdHsY1shP zwD>$_KB!tC-ABuJa~je!zyfg&dBL^`hR1Lo6|qSZ0jt9SshKR9}W>E z^m&DclyVl*`wSsqi1|E~rvbuasGN&oo*Y1aCd~3%Kv;suXyVVQ%HTr{KFr|5AzKMg z$9Mz~z6HF9(svvH#fCY6RfPwVo+NkuR9oTodG}EqEhksx`f~TtiDf>3N5ji_noik6 zbvWI?!S@gje%r|>cMVK?X$7Ea`0^99a@YP};to1G)hDrI75*CW*Mz^-_*;{pW}nCB zeVR^7P)oDVo1oL(s?!LBHNAWYROh2Y7;6FyHJzs->P*A;`itopK9m;mVRSY`ZRZkv zNqstNb#IbZW$i@pq&Yzaxdp z9Xt~>C3bAnSd`dtInUzRQ2cb-jCI6U!~}E5vmZ;OqQj8@o5A?%9t<+kV0?RT9>F=L zeM-5X!ge2EN^)yg@4ywex9H+8|Lgm z1S3JFV~E*u=NQ5(qeQRkDspH0yxM|C@1e7EsCn1^w+3i_%j`b#3+dMFR5(C^7EEYO zP+K1brFFe-ZI{;d3F_#hkhE^lt)0@kAwl6j>XO!oZjDN7BtaYd=p1RS(ycLRtx8aL zAH}7$N4NG$YfpkU_0eW&&EHP5%g}_qVax7%q=rDod4=Z#f)@!Zu1^$Oj(Ra&n|(3O33m9$>1TenH;)d{+$kFJ&0>$X$D09_B7 zH|!pu8(RkGCfwg#cuRtA1wa*YTihk+wm!OD^5hQ@>pns>^XT3EChQc%73ASc%H&fJSC)~VYp8>l(Xfo47*17KAm)GPq%y+G;F8ucE8j57EL&0LAA8sxOuhY}?5W!RJsO$6%u#=%W|A`6h(Y&9oTz%lSOS zu=7*8n~za7T6a?rXO`=n0DLBO0(+hSE8+x7E1|_&$TNygfjuRkm`Drx6tsD$o(i}Q zmi4A|XOC~dc)M?f6E7x`+7CnI>fLFj!KY$dIu*H@1P3|Tn4tD9@NgqHLWB77j2$3y zN?=_?D}F8&Am(qURnG1t0RrjOy?f|BCLJRrRMbnTo`V}5Anr%RmuT^T4%=mN`=H!D zggB3+0U=_xcu8P86%A0U_)Z`}4<~46AMKKkcI{N_rK3GTkMz-_(%PwqZ;;l`1U;6Z z$NT6B>4@r%h;&2~^kjm*+(%!Lj+pMKl8#t{b|>g5WF^wks~6~zj@|@4-A7-Q)(f{2 zl9zmV>N6tcg|c})Ywt(tFgQ6C1|O>M0xsB{AyZ=4{`a*^m+B=i5z3b)s4qeNeY8i2 zZ`B=FNXOO$J(r+?K6+j{wrO6jmX2)+dZCYAl-BFF(-b+xGETNHwdCaV(_S2HUj|5b z*Kehu!Rnnf0~WmkF=Z=a%2hz()rcwE5Kpe9X1$4593MUs%^dLLDMDE8{pc`a}+36AWtl9(JrKY-6Dpn5L+;|$6Hp9=Bj zOn3tjob)Yz4!*V4i8pe@x7RvL)4ClpPXFri3?9=Ogr9eNJ? n1nm=w&NTRJoQ~NKz7-@p4WETr?|y!Rn{)BQL3ORVev$8gorx3D diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_8_R3.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_8_R3.class deleted file mode 100644 index ad8fa4d666871a908ed0d856cd89e22cca3bb979..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14811 zcmbVT33yc16+Y)?CNFt;Y{4kQ8Z}@DU_cQyi3kCL(Ig-V#E6QM$&d`0%;01az_qTZ zxbLXA3$86%odn~8)naRHU25&#TD!M)ueRDM{m*@GX5I`j$yfOD=DoX|dzSy4d+vEN zuYdmBi$rvk`hiI=aX>C@CXMBw$?Lg2pI+q-gF_~7;7(}{8{C!05xI>@=SGvy;h4eQ zc^o&mC!c$HlXPyD&MhXN%Q2JBQt z@D7vj;d>3f&!o8`+pB!PTplp^K^gmyTrQW(!!m!T-0hM9kL0n};73iW;>Tp_<9VE$ z$A)x0VepeCRr8nS;VW|4ZSYej)$r4D`Kq)$BX_&<`B_dB(4E{@!2P^OF3%Y}AoQM> zQ7?!9FUsX5x$Kq8%X0aeDCU)XewDv2{O^;;*9`uKNoz%jx%|xnex3W|?pp=?27lY6 z`TQM&-!%9wlUn(0lLGvX!QVCbU6a=H_e^T%_YD5N!7%a${-H^o{3C;ZZ17J^ittZO zit^74{<+BezDY5D%-~-b{DDb5{7aL1`B%d4uMPf9KL3_~m&d;saQwmGKN|d@Nf!xM z7xJGB{diipUdZdTojpfBY$F2zGC1^DMRJRg9lnwUb*C&Xv>5ADj%9qrlAT7 z=ze9%Wt5>tLlbI@$-Qc+Oy_zI?fC}=poNBVLFa;8-sivByibdeRK|pn=sSZW(-0 z+vTGs6b!d9`RplSKZeGF>%+l7yj*u-Mj>V_i3R=fAm-Eu;~h~*M9! z!B{T{JH*Nxs+%xtNwjNYv?tP5IrQK(;YtxZC+=@&nltpAtOdY4td?SL=FpQ}3noQO zP1ceM1H*~vA~N)9S*(hP1?|DOt;$+p;`m{dX^*U&>B3rLJO*?MWP*-GrVq`8Lj#Ci z)q@#b!8M`o5WurI5{btB+U87?^a`8H{i(+ChMsU(Kqhz&XfWH9YGTnY;r-0g1GyTS zlV$-Wgc%Y)DRxx|ixeKX29sB#o2g`IO7?P0<6KC#sWYt}M)6se8+sv!WihW_%YIJ5 zX}GnV=|iuP#gMFJ0!r24XrNQ9F`=|B8f#B_dp$xALPWT7W-U`*m-7U~4?4(3Wpa+t zs-5`-0~z%6x}j)SP}ZH4v2LrdQ(i5ddTDQ~+=8N;oO=+H(G}3+nT9cm9#!q{7C??_ zjQazf_5O`I0vhT_NGaN|SDTc@f98UEpzz6bLI(2^TE!iJ&_M&K%;_!{4z$+6Mjo2< zlq}7rC_z~|NNOlD&2pbuuum|de2Un+X2bR2ASf&{x zl|jXWdOIvferKq;NaqYS52AHD;9@#)a4n5&fzxN6&NLd4CbWLb;z(OvsJ$Z&k;xEd#0b}eTC_?V_1@1^HgxdP zh_=UKu~D|0W?eKCRkFBpB1o2S5`0iQ z!KJX&Duci#o3c0-poBxGDur4aqdl=eum<@v&PbU@iX-JXWzie-ZA%@mDlAp0stk34 zr536aE!sz~A!N8>?qGpbM^HOv7;2HF7OQGYEm2Dmq(+EW#DFlMW2t4T#-eY~Hx0Gi zQYR^-FeSs05OZOxu_G1aMnKRfM16YG<}%dDmO6#&Emf!LEqa~4WvB*hot9dmR$A&* zwbD?l@JTBwR%`VIZlqR-S?OP!(4 zG}Kv^TBnv8s@zg%D?c1-BudlK)>5sYuL5#ula=->2vm~BN_tDw8G|daK^9=C^)j(t zb-;)!WT_1b=~CH{TGP47%4l~;awwS=MqIa4mx>_q8FHo_50V?bML(gRT6`2Ajh#8o zulBX%7+AzoQMFN61fS=qn5DW^+~Ou)jeszM)sUSFk3E*^Rhuk&kG{_|Zy4>ucX0$R zckS(>n9Uab3`V98=}%14(+sB-?93BP!J$DyR^B2yuCnM?f{k-6bspDR>U?zpwn0l> zs4lY9m(;}wk7?N1+kmAmQI}fu2l}I>E>o9V>I%7RmCKdtDob50mu>1ALtSU78`O=K zx=Gz^saw>oh@R;x$4UO~4*0&MZd12oXRy>AYCARwOWmpN687#MnV(f}k+k99wA9*6 z(yC3=WCLgi)9ex0M5Zl{#r%kilLn!vyENI`)IGxEy>N&TkX;(>(Y2EaSv2i-P4GUb z4+QVWA!GyuYr;`K0`ehQ^mMZ(_W*1Fa!6K-vc>>*dc;Gjd1PLJ364s#eIeQ7Xyjp8 zai_&gc^SfS8a1gj#8A5|^@w^DId+X7LA$Lu9xV<;BPia)i_=@Or5;m{A81l%S4ooA zJCtTjI%Mf5Mh2L=XavDD8!*!9$nm5Q`|`*P(by4<4Ppr0EaVVtzar#zj|?cbgJDa} zGMe44`Fl!S_6>FE$b!tW2u?TI5I`eHF&&n+QEfOJZ1;y3$J%=&iAwF&z*u^a%|&%j z2!%als#BLnBS*xGJ0sCe#U1#AF}wVo!D9O?RcxuJ)mJU`4EV*igBW>-Y@MUi0YKYL zJ!^L*EY+v_4YkKo`RJ+EG{)Qjr&40ESa1xvl8E|x)vPlZ{!(pq|6?X}d)@O_NA zM=oD8)GL;HRf5#>>g$HuXQ|gDPCc)_VW@9f>UCk`dG)Ydz9qc8A$Q+4)ORfPrg~By z-ZIqNmU;&U#Y0s_U|i9<0o7MaeOJ9}sqd-xl3eS}+NI1%U!byv`o?0W1!+mrp?mo1 zDbxHBOsv*b*jf}{7u$tc7%*+xhG=6?phH)WUF=TF9$;6CT_c9x=u!m}=)<+MCC`@d zLRYI!0?PFsKAa<`%bz%V3>hx%-EKHv*7-{EBw3h7X!3lD6Jxp&Ak28ifd{)qT2qa| zKu-)?tV>J9>E5KH1p>kDZr2d03F)j3sw#C?TXiE+=CLxsABjdnIK4IK^YlR(18wib z$O&m)Gv6fGl?(f=0@IQ1!-zB4S$Ocb5aV3Nve9G{Oe(Gj?6`)cPTQVX_r6o5^d&+l=Jv4_DC2cryaSp{lf4D_<(mNYG19mrAA` zmNYFpq3|@dti(1p4q8w0l6;M_Xb@)B9&jpj+c3#P>Sc>O6Emkej5(!PAs_}9(;0$fe;nw75vy_jFRiT=;K-Ph{E;?shS?xC zq&i%I68z2S|gqazK!&a*zlxwBnH63hp#hM+~QB z+f%XVyusEPf=%IYM!J7f>J@A#f=X+|A4V-ZfJ zmR{hBQo&v%wdMG;PtSNS-V+NpZuD=8ER&uReY+~??~bBWP>}JIyJU4^(~5d|x&8kU zgsSrWZBDJ3>Fi;A!!iEyF4D@Ah&^9rqV_-xV_k#uPlydO?$Ke6HN&s761^^m$ zr8x&HFjWj@%8~g2Y`L)qB#v{FaKPf)N{31l3Z1FRQl<7SPieIVQ|ZjLI>xQlkBq~P zr*x_GFi_(u1x9d-sOZ5!>}cN7wc5Syydg9F0d^3rjpoIx8fqJsr@nS^;2;<}2ML!h zXs10Um4XSKN|$U-8sln79h9{wC2rN&S)j`i`u&68Fwd*1IVRQ^Co~~tNisw{4%xo5ANhP1g^xROSH`)p7;TtDuH8?DtMNxvS-NhBxn@cMi-9pyg*}Ha-ODfjR`7zmd2xZJbDj$3M3W1iR)pM zhwD1>&>FDfr^(btr4*#O)Il{Aq6XSPZ()RGvq5juJ9zpo{&GR#UHTrr42L=~dWGGE zXj9TR3#=BUS21;KH+d!l_tE3ps2EE(-Ngk z%%=4SXg!)i%a&Gnw3Wv6XZnjn>v(*MtX`0s^aO6)N_*Nx#_OO0L+P*dH%w!Bhm%ca zQa?@3)>!`+kijb-P39x|*dfz~&m1sO2*ppSpS_RF+0W3_UF69T)^aqMZJ50PHeS?p zi|rXH_6q4=^l#Ad(kS|bK7~O4!CcJxFO4Okd!^ zb;bhG`wj6k<*x2U;$qHugdv zIiP+P=i<(THBMs#cV4Wtit{)hI;o^ee51AiF>fW!U<(eNr!6#%6g{ZYet9AN=1OB9=HIK@0JG zqJGXzJulMFpkVj=%zj#2l$XYC4UGfWzkohIfM$P1;}LUwK+!Zrk?HX73b@uHIM*`h z>Y&}n4ALVO%O%Z!NNM_Pr z<6teZ89pXr8Rkhm*)|sd=Y_$rbJ(u1m#XWb{v{1_`e|u}$LHBc)024i&hdHsY1shP zwD>$_KB!tC-ABuJa~je!zyfg&dBL^`hR1Lo6|qSZ0jt9SshKR9}W>E z^m&DclyVl*`wSsqi1|E~rvbuasGN&oo*Y1aCd~3%Kv;suXyVVQ%HTr{KFr|5AzKMg z$9Mz~z6HF9(svvH#fCY6RfPwVo+NkuR9oTodG}EqEhksx`f~TtiDf>3N5ji_noik6 zbvWI?!S@gje%r|>cMVK?X$7Ea`0^99a@YP};to1G)hDrI75*CW*Mz^-_*;{pW}nCB zeVR^7P)oDVo1oL(s?!LBHNAWYROh2Y7;6FyHJzs->P*A;`itopK9m;mVRSY`ZRZkv zNqstNb#IbZW$i@pq&Yzaxdp z9Xt~>C3bAnSd`dtInUzRQ2cb-jCI6U!~}E5vmZ;OqQj8@o5A?%9t<+kV0?RT9>F=L zeM-5X!ge2EN^)yg@4ywex9H+8|Lgm z1S3JFV~E*u=NQ5(qeQRkDspH0yxM|C@1e7EsCn1^w+3i_%j`b#3+dMFR5(C^7EEYO zP+K1brFFe-ZI{;d3F_#hkhE^lt)0@kAwl6j>XO!oZjDN7BtaYd=p1RS(ycLRtx8aL zAH}7$N4NG$YfpkU_0eW&&EHP5%g}_qVax7%q=rDod4=Z#f)@!Zu1^$Oj(Ra&n|(3O33m9$>1TenH;)d{+$kFJ&0>$X$D09_B7 zH|!pu8(RkGCfwg#cuRtA1wa*YTihk+wm!OD^5hQ@>pns>^XT3EChQc%73ASc%H&fJSC)~VYp8>l(Xfo47*17KAm)GPq%y+G;F8ucE8j57EL&0LAA8sxOuhY}?5W!RJsO$6%u#=%W|A`6h(Y&9oTz%lSOS zu=7*8n~za7T6a?rXO`=n0DLBO0(+hSE8+x7E1|_&$TNygfjuRkm`Drx6tsD$o(i}Q zmi4A|XOC~dc)M?f6E7x`+7CnI>fLFj!KY$dIu*H@1P3|Tn4tD9@NgqHLWB77j2$3y zN?=_?D}F8&Am(qURnG1t0RrjOy?f|BCLJRrRMbnTo`V}5Anr%RmuT^T4%=mN`=H!D zggB3+0U=_xcu8P86%A0U_)Z`}4<~46AMKKkcI{N_rK3GTkMz-_(%PwqZ;;l`1U;6Z z$NT6B>4@r%h;&2~^kjm*+(%!Lj+pMKl8#t{b|>g5WF^wks~6~zj@|@4-A7-Q)(f{2 zl9zmV>N6tcg|c})Ywt(tFgQ6C1|O>M0xsB{AyZ=4{`a*^m+B=i5z3b)s4qeNeY8i2 zZ`B=FNXOO$J(r+?K6+j{wrO6jmX2)+dZCYAl-BFF(-b+xGETNHwdCaV(_S2HUj|5b z*Kehu!Rnnf0~WmkF=Z=a%2hz()rcwE5Kpe9X1$4593MUs%^dLLDMDE8{pc`a}+36AWtl9(JrKY-6Dpn5L+;|$6Hp9=Bj zOn3tjob)Yz4!*V4i8pe@x7RvL)4ClpPXFri3?9=Ogr9eNJ? n1nm=w&NTRJoQ~NKz7-@p4WETr?|y!Rn{)BQL3ORVev$8gA~zHf diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_9_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_9_R1.class deleted file mode 100644 index 77edca3290e5d9d476666edf807cbe21268562b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14795 zcmbVT33yc1^*`rkCNFt;Y|$tK0zm;o0uCsmB#00;qe-A7ECCfK$s`$=%*4qgfcpvx z?mH^(f@?*qlVGaiQf#fQwzaL@t=(I@TJ^83^8cOt-psriVv?_XA8+2f%eiOyo#o#5 z^2Qg>zeq&Ks~?;65(nhcXwpb-GP#+9`ScpM7~E=d8;7KMgTWi~I4rmA(it&1${hxu zo5wMOJM%ftUDDYtotsSF%pE3g;q&BjzR4Hxg>t#bKq zm&teYE`#qeX@rhxU{Wi;WAG0R{*g%=7?$41?;89QgMVsLgnwpI zlz(pUFGSv7niS(l4E~kD@0rxazc#6x-xq#=WAJbD`FH&LJpO}#2Ymbg^)C z5&y;D4-EdRNtf~8OuC%^Zty=0{-;S>`Cle&;|~q~x4|Eow4FaTX$OB|@c$Y7sY%y! zz~Ije{*OsFaUhTXE5D!12V20|K|>K96ho^@$tA~B9_5AnDi@kihN1Eb z=zf(i7t>G$(1fx~j;mp!n75$_HC$Bk4pg8C%I!qld3i&y7po&a& zggO$^tI?tds32d*4AK*X-xHoKzG336%U2|(iV!e`m1$c1=C@X#&~t8GhQEP zm7gV{V7QsdXHN+SFf>ub3>6( zd>&Iy$<$R$o`uooAk&EIP$XE})!rD4)dw2GXeq3YHU+|~0aU*^L&4G@1Fy;@ncZB_Q9ii4}e0}%K^>fy*n2F`h z#haUg9q~{!(rKuvhAL$$0{_imzbX=s)`!Bu#gTX@zJ;lwq&gCe``f`;Q!LOD_jd+k z-5~4`^Ve3^W7fiGdq=b@(p)j{;56Y15j!UyXl0r{@SLm#z&xy$VsGlelU)lYMNCcB zk_rQZiRdCS@M>ACiiicR!MLr;Dqv#HAj-5yR!ntatu7t|It4O8$0CylX2PKX#IESV zjP~HFP-h6>SrCat;{k1Rrm=d3&Hg~D(O=sY4hzTx&rKT4Hl-!8XuI%!R>`4U4a~`E z0VRYP5I-q)RS1g|9=ZmTSEHM0(!iAL<(NjfkZe znoUuHvUHHtP-H4|t3h`-(K#7B7fM7;;ufVFp=cvM4+gRa>V^APr*H?ByjobMDMOV( z#e+H>PD6cXsOc!@40Rkt>vX`ybZY-v8rlMDr>IeNRk535M{`4 zSBHhv>YhkIe9+s8Xpi4xhe#8mYqizs{LWN5aDdXNwa1Es+R`;A#eT|AGq4LV)J#At z9<9{|XPP^R&m-z-k9T{dMungOWl|%|C|Dmbqa=x-zUYjj*vst>gu8+$m`2#iMOS@@ zB_LSP5{(5zt&uZ=TeAA=f^qaSRx5I)r24j4bd!@L4QDRX5n{e{k+!8HS*V?qx!_zE zB`2-BY?G369u_{vH507#Gjm>rp^i7y3D_e5TuBv6!K&S4FbzSWGBzXjX%3vq7d#lj zaIhWVf*L|hgQRggUulv|BVF7(O`bT^l2*91!ahx5sC|@6Eepee&Q7d7C5yt`FH@Ae zDAAMWmi0dr+h}ZN3^mJ8Cn8L@psI19GMxZYW*A&x4OKWAbQD9}_5%F!YgI)e!I)-7 zQ0L$$iMmO8lwb=AIJ`ezCEjQ8lQxPQjj19Y)J}0J4A{0;=?6C1l*O?CC2TC!WT>Ss z+7)XGEqAGE9tbSs{&W?f=q9zpiFF0tuUf$vs6fJfXN2bnyx>VM>|7O zC&@JU&)LV^k@2u zr7l-jSn5i-Y?aG4b(N*Amdkdv!%){+>Uwp9rEXL=S?XqW3!-QGB;&L|XB&LqQn#wx zkQpp>ySf8O!csfcoxcn=(62xJ#UyY%_U=q#FcyC!%q)CYq1VWTkwf=j~D00Q!nS@d+XCU-w< z0CEo?pl6K%?DU8S)ykoH1tvHu$@Yb0kE4-?WW|RquH=OX$7$50$`C{Cw$vW=2I$0%2T4yNDm~_a}j}Hwn)zJuoX*OV_)sf=~ zA@=0Z3{lq>jrC&)-7Mq~YriVwo*EiZYzIS1%`%$ZuKC+5F8ijsY-mAdaRf0p8v-HmVATgROz^f>>*p6j7;M4UDA+*<4h1g>ZO>N_G6AXyn*<@y1AWQ*j&q!jlBM>;?J;JTTwXTRE0%gy;!~e`%~0R4)By=med={X zebZ9k5;pqOLvndTc=@*6y=f?v4&PNz$irKPdfQUpgDvqeCnF{BC_cyA!ep*oVQc5d-JA)OiT>;Yw=Bts@-J)vEKqU#IWEd^ml&iEYP#kVi#OF=SVlmWtE8Ngr!!3U+q7hRBhR zF6f}D68B-MZbY>_QU(Mf(MSjzw_3ejK0ITf?U)!jI?Ze5ivs&#!hUJMbewx1;!JiH z?*ApjD3`HpG}#1`iYo#;t|6(7wx=l|JEtk`^=ya9I5l>fY)Kado5F!uu-SQ&G2J~k zlh=%w70I_7u6UL4;sb`mq0s`Zd^uo7ZC+_8=~GuPv>_*|cmsq(R=>;G{cW9Wht_4PY>WT}M8HY+v z46qMp2R<@M(E#Gh2GLh~tnghXXRiZBjr4e+u~E2@qS@h_2|N#RdWJ)|g>&{mt_*I^$a>u80Ic&5AQR_H>`9<{pH zxb7QV_c+%alR4F4%sHMF0s;{+v?1^h!~sc|yb|XHB~?{|HW_nTAkr)zG!4WCREI0N zg1=ml&@_h0I;l5XOsfaes_>WG*bVlICQTSin(+DBMn{kdCE4c*Nk4*1=~sLsG2B)F zPJ?af!E~iQCYBcqDN^Ghc{=lE?+mf92S|gqazK!&qMxuau;Ne+3+^;i#}1}t+qbdk z%>LFHfKB0WO1ghj>a}brg7g;&gmJzd!NF`K4mkR1m#ts8Ynu5znd3IrOPA0Z8{4j()P@5+m?K?+30R`Dv-6qC#B8=$bzP}KkQV!k;IXob-G$C(h0H98vOy^() zrtZED~0lvHXkl}ufyW86CZ$k-ftN)|~E zK5W7*FoIh|MGpodk9bSgY4^5^jm(+}*g>>5RxemlTUEO>^(n@ogJ9?!RB8GEJnb>5 zx=rX*xMXu`A6H9iW35G*(EWb|L4PeYZcR`qO1tDDu%c;A( z=a)z=$uMJ?WYH{Mze--EWFrzqys!)W#RcDTSR6_i9t+QV5(5FZ0!ntg<(S#%mD z{zj71QbK6JX|v<(VUQr=PB$q6dI>of!J@7r**-tX52K@B@$}h8rg+XNiP5guM_3#x+S`7|R+%-v}Fl>#aHE}m{81LKLROM8e*OB19Ll+#O|=g3=_+e=1*@>Z7? z<`6jL(VfasxCo=&(UG%JPe(OKMi_{-oo{0%ENU% zd1w{*2+&w+rYRJppZk6 z=_>=DMd?*c-P%cBifd{|*rVuO`Uyr0t)J4*K*N+X@oZY9WeGYWo7RP(bx{T_pG~BlqIQ7Cu)uUgZ+dOYhOI(f>aFOYd*+Ys%TRL#Q0TTENn> zUK*WE>6Q$JeoueEY@zc<`V(kn(!{|w+73~gFI&)iAn3grbkj-`UPVwG$!F6NrH#p^ z^$2J^nnBB!R(Q0P#`HJ(yF+UZennO^_p@0XDIJ^fpg`G`Jt$TZ_O2TT+~@#AWy9UyaBFOAyntOYt zS3&7D*Ggt;C6jCkycl7x#B>k{)Regv`Zhti8?sDX4fP(qpN^@)@1%LSOrGt*b;@kf z`?2M@eN@um%iTv)k>v4%&k}p6tlXHEplN+HyZp$Eb%Jukw|Fa(@J$UPdG91l4r!O<(= z-pk?ME8*a010g{;RwrEaZOm$c1ZPu`#!bG+l9IifnH3}*Mj_5&542oJ&FqCmb3pxU z&c&SvYph`dcV4Wtg7Y{ZI;o%vHt}7pfmNrl1&7Yl78*}{5DVuUJj~$X29LlB29Gp& zl);5qoB1$4+|lj*pktwJx7IDJmQrxJsCAN7>*U$FTE&K_7@C}o|0mrzZXccOq1kzO zm;>$QAE1B_(Ne3q$Xk?KWH@>@edYmLthHLcpJtR7_zDUu`e<&0SmKlf&BODl`Z+iC zJYPS9g5B>kduc&YUK+bgXcV~qHT3a5H2YgR3^B(C6iq-BnGF9fhilD;b1jC>&ZLhJ zsz0VM@O%LfeGM>nH}L!*uq(DX4;l#5N!m6A7`;@7S3%tFl$CZnRzjQBxp?|+F5)9# zrNiiEZ8;A(xK>-v3qH1K%jJTbOSR<;@D%1FF(VJ0weV>6QNFg#@UsyZ6mll2HI;|q`|=T5P4lqwF%VHgpI3ND zDQ6zN#}ERBn8o9H0w6qs{9Fw4?6{9l!z)jp5U`wXo~ zP{V4UH$iLNs?!LBHNAW!ROh2Y7;7{PHJQgF>P*0g{>5}6Po(*LG@S!cTX_<`TAxhk zatXdMFQr?#jPBy;TD50F^mEAIDNs~C&@odh*`OKt=wEOmCf}7(_pTHcck!{HCJ|$Y zMxaEDD|srYdw{#mSV25Q6hECj2kG>5Ou)B$BMip3doaTogO4-VPjHC|pHc2-u-N;U zl1%7IUb@@(QwKoKfUUNcy$-?mmc2|fcGBuTT89vNW=$EqJ3(jFPTz;PMS@31{nO;m zQNLG4i8j}l=T7r^wcSqGN9W|w>OBYF?xR@^(|RZ%q#JiqVIMU$U_xVpntLcHtu4B> zRa#pT)Yd~GY2Bb(H%jY<1ciI3U0Nf$H7c!<1a8!V>eg-2x-~&p_0ZMQx?Q*Kkk;)9x~7M&mDcNaQb8YG51KdZ?V}qT`sgOy z-&}Z0f^G#W6{=a>CFr&ux?L*c4-nu!LJ0HdlztP^193TdxPo%|6dK0!;LoShI9`Bc zQHeisSx75+5t7Mb3h)wY**t2Ngwkn0B$uO&JBo8Yq^xy@k~CG=kr;-l+Q-*dfc6ZkKYS254 zDXE$BFjIg&iALsrLE{ZR)!_L+^=EYar<7Nu|1C3k!Fb#aCnYb$F<0WwBYFBalLd; zxmVEP^8(73O0>1DV@KO_34eD5%XC2t-ALS<5H&Z`0^Bd<^AWBt&>CBTG%*XK7HN%* zLr9TSCUJL7QYWxt1#F0&CM|~+mqMOlbOx*`rNbDShcB;}V&xht;L~AOZ%TLe_-c%| z`)ZsZF^1GZ7$R3EqFRHOApy#qAd2s9}9sK$;8Iiq1ygeZPK6%}Uf zq!msglBj@6>fU{HACnFY5+7A3{h+eSo+yO?;zi zCl&Qkqj*eHf*wxL?jG7B9j)4xTBM^jL67v%qtd!j58oiI8x!Wr%`}NN4H*}OFFs}^h^(ZODYHvD)v28?gdJ?G4{t*xxf)2^j!3eDe0&W}#BT*(ORM=hTFckdnS2BOdhJI1#nnx8 z0pE;dbPN6v>{faR^d9Hi=>@(6e~Y#gQRGhg1>c1zayNa*yXZfRZ*}-yp2+uc89vlL zjvqj-c@S~nAz=4mUe3GmR%{Qx9eo5}wm%9EALrZn3BH}5znO zA{1{@pD3P)q`Zb3G_p^mci|@rNS*<@YbggjDa4p{@BpAT=}-JT{Hei-F|vcV>7EI? z5?PL?!rafP*iM!RE1waME*d?0bde4>aF?@mxHzr1iMbZ#f%jHs&FXOFpx!mL{c$>-F z`AWH5C67By-pN;+d<|b~@OAQey5uF`4+xaF1MLf$hVtx9Pcvt4wI(y zohIMKyA8hEq!}XHYkZGf?lt&68GFB6w#wxJng5{NJtPD6WV6@cy(Z1&hh^#`+3d?^ zL%JR{_%V~p`Ehx8LM~r1_(_u%^FFyeB`r_O-9tJ2RemOy?%-#0Il=`nb}(0fis z^@;$`%jE^RyeOBKMl}C9Yzw$v7$}m)R zF5RbcIikDDCDQmfyy`4 zQR-+&uSSa=pn@DNr}7I6V<4d#YpP?^I1%`-5KxUb)dW=_@_q>U)I^c=6GI&<>mLVK zP?HQbIa^IJ)bWNYWb%chEiJ(q)0nCafv!MFXFL=xk+x8zrKC#tl`$O=X^dBeI^uPK z7Wr5l3Wl4R{PvV^07GNJ_2FPsyhL|lMjmEV#Dal%5Ob=7@zy9NIBR4~u=_B>H#Zas z#pf|)6;55r57HXr#kXQw>$bln?%!!G2{V9<2+7gNq{ZP<#thLt#}U7%yo9XHBud`glo4 zFxCaa4zZG&@;c0_h_X=>yN{vjCWf)l%$D9eA>9!K8?( z$y!ojU@#F~L(-{s6$OO+#8q7AO#j$9c@P2mT;am;O zNxgs)!VHL?6uT;fMe+_`gUPGW%`|CXO7?P0qg+U~sWYt@MDcwrH}FCZ%VJ)=mi?T9 z(_m{k(+6Io4@0t+2`H6^qfHyd8lwxVqOq2ww^t+dAVh@ArdBd#w>eKhe7}QiR3_&L zt;(riFpxn{uN#WC1!di_8S6F*J0<1Psh9RP$}K3m$+-tH8Es8^Jkua1(WA-(9RkQ< zwedjH#_B-3j(~LM^Rvh=fL? zsTH|12n^*!pu{f8l}yLD$ZkLyElFk)^p>G&#OPE6Wva+vEvN%xNzxr%lytz*>ChP? zR&>TmW_GzwCJ|^}+sPiwbdq~$e-?D6YeS|M$Zl)0?@_uMssuGCljV-7Osg^^Ndahx zGGw@`!$N9xPb45d=6(*bKWV5L*aaAB zCZH9M)@Xw>%^k$&5%sjkyFF5)LePLRsS#!rtPhw`l0;Bnbi`5Y`MLt(&L9e=5q5IX zRUcvr2*dqX3Nfk@Ms@-HT4MCwYHY4_F4xGvt zJQ%@nunpjX8bVBiq;Wf6X_8DMUEDiOo;cK!R=BjnK22e$eUwWr72!Zf2iBg_hr--1 zQk1(W(Ua#E_dgWdXl!N-HOo*ZBTTPHRpUZsIsv52Fu1@Ps&F*uD2BN01^DIDs*FT} zG0lvi&cRO-b(8cc!4?#7WPiL$yzj$L+9+-`riyq_JI$pqVB21$AK3JzERF>zVPmN# zLoKz@&RA1$F=}M&gEF@bC&-q`qBrSVmYS_jvDB$*j-g5|Ri@@zbdX+0$Z*Bg{(_~B zl6K56)M=KQr%t!je6;{UYKVA63%D$)B;0Iv(&jN0LL1N z(sZ=7R3qrCCb=}rN{18#nv}*$I_>GIz*W2;(_3o2Ol(oDFro@sYJ);aR5YO0bp5d` z+7XgENv4Gn*DckiA}DSKoS9j_TJ%%;nZ+|0>0nHnU+rrZ&ejnYu~byG3ya|MJQcH4 zhl*RgoNEyfhOincaN)7jQeA43ML(b)GR+)ByYO9Xb4y(LTNJa|qMyUa^a1^uX>yw3 zw1S;^f+;vONXW`tM8|V1`n6!=d`n%xz|)25BBVh}U92v#)R)zz2#;yl*=fL1m#M85 z{gM7;sms+Bmf9wl?Q*$NU1g~qa@nb_Hq^D2x?bI2sT(F)(U z)UE0^WCly!u67|wSn3XSr?7X|(EO}?iGU-G`>#t_j`?^?@KN$ig8ITpW%D5Ri}VLr*tr za`(dqAol_XogVR^!X|AfUV#aYO8WXjvd7WLL$cx?i_5tJ;W&+&R2gEZy_R}d zJ%T!VaR5QPxgZ`bXo^N~Koc)Wr({b#svbMsq)t{zlGYhYGbSCf^y5PVOjR_3VA>Zj z((1_Zgb@46&+B&o#vnYZc zOkW6~5u})oP1~q491gYw!V6+8ol-=lay2lP9%OS--WkH-9V*rF3!{09G>=lZ8G(&M9$k)!cyI;$58t%^_=Rp)br{E zOTDOW%dm8+O0d*R>QWhm(3IClO>xTMvda<(tCGn{xLpLw(y)Z>cBb;cY{G$5P*gE%7iXBPK3w+wFXRpVywjBdT zN;}aF=Ek~INp2$Z(g>}@5mg`_1C`DoFPxeXOY| z*wNt{B1b;Dpo6Lk-G`~V5!LcY84!p>BOz?uYV>yb$c%xuV`Aj!G_RR23haXk`=tTX z3GRJ}Guc_V|CbD-T*k7|WD`s(E+6c;hNL#yo~D58oTj+fvmGYm)YxgVC0!V73I}4r zX6H@Dbobm$UNc@+B;Rhh;#J0r4;T)IMhmp^<$xKrdEsg~sIp1Ou*i%_aS z>q%acZ%O9&!_1n)HiT{)CV5D`OR-Iq!FrN92bg9Ie&&EESCM>yAp&?h0$mVi?f-M; zpvMyKbp~@I+u7={YsMau8~Yr}mv6CA%j+|vLHbbF3uViJEnYC;47bFErT%ticD&G4 zuoE;!Hp<~@UDOqJ$}`TaoDgH5{SGX8iUu62co3zg#|q!Ya4sFp$Nh201Sr!YT*uq;kd66bZe67KzjWyA@yh^c8 zsC6*JK0ni&bt`lsN1IyRt6cXDu6rDtj>(+rFy@^83ITzL7}^l;3dDhUn7kav5rvhN z0%jR=Mj+BG4mu6Q22_VDc!NJ5NN5_vWS!KDGp72%v?}~1_l<+S0ZJ3bk|sh*O`{{o zgu=eZ6-hURC+RncBQe}o01lgN>A`flK82R|7AaEWA$dBn_uY76VGoc7ZDoNVQ&~Sz zX<)@A4;_WZ@q=mE_H8UWv%hr)U{k11N%wC`z4Z-6kX<8zFpke7IQNaj0Y`t$(sdO} zmo=qTFb8lBS_|z50A1QZ*@usYz$V>^lN?Fk%R=#{R-6~Y9O()t zyKv#cg^L$YU1=z6?Pt4UTCfW>b_xFM%{*SkcgBLX?SV~^Mba}#-!2aZI-)qa$jx~2 zRjjD3TUsse)BiVuP*qN#**W@VI(HD?aE$-IE+&>30R`DbgH4R-WEj!KeSaZ7r5wC+ za(F;uX+m1g06?ui_|C!#Or`yqa%g@4Tef$C#Hnr)4p?02eW21M&zYJ$In@sDDJ<7u zDxA7T$GA26k+Jvk6fTq=d~XW3zzA*;6+IY;JmM`}qutxCWim@LUYE;i4}zhyPz37p^|Z&N%0i)2=90}Rtz0dseY+NAl3O))W$JQ7+0fZvk|>;drpR%o zhy?F}_j(Fz^OT(h=SKLb`$7zgwEHVi)5Rwu2Zg^1$6iE z>!jTP#=gfo2s5rAq$_PX)R(UjNTilzn6XTy%aDg{A zD2bBDP1Ty>i;XyPatLL{D*JEf?Ham_s1_>hWbdw^Wmylx@Eb6Mk?cqH$<4iKT#5hZ(;DislB$XN;(|w^xS9Bw+hcCIL)!+cdUD7A9 zbNHytHwc5obec)8(M!biHOitqc>#fMRp!Y%0sV=?d;Q7s#)1@m8&5Zqf$>CDMcu?j zMF~;~%IYD{v*gY5^^lRE?E0d-oIEo@xzCbS^bA>^1Pv?78=g19^8$@*$a0%c#Lz568rAyFCg<<`llxI5q<2CX~t(3n8<_X z$5l@|NanO28o!r3S;AVDhO-T{7r@4gnr?wTBgI}GeM0{N9WM=|Pw6uV^l!|?tpCtR zgZ?vL82>MQj;k1^3ZJr~3C1T>W3_@b_x4J!g3@cQmCV#iCd@Aqc=6v}iRlm^s3~&| z>|la&7i5`O5A_~Zp$Eb{LoWi(Foc{u$UPdG91l4r!PU#);LG6PE8ybiz^{UE*bX@9+nBW;5}ZT% z+S_tOmXz#W%&Z{kFbZ)Nd!Xe!YGyC=kp=4Kun%`0tg(s>+cxczjhhh}HvVGgvHbC3dl#7nK_d~d!l-*EJ7`ptv1 zNNct90L>`P_2=f5_0rr1vBYT!nuq7p^|LSaJYPS9g5B>oduTy^b{e~jX%x8rCG_z= zH2Z5h0ztv=T$DM#CDoY?CDGL!Zi1#5}T@G%CQTIEW|_)hj%tlrxXsV+a95%;NDp0T3QRC0qdWWC8M1 zb!_)&QHK+MPIC>OXz;NH9|zec@nnog0O1|rMU=k#Feuhc2dqjxkn{|>>!He0uitx+ z;%GUu)aUmdq|=N10FQ>3@id*apQ^CAfrIZS?E7|+U+!v{4$x9S)$r#eXxZLFzrr1K z^d-N`XAriHxljjhfnT`qg za^MJq@#R36VT{2i7+gYdi3y*P?=x8JeN0JabR}=~ZTzW&AZNf<+lpU@;QNYSrWw1a zzL(Y@gs!bFhIc3E?3(HO5w}S2=%|01+&Sv^$|%w1x>DaXzgOGsr2TYm7S-=P^mZ@J zYM9nd0U_PEi}HG@sR0uj6V%*IL1|sDTU(@ceS%uMDI~2Mbn8ZG-H@PgH?>J?M7Ktz zHIktAZaPm|=jzs&w9ZXXM>oZ#wNtltNo!|o(oGU0Sy#=*n)oN?Ld5)}7M2 zBSBYp(>2n1?JmmgrRzZR`hC50Lqjj!i2IxJZcflGK&3)Gi@OBf+D*4fZTtZO+(!su z9-Y!}M0y}DB@dU8k58jvJP-bSI*sE6NEYSz4NV2D;DtygizvX0sg;+|CO!i{HK|1C zI+JeZv*-b?qDQ%!_9O8g;HC5yBdPJ1=r_EaKHxg~h*!|Zyb^$`=OeiR(P=do@fx1V zYk5AO%}e+k^sd9*x%hTnqXzgHK+R%AmlOFU;HnJqWfq|BMRcg*lX*5EJdPIfDSRp- z#>X_C=RgL8Sl*TdJ#XVO%w?VnWJ*PB&pa(Pa~@_2&?nJI-{&;m;L{DB4^)3fCw@xV z`TE~dgBOg)-EdO!#vOAd?o5L2fN5Igm{KZ>+vmyF05`i1&>f|otl8dti4k|+Pm}y8 zAokN;3bAB35S+yCZbkK%dwK7nAC2pwyGy--4!;*rzEq;EZ5=z>o=5m$7cA2WEp#Dq zZ$i}EObc+ogfBq2x=?FuInu-|j9REQHVz?0QklfvRY{$|ie<1N_L{T|T3iBohS6ED zrj!n2Xdb@Wy#y;)Q!bwgyLwZ)v&UCqyxmvr1c@=E4#5yUorr1-UWyE~6lIu11lh%y zp!N>Xa0AewYZond5|Km&R8sfsr+b-nV37DwEm3(oZgf<* z55ZkR#Qi!#7s>4da{C}cI_d+&g=yj&O}i++mm0-mniBL-g7$RNUg>DjuC!h{S`zed zH$5V)8};xF(z-E0k0$7`ZhBlgqPim@9nl0mk)W@1)05H>(;aiABbK0j33>_zh;(%6 z1v;gpD?v|p(^sYS;$4I~B?tcbj7WL0&ej&bHcWjf6?Fo7=LA~Adymai;yzG#Uoe6rOn_iUG>vqvN*|9RV zu`e}bW%bYj>|9a-pNF?2l3WEO?m#5jNq)YX zCgQVsv(0hz;qZjyg{Mc<5qR1We zGrkj10S7V0+MHd?rO>c zPYN++4Lks-P5Ki*2Y+gCVvOwJZMthgS0c-al;`^|71+rVVdXR8(fOlCkIvWO2JUjU r4mZbsiuTd@csK|9dtQf`3XyOnKJ&2NefV|Z3SSPtqOMWb&G-Kwy74+U diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index a1b18a251..9ed05da68 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -29,10 +29,6 @@ import com.sk89q.worldedit.blocks.MobSpawnerBlock; import com.sk89q.worldedit.blocks.SignBlock; import com.sk89q.worldedit.blocks.SkullBlock; import com.sk89q.worldedit.blocks.metadata.MobType; -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.entity.Player; import com.sk89q.worldedit.extension.input.DisallowedUsageException; import com.sk89q.worldedit.extension.input.InputParseException; @@ -41,11 +37,15 @@ import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.internal.registry.InputParser; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; -import com.sk89q.worldedit.world.registry.BundledBlockData; -import com.sk89q.worldedit.registry.state.Property; +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 java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; @@ -162,7 +162,8 @@ class DefaultBlockParser extends InputParser { throw new NoMatchException("Bad state format in " + parseableData); } - Property propertyKey = BundledBlockData.getInstance().findById(state.getBlockType().getId()).states.get(parts[0]); + Property propertyKey = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS) + .getRegistries().getBlockRegistry().getProperties(state.getBlockType()).get(parts[0]); if (propertyKey == null) { throw new NoMatchException("Unknown state " + parts[0] + " for block " + state.getBlockType().getName()); } @@ -194,7 +195,7 @@ class DefaultBlockParser extends InputParser { } String typeString = matcher.group(1); String[] stateProperties = EMPTY_STRING_ARRAY; - if (matcher.groupCount() == 3) { + if (matcher.groupCount() >= 2 && matcher.group(2) != null) { stateProperties = matcher.group(2).split(","); } 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 a04c25cfb..81d2ed272 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 @@ -34,7 +34,6 @@ import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.registry.state.DirectionalProperty; import com.sk89q.worldedit.registry.state.Property; -import com.sk89q.worldedit.registry.state.value.DirectionalStateValue; import java.util.Map; @@ -129,7 +128,7 @@ public class BlockTransformExtent extends AbstractDelegateExtent { checkNotNull(transform); Map states = WorldEdit.getInstance().getPlatformManager() - .queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getStates(block); + .queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getProperties(block.getBlockType()); if (states == null) { return changedBlock; @@ -137,9 +136,9 @@ public class BlockTransformExtent extends AbstractDelegateExtent { for (Property property : states.values()) { if (property instanceof DirectionalProperty) { - DirectionalStateValue value = (DirectionalStateValue) block.getState(property); + Vector value = (Vector) block.getState(property); if (value != null) { - DirectionalStateValue newValue = getNewStateValue((DirectionalProperty) property, transform, value.getDirection()); + Vector newValue = getNewStateValue((DirectionalProperty) property, transform, value); if (newValue != null) { changedBlock.with(property, newValue); } @@ -159,20 +158,18 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * @return a new state or null if none could be found */ @Nullable - private static DirectionalStateValue getNewStateValue(DirectionalProperty state, Transform transform, Vector oldDirection) { + private static Vector getNewStateValue(DirectionalProperty state, Transform transform, Vector oldDirection) { Vector newDirection = transform.apply(oldDirection).subtract(transform.apply(Vector.ZERO)).normalize(); - DirectionalStateValue newValue = null; + Vector newValue = null; double closest = -2; boolean found = false; - for (DirectionalStateValue v : state.getValues()) { - if (v.getDirection() != null) { - double dot = v.getDirection().normalize().dot(newDirection); - if (dot >= closest) { - closest = dot; - newValue = v; - found = true; - } + for (Vector v : state.getValues()) { + double dot = v.normalize().dot(newDirection); + if (dot >= closest) { + closest = dot; + newValue = v; + found = true; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/BooleanProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/BooleanProperty.java new file mode 100644 index 000000000..4acb12f7d --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/BooleanProperty.java @@ -0,0 +1,38 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.registry.state; + +import java.util.List; + +import javax.annotation.Nullable; + +public class BooleanProperty extends AbstractProperty { + + @Override + public List getValues() { + return null; + } + + @Nullable + @Override + public Boolean getValueFor(String string) { + return null; + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java index c165fdfff..e29a7cc75 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java @@ -19,21 +19,21 @@ package com.sk89q.worldedit.registry.state; -import com.sk89q.worldedit.registry.state.value.DirectionalStateValue; +import com.sk89q.worldedit.Vector; import java.util.List; import javax.annotation.Nullable; -public class DirectionalProperty extends AbstractProperty { +public class DirectionalProperty extends AbstractProperty { @Override - public List getValues() { + public List getValues() { return null; } @Nullable @Override - public DirectionalStateValue getValueFor(final String string) { + public Vector getValueFor(final String string) { return null; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/EnumProperty.java similarity index 71% rename from worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/EnumProperty.java index 69d3e1ef4..37d3bfe20 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/value/DirectionalStateValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/EnumProperty.java @@ -17,13 +17,22 @@ * along with this program. If not, see . */ -package com.sk89q.worldedit.registry.state.value; +package com.sk89q.worldedit.registry.state; -import com.sk89q.worldedit.Vector; +import java.util.List; -public class DirectionalStateValue { +import javax.annotation.Nullable; - public Vector getDirection() { - return new Vector(); // TODO +public class EnumProperty extends AbstractProperty { + + @Override + public List getValues() { + return null; + } + + @Nullable + @Override + public String getValueFor(String string) { + return null; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/IntegerProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/IntegerProperty.java new file mode 100644 index 000000000..bc08a33ee --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/IntegerProperty.java @@ -0,0 +1,38 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.registry.state; + +import java.util.List; + +import javax.annotation.Nullable; + +public class IntegerProperty extends AbstractProperty { + + @Override + public List getValues() { + return null; + } + + @Nullable + @Override + public Integer getValueFor(String string) { + return null; + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index 02a50c1ac..ed86f0e03 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -20,10 +20,10 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BlockMaterial; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.registry.state.Property; +import com.sk89q.worldedit.world.block.BlockType; +import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -33,15 +33,6 @@ import javax.annotation.Nullable; */ public interface BlockRegistry { - /** - * Create a new block using its ID. - * - * @param id the id - * @return the block, which may be null if no block exists - */ - @Nullable - BlockState createFromId(String id); - /** * Get the material for the given block. * @@ -51,13 +42,21 @@ public interface BlockRegistry { @Nullable BlockMaterial getMaterial(String id); + /** + * Get an unmodifiable list of values for this property. + * + * @param blockType The block + * @param property the property + * @return the list of values + */ + List getPropertyValues(BlockType blockType, Property property); + /** * Get an unmodifiable map of states for this block. * - * @param block the block + * @param blockType the block * @return a map of states where the key is the state's ID */ - @Nullable - Map getStates(BlockStateHolder block); + Map getProperties(BlockType blockType); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index cedb6aa4d..2fa75d668 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -25,11 +25,8 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BlockMaterial; -import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.gson.VectorAdapter; -import com.sk89q.worldedit.registry.state.AbstractProperty; -import javax.annotation.Nullable; import java.io.IOException; import java.net.URL; import java.nio.charset.Charset; @@ -39,6 +36,8 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; +import javax.annotation.Nullable; + /** * Provides block data based on the built-in block database that is bundled * with WorldEdit. @@ -86,7 +85,6 @@ public class BundledBlockData { for (BlockEntry entry : entries) { idMap.put(entry.id, entry); - entry.postDeserialization(); } } @@ -121,22 +119,6 @@ public class BundledBlockData { } } - /** - * Get the states for the given block. - * - * @param id the string ID - * @return the block's states, or null if no information is available - */ - @Nullable - public Map getStatesById(String id) { - BlockEntry entry = findById(id); - if (entry != null) { - return entry.states; - } else { - return null; - } - } - /** * Get a singleton instance of this object. * @@ -151,14 +133,7 @@ public class BundledBlockData { private String unlocalizedName; public String localizedName; private List aliases; - public Map states = new HashMap<>(); private SimpleBlockMaterial material = new SimpleBlockMaterial(); - - void postDeserialization() { - for (Map.Entry state : states.entrySet()) { - state.getValue().setName(state.getKey()); - } - } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 10c3e11a3..05a9c9029 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -21,10 +21,10 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.registry.state.Property; -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.BlockType; +import java.util.Collections; +import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -35,22 +35,21 @@ import javax.annotation.Nullable; */ public class BundledBlockRegistry implements BlockRegistry { - @Nullable - @Override - public BlockState createFromId(String id) { - return BlockTypes.get(id).getDefaultState(); - } - @Nullable @Override public BlockMaterial getMaterial(String id) { return new PassthroughBlockMaterial(BundledBlockData.getInstance().getMaterialById(id)); } + @Override + public List getPropertyValues(BlockType blockType, Property property) { + return Collections.emptyList(); // Oof + } + @Nullable @Override - public Map getStates(BlockStateHolder block) { - return BundledBlockData.getInstance().getStatesById(block.getBlockType().getId()); + public Map getProperties(BlockType blockType) { + return Collections.emptyMap(); // Oof } } From 6b5f218809e4aad4011e405a4074e9ea4778ce8a Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 18 Jul 2018 00:42:09 +1000 Subject: [PATCH 44/74] Basically finish the state system. Just 1 more bug that I'm encountering. --- .../worldedit/bukkit/BukkitBlockRegistry.java | 15 ++----- .../worldedit/bukkit/WorldEditPlugin.java | 7 ++-- .../bukkit/adapter/BukkitImplAdapter.java | 10 ----- .../bukkit/adapter/impl/Spigot_v1_13_R1.class | Bin 18415 -> 19401 bytes .../java/com/sk89q/worldedit/WorldEdit.java | 12 ++++-- .../extension/factory/DefaultBlockParser.java | 6 +-- .../extension/platform/PlatformManager.java | 3 ++ .../transform/BlockTransformExtent.java | 24 ++++-------- .../registry/state/AbstractProperty.java | 12 ++++-- .../registry/state/BooleanProperty.java | 11 ++++-- .../registry/state/DirectionalProperty.java | 18 +++++---- .../registry/state/EnumProperty.java | 10 +++-- .../registry/state/IntegerProperty.java | 15 +++++-- .../worldedit/registry/state/Property.java | 3 +- .../worldedit/world/block/BlockState.java | 35 ++++++++++++++++- .../worldedit/world/block/BlockType.java | 37 +++++++++++++++++- .../world/registry/BlockRegistry.java | 13 +----- .../world/registry/BundledBlockData.java | 5 ++- .../world/registry/BundledBlockRegistry.java | 10 +---- .../world/registry/BundledItemData.java | 5 ++- .../world/registry/LegacyMapper.java | 5 ++- 21 files changed, 158 insertions(+), 98 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java index 0b880cb18..8c3ef7c9d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java @@ -28,7 +28,6 @@ import com.sk89q.worldedit.world.registry.PassthroughBlockMaterial; import org.bukkit.Material; import java.util.EnumMap; -import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -39,17 +38,9 @@ public class BukkitBlockRegistry extends BundledBlockRegistry { @Nullable @Override - public BlockMaterial getMaterial(String id) { - return materialMap.computeIfAbsent(BukkitUtil.toMaterial(BlockTypes.get(id)), - material -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(id), material)); - } - - @Override - public List getPropertyValues(BlockType blockType, Property property) { - if (WorldEditPlugin.getInstance().getBukkitImplAdapter() != null) { - return WorldEditPlugin.getInstance().getBukkitImplAdapter().getPropertyValues(blockType, property); - } - return super.getPropertyValues(blockType, property); + public BlockMaterial getMaterial(BlockType blockType) { + return materialMap.computeIfAbsent(BukkitUtil.toMaterial(blockType), + material -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), material)); } @Nullable diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 0122352ae..cbd56f920 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -82,12 +82,13 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { WorldEdit worldEdit = WorldEdit.getInstance(); - loadConfig(); // Load configuration - PermissionsResolverManager.initialize(this); // Setup permission resolver - // Setup platform server = new BukkitServerInterface(this, getServer()); worldEdit.getPlatformManager().register(server); + worldEdit.loadMappings(); + + loadConfig(); // Load configuration + PermissionsResolverManager.initialize(this); // Setup permission resolver // Register CUI getServer().getMessenger().registerIncomingPluginChannel(this, CUI_PLUGIN_CHANNEL, new CUIChannelListener(this)); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 942bbe625..359ddd90d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -28,7 +28,6 @@ import org.bukkit.Location; import org.bukkit.block.Biome; import org.bukkit.entity.Entity; -import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -95,15 +94,6 @@ public interface BukkitImplAdapter { @Nullable Entity createEntity(Location location, BaseEntity state); - - /** - * Get a list of values for a property. - * - * @param property The property - * @return The list of values - */ - List getPropertyValues(BlockType blockType, Property property); - /** * Get a map of string -> properties * diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class index a9885edc5c58c176413f963ba7e23d01aedd9376..f2101f1559f9d3bb1dd4501eda74693cdb116743 100644 GIT binary patch delta 7831 zcma)B34ByV(yywXnNHq3LdXG0AQvQo9FTyV3Cj%v5(I)`6oerO7)UaZOh7~(FFZg+ zc?bpt@mNq0h(u=+BM5loh39&%w|K5B;DrcZ)tdwY>+bL4NBZ@v?y9c(_rI!pW`0_U zFRexY{u58`27tb*+JH~7PMUQFxbYqX@5S}u@EvZ@c%OkA@qQ6Mpz*;ld`RQpHEt5Y zW{nSr;Um)BBD1#|_$Y4ExIGMagkwEECc>QtHsCe`!trrwo-i$)IJddpUUfJ zGU4+u%+&aW0mJc2QU59ov%)Z2hQ8K#P@dmN^R3433>c5!OY?(Bew5y4;rK87$qm(b z$c_KT!_pklemp9+ewJy!h}XYL^P4okOLI(`KLms0;rJ(>5a&-C1cU|=DT5s3l*VO{ zrZ6{!;~`CkCbuTj4W-mhnlOVRsJ#JmC{j}gO;J3LqN4yP&hMspN-(H1b&+18rX&L@ zWL~nSlqf)oGoV)9yK3rYz!K@EX-YTXN~{Z`41Q8~-hJvJlBWzhu$G2u8piuT!wp!6UuqhmX`}(`X_NsQXf$IF!`PGf0Y7>#Ep(|MXE zXeu;dvv{B27~b*iIK1u!AntG)>b*ZiuF00~&C*ri(RQ zVn9&Bo^C({&0wn2rP7Kyb^YSgt@?=g~WNehK6#WRAZ2jY9+))5-i6V5ejCp_;9&IvBaP& zXsN+LO_3n3H0Ub2T4K78V<5i)J0*~7#DQx$C+WIWP1lFf4Vsp@;VZgP(@h2(q?--8 zg_dhtq3PC!LnW@v9Wf4| zWj*WO>o}-swRMa6ZM*L@-NpIEHAB-H>-qMRt-%omm~HKKC0pAfA}or?w>m{8M@7u8 z@RrOk@_Bq^6Uu9R2)*nn!+JR_Z-UbyGOID73r@23M5bC7Mdm65f7>ZenKJm47p z^l>A^<|vQPQ!s>yv{uvIc8b&?gcp_1t@8M4tIHbhhzFkSW1}+Bc$gDG(>k&Fucq(U?deY{W`6g9+7nD`|%FAlfdLv|5_xFvqF76ha6E$I;XOSnj z!c#Rj_x#!O%1V3%|4lE?vSKn455p0Y*3$-)?xT&G?l#ZE>N19Qs%NgI9VXSI--JW(Z%vPx_z>+hsevBnEi>r}3YZk6Mw6Q8Nlncr zJw>}r+D#h~vaAlSBx`quImm>=^t4HPXs=28Xs4!UOnR1{)3j2A&zqP+FPQWqy`*Ws zNiXASW{OF#(5u$^j=5Q{(d#B1kme0;up7O}6f)^8dRx;wCcR7l5EtGP6l6i>K;k5C zO}Ve!TO|v>&y+Ih1NzWJLZ(5Qg(3F8F9$BY;&GcMYH zn7%gYAZ;|UJ#sPp#-wj?sY&0__sngRexM&s`WO9#5P6yjMZW6ts<|c|V!SXGJDT)w zI&9JrX^u+sGyP)HuhRTRziax#q(A9|NhcL(g{C5yD=)lCS$)>LUK9ihW%OJhAXmlb*zm?}ec*R;-5JyfOy zkkv}}%R6^>g%T{7Ig8D5t45qLzlpi5fV5(b)O z=UDf4NpN}Tb%dN2Hn^-Wx^ydIMElBwekLx$#R$=-cXH}w)!xOP*%f74^*7Z3H4vf8 z7*BacS!s&Tn^NMf;#BpeOdK(llS~jX)gYD66~Ic0>1cTq<6MUo7lcsOZcj{=%^NIB z{jJr%)dN?XYB*;PBQ(NPBh@IaMw@Dk zI@eTV)i_g)SKZlrYjRAq-&E((Pb?N@MwNIgb8F@g9JDZZUe#=0F8eA96HHYoX2&v& z+)UK!d{a$g{P<#K7^(RIM&B)rGR~SVoGQX|no7(ks^LVpCnhQSr-kt!9|& zQVu7TSLOiP~Rx4m4dO99aajF%r2>;t7J_wx<|fC+oTlzbZ$$;ye6CT} z^xP$wZhe*)?LWg-jjtf{LIf8lTbZZw?6pGDT&@>9SYW6*YA#=A)MW@x&w>RNOAwOJ z@NG_QmAzW-n3fLv*Xgu7wmE-gi#-HY=~;j?(WQ!QQ1&<<%kJ zIX*@`*4pQYi8yn_dcSWkzgF{1HD6VkxQ4R_EnJPz^>luhS1t0+FUy@^AM{)cJ##!I zK5sPx@2))krWM2Jn&9=$ujS4wEfLsGwipPN(XpPY(h9yJgk}~n?A8~(6Z~h)nYv^_ znT)jF8vg%-A?yEJw=I4xmPh(M6%|G0zOn+X7V^pVUzR@8cZ8(>Jr8=rckn47d=Cnu zGYc~yoZDJ(Km{u-hR(1Aa^OlB09V0K zxCW-ewJ;s7gI{=-$p!#sz_0KdKY!;x7uz}pe}EyUH;*1=*$|eIjAds9Anq~l5y(o0 zEnNXlxYf4Su`)CbPQXbXW(5S~|6s_SqQ%%yo+HL|R(1g5r=4x>F7{we$XaNcZ9s9XpCXaGcE94|Y1$G~oOY@xk-nf-Xh)=XiV3Bf{4 z;2w6yF0A3?NE0zhJ|XisYaNG3jmg7gTT(DpY_fa;KSkf@+z1(kIgQZ0p5NNC*J%gyusil(hohhj zGua!()@NcC_Z%1UBE^`^T_-P9ggMxg@y_F~TY6zGvvM?l3zEk)53>lWHsyyQQEM9pL3G@S_V>GGFe)FxbRglyDb-8@!zDl7t4#WIuUPt_dTd1P5V0 zgz=n*LlF3-+k%1gdSL-$Aicr(H^v|u?y_-lutO_tT%7FIEjBJLcJ6u`7HtO}FM)4@ zu-3qbaM%(&n?oFm!z5N}+@mw6s3P-K_!P{+@#y|)5Je^(2V3&GuLS#Z5WrB_9LVF@~aT*+MMBsS-P9YLT&9Jn%8Llk$2jQxys{`PVcLsn0a1D0@aBUE-dpf5zG*=T`uVC8d6Tjq0 zsdLx|;t(brF!3BXiYYvrIdU!xWL{l><6s7FkG3U2j@NNcr;~zLr zf98u$h;gg0rCd16AQ9(60q@BeENAx3gNx8VA3RvW`B({yu?nt6 zFWiO;U^Om;2eBHqU=1{(5B6X!ypD_DU0e)b;pOlHUI9PjQuqb0tO zKQ4f^NwKjp5#T5J@`07P%<<*I!TteU)UumW>7E?IyWN31&0KTx9jd=G*2!;AJpgI( zj#w^byQCULGmBd}yqjR!4NlyA^8Lg{csk!H1c`StogX<}5<(~2S_t#w-Ml;Z@R4>e zWZ-%}qBihPANTU{d_NRo=;Ats59hu->v9{kL_TMhpj{mPXq>=JBBy#FA>W)(fP|hJJIV$br0Xu1bdN7?oHOGqhkE~@*O#HAUq=nLQ$4< zpOx-&K^Pig%1q$KyARLg9b@s?`8Ce&AHv;fx5Jt$r2786|GO!^4 zZw29Pk#4Gk;mr`i3HXi_txa;&y=(0mo#1~i-^qLJwEh3bw9O|!u>;s@o8KZ+Fr{Nl0%QxRpEqDNWFts1$TCk04!4Bq8J=cQAARc!@ zDnARb0jA;Oa4|js(=ot@c@S!`k$-1u;_JneunL>uA$$t9;x5>QyTSh~KFxJt4}6S! zxen}uBlrybfxM~s9H!#)d=q{FbMZy4125q~+>hh&Wt@z!Uj7V;NAS@ z#g$B8U{70*xMt3W+ghrGe4Gs#zJpPa+Rz80Tz^7J=mNxr;TT|CY+PJitX(je?RVM* zqucK+kBgn5aTP@x@+}5i^2>d-FL&e)Yh>+#ubSX%gwvmF?9YdMoXfEt`Xp_zgLeV2 z3H~;O^~6HI77K2+a4-PhG{U!Mn;755ggaz{;~lw{wTY2i&d&r+?|qbsx48I+OFBl! ehsCQ3iB;mQ7VA| delta 6664 zcmZu$3w(}c8^5mWdEedJ^FA9pv0^r zMVQ{#T8YjFmCh%fk3LE&eG&HkuV*v9e)(}f_w&E+`?{~g|GMt`dA+ub4=v*0>nESy zNknH`1vc&Dh1x8#DZuyIyqK3n(bw!6zR%{Re80lW3@?x5O2ZErUZKE)hF3=NL)v{< zXFp=|Dqd~)(MVns#cO$;g6nO5j91$f#T&HQX!GOzgiU>UQ&78`ZGMus*p$Xw4R6zD zl_J}9>?v)qAjDytcW|{fPwQ)q&Cl?&Ht*!;4DZtCZf%~|<^^qD4Dd_*vdypXt2Slx zYldI9sWZP}^B#WFCP$6^I>>Jsej6R$Yxo_T&gFNtc~6(UuL3^M*AI2VN0Hpp@W(dw z;!kw>r;(f<$*pwgGsFAz`MEY<82-|x{`{3TUn}yB_CAc_Z~40bh57pc|G+FL-!>oT69F2{ zCvC13vV}zyI~fp*zc=DD;x`gu(^y_;#2AURX#y_{8i_Ju+cZ((fDy;0$=Z!J5@XX% zyf9K4;VF#~VTn~_t4&k53R_8BK;k9ANTN+a^`;|D0@9Sf*ItrM-6YvaGb7Dynju*JhBBE7amEZC)!^sRL5f;K6Eox>|a*EkooQI|$1&)zWKi zxlXQE!?R$k++fR48KzbitGzHarp}(>s>2AiWTY)6a-$m79frs#TSm(mwW}x0kg+yx zQd`EU0^^Z?GQmh`q?8$%Xk-#o#Q3sNqe`mMeX;B-H!``Zi$7a@+YIlo8fmTC#9*b$g9Z$(K-LrcX zFm=#bX=lu;gQEtG8C6@}q_}G#W6$L#C+{dCX zb03UJxr&%r-K|k-2iGL*LSOYUivbneM)X$iQ8W%#-3#U%arM+$ECY(C&uO9=g3l?=FpGylac!!u9RhtESE|| z%#jCVg(DBjN=F`&hmAbq$SPUw$fGiwDchapPjxr9ak@FQU)DIXR@OPPUX~eo%#jVU z(MW}Yk2~B{o^WK7Y&Pyx6UDYzt&21WM4dY_BXVbJ6`(?LId|qX| z;K+;ek|Qt6D-H+wHusU#wuu*&R_KIR9eGV&cj$NegQ+td+R|O<#6>&wHyw94h8wB7 zdIb{PLr!c^7rf!f9+~ZM1fw{<>Bw6QL*JIYptK|J$h(fbC+{;g_899CVo*i-n9@;> zd;mYO!_kg>C?7fUu{NJ*^QnC1$Ubd8moJQb<;XYkts~zF>hTYb{HTHd$&vk?1zb2F z2aVjSu>ktB`uG<|4#}@Z4m~5!!3^dEyt0pr!%l$@#N7(#S&7Ntrm_E3xTcIEH^FqX|qo0K=Uba+J`qIE^_D2GSOcGX-L1X9|>$RR7BD;$T*c%oaFk`xi`STR;3 z_xhA{tFaa9&PwTI?YH8*Y}l8Q3RhY2x+3A!zS*hif%TTM%4%{-znfDttfn#>JSoZF z1AC-a?qP~K?E)=Aj+Lamt+kRJtC`i@SS=hY#Y%OoG^?d!rOQdTLt0W~D|sJ?yzgF; z)-;%AWjI!A2*jKSZ8DA3#hWb zSe;=AUd}Ss*^YG%EWkF%%rl5rSBV^}i*>GJb+x*=-=%fobCD_;Zj3*n>Y6}>gS;lQqzI>)G?w0ml+@Sv!>4Ey0}2(ole#3j zZSzw9uh`DZYvn$lHtR&ngwqc0T{eC^s_2-q z(yE6$J>lbQXp-HLI?>m(kC?t8i{i8h;z}B)#m#%7ig`~aR80~(;FfnS4ITv6hN93; zBp;2!{Bmke6_iU;>0Fvdg*1b%pj+rVx|M#$EC=$5uBTt<5T3u{Uj$?wrr*fcDuK}h zz38zaYfc%B8~GV7H`mPA|O| zGZxn^^;Q~hzOFQ$3|)!Zgs}teo^H8=POn@+F|_iGmCfk{oy58ril$oF#H@xnB*&?V zVd-tyVjqwQjQH`iwWfJ;FV0W(+=db08_tj!&5^9GB#LI616cY05>Vd$%|WgH>7Xh& zX!{v*BhK)TYR!Y84ytdxutKP%-Zt4eA<7v1PifD>hMi|fGxe6A_8D_yj`h4?jb)SBn{B?8Lb;km_lh9iQtw2mTA8Ga7T zR^vUJQDD_(^xuM=5qS2<*+K2xw8BEq2VNyYlK8=Gn;TOjj-y0Qpk|<01~;KBZc5z| z0S#vltj~Z#YM&-(kA`sepcC8```C0gcjJ7R(unf70RFNl5i&GMeV#@!#3!k{Vf>9b z4;hcJ^k7Y=1MY#s&7MkqC>GIb36;{JQU;jcnvxLkOm2to;VkON*>n!)P*2XKVF>Lg z?f@3$(IohAKD@V-&!H7CTUEXeg?1Pj?g<5=s3!`xDsModab8H&AuAiqSQ%^x$x4Kz zmq*LHy+9}}=kWR58zIT0X?y`}^LrMxCtoet-@v;I;eEq>48y#>hWi=5h(MsUV-#@= zt~j$kG56<-)plqx7f+wkA{8a&h8;9CM8k5cshBB5!!K!H4Gz%`8o32Ctkad9&!YtH z;hCBZ&9J(`m{cCXMTiM7zJxD@_yo9fAYVonUkUSAaCAsKa&a{h0=lhaxE_E*zPiw3W+9h<8j^LZZ2$I(L?K}0Wy`_Nh3mkPNb>d8f@F8%3R z4qgmv1|Y$UXa-!i63*HLXKmp@4Q%QT52-u-G_avJvY|Jvp|_G6*U!tL+d-zwyzp#m z2+y|q@c8iUK7_A<#}Sm?-f3S4T?C}$TrA)2Mpx!pb5yH)Ux{D|CSe|B<2n7W?w(B2yAHY7Jp zv$y2zra6@qS3`4$VC9?;-5I946rJax^A(*JqPxR%kD?1abfKaPLbNDM_bR&BLzgJJ zI7Duk?o+gvhX$7_+$%))hiRF@%RRVK(d8j}AWSP1jj5!ZY(Oz#dT>io_IC1bqle-i z&JEEcHMD9-+}s*k4f`Gq(;A(=))TT$g{%$H`Y=7F=mrnnsOW|eJszefw&VnN)22#_ zt)b0Ba;oV`rZ8>MxmznKP(#}wvuewkB-;*Vf$ZRzb(&-F@j+a>j-YPT(P{|}C*q-? z)i8?S;W(d1poEU36uyxPcog;F(R3w`p{qGK7Wq65KX#3$sXT#Zaw#p~GP;i^(xW_y zHgY*t^JLn^74$Ywp%3{c`ktrKL7q-W_-6W(XW)u-3y$iU+#DZ{*?b#!;#nwew{u^< zgRkV-d>zl>kz9Az>qmzAprQ|lLJ?Fz&4L(;0&^2-0GBA|K&}h;M(AjvDyH&iXo;f0 zb55}o!p34THx!JzmE#&#jtAeBq^+rO#7Ro^SULejJw~06Qe>j{=TgI^sfmdRF%%U2 zEUGUlt>Hd{rB~NSQ_IRzJrM0!bV9o*obR)`_!Iqj+p(HjC;JkS)YXF85)T%i;_%Z# zgJ=7BeeEYHJE$h#uLMcz;nxVw@7R6`!JYX&uLM4)C3sM_R>NJ|-5sXF5cOVPyEj+)KDUw* zYiN$<#@rA+AEFn+^r8;T_mXCw4$KeHOJRCh(S_dh1&S^V(JLW(HB7JRz!Gm@u?{Q= z(d(fidLvAGbY!VF(o08{hUm=@y%nbOb)eGQVYv=ehUo1u?NxMDCH1PI7$o33TC`SO z(mq7*x`+EU3+~SMBi4RT|MyVOzw``P=ZRmdQr3m&{SbW+rVmxnMsHw)4r~n3M&^MXaSD*l^%{_3yO+ zDR@6v^<{l6SWWGaKaZmpJb_xU89aItwO|V+^Hxg7vw*kJV6LKTcspIkPvKAxA*eXI zcn96h)wG14rZrqckMlE#>$4Pmk$0jFJV&4NF4TeD^gBOKfAb5t?Z1f2;7gp#FLNG# z^zX#4a#wy07mC;UGJb%!cZTxU1^L zNH`s&ox}RQ_&0T-BSG+7K*Ubq^qt7{<#-#-cY(kJE$hEcxCUFzt*;XLxmqW9Uj3D? zGsQ)mAp9SMUWHH?@RgaAn3R;1=oJjGeZGfh90i_~c)j7f@o~lXAmfCS7w{eE#9_mo S63@3s;C~b3OZmEI^8WxAZS4vG diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 4232679c0..5880047d8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -100,9 +100,6 @@ public class WorldEdit { static { WorldEditPrefixHandler.register("com.sk89q.worldedit"); getVersion(); - BundledBlockData.getInstance(); // Load block registry - BundledItemData.getInstance(); // Load item registry - LegacyMapper.getInstance(); // Load item registry } private WorldEdit() { @@ -283,6 +280,15 @@ public class WorldEdit { } } + /** + * Load the bundled mappings. + */ + public void loadMappings() { + BundledBlockData.getInstance(); // Load block registry + BundledItemData.getInstance(); // Load item registry + LegacyMapper.getInstance(); // Load item registry + } + /** * Checks to see if the specified radius is within bounds. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 9ed05da68..34c61bb26 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -45,7 +45,6 @@ import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; @@ -78,7 +77,6 @@ class DefaultBlockParser extends InputParser { public BlockStateHolder parseFromInput(String input, ParserContext context) throws InputParseException { String originalInput = input; - input = input.replace("_", " "); input = input.replace(";", "|"); Exception suppressed = null; try { @@ -162,8 +160,7 @@ class DefaultBlockParser extends InputParser { throw new NoMatchException("Bad state format in " + parseableData); } - Property propertyKey = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS) - .getRegistries().getBlockRegistry().getProperties(state.getBlockType()).get(parts[0]); + Property propertyKey = state.getBlockType().getPropertyMap().get(parts[0]); if (propertyKey == null) { throw new NoMatchException("Unknown state " + parts[0] + " for block " + state.getBlockType().getName()); } @@ -176,6 +173,7 @@ class DefaultBlockParser extends InputParser { } catch (NoMatchException e) { throw e; // Pass-through } catch (Exception e) { + e.printStackTrace(); throw new NoMatchException("Unknown state '" + parseableData + "'"); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index 356ad5c58..95c202455 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -165,6 +165,9 @@ public class PlatformManager { if (platform != null) { return platform; } else { + if (preferences.isEmpty()) { + return platforms.get(0); // Use the first available if preferences have not been decided yet. + } throw new NoCapablePlatformException("No platform was found supporting " + capability.name()); } } 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 81d2ed272..4ff6771c4 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 @@ -22,20 +22,17 @@ package com.sk89q.worldedit.extent.transform; import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.registry.state.DirectionalProperty; import com.sk89q.worldedit.registry.state.Property; - -import java.util.Map; +import com.sk89q.worldedit.util.Direction; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; import javax.annotation.Nullable; @@ -127,14 +124,7 @@ public class BlockTransformExtent extends AbstractDelegateExtent { checkNotNull(block); checkNotNull(transform); - Map states = WorldEdit.getInstance().getPlatformManager() - .queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getProperties(block.getBlockType()); - - if (states == null) { - return changedBlock; - } - - for (Property property : states.values()) { + for (Property property : block.getBlockType().getProperties()) { if (property instanceof DirectionalProperty) { Vector value = (Vector) block.getState(property); if (value != null) { @@ -164,11 +154,11 @@ public class BlockTransformExtent extends AbstractDelegateExtent { double closest = -2; boolean found = false; - for (Vector v : state.getValues()) { - double dot = v.normalize().dot(newDirection); + for (Direction v : state.getValues()) { + double dot = v.toVector().normalize().dot(newDirection); if (dot >= closest) { closest = dot; - newValue = v; + newValue = v.toVector(); found = true; } } 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 91589ea84..1168db403 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 @@ -21,15 +21,21 @@ package com.sk89q.worldedit.registry.state; import static com.google.common.base.Preconditions.checkState; +import java.util.List; + public abstract class AbstractProperty implements Property { private String name; + private List values; - public AbstractProperty() { + public AbstractProperty(final String name, final List values) { + this.name = name; + this.values = values; } - public AbstractProperty(final String name) { - this.name = name; + @Override + public List getValues() { + return this.values; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/BooleanProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/BooleanProperty.java index 4acb12f7d..b6502f3ff 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/BooleanProperty.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/BooleanProperty.java @@ -25,14 +25,17 @@ import javax.annotation.Nullable; public class BooleanProperty extends AbstractProperty { - @Override - public List getValues() { - return null; + public BooleanProperty(final String name, final List values) { + super(name, values); } @Nullable @Override public Boolean getValueFor(String string) { - return null; + boolean val = Boolean.parseBoolean(string); + if (!getValues().contains(val)) { + throw new IllegalArgumentException("Invalid boolean value: " + string + ". Must be in " + getValues().toString()); + } + return val; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java index e29a7cc75..ef41a8c0c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java @@ -19,21 +19,25 @@ package com.sk89q.worldedit.registry.state; -import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.util.Direction; import java.util.List; import javax.annotation.Nullable; -public class DirectionalProperty extends AbstractProperty { - @Override - public List getValues() { - return null; +public class DirectionalProperty extends AbstractProperty { + + public DirectionalProperty(final String name, final List values) { + super(name, values); } @Nullable @Override - public Vector getValueFor(final String string) { - return null; + public Direction getValueFor(final String string) { + Direction direction = Direction.valueOf(string); + if (!getValues().contains(direction)) { + throw new IllegalArgumentException("Invalid direction value: " + string + ". Must be in " + getValues().toString()); + } + return direction; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/EnumProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/EnumProperty.java index 37d3bfe20..d593eb062 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/EnumProperty.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/EnumProperty.java @@ -25,14 +25,16 @@ import javax.annotation.Nullable; public class EnumProperty extends AbstractProperty { - @Override - public List getValues() { - return null; + public EnumProperty(final String name, final List values) { + super(name, values); } @Nullable @Override public String getValueFor(String string) { - return null; + if (!getValues().contains(string)) { + throw new IllegalArgumentException("Invalid value: " + string + ". Must be in " + getValues().toString()); + } + return string; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/IntegerProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/IntegerProperty.java index bc08a33ee..fe7b7b7de 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/IntegerProperty.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/IntegerProperty.java @@ -25,14 +25,21 @@ import javax.annotation.Nullable; public class IntegerProperty extends AbstractProperty { - @Override - public List getValues() { - return null; + public IntegerProperty(final String name, final List values) { + super(name, values); } @Nullable @Override public Integer getValueFor(String string) { - return null; + try { + int val = Integer.parseInt(string); + if (!getValues().contains(val)) { + throw new IllegalArgumentException("Invalid int value: " + string + ". Must be in " + getValues().toString()); + } + return val; + } catch (NumberFormatException e) { + throw new IllegalArgumentException("Invalid int value: " + string + ". Not an int."); + } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/Property.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/Property.java index 069b279c5..856bdd850 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/Property.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/Property.java @@ -50,7 +50,8 @@ public interface Property { * * @param string The string * @return The value, or null + * @throws IllegalArgumentException When the value is invalid. */ @Nullable - T getValueFor(String string); + T getValueFor(String string) throws IllegalArgumentException; } 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 5297179f2..3430e431e 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 @@ -21,6 +21,7 @@ package com.sk89q.worldedit.world.block; import com.google.common.collect.ArrayTable; import com.google.common.collect.HashBasedTable; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Table; import com.sk89q.worldedit.registry.state.Property; @@ -28,8 +29,10 @@ import com.sk89q.worldedit.registry.state.Property; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * An immutable class that represents the state a block can be in. @@ -46,7 +49,7 @@ public class BlockState implements BlockStateHolder { BlockState(BlockType blockType) { this.blockType = blockType; - this.values = new HashMap<>(); + this.values = new LinkedHashMap<>(); this.fuzzy = false; } @@ -62,6 +65,34 @@ public class BlockState implements BlockStateHolder { this.fuzzy = true; } + public static Map, Object>, BlockState> generateStateMap(BlockType blockType) { + List properties = blockType.getProperties(); + List> valueLists = Lists.cartesianProduct(properties.stream().map(Property::getValues).collect(Collectors.toList())); + Map, Object>, BlockState> stateMap = new LinkedHashMap<>(); + for (int i = 0; i < valueLists.size(); i++) { + List valueList = valueLists.get(i); + Property property = properties.get(i); + LinkedHashMap, Object> valueMap = new LinkedHashMap<>(); + BlockState stateMaker = new BlockState(blockType); + for (Object value : valueList) { + valueMap.put(property, value); + stateMaker.setState(property, value); + } + stateMap.put(valueMap, stateMaker); + } + + if (stateMap.isEmpty()) { + // No properties. + stateMap.put(new LinkedHashMap<>(), new BlockState(blockType)); + } + + for (BlockState state : stateMap.values()) { + state.populate(stateMap); + } + + return stateMap; + } + public void populate(Map, Object>, BlockState> stateMap) { final Table, Object, BlockState> states = HashBasedTable.create(); @@ -154,7 +185,7 @@ public class BlockState implements BlockStateHolder { * @param value The value * @return The blockstate, for chaining */ - private BlockState setState(final Property property, final V value) { + private BlockState setState(final Property property, final Object value) { this.values.put(property, value); return this; } 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 3dc01ea1a..70584f54a 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 @@ -19,15 +19,21 @@ package com.sk89q.worldedit.world.block; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.registry.NamespacedRegistry; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.LegacyMapper; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import java.util.function.Function; import javax.annotation.Nullable; @@ -38,6 +44,8 @@ public class BlockType { private String id; private BlockState defaultState; + private Map properties; + private BlockMaterial blockMaterial; public BlockType(String id) { this(id, null); @@ -49,7 +57,7 @@ public class BlockType { id = "minecraft:" + id; } this.id = id; - this.defaultState = new BlockState(this); + this.defaultState = new ArrayList<>(BlockState.generateStateMap(this).values()).get(0); if (values != null) { this.defaultState = values.apply(this.defaultState); } @@ -78,6 +86,28 @@ public class BlockType { } } + /** + * Gets the properties of this BlockType in a key->property mapping. + * + * @return The properties map + */ + public Map getPropertyMap() { + if (properties == null) { + properties = ImmutableMap.copyOf(WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getProperties(this)); + } + return this.properties; + } + + /** + * Gets the properties of this BlockType. + * + * @return the properties + */ + public List getProperties() { + return ImmutableList.copyOf(this.getPropertyMap().values()); + } + /** * Gets the default state of this block type. * @@ -112,7 +142,10 @@ public class BlockType { * @return The material */ public BlockMaterial getMaterial() { - return WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this.id); + if (this.blockMaterial == null) { + this.blockMaterial = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this); + } + return this.blockMaterial; } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index ed86f0e03..df22df349 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -36,20 +36,11 @@ public interface BlockRegistry { /** * Get the material for the given block. * - * @param id the block + * @param blockType the block * @return the material, or null if the material information is not known */ @Nullable - BlockMaterial getMaterial(String id); - - /** - * Get an unmodifiable list of values for this property. - * - * @param blockType The block - * @param property the property - * @return the list of values - */ - List getPropertyValues(BlockType blockType, Property property); + BlockMaterial getMaterial(BlockType blockType); /** * Get an unmodifiable map of states for this block. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 2fa75d668..0ec4ca15f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -52,7 +52,7 @@ import javax.annotation.Nullable; public class BundledBlockData { private static final Logger log = Logger.getLogger(BundledBlockData.class.getCanonicalName()); - private static final BundledBlockData INSTANCE = new BundledBlockData(); + private static BundledBlockData INSTANCE; private final Map idMap = new HashMap<>(); @@ -125,6 +125,9 @@ public class BundledBlockData { * @return the instance */ public static BundledBlockData getInstance() { + if (INSTANCE == null) { + INSTANCE = new BundledBlockData(); + } return INSTANCE; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 05a9c9029..1f1a2b317 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -24,7 +24,6 @@ import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockType; import java.util.Collections; -import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -37,13 +36,8 @@ public class BundledBlockRegistry implements BlockRegistry { @Nullable @Override - public BlockMaterial getMaterial(String id) { - return new PassthroughBlockMaterial(BundledBlockData.getInstance().getMaterialById(id)); - } - - @Override - public List getPropertyValues(BlockType blockType, Property property) { - return Collections.emptyList(); // Oof + public BlockMaterial getMaterial(BlockType blockType) { + return new PassthroughBlockMaterial(BundledBlockData.getInstance().getMaterialById(blockType.getId())); } @Nullable diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java index bedbf6a19..00cafb244 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java @@ -51,7 +51,7 @@ import javax.annotation.Nullable; public class BundledItemData { private static final Logger log = Logger.getLogger(BundledItemData.class.getCanonicalName()); - private static final BundledItemData INSTANCE = new BundledItemData(); + private static BundledItemData INSTANCE; private final Map idMap = new HashMap<>(); @@ -108,6 +108,9 @@ public class BundledItemData { * @return the instance */ public static BundledItemData getInstance() { + if (INSTANCE == null) { + INSTANCE = new BundledItemData(); + } return INSTANCE; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index f24ffe1e3..8950b8242 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -46,7 +46,7 @@ import javax.annotation.Nullable; public class LegacyMapper { private static final Logger log = Logger.getLogger(LegacyMapper.class.getCanonicalName()); - private static final LegacyMapper INSTANCE = new LegacyMapper(); + private static LegacyMapper INSTANCE; private BiMap blockMap = HashBiMap.create(); private BiMap itemMap = HashBiMap.create(); @@ -141,6 +141,9 @@ public class LegacyMapper { } public static LegacyMapper getInstance() { + if (INSTANCE == null) { + INSTANCE = new LegacyMapper(); + } return INSTANCE; } From c3d832c3fd838850f92a41f27c24e3c3760501c6 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 18 Jul 2018 17:39:25 +1000 Subject: [PATCH 45/74] State system is done. It works. Finally. Still a few rough edges that need fixing however. --- .../worldedit/bukkit/WorldEditPlugin.java | 4 +- .../bukkit/adapter/impl/Spigot_v1_13_R1.class | Bin 19401 -> 19806 bytes .../extension/factory/DefaultBlockParser.java | 6 ++- .../registry/state/AbstractProperty.java | 3 ++ .../registry/state/DirectionalProperty.java | 2 +- .../worldedit/world/block/BlockState.java | 41 +++++++++++++----- .../world/block/BlockStateHolder.java | 4 +- .../world/registry/BundledBlockData.java | 2 - 8 files changed, 42 insertions(+), 20 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index cbd56f920..057742b92 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -82,6 +82,8 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { WorldEdit worldEdit = WorldEdit.getInstance(); + loadAdapter(); // Need an adapter to work with special blocks with NBT data + // Setup platform server = new BukkitServerInterface(this, getServer()); worldEdit.getPlatformManager().register(server); @@ -101,8 +103,6 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { // Forge WorldEdit and there's (probably) not going to be any other // platforms to be worried about... at the current time of writing WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent()); - - loadAdapter(); // Need an adapter to work with special blocks with NBT data } private void loadConfig() { diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class index f2101f1559f9d3bb1dd4501eda74693cdb116743..8520a5c418da59238164651667d59edfe289a3e6 100644 GIT binary patch delta 6647 zcmZu$2Xs}%)1R4rFPq%AsSrqjG!j}82q01tq<07)0WnAmBya%U?i2$~SWp%EvM1yuEv8c4lX0e>1y#b7UocS&H7buIzag z09vTU7M#Mh(yX(`~ttUz=*SFy!e&IuepQYX#CcKR`{JXr$p>~QSgJj{wM=}3dB^6KU>fd ze-ZIt1F>-+HWAiojc4Tfn>4>`{KJA?_@^}g6UtxG`!NX5;yDk@#Pc5f8~>5!g7)G? z(eqL8QpV#*;e&fIJo%3brVOLM;lTa7_^wjKZ~nRE?ih zU0x3I8d9XNYgkm1qC6Ch=QY*RR9jOW4@{&Oue4DX#ZsIFlPO+Pf~LAWkP;&RslJCA zP(zCvQL^+>G^JWlB*PkOY7zlN^(~k!?@cu|vtX`tn+MWuj0b9A!F)XIq1&mYhgwl< zO>Hb#EMYg4?x74kZ-LiPTMOFI9h%x{YHz_(>R`b#>Zqxcrp^{Dr!E%Q)KybAP2DY6 zK|L&3Nj)|7($w36QtD&DD$3N)HEoF?xMkg zbhpGMThkCt-g_)~PE6WHLp2T4G~9w6G{S-xXr!hbO`|N>MWZb!qg+jSn#Opb8jZEU zkB2pl(=^_K3W@pz3qoijgP$fzZ!#}5U~rX@rq*vBFx(qA#O7Z(}$3(jhK)!;VTXJ|hiVE+sqq(g=d(`$xa zr#CdcY3K;OW$10%j*x86bH~~{>YFwO&e2gr@6fx3j?q3%#|^zlCp4`R;`;^@=>tO_ z(np#;HuMRWa##(0N}t(tYNRE9PA3h0A1uRP)S z#8~t83W|%03v;Gq=G|62t{}H4G(d%fsnAfj z3JX)=Mn$MRmNR}*UT%DGLHwBU`ML2^ z3Ja#>6&8=rD~caeP#AAiZB@sp7`9NwsyK$JQSmB4tGWn{oTdISs<_%atXU-*m89x% zBvgHbW)AOkh-EK~?vm6%H4MX2wy%*<$tp#wRHGWJCR(K#)l@Yzs=2z&R<)*K3;XM+ z6nj&x(RM=ZhHY*agEtGh__@)jmZ}v(xD&r=#p5TX^~fn2mzgugsMe~DrY%OLs|=aH zEknGU=ML3QUfLrxW>_cLXKOd|bWk0I)=6+Gv_5qbJ)JqyOzR>J32jZCgoa*@In%l# zM2;?)oK`fkb(^Va6Y@tDr!hJP=8QEsjZPw@Is%@U2Ep;Fn+S9_I2-S`+s8x&^f0QY z>SYg$Nl?92AA4R*Gj&d7I>~o3Ce9PD`ielmYqKWDCU}mi{zAL+nsu{c6V(9P&Zx|5 zbe6qQ=~!x17Uu(dI?$*=>MpGY8+EtJHfo5v$EcyIjolYxG6%g^7Ez-EX>Q} zH?AZN|6Al{O;v+gO(RbJdS>9vDLk8dY+iBCTwA5}ve!3j6R4->6y|egm-S9-i!L~$ zW|uwI)Sx<}?l1eKS&=K$Q(Q1;3a44;oFbO4>y(j^EoVf|G0Lmv8?`_!H25?xHkNSR z{;B2d_<$YT>XT4}pehds7BDo~_v*T*Ru4)kTH7kdj&7aW_zaxlg7q6Hh>*>IPreaS zp%}&#wg|)dX-NTh^!84V^@?7x6=26rI)kw~MluapXAP{$lK)==*Yf|0Roz=- zwVPvAev{sSn_?wa<6t(2x0+jnm7L;(#KE^}JIIzEx=EX^^87~35bI!!D6`vVB=)-z zv$xrfqmE=e<3~%k1Ry7RywaB-Ok>>+yg6bbCOJA^%&6V|hR*j` z=EO}pt?N21j$S=Sr@K-o>!^01hHMyuj`nO4Y3hR z1j7VO#uQ$!2*|@!)~g^2Mqp#^xgZv@u?hFwkOWznhD|v_P5DyR44Z?7u6$RzjS(5> z_!J9x6(&QF#ugfH*R`-EPph$&#?~6!@Z^Z;nBf>X?v8RcvTnP6j*(Nq0|k7A5|~>s zg4GMmgP=2v#xOTwGMs5_hNP18+G7Vcyc#^|IOBq7Smrq6hB$c0aV7xj z!2-t_?U>5|y9#leA+X9`?8wH7$&RI+u(M-nX#0L_>4^3zIg*g=*!@I^b}V%}@7I>O z9YduHOIXkXyJ9!CDiqSNJ3~-GBs6m1?sDc00lWfjHTKZhlT(MI(hGY#>GEs)9XwZQ zhu%(9hH?Z(aGrS6`3H>g!Qi%~8p8mUD>{3t7%Z*cbcp za@K>9Zna{4xY1L`Kf1nvqLmF5)6oTm%{*r{V*{-AUfaxOe%r+3YeT79Z(MW2=d@E zz8j|aVQRYG0taPKVF|RVfTCLll|wPY9+(DPFYYClnO+Vvh*i(@!z__~KxFT8WWBTh zTloI}5}qT%y+qjSSU2|;S;xA0GN@h!%+J0SiUk~l=l~y(4;EI2!w-x0rAF&=c)-i9 z@$*3igST8cpSqJ*+U0BzcQKZLkttXU$F2~`NNbMW8FM`$9ecr0>;t*H`tz_aqrM-k z!2Ylo?}XQI0Gz-qxPSv0MT58`4aN>Qgt2fBX5mn$$Ve8>0fl#CwwH5zPi2>T=dbm+ zj5=%vWd{h8fy^BWXBluqI58Li*Wk!g+{0>lw`KSa!{H2+aO{F3a3rTgI-mS=a1^+3 zG&?4HT;-@-?p5+S<}p(?nfefT8MvB^(Kz-pglinfkh}!x8pmg3Bwd08jT8Ri5<8K{ z5>DbDUs8Bl-qJePj#$i?dnhwyKNuf8+_!N#EU_mBL_p|1DAMn7y4 zYDfvBBr_?*56|q(6#VakEfHH&eei4rY|D;VRsqjt`|V3z>Uw#mGLhcpgO~j9vPk<% zAiM(n*(v3)8^I6dLflgVo(ia7hhEuvGm7?BCKQ86-2f2>;5468&cWs?*evJj4LFX2 zI-buE6L}|^#L$@xFF_AdfG2P!Y{Xfx z4ex_;oDKW&emI76;3M?H_c#|$<9s-W3*bC1D4 zbRB7na5~H4bu3j%&frm%k~0~z!3>Wi2n)CZu@07IF^Voi^9$e&jCB6`X}m8sGO~II zBZ#jbEX;KclQ?{uMelaj3!ay<_G&v`&v5SS(c=+p?qGseahL6TH_FyFQnAz_q-SuH)6&$Z^;N_3;@_ z?9KcwaT9Ne&q5|{bAmR2i){-YHOGlr41c%uIy*EQdMzrvkkfftkVp3CIL>2-f}uCg z=Wz;ZK|5T)G#6wJ=TEW=IhgM2;j0vQfCVxg-h)+pMJ>Klb3_B2&2q8kb(Np&4vm~+ zuEpvuFl;B|mJ7r7!8?96#kADr-I!ux*sKsak0PDkOa@xg~a_{a~Pgt5VyVZAUm_~2tdd?M6s zCD5?~LO20Gm5Q>hFYjBQ*?;z^=H(q55Drj*M9g$7=CA7pD_GB_|^~K3ALgGVi<8X(6tv%Wh=ECzR&W(4-B!L znJA^edwoaw>A!0M&czkD5`N?blC$LoXvj!=iEF{jTnqe+qupE!%K1>U2NL+1ffXL0-0*`PVcnki* zx8Ywr%IDg5Fah7?Q`j*+I3DLZ@E*3t6MWivAMeBua5R316Zq@-O#GNl{1jK>XZRF; zj-~kJb(m*B9j+FSv+0qX0&+eiOki9tN1Kbpzre>eFXNmTh|L(&PjIe3#c$K_Nd_>m zCsoHYtl)gGtEz9atDp|iYOY$O f=0P;^E)9G`AOGJ&w5;4x+xNXJTP#z*T*7bWf=K=HCv(r8IWuQw&VS~d`@UF%`&XgwK-JFO z0MJ&=wBRc&7P7_yFFtPJ6Ic=qCvdICCoNouPYL^Jjn4$(dX3L&+#rmN8aD;ub28j4 zv$t6IJiefDYY=V=#_jl`Fn3s3iZ56Yj4ug!*+M@CEa-)0J{guG=w}l+>;!!+i;XC-Q1*!O+ z#`i5~gCAJfTMD0s4@RhuNEfc;8!W50)T9Aj| ziTd|Jm>Ps>BKkq&ae4kIO;ie+fA!ZYycA6_7B!|OGK$p{XTcPi7q6*lI3Pt?Fh|~- zX-c%q9RMUf{EnU&* zdPvj5r9IrK@@FDwC#)DJ+9-LR@i&Y zPa!8XJ;wFLJwwyV(m+TAmYxsIL~E6%)ec^ZOS8i&(Y1!Rt@J|u6tp%m5;Z-p>50@7KNIY`+#dUAWJttj+G5~0IH~D*Lod))gk&3=B=or^D zM<C+)-WjeNaTf1~n6zc=TB$pEbe8a0R$z%SQoHQ1;j95}yRr`7dF-5@LU=E#@~ zm1S;}QGr%B8Fe!|&o8%VHO#2t>@+XKHCqRX14m67J9@TJBh*Nv3e_lkbkpIRjLw?TQ2S{?d>kD+uKR4_u3OP z64Szp#?I|Ov1szxF*U$IXxuWT{}sGk5!!n)axk&Rp4&c`(YJJQW)23cacVptd}>1J z>sbcX2{qBq%gil(zs(F6Hgmk0m_09Sl2MaYk-?RmeYCkRp3QED)9v&QA9=KzA*K6B zher0)j@s_uF|E}J_zDny1_j~LTltz8F8$JZax3I#1k1S@1Hox~ea9j^V@Kqq`OdP$ zumoTj{15)(=Q;lK@T~K20W9eoEIrM<&dei`rKS2I>O~$AoMCD?+@;`#2SKbgteyo` zaEae|J_7Q8u%xHe*y_S_#Fn;q<(PI?tUSgmudHK5JGx>;JNCp1H!s#bZCB-_54obb z4npDSI+~5qgPQe1Aq0akm|d{=%>Z45h8n%yG#U(Hj)x_o{IsO$Id&K1#`(l9OPFr0 zV>1NnBj3dMUkFBE1J?Yf1@3?Um8)j|&Q%%bs=SU}Pn}$e*Ep2j;r9IRWTmG0A#v!x zt?gw`U#nwH*F=6LXNb`lBgX6*S0_5LRqxqB_T!MF*_3f3h^a;ZkFYT|VGTD&8jEpq zg=INwU4$@=@m*zGnqq?3WPX2sioVsj44UVsmqCl|{8kqo$Jo+4)hne|Ppw_b;-ofX z18#6vFU6)4F-c6@ojTpmFnyy_t^?C??7$F+agr6x3(T#xF&C4uIctQ#By52#dFgN% ziz#eZK@^O@R35n?4hk@hM{Y=hA()P>IB}W$VbdBj7+yX2dn1#98svl;2Y3mlLa@dx zjcs%cUWJGn+iGm5u{|%2n2jAAC)ac?XD6@gGSG2yI(T6kWIIk;FoMnVR0xJ{Fd92z z4g|68rdr20)i};Pb|aS^m(kVOi5-uC$DCkX5Dm+mVB8Q74>-YiAQ|p;g3*q<(c*6W z1_-M07dx}F;rh@lCo8vb21bI$ zK3qS+&=sf}PUa}oB#{=A*ZFc0(DC%5BC zD{x(czO@^M12}$-12y{Cu|XQI)i@Zqr^TNK&v}laZsj5l!Ry3p25k$@1@{e1DTCqp zTyG=FV5A=k2ek6TsB+#z$Z`NyOR>A0qo6Yb1sE_c><;y?2V`O|@O5BBT#tQV81Lkx*pKtp z9}Z(aypIFm6b`}$I2e<72U_qR2ri|}2ZO@v@difd!?mLWwWE`lN8E$MYUX9aX~xP> zK{BRXMiN)ejXo@3D7zR^H{s0!WsJdFa2T5y&Wp)mRV^D)D;vo&X?IOQS3!)%LXD#s zJr^NIGTCam-)bB**eB!g2h^_j4&Re%)6CphanKGBmfR#q0r73_~kmA*Xdw zep)3MKP(>5svPdKeLb3G-k;;)q^3rD0??r*rs98U?aP>DFDyO^v#ZuEn;M|-=5O5nXi5Yloq6w!%GMOcv2;zhK#xb8P3ZuoS8FxJXfP+Irm?{k(~EJz8s9^BW4UlaxP!8MJ-^2`S?7$i#zAtn1%OXSG~ufLnw!SQ%@vRjoObXH{#? zs=-zggn6nU&H>kK2G@CLa}I(coqyc4=EOxtHV9>0@%7%v$_y+_;`GUl=Ej=+lJ2y# zGw)}89#n9j$Z@Im?npPkz4A09MY|%o{p^ws62TC=46xklZwm$Skv966t3pfhjLd=4(3f0w)yeOxt{E7O_Z z8}DL;YT?~A-985B5@*!o9C!C<-cR|H{+{C8UoAFw9vAWtT#Gn~{8=o;X^-#I!dF=i zd!*Ukhafd5eH>cxz-i-qb6n}t(_fRGJ|tC!ugh>>0J`|0+r~>r(*^!Ziy^WCmPm;# z^}`!}cryTRiC~#iI}eLsnIHBC;DB&#XZmvC+T2GE`r%Lj4vS=!BUveuRepHe4@UxU zR0L}rL7oWK_~Doz-U+}pB3SFJP$Gi0et0(k?+JH9G2~T1DA(ir(qJ~oY4t%lC%evR z1+fy2&xvzij++7DcB1-l=*CN5I$>>b7TqkixA@^BKYSd3PsIE-N3c}{+x+mUA3h7f z=OQR|yxAdwQa^kVfG>p`D27;uWkYoBg0BjcDub_w_~9GI;r4tV{-a@h_umbJYjq{# z?_1tQxrsjwEg6r`bHjLn8^$&U+jedkFG4i#fCPT#Vkr#8m*6IR8E!#8pV9%CgJt|1 zXF1;+cEWP3fc5waY{6YV*oC`!Q(xs~Q3;>p9&Q$U;ZJ-GE+B6;?!yFpgYSlKVg|m& z&0;@xzysJ958}0W2uI^#oP=*P!jG_v$8Z(@^1K?~#WnbW(?Fyaa-j*{k4xG0Na*EU za|ja{*$?7FTot|x&>pI|7>LoD#lV;IZ8g75!)1(eU{7mqVOYUM^H5DIkuS7r!;f$l z { if (propertyKey == null) { throw new NoMatchException("Unknown state " + parts[0] + " for block " + state.getBlockType().getName()); } - Object value = propertyKey.getValueFor(parts[1]); - if (value == null) { + Object value; + try { + value = propertyKey.getValueFor(parts[1]); + } catch (IllegalArgumentException e) { throw new NoMatchException("Unknown value " + parts[1] + " for state " + parts[0]); } 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 1168db403..905d0466b 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 @@ -21,6 +21,9 @@ package com.sk89q.worldedit.registry.state; import static com.google.common.base.Preconditions.checkState; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + import java.util.List; public abstract class AbstractProperty implements Property { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java index ef41a8c0c..32c0e1435 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/DirectionalProperty.java @@ -34,7 +34,7 @@ public class DirectionalProperty extends AbstractProperty { @Nullable @Override public Direction getValueFor(final String string) { - Direction direction = Direction.valueOf(string); + Direction direction = Direction.valueOf(string.toUpperCase()); if (!getValues().contains(direction)) { throw new IllegalArgumentException("Invalid direction value: " + string + ". Must be in " + getValues().toString()); } 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 3430e431e..94159c223 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 @@ -24,10 +24,12 @@ import com.google.common.collect.HashBasedTable; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Table; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.registry.state.Property; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -66,19 +68,28 @@ public class BlockState implements BlockStateHolder { } public static Map, Object>, BlockState> generateStateMap(BlockType blockType) { - List properties = blockType.getProperties(); - List> valueLists = Lists.cartesianProduct(properties.stream().map(Property::getValues).collect(Collectors.toList())); Map, Object>, BlockState> stateMap = new LinkedHashMap<>(); - for (int i = 0; i < valueLists.size(); i++) { - List valueList = valueLists.get(i); - Property property = properties.get(i); - LinkedHashMap, Object> valueMap = new LinkedHashMap<>(); - BlockState stateMaker = new BlockState(blockType); - for (Object value : valueList) { - valueMap.put(property, value); - stateMaker.setState(property, value); + List properties = blockType.getProperties(); + + if (!properties.isEmpty()) { + List> separatedValues = Lists.newArrayList(); + for (Property prop : properties) { + List vals = Lists.newArrayList(); + vals.addAll(prop.getValues()); + separatedValues.add(vals); + } + List> valueLists = Lists.cartesianProduct(separatedValues); + for (List valueList : valueLists) { + Map, Object> valueMap = Maps.newTreeMap(Comparator.comparing(Property::getName)); + BlockState stateMaker = new BlockState(blockType); + for (int i = 0; i < valueList.size(); i++) { + Property property = properties.get(i); + Object value = valueList.get(i); + valueMap.put(property, value); + stateMaker.setState(property, value); + } + stateMap.put(valueMap, stateMaker); } - stateMap.put(valueMap, stateMaker); } if (stateMap.isEmpty()) { @@ -101,7 +112,13 @@ public class BlockState implements BlockStateHolder { property.getValues().forEach(value -> { if(value != entry.getValue()) { - states.put(property, value, stateMap.get(this.withValue(property, value))); + BlockState modifiedState = stateMap.get(this.withValue(property, value)); + if (modifiedState != null) { + states.put(property, value, modifiedState); + } else { + System.out.println(stateMap); + WorldEdit.logger.warning("Found a null state at " + this.withValue(property, value)); + } } }); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java index b8c2a9bee..b31888ee0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java @@ -76,7 +76,9 @@ public interface BlockStateHolder { if (getStates().isEmpty()) { return this.getBlockType().getId(); } else { - String properties = getStates().entrySet().stream().map(entry -> entry.getKey() + "=" + entry.getValue()).collect(Collectors.joining(",")); + String properties = + getStates().entrySet().stream().map(entry -> entry.getKey().getName() + "=" + entry.getValue().toString().toLowerCase()).collect(Collectors.joining( + ",")); return this.getBlockType().getId() + "[" + properties + "]"; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 0ec4ca15f..98987d191 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -133,9 +133,7 @@ public class BundledBlockData { public static class BlockEntry { private String id; - private String unlocalizedName; public String localizedName; - private List aliases; private SimpleBlockMaterial material = new SimpleBlockMaterial(); } From 572bf04482d1736c67db7b2e2f8b3a6f65bcf739 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 19 Jul 2018 12:55:02 +1000 Subject: [PATCH 46/74] Cleanup the bukkit implementation, and update to the 1.13 release items/blocks. --- worldedit-bukkit/build.gradle | 4 - .../sk89q/worldedit/bukkit/BukkitAdapter.java | 151 +- .../worldedit/bukkit/BukkitBlockRegistry.java | 3 +- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 10 +- .../bukkit/BukkitPlayerBlockBag.java | 6 +- .../bukkit/BukkitServerInterface.java | 2 +- .../sk89q/worldedit/bukkit/BukkitUtil.java | 185 - .../sk89q/worldedit/bukkit/BukkitWorld.java | 12 +- .../EditSessionBlockChangeDelegate.java | 4 +- .../bukkit/adapter/impl/Spigot_v1_13_R1.class | Bin 19806 -> 19807 bytes .../worldedit/bukkit/BukkitWorldTest.java | 2 +- .../sk89q/worldedit/blocks/BlockMaterial.java | 42 - .../com/sk89q/worldedit/blocks/Blocks.java | 2 +- .../extension/factory/DefaultBlockParser.java | 2 +- .../worldedit/world/block/BlockTypes.java | 37 +- .../sk89q/worldedit/world/item/ItemTypes.java | 98 +- .../registry/PassthroughBlockMaterial.java | 54 - .../world/registry/SimpleBlockMaterial.java | 60 - .../worldedit/world/registry/blocks.json | 24011 +++++++++------- .../sk89q/worldedit/world/registry/items.json | 8856 ++---- 20 files changed, 17201 insertions(+), 16340 deletions(-) delete mode 100644 worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index ff4da1ee2..7232b2648 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -11,7 +11,6 @@ dependencies { compile project(':worldedit-core') compile 'com.sk89q:dummypermscompat:1.8' compile 'org.bukkit:bukkit:1.13-pre7-R0.1-SNAPSHOT' // zzz -// compile 'org.bukkit:bukkit:1.9.4-R0.1-SNAPSHOT' // zzz testCompile 'org.mockito:mockito-core:1.9.0-rc1' } @@ -36,10 +35,7 @@ jar { shadowJar { dependencies { include(dependency(':worldedit-core')) - include(dependency('com.google.code.gson:gson')) } - - relocate('com.google.gson', 'com.sk89q.worldedit.internal.gson') } build.dependsOn(shadowJar) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java index 306f19b7b..edfbb9c7e 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java @@ -19,22 +19,59 @@ package com.sk89q.worldedit.bukkit; +import com.google.common.base.Function; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.Entity; +import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +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.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.block.data.BlockData; +import org.bukkit.inventory.ItemStack; import static com.google.common.base.Preconditions.checkNotNull; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import javax.annotation.Nullable; + /** * Adapts between Bukkit and WorldEdit equivalent objects. */ -final class BukkitAdapter { +public class BukkitAdapter { private BukkitAdapter() { } + private static final ParserContext TO_BLOCK_CONTEXT = new ParserContext(); + + static { + TO_BLOCK_CONTEXT.setRestricted(false); + } + + /** + * Checks equality between a WorldEdit BlockType and a Bukkit Material + * + * @param blockType The WorldEdit BlockType + * @param type The Bukkit Material + * @return If they are equal + */ + public static boolean equals(BlockType blockType, Material type) { + return Objects.equals(blockType.getId(), type.getKey().toString()); + } + /** * Convert any WorldEdit world into an equivalent wrapped Bukkit world. * @@ -95,7 +132,7 @@ final class BukkitAdapter { */ public static Location adapt(org.bukkit.Location location) { checkNotNull(location); - Vector position = BukkitUtil.toVector(location); + Vector position = asVector(location); return new com.sk89q.worldedit.util.Location( adapt(location.getWorld()), position, @@ -151,6 +188,17 @@ final class BukkitAdapter { location.getPitch()); } + /** + * Create a WorldEdit Vector from a Bukkit location. + * + * @param location The Bukkit location + * @return a WorldEdit vector + */ + public static Vector asVector(org.bukkit.Location location) { + checkNotNull(location); + return new Vector(location.getX(), location.getY(), location.getZ()); + } + /** * Create a WorldEdit entity from a Bukkit entity. * @@ -162,4 +210,103 @@ final class BukkitAdapter { return new BukkitEntity(entity); } + /** + * Create a Bukkit Material form a WorldEdit ItemType + * + * @param itemType The WorldEdit ItemType + * @return The Bukkit Material + */ + public static Material adapt(ItemType itemType) { + checkNotNull(itemType); + if (!itemType.getId().startsWith("minecraft:")) { + throw new IllegalArgumentException("Bukkit only supports Minecraft items"); + } + return Material.getMaterial(itemType.getId().replace("minecraft:", "").toUpperCase()); + } + + /** + * Create a Bukkit Material form a WorldEdit BlockType + * + * @param blockType The WorldEdit BlockType + * @return The Bukkit Material + */ + public static Material adapt(BlockType blockType) { + checkNotNull(blockType); + if (!blockType.getId().startsWith("minecraft:")) { + throw new IllegalArgumentException("Bukkit only supports Minecraft blocks"); + } + return Material.getMaterial(blockType.getId().replace("minecraft:", "").toUpperCase()); + } + + private static Map blockStateCache = new HashMap<>(); + + /** + * Create a WorldEdit BlockState from a Bukkit BlockData + * + * @param blockData The Bukkit BlockData + * @return The WorldEdit BlockState + */ + public static BlockState adapt(BlockData blockData) { + checkNotNull(blockData); + return blockStateCache.computeIfAbsent(blockData.getAsString(), new Function() { + @Nullable + @Override + public BlockState apply(@Nullable String input) { + try { + return WorldEdit.getInstance().getBlockFactory().parseFromInput(input, TO_BLOCK_CONTEXT).toImmutableState(); + } catch (InputParseException e) { + e.printStackTrace(); + return null; + } + } + }); + } + + /** + * Create a Bukkit BlockData from a WorldEdit BlockStateHolder + * + * @param block The WorldEdit BlockStateHolder + * @return The Bukkit BlockData + */ + public static BlockData adapt(BlockStateHolder block) { + checkNotNull(block); + return Bukkit.createBlockData(block.getAsString()); + } + + /** + * Create a WorldEdit BlockState from a Bukkit ItemStack + * + * @param itemStack The Bukkit ItemStack + * @return The WorldEdit BlockState + */ + public static BlockState asBlockState(ItemStack itemStack) { + checkNotNull(itemStack); + if (itemStack.getType().isBlock()) { + return adapt(itemStack.getType().createBlockData()); + } else { + return BlockTypes.AIR.getDefaultState(); + } + } + + /** + * Create a WorldEdit BaseItemStack from a Bukkit ItemStack + * + * @param itemStack The Bukkit ItemStack + * @return The WorldEdit BaseItemStack + */ + public static BaseItemStack adapt(ItemStack itemStack) { + checkNotNull(itemStack); + return new BaseItemStack(ItemTypes.get(itemStack.getType().getKey().toString()), itemStack.getAmount()); + } + + /** + * Create a Bukkit ItemStack from a WorldEdit BaseItemStack + * + * @param item The WorldEdit BaseItemStack + * @return The Bukkit ItemStack + */ + public static ItemStack adapt(BaseItemStack item) { + checkNotNull(item); + return new ItemStack(adapt(item.getType()), item.getAmount()); + } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java index 8c3ef7c9d..32f73967c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.registry.BundledBlockRegistry; import com.sk89q.worldedit.world.registry.PassthroughBlockMaterial; import org.bukkit.Material; @@ -39,7 +38,7 @@ public class BukkitBlockRegistry extends BundledBlockRegistry { @Nullable @Override public BlockMaterial getMaterial(BlockType blockType) { - return materialMap.computeIfAbsent(BukkitUtil.toMaterial(blockType), + return materialMap.computeIfAbsent(BukkitAdapter.adapt(blockType), material -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), material)); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index 983e61770..eac2dc0af 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -61,7 +61,7 @@ public class BukkitPlayer extends AbstractPlayerActor { ItemStack itemStack = handSide == HandSide.MAIN_HAND ? player.getInventory().getItemInMainHand() : player.getInventory().getItemInOffHand(); - return BukkitUtil.toBaseItemStack(itemStack); + return BukkitAdapter.adapt(itemStack); } @Override @@ -69,7 +69,7 @@ public class BukkitPlayer extends AbstractPlayerActor { ItemStack itemStack = handSide == HandSide.MAIN_HAND ? player.getInventory().getItemInMainHand() : player.getInventory().getItemInOffHand(); - return new BaseBlock(BukkitUtil.toBlock(itemStack)); + return new BaseBlock(BukkitAdapter.asBlockState(itemStack)); } @Override @@ -79,7 +79,7 @@ public class BukkitPlayer extends AbstractPlayerActor { @Override public void giveItem(BaseItemStack itemStack) { - player.getInventory().addItem(BukkitUtil.toItemStack(itemStack)); + player.getInventory().addItem(BukkitAdapter.adapt(itemStack)); } @Override @@ -135,7 +135,7 @@ public class BukkitPlayer extends AbstractPlayerActor { @Override public World getWorld() { - return BukkitUtil.getWorld(player.getWorld()); + return BukkitAdapter.adapt(player.getWorld()); } @Override @@ -176,7 +176,7 @@ public class BukkitPlayer extends AbstractPlayerActor { @Override public com.sk89q.worldedit.util.Location getLocation() { Location nativeLocation = player.getLocation(); - Vector position = BukkitUtil.toVector(nativeLocation); + Vector position = BukkitAdapter.asVector(nativeLocation); return new com.sk89q.worldedit.util.Location( getWorld(), position, diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index 6c13a12c8..cc0ce26df 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -79,7 +79,7 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (!BukkitUtil.equals(blockState.getBlockType(), bukkitItem.getType())) { + if (!BukkitAdapter.equals(blockState.getBlockType(), bukkitItem.getType())) { // Type id doesn't fit continue; } @@ -132,7 +132,7 @@ public class BukkitPlayerBlockBag extends BlockBag { continue; } - if (!BukkitUtil.equals(blockState.getBlockType(), bukkitItem.getType())) { + if (!BukkitAdapter.equals(blockState.getBlockType(), bukkitItem.getType())) { // Type id doesn't fit continue; } @@ -158,7 +158,7 @@ public class BukkitPlayerBlockBag extends BlockBag { } if (freeSlot > -1) { - items[freeSlot] = new ItemStack(BukkitUtil.toItemStack(new BaseItemStack(blockState.getBlockType().getItemType(), amount))); + items[freeSlot] = BukkitAdapter.adapt(new BaseItemStack(blockState.getBlockType().getItemType(), amount)); return; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java index e66fdaa40..3e8f4bcf9 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java @@ -87,7 +87,7 @@ public class BukkitServerInterface implements MultiUserPlatform { List ret = new ArrayList<>(worlds.size()); for (World world : worlds) { - ret.add(BukkitUtil.getWorld(world)); + ret.add(BukkitAdapter.adapt(world)); } return ret; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java deleted file mode 100644 index bb981c79c..000000000 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.bukkit; - -import com.sk89q.worldedit.BlockVector; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.extension.input.InputParseException; -import com.sk89q.worldedit.extension.input.ParserContext; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.util.Location; -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.item.ItemType; -import com.sk89q.worldedit.world.item.ItemTypes; -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.Server; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.data.BlockData; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -import java.util.List; -import java.util.Objects; - -public final class BukkitUtil { - - private BukkitUtil() { - } - - private static final ParserContext TO_BLOCK_CONTEXT = new ParserContext(); - - static { - TO_BLOCK_CONTEXT.setRestricted(false); - } - - public static com.sk89q.worldedit.world.World getWorld(World w) { - return new BukkitWorld(w); - } - - public static BlockVector toVector(Block block) { - return new BlockVector(block.getX(), block.getY(), block.getZ()); - } - - public static BlockVector toVector(BlockFace face) { - return new BlockVector(face.getModX(), face.getModY(), face.getModZ()); - } - - public static Vector toVector(org.bukkit.Location loc) { - return new Vector(loc.getX(), loc.getY(), loc.getZ()); - } - - public static Location toLocation(org.bukkit.Location loc) { - return new Location( - getWorld(loc.getWorld()), - new Vector(loc.getX(), loc.getY(), loc.getZ()), - loc.getYaw(), loc.getPitch() - ); - } - - public static Vector toVector(org.bukkit.util.Vector vector) { - return new Vector(vector.getX(), vector.getY(), vector.getZ()); - } - - public static org.bukkit.Location toLocation(World world, Vector pt) { - return new org.bukkit.Location(world, pt.getX(), pt.getY(), pt.getZ()); - } - - public static org.bukkit.Location center(org.bukkit.Location loc) { - return new org.bukkit.Location( - loc.getWorld(), - loc.getBlockX() + 0.5, - loc.getBlockY() + 0.5, - loc.getBlockZ() + 0.5, - loc.getPitch(), - loc.getYaw() - ); - } - - public static Player matchSinglePlayer(Server server, String name) { - List players = server.matchPlayer(name); - if (players.isEmpty()) { - return null; - } - return players.get(0); - } - - /** - * Bukkit's Location class has serious problems with floating point - * precision. - */ - @SuppressWarnings("RedundantIfStatement") - public static boolean equals(org.bukkit.Location a, org.bukkit.Location b) { - if (Math.abs(a.getX() - b.getX()) > EQUALS_PRECISION) return false; - if (Math.abs(a.getY() - b.getY()) > EQUALS_PRECISION) return false; - if (Math.abs(a.getZ() - b.getZ()) > EQUALS_PRECISION) return false; - return true; - } - - public static boolean equals(BlockType blockType, Material type) { - return Objects.equals(blockType.getId(), type.getKey().toString()); - } - - public static final double EQUALS_PRECISION = 0.0001; - - public static org.bukkit.Location toLocation(Location location) { - Vector pt = location.toVector(); - return new org.bukkit.Location( - toWorld(location.getExtent()), - pt.getX(), pt.getY(), pt.getZ(), - location.getYaw(), location.getPitch() - ); - } - - public static World toWorld(final Extent world) { - return ((BukkitWorld) world).getWorld(); - } - - public static Material toMaterial(ItemType itemType) { - if (!itemType.getId().startsWith("minecraft:")) { - throw new IllegalArgumentException("Bukkit only supports Minecraft items"); - } - return Material.getMaterial(itemType.getId().replace("minecraft:", "").toUpperCase()); - } - - public static Material toMaterial(BlockType blockType) { - if (!blockType.getId().startsWith("minecraft:")) { - throw new IllegalArgumentException("Bukkit only supports Minecraft blocks"); - } - return Material.getMaterial(blockType.getId().replace("minecraft:", "").toUpperCase()); - } - - public static BlockState toBlock(BlockData blockData) { - try { - return WorldEdit.getInstance().getBlockFactory().parseFromInput(blockData.getAsString(), TO_BLOCK_CONTEXT).toImmutableState(); - } catch (InputParseException e) { - e.printStackTrace(); - } - return null; - } - - public static BlockData toBlock(BlockStateHolder block) { - return Bukkit.createBlockData(block.getAsString()); - } - - public static BlockState toBlock(ItemStack itemStack) throws WorldEditException { - if (itemStack.getType().isBlock()) { - return toBlock(itemStack.getType().createBlockData()); - } else { - return BlockTypes.AIR.getDefaultState(); - } - } - - public static BaseItemStack toBaseItemStack(ItemStack itemStack) { - return new BaseItemStack(ItemTypes.get(itemStack.getType().getKey().toString()), itemStack.getAmount()); - } - - public static ItemStack toItemStack(BaseItemStack item) { - return new ItemStack(toMaterial(item.getType()), item.getAmount()); - } -} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 60219b6c9..12f2ca8b0 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -89,7 +89,7 @@ public class BukkitWorld extends AbstractWorld { List ents = world.getEntities(); List entities = new ArrayList<>(); for (Entity ent : ents) { - if (region.contains(BukkitUtil.toVector(ent.getLocation()))) { + if (region.contains(BukkitAdapter.asVector(ent.getLocation()))) { entities.add(BukkitAdapter.adapt(ent)); } } @@ -284,14 +284,14 @@ public class BukkitWorld extends AbstractWorld { public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Vector pt) { World world = getWorld(); TreeType bukkitType = toBukkitTreeType(type); - return type != null && world.generateTree(BukkitUtil.toLocation(world, pt), bukkitType, + return type != null && world.generateTree(BukkitAdapter.adapt(world, pt), bukkitType, new EditSessionBlockChangeDelegate(editSession)); } @Override public void dropItem(Vector pt, BaseItemStack item) { World world = getWorld(); - world.dropItemNaturally(BukkitUtil.toLocation(world, pt), BukkitUtil.toItemStack(item)); + world.dropItemNaturally(BukkitAdapter.adapt(world, pt), BukkitAdapter.adapt(item)); } @Override @@ -343,7 +343,7 @@ public class BukkitWorld extends AbstractWorld { return false; } - world.playEffect(BukkitUtil.toLocation(world, position), effect, data); + world.playEffect(BukkitAdapter.adapt(world, position), effect, data); return true; } @@ -356,7 +356,7 @@ public class BukkitWorld extends AbstractWorld { @Override public com.sk89q.worldedit.world.block.BlockState getBlock(Vector position) { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - return BukkitUtil.toBlock(bukkitBlock.getBlockData()); + return BukkitAdapter.adapt(bukkitBlock.getBlockData()); } @Override @@ -366,7 +366,7 @@ public class BukkitWorld extends AbstractWorld { return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight); } else { Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - bukkitBlock.setBlockData(BukkitUtil.toBlock(block), notifyAndLight); + bukkitBlock.setBlockData(BukkitAdapter.adapt(block), notifyAndLight); return true; } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java index c492d8158..24e14d964 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java @@ -40,7 +40,7 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { @Override public boolean setBlockData(int x, int y, int z, BlockData blockData) { try { - editSession.setBlock(new Vector(x, y, z), BukkitUtil.toBlock(blockData)); + editSession.setBlock(new Vector(x, y, z), BukkitAdapter.adapt(blockData)); } catch (MaxChangedBlocksException e) { return false; } @@ -49,7 +49,7 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate { @Override public BlockData getBlockData(int x, int y, int z) { - return BukkitUtil.toBlock(editSession.getBlock(new Vector(x, y, z))); + return BukkitAdapter.adapt(editSession.getBlock(new Vector(x, y, z))); } @Override diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class index 8520a5c418da59238164651667d59edfe289a3e6..3be81c1a3d8f72167fb23b2ee57a9aaf0588fcec 100644 GIT binary patch delta 40 tcmcaNi}C&}#tmFrj2e>@wL~V%Yw_|srX&`Wq!uwUuqJ|7o2|4|lmQSp3|asH delta 41 xcmcaVi}Btp#tmFrjH;6_C`gMqm1bvWmV}mM<}fm_m*hL; { text[2] = blockAndExtraData.length > 3 ? blockAndExtraData[3] : ""; text[3] = blockAndExtraData.length > 4 ? blockAndExtraData[4] : ""; return new SignBlock(state, text); - } else if (blockType == BlockTypes.MOB_SPAWNER) { + } else if (blockType == BlockTypes.SPAWNER) { // Allow setting mob spawn type if (blockAndExtraData.length > 1) { String mobName = blockAndExtraData[1]; 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 877b113ff..f2352d189 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 @@ -26,7 +26,6 @@ import javax.annotation.Nullable; */ public final class BlockTypes { - public static final BlockType ACACIA_BARK = register("minecraft:acacia_bark"); public static final BlockType ACACIA_BUTTON = register("minecraft:acacia_button"); public static final BlockType ACACIA_DOOR = register("minecraft:acacia_door"); public static final BlockType ACACIA_FENCE = register("minecraft:acacia_fence"); @@ -39,6 +38,7 @@ public final class BlockTypes { public static final BlockType ACACIA_SLAB = register("minecraft:acacia_slab"); public static final BlockType ACACIA_STAIRS = register("minecraft:acacia_stairs"); public static final BlockType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor"); + public static final BlockType ACACIA_WOOD = register("minecraft:acacia_wood"); public static final BlockType ACTIVATOR_RAIL = register("minecraft:activator_rail"); public static final BlockType AIR = register("minecraft:air"); public static final BlockType ALLIUM = register("minecraft:allium"); @@ -51,7 +51,6 @@ public final class BlockTypes { public static final BlockType BEACON = register("minecraft:beacon"); public static final BlockType BEDROCK = register("minecraft:bedrock"); public static final BlockType BEETROOTS = register("minecraft:beetroots"); - public static final BlockType BIRCH_BARK = register("minecraft:birch_bark"); public static final BlockType BIRCH_BUTTON = register("minecraft:birch_button"); public static final BlockType BIRCH_DOOR = register("minecraft:birch_door"); public static final BlockType BIRCH_FENCE = register("minecraft:birch_fence"); @@ -64,6 +63,7 @@ public final class BlockTypes { public static final BlockType BIRCH_SLAB = register("minecraft:birch_slab"); public static final BlockType BIRCH_STAIRS = register("minecraft:birch_stairs"); public static final BlockType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor"); + public static final BlockType BIRCH_WOOD = register("minecraft:birch_wood"); public static final BlockType BLACK_BANNER = register("minecraft:black_banner"); public static final BlockType BLACK_BED = register("minecraft:black_bed"); public static final BlockType BLACK_CARPET = register("minecraft:black_carpet"); @@ -95,6 +95,7 @@ public final class BlockTypes { public static final BlockType BRAIN_CORAL = register("minecraft:brain_coral"); public static final BlockType BRAIN_CORAL_BLOCK = register("minecraft:brain_coral_block"); public static final BlockType BRAIN_CORAL_FAN = register("minecraft:brain_coral_fan"); + public static final BlockType BRAIN_CORAL_WALL_FAN = register("minecraft:brain_coral_wall_fan"); public static final BlockType BREWING_STAND = register("minecraft:brewing_stand"); public static final BlockType BRICK_SLAB = register("minecraft:brick_slab"); public static final BlockType BRICK_STAIRS = register("minecraft:brick_stairs"); @@ -117,6 +118,7 @@ public final class BlockTypes { public static final BlockType BUBBLE_CORAL = register("minecraft:bubble_coral"); public static final BlockType BUBBLE_CORAL_BLOCK = register("minecraft:bubble_coral_block"); public static final BlockType BUBBLE_CORAL_FAN = register("minecraft:bubble_coral_fan"); + public static final BlockType BUBBLE_CORAL_WALL_FAN = register("minecraft:bubble_coral_wall_fan"); public static final BlockType CACTUS = register("minecraft:cactus"); public static final BlockType CAKE = register("minecraft:cake"); public static final BlockType CARROTS = register("minecraft:carrots"); @@ -165,7 +167,6 @@ public final class BlockTypes { public static final BlockType CYAN_WOOL = register("minecraft:cyan_wool"); public static final BlockType DAMAGED_ANVIL = register("minecraft:damaged_anvil"); public static final BlockType DANDELION = register("minecraft:dandelion"); - public static final BlockType DARK_OAK_BARK = register("minecraft:dark_oak_bark"); public static final BlockType DARK_OAK_BUTTON = register("minecraft:dark_oak_button"); public static final BlockType DARK_OAK_DOOR = register("minecraft:dark_oak_door"); public static final BlockType DARK_OAK_FENCE = register("minecraft:dark_oak_fence"); @@ -178,16 +179,27 @@ public final class BlockTypes { public static final BlockType DARK_OAK_SLAB = register("minecraft:dark_oak_slab"); public static final BlockType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs"); public static final BlockType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor"); + public static final BlockType DARK_OAK_WOOD = register("minecraft:dark_oak_wood"); public static final BlockType DARK_PRISMARINE = register("minecraft:dark_prismarine"); public static final BlockType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab"); public static final BlockType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs"); public static final BlockType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector"); public static final BlockType DEAD_BRAIN_CORAL_BLOCK = register("minecraft:dead_brain_coral_block"); + public static final BlockType DEAD_BRAIN_CORAL_FAN = register("minecraft:dead_brain_coral_fan"); + public static final BlockType DEAD_BRAIN_CORAL_WALL_FAN = register("minecraft:dead_brain_coral_wall_fan"); public static final BlockType DEAD_BUBBLE_CORAL_BLOCK = register("minecraft:dead_bubble_coral_block"); + public static final BlockType DEAD_BUBBLE_CORAL_FAN = register("minecraft:dead_bubble_coral_fan"); + public static final BlockType DEAD_BUBBLE_CORAL_WALL_FAN = register("minecraft:dead_bubble_coral_wall_fan"); public static final BlockType DEAD_BUSH = register("minecraft:dead_bush"); public static final BlockType DEAD_FIRE_CORAL_BLOCK = register("minecraft:dead_fire_coral_block"); + public static final BlockType DEAD_FIRE_CORAL_FAN = register("minecraft:dead_fire_coral_fan"); + public static final BlockType DEAD_FIRE_CORAL_WALL_FAN = register("minecraft:dead_fire_coral_wall_fan"); public static final BlockType DEAD_HORN_CORAL_BLOCK = register("minecraft:dead_horn_coral_block"); + public static final BlockType DEAD_HORN_CORAL_FAN = register("minecraft:dead_horn_coral_fan"); + public static final BlockType DEAD_HORN_CORAL_WALL_FAN = register("minecraft:dead_horn_coral_wall_fan"); public static final BlockType DEAD_TUBE_CORAL_BLOCK = register("minecraft:dead_tube_coral_block"); + public static final BlockType DEAD_TUBE_CORAL_FAN = register("minecraft:dead_tube_coral_fan"); + public static final BlockType DEAD_TUBE_CORAL_WALL_FAN = register("minecraft:dead_tube_coral_wall_fan"); public static final BlockType DETECTOR_RAIL = register("minecraft:detector_rail"); public static final BlockType DIAMOND_BLOCK = register("minecraft:diamond_block"); public static final BlockType DIAMOND_ORE = register("minecraft:diamond_ore"); @@ -215,6 +227,7 @@ public final class BlockTypes { public static final BlockType FIRE_CORAL = register("minecraft:fire_coral"); public static final BlockType FIRE_CORAL_BLOCK = register("minecraft:fire_coral_block"); public static final BlockType FIRE_CORAL_FAN = register("minecraft:fire_coral_fan"); + public static final BlockType FIRE_CORAL_WALL_FAN = register("minecraft:fire_coral_wall_fan"); public static final BlockType FLOWER_POT = register("minecraft:flower_pot"); public static final BlockType FROSTED_ICE = register("minecraft:frosted_ice"); public static final BlockType FURNACE = register("minecraft:furnace"); @@ -258,6 +271,7 @@ public final class BlockTypes { public static final BlockType HORN_CORAL = register("minecraft:horn_coral"); public static final BlockType HORN_CORAL_BLOCK = register("minecraft:horn_coral_block"); public static final BlockType HORN_CORAL_FAN = register("minecraft:horn_coral_fan"); + public static final BlockType HORN_CORAL_WALL_FAN = register("minecraft:horn_coral_wall_fan"); public static final BlockType ICE = register("minecraft:ice"); public static final BlockType INFESTED_CHISELED_STONE_BRICKS = register("minecraft:infested_chiseled_stone_bricks"); public static final BlockType INFESTED_COBBLESTONE = register("minecraft:infested_cobblestone"); @@ -272,7 +286,6 @@ public final class BlockTypes { public static final BlockType IRON_TRAPDOOR = register("minecraft:iron_trapdoor"); public static final BlockType JACK_O_LANTERN = register("minecraft:jack_o_lantern"); public static final BlockType JUKEBOX = register("minecraft:jukebox"); - public static final BlockType JUNGLE_BARK = register("minecraft:jungle_bark"); public static final BlockType JUNGLE_BUTTON = register("minecraft:jungle_button"); public static final BlockType JUNGLE_DOOR = register("minecraft:jungle_door"); public static final BlockType JUNGLE_FENCE = register("minecraft:jungle_fence"); @@ -285,6 +298,7 @@ public final class BlockTypes { public static final BlockType JUNGLE_SLAB = register("minecraft:jungle_slab"); public static final BlockType JUNGLE_STAIRS = register("minecraft:jungle_stairs"); public static final BlockType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor"); + public static final BlockType JUNGLE_WOOD = register("minecraft:jungle_wood"); public static final BlockType KELP = register("minecraft:kelp"); public static final BlockType KELP_PLANT = register("minecraft:kelp_plant"); public static final BlockType LADDER = register("minecraft:ladder"); @@ -347,7 +361,6 @@ public final class BlockTypes { public static final BlockType MAGMA_BLOCK = register("minecraft:magma_block"); public static final BlockType MELON = register("minecraft:melon"); public static final BlockType MELON_STEM = register("minecraft:melon_stem"); - public static final BlockType MOB_SPAWNER = register("minecraft:mob_spawner"); public static final BlockType MOSSY_COBBLESTONE = register("minecraft:mossy_cobblestone"); public static final BlockType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall"); public static final BlockType MOSSY_STONE_BRICKS = register("minecraft:mossy_stone_bricks"); @@ -358,12 +371,12 @@ public final class BlockTypes { public static final BlockType NETHER_BRICK_SLAB = register("minecraft:nether_brick_slab"); public static final BlockType NETHER_BRICK_STAIRS = register("minecraft:nether_brick_stairs"); public static final BlockType NETHER_BRICKS = register("minecraft:nether_bricks"); + public static final BlockType NETHER_PORTAL = register("minecraft:nether_portal"); public static final BlockType NETHER_QUARTZ_ORE = register("minecraft:nether_quartz_ore"); public static final BlockType NETHER_WART = register("minecraft:nether_wart"); public static final BlockType NETHER_WART_BLOCK = register("minecraft:nether_wart_block"); public static final BlockType NETHERRACK = register("minecraft:netherrack"); public static final BlockType NOTE_BLOCK = register("minecraft:note_block"); - public static final BlockType OAK_BARK = register("minecraft:oak_bark"); public static final BlockType OAK_BUTTON = register("minecraft:oak_button"); public static final BlockType OAK_DOOR = register("minecraft:oak_door"); public static final BlockType OAK_FENCE = register("minecraft:oak_fence"); @@ -376,6 +389,7 @@ public final class BlockTypes { public static final BlockType OAK_SLAB = register("minecraft:oak_slab"); public static final BlockType OAK_STAIRS = register("minecraft:oak_stairs"); public static final BlockType OAK_TRAPDOOR = register("minecraft:oak_trapdoor"); + public static final BlockType OAK_WOOD = register("minecraft:oak_wood"); public static final BlockType OBSERVER = register("minecraft:observer"); public static final BlockType OBSIDIAN = register("minecraft:obsidian"); public static final BlockType ORANGE_BANNER = register("minecraft:orange_banner"); @@ -417,7 +431,6 @@ public final class BlockTypes { public static final BlockType POLISHED_DIORITE = register("minecraft:polished_diorite"); public static final BlockType POLISHED_GRANITE = register("minecraft:polished_granite"); public static final BlockType POPPY = register("minecraft:poppy"); - public static final BlockType PORTAL = register("minecraft:portal"); public static final BlockType POTATOES = register("minecraft:potatoes"); public static final BlockType POTTED_ACACIA_SAPLING = register("minecraft:potted_acacia_sapling"); public static final BlockType POTTED_ALLIUM = register("minecraft:potted_allium"); @@ -518,8 +531,8 @@ public final class BlockTypes { public static final BlockType SNOW = register("minecraft:snow"); public static final BlockType SNOW_BLOCK = register("minecraft:snow_block"); public static final BlockType SOUL_SAND = register("minecraft:soul_sand"); + public static final BlockType SPAWNER = register("minecraft:spawner"); public static final BlockType SPONGE = register("minecraft:sponge"); - public static final BlockType SPRUCE_BARK = register("minecraft:spruce_bark"); public static final BlockType SPRUCE_BUTTON = register("minecraft:spruce_button"); public static final BlockType SPRUCE_DOOR = register("minecraft:spruce_door"); public static final BlockType SPRUCE_FENCE = register("minecraft:spruce_fence"); @@ -532,6 +545,7 @@ public final class BlockTypes { public static final BlockType SPRUCE_SLAB = register("minecraft:spruce_slab"); public static final BlockType SPRUCE_STAIRS = register("minecraft:spruce_stairs"); public static final BlockType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor"); + public static final BlockType SPRUCE_WOOD = register("minecraft:spruce_wood"); public static final BlockType STICKY_PISTON = register("minecraft:sticky_piston"); public static final BlockType STONE = register("minecraft:stone"); public static final BlockType STONE_BRICK_SLAB = register("minecraft:stone_brick_slab"); @@ -541,11 +555,17 @@ public final class BlockTypes { public static final BlockType STONE_PRESSURE_PLATE = register("minecraft:stone_pressure_plate"); public static final BlockType STONE_SLAB = register("minecraft:stone_slab"); public static final BlockType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log"); + public static final BlockType STRIPPED_ACACIA_WOOD = register("minecraft:stripped_acacia_wood"); public static final BlockType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log"); + public static final BlockType STRIPPED_BIRCH_WOOD = register("minecraft:stripped_birch_wood"); public static final BlockType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log"); + public static final BlockType STRIPPED_DARK_OAK_WOOD = register("minecraft:stripped_dark_oak_wood"); public static final BlockType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log"); + public static final BlockType STRIPPED_JUNGLE_WOOD = register("minecraft:stripped_jungle_wood"); public static final BlockType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log"); + public static final BlockType STRIPPED_OAK_WOOD = register("minecraft:stripped_oak_wood"); public static final BlockType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log"); + public static final BlockType STRIPPED_SPRUCE_WOOD = register("minecraft:stripped_spruce_wood"); public static final BlockType STRUCTURE_BLOCK = register("minecraft:structure_block"); public static final BlockType STRUCTURE_VOID = register("minecraft:structure_void"); public static final BlockType SUGAR_CANE = register("minecraft:sugar_cane"); @@ -561,6 +581,7 @@ public final class BlockTypes { public static final BlockType TUBE_CORAL = register("minecraft:tube_coral"); public static final BlockType TUBE_CORAL_BLOCK = register("minecraft:tube_coral_block"); public static final BlockType TUBE_CORAL_FAN = register("minecraft:tube_coral_fan"); + public static final BlockType TUBE_CORAL_WALL_FAN = register("minecraft:tube_coral_wall_fan"); public static final BlockType TURTLE_EGG = register("minecraft:turtle_egg"); public static final BlockType VINE = register("minecraft:vine"); public static final BlockType VOID_AIR = register("minecraft:void_air"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java index cd66a0174..918fde039 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java @@ -23,9 +23,9 @@ import javax.annotation.Nullable; public final class ItemTypes { - public static final ItemType ACACIA_BARK = register("minecraft:acacia_bark"); public static final ItemType ACACIA_BOAT = register("minecraft:acacia_boat"); public static final ItemType ACACIA_BUTTON = register("minecraft:acacia_button"); + public static final ItemType ACACIA_DOOR = register("minecraft:acacia_door"); public static final ItemType ACACIA_FENCE = register("minecraft:acacia_fence"); public static final ItemType ACACIA_FENCE_GATE = register("minecraft:acacia_fence_gate"); public static final ItemType ACACIA_LEAVES = register("minecraft:acacia_leaves"); @@ -36,6 +36,7 @@ public final class ItemTypes { public static final ItemType ACACIA_SLAB = register("minecraft:acacia_slab"); public static final ItemType ACACIA_STAIRS = register("minecraft:acacia_stairs"); public static final ItemType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor"); + public static final ItemType ACACIA_WOOD = register("minecraft:acacia_wood"); public static final ItemType ACTIVATOR_RAIL = register("minecraft:activator_rail"); public static final ItemType AIR = register("minecraft:air"); public static final ItemType ALLIUM = register("minecraft:allium"); @@ -48,14 +49,15 @@ public final class ItemTypes { public static final ItemType BAKED_POTATO = register("minecraft:baked_potato"); public static final ItemType BARRIER = register("minecraft:barrier"); public static final ItemType BAT_SPAWN_EGG = register("minecraft:bat_spawn_egg"); + public static final ItemType BEACON = register("minecraft:beacon"); public static final ItemType BEDROCK = register("minecraft:bedrock"); public static final ItemType BEEF = register("minecraft:beef"); public static final ItemType BEETROOT = register("minecraft:beetroot"); public static final ItemType BEETROOT_SEEDS = register("minecraft:beetroot_seeds"); public static final ItemType BEETROOT_SOUP = register("minecraft:beetroot_soup"); - public static final ItemType BIRCH_BARK = register("minecraft:birch_bark"); public static final ItemType BIRCH_BOAT = register("minecraft:birch_boat"); public static final ItemType BIRCH_BUTTON = register("minecraft:birch_button"); + public static final ItemType BIRCH_DOOR = register("minecraft:birch_door"); public static final ItemType BIRCH_FENCE = register("minecraft:birch_fence"); public static final ItemType BIRCH_FENCE_GATE = register("minecraft:birch_fence_gate"); public static final ItemType BIRCH_LEAVES = register("minecraft:birch_leaves"); @@ -66,11 +68,14 @@ public final class ItemTypes { public static final ItemType BIRCH_SLAB = register("minecraft:birch_slab"); public static final ItemType BIRCH_STAIRS = register("minecraft:birch_stairs"); public static final ItemType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor"); + public static final ItemType BIRCH_WOOD = register("minecraft:birch_wood"); public static final ItemType BLACK_BANNER = register("minecraft:black_banner"); + public static final ItemType BLACK_BED = register("minecraft:black_bed"); public static final ItemType BLACK_CARPET = register("minecraft:black_carpet"); public static final ItemType BLACK_CONCRETE = register("minecraft:black_concrete"); public static final ItemType BLACK_CONCRETE_POWDER = register("minecraft:black_concrete_powder"); public static final ItemType BLACK_GLAZED_TERRACOTTA = register("minecraft:black_glazed_terracotta"); + public static final ItemType BLACK_SHULKER_BOX = register("minecraft:black_shulker_box"); public static final ItemType BLACK_STAINED_GLASS = register("minecraft:black_stained_glass"); public static final ItemType BLACK_STAINED_GLASS_PANE = register("minecraft:black_stained_glass_pane"); public static final ItemType BLACK_TERRACOTTA = register("minecraft:black_terracotta"); @@ -79,12 +84,14 @@ public final class ItemTypes { public static final ItemType BLAZE_ROD = register("minecraft:blaze_rod"); public static final ItemType BLAZE_SPAWN_EGG = register("minecraft:blaze_spawn_egg"); public static final ItemType BLUE_BANNER = register("minecraft:blue_banner"); + public static final ItemType BLUE_BED = register("minecraft:blue_bed"); public static final ItemType BLUE_CARPET = register("minecraft:blue_carpet"); public static final ItemType BLUE_CONCRETE = register("minecraft:blue_concrete"); public static final ItemType BLUE_CONCRETE_POWDER = register("minecraft:blue_concrete_powder"); public static final ItemType BLUE_GLAZED_TERRACOTTA = register("minecraft:blue_glazed_terracotta"); public static final ItemType BLUE_ICE = register("minecraft:blue_ice"); public static final ItemType BLUE_ORCHID = register("minecraft:blue_orchid"); + public static final ItemType BLUE_SHULKER_BOX = register("minecraft:blue_shulker_box"); public static final ItemType BLUE_STAINED_GLASS = register("minecraft:blue_stained_glass"); public static final ItemType BLUE_STAINED_GLASS_PANE = register("minecraft:blue_stained_glass_pane"); public static final ItemType BLUE_TERRACOTTA = register("minecraft:blue_terracotta"); @@ -106,12 +113,14 @@ public final class ItemTypes { public static final ItemType BRICK_STAIRS = register("minecraft:brick_stairs"); public static final ItemType BRICKS = register("minecraft:bricks"); public static final ItemType BROWN_BANNER = register("minecraft:brown_banner"); + public static final ItemType BROWN_BED = register("minecraft:brown_bed"); public static final ItemType BROWN_CARPET = register("minecraft:brown_carpet"); public static final ItemType BROWN_CONCRETE = register("minecraft:brown_concrete"); public static final ItemType BROWN_CONCRETE_POWDER = register("minecraft:brown_concrete_powder"); public static final ItemType BROWN_GLAZED_TERRACOTTA = register("minecraft:brown_glazed_terracotta"); public static final ItemType BROWN_MUSHROOM = register("minecraft:brown_mushroom"); public static final ItemType BROWN_MUSHROOM_BLOCK = register("minecraft:brown_mushroom_block"); + public static final ItemType BROWN_SHULKER_BOX = register("minecraft:brown_shulker_box"); public static final ItemType BROWN_STAINED_GLASS = register("minecraft:brown_stained_glass"); public static final ItemType BROWN_STAINED_GLASS_PANE = register("minecraft:brown_stained_glass_pane"); public static final ItemType BROWN_TERRACOTTA = register("minecraft:brown_terracotta"); @@ -122,11 +131,13 @@ public final class ItemTypes { public static final ItemType BUCKET = register("minecraft:bucket"); public static final ItemType CACTUS = register("minecraft:cactus"); public static final ItemType CACTUS_GREEN = register("minecraft:cactus_green"); + public static final ItemType CAKE = register("minecraft:cake"); public static final ItemType CARROT = register("minecraft:carrot"); public static final ItemType CARROT_ON_A_STICK = register("minecraft:carrot_on_a_stick"); public static final ItemType CARVED_PUMPKIN = register("minecraft:carved_pumpkin"); public static final ItemType CAULDRON = register("minecraft:cauldron"); public static final ItemType CAVE_SPIDER_SPAWN_EGG = register("minecraft:cave_spider_spawn_egg"); + public static final ItemType CHAIN_COMMAND_BLOCK = register("minecraft:chain_command_block"); public static final ItemType CHAINMAIL_BOOTS = register("minecraft:chainmail_boots"); public static final ItemType CHAINMAIL_CHESTPLATE = register("minecraft:chainmail_chestplate"); public static final ItemType CHAINMAIL_HELMET = register("minecraft:chainmail_helmet"); @@ -143,13 +154,10 @@ public final class ItemTypes { public static final ItemType CHISELED_STONE_BRICKS = register("minecraft:chiseled_stone_bricks"); public static final ItemType CHORUS_FLOWER = register("minecraft:chorus_flower"); public static final ItemType CHORUS_FRUIT = register("minecraft:chorus_fruit"); - public static final ItemType CHORUS_FRUIT_POPPED = register("minecraft:chorus_fruit_popped"); public static final ItemType CHORUS_PLANT = register("minecraft:chorus_plant"); public static final ItemType CLAY = register("minecraft:clay"); public static final ItemType CLAY_BALL = register("minecraft:clay_ball"); public static final ItemType CLOCK = register("minecraft:clock"); - public static final ItemType CLOWNFISH = register("minecraft:clownfish"); - public static final ItemType CLOWNFISH_BUCKET = register("minecraft:clownfish_bucket"); public static final ItemType COAL = register("minecraft:coal"); public static final ItemType COAL_BLOCK = register("minecraft:coal_block"); public static final ItemType COAL_ORE = register("minecraft:coal_ore"); @@ -163,9 +171,11 @@ public final class ItemTypes { public static final ItemType COD = register("minecraft:cod"); public static final ItemType COD_BUCKET = register("minecraft:cod_bucket"); public static final ItemType COD_SPAWN_EGG = register("minecraft:cod_spawn_egg"); + public static final ItemType COMMAND_BLOCK = register("minecraft:command_block"); public static final ItemType COMMAND_BLOCK_MINECART = register("minecraft:command_block_minecart"); public static final ItemType COMPARATOR = register("minecraft:comparator"); public static final ItemType COMPASS = register("minecraft:compass"); + public static final ItemType CONDUIT = register("minecraft:conduit"); public static final ItemType COOKED_BEEF = register("minecraft:cooked_beef"); public static final ItemType COOKED_CHICKEN = register("minecraft:cooked_chicken"); public static final ItemType COOKED_COD = register("minecraft:cooked_cod"); @@ -177,15 +187,18 @@ public final class ItemTypes { public static final ItemType COW_SPAWN_EGG = register("minecraft:cow_spawn_egg"); public static final ItemType CRACKED_STONE_BRICKS = register("minecraft:cracked_stone_bricks"); public static final ItemType CRAFTING_TABLE = register("minecraft:crafting_table"); + public static final ItemType CREEPER_HEAD = register("minecraft:creeper_head"); public static final ItemType CREEPER_SPAWN_EGG = register("minecraft:creeper_spawn_egg"); public static final ItemType CUT_RED_SANDSTONE = register("minecraft:cut_red_sandstone"); public static final ItemType CUT_SANDSTONE = register("minecraft:cut_sandstone"); public static final ItemType CYAN_BANNER = register("minecraft:cyan_banner"); + public static final ItemType CYAN_BED = register("minecraft:cyan_bed"); public static final ItemType CYAN_CARPET = register("minecraft:cyan_carpet"); public static final ItemType CYAN_CONCRETE = register("minecraft:cyan_concrete"); public static final ItemType CYAN_CONCRETE_POWDER = register("minecraft:cyan_concrete_powder"); public static final ItemType CYAN_DYE = register("minecraft:cyan_dye"); public static final ItemType CYAN_GLAZED_TERRACOTTA = register("minecraft:cyan_glazed_terracotta"); + public static final ItemType CYAN_SHULKER_BOX = register("minecraft:cyan_shulker_box"); public static final ItemType CYAN_STAINED_GLASS = register("minecraft:cyan_stained_glass"); public static final ItemType CYAN_STAINED_GLASS_PANE = register("minecraft:cyan_stained_glass_pane"); public static final ItemType CYAN_TERRACOTTA = register("minecraft:cyan_terracotta"); @@ -193,9 +206,9 @@ public final class ItemTypes { public static final ItemType DAMAGED_ANVIL = register("minecraft:damaged_anvil"); public static final ItemType DANDELION = register("minecraft:dandelion"); public static final ItemType DANDELION_YELLOW = register("minecraft:dandelion_yellow"); - public static final ItemType DARK_OAK_BARK = register("minecraft:dark_oak_bark"); public static final ItemType DARK_OAK_BOAT = register("minecraft:dark_oak_boat"); public static final ItemType DARK_OAK_BUTTON = register("minecraft:dark_oak_button"); + public static final ItemType DARK_OAK_DOOR = register("minecraft:dark_oak_door"); public static final ItemType DARK_OAK_FENCE = register("minecraft:dark_oak_fence"); public static final ItemType DARK_OAK_FENCE_GATE = register("minecraft:dark_oak_fence_gate"); public static final ItemType DARK_OAK_LEAVES = register("minecraft:dark_oak_leaves"); @@ -206,16 +219,22 @@ public final class ItemTypes { public static final ItemType DARK_OAK_SLAB = register("minecraft:dark_oak_slab"); public static final ItemType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs"); public static final ItemType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor"); + public static final ItemType DARK_OAK_WOOD = register("minecraft:dark_oak_wood"); public static final ItemType DARK_PRISMARINE = register("minecraft:dark_prismarine"); public static final ItemType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab"); public static final ItemType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs"); public static final ItemType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector"); public static final ItemType DEAD_BRAIN_CORAL_BLOCK = register("minecraft:dead_brain_coral_block"); + public static final ItemType DEAD_BRAIN_CORAL_FAN = register("minecraft:dead_brain_coral_fan"); public static final ItemType DEAD_BUBBLE_CORAL_BLOCK = register("minecraft:dead_bubble_coral_block"); + public static final ItemType DEAD_BUBBLE_CORAL_FAN = register("minecraft:dead_bubble_coral_fan"); public static final ItemType DEAD_BUSH = register("minecraft:dead_bush"); public static final ItemType DEAD_FIRE_CORAL_BLOCK = register("minecraft:dead_fire_coral_block"); + public static final ItemType DEAD_FIRE_CORAL_FAN = register("minecraft:dead_fire_coral_fan"); public static final ItemType DEAD_HORN_CORAL_BLOCK = register("minecraft:dead_horn_coral_block"); + public static final ItemType DEAD_HORN_CORAL_FAN = register("minecraft:dead_horn_coral_fan"); public static final ItemType DEAD_TUBE_CORAL_BLOCK = register("minecraft:dead_tube_coral_block"); + public static final ItemType DEAD_TUBE_CORAL_FAN = register("minecraft:dead_tube_coral_fan"); public static final ItemType DEBUG_STICK = register("minecraft:debug_stick"); public static final ItemType DETECTOR_RAIL = register("minecraft:detector_rail"); public static final ItemType DIAMOND = register("minecraft:diamond"); @@ -237,6 +256,8 @@ public final class ItemTypes { public static final ItemType DOLPHIN_SPAWN_EGG = register("minecraft:dolphin_spawn_egg"); public static final ItemType DONKEY_SPAWN_EGG = register("minecraft:donkey_spawn_egg"); public static final ItemType DRAGON_BREATH = register("minecraft:dragon_breath"); + public static final ItemType DRAGON_EGG = register("minecraft:dragon_egg"); + public static final ItemType DRAGON_HEAD = register("minecraft:dragon_head"); public static final ItemType DRIED_KELP = register("minecraft:dried_kelp"); public static final ItemType DRIED_KELP_BLOCK = register("minecraft:dried_kelp_block"); public static final ItemType DROPPER = register("minecraft:dropper"); @@ -260,7 +281,7 @@ public final class ItemTypes { public static final ItemType ENDER_PEARL = register("minecraft:ender_pearl"); public static final ItemType ENDERMAN_SPAWN_EGG = register("minecraft:enderman_spawn_egg"); public static final ItemType ENDERMITE_SPAWN_EGG = register("minecraft:endermite_spawn_egg"); - public static final ItemType EVOCATION_ILLAGER_SPAWN_EGG = register("minecraft:evocation_illager_spawn_egg"); + public static final ItemType EVOKER_SPAWN_EGG = register("minecraft:evoker_spawn_egg"); public static final ItemType EXPERIENCE_BOTTLE = register("minecraft:experience_bottle"); public static final ItemType FARMLAND = register("minecraft:farmland"); public static final ItemType FEATHER = register("minecraft:feather"); @@ -309,20 +330,24 @@ public final class ItemTypes { public static final ItemType GRASS_PATH = register("minecraft:grass_path"); public static final ItemType GRAVEL = register("minecraft:gravel"); public static final ItemType GRAY_BANNER = register("minecraft:gray_banner"); + public static final ItemType GRAY_BED = register("minecraft:gray_bed"); public static final ItemType GRAY_CARPET = register("minecraft:gray_carpet"); public static final ItemType GRAY_CONCRETE = register("minecraft:gray_concrete"); public static final ItemType GRAY_CONCRETE_POWDER = register("minecraft:gray_concrete_powder"); public static final ItemType GRAY_DYE = register("minecraft:gray_dye"); public static final ItemType GRAY_GLAZED_TERRACOTTA = register("minecraft:gray_glazed_terracotta"); + public static final ItemType GRAY_SHULKER_BOX = register("minecraft:gray_shulker_box"); public static final ItemType GRAY_STAINED_GLASS = register("minecraft:gray_stained_glass"); public static final ItemType GRAY_STAINED_GLASS_PANE = register("minecraft:gray_stained_glass_pane"); public static final ItemType GRAY_TERRACOTTA = register("minecraft:gray_terracotta"); public static final ItemType GRAY_WOOL = register("minecraft:gray_wool"); public static final ItemType GREEN_BANNER = register("minecraft:green_banner"); + public static final ItemType GREEN_BED = register("minecraft:green_bed"); public static final ItemType GREEN_CARPET = register("minecraft:green_carpet"); public static final ItemType GREEN_CONCRETE = register("minecraft:green_concrete"); public static final ItemType GREEN_CONCRETE_POWDER = register("minecraft:green_concrete_powder"); public static final ItemType GREEN_GLAZED_TERRACOTTA = register("minecraft:green_glazed_terracotta"); + public static final ItemType GREEN_SHULKER_BOX = register("minecraft:green_shulker_box"); public static final ItemType GREEN_STAINED_GLASS = register("minecraft:green_stained_glass"); public static final ItemType GREEN_STAINED_GLASS_PANE = register("minecraft:green_stained_glass_pane"); public static final ItemType GREEN_TERRACOTTA = register("minecraft:green_terracotta"); @@ -352,6 +377,7 @@ public final class ItemTypes { public static final ItemType IRON_BLOCK = register("minecraft:iron_block"); public static final ItemType IRON_BOOTS = register("minecraft:iron_boots"); public static final ItemType IRON_CHESTPLATE = register("minecraft:iron_chestplate"); + public static final ItemType IRON_DOOR = register("minecraft:iron_door"); public static final ItemType IRON_HELMET = register("minecraft:iron_helmet"); public static final ItemType IRON_HOE = register("minecraft:iron_hoe"); public static final ItemType IRON_HORSE_ARMOR = register("minecraft:iron_horse_armor"); @@ -366,9 +392,9 @@ public final class ItemTypes { public static final ItemType ITEM_FRAME = register("minecraft:item_frame"); public static final ItemType JACK_O_LANTERN = register("minecraft:jack_o_lantern"); public static final ItemType JUKEBOX = register("minecraft:jukebox"); - public static final ItemType JUNGLE_BARK = register("minecraft:jungle_bark"); public static final ItemType JUNGLE_BOAT = register("minecraft:jungle_boat"); public static final ItemType JUNGLE_BUTTON = register("minecraft:jungle_button"); + public static final ItemType JUNGLE_DOOR = register("minecraft:jungle_door"); public static final ItemType JUNGLE_FENCE = register("minecraft:jungle_fence"); public static final ItemType JUNGLE_FENCE_GATE = register("minecraft:jungle_fence_gate"); public static final ItemType JUNGLE_LEAVES = register("minecraft:jungle_leaves"); @@ -379,12 +405,14 @@ public final class ItemTypes { public static final ItemType JUNGLE_SLAB = register("minecraft:jungle_slab"); public static final ItemType JUNGLE_STAIRS = register("minecraft:jungle_stairs"); public static final ItemType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor"); + public static final ItemType JUNGLE_WOOD = register("minecraft:jungle_wood"); public static final ItemType KELP = register("minecraft:kelp"); public static final ItemType KNOWLEDGE_BOOK = register("minecraft:knowledge_book"); public static final ItemType LADDER = register("minecraft:ladder"); public static final ItemType LAPIS_BLOCK = register("minecraft:lapis_block"); public static final ItemType LAPIS_LAZULI = register("minecraft:lapis_lazuli"); public static final ItemType LAPIS_ORE = register("minecraft:lapis_ore"); + public static final ItemType LARGE_FERN = register("minecraft:large_fern"); public static final ItemType LAVA_BUCKET = register("minecraft:lava_bucket"); public static final ItemType LEAD = register("minecraft:lead"); public static final ItemType LEATHER = register("minecraft:leather"); @@ -394,32 +422,40 @@ public final class ItemTypes { public static final ItemType LEATHER_LEGGINGS = register("minecraft:leather_leggings"); public static final ItemType LEVER = register("minecraft:lever"); public static final ItemType LIGHT_BLUE_BANNER = register("minecraft:light_blue_banner"); + public static final ItemType LIGHT_BLUE_BED = register("minecraft:light_blue_bed"); public static final ItemType LIGHT_BLUE_CARPET = register("minecraft:light_blue_carpet"); public static final ItemType LIGHT_BLUE_CONCRETE = register("minecraft:light_blue_concrete"); public static final ItemType LIGHT_BLUE_CONCRETE_POWDER = register("minecraft:light_blue_concrete_powder"); public static final ItemType LIGHT_BLUE_DYE = register("minecraft:light_blue_dye"); public static final ItemType LIGHT_BLUE_GLAZED_TERRACOTTA = register("minecraft:light_blue_glazed_terracotta"); + public static final ItemType LIGHT_BLUE_SHULKER_BOX = register("minecraft:light_blue_shulker_box"); public static final ItemType LIGHT_BLUE_STAINED_GLASS = register("minecraft:light_blue_stained_glass"); public static final ItemType LIGHT_BLUE_STAINED_GLASS_PANE = register("minecraft:light_blue_stained_glass_pane"); public static final ItemType LIGHT_BLUE_TERRACOTTA = register("minecraft:light_blue_terracotta"); public static final ItemType LIGHT_BLUE_WOOL = register("minecraft:light_blue_wool"); public static final ItemType LIGHT_GRAY_BANNER = register("minecraft:light_gray_banner"); + public static final ItemType LIGHT_GRAY_BED = register("minecraft:light_gray_bed"); public static final ItemType LIGHT_GRAY_CARPET = register("minecraft:light_gray_carpet"); public static final ItemType LIGHT_GRAY_CONCRETE = register("minecraft:light_gray_concrete"); public static final ItemType LIGHT_GRAY_CONCRETE_POWDER = register("minecraft:light_gray_concrete_powder"); public static final ItemType LIGHT_GRAY_DYE = register("minecraft:light_gray_dye"); public static final ItemType LIGHT_GRAY_GLAZED_TERRACOTTA = register("minecraft:light_gray_glazed_terracotta"); + public static final ItemType LIGHT_GRAY_SHULKER_BOX = register("minecraft:light_gray_shulker_box"); public static final ItemType LIGHT_GRAY_STAINED_GLASS = register("minecraft:light_gray_stained_glass"); public static final ItemType LIGHT_GRAY_STAINED_GLASS_PANE = register("minecraft:light_gray_stained_glass_pane"); public static final ItemType LIGHT_GRAY_TERRACOTTA = register("minecraft:light_gray_terracotta"); public static final ItemType LIGHT_GRAY_WOOL = register("minecraft:light_gray_wool"); public static final ItemType LIGHT_WEIGHTED_PRESSURE_PLATE = register("minecraft:light_weighted_pressure_plate"); + public static final ItemType LILAC = register("minecraft:lilac"); + public static final ItemType LILY_PAD = register("minecraft:lily_pad"); public static final ItemType LIME_BANNER = register("minecraft:lime_banner"); + public static final ItemType LIME_BED = register("minecraft:lime_bed"); public static final ItemType LIME_CARPET = register("minecraft:lime_carpet"); public static final ItemType LIME_CONCRETE = register("minecraft:lime_concrete"); public static final ItemType LIME_CONCRETE_POWDER = register("minecraft:lime_concrete_powder"); public static final ItemType LIME_DYE = register("minecraft:lime_dye"); public static final ItemType LIME_GLAZED_TERRACOTTA = register("minecraft:lime_glazed_terracotta"); + public static final ItemType LIME_SHULKER_BOX = register("minecraft:lime_shulker_box"); public static final ItemType LIME_STAINED_GLASS = register("minecraft:lime_stained_glass"); public static final ItemType LIME_STAINED_GLASS_PANE = register("minecraft:lime_stained_glass_pane"); public static final ItemType LIME_TERRACOTTA = register("minecraft:lime_terracotta"); @@ -427,11 +463,13 @@ public final class ItemTypes { public static final ItemType LINGERING_POTION = register("minecraft:lingering_potion"); public static final ItemType LLAMA_SPAWN_EGG = register("minecraft:llama_spawn_egg"); public static final ItemType MAGENTA_BANNER = register("minecraft:magenta_banner"); + public static final ItemType MAGENTA_BED = register("minecraft:magenta_bed"); public static final ItemType MAGENTA_CARPET = register("minecraft:magenta_carpet"); public static final ItemType MAGENTA_CONCRETE = register("minecraft:magenta_concrete"); public static final ItemType MAGENTA_CONCRETE_POWDER = register("minecraft:magenta_concrete_powder"); public static final ItemType MAGENTA_DYE = register("minecraft:magenta_dye"); public static final ItemType MAGENTA_GLAZED_TERRACOTTA = register("minecraft:magenta_glazed_terracotta"); + public static final ItemType MAGENTA_SHULKER_BOX = register("minecraft:magenta_shulker_box"); public static final ItemType MAGENTA_STAINED_GLASS = register("minecraft:magenta_stained_glass"); public static final ItemType MAGENTA_STAINED_GLASS_PANE = register("minecraft:magenta_stained_glass_pane"); public static final ItemType MAGENTA_TERRACOTTA = register("minecraft:magenta_terracotta"); @@ -445,7 +483,6 @@ public final class ItemTypes { public static final ItemType MELON_SLICE = register("minecraft:melon_slice"); public static final ItemType MILK_BUCKET = register("minecraft:milk_bucket"); public static final ItemType MINECART = register("minecraft:minecart"); - public static final ItemType MOB_SPAWNER = register("minecraft:mob_spawner"); public static final ItemType MOOSHROOM_SPAWN_EGG = register("minecraft:mooshroom_spawn_egg"); public static final ItemType MOSSY_COBBLESTONE = register("minecraft:mossy_cobblestone"); public static final ItemType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall"); @@ -480,9 +517,9 @@ public final class ItemTypes { public static final ItemType NETHER_WART_BLOCK = register("minecraft:nether_wart_block"); public static final ItemType NETHERRACK = register("minecraft:netherrack"); public static final ItemType NOTE_BLOCK = register("minecraft:note_block"); - public static final ItemType OAK_BARK = register("minecraft:oak_bark"); public static final ItemType OAK_BOAT = register("minecraft:oak_boat"); public static final ItemType OAK_BUTTON = register("minecraft:oak_button"); + public static final ItemType OAK_DOOR = register("minecraft:oak_door"); public static final ItemType OAK_FENCE = register("minecraft:oak_fence"); public static final ItemType OAK_FENCE_GATE = register("minecraft:oak_fence_gate"); public static final ItemType OAK_LEAVES = register("minecraft:oak_leaves"); @@ -493,15 +530,18 @@ public final class ItemTypes { public static final ItemType OAK_SLAB = register("minecraft:oak_slab"); public static final ItemType OAK_STAIRS = register("minecraft:oak_stairs"); public static final ItemType OAK_TRAPDOOR = register("minecraft:oak_trapdoor"); + public static final ItemType OAK_WOOD = register("minecraft:oak_wood"); public static final ItemType OBSERVER = register("minecraft:observer"); public static final ItemType OBSIDIAN = register("minecraft:obsidian"); public static final ItemType OCELOT_SPAWN_EGG = register("minecraft:ocelot_spawn_egg"); public static final ItemType ORANGE_BANNER = register("minecraft:orange_banner"); + public static final ItemType ORANGE_BED = register("minecraft:orange_bed"); public static final ItemType ORANGE_CARPET = register("minecraft:orange_carpet"); public static final ItemType ORANGE_CONCRETE = register("minecraft:orange_concrete"); public static final ItemType ORANGE_CONCRETE_POWDER = register("minecraft:orange_concrete_powder"); public static final ItemType ORANGE_DYE = register("minecraft:orange_dye"); public static final ItemType ORANGE_GLAZED_TERRACOTTA = register("minecraft:orange_glazed_terracotta"); + public static final ItemType ORANGE_SHULKER_BOX = register("minecraft:orange_shulker_box"); public static final ItemType ORANGE_STAINED_GLASS = register("minecraft:orange_stained_glass"); public static final ItemType ORANGE_STAINED_GLASS_PANE = register("minecraft:orange_stained_glass_pane"); public static final ItemType ORANGE_TERRACOTTA = register("minecraft:orange_terracotta"); @@ -512,28 +552,33 @@ public final class ItemTypes { public static final ItemType PAINTING = register("minecraft:painting"); public static final ItemType PAPER = register("minecraft:paper"); public static final ItemType PARROT_SPAWN_EGG = register("minecraft:parrot_spawn_egg"); + public static final ItemType PEONY = register("minecraft:peony"); public static final ItemType PETRIFIED_OAK_SLAB = register("minecraft:petrified_oak_slab"); public static final ItemType PHANTOM_MEMBRANE = register("minecraft:phantom_membrane"); public static final ItemType PHANTOM_SPAWN_EGG = register("minecraft:phantom_spawn_egg"); public static final ItemType PIG_SPAWN_EGG = register("minecraft:pig_spawn_egg"); public static final ItemType PINK_BANNER = register("minecraft:pink_banner"); + public static final ItemType PINK_BED = register("minecraft:pink_bed"); public static final ItemType PINK_CARPET = register("minecraft:pink_carpet"); public static final ItemType PINK_CONCRETE = register("minecraft:pink_concrete"); public static final ItemType PINK_CONCRETE_POWDER = register("minecraft:pink_concrete_powder"); public static final ItemType PINK_DYE = register("minecraft:pink_dye"); public static final ItemType PINK_GLAZED_TERRACOTTA = register("minecraft:pink_glazed_terracotta"); + public static final ItemType PINK_SHULKER_BOX = register("minecraft:pink_shulker_box"); public static final ItemType PINK_STAINED_GLASS = register("minecraft:pink_stained_glass"); public static final ItemType PINK_STAINED_GLASS_PANE = register("minecraft:pink_stained_glass_pane"); public static final ItemType PINK_TERRACOTTA = register("minecraft:pink_terracotta"); public static final ItemType PINK_TULIP = register("minecraft:pink_tulip"); public static final ItemType PINK_WOOL = register("minecraft:pink_wool"); public static final ItemType PISTON = register("minecraft:piston"); + public static final ItemType PLAYER_HEAD = register("minecraft:player_head"); public static final ItemType PODZOL = register("minecraft:podzol"); public static final ItemType POISONOUS_POTATO = register("minecraft:poisonous_potato"); public static final ItemType POLAR_BEAR_SPAWN_EGG = register("minecraft:polar_bear_spawn_egg"); public static final ItemType POLISHED_ANDESITE = register("minecraft:polished_andesite"); public static final ItemType POLISHED_DIORITE = register("minecraft:polished_diorite"); public static final ItemType POLISHED_GRANITE = register("minecraft:polished_granite"); + public static final ItemType POPPED_CHORUS_FRUIT = register("minecraft:popped_chorus_fruit"); public static final ItemType POPPY = register("minecraft:poppy"); public static final ItemType PORKCHOP = register("minecraft:porkchop"); public static final ItemType POTATO = register("minecraft:potato"); @@ -554,11 +599,13 @@ public final class ItemTypes { public static final ItemType PUMPKIN_PIE = register("minecraft:pumpkin_pie"); public static final ItemType PUMPKIN_SEEDS = register("minecraft:pumpkin_seeds"); public static final ItemType PURPLE_BANNER = register("minecraft:purple_banner"); + public static final ItemType PURPLE_BED = register("minecraft:purple_bed"); public static final ItemType PURPLE_CARPET = register("minecraft:purple_carpet"); public static final ItemType PURPLE_CONCRETE = register("minecraft:purple_concrete"); public static final ItemType PURPLE_CONCRETE_POWDER = register("minecraft:purple_concrete_powder"); public static final ItemType PURPLE_DYE = register("minecraft:purple_dye"); public static final ItemType PURPLE_GLAZED_TERRACOTTA = register("minecraft:purple_glazed_terracotta"); + public static final ItemType PURPLE_SHULKER_BOX = register("minecraft:purple_shulker_box"); public static final ItemType PURPLE_STAINED_GLASS = register("minecraft:purple_stained_glass"); public static final ItemType PURPLE_STAINED_GLASS_PANE = register("minecraft:purple_stained_glass_pane"); public static final ItemType PURPLE_TERRACOTTA = register("minecraft:purple_terracotta"); @@ -579,6 +626,7 @@ public final class ItemTypes { public static final ItemType RABBIT_STEW = register("minecraft:rabbit_stew"); public static final ItemType RAIL = register("minecraft:rail"); public static final ItemType RED_BANNER = register("minecraft:red_banner"); + public static final ItemType RED_BED = register("minecraft:red_bed"); public static final ItemType RED_CARPET = register("minecraft:red_carpet"); public static final ItemType RED_CONCRETE = register("minecraft:red_concrete"); public static final ItemType RED_CONCRETE_POWDER = register("minecraft:red_concrete_powder"); @@ -590,6 +638,7 @@ public final class ItemTypes { public static final ItemType RED_SANDSTONE = register("minecraft:red_sandstone"); public static final ItemType RED_SANDSTONE_SLAB = register("minecraft:red_sandstone_slab"); public static final ItemType RED_SANDSTONE_STAIRS = register("minecraft:red_sandstone_stairs"); + public static final ItemType RED_SHULKER_BOX = register("minecraft:red_shulker_box"); public static final ItemType RED_STAINED_GLASS = register("minecraft:red_stained_glass"); public static final ItemType RED_STAINED_GLASS_PANE = register("minecraft:red_stained_glass_pane"); public static final ItemType RED_TERRACOTTA = register("minecraft:red_terracotta"); @@ -599,7 +648,10 @@ public final class ItemTypes { public static final ItemType REDSTONE_BLOCK = register("minecraft:redstone_block"); public static final ItemType REDSTONE_LAMP = register("minecraft:redstone_lamp"); public static final ItemType REDSTONE_ORE = register("minecraft:redstone_ore"); + public static final ItemType REDSTONE_TORCH = register("minecraft:redstone_torch"); public static final ItemType REPEATER = register("minecraft:repeater"); + public static final ItemType REPEATING_COMMAND_BLOCK = register("minecraft:repeating_command_block"); + public static final ItemType ROSE_BUSH = register("minecraft:rose_bush"); public static final ItemType ROSE_RED = register("minecraft:rose_red"); public static final ItemType ROTTEN_FLESH = register("minecraft:rotten_flesh"); public static final ItemType SADDLE = register("minecraft:saddle"); @@ -617,11 +669,13 @@ public final class ItemTypes { public static final ItemType SHEARS = register("minecraft:shears"); public static final ItemType SHEEP_SPAWN_EGG = register("minecraft:sheep_spawn_egg"); public static final ItemType SHIELD = register("minecraft:shield"); + public static final ItemType SHULKER_BOX = register("minecraft:shulker_box"); public static final ItemType SHULKER_SHELL = register("minecraft:shulker_shell"); public static final ItemType SHULKER_SPAWN_EGG = register("minecraft:shulker_spawn_egg"); public static final ItemType SIGN = register("minecraft:sign"); public static final ItemType SILVERFISH_SPAWN_EGG = register("minecraft:silverfish_spawn_egg"); public static final ItemType SKELETON_HORSE_SPAWN_EGG = register("minecraft:skeleton_horse_spawn_egg"); + public static final ItemType SKELETON_SKULL = register("minecraft:skeleton_skull"); public static final ItemType SKELETON_SPAWN_EGG = register("minecraft:skeleton_spawn_egg"); public static final ItemType SLIME_BALL = register("minecraft:slime_ball"); public static final ItemType SLIME_BLOCK = register("minecraft:slime_block"); @@ -634,14 +688,15 @@ public final class ItemTypes { public static final ItemType SNOW_BLOCK = register("minecraft:snow_block"); public static final ItemType SNOWBALL = register("minecraft:snowball"); public static final ItemType SOUL_SAND = register("minecraft:soul_sand"); + public static final ItemType SPAWNER = register("minecraft:spawner"); public static final ItemType SPECTRAL_ARROW = register("minecraft:spectral_arrow"); public static final ItemType SPIDER_EYE = register("minecraft:spider_eye"); public static final ItemType SPIDER_SPAWN_EGG = register("minecraft:spider_spawn_egg"); public static final ItemType SPLASH_POTION = register("minecraft:splash_potion"); public static final ItemType SPONGE = register("minecraft:sponge"); - public static final ItemType SPRUCE_BARK = register("minecraft:spruce_bark"); public static final ItemType SPRUCE_BOAT = register("minecraft:spruce_boat"); public static final ItemType SPRUCE_BUTTON = register("minecraft:spruce_button"); + public static final ItemType SPRUCE_DOOR = register("minecraft:spruce_door"); public static final ItemType SPRUCE_FENCE = register("minecraft:spruce_fence"); public static final ItemType SPRUCE_FENCE_GATE = register("minecraft:spruce_fence_gate"); public static final ItemType SPRUCE_LEAVES = register("minecraft:spruce_leaves"); @@ -652,6 +707,7 @@ public final class ItemTypes { public static final ItemType SPRUCE_SLAB = register("minecraft:spruce_slab"); public static final ItemType SPRUCE_STAIRS = register("minecraft:spruce_stairs"); public static final ItemType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor"); + public static final ItemType SPRUCE_WOOD = register("minecraft:spruce_wood"); public static final ItemType SQUID_SPAWN_EGG = register("minecraft:squid_spawn_egg"); public static final ItemType STICK = register("minecraft:stick"); public static final ItemType STICKY_PISTON = register("minecraft:sticky_piston"); @@ -670,22 +726,34 @@ public final class ItemTypes { public static final ItemType STRAY_SPAWN_EGG = register("minecraft:stray_spawn_egg"); public static final ItemType STRING = register("minecraft:string"); public static final ItemType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log"); + public static final ItemType STRIPPED_ACACIA_WOOD = register("minecraft:stripped_acacia_wood"); public static final ItemType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log"); + public static final ItemType STRIPPED_BIRCH_WOOD = register("minecraft:stripped_birch_wood"); public static final ItemType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log"); + public static final ItemType STRIPPED_DARK_OAK_WOOD = register("minecraft:stripped_dark_oak_wood"); public static final ItemType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log"); + public static final ItemType STRIPPED_JUNGLE_WOOD = register("minecraft:stripped_jungle_wood"); public static final ItemType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log"); + public static final ItemType STRIPPED_OAK_WOOD = register("minecraft:stripped_oak_wood"); public static final ItemType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log"); + public static final ItemType STRIPPED_SPRUCE_WOOD = register("minecraft:stripped_spruce_wood"); + public static final ItemType STRUCTURE_BLOCK = register("minecraft:structure_block"); public static final ItemType STRUCTURE_VOID = register("minecraft:structure_void"); public static final ItemType SUGAR = register("minecraft:sugar"); public static final ItemType SUGAR_CANE = register("minecraft:sugar_cane"); + public static final ItemType SUNFLOWER = register("minecraft:sunflower"); + public static final ItemType TALL_GRASS = register("minecraft:tall_grass"); public static final ItemType TERRACOTTA = register("minecraft:terracotta"); public static final ItemType TIPPED_ARROW = register("minecraft:tipped_arrow"); public static final ItemType TNT = register("minecraft:tnt"); public static final ItemType TNT_MINECART = register("minecraft:tnt_minecart"); + public static final ItemType TORCH = register("minecraft:torch"); public static final ItemType TOTEM_OF_UNDYING = register("minecraft:totem_of_undying"); public static final ItemType TRAPPED_CHEST = register("minecraft:trapped_chest"); public static final ItemType TRIDENT = register("minecraft:trident"); public static final ItemType TRIPWIRE_HOOK = register("minecraft:tripwire_hook"); + public static final ItemType TROPICAL_FISH = register("minecraft:tropical_fish"); + public static final ItemType TROPICAL_FISH_BUCKET = register("minecraft:tropical_fish_bucket"); public static final ItemType TROPICAL_FISH_SPAWN_EGG = register("minecraft:tropical_fish_spawn_egg"); public static final ItemType TUBE_CORAL = register("minecraft:tube_coral"); public static final ItemType TUBE_CORAL_BLOCK = register("minecraft:tube_coral_block"); @@ -695,23 +763,26 @@ public final class ItemTypes { public static final ItemType TURTLE_SPAWN_EGG = register("minecraft:turtle_spawn_egg"); public static final ItemType VEX_SPAWN_EGG = register("minecraft:vex_spawn_egg"); public static final ItemType VILLAGER_SPAWN_EGG = register("minecraft:villager_spawn_egg"); - public static final ItemType VINDICATION_ILLAGER_SPAWN_EGG = register("minecraft:vindication_illager_spawn_egg"); + public static final ItemType VINDICATOR_SPAWN_EGG = register("minecraft:vindicator_spawn_egg"); public static final ItemType VINE = register("minecraft:vine"); public static final ItemType WATER_BUCKET = register("minecraft:water_bucket"); public static final ItemType WET_SPONGE = register("minecraft:wet_sponge"); public static final ItemType WHEAT = register("minecraft:wheat"); public static final ItemType WHEAT_SEEDS = register("minecraft:wheat_seeds"); public static final ItemType WHITE_BANNER = register("minecraft:white_banner"); + public static final ItemType WHITE_BED = register("minecraft:white_bed"); public static final ItemType WHITE_CARPET = register("minecraft:white_carpet"); public static final ItemType WHITE_CONCRETE = register("minecraft:white_concrete"); public static final ItemType WHITE_CONCRETE_POWDER = register("minecraft:white_concrete_powder"); public static final ItemType WHITE_GLAZED_TERRACOTTA = register("minecraft:white_glazed_terracotta"); + public static final ItemType WHITE_SHULKER_BOX = register("minecraft:white_shulker_box"); public static final ItemType WHITE_STAINED_GLASS = register("minecraft:white_stained_glass"); public static final ItemType WHITE_STAINED_GLASS_PANE = register("minecraft:white_stained_glass_pane"); public static final ItemType WHITE_TERRACOTTA = register("minecraft:white_terracotta"); public static final ItemType WHITE_TULIP = register("minecraft:white_tulip"); public static final ItemType WHITE_WOOL = register("minecraft:white_wool"); public static final ItemType WITCH_SPAWN_EGG = register("minecraft:witch_spawn_egg"); + public static final ItemType WITHER_SKELETON_SKULL = register("minecraft:wither_skeleton_skull"); public static final ItemType WITHER_SKELETON_SPAWN_EGG = register("minecraft:wither_skeleton_spawn_egg"); public static final ItemType WOLF_SPAWN_EGG = register("minecraft:wolf_spawn_egg"); public static final ItemType WOODEN_AXE = register("minecraft:wooden_axe"); @@ -722,14 +793,17 @@ public final class ItemTypes { public static final ItemType WRITABLE_BOOK = register("minecraft:writable_book"); public static final ItemType WRITTEN_BOOK = register("minecraft:written_book"); public static final ItemType YELLOW_BANNER = register("minecraft:yellow_banner"); + public static final ItemType YELLOW_BED = register("minecraft:yellow_bed"); public static final ItemType YELLOW_CARPET = register("minecraft:yellow_carpet"); public static final ItemType YELLOW_CONCRETE = register("minecraft:yellow_concrete"); public static final ItemType YELLOW_CONCRETE_POWDER = register("minecraft:yellow_concrete_powder"); public static final ItemType YELLOW_GLAZED_TERRACOTTA = register("minecraft:yellow_glazed_terracotta"); + public static final ItemType YELLOW_SHULKER_BOX = register("minecraft:yellow_shulker_box"); public static final ItemType YELLOW_STAINED_GLASS = register("minecraft:yellow_stained_glass"); public static final ItemType YELLOW_STAINED_GLASS_PANE = register("minecraft:yellow_stained_glass_pane"); public static final ItemType YELLOW_TERRACOTTA = register("minecraft:yellow_terracotta"); public static final ItemType YELLOW_WOOL = register("minecraft:yellow_wool"); + public static final ItemType ZOMBIE_HEAD = register("minecraft:zombie_head"); public static final ItemType ZOMBIE_HORSE_SPAWN_EGG = register("minecraft:zombie_horse_spawn_egg"); public static final ItemType ZOMBIE_PIGMAN_SPAWN_EGG = register("minecraft:zombie_pigman_spawn_egg"); public static final ItemType ZOMBIE_SPAWN_EGG = register("minecraft:zombie_spawn_egg"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/PassthroughBlockMaterial.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/PassthroughBlockMaterial.java index d606efabc..1eaa65c1d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/PassthroughBlockMaterial.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/PassthroughBlockMaterial.java @@ -31,15 +31,6 @@ public class PassthroughBlockMaterial implements BlockMaterial { this.blockMaterial = material; } - @Override - public boolean isRenderedAsNormalBlock() { - if (blockMaterial == null) { - return true; - } else { - return blockMaterial.isRenderedAsNormalBlock(); - } - } - @Override public boolean isFullCube() { if (blockMaterial == null) { @@ -112,33 +103,6 @@ public class PassthroughBlockMaterial implements BlockMaterial { } } - @Override - public boolean isGrassBlocking() { - if (blockMaterial == null) { - return true; - } else { - return blockMaterial.isGrassBlocking(); - } - } - - @Override - public float getAmbientOcclusionLightValue() { - if (blockMaterial == null) { - return 0; - } else { - return blockMaterial.getAmbientOcclusionLightValue(); - } - } - - @Override - public int getLightOpacity() { - if (blockMaterial == null) { - return 0; - } else { - return blockMaterial.getLightOpacity(); - } - } - @Override public int getLightValue() { if (blockMaterial == null) { @@ -166,15 +130,6 @@ public class PassthroughBlockMaterial implements BlockMaterial { } } - @Override - public boolean isAdventureModeExempt() { - if (blockMaterial == null) { - return false; - } else { - return blockMaterial.isAdventureModeExempt(); - } - } - @Override public boolean isTicksRandomly() { if (blockMaterial == null) { @@ -184,15 +139,6 @@ public class PassthroughBlockMaterial implements BlockMaterial { } } - @Override - public boolean isUsingNeighborLight() { - if (blockMaterial == null) { - return false; - } else { - return blockMaterial.isUsingNeighborLight(); - } - } - @Override public boolean isMovementBlocker() { if (blockMaterial == null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleBlockMaterial.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleBlockMaterial.java index 9ad54acf6..6e0b57e31 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleBlockMaterial.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleBlockMaterial.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.blocks.BlockMaterial; class SimpleBlockMaterial implements BlockMaterial { - private boolean renderedAsNormalBlock; private boolean fullCube; private boolean opaque; private boolean powerSource; @@ -32,15 +31,10 @@ class SimpleBlockMaterial implements BlockMaterial { private float hardness; private float resistance; private float slipperiness; - private boolean grassBlocking; - private float ambientOcclusionLightValue; - private int lightOpacity; private int lightValue; private boolean fragileWhenPushed; private boolean unpushable; - private boolean adventureModeExempt; private boolean ticksRandomly; - private boolean usingNeighborLight; private boolean movementBlocker; private boolean burnable; private boolean toolRequired; @@ -48,15 +42,6 @@ class SimpleBlockMaterial implements BlockMaterial { private boolean isTranslucent; private boolean hasContainer; - @Override - public boolean isRenderedAsNormalBlock() { - return renderedAsNormalBlock; - } - - public void setRenderedAsNormalBlock(boolean renderedAsNormalBlock) { - this.renderedAsNormalBlock = renderedAsNormalBlock; - } - @Override public boolean isFullCube() { return fullCube; @@ -129,33 +114,6 @@ class SimpleBlockMaterial implements BlockMaterial { this.slipperiness = slipperiness; } - @Override - public boolean isGrassBlocking() { - return grassBlocking; - } - - public void setGrassBlocking(boolean grassBlocking) { - this.grassBlocking = grassBlocking; - } - - @Override - public float getAmbientOcclusionLightValue() { - return ambientOcclusionLightValue; - } - - public void setAmbientOcclusionLightValue(float ambientOcclusionLightValue) { - this.ambientOcclusionLightValue = ambientOcclusionLightValue; - } - - @Override - public int getLightOpacity() { - return lightOpacity; - } - - public void setLightOpacity(int lightOpacity) { - this.lightOpacity = lightOpacity; - } - @Override public int getLightValue() { return lightValue; @@ -183,15 +141,6 @@ class SimpleBlockMaterial implements BlockMaterial { this.unpushable = unpushable; } - @Override - public boolean isAdventureModeExempt() { - return adventureModeExempt; - } - - public void setAdventureModeExempt(boolean adventureModeExempt) { - this.adventureModeExempt = adventureModeExempt; - } - @Override public boolean isTicksRandomly() { return ticksRandomly; @@ -201,15 +150,6 @@ class SimpleBlockMaterial implements BlockMaterial { this.ticksRandomly = ticksRandomly; } - @Override - public boolean isUsingNeighborLight() { - return usingNeighborLight; - } - - public void setUsingNeighborLight(boolean usingNeighborLight) { - this.usingNeighborLight = usingNeighborLight; - } - @Override public boolean isMovementBlocker() { return movementBlocker; diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json index 081ebf427..3e163855a 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json @@ -1,21 +1,365 @@ [ { - "legacyId": 0, + "id": "minecraft:acacia_button", + "localizedName": "Acacia Button", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_door", + "localizedName": "Acacia Door", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_fence", + "localizedName": "Acacia Fence", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_fence_gate", + "localizedName": "Acacia Fence Gate", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_leaves", + "localizedName": "Acacia Leaves", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_log", + "localizedName": "Acacia Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_planks", + "localizedName": "Acacia Planks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_pressure_plate", + "localizedName": "Acacia Pressure Plate", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_sapling", + "localizedName": "Acacia Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_slab", + "localizedName": "Acacia Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_stairs", + "localizedName": "Acacia Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_trapdoor", + "localizedName": "Acacia Trapdoor", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:acacia_wood", + "localizedName": "Acacia Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:activator_rail", + "localizedName": "Activator Rail", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.7, + "resistance": 0.7, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { "id": "minecraft:air", - "unlocalizedName": "tile.air", "localizedName": "Air", - "states": {}, "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": false, "hardness": 0.0, "resistance": 0.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": false, "movementBlocker": false, @@ -25,244 +369,22 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 1, - "id": "minecraft:stone", - "unlocalizedName": "tile.stone", - "localizedName": "Stone", - "states": { - "variant": { - "values": [ - "stone", - "granite", - "smooth_granite", - "diorite", - "smooth_diorite", - "andesite", - "smooth_andesite" - ] - } - }, + "id": "minecraft:allium", + "localizedName": "Allium", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.5, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 2, - "id": "minecraft:grass", - "unlocalizedName": "tile.grass", - "localizedName": "Grass Block", - "states": { - "snowy": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.6, - "resistance": 3.0, - "ticksRandomly": true, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 3, - "id": "minecraft:dirt", - "unlocalizedName": "tile.dirt", - "localizedName": "Dirt", - "states": { - "snowy": { - "values": [ - "true", - "false" - ] - }, - "variant": { - "values": [ - "dirt", - "coarse_dirt", - "podzol" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 4, - "id": "minecraft:cobblestone", - "unlocalizedName": "tile.stonebrick", - "localizedName": "Cobblestone", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 5, - "id": "minecraft:planks", - "unlocalizedName": "tile.wood", - "localizedName": "Wooden Planks", - "states": { - "variant": { - "values": [ - "oak", - "spruce", - "birch", - "jungle", - "acacia", - "dark_oak" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 6, - "id": "minecraft:sapling", - "unlocalizedName": "tile.sapling", - "localizedName": "Oak Sapling", - "states": { - "stage": { - "values": [ - "0", - "1" - ] - }, - "type": { - "values": [ - "oak", - "spruce", - "birch", - "jungle", - "acacia", - "dark_oak" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, "hardness": 0.0, "resistance": 0.0, - "ticksRandomly": true, + "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": false, "movementBlocker": false, @@ -272,28 +394,197 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:andesite", + "localizedName": "Andesite", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:anvil", + "localizedName": "Anvil", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 1200.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:attached_melon_stem", + "localizedName": "Attached Melon Stem", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:attached_pumpkin_stem", + "localizedName": "Attached Pumpkin Stem", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:azure_bluet", + "localizedName": "Azure Bluet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:barrier", + "localizedName": "Barrier", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": -1.0, + "resistance": 3600000.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:beacon", + "localizedName": "Beacon", + "material": { + "powerSource": false, + "lightValue": 15, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true } }, { - "legacyId": 7, "id": "minecraft:bedrock", - "unlocalizedName": "tile.bedrock", "localizedName": "Bedrock", - "states": {}, "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, "hardness": -1.0, - "resistance": 1.8E7, + "resistance": 3600000.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -303,816 +594,22 @@ "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 8, - "id": "minecraft:flowing_water", - "unlocalizedName": "tile.water", - "localizedName": "Water", - "states": { - "level": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, + "id": "minecraft:beetroots", + "localizedName": "Beetroots", "material": { "powerSource": false, - "lightOpacity": 3, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 100.0, - "resistance": 500.0, + "hardness": 0.0, + "resistance": 0.0, "ticksRandomly": true, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": true, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": true, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 9, - "id": "minecraft:water", - "unlocalizedName": "tile.water", - "localizedName": "Water", - "states": { - "level": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 3, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 100.0, - "resistance": 500.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": true, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": true, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 10, - "id": "minecraft:flowing_lava", - "unlocalizedName": "tile.lava", - "localizedName": "Lava", - "states": { - "level": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 15, - "usingNeighborLight": true, - "hardness": 100.0, - "resistance": 500.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": true, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": true, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 11, - "id": "minecraft:lava", - "unlocalizedName": "tile.lava", - "localizedName": "Lava", - "states": { - "level": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 15, - "usingNeighborLight": true, - "hardness": 100.0, - "resistance": 500.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": true, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": true, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 12, - "id": "minecraft:sand", - "unlocalizedName": "tile.sand", - "localizedName": "Sand", - "states": { - "variant": { - "values": [ - "sand", - "red_sand" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 13, - "id": "minecraft:gravel", - "unlocalizedName": "tile.gravel", - "localizedName": "Gravel", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.6, - "resistance": 3.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 14, - "id": "minecraft:gold_ore", - "unlocalizedName": "tile.oreGold", - "localizedName": "Gold Ore", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 15, - "id": "minecraft:iron_ore", - "unlocalizedName": "tile.oreIron", - "localizedName": "Iron Ore", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 16, - "id": "minecraft:coal_ore", - "unlocalizedName": "tile.oreCoal", - "localizedName": "Coal Ore", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 17, - "id": "minecraft:log", - "unlocalizedName": "tile.log", - "localizedName": "Wood", - "states": { - "axis": { - "values": [ - "x", - "y", - "z", - "none" - ] - }, - "variant": { - "values": [ - "oak", - "spruce", - "birch", - "jungle" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 18, - "id": "minecraft:leaves", - "unlocalizedName": "tile.leaves", - "localizedName": "Leaves", - "states": { - "check_decay": { - "values": [ - "true", - "false" - ] - }, - "decayable": { - "values": [ - "true", - "false" - ] - }, - "variant": { - "values": [ - "oak", - "spruce", - "birch", - "jungle" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 1, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.2, - "resistance": 1.0, - "ticksRandomly": true, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 19, - "id": "minecraft:sponge", - "unlocalizedName": "tile.sponge", - "localizedName": "Sponge", - "states": { - "wet": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.6, - "resistance": 3.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 20, - "id": "minecraft:glass", - "unlocalizedName": "tile.glass", - "localizedName": "Glass", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.3, - "resistance": 1.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 21, - "id": "minecraft:lapis_ore", - "unlocalizedName": "tile.oreLapis", - "localizedName": "Lapis Lazuli Ore", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 22, - "id": "minecraft:lapis_block", - "unlocalizedName": "tile.blockLapis", - "localizedName": "Lapis Lazuli Block", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 23, - "id": "minecraft:dispenser", - "unlocalizedName": "tile.dispenser", - "localizedName": "Dispenser", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - }, - "triggered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.5, - "resistance": 17.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 24, - "id": "minecraft:sandstone", - "unlocalizedName": "tile.sandStone", - "localizedName": "Sandstone", - "states": { - "type": { - "values": [ - "sandstone", - "chiseled_sandstone", - "smooth_sandstone" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.8, - "resistance": 4.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 25, - "id": "minecraft:noteblock", - "unlocalizedName": "tile.musicBlock", - "localizedName": "Note Block", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.8, - "resistance": 4.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 26, - "id": "minecraft:bed", - "unlocalizedName": "tile.bed", - "localizedName": "tile.bed.name", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "occupied": { - "values": [ - "true", - "false" - ] - }, - "part": { - "values": [ - "head", - "foot" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.2, - "resistance": 1.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 27, - "id": "minecraft:golden_rail", - "unlocalizedName": "tile.goldenRail", - "localizedName": "Powered Rail", - "states": { - "powered": { - "values": [ - "true", - "false" - ] - }, - "shape": { - "values": [ - "north_south", - "east_west", - "ascending_east", - "ascending_west", - "ascending_north", - "ascending_south" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.7, - "resistance": 3.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": false, "movementBlocker": false, @@ -1122,433 +619,22 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 28, - "id": "minecraft:detector_rail", - "unlocalizedName": "tile.detectorRail", - "localizedName": "Detector Rail", - "states": { - "powered": { - "values": [ - "true", - "false" - ] - }, - "shape": { - "values": [ - "north_south", - "east_west", - "ascending_east", - "ascending_west", - "ascending_north", - "ascending_south" - ] - } - }, + "id": "minecraft:birch_button", + "localizedName": "Birch Button", "material": { "powerSource": true, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.7, - "resistance": 3.5, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 29, - "id": "minecraft:sticky_piston", - "unlocalizedName": "tile.pistonStickyBase", - "localizedName": "Sticky Piston", - "states": { - "extended": { - "values": [ - "true", - "false" - ] - }, - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, "hardness": 0.5, - "resistance": 2.5, + "resistance": 0.5, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": true, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 30, - "id": "minecraft:web", - "unlocalizedName": "tile.web", - "localizedName": "Cobweb", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 1, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 4.0, - "resistance": 20.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 31, - "id": "minecraft:tallgrass", - "unlocalizedName": "tile.tallgrass", - "localizedName": "Grass", - "states": { - "type": { - "values": [ - "dead_bush", - "tall_grass", - "fern" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": true, - "opaque": false, - "replacedDuringPlacement": true, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 32, - "id": "minecraft:deadbush", - "unlocalizedName": "tile.deadbush", - "localizedName": "Dead Bush", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": true, - "opaque": false, - "replacedDuringPlacement": true, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 33, - "id": "minecraft:piston", - "unlocalizedName": "tile.pistonBase", - "localizedName": "Piston", - "states": { - "extended": { - "values": [ - "true", - "false" - ] - }, - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": true, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 34, - "id": "minecraft:piston_head", - "unlocalizedName": "tile.pistonBase", - "localizedName": "Piston", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - }, - "short": { - "values": [ - "true", - "false" - ] - }, - "type": { - "values": [ - "normal", - "sticky" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": true, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 35, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth", - "localizedName": "Wool", - "states": { - "color": { - "values": [ - "white", - "orange", - "magenta", - "light_blue", - "yellow", - "lime", - "pink", - "gray", - "silver", - "cyan", - "purple", - "blue", - "brown", - "green", - "red", - "black" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.8, - "resistance": 4.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 36, - "id": "minecraft:piston_extension", - "unlocalizedName": "tile.null", - "localizedName": "tile.null.name", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - }, - "type": { - "values": [ - "normal", - "sticky" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": -1.0, - "resistance": 0.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": true, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 37, - "id": "minecraft:yellow_flower", - "unlocalizedName": "tile.flower1", - "localizedName": "Flower", - "states": { - "type": { - "values": [ - "dandelion" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": false, "movementBlocker": false, @@ -1558,366 +644,22 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 38, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2", - "localizedName": "Flower", - "states": { - "type": { - "values": [ - "poppy", - "blue_orchid", - "allium", - "houstonia", - "red_tulip", - "orange_tulip", - "white_tulip", - "pink_tulip", - "oxeye_daisy" - ] - } - }, + "id": "minecraft:birch_door", + "localizedName": "Birch Door", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 39, - "id": "minecraft:brown_mushroom", - "unlocalizedName": "tile.mushroom", - "localizedName": "Mushroom", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 1, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 40, - "id": "minecraft:red_mushroom", - "unlocalizedName": "tile.mushroom", - "localizedName": "Mushroom", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 41, - "id": "minecraft:gold_block", - "unlocalizedName": "tile.blockGold", - "localizedName": "Block of Gold", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, "hardness": 3.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 42, - "id": "minecraft:iron_block", - "unlocalizedName": "tile.blockIron", - "localizedName": "Block of Iron", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 5.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 43, - "id": "minecraft:double_stone_slab", - "unlocalizedName": "tile.stoneSlab", - "localizedName": "Stone Slab", - "states": { - "seamless": { - "values": [ - "true", - "false" - ] - }, - "variant": { - "values": [ - "stone", - "sandstone", - "wood_old", - "cobblestone", - "brick", - "stone_brick", - "nether_brick", - "quartz" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 44, - "id": "minecraft:stone_slab", - "unlocalizedName": "tile.stoneSlab", - "localizedName": "Stone Slab", - "states": { - "half": { - "values": [ - "top", - "bottom" - ] - }, - "variant": { - "values": [ - "stone", - "sandstone", - "wood_old", - "cobblestone", - "brick", - "stone_brick", - "nether_brick", - "quartz" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, + "resistance": 3.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 45, - "id": "minecraft:brick_block", - "unlocalizedName": "tile.brick", - "localizedName": "Bricks", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 46, - "id": "minecraft:tnt", - "unlocalizedName": "tile.tnt", - "localizedName": "TNT", - "states": { - "explode": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 47, - "id": "minecraft:bookshelf", - "unlocalizedName": "tile.bookshelf", - "localizedName": "Bookshelf", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.5, - "resistance": 7.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -1927,268 +669,122 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 48, - "id": "minecraft:mossy_cobblestone", - "unlocalizedName": "tile.stoneMoss", - "localizedName": "Moss Stone", - "states": {}, + "id": "minecraft:birch_fence", + "localizedName": "Birch Fence", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, "hardness": 2.0, - "resistance": 30.0, + "resistance": 3.0, "ticksRandomly": false, - "fullCube": true, + "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, - "burnable": false, + "burnable": true, "opaque": true, "replacedDuringPlacement": false, - "toolRequired": true, + "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 49, - "id": "minecraft:obsidian", - "unlocalizedName": "tile.obsidian", - "localizedName": "Obsidian", - "states": {}, + "id": "minecraft:birch_fence_gate", + "localizedName": "Birch Fence Gate", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 50.0, - "resistance": 6000.0, + "hardness": 2.0, + "resistance": 3.0, "ticksRandomly": false, - "fullCube": true, + "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, - "burnable": false, + "burnable": true, "opaque": true, "replacedDuringPlacement": false, - "toolRequired": true, + "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 50, - "id": "minecraft:torch", - "unlocalizedName": "tile.torch", - "localizedName": "Torch", - "states": { - "facing": { - "values": [ - "up", - "north", - "south", - "west", - "east" - ] - } - }, + "id": "minecraft:birch_leaves", + "localizedName": "Birch Leaves", "material": { "powerSource": false, - "lightOpacity": 0, - "lightValue": 14, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, "ticksRandomly": true, - "fullCube": false, + "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, + "solid": true, + "movementBlocker": true, + "burnable": true, "opaque": false, "replacedDuringPlacement": false, "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 51, - "id": "minecraft:fire", - "unlocalizedName": "tile.fire", - "localizedName": "Fire", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - }, - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "up": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, + "id": "minecraft:birch_log", + "localizedName": "Birch Log", "material": { "powerSource": false, - "lightOpacity": 0, - "lightValue": 15, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": true, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 52, - "id": "minecraft:mob_spawner", - "unlocalizedName": "tile.mobSpawner", - "localizedName": "Monster Spawner", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 5.0, - "resistance": 25.0, + "hardness": 2.0, + "resistance": 2.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, - "burnable": false, + "burnable": true, "opaque": true, "replacedDuringPlacement": false, - "toolRequired": true, + "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 53, - "id": "minecraft:oak_stairs", - "unlocalizedName": "tile.stairsWood", - "localizedName": "Oak Wood Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, + "id": "minecraft:birch_planks", + "localizedName": "Birch Planks", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": true, "hardness": 2.0, - "resistance": 15.0, + "resistance": 3.0, "ticksRandomly": false, - "fullCube": false, + "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -2198,210 +794,22 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 54, - "id": "minecraft:chest", - "unlocalizedName": "tile.chest", - "localizedName": "Chest", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.5, - "resistance": 12.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 55, - "id": "minecraft:redstone_wire", - "unlocalizedName": "tile.redstoneDust", - "localizedName": "Redstone Dust", - "states": { - "east": { - "values": [ - "up", - "side", - "none" - ] - }, - "north": { - "values": [ - "up", - "side", - "none" - ] - }, - "power": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - }, - "south": { - "values": [ - "up", - "side", - "none" - ] - }, - "west": { - "values": [ - "up", - "side", - "none" - ] - } - }, + "id": "minecraft:birch_pressure_plate", + "localizedName": "Birch Pressure Plate", "material": { "powerSource": true, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, + "hardness": 0.5, + "resistance": 0.5, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 56, - "id": "minecraft:diamond_ore", - "unlocalizedName": "tile.oreDiamond", - "localizedName": "Diamond Ore", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 57, - "id": "minecraft:diamond_block", - "unlocalizedName": "tile.blockDiamond", - "localizedName": "Block of Diamond", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 5.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 58, - "id": "minecraft:crafting_table", - "unlocalizedName": "tile.workbench", - "localizedName": "Crafting Table", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 2.5, - "resistance": 12.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -2411,41 +819,22 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 59, - "id": "minecraft:wheat", - "unlocalizedName": "tile.crops", - "localizedName": "Crops", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ] - } - }, + "id": "minecraft:birch_sapling", + "localizedName": "Birch Sapling", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, "hardness": 0.0, "resistance": 0.0, "ticksRandomly": true, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": false, "movementBlocker": false, @@ -2455,173 +844,122 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 60, - "id": "minecraft:farmland", - "unlocalizedName": "tile.farmland", - "localizedName": "Farmland", - "states": { - "moisture": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ] - } - }, + "id": "minecraft:birch_slab", + "localizedName": "Birch Slab", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.6, + "hardness": 2.0, "resistance": 3.0, - "ticksRandomly": true, + "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, - "burnable": false, + "burnable": true, "opaque": true, "replacedDuringPlacement": false, "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 61, - "id": "minecraft:furnace", - "unlocalizedName": "tile.furnace", - "localizedName": "Furnace", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, + "id": "minecraft:birch_stairs", + "localizedName": "Birch Stairs", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.5, - "resistance": 17.5, + "hardness": 2.0, + "resistance": 3.0, "ticksRandomly": false, - "fullCube": true, + "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, - "burnable": false, + "burnable": true, "opaque": true, "replacedDuringPlacement": false, - "toolRequired": true, + "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 62, - "id": "minecraft:lit_furnace", - "unlocalizedName": "tile.furnace", - "localizedName": "Furnace", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, + "id": "minecraft:birch_trapdoor", + "localizedName": "Birch Trapdoor", "material": { "powerSource": false, - "lightOpacity": 255, - "lightValue": 13, - "usingNeighborLight": false, - "hardness": 3.5, - "resistance": 17.5, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, "ticksRandomly": false, - "fullCube": true, + "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, - "burnable": false, + "burnable": true, "opaque": true, "replacedDuringPlacement": false, - "toolRequired": true, + "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 63, - "id": "minecraft:standing_sign", - "unlocalizedName": "tile.sign", - "localizedName": "Sign", - "states": { - "rotation": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, + "id": "minecraft:birch_wood", + "localizedName": "Birch Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:black_banner", + "localizedName": "Black Banner", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, "hardness": 1.0, - "resistance": 5.0, + "resistance": 1.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -2631,61 +969,22 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true } }, { - "legacyId": 64, - "id": "minecraft:wooden_door", - "unlocalizedName": "tile.doorOak", - "localizedName": "Oak Door", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "upper", - "lower" - ] - }, - "hinge": { - "values": [ - "left", - "right" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, + "id": "minecraft:black_bed", + "localizedName": "Black Bed", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 15.0, + "hardness": 0.2, + "resistance": 0.2, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -2695,138 +994,122 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 65, - "id": "minecraft:ladder", - "unlocalizedName": "tile.ladder", - "localizedName": "Ladder", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, + "id": "minecraft:black_carpet", + "localizedName": "Black Carpet", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.4, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:black_concrete", + "localizedName": "Black Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:black_concrete_powder", + "localizedName": "Black Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:black_glazed_terracotta", + "localizedName": "Black Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:black_shulker_box", + "localizedName": "Black Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, "resistance": 2.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 66, - "id": "minecraft:rail", - "unlocalizedName": "tile.rail", - "localizedName": "Rail", - "states": { - "shape": { - "values": [ - "north_south", - "east_west", - "ascending_east", - "ascending_west", - "ascending_north", - "ascending_south", - "south_east", - "south_west", - "north_west", - "north_east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.7, - "resistance": 3.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 67, - "id": "minecraft:stone_stairs", - "unlocalizedName": "tile.stairsStone", - "localizedName": "Cobblestone Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -2836,37 +1119,97 @@ "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true } }, { - "legacyId": 68, - "id": "minecraft:wall_sign", - "unlocalizedName": "tile.sign", - "localizedName": "Sign", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, + "id": "minecraft:black_stained_glass", + "localizedName": "Black Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:black_stained_glass_pane", + "localizedName": "Black Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:black_terracotta", + "localizedName": "Black Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:black_wall_banner", + "localizedName": "Air", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, "hardness": 1.0, - "resistance": 5.0, + "resistance": 1.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -2876,187 +1219,22 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true } }, { - "legacyId": 69, - "id": "minecraft:lever", - "unlocalizedName": "tile.lever", - "localizedName": "Lever", - "states": { - "facing": { - "values": [ - "down_x", - "east", - "west", - "south", - "north", - "up_z", - "up_x", - "down_z" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 70, - "id": "minecraft:stone_pressure_plate", - "unlocalizedName": "tile.pressurePlateStone", - "localizedName": "Stone Pressure Plate", - "states": { - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 71, - "id": "minecraft:iron_door", - "unlocalizedName": "tile.doorIron", - "localizedName": "Iron Door", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "upper", - "lower" - ] - }, - "hinge": { - "values": [ - "left", - "right" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, + "id": "minecraft:black_wool", + "localizedName": "Black Wool", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 5.0, - "resistance": 25.0, + "hardness": 0.8, + "resistance": 0.8, "ticksRandomly": false, - "fullCube": false, + "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 72, - "id": "minecraft:wooden_pressure_plate", - "unlocalizedName": "tile.pressurePlateWood", - "localizedName": "Wooden Pressure Plate", - "states": { - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -3066,264 +1244,3847 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 73, - "id": "minecraft:redstone_ore", - "unlocalizedName": "tile.oreRedstone", - "localizedName": "Redstone Ore", - "states": {}, + "id": "minecraft:blue_banner", + "localizedName": "Blue Banner", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, + "hardness": 1.0, + "resistance": 1.0, "ticksRandomly": false, - "fullCube": true, + "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, - "burnable": false, + "burnable": true, "opaque": true, "replacedDuringPlacement": false, - "toolRequired": true, + "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true } }, { - "legacyId": 74, - "id": "minecraft:lit_redstone_ore", - "unlocalizedName": "tile.oreRedstone", - "localizedName": "Redstone Ore", - "states": {}, + "id": "minecraft:blue_bed", + "localizedName": "Blue Bed", "material": { "powerSource": false, - "lightOpacity": 255, - "lightValue": 9, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": true, - "fullCube": true, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, - "burnable": false, + "burnable": true, "opaque": true, "replacedDuringPlacement": false, - "toolRequired": true, + "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 75, - "id": "minecraft:unlit_redstone_torch", - "unlocalizedName": "tile.notGate", - "localizedName": "Redstone Torch", - "states": { - "facing": { - "values": [ - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 76, - "id": "minecraft:redstone_torch", - "unlocalizedName": "tile.notGate", - "localizedName": "Redstone Torch", - "states": { - "facing": { - "values": [ - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 7, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 77, - "id": "minecraft:stone_button", - "unlocalizedName": "tile.button", - "localizedName": "Button", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 78, - "id": "minecraft:snow_layer", - "unlocalizedName": "tile.snow", - "localizedName": "Snow", - "states": { - "layers": { - "values": [ - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8" - ] - } - }, + "id": "minecraft:blue_carpet", + "localizedName": "Blue Carpet", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:blue_concrete", + "localizedName": "Blue Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:blue_concrete_powder", + "localizedName": "Blue Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:blue_glazed_terracotta", + "localizedName": "Blue Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:blue_ice", + "localizedName": "Blue Ice", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.8, + "resistance": 2.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.989, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a0a0ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:blue_orchid", + "localizedName": "Blue Orchid", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:blue_shulker_box", + "localizedName": "Blue Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:blue_stained_glass", + "localizedName": "Blue Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:blue_stained_glass_pane", + "localizedName": "Blue Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:blue_terracotta", + "localizedName": "Blue Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:blue_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:blue_wool", + "localizedName": "Blue Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:bone_block", + "localizedName": "Bone Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:bookshelf", + "localizedName": "Bookshelf", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 1.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brain_coral", + "localizedName": "Brain Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brain_coral_block", + "localizedName": "Brain Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brain_coral_fan", + "localizedName": "Brain Coral Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brain_coral_wall_fan", + "localizedName": "Brain Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brewing_stand", + "localizedName": "Brewing Stand", + "material": { + "powerSource": false, + "lightValue": 1, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:brick_slab", + "localizedName": "Brick Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brick_stairs", + "localizedName": "Brick Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:bricks", + "localizedName": "Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_banner", + "localizedName": "Brown Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:brown_bed", + "localizedName": "Brown Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_carpet", + "localizedName": "Brown Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_concrete", + "localizedName": "Brown Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_concrete_powder", + "localizedName": "Brown Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_glazed_terracotta", + "localizedName": "Brown Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_mushroom", + "localizedName": "Brown Mushroom", + "material": { + "powerSource": false, + "lightValue": 1, + "hardness": 0.0, + "resistance": 0.0, "ticksRandomly": true, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_mushroom_block", + "localizedName": "Brown Mushroom Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_shulker_box", + "localizedName": "Brown Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:brown_stained_glass", + "localizedName": "Brown Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_stained_glass_pane", + "localizedName": "Brown Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_terracotta", + "localizedName": "Brown Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:brown_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:brown_wool", + "localizedName": "Brown Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:bubble_column", + "localizedName": "Bubble Column", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": true, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:bubble_coral", + "localizedName": "Bubble Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:bubble_coral_block", + "localizedName": "Bubble Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:bubble_coral_fan", + "localizedName": "Bubble Coral Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:bubble_coral_wall_fan", + "localizedName": "Bubble Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cactus", + "localizedName": "Cactus", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.4, + "resistance": 0.4, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cake", + "localizedName": "Cake", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:carrots", + "localizedName": "Carrots", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:carved_pumpkin", + "localizedName": "Carved Pumpkin", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cauldron", + "localizedName": "Cauldron", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cave_air", + "localizedName": "Cave Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, "liquid": false, "solid": false, "movementBlocker": false, "burnable": false, "opaque": false, "replacedDuringPlacement": true, - "toolRequired": true, - "fragileWhenPushed": true, + "toolRequired": false, + "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 79, - "id": "minecraft:ice", - "unlocalizedName": "tile.ice", - "localizedName": "Ice", - "states": {}, + "id": "minecraft:chain_command_block", + "localizedName": "Chain Command Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": -1.0, + "resistance": 3600000.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:chest", + "localizedName": "Chest", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.5, + "resistance": 2.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:chipped_anvil", + "localizedName": "Chipped Anvil", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 1200.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:chiseled_quartz_block", + "localizedName": "Chiseled Quartz Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:chiseled_red_sandstone", + "localizedName": "Chiseled Red Sandstone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:chiseled_sandstone", + "localizedName": "Chiseled Sandstone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:chiseled_stone_bricks", + "localizedName": "Chiseled Stone Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:chorus_flower", + "localizedName": "Chorus Flower", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.4, + "resistance": 0.4, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:chorus_plant", + "localizedName": "Chorus Plant", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.4, + "resistance": 0.4, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:clay", + "localizedName": "Clay", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.6, + "resistance": 0.6, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a4a8b8", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:coal_block", + "localizedName": "Block of Coal", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:coal_ore", + "localizedName": "Coal Ore", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:coarse_dirt", + "localizedName": "Coarse Dirt", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#976d4d", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cobblestone", + "localizedName": "Cobblestone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cobblestone_slab", + "localizedName": "Cobblestone Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cobblestone_stairs", + "localizedName": "Cobblestone Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cobblestone_wall", + "localizedName": "Cobblestone Wall", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cobweb", + "localizedName": "Cobweb", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 4.0, + "resistance": 4.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cocoa", + "localizedName": "Cocoa", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 3.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:command_block", + "localizedName": "Command Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": -1.0, + "resistance": 3600000.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:comparator", + "localizedName": "Redstone Comparator", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:conduit", + "localizedName": "Conduit", + "material": { + "powerSource": false, + "lightValue": 15, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:cracked_stone_bricks", + "localizedName": "Cracked Stone Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:crafting_table", + "localizedName": "Crafting Table", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.5, + "resistance": 2.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:creeper_head", + "localizedName": "Creeper Head", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:creeper_wall_head", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:cut_red_sandstone", + "localizedName": "Cut Red Sandstone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cut_sandstone", + "localizedName": "Cut Sandstone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cyan_banner", + "localizedName": "Cyan Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:cyan_bed", + "localizedName": "Cyan Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cyan_carpet", + "localizedName": "Cyan Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cyan_concrete", + "localizedName": "Cyan Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cyan_concrete_powder", + "localizedName": "Cyan Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cyan_glazed_terracotta", + "localizedName": "Cyan Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cyan_shulker_box", + "localizedName": "Cyan Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:cyan_stained_glass", + "localizedName": "Cyan Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cyan_stained_glass_pane", + "localizedName": "Cyan Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cyan_terracotta", + "localizedName": "Cyan Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:cyan_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:cyan_wool", + "localizedName": "Cyan Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:damaged_anvil", + "localizedName": "Damaged Anvil", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 1200.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dandelion", + "localizedName": "Dandelion", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_button", + "localizedName": "Dark Oak Button", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_door", + "localizedName": "Dark Oak Door", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_fence", + "localizedName": "Dark Oak Fence", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_fence_gate", + "localizedName": "Dark Oak Fence Gate", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_leaves", + "localizedName": "Dark Oak Leaves", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_log", + "localizedName": "Dark Oak Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_planks", + "localizedName": "Dark Oak Planks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_pressure_plate", + "localizedName": "Dark Oak Pressure Plate", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_sapling", + "localizedName": "Dark Oak Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_slab", + "localizedName": "Dark Oak Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_stairs", + "localizedName": "Dark Oak Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_trapdoor", + "localizedName": "Dark Oak Trapdoor", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_oak_wood", + "localizedName": "Dark Oak Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_prismarine", + "localizedName": "Dark Prismarine", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_prismarine_slab", + "localizedName": "Dark Prismarine Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dark_prismarine_stairs", + "localizedName": "Dark Prismarine Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:daylight_detector", + "localizedName": "Daylight Detector", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:dead_brain_coral_block", + "localizedName": "Dead Brain Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_brain_coral_fan", + "localizedName": "Dead Brain Coral Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_brain_coral_wall_fan", + "localizedName": "Dead Brain Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_bubble_coral_block", + "localizedName": "Dead Bubble Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_bubble_coral_fan", + "localizedName": "Dead Bubble Coral Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_bubble_coral_wall_fan", + "localizedName": "Dead Bubble Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_bush", + "localizedName": "Dead Bush", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_fire_coral_block", + "localizedName": "Dead Fire Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_fire_coral_fan", + "localizedName": "Dead Fire Coral Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_fire_coral_wall_fan", + "localizedName": "Dead Fire Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_horn_coral_block", + "localizedName": "Dead Horn Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_horn_coral_fan", + "localizedName": "Dead Horn Coral Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_horn_coral_wall_fan", + "localizedName": "Dead Horn Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_tube_coral_block", + "localizedName": "Dead Tube Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_tube_coral_fan", + "localizedName": "Dead Tube Coral Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dead_tube_coral_wall_fan", + "localizedName": "Dead Tube Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:detector_rail", + "localizedName": "Detector Rail", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.7, + "resistance": 0.7, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:diamond_block", + "localizedName": "Block of Diamond", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:diamond_ore", + "localizedName": "Diamond Ore", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:diorite", + "localizedName": "Diorite", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dirt", + "localizedName": "Dirt", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#976d4d", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dispenser", + "localizedName": "Dispenser", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.5, + "resistance": 3.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:dragon_egg", + "localizedName": "Dragon Egg", + "material": { + "powerSource": false, + "lightValue": 1, + "hardness": 3.0, + "resistance": 9.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dragon_head", + "localizedName": "Dragon Head", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:dragon_wall_head", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:dried_kelp_block", + "localizedName": "Dried Kelp Block", "material": { "powerSource": false, - "lightOpacity": 3, "lightValue": 0, - "usingNeighborLight": false, "hardness": 0.5, "resistance": 2.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#7fb238", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:dropper", + "localizedName": "Dropper", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.5, + "resistance": 3.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:emerald_block", + "localizedName": "Block of Emerald", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:emerald_ore", + "localizedName": "Emerald Ore", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:enchanting_table", + "localizedName": "Enchanting Table", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 1200.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:end_gateway", + "localizedName": "End Gateway", + "material": { + "powerSource": false, + "lightValue": 15, + "hardness": -1.0, + "resistance": 3600000.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:end_portal", + "localizedName": "End Portal", + "material": { + "powerSource": false, + "lightValue": 15, + "hardness": -1.0, + "resistance": 3600000.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:end_portal_frame", + "localizedName": "End Portal Frame", + "material": { + "powerSource": false, + "lightValue": 1, + "hardness": -1.0, + "resistance": 3600000.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:end_rod", + "localizedName": "End Rod", + "material": { + "powerSource": false, + "lightValue": 14, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:end_stone", + "localizedName": "End Stone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 9.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:end_stone_bricks", + "localizedName": "End Stone Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:ender_chest", + "localizedName": "Ender Chest", + "material": { + "powerSource": false, + "lightValue": 7, + "hardness": 22.5, + "resistance": 600.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:farmland", + "localizedName": "Farmland", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.6, + "resistance": 0.6, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#976d4d", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:fern", + "localizedName": "Fern", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:fire", + "localizedName": "Fire", + "material": { + "powerSource": false, + "lightValue": 15, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:fire_coral", + "localizedName": "Fire Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:fire_coral_block", + "localizedName": "Fire Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:fire_coral_fan", + "localizedName": "Fire Coral Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:fire_coral_wall_fan", + "localizedName": "Fire Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:flower_pot", + "localizedName": "Flower Pot", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:frosted_ice", + "localizedName": "Frosted Ice", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, "ticksRandomly": true, "fullCube": true, "slipperiness": 0.98, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -3333,28 +5094,22 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#a0a0ff", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 80, - "id": "minecraft:snow", - "unlocalizedName": "tile.snow", - "localizedName": "Snow", - "states": {}, + "id": "minecraft:furnace", + "localizedName": "Furnace", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.2, - "resistance": 1.0, - "ticksRandomly": true, + "hardness": 3.5, + "resistance": 3.5, + "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -3364,49 +5119,22 @@ "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": true } }, { - "legacyId": 81, - "id": "minecraft:cactus", - "unlocalizedName": "tile.cactus", - "localizedName": "Cactus", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, + "id": "minecraft:glass", + "localizedName": "Glass", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.4, - "resistance": 2.0, - "ticksRandomly": true, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -3414,247 +5142,99 @@ "opaque": false, "replacedDuringPlacement": false, "toolRequired": false, - "fragileWhenPushed": true, + "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 82, - "id": "minecraft:clay", - "unlocalizedName": "tile.clay", - "localizedName": "Clay", - "states": {}, + "id": "minecraft:glass_pane", + "localizedName": "Glass Pane", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.6, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:glowstone", + "localizedName": "Glowstone", + "material": { + "powerSource": false, + "lightValue": 15, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gold_block", + "localizedName": "Block of Gold", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gold_ore", + "localizedName": "Gold Ore", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, "resistance": 3.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 83, - "id": "minecraft:reeds", - "unlocalizedName": "tile.reeds", - "localizedName": "Sugar cane", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 84, - "id": "minecraft:jukebox", - "unlocalizedName": "tile.jukebox", - "localizedName": "Jukebox", - "states": { - "has_record": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 85, - "id": "minecraft:fence", - "unlocalizedName": "tile.fence", - "localizedName": "Oak Fence", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 86, - "id": "minecraft:pumpkin", - "unlocalizedName": "tile.pumpkin", - "localizedName": "Pumpkin", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.0, - "resistance": 5.0, - "ticksRandomly": true, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 87, - "id": "minecraft:netherrack", - "unlocalizedName": "tile.hellrock", - "localizedName": "Netherrack", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.4, - "resistance": 2.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -3664,474 +5244,22 @@ "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 88, - "id": "minecraft:soul_sand", - "unlocalizedName": "tile.hellsand", - "localizedName": "Soul Sand", - "states": {}, + "id": "minecraft:granite", + "localizedName": "Granite", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 89, - "id": "minecraft:glowstone", - "unlocalizedName": "tile.lightgem", - "localizedName": "Glowstone", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 15, - "usingNeighborLight": false, - "hardness": 0.3, - "resistance": 1.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 90, - "id": "minecraft:portal", - "unlocalizedName": "tile.portal", - "localizedName": "Portal", - "states": { - "axis": { - "values": [ - "x", - "z" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 11, - "usingNeighborLight": true, - "hardness": -1.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": true, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 91, - "id": "minecraft:lit_pumpkin", - "unlocalizedName": "tile.litpumpkin", - "localizedName": "Jack o\u0027Lantern", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 15, - "usingNeighborLight": false, - "hardness": 1.0, - "resistance": 5.0, - "ticksRandomly": true, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 92, - "id": "minecraft:cake", - "unlocalizedName": "tile.cake", - "localizedName": "Cake", - "states": { - "bites": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 93, - "id": "minecraft:unpowered_repeater", - "unlocalizedName": "tile.diode", - "localizedName": "Redstone Repeater", - "states": { - "delay": { - "values": [ - "1", - "2", - "3", - "4" - ] - }, - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "locked": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 94, - "id": "minecraft:powered_repeater", - "unlocalizedName": "tile.diode", - "localizedName": "Redstone Repeater", - "states": { - "delay": { - "values": [ - "1", - "2", - "3", - "4" - ] - }, - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "locked": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 95, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass", - "localizedName": "Stained Glass", - "states": { - "color": { - "values": [ - "white", - "orange", - "magenta", - "light_blue", - "yellow", - "lime", - "pink", - "gray", - "silver", - "cyan", - "purple", - "blue", - "brown", - "green", - "red", - "black" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.3, - "resistance": 1.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 96, - "id": "minecraft:trapdoor", - "unlocalizedName": "tile.trapdoor", - "localizedName": "Wooden Trapdoor", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 97, - "id": "minecraft:monster_egg", - "unlocalizedName": "tile.monsterStoneEgg", - "localizedName": "Stone Monster Egg", - "states": { - "variant": { - "values": [ - "stone", - "cobblestone", - "stone_brick", - "mossy_brick", - "cracked_brick", - "chiseled_brick" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.75, - "resistance": 3.75, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 98, - "id": "minecraft:stonebrick", - "unlocalizedName": "tile.stonebricksmooth", - "localizedName": "Stone Bricks", - "states": { - "variant": { - "values": [ - "stonebrick", - "mossy_stonebrick", - "cracked_stonebrick", - "chiseled_stonebrick" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, "hardness": 1.5, - "resistance": 30.0, + "resistance": 6.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -4141,406 +5269,22 @@ "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 99, - "id": "minecraft:brown_mushroom_block", - "unlocalizedName": "tile.mushroom", - "localizedName": "Mushroom", - "states": { - "variant": { - "values": [ - "north_west", - "north", - "north_east", - "west", - "center", - "east", - "south_west", - "south", - "south_east", - "stem", - "all_inside", - "all_outside", - "all_stem" - ] - } - }, + "id": "minecraft:grass", + "localizedName": "Grass", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.2, - "resistance": 1.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 100, - "id": "minecraft:red_mushroom_block", - "unlocalizedName": "tile.mushroom", - "localizedName": "Mushroom", - "states": { - "variant": { - "values": [ - "north_west", - "north", - "north_east", - "west", - "center", - "east", - "south_west", - "south", - "south_east", - "stem", - "all_inside", - "all_outside", - "all_stem" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.2, - "resistance": 1.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 101, - "id": "minecraft:iron_bars", - "unlocalizedName": "tile.fenceIron", - "localizedName": "Iron Bars", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 5.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 102, - "id": "minecraft:glass_pane", - "unlocalizedName": "tile.thinGlass", - "localizedName": "Glass Pane", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.3, - "resistance": 1.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 103, - "id": "minecraft:melon_block", - "unlocalizedName": "tile.melon", - "localizedName": "Melon", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.0, - "resistance": 5.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 104, - "id": "minecraft:pumpkin_stem", - "unlocalizedName": "tile.pumpkinStem", - "localizedName": "Pumpkin Stem", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ] - }, - "facing": { - "values": [ - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, "hardness": 0.0, "resistance": 0.0, - "ticksRandomly": true, + "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 105, - "id": "minecraft:melon_stem", - "unlocalizedName": "tile.pumpkinStem", - "localizedName": "Pumpkin Stem", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ] - }, - "facing": { - "values": [ - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 106, - "id": "minecraft:vine", - "unlocalizedName": "tile.vine", - "localizedName": "Vines", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "up": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.2, - "resistance": 1.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": false, "movementBlocker": false, @@ -4550,203 +5294,22 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 107, - "id": "minecraft:fence_gate", - "unlocalizedName": "tile.fenceGate", - "localizedName": "Oak Fence Gate", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "in_wall": { - "values": [ - "true", - "false" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, + "id": "minecraft:grass_block", + "localizedName": "Grass Block", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 108, - "id": "minecraft:brick_stairs", - "unlocalizedName": "tile.stairsBrick", - "localizedName": "Brick Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 109, - "id": "minecraft:stone_brick_stairs", - "unlocalizedName": "tile.stairsStoneBrickSmooth", - "localizedName": "Stone Brick Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 1.5, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 110, - "id": "minecraft:mycelium", - "unlocalizedName": "tile.mycel", - "localizedName": "Mycelium", - "states": { - "snowy": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, "hardness": 0.6, - "resistance": 3.0, + "resistance": 0.6, "ticksRandomly": true, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -4756,501 +5319,47 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#7fb238", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 111, - "id": "minecraft:waterlily", - "unlocalizedName": "tile.waterlily", - "localizedName": "Lily Pad", - "states": {}, + "id": "minecraft:grass_path", + "localizedName": "Grass Path", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, + "hardness": 0.65, + "resistance": 0.65, + "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, - "solid": false, - "movementBlocker": false, + "solid": true, + "movementBlocker": true, "burnable": false, - "opaque": false, + "opaque": true, "replacedDuringPlacement": false, "toolRequired": false, - "fragileWhenPushed": true, + "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#976d4d", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 112, - "id": "minecraft:nether_brick", - "unlocalizedName": "tile.netherBrick", - "localizedName": "Nether Brick", - "states": {}, + "id": "minecraft:gravel", + "localizedName": "Gravel", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 2.0, - "resistance": 30.0, + "hardness": 0.6, + "resistance": 0.6, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 113, - "id": "minecraft:nether_brick_fence", - "unlocalizedName": "tile.netherFence", - "localizedName": "Nether Brick Fence", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 114, - "id": "minecraft:nether_brick_stairs", - "unlocalizedName": "tile.stairsNetherBrick", - "localizedName": "Nether Brick Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 115, - "id": "minecraft:nether_wart", - "unlocalizedName": "tile.netherStalk", - "localizedName": "Nether Wart", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 116, - "id": "minecraft:enchanting_table", - "unlocalizedName": "tile.enchantmentTable", - "localizedName": "Enchantment Table", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 5.0, - "resistance": 6000.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 117, - "id": "minecraft:brewing_stand", - "unlocalizedName": "tile.brewingStand", - "localizedName": "Brewing Stand", - "states": { - "has_bottle_0": { - "values": [ - "true", - "false" - ] - }, - "has_bottle_1": { - "values": [ - "true", - "false" - ] - }, - "has_bottle_2": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 1, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 118, - "id": "minecraft:cauldron", - "unlocalizedName": "tile.cauldron", - "localizedName": "Cauldron", - "states": { - "level": { - "values": [ - "0", - "1", - "2", - "3" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 119, - "id": "minecraft:end_portal", - "unlocalizedName": "tile.null", - "localizedName": "tile.null.name", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 15, - "usingNeighborLight": true, - "hardness": -1.0, - "resistance": 1.8E7, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": true, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 120, - "id": "minecraft:end_portal_frame", - "unlocalizedName": "tile.endPortalFrame", - "localizedName": "End Portal", - "states": { - "eye": { - "values": [ - "true", - "false" - ] - }, - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 1, - "usingNeighborLight": true, - "hardness": -1.0, - "resistance": 1.8E7, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 121, - "id": "minecraft:end_stone", - "unlocalizedName": "tile.whiteStone", - "localizedName": "End Stone", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 45.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 122, - "id": "minecraft:dragon_egg", - "unlocalizedName": "tile.dragonEgg", - "localizedName": "Dragon Egg", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 1, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 45.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 123, - "id": "minecraft:redstone_lamp", - "unlocalizedName": "tile.redstoneLight", - "localizedName": "Redstone Lamp", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.3, - "resistance": 1.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -5260,1022 +5369,1147 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 124, - "id": "minecraft:lit_redstone_lamp", - "unlocalizedName": "tile.redstoneLight", - "localizedName": "Redstone Lamp", - "states": {}, + "id": "minecraft:gray_banner", + "localizedName": "Gray Banner", "material": { "powerSource": false, - "lightOpacity": 255, - "lightValue": 15, - "usingNeighborLight": false, - "hardness": 0.3, - "resistance": 1.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 125, - "id": "minecraft:double_wooden_slab", - "unlocalizedName": "tile.woodSlab", - "localizedName": "Wood Slab", - "states": { - "variant": { - "values": [ - "oak", - "spruce", - "birch", - "jungle", - "acacia", - "dark_oak" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 126, - "id": "minecraft:wooden_slab", - "unlocalizedName": "tile.woodSlab", - "localizedName": "Wood Slab", - "states": { - "half": { - "values": [ - "top", - "bottom" - ] - }, - "variant": { - "values": [ - "oak", - "spruce", - "birch", - "jungle", - "acacia", - "dark_oak" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 127, - "id": "minecraft:cocoa", - "unlocalizedName": "tile.cocoa", - "localizedName": "Cocoa", - "states": { - "age": { - "values": [ - "0", - "1", - "2" - ] - }, - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.2, - "resistance": 15.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 128, - "id": "minecraft:sandstone_stairs", - "unlocalizedName": "tile.stairsSandStone", - "localizedName": "Sandstone Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.8, - "resistance": 4.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 129, - "id": "minecraft:emerald_ore", - "unlocalizedName": "tile.oreEmerald", - "localizedName": "Emerald Ore", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 130, - "id": "minecraft:ender_chest", - "unlocalizedName": "tile.enderChest", - "localizedName": "Ender Chest", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 7, - "usingNeighborLight": true, - "hardness": 22.5, - "resistance": 3000.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 131, - "id": "minecraft:tripwire_hook", - "unlocalizedName": "tile.tripWireSource", - "localizedName": "Tripwire Hook", - "states": { - "attached": { - "values": [ - "true", - "false" - ] - }, - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 132, - "id": "minecraft:tripwire", - "unlocalizedName": "tile.tripWire", - "localizedName": "Tripwire", - "states": { - "attached": { - "values": [ - "true", - "false" - ] - }, - "disarmed": { - "values": [ - "true", - "false" - ] - }, - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 133, - "id": "minecraft:emerald_block", - "unlocalizedName": "tile.blockEmerald", - "localizedName": "Block of Emerald", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 5.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 134, - "id": "minecraft:spruce_stairs", - "unlocalizedName": "tile.stairsWoodSpruce", - "localizedName": "Spruce Wood Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 135, - "id": "minecraft:birch_stairs", - "unlocalizedName": "tile.stairsWoodBirch", - "localizedName": "Birch Wood Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 136, - "id": "minecraft:jungle_stairs", - "unlocalizedName": "tile.stairsWoodJungle", - "localizedName": "Jungle Wood Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 137, - "id": "minecraft:command_block", - "unlocalizedName": "tile.commandBlock", - "localizedName": "Command Block", - "states": { - "conditional": { - "values": [ - "true", - "false" - ] - }, - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": -1.0, - "resistance": 1.8E7, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 138, - "id": "minecraft:beacon", - "unlocalizedName": "tile.beacon", - "localizedName": "Beacon", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 15, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 139, - "id": "minecraft:cobblestone_wall", - "unlocalizedName": "tile.cobbleWall", - "localizedName": "Cobblestone Wall", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "up": { - "values": [ - "true", - "false" - ] - }, - "variant": { - "values": [ - "cobblestone", - "mossy_cobblestone" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 140, - "id": "minecraft:flower_pot", - "unlocalizedName": "tile.flowerPot", - "localizedName": "Flower Pot", - "states": { - "contents": { - "values": [ - "empty", - "rose", - "blue_orchid", - "allium", - "houstonia", - "red_tulip", - "orange_tulip", - "white_tulip", - "pink_tulip", - "oxeye_daisy", - "dandelion", - "oak_sapling", - "spruce_sapling", - "birch_sapling", - "jungle_sapling", - "acacia_sapling", - "dark_oak_sapling", - "mushroom_red", - "mushroom_brown", - "dead_bush", - "fern", - "cactus" - ] - }, - "legacy_data": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 141, - "id": "minecraft:carrots", - "unlocalizedName": "tile.carrots", - "localizedName": "Carrots", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 142, - "id": "minecraft:potatoes", - "unlocalizedName": "tile.potatoes", - "localizedName": "Potatoes", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 143, - "id": "minecraft:wooden_button", - "unlocalizedName": "tile.button", - "localizedName": "Button", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 144, - "id": "minecraft:skull", - "unlocalizedName": "tile.skull", - "localizedName": "tile.skull.skeleton.name", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - }, - "nodrop": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:gray_bed", + "localizedName": "Gray Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gray_carpet", + "localizedName": "Gray Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gray_concrete", + "localizedName": "Gray Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gray_concrete_powder", + "localizedName": "Gray Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gray_glazed_terracotta", + "localizedName": "Gray Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gray_shulker_box", + "localizedName": "Gray Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:gray_stained_glass", + "localizedName": "Gray Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gray_stained_glass_pane", + "localizedName": "Gray Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gray_terracotta", + "localizedName": "Gray Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:gray_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:gray_wool", + "localizedName": "Gray Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:green_banner", + "localizedName": "Green Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:green_bed", + "localizedName": "Green Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:green_carpet", + "localizedName": "Green Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:green_concrete", + "localizedName": "Green Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:green_concrete_powder", + "localizedName": "Green Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:green_glazed_terracotta", + "localizedName": "Green Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:green_shulker_box", + "localizedName": "Green Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:green_stained_glass", + "localizedName": "Green Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:green_stained_glass_pane", + "localizedName": "Green Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:green_terracotta", + "localizedName": "Green Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:green_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:green_wool", + "localizedName": "Green Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:hay_block", + "localizedName": "Hay Bale", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#7fb238", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:heavy_weighted_pressure_plate", + "localizedName": "Heavy Weighted Pressure Plate", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:hopper", + "localizedName": "Hopper", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 4.8, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:horn_coral", + "localizedName": "Horn Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:horn_coral_block", + "localizedName": "Horn Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:horn_coral_fan", + "localizedName": "Horn Coral Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:horn_coral_wall_fan", + "localizedName": "Horn Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:ice", + "localizedName": "Ice", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.98, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a0a0ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:infested_chiseled_stone_bricks", + "localizedName": "Infested Chiseled Stone Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.75, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a4a8b8", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:infested_cobblestone", + "localizedName": "Infested Cobblestone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.75, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a4a8b8", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:infested_cracked_stone_bricks", + "localizedName": "Infested Cracked Stone Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.75, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a4a8b8", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:infested_mossy_stone_bricks", + "localizedName": "Infested Mossy Stone Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.75, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a4a8b8", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:infested_stone", + "localizedName": "Infested Stone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.75, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a4a8b8", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:infested_stone_bricks", + "localizedName": "Infested Stone Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.75, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a4a8b8", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:iron_bars", + "localizedName": "Iron Bars", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:iron_block", + "localizedName": "Block of Iron", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:iron_door", + "localizedName": "Iron Door", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, "resistance": 5.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:iron_ore", + "localizedName": "Iron Ore", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:iron_trapdoor", + "localizedName": "Iron Trapdoor", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 5.0, + "resistance": 5.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jack_o_lantern", + "localizedName": "Jack o\u0027Lantern", + "material": { + "powerSource": false, + "lightValue": 15, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jukebox", + "localizedName": "Jukebox", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:jungle_button", + "localizedName": "Jungle Button", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, "liquid": false, "solid": false, "movementBlocker": false, @@ -6285,44 +6519,397 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 145, - "id": "minecraft:anvil", - "unlocalizedName": "tile.anvil", - "localizedName": "Anvil", - "states": { - "damage": { - "values": [ - "0", - "1", - "2" - ] - }, - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, + "id": "minecraft:jungle_door", + "localizedName": "Jungle Door", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 5.0, - "resistance": 6000.0, + "hardness": 3.0, + "resistance": 3.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_fence", + "localizedName": "Jungle Fence", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_fence_gate", + "localizedName": "Jungle Fence Gate", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_leaves", + "localizedName": "Jungle Leaves", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_log", + "localizedName": "Jungle Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_planks", + "localizedName": "Jungle Planks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_pressure_plate", + "localizedName": "Jungle Pressure Plate", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_sapling", + "localizedName": "Jungle Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_slab", + "localizedName": "Jungle Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_stairs", + "localizedName": "Jungle Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_trapdoor", + "localizedName": "Jungle Trapdoor", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:jungle_wood", + "localizedName": "Jungle Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:kelp", + "localizedName": "Kelp", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:kelp_plant", + "localizedName": "Kelp Plant", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:ladder", + "localizedName": "Ladder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.4, + "resistance": 0.4, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lapis_block", + "localizedName": "Lapis Lazuli Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, "liquid": false, "solid": true, "movementBlocker": true, @@ -6331,329 +6918,1623 @@ "replacedDuringPlacement": false, "toolRequired": true, "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lapis_ore", + "localizedName": "Lapis Lazuli Ore", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:large_fern", + "localizedName": "Large Fern", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lava", + "localizedName": "Lava", + "material": { + "powerSource": false, + "lightValue": 15, + "hardness": 100.0, + "resistance": 100.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": true, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#ff0000", + "isTranslucent": true, + "hasContainer": false + } + }, + { + "id": "minecraft:lever", + "localizedName": "Lever", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_blue_banner", + "localizedName": "Light Blue Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:light_blue_bed", + "localizedName": "Light Blue Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_blue_carpet", + "localizedName": "Light Blue Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_blue_concrete", + "localizedName": "Light Blue Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_blue_concrete_powder", + "localizedName": "Light Blue Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_blue_glazed_terracotta", + "localizedName": "Light Blue Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_blue_shulker_box", + "localizedName": "Light Blue Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:light_blue_stained_glass", + "localizedName": "Light Blue Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_blue_stained_glass_pane", + "localizedName": "Light Blue Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_blue_terracotta", + "localizedName": "Light Blue Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_blue_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:light_blue_wool", + "localizedName": "Light Blue Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_gray_banner", + "localizedName": "Light Gray Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:light_gray_bed", + "localizedName": "Light Gray Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_gray_carpet", + "localizedName": "Light Gray Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_gray_concrete", + "localizedName": "Light Gray Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_gray_concrete_powder", + "localizedName": "Light Gray Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_gray_glazed_terracotta", + "localizedName": "Light Gray Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_gray_shulker_box", + "localizedName": "Light Gray Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:light_gray_stained_glass", + "localizedName": "Light Gray Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_gray_stained_glass_pane", + "localizedName": "Light Gray Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_gray_terracotta", + "localizedName": "Light Gray Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_gray_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:light_gray_wool", + "localizedName": "Light Gray Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:light_weighted_pressure_plate", + "localizedName": "Light Weighted Pressure Plate", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lilac", + "localizedName": "Lilac", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lily_pad", + "localizedName": "Lily Pad", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lime_banner", + "localizedName": "Lime Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:lime_bed", + "localizedName": "Lime Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lime_carpet", + "localizedName": "Lime Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lime_concrete", + "localizedName": "Lime Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lime_concrete_powder", + "localizedName": "Lime Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lime_glazed_terracotta", + "localizedName": "Lime Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lime_shulker_box", + "localizedName": "Lime Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:lime_stained_glass", + "localizedName": "Lime Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lime_stained_glass_pane", + "localizedName": "Lime Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lime_terracotta", + "localizedName": "Lime Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:lime_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:lime_wool", + "localizedName": "Lime Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magenta_banner", + "localizedName": "Magenta Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:magenta_bed", + "localizedName": "Magenta Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magenta_carpet", + "localizedName": "Magenta Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magenta_concrete", + "localizedName": "Magenta Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magenta_concrete_powder", + "localizedName": "Magenta Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magenta_glazed_terracotta", + "localizedName": "Magenta Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magenta_shulker_box", + "localizedName": "Magenta Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:magenta_stained_glass", + "localizedName": "Magenta Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magenta_stained_glass_pane", + "localizedName": "Magenta Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magenta_terracotta", + "localizedName": "Magenta Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magenta_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:magenta_wool", + "localizedName": "Magenta Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:magma_block", + "localizedName": "Magma Block", + "material": { + "powerSource": false, + "lightValue": 3, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:melon", + "localizedName": "Melon", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:melon_stem", + "localizedName": "Melon Stem", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:mossy_cobblestone", + "localizedName": "Mossy Cobblestone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:mossy_cobblestone_wall", + "localizedName": "Mossy Cobblestone Wall", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:mossy_stone_bricks", + "localizedName": "Mossy Stone Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:moving_piston", + "localizedName": "Moving Piston", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": -1.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, "unpushable": true, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true } }, { - "legacyId": 146, - "id": "minecraft:trapped_chest", - "unlocalizedName": "tile.chestTrap", - "localizedName": "Trapped Chest", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, + "id": "minecraft:mushroom_stem", + "localizedName": "Mushroom Stem", "material": { - "powerSource": true, - "lightOpacity": 0, + "powerSource": false, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.5, - "resistance": 12.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 147, - "id": "minecraft:light_weighted_pressure_plate", - "unlocalizedName": "tile.weightedPlate_light", - "localizedName": "Weighted Pressure Plate (Light)", - "states": { - "power": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 148, - "id": "minecraft:heavy_weighted_pressure_plate", - "unlocalizedName": "tile.weightedPlate_heavy", - "localizedName": "Weighted Pressure Plate (Heavy)", - "states": { - "power": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 149, - "id": "minecraft:unpowered_comparator", - "unlocalizedName": "tile.comparator", - "localizedName": "Redstone Comparator", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "mode": { - "values": [ - "compare", - "subtract" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 150, - "id": "minecraft:powered_comparator", - "unlocalizedName": "tile.comparator", - "localizedName": "Redstone Comparator", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "mode": { - "values": [ - "compare", - "subtract" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 9, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 151, - "id": "minecraft:daylight_detector", - "unlocalizedName": "tile.daylightDetector", - "localizedName": "Daylight Sensor", - "states": { - "power": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, "hardness": 0.2, - "resistance": 1.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 152, - "id": "minecraft:redstone_block", - "unlocalizedName": "tile.blockRedstone", - "localizedName": "Block of Redstone", - "states": {}, - "material": { - "powerSource": true, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 5.0, - "resistance": 30.0, + "resistance": 0.2, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:mycelium", + "localizedName": "Mycelium", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.6, + "resistance": 0.6, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#7fb238", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:nether_brick_fence", + "localizedName": "Nether Brick Fence", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, "liquid": false, "solid": true, "movementBlocker": true, @@ -6663,28 +8544,122 @@ "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 153, - "id": "minecraft:quartz_ore", - "unlocalizedName": "tile.netherquartz", + "id": "minecraft:nether_brick_slab", + "localizedName": "Nether Brick Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:nether_brick_stairs", + "localizedName": "Nether Brick Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:nether_bricks", + "localizedName": "Nether Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:nether_portal", + "localizedName": "Nether Portal", + "material": { + "powerSource": false, + "lightValue": 11, + "hardness": -1.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:nether_quartz_ore", "localizedName": "Nether Quartz Ore", - "states": {}, "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, "hardness": 3.0, - "resistance": 15.0, + "resistance": 3.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -6694,188 +8669,22 @@ "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 154, - "id": "minecraft:hopper", - "unlocalizedName": "tile.hopper", - "localizedName": "Hopper", - "states": { - "enabled": { - "values": [ - "true", - "false" - ] - }, - "facing": { - "values": [ - "down", - "north", - "south", - "west", - "east" - ] - } - }, + "id": "minecraft:nether_wart", + "localizedName": "Nether Wart", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 24.0, - "ticksRandomly": false, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 155, - "id": "minecraft:quartz_block", - "unlocalizedName": "tile.quartzBlock", - "localizedName": "Block of Quartz", - "states": { - "variant": { - "values": [ - "default", - "chiseled", - "lines_y", - "lines_x", - "lines_z" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.8, - "resistance": 4.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 156, - "id": "minecraft:quartz_stairs", - "unlocalizedName": "tile.stairsQuartz", - "localizedName": "Quartz Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.8, - "resistance": 4.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 157, - "id": "minecraft:activator_rail", - "unlocalizedName": "tile.activatorRail", - "localizedName": "Activator Rail", - "states": { - "powered": { - "values": [ - "true", - "false" - ] - }, - "shape": { - "values": [ - "north_south", - "east_west", - "ascending_east", - "ascending_west", - "ascending_north", - "ascending_south" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.7, - "resistance": 3.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": false, "movementBlocker": false, @@ -6885,223 +8694,197 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 158, - "id": "minecraft:dropper", - "unlocalizedName": "tile.dropper", - "localizedName": "Dropper", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - }, - "triggered": { - "values": [ - "true", - "false" - ] - } - }, + "id": "minecraft:nether_wart_block", + "localizedName": "Nether Wart Block", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.5, - "resistance": 17.5, + "hardness": 1.0, + "resistance": 1.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, "burnable": false, "opaque": true, "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 159, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained", - "localizedName": "Stained Terracotta", - "states": { - "color": { - "values": [ - "white", - "orange", - "magenta", - "light_blue", - "yellow", - "lime", - "pink", - "gray", - "silver", - "cyan", - "purple", - "blue", - "brown", - "green", - "red", - "black" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.25, - "resistance": 21.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 160, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass", - "localizedName": "Stained Glass Pane", - "states": { - "color": { - "values": [ - "white", - "orange", - "magenta", - "light_blue", - "yellow", - "lime", - "pink", - "gray", - "silver", - "cyan", - "purple", - "blue", - "brown", - "green", - "red", - "black" - ] - }, - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.3, - "resistance": 1.5, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#7fb238", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 161, - "id": "minecraft:leaves2", - "unlocalizedName": "tile.leaves", - "localizedName": "Leaves", - "states": { - "check_decay": { - "values": [ - "true", - "false" - ] - }, - "decayable": { - "values": [ - "true", - "false" - ] - }, - "variant": { - "values": [ - "acacia", - "dark_oak" - ] - } - }, + "id": "minecraft:netherrack", + "localizedName": "Netherrack", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.4, + "resistance": 0.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:note_block", + "localizedName": "Note Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oak_button", + "localizedName": "Oak Button", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oak_door", + "localizedName": "Oak Door", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oak_fence", + "localizedName": "Oak Fence", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oak_fence_gate", + "localizedName": "Oak Fence Gate", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oak_leaves", + "localizedName": "Oak Leaves", "material": { "powerSource": false, - "lightOpacity": 1, "lightValue": 0, - "usingNeighborLight": false, "hardness": 0.2, - "resistance": 1.0, + "resistance": 0.2, "ticksRandomly": true, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -7111,43 +8894,22 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 162, - "id": "minecraft:log2", - "unlocalizedName": "tile.log", - "localizedName": "Wood", - "states": { - "axis": { - "values": [ - "x", - "y", - "z", - "none" - ] - }, - "variant": { - "values": [ - "acacia", - "dark_oak" - ] - } - }, + "id": "minecraft:oak_log", + "localizedName": "Oak Log", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, "hardness": 2.0, - "resistance": 10.0, + "resistance": 2.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -7157,52 +8919,47 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 163, - "id": "minecraft:acacia_stairs", - "unlocalizedName": "tile.stairsWoodAcacia", - "localizedName": "Acacia Wood Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, + "id": "minecraft:oak_planks", + "localizedName": "Oak Planks", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": true, "hardness": 2.0, - "resistance": 15.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oak_pressure_plate", + "localizedName": "Oak Pressure Plate", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -7212,52 +8969,47 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 164, - "id": "minecraft:dark_oak_stairs", - "unlocalizedName": "tile.stairsWoodDarkOak", - "localizedName": "Dark Oak Wood Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, + "id": "minecraft:oak_sapling", + "localizedName": "Oak Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oak_slab", + "localizedName": "Oak Slab", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": true, "hardness": 2.0, - "resistance": 15.0, + "resistance": 3.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -7267,28 +9019,3422 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 165, - "id": "minecraft:slime", - "unlocalizedName": "tile.slime", + "id": "minecraft:oak_stairs", + "localizedName": "Oak Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oak_trapdoor", + "localizedName": "Oak Trapdoor", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oak_wood", + "localizedName": "Oak Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:observer", + "localizedName": "Observer", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:obsidian", + "localizedName": "Obsidian", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 50.0, + "resistance": 1200.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_banner", + "localizedName": "Orange Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:orange_bed", + "localizedName": "Orange Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_carpet", + "localizedName": "Orange Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_concrete", + "localizedName": "Orange Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_concrete_powder", + "localizedName": "Orange Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_glazed_terracotta", + "localizedName": "Orange Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_shulker_box", + "localizedName": "Orange Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:orange_stained_glass", + "localizedName": "Orange Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_stained_glass_pane", + "localizedName": "Orange Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_terracotta", + "localizedName": "Orange Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_tulip", + "localizedName": "Orange Tulip", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:orange_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:orange_wool", + "localizedName": "Orange Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:oxeye_daisy", + "localizedName": "Oxeye Daisy", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:packed_ice", + "localizedName": "Packed Ice", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.98, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a0a0ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:peony", + "localizedName": "Peony", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:petrified_oak_slab", + "localizedName": "Petrified Oak Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_banner", + "localizedName": "Pink Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:pink_bed", + "localizedName": "Pink Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_carpet", + "localizedName": "Pink Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_concrete", + "localizedName": "Pink Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_concrete_powder", + "localizedName": "Pink Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_glazed_terracotta", + "localizedName": "Pink Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_shulker_box", + "localizedName": "Pink Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:pink_stained_glass", + "localizedName": "Pink Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_stained_glass_pane", + "localizedName": "Pink Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_terracotta", + "localizedName": "Pink Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_tulip", + "localizedName": "Pink Tulip", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pink_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:pink_wool", + "localizedName": "Pink Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:piston", + "localizedName": "Piston", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:piston_head", + "localizedName": "Piston Head", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:player_head", + "localizedName": "Player Head", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:player_wall_head", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:podzol", + "localizedName": "Podzol", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#976d4d", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:polished_andesite", + "localizedName": "Polished Andesite", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:polished_diorite", + "localizedName": "Polished Diorite", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:polished_granite", + "localizedName": "Polished Granite", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:poppy", + "localizedName": "Poppy", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potatoes", + "localizedName": "Potatoes", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_acacia_sapling", + "localizedName": "Potted Acacia Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_allium", + "localizedName": "Potted Allium", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_azure_bluet", + "localizedName": "Potted Azure Bluet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_birch_sapling", + "localizedName": "Potted Birch Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_blue_orchid", + "localizedName": "Potted Blue Orchid", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_brown_mushroom", + "localizedName": "Potted Brown Mushroom", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_cactus", + "localizedName": "Potted Cactus", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_dandelion", + "localizedName": "Potted Dandelion", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_dark_oak_sapling", + "localizedName": "Potted Dark Oak Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_dead_bush", + "localizedName": "Potted Dead Bush", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_fern", + "localizedName": "Potted Fern", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_jungle_sapling", + "localizedName": "Potted Jungle Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_oak_sapling", + "localizedName": "Potted Oak Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_orange_tulip", + "localizedName": "Potted Orange Tulip", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_oxeye_daisy", + "localizedName": "Potted Oxeye Daisy", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_pink_tulip", + "localizedName": "Potted Pink Tulip", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_poppy", + "localizedName": "Potted Poppy", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_red_mushroom", + "localizedName": "Potted Red Mushroom", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_red_tulip", + "localizedName": "Potted Red Tulip", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_spruce_sapling", + "localizedName": "Potted Spruce Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:potted_white_tulip", + "localizedName": "Potted White Tulip", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:powered_rail", + "localizedName": "Powered Rail", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.7, + "resistance": 0.7, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:prismarine", + "localizedName": "Prismarine", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:prismarine_brick_slab", + "localizedName": "Prismarine Brick Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:prismarine_brick_stairs", + "localizedName": "Prismarine Brick Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:prismarine_bricks", + "localizedName": "Prismarine Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:prismarine_slab", + "localizedName": "Prismarine Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:prismarine_stairs", + "localizedName": "Prismarine Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pumpkin", + "localizedName": "Pumpkin", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:pumpkin_stem", + "localizedName": "Pumpkin Stem", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purple_banner", + "localizedName": "Purple Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:purple_bed", + "localizedName": "Purple Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purple_carpet", + "localizedName": "Purple Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purple_concrete", + "localizedName": "Purple Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purple_concrete_powder", + "localizedName": "Purple Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purple_glazed_terracotta", + "localizedName": "Purple Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purple_shulker_box", + "localizedName": "Purple Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:purple_stained_glass", + "localizedName": "Purple Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purple_stained_glass_pane", + "localizedName": "Purple Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purple_terracotta", + "localizedName": "Purple Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purple_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:purple_wool", + "localizedName": "Purple Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purpur_block", + "localizedName": "Purpur Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purpur_pillar", + "localizedName": "Purpur Pillar", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purpur_slab", + "localizedName": "Purpur Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:purpur_stairs", + "localizedName": "Purpur Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:quartz_block", + "localizedName": "Block of Quartz", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:quartz_pillar", + "localizedName": "Quartz Pillar", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:quartz_slab", + "localizedName": "Quartz Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:quartz_stairs", + "localizedName": "Quartz Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:rail", + "localizedName": "Rail", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.7, + "resistance": 0.7, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_banner", + "localizedName": "Red Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:red_bed", + "localizedName": "Red Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_carpet", + "localizedName": "Red Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_concrete", + "localizedName": "Red Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_concrete_powder", + "localizedName": "Red Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_glazed_terracotta", + "localizedName": "Red Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_mushroom", + "localizedName": "Red Mushroom", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_mushroom_block", + "localizedName": "Red Mushroom Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_nether_bricks", + "localizedName": "Red Nether Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_sand", + "localizedName": "Red Sand", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_sandstone", + "localizedName": "Red Sandstone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_sandstone_slab", + "localizedName": "Red Sandstone Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_sandstone_stairs", + "localizedName": "Red Sandstone Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_shulker_box", + "localizedName": "Red Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:red_stained_glass", + "localizedName": "Red Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_stained_glass_pane", + "localizedName": "Red Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_terracotta", + "localizedName": "Red Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_tulip", + "localizedName": "Red Tulip", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:red_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:red_wool", + "localizedName": "Red Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:redstone_block", + "localizedName": "Block of Redstone", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 5.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:redstone_lamp", + "localizedName": "Redstone Lamp", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:redstone_ore", + "localizedName": "Redstone Ore", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:redstone_torch", + "localizedName": "Redstone Torch", + "material": { + "powerSource": true, + "lightValue": 7, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:redstone_wall_torch", + "localizedName": "Air", + "material": { + "powerSource": true, + "lightValue": 7, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:redstone_wire", + "localizedName": "Redstone Dust", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:repeater", + "localizedName": "Redstone Repeater", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:repeating_command_block", + "localizedName": "Repeating Command Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": -1.0, + "resistance": 3600000.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:rose_bush", + "localizedName": "Rose Bush", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:sand", + "localizedName": "Sand", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:sandstone", + "localizedName": "Sandstone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:sandstone_slab", + "localizedName": "Sandstone Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:sandstone_stairs", + "localizedName": "Sandstone Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:sea_lantern", + "localizedName": "Sea Lantern", + "material": { + "powerSource": false, + "lightValue": 15, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:sea_pickle", + "localizedName": "Sea Pickle", + "material": { + "powerSource": false, + "lightValue": 6, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:seagrass", + "localizedName": "Seagrass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:shulker_box", + "localizedName": "Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:sign", + "localizedName": "Sign", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:skeleton_skull", + "localizedName": "Skeleton Skull", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:skeleton_wall_skull", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:slime_block", "localizedName": "Slime Block", - "states": {}, "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, "hardness": 0.0, "resistance": 0.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.8, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -7298,28 +12444,22 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#a4a8b8", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 166, - "id": "minecraft:barrier", - "unlocalizedName": "tile.barrier", - "localizedName": "Barrier", - "states": {}, + "id": "minecraft:smooth_quartz", + "localizedName": "Smooth Quartz", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": -1.0, - "resistance": 1.8000004E7, + "hardness": 2.0, + "resistance": 6.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -7328,89 +12468,573 @@ "replacedDuringPlacement": false, "toolRequired": true, "fragileWhenPushed": false, - "unpushable": true, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 167, - "id": "minecraft:iron_trapdoor", - "unlocalizedName": "tile.ironTrapdoor", - "localizedName": "Iron Trapdoor", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - } - }, + "id": "minecraft:smooth_red_sandstone", + "localizedName": "Smooth Red Sandstone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:smooth_sandstone", + "localizedName": "Smooth Sandstone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:smooth_stone", + "localizedName": "Smooth Stone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:snow", + "localizedName": "Snow", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": true, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#ffffff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:snow_block", + "localizedName": "Snow Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#ffffff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:soul_sand", + "localizedName": "Soul Sand", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spawner", + "localizedName": "Spawner", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, "hardness": 5.0, - "resistance": 25.0, + "resistance": 5.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:sponge", + "localizedName": "Sponge", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.6, + "resistance": 0.6, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#e5e533", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_button", + "localizedName": "Spruce Button", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, - "solid": true, - "movementBlocker": true, + "solid": false, + "movementBlocker": false, "burnable": false, - "opaque": true, + "opaque": false, "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, + "toolRequired": false, + "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 168, - "id": "minecraft:prismarine", - "unlocalizedName": "tile.prismarine", - "localizedName": "Prismarine", - "states": { - "variant": { - "values": [ - "prismarine", - "prismarine_bricks", - "dark_prismarine" - ] - } - }, + "id": "minecraft:spruce_door", + "localizedName": "Spruce Door", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.5, - "resistance": 30.0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_fence", + "localizedName": "Spruce Fence", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_fence_gate", + "localizedName": "Spruce Fence Gate", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_leaves", + "localizedName": "Spruce Leaves", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": true, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_log", + "localizedName": "Spruce Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_planks", + "localizedName": "Spruce Planks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_pressure_plate", + "localizedName": "Spruce Pressure Plate", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_sapling", + "localizedName": "Spruce Sapling", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_slab", + "localizedName": "Spruce Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_stairs", + "localizedName": "Spruce Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_trapdoor", + "localizedName": "Spruce Trapdoor", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 3.0, + "resistance": 3.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:spruce_wood", + "localizedName": "Spruce Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:sticky_piston", + "localizedName": "Sticky Piston", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": true, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stone", + "localizedName": "Stone", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -7420,212 +13044,872 @@ "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 169, - "id": "minecraft:sea_lantern", - "unlocalizedName": "tile.seaLantern", - "localizedName": "Sea Lantern", - "states": {}, + "id": "minecraft:stone_brick_slab", + "localizedName": "Stone Brick Slab", "material": { "powerSource": false, - "lightOpacity": 255, - "lightValue": 15, - "usingNeighborLight": false, - "hardness": 0.3, - "resistance": 1.5, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, "ticksRandomly": false, - "fullCube": true, + "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stone_brick_stairs", + "localizedName": "Stone Brick Stairs", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stone_bricks", + "localizedName": "Stone Bricks", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stone_button", + "localizedName": "Stone Button", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stone_pressure_plate", + "localizedName": "Stone Pressure Plate", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stone_slab", + "localizedName": "Stone Slab", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 6.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_acacia_log", + "localizedName": "Stripped Acacia Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_acacia_wood", + "localizedName": "Stripped Acacia Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_birch_log", + "localizedName": "Stripped Birch Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_birch_wood", + "localizedName": "Stripped Birch Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_dark_oak_log", + "localizedName": "Stripped Dark Oak Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_dark_oak_wood", + "localizedName": "Stripped Dark Oak Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_jungle_log", + "localizedName": "Stripped Jungle Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_jungle_wood", + "localizedName": "Stripped Jungle Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_oak_log", + "localizedName": "Stripped Oak Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_oak_wood", + "localizedName": "Stripped Oak Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_spruce_log", + "localizedName": "Stripped Spruce Log", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:stripped_spruce_wood", + "localizedName": "Stripped Spruce Wood", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:structure_block", + "localizedName": "Structure Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": -1.0, + "resistance": 3600000.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#a7a7a7", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:structure_void", + "localizedName": "Structure Void", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:sugar_cane", + "localizedName": "Sugar Cane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:sunflower", + "localizedName": "Sunflower", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:tall_grass", + "localizedName": "Tall Grass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:tall_seagrass", + "localizedName": "Tall Seagrass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": true, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:terracotta", + "localizedName": "Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:tnt", + "localizedName": "TNT", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, "opaque": false, "replacedDuringPlacement": false, "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#ff0000", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 170, - "id": "minecraft:hay_block", - "unlocalizedName": "tile.hayBlock", - "localizedName": "Hay Bale", - "states": { - "axis": { - "values": [ - "x", - "y", - "z" - ] - } - }, + "id": "minecraft:torch", + "localizedName": "Torch", "material": { "powerSource": false, - "lightOpacity": 255, + "lightValue": 14, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:trapped_chest", + "localizedName": "Trapped Chest", + "material": { + "powerSource": true, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.5, + "hardness": 2.5, "resistance": 2.5, "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:tripwire", + "localizedName": "Tripwire", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:tripwire_hook", + "localizedName": "Tripwire Hook", + "material": { + "powerSource": true, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:tube_coral", + "localizedName": "Tube Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:tube_coral_block", + "localizedName": "Tube Coral Block", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.5, + "resistance": 6.0, + "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, "burnable": false, "opaque": true, "replacedDuringPlacement": false, - "toolRequired": false, + "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 171, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet", - "localizedName": "Carpet", - "states": { - "color": { - "values": [ - "white", - "orange", - "magenta", - "light_blue", - "yellow", - "lime", - "pink", - "gray", - "silver", - "cyan", - "purple", - "blue", - "brown", - "green", - "red", - "black" - ] - } - }, + "id": "minecraft:tube_coral_fan", + "localizedName": "Tube Coral Fan", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.1, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:tube_coral_wall_fan", + "localizedName": "Tube Coral Wall Fan", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#4040ff", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:turtle_egg", + "localizedName": "Turtle Egg", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, "resistance": 0.5, "ticksRandomly": true, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": true, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 172, - "id": "minecraft:hardened_clay", - "unlocalizedName": "tile.clayHardened", - "localizedName": "Terracotta", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.25, - "resistance": 21.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 173, - "id": "minecraft:coal_block", - "unlocalizedName": "tile.blockCoal", - "localizedName": "Block of Coal", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 5.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 174, - "id": "minecraft:packed_ice", - "unlocalizedName": "tile.icePacked", - "localizedName": "Packed Ice", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.98, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -7633,55 +13917,24 @@ "opaque": true, "replacedDuringPlacement": false, "toolRequired": false, - "fragileWhenPushed": false, + "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 175, - "id": "minecraft:double_plant", - "unlocalizedName": "tile.doublePlant", - "localizedName": "Plant", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "upper", - "lower" - ] - }, - "variant": { - "values": [ - "sunflower", - "syringa", - "double_grass", - "double_fern", - "double_rose", - "paeonia" - ] - } - }, + "id": "minecraft:vine", + "localizedName": "Vines", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, + "hardness": 0.2, + "resistance": 0.2, "ticksRandomly": true, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": false, "movementBlocker": false, @@ -7691,141 +13944,47 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 176, - "id": "minecraft:standing_banner", - "unlocalizedName": "tile.banner", - "localizedName": "White Banner", - "states": { - "rotation": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, + "id": "minecraft:void_air", + "localizedName": "Void Air", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 1.0, - "resistance": 5.0, + "hardness": 0.0, + "resistance": 0.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": true, "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 177, - "id": "minecraft:wall_banner", - "unlocalizedName": "tile.banner", - "localizedName": "White Banner", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, + "id": "minecraft:wall_sign", + "localizedName": "Air", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, "hardness": 1.0, - "resistance": 5.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 178, - "id": "minecraft:daylight_detector_inverted", - "unlocalizedName": "tile.daylightDetector", - "localizedName": "Daylight Sensor", - "states": { - "power": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15" - ] - } - }, - "material": { - "powerSource": true, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.2, "resistance": 1.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": true, "movementBlocker": true, @@ -7835,1109 +13994,22 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true } }, { - "legacyId": 179, - "id": "minecraft:red_sandstone", - "unlocalizedName": "tile.redSandStone", - "localizedName": "Red Sandstone", - "states": { - "type": { - "values": [ - "red_sandstone", - "chiseled_red_sandstone", - "smooth_red_sandstone" - ] - } - }, + "id": "minecraft:wall_torch", + "localizedName": "Air", "material": { "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.8, - "resistance": 4.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 180, - "id": "minecraft:red_sandstone_stairs", - "unlocalizedName": "tile.stairsRedSandStone", - "localizedName": "Red Sandstone Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.8, - "resistance": 4.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 181, - "id": "minecraft:double_stone_slab2", - "unlocalizedName": "tile.stoneSlab2", - "localizedName": "Red Sandstone Slab", - "states": { - "seamless": { - "values": [ - "true", - "false" - ] - }, - "variant": { - "values": [ - "red_sandstone" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 182, - "id": "minecraft:stone_slab2", - "unlocalizedName": "tile.stoneSlab2", - "localizedName": "Red Sandstone Slab", - "states": { - "half": { - "values": [ - "top", - "bottom" - ] - }, - "variant": { - "values": [ - "red_sandstone" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 183, - "id": "minecraft:spruce_fence_gate", - "unlocalizedName": "tile.spruceFenceGate", - "localizedName": "Spruce Fence Gate", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "in_wall": { - "values": [ - "true", - "false" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 184, - "id": "minecraft:birch_fence_gate", - "unlocalizedName": "tile.birchFenceGate", - "localizedName": "Birch Fence Gate", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "in_wall": { - "values": [ - "true", - "false" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 185, - "id": "minecraft:jungle_fence_gate", - "unlocalizedName": "tile.jungleFenceGate", - "localizedName": "Jungle Fence Gate", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "in_wall": { - "values": [ - "true", - "false" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 186, - "id": "minecraft:dark_oak_fence_gate", - "unlocalizedName": "tile.darkOakFenceGate", - "localizedName": "Dark Oak Fence Gate", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "in_wall": { - "values": [ - "true", - "false" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 187, - "id": "minecraft:acacia_fence_gate", - "unlocalizedName": "tile.acaciaFenceGate", - "localizedName": "Acacia Fence Gate", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "in_wall": { - "values": [ - "true", - "false" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 188, - "id": "minecraft:spruce_fence", - "unlocalizedName": "tile.spruceFence", - "localizedName": "Spruce Fence", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 189, - "id": "minecraft:birch_fence", - "unlocalizedName": "tile.birchFence", - "localizedName": "Birch Fence", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 190, - "id": "minecraft:jungle_fence", - "unlocalizedName": "tile.jungleFence", - "localizedName": "Jungle Fence", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 191, - "id": "minecraft:dark_oak_fence", - "unlocalizedName": "tile.darkOakFence", - "localizedName": "Dark Oak Fence", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 192, - "id": "minecraft:acacia_fence", - "unlocalizedName": "tile.acaciaFence", - "localizedName": "Acacia Fence", - "states": { - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 193, - "id": "minecraft:spruce_door", - "unlocalizedName": "tile.doorSpruce", - "localizedName": "Spruce Door", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "upper", - "lower" - ] - }, - "hinge": { - "values": [ - "left", - "right" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 194, - "id": "minecraft:birch_door", - "unlocalizedName": "tile.doorBirch", - "localizedName": "Birch Door", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "upper", - "lower" - ] - }, - "hinge": { - "values": [ - "left", - "right" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 195, - "id": "minecraft:jungle_door", - "unlocalizedName": "tile.doorJungle", - "localizedName": "Jungle Door", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "upper", - "lower" - ] - }, - "hinge": { - "values": [ - "left", - "right" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 196, - "id": "minecraft:acacia_door", - "unlocalizedName": "tile.doorAcacia", - "localizedName": "Acacia Door", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "upper", - "lower" - ] - }, - "hinge": { - "values": [ - "left", - "right" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 197, - "id": "minecraft:dark_oak_door", - "unlocalizedName": "tile.doorDarkOak", - "localizedName": "Dark Oak Door", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "upper", - "lower" - ] - }, - "hinge": { - "values": [ - "left", - "right" - ] - }, - "open": { - "values": [ - "true", - "false" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 3.0, - "resistance": 15.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": true, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 198, - "id": "minecraft:end_rod", - "unlocalizedName": "tile.endRod", - "localizedName": "End Rod", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, "lightValue": 14, - "usingNeighborLight": true, "hardness": 0.0, "resistance": 0.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, "liquid": false, "solid": false, "movementBlocker": false, @@ -8947,2208 +14019,47 @@ "toolRequired": false, "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 199, - "id": "minecraft:chorus_plant", - "unlocalizedName": "tile.chorusPlant", - "localizedName": "Chorus Plant", - "states": { - "down": { - "values": [ - "true", - "false" - ] - }, - "east": { - "values": [ - "true", - "false" - ] - }, - "north": { - "values": [ - "true", - "false" - ] - }, - "south": { - "values": [ - "true", - "false" - ] - }, - "up": { - "values": [ - "true", - "false" - ] - }, - "west": { - "values": [ - "true", - "false" - ] - } - }, + "id": "minecraft:water", + "localizedName": "Water", "material": { "powerSource": false, - "lightOpacity": 0, "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.4, - "resistance": 2.0, + "hardness": 100.0, + "resistance": 100.0, "ticksRandomly": false, "fullCube": false, "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 200, - "id": "minecraft:chorus_flower", - "unlocalizedName": "tile.chorusFlower", - "localizedName": "Chorus Flower", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3", - "4", - "5" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.4, - "resistance": 2.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 201, - "id": "minecraft:purpur_block", - "unlocalizedName": "tile.purpurBlock", - "localizedName": "Purpur Block", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.5, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 202, - "id": "minecraft:purpur_pillar", - "unlocalizedName": "tile.purpurPillar", - "localizedName": "Purpur Pillar", - "states": { - "axis": { - "values": [ - "x", - "y", - "z" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.5, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 203, - "id": "minecraft:purpur_stairs", - "unlocalizedName": "tile.stairsPurpur", - "localizedName": "Purpur Stairs", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - }, - "half": { - "values": [ - "top", - "bottom" - ] - }, - "shape": { - "values": [ - "straight", - "inner_left", - "inner_right", - "outer_left", - "outer_right" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 1.5, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 204, - "id": "minecraft:purpur_double_slab", - "unlocalizedName": "tile.purpurSlab", - "localizedName": "Purpur Slab", - "states": { - "variant": { - "values": [ - "default" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 205, - "id": "minecraft:purpur_slab", - "unlocalizedName": "tile.purpurSlab", - "localizedName": "Purpur Slab", - "states": { - "half": { - "values": [ - "top", - "bottom" - ] - }, - "variant": { - "values": [ - "default" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 206, - "id": "minecraft:end_bricks", - "unlocalizedName": "tile.endBricks", - "localizedName": "End Stone Bricks", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.8, - "resistance": 4.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 207, - "id": "minecraft:beetroots", - "unlocalizedName": "tile.beetroots", - "localizedName": "Beetroots", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": true, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": true, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 208, - "id": "minecraft:grass_path", - "unlocalizedName": "tile.grassPath", - "localizedName": "Grass Path", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.65, - "resistance": 3.25, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 209, - "id": "minecraft:end_gateway", - "unlocalizedName": "tile.null", - "localizedName": "tile.null.name", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 15, - "usingNeighborLight": true, - "hardness": -1.0, - "resistance": 1.8E7, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": false, - "movementBlocker": false, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": true, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 210, - "id": "minecraft:repeating_command_block", - "unlocalizedName": "tile.repeatingCommandBlock", - "localizedName": "Repeating Command Block", - "states": { - "conditional": { - "values": [ - "true", - "false" - ] - }, - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": -1.0, - "resistance": 1.8E7, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 211, - "id": "minecraft:chain_command_block", - "unlocalizedName": "tile.chainCommandBlock", - "localizedName": "Chain Command Block", - "states": { - "conditional": { - "values": [ - "true", - "false" - ] - }, - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": -1.0, - "resistance": 1.8E7, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 212, - "id": "minecraft:frosted_ice", - "unlocalizedName": "tile.frostedIce", - "localizedName": "Frosted Ice", - "states": { - "age": { - "values": [ - "0", - "1", - "2", - "3" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 3, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": true, - "fullCube": true, - "slipperiness": 0.98, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": false, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": true, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 213, - "id": "minecraft:magma", - "unlocalizedName": "tile.magma", - "localizedName": "Magma Block", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 3, - "usingNeighborLight": false, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": true, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 214, - "id": "minecraft:nether_wart_block", - "unlocalizedName": "tile.netherWartBlock", - "localizedName": "Nether Wart Block", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.0, - "resistance": 5.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": false, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 215, - "id": "minecraft:red_nether_brick", - "unlocalizedName": "tile.redNetherBrick", - "localizedName": "Red Nether Brick", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 2.0, - "resistance": 30.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 216, - "id": "minecraft:bone_block", - "unlocalizedName": "tile.boneBlock", - "localizedName": "Bone Block", - "states": { - "axis": { - "values": [ - "x", - "y", - "z" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 217, - "id": "minecraft:structure_void", - "unlocalizedName": "tile.structureVoid", - "localizedName": "Structure Void", - "states": {}, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 0.0, - "resistance": 0.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, + "liquid": true, "solid": false, "movementBlocker": false, "burnable": false, "opaque": false, "replacedDuringPlacement": true, "toolRequired": false, - "fragileWhenPushed": false, + "fragileWhenPushed": true, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false + "mapColor": "#4040ff", + "isTranslucent": true, + "hasContainer": false } }, { - "legacyId": 218, - "id": "minecraft:observer", - "unlocalizedName": "tile.observer", - "localizedName": "Observer", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - }, - "powered": { - "values": [ - "true", - "false" - ] - } - }, + "id": "minecraft:wet_sponge", + "localizedName": "Wet Sponge", "material": { - "powerSource": true, - "lightOpacity": 255, + "powerSource": false, "lightValue": 0, - "usingNeighborLight": false, - "hardness": 3.0, - "resistance": 15.0, + "hardness": 0.6, + "resistance": 0.6, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 219, - "id": "minecraft:white_shulker_box", - "unlocalizedName": "tile.shulkerBoxWhite", - "localizedName": "White Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 220, - "id": "minecraft:orange_shulker_box", - "unlocalizedName": "tile.shulkerBoxOrange", - "localizedName": "Orange Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 221, - "id": "minecraft:magenta_shulker_box", - "unlocalizedName": "tile.shulkerBoxMagenta", - "localizedName": "Magenta Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 222, - "id": "minecraft:light_blue_shulker_box", - "unlocalizedName": "tile.shulkerBoxLightBlue", - "localizedName": "Light Blue Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 223, - "id": "minecraft:yellow_shulker_box", - "unlocalizedName": "tile.shulkerBoxYellow", - "localizedName": "Yellow Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 224, - "id": "minecraft:lime_shulker_box", - "unlocalizedName": "tile.shulkerBoxLime", - "localizedName": "Lime Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 225, - "id": "minecraft:pink_shulker_box", - "unlocalizedName": "tile.shulkerBoxPink", - "localizedName": "Pink Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 226, - "id": "minecraft:gray_shulker_box", - "unlocalizedName": "tile.shulkerBoxGray", - "localizedName": "Gray Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 227, - "id": "minecraft:silver_shulker_box", - "unlocalizedName": "tile.shulkerBoxSilver", - "localizedName": "Light Gray Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 228, - "id": "minecraft:cyan_shulker_box", - "unlocalizedName": "tile.shulkerBoxCyan", - "localizedName": "Cyan Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 229, - "id": "minecraft:purple_shulker_box", - "unlocalizedName": "tile.shulkerBoxPurple", - "localizedName": "Purple Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 230, - "id": "minecraft:blue_shulker_box", - "unlocalizedName": "tile.shulkerBoxBlue", - "localizedName": "Blue Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 231, - "id": "minecraft:brown_shulker_box", - "unlocalizedName": "tile.shulkerBoxBrown", - "localizedName": "Brown Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 232, - "id": "minecraft:green_shulker_box", - "unlocalizedName": "tile.shulkerBoxGreen", - "localizedName": "Green Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 233, - "id": "minecraft:red_shulker_box", - "unlocalizedName": "tile.shulkerBoxRed", - "localizedName": "Red Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 234, - "id": "minecraft:black_shulker_box", - "unlocalizedName": "tile.shulkerBoxBlack", - "localizedName": "Black Shulker Box", - "states": { - "facing": { - "values": [ - "down", - "up", - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 0, - "lightValue": 0, - "usingNeighborLight": true, - "hardness": 2.0, - "resistance": 10.0, - "ticksRandomly": false, - "fullCube": false, - "slipperiness": 0.6, - "renderedAsNormalBlock": false, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 1.0, - "grassBlocking": false - } - }, - { - "legacyId": 235, - "id": "minecraft:white_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaWhite", - "localizedName": "White Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 236, - "id": "minecraft:orange_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaOrange", - "localizedName": "Orange Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 237, - "id": "minecraft:magenta_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaMagenta", - "localizedName": "Magenta Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 238, - "id": "minecraft:light_blue_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaLightBlue", - "localizedName": "Light Blue Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 239, - "id": "minecraft:yellow_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaYellow", - "localizedName": "Yellow Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 240, - "id": "minecraft:lime_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaLime", - "localizedName": "Lime Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 241, - "id": "minecraft:pink_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaPink", - "localizedName": "Pink Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 242, - "id": "minecraft:gray_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaGray", - "localizedName": "Gray Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 243, - "id": "minecraft:silver_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaSilver", - "localizedName": "Light Gray Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 244, - "id": "minecraft:cyan_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaCyan", - "localizedName": "Cyan Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 245, - "id": "minecraft:purple_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaPurple", - "localizedName": "Purple Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 246, - "id": "minecraft:blue_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaBlue", - "localizedName": "Blue Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 247, - "id": "minecraft:brown_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaBrown", - "localizedName": "Brown Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 248, - "id": "minecraft:green_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaGreen", - "localizedName": "Green Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 249, - "id": "minecraft:red_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaRed", - "localizedName": "Red Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 250, - "id": "minecraft:black_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaBlack", - "localizedName": "Black Glazed Terracotta", - "states": { - "facing": { - "values": [ - "north", - "south", - "west", - "east" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.4, - "resistance": 7.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 251, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete", - "localizedName": "tile.concrete.name", - "states": { - "color": { - "values": [ - "white", - "orange", - "magenta", - "light_blue", - "yellow", - "lime", - "pink", - "gray", - "silver", - "cyan", - "purple", - "blue", - "brown", - "green", - "red", - "black" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 1.8, - "resistance": 9.0, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, - "liquid": false, - "solid": true, - "movementBlocker": true, - "burnable": false, - "opaque": true, - "replacedDuringPlacement": false, - "toolRequired": true, - "fragileWhenPushed": false, - "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false - } - }, - { - "legacyId": 252, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder", - "localizedName": "tile.concretePowder.name", - "states": { - "color": { - "values": [ - "white", - "orange", - "magenta", - "light_blue", - "yellow", - "lime", - "pink", - "gray", - "silver", - "cyan", - "purple", - "blue", - "brown", - "green", - "red", - "black" - ] - } - }, - "material": { - "powerSource": false, - "lightOpacity": 255, - "lightValue": 0, - "usingNeighborLight": false, - "hardness": 0.5, - "resistance": 2.5, - "ticksRandomly": false, - "fullCube": true, - "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -11158,37 +14069,122 @@ "toolRequired": false, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#e5e533", + "isTranslucent": false, + "hasContainer": false } }, { - "legacyId": 255, - "id": "minecraft:structure_block", - "unlocalizedName": "tile.structureBlock", - "localizedName": "Structure Block", - "states": { - "mode": { - "values": [ - "save", - "load", - "corner", - "data" - ] - } - }, + "id": "minecraft:wheat", + "localizedName": "Wheat Crops", "material": { "powerSource": false, - "lightOpacity": 255, "lightValue": 0, - "usingNeighborLight": false, - "hardness": -1.0, - "resistance": 1.8E7, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": true, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_banner", + "localizedName": "White Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:white_bed", + "localizedName": "White Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_carpet", + "localizedName": "White Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_concrete", + "localizedName": "White Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, "ticksRandomly": false, "fullCube": true, "slipperiness": 0.6, - "renderedAsNormalBlock": true, "liquid": false, "solid": true, "movementBlocker": true, @@ -11198,9 +14194,634 @@ "toolRequired": true, "fragileWhenPushed": false, "unpushable": false, - "adventureModeExempt": false, - "ambientOcclusionLightValue": 0.2, - "grassBlocking": false + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_concrete_powder", + "localizedName": "White Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_glazed_terracotta", + "localizedName": "White Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_shulker_box", + "localizedName": "White Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:white_stained_glass", + "localizedName": "White Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_stained_glass_pane", + "localizedName": "White Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_terracotta", + "localizedName": "White Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_tulip", + "localizedName": "White Tulip", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#007c00", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:white_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:white_wool", + "localizedName": "White Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:wither_skeleton_skull", + "localizedName": "Wither Skeleton Skull", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:wither_skeleton_wall_skull", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:yellow_banner", + "localizedName": "Yellow Banner", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:yellow_bed", + "localizedName": "Yellow Bed", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.2, + "resistance": 0.2, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:yellow_carpet", + "localizedName": "Yellow Carpet", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.1, + "resistance": 0.1, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": true, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:yellow_concrete", + "localizedName": "Yellow Concrete", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.8, + "resistance": 1.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:yellow_concrete_powder", + "localizedName": "Yellow Concrete Powder", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.5, + "resistance": 0.5, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#f7e9a3", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:yellow_glazed_terracotta", + "localizedName": "Yellow Glazed Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.4, + "resistance": 1.4, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:yellow_shulker_box", + "localizedName": "Yellow Shulker Box", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 2.0, + "resistance": 2.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": true, + "hasContainer": true + } + }, + { + "id": "minecraft:yellow_stained_glass", + "localizedName": "Yellow Stained Glass", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:yellow_stained_glass_pane", + "localizedName": "Yellow Stained Glass Pane", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.3, + "resistance": 0.3, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:yellow_terracotta", + "localizedName": "Yellow Terracotta", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.25, + "resistance": 4.2, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:yellow_wall_banner", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#8f7748", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:yellow_wool", + "localizedName": "Yellow Wool", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.8, + "resistance": 0.8, + "ticksRandomly": false, + "fullCube": true, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": true, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#c7c7c7", + "isTranslucent": false, + "hasContainer": false + } + }, + { + "id": "minecraft:zombie_head", + "localizedName": "Zombie Head", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true + } + }, + { + "id": "minecraft:zombie_wall_head", + "localizedName": "Air", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 1.0, + "resistance": 1.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": false, + "movementBlocker": false, + "burnable": false, + "opaque": false, + "replacedDuringPlacement": false, + "toolRequired": false, + "fragileWhenPushed": true, + "unpushable": false, + "mapColor": "#000000", + "isTranslucent": false, + "hasContainer": true } } ] \ No newline at end of file diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json index f1b94a1cc..c9eeb23b8 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json @@ -1,5798 +1,3142 @@ [ { - "legacyId": 0, - "legacyData": 0, - "id": "minecraft:air", - "unlocalizedName": "tile.air", - "localizedName": "Air", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 1, - "legacyData": 0, - "id": "minecraft:stone", - "unlocalizedName": "tile.stone.stone", - "localizedName": "Stone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 1, - "legacyData": 1, - "id": "minecraft:stone", - "unlocalizedName": "tile.stone.granite", - "localizedName": "Granite", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 1, - "legacyData": 2, - "id": "minecraft:stone", - "unlocalizedName": "tile.stone.graniteSmooth", - "localizedName": "Polished Granite", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 1, - "legacyData": 3, - "id": "minecraft:stone", - "unlocalizedName": "tile.stone.diorite", - "localizedName": "Diorite", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 1, - "legacyData": 4, - "id": "minecraft:stone", - "unlocalizedName": "tile.stone.dioriteSmooth", - "localizedName": "Polished Diorite", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 1, - "legacyData": 5, - "id": "minecraft:stone", - "unlocalizedName": "tile.stone.andesite", - "localizedName": "Andesite", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 1, - "legacyData": 6, - "id": "minecraft:stone", - "unlocalizedName": "tile.stone.andesiteSmooth", - "localizedName": "Polished Andesite", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 2, - "legacyData": 0, - "id": "minecraft:grass", - "unlocalizedName": "tile.grass", - "localizedName": "Grass Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 3, - "legacyData": 0, - "id": "minecraft:dirt", - "unlocalizedName": "tile.dirt.default", - "localizedName": "Dirt", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 3, - "legacyData": 1, - "id": "minecraft:dirt", - "unlocalizedName": "tile.dirt.coarse", - "localizedName": "Coarse Dirt", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 3, - "legacyData": 2, - "id": "minecraft:dirt", - "unlocalizedName": "tile.dirt.podzol", - "localizedName": "Podzol", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 4, - "legacyData": 0, - "id": "minecraft:cobblestone", - "unlocalizedName": "tile.stonebrick", - "localizedName": "Cobblestone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 5, - "legacyData": 0, - "id": "minecraft:planks", - "unlocalizedName": "tile.wood.oak", - "localizedName": "Oak Wood Planks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 5, - "legacyData": 1, - "id": "minecraft:planks", - "unlocalizedName": "tile.wood.spruce", - "localizedName": "Spruce Wood Planks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 5, - "legacyData": 2, - "id": "minecraft:planks", - "unlocalizedName": "tile.wood.birch", - "localizedName": "Birch Wood Planks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 5, - "legacyData": 3, - "id": "minecraft:planks", - "unlocalizedName": "tile.wood.jungle", - "localizedName": "Jungle Wood Planks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 5, - "legacyData": 4, - "id": "minecraft:planks", - "unlocalizedName": "tile.wood.acacia", - "localizedName": "Acacia Wood Planks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 5, - "legacyData": 5, - "id": "minecraft:planks", - "unlocalizedName": "tile.wood.big_oak", - "localizedName": "Dark Oak Wood Planks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 6, - "legacyData": 0, - "id": "minecraft:sapling", - "unlocalizedName": "tile.sapling.oak", - "localizedName": "Oak Sapling", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 6, - "legacyData": 1, - "id": "minecraft:sapling", - "unlocalizedName": "tile.sapling.spruce", - "localizedName": "Spruce Sapling", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 6, - "legacyData": 2, - "id": "minecraft:sapling", - "unlocalizedName": "tile.sapling.birch", - "localizedName": "Birch Sapling", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 6, - "legacyData": 3, - "id": "minecraft:sapling", - "unlocalizedName": "tile.sapling.jungle", - "localizedName": "Jungle Sapling", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 6, - "legacyData": 4, - "id": "minecraft:sapling", - "unlocalizedName": "tile.sapling.acacia", - "localizedName": "Acacia Sapling", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 6, - "legacyData": 5, - "id": "minecraft:sapling", - "unlocalizedName": "tile.sapling.big_oak", - "localizedName": "Dark Oak Sapling", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 7, - "legacyData": 0, - "id": "minecraft:bedrock", - "unlocalizedName": "tile.bedrock", - "localizedName": "Bedrock", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 12, - "legacyData": 0, - "id": "minecraft:sand", - "unlocalizedName": "tile.sand.default", - "localizedName": "Sand", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 12, - "legacyData": 1, - "id": "minecraft:sand", - "unlocalizedName": "tile.sand.red", - "localizedName": "Red Sand", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 13, - "legacyData": 0, - "id": "minecraft:gravel", - "unlocalizedName": "tile.gravel", - "localizedName": "Gravel", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 14, - "legacyData": 0, - "id": "minecraft:gold_ore", - "unlocalizedName": "tile.oreGold", - "localizedName": "Gold Ore", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 15, - "legacyData": 0, - "id": "minecraft:iron_ore", - "unlocalizedName": "tile.oreIron", - "localizedName": "Iron Ore", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 16, - "legacyData": 0, - "id": "minecraft:coal_ore", - "unlocalizedName": "tile.oreCoal", - "localizedName": "Coal Ore", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 17, - "legacyData": 0, - "id": "minecraft:log", - "unlocalizedName": "tile.log.oak", - "localizedName": "Oak Wood", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 17, - "legacyData": 1, - "id": "minecraft:log", - "unlocalizedName": "tile.log.spruce", - "localizedName": "Spruce Wood", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 17, - "legacyData": 2, - "id": "minecraft:log", - "unlocalizedName": "tile.log.birch", - "localizedName": "Birch Wood", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 17, - "legacyData": 3, - "id": "minecraft:log", - "unlocalizedName": "tile.log.jungle", - "localizedName": "Jungle Wood", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 18, - "legacyData": 0, - "id": "minecraft:leaves", - "unlocalizedName": "tile.leaves.oak", - "localizedName": "Oak Leaves", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 18, - "legacyData": 1, - "id": "minecraft:leaves", - "unlocalizedName": "tile.leaves.spruce", - "localizedName": "Spruce Leaves", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 18, - "legacyData": 2, - "id": "minecraft:leaves", - "unlocalizedName": "tile.leaves.birch", - "localizedName": "Birch Leaves", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 18, - "legacyData": 3, - "id": "minecraft:leaves", - "unlocalizedName": "tile.leaves.jungle", - "localizedName": "Jungle Leaves", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 19, - "legacyData": 0, - "id": "minecraft:sponge", - "unlocalizedName": "tile.sponge.dry", - "localizedName": "Sponge", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 19, - "legacyData": 1, - "id": "minecraft:sponge", - "unlocalizedName": "tile.sponge.wet", - "localizedName": "Wet Sponge", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 20, - "legacyData": 0, - "id": "minecraft:glass", - "unlocalizedName": "tile.glass", - "localizedName": "Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 21, - "legacyData": 0, - "id": "minecraft:lapis_ore", - "unlocalizedName": "tile.oreLapis", - "localizedName": "Lapis Lazuli Ore", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 22, - "legacyData": 0, - "id": "minecraft:lapis_block", - "unlocalizedName": "tile.blockLapis", - "localizedName": "Lapis Lazuli Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 23, - "legacyData": 0, - "id": "minecraft:dispenser", - "unlocalizedName": "tile.dispenser", - "localizedName": "Dispenser", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 24, - "legacyData": 0, - "id": "minecraft:sandstone", - "unlocalizedName": "tile.sandStone.default", - "localizedName": "Sandstone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 24, - "legacyData": 1, - "id": "minecraft:sandstone", - "unlocalizedName": "tile.sandStone.chiseled", - "localizedName": "Chiseled Sandstone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 24, - "legacyData": 2, - "id": "minecraft:sandstone", - "unlocalizedName": "tile.sandStone.smooth", - "localizedName": "Smooth Sandstone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 25, - "legacyData": 0, - "id": "minecraft:noteblock", - "unlocalizedName": "tile.musicBlock", - "localizedName": "Note Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 27, - "legacyData": 0, - "id": "minecraft:golden_rail", - "unlocalizedName": "tile.goldenRail", - "localizedName": "Powered Rail", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 28, - "legacyData": 0, - "id": "minecraft:detector_rail", - "unlocalizedName": "tile.detectorRail", - "localizedName": "Detector Rail", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 29, - "legacyData": 0, - "id": "minecraft:sticky_piston", - "unlocalizedName": "tile.pistonStickyBase", - "localizedName": "Sticky Piston", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 30, - "legacyData": 0, - "id": "minecraft:web", - "unlocalizedName": "tile.web", - "localizedName": "Cobweb", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 31, - "legacyData": 1, - "id": "minecraft:tallgrass", - "unlocalizedName": "tile.tallgrass.grass", - "localizedName": "Grass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 31, - "legacyData": 2, - "id": "minecraft:tallgrass", - "unlocalizedName": "tile.tallgrass.fern", - "localizedName": "Fern", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 32, - "legacyData": 0, - "id": "minecraft:deadbush", - "unlocalizedName": "tile.deadbush", - "localizedName": "Dead Bush", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 33, - "legacyData": 0, - "id": "minecraft:piston", - "unlocalizedName": "tile.pistonBase", - "localizedName": "Piston", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 0, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.white", - "localizedName": "White Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 1, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.orange", - "localizedName": "Orange Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 2, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.magenta", - "localizedName": "Magenta Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 3, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.lightBlue", - "localizedName": "Light Blue Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 4, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.yellow", - "localizedName": "Yellow Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 5, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.lime", - "localizedName": "Lime Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 6, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.pink", - "localizedName": "Pink Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 7, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.gray", - "localizedName": "Gray Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 8, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.silver", - "localizedName": "Light Gray Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 9, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.cyan", - "localizedName": "Cyan Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 10, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.purple", - "localizedName": "Purple Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 11, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.blue", - "localizedName": "Blue Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 12, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.brown", - "localizedName": "Brown Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 13, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.green", - "localizedName": "Green Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 14, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.red", - "localizedName": "Red Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 35, - "legacyData": 15, - "id": "minecraft:wool", - "unlocalizedName": "tile.cloth.black", - "localizedName": "Black Wool", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 37, - "legacyData": 0, - "id": "minecraft:yellow_flower", - "unlocalizedName": "tile.flower1.dandelion", - "localizedName": "Dandelion", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 38, - "legacyData": 0, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2.poppy", - "localizedName": "Poppy", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 38, - "legacyData": 1, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2.blueOrchid", - "localizedName": "Blue Orchid", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 38, - "legacyData": 2, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2.allium", - "localizedName": "Allium", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 38, - "legacyData": 3, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2.houstonia", - "localizedName": "Azure Bluet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 38, - "legacyData": 4, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2.tulipRed", - "localizedName": "Red Tulip", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 38, - "legacyData": 5, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2.tulipOrange", - "localizedName": "Orange Tulip", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 38, - "legacyData": 6, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2.tulipWhite", - "localizedName": "White Tulip", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 38, - "legacyData": 7, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2.tulipPink", - "localizedName": "Pink Tulip", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 38, - "legacyData": 8, - "id": "minecraft:red_flower", - "unlocalizedName": "tile.flower2.oxeyeDaisy", - "localizedName": "Oxeye Daisy", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 39, - "legacyData": 0, - "id": "minecraft:brown_mushroom", - "unlocalizedName": "tile.mushroom", - "localizedName": "Mushroom", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 40, - "legacyData": 0, - "id": "minecraft:red_mushroom", - "unlocalizedName": "tile.mushroom", - "localizedName": "Mushroom", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 41, - "legacyData": 0, - "id": "minecraft:gold_block", - "unlocalizedName": "tile.blockGold", - "localizedName": "Block of Gold", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 42, - "legacyData": 0, - "id": "minecraft:iron_block", - "unlocalizedName": "tile.blockIron", - "localizedName": "Block of Iron", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 44, - "legacyData": 0, - "id": "minecraft:stone_slab", - "unlocalizedName": "tile.stoneSlab.stone", - "localizedName": "Stone Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 44, - "legacyData": 1, - "id": "minecraft:stone_slab", - "unlocalizedName": "tile.stoneSlab.sand", - "localizedName": "Sandstone Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 44, - "legacyData": 3, - "id": "minecraft:stone_slab", - "unlocalizedName": "tile.stoneSlab.cobble", - "localizedName": "Cobblestone Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 44, - "legacyData": 4, - "id": "minecraft:stone_slab", - "unlocalizedName": "tile.stoneSlab.brick", - "localizedName": "Bricks Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 44, - "legacyData": 5, - "id": "minecraft:stone_slab", - "unlocalizedName": "tile.stoneSlab.smoothStoneBrick", - "localizedName": "Stone Bricks Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 44, - "legacyData": 6, - "id": "minecraft:stone_slab", - "unlocalizedName": "tile.stoneSlab.netherBrick", - "localizedName": "Nether Brick Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 44, - "legacyData": 7, - "id": "minecraft:stone_slab", - "unlocalizedName": "tile.stoneSlab.quartz", - "localizedName": "Quartz Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 45, - "legacyData": 0, - "id": "minecraft:brick_block", - "unlocalizedName": "tile.brick", - "localizedName": "Bricks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 46, - "legacyData": 0, - "id": "minecraft:tnt", - "unlocalizedName": "tile.tnt", - "localizedName": "TNT", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 47, - "legacyData": 0, - "id": "minecraft:bookshelf", - "unlocalizedName": "tile.bookshelf", - "localizedName": "Bookshelf", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 48, - "legacyData": 0, - "id": "minecraft:mossy_cobblestone", - "unlocalizedName": "tile.stoneMoss", - "localizedName": "Moss Stone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 49, - "legacyData": 0, - "id": "minecraft:obsidian", - "unlocalizedName": "tile.obsidian", - "localizedName": "Obsidian", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 50, - "legacyData": 0, - "id": "minecraft:torch", - "unlocalizedName": "tile.torch", - "localizedName": "Torch", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 52, - "legacyData": 0, - "id": "minecraft:mob_spawner", - "unlocalizedName": "tile.mobSpawner", - "localizedName": "Monster Spawner", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 53, - "legacyData": 0, - "id": "minecraft:oak_stairs", - "unlocalizedName": "tile.stairsWood", - "localizedName": "Oak Wood Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 54, - "legacyData": 0, - "id": "minecraft:chest", - "unlocalizedName": "tile.chest", - "localizedName": "Chest", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 56, - "legacyData": 0, - "id": "minecraft:diamond_ore", - "unlocalizedName": "tile.oreDiamond", - "localizedName": "Diamond Ore", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 57, - "legacyData": 0, - "id": "minecraft:diamond_block", - "unlocalizedName": "tile.blockDiamond", - "localizedName": "Block of Diamond", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 58, - "legacyData": 0, - "id": "minecraft:crafting_table", - "unlocalizedName": "tile.workbench", - "localizedName": "Crafting Table", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 60, - "legacyData": 0, - "id": "minecraft:farmland", - "unlocalizedName": "tile.farmland", - "localizedName": "Farmland", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 61, - "legacyData": 0, - "id": "minecraft:furnace", - "unlocalizedName": "tile.furnace", - "localizedName": "Furnace", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 65, - "legacyData": 0, - "id": "minecraft:ladder", - "unlocalizedName": "tile.ladder", - "localizedName": "Ladder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 66, - "legacyData": 0, - "id": "minecraft:rail", - "unlocalizedName": "tile.rail", - "localizedName": "Rail", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 67, - "legacyData": 0, - "id": "minecraft:stone_stairs", - "unlocalizedName": "tile.stairsStone", - "localizedName": "Cobblestone Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 69, - "legacyData": 0, - "id": "minecraft:lever", - "unlocalizedName": "tile.lever", - "localizedName": "Lever", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 70, - "legacyData": 0, - "id": "minecraft:stone_pressure_plate", - "unlocalizedName": "tile.pressurePlateStone", - "localizedName": "Stone Pressure Plate", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 72, - "legacyData": 0, - "id": "minecraft:wooden_pressure_plate", - "unlocalizedName": "tile.pressurePlateWood", - "localizedName": "Wooden Pressure Plate", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 73, - "legacyData": 0, - "id": "minecraft:redstone_ore", - "unlocalizedName": "tile.oreRedstone", - "localizedName": "Redstone Ore", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 76, - "legacyData": 0, - "id": "minecraft:redstone_torch", - "unlocalizedName": "tile.notGate", - "localizedName": "Redstone Torch", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 77, - "legacyData": 0, - "id": "minecraft:stone_button", - "unlocalizedName": "tile.button", - "localizedName": "Button", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 78, - "legacyData": 0, - "id": "minecraft:snow_layer", - "unlocalizedName": "tile.snow", - "localizedName": "Snow", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 79, - "legacyData": 0, - "id": "minecraft:ice", - "unlocalizedName": "tile.ice", - "localizedName": "Ice", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 80, - "legacyData": 0, - "id": "minecraft:snow", - "unlocalizedName": "tile.snow", - "localizedName": "Snow", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 81, - "legacyData": 0, - "id": "minecraft:cactus", - "unlocalizedName": "tile.cactus", - "localizedName": "Cactus", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 82, - "legacyData": 0, - "id": "minecraft:clay", - "unlocalizedName": "tile.clay", - "localizedName": "Clay", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 84, - "legacyData": 0, - "id": "minecraft:jukebox", - "unlocalizedName": "tile.jukebox", - "localizedName": "Jukebox", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 85, - "legacyData": 0, - "id": "minecraft:fence", - "unlocalizedName": "tile.fence", - "localizedName": "Oak Fence", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 86, - "legacyData": 0, - "id": "minecraft:pumpkin", - "unlocalizedName": "tile.pumpkin", - "localizedName": "Pumpkin", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 87, - "legacyData": 0, - "id": "minecraft:netherrack", - "unlocalizedName": "tile.hellrock", - "localizedName": "Netherrack", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 88, - "legacyData": 0, - "id": "minecraft:soul_sand", - "unlocalizedName": "tile.hellsand", - "localizedName": "Soul Sand", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 89, - "legacyData": 0, - "id": "minecraft:glowstone", - "unlocalizedName": "tile.lightgem", - "localizedName": "Glowstone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 91, - "legacyData": 0, - "id": "minecraft:lit_pumpkin", - "unlocalizedName": "tile.litpumpkin", - "localizedName": "Jack o\u0027Lantern", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 0, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.white", - "localizedName": "White Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 1, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.orange", - "localizedName": "Orange Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 2, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.magenta", - "localizedName": "Magenta Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 3, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.lightBlue", - "localizedName": "Light Blue Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 4, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.yellow", - "localizedName": "Yellow Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 5, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.lime", - "localizedName": "Lime Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 6, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.pink", - "localizedName": "Pink Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 7, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.gray", - "localizedName": "Gray Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 8, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.silver", - "localizedName": "Light Gray Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 9, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.cyan", - "localizedName": "Cyan Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 10, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.purple", - "localizedName": "Purple Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 11, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.blue", - "localizedName": "Blue Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 12, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.brown", - "localizedName": "Brown Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 13, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.green", - "localizedName": "Green Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 14, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.red", - "localizedName": "Red Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 95, - "legacyData": 15, - "id": "minecraft:stained_glass", - "unlocalizedName": "tile.stainedGlass.black", - "localizedName": "Black Stained Glass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 96, - "legacyData": 0, - "id": "minecraft:trapdoor", - "unlocalizedName": "tile.trapdoor", - "localizedName": "Wooden Trapdoor", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 97, - "legacyData": 0, - "id": "minecraft:monster_egg", - "unlocalizedName": "tile.monsterStoneEgg.stone", - "localizedName": "Stone Monster Egg", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 97, - "legacyData": 1, - "id": "minecraft:monster_egg", - "unlocalizedName": "tile.monsterStoneEgg.cobble", - "localizedName": "Cobblestone Monster Egg", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 97, - "legacyData": 2, - "id": "minecraft:monster_egg", - "unlocalizedName": "tile.monsterStoneEgg.brick", - "localizedName": "Stone Brick Monster Egg", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 97, - "legacyData": 3, - "id": "minecraft:monster_egg", - "unlocalizedName": "tile.monsterStoneEgg.mossybrick", - "localizedName": "Mossy Stone Brick Monster Egg", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 97, - "legacyData": 4, - "id": "minecraft:monster_egg", - "unlocalizedName": "tile.monsterStoneEgg.crackedbrick", - "localizedName": "Cracked Stone Brick Monster Egg", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 97, - "legacyData": 5, - "id": "minecraft:monster_egg", - "unlocalizedName": "tile.monsterStoneEgg.chiseledbrick", - "localizedName": "Chiseled Stone Brick Monster Egg", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 98, - "legacyData": 0, - "id": "minecraft:stonebrick", - "unlocalizedName": "tile.stonebricksmooth.default", - "localizedName": "Stone Bricks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 98, - "legacyData": 1, - "id": "minecraft:stonebrick", - "unlocalizedName": "tile.stonebricksmooth.mossy", - "localizedName": "Mossy Stone Bricks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 98, - "legacyData": 2, - "id": "minecraft:stonebrick", - "unlocalizedName": "tile.stonebricksmooth.cracked", - "localizedName": "Cracked Stone Bricks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 98, - "legacyData": 3, - "id": "minecraft:stonebrick", - "unlocalizedName": "tile.stonebricksmooth.chiseled", - "localizedName": "Chiseled Stone Bricks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 99, - "legacyData": 0, - "id": "minecraft:brown_mushroom_block", - "unlocalizedName": "tile.mushroom", - "localizedName": "Mushroom", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 100, - "legacyData": 0, - "id": "minecraft:red_mushroom_block", - "unlocalizedName": "tile.mushroom", - "localizedName": "Mushroom", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 101, - "legacyData": 0, - "id": "minecraft:iron_bars", - "unlocalizedName": "tile.fenceIron", - "localizedName": "Iron Bars", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 102, - "legacyData": 0, - "id": "minecraft:glass_pane", - "unlocalizedName": "tile.thinGlass", - "localizedName": "Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 103, - "legacyData": 0, - "id": "minecraft:melon_block", - "unlocalizedName": "tile.melon", - "localizedName": "Melon", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 106, - "legacyData": 0, - "id": "minecraft:vine", - "unlocalizedName": "tile.vine", - "localizedName": "Vines", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 107, - "legacyData": 0, - "id": "minecraft:fence_gate", - "unlocalizedName": "tile.fenceGate", - "localizedName": "Oak Fence Gate", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 108, - "legacyData": 0, - "id": "minecraft:brick_stairs", - "unlocalizedName": "tile.stairsBrick", - "localizedName": "Brick Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 109, - "legacyData": 0, - "id": "minecraft:stone_brick_stairs", - "unlocalizedName": "tile.stairsStoneBrickSmooth", - "localizedName": "Stone Brick Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 110, - "legacyData": 0, - "id": "minecraft:mycelium", - "unlocalizedName": "tile.mycel", - "localizedName": "Mycelium", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 111, - "legacyData": 0, - "id": "minecraft:waterlily", - "unlocalizedName": "tile.waterlily", - "localizedName": "Lily Pad", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 112, - "legacyData": 0, - "id": "minecraft:nether_brick", - "unlocalizedName": "tile.netherBrick", - "localizedName": "Nether Brick", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 113, - "legacyData": 0, - "id": "minecraft:nether_brick_fence", - "unlocalizedName": "tile.netherFence", - "localizedName": "Nether Brick Fence", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 114, - "legacyData": 0, - "id": "minecraft:nether_brick_stairs", - "unlocalizedName": "tile.stairsNetherBrick", - "localizedName": "Nether Brick Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 116, - "legacyData": 0, - "id": "minecraft:enchanting_table", - "unlocalizedName": "tile.enchantmentTable", - "localizedName": "Enchantment Table", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 120, - "legacyData": 0, - "id": "minecraft:end_portal_frame", - "unlocalizedName": "tile.endPortalFrame", - "localizedName": "End Portal", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 121, - "legacyData": 0, - "id": "minecraft:end_stone", - "unlocalizedName": "tile.whiteStone", - "localizedName": "End Stone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 122, - "legacyData": 0, - "id": "minecraft:dragon_egg", - "unlocalizedName": "tile.dragonEgg", - "localizedName": "Dragon Egg", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 123, - "legacyData": 0, - "id": "minecraft:redstone_lamp", - "unlocalizedName": "tile.redstoneLight", - "localizedName": "Redstone Lamp", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 126, - "legacyData": 0, - "id": "minecraft:wooden_slab", - "unlocalizedName": "tile.woodSlab.oak", - "localizedName": "Oak Wood Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 126, - "legacyData": 1, - "id": "minecraft:wooden_slab", - "unlocalizedName": "tile.woodSlab.spruce", - "localizedName": "Spruce Wood Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 126, - "legacyData": 2, - "id": "minecraft:wooden_slab", - "unlocalizedName": "tile.woodSlab.birch", - "localizedName": "Birch Wood Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 126, - "legacyData": 3, - "id": "minecraft:wooden_slab", - "unlocalizedName": "tile.woodSlab.jungle", - "localizedName": "Jungle Wood Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 126, - "legacyData": 4, - "id": "minecraft:wooden_slab", - "unlocalizedName": "tile.woodSlab.acacia", - "localizedName": "Acacia Wood Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 126, - "legacyData": 5, - "id": "minecraft:wooden_slab", - "unlocalizedName": "tile.woodSlab.big_oak", - "localizedName": "Dark Oak Wood Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 128, - "legacyData": 0, - "id": "minecraft:sandstone_stairs", - "unlocalizedName": "tile.stairsSandStone", - "localizedName": "Sandstone Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 129, - "legacyData": 0, - "id": "minecraft:emerald_ore", - "unlocalizedName": "tile.oreEmerald", - "localizedName": "Emerald Ore", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 130, - "legacyData": 0, - "id": "minecraft:ender_chest", - "unlocalizedName": "tile.enderChest", - "localizedName": "Ender Chest", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 131, - "legacyData": 0, - "id": "minecraft:tripwire_hook", - "unlocalizedName": "tile.tripWireSource", - "localizedName": "Tripwire Hook", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 133, - "legacyData": 0, - "id": "minecraft:emerald_block", - "unlocalizedName": "tile.blockEmerald", - "localizedName": "Block of Emerald", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 134, - "legacyData": 0, - "id": "minecraft:spruce_stairs", - "unlocalizedName": "tile.stairsWoodSpruce", - "localizedName": "Spruce Wood Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 135, - "legacyData": 0, - "id": "minecraft:birch_stairs", - "unlocalizedName": "tile.stairsWoodBirch", - "localizedName": "Birch Wood Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 136, - "legacyData": 0, - "id": "minecraft:jungle_stairs", - "unlocalizedName": "tile.stairsWoodJungle", - "localizedName": "Jungle Wood Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 137, - "legacyData": 0, - "id": "minecraft:command_block", - "unlocalizedName": "tile.commandBlock", - "localizedName": "Command Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 138, - "legacyData": 0, - "id": "minecraft:beacon", - "unlocalizedName": "tile.beacon", - "localizedName": "Beacon", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 139, - "legacyData": 0, - "id": "minecraft:cobblestone_wall", - "unlocalizedName": "tile.cobbleWall.normal", - "localizedName": "Cobblestone Wall", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 139, - "legacyData": 1, - "id": "minecraft:cobblestone_wall", - "unlocalizedName": "tile.cobbleWall.mossy", - "localizedName": "Mossy Cobblestone Wall", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 143, - "legacyData": 0, - "id": "minecraft:wooden_button", - "unlocalizedName": "tile.button", - "localizedName": "Button", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 145, - "legacyData": 0, - "id": "minecraft:anvil", - "unlocalizedName": "tile.anvil.intact", - "localizedName": "Anvil", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 145, - "legacyData": 1, - "id": "minecraft:anvil", - "unlocalizedName": "tile.anvil.slightlyDamaged", - "localizedName": "Slightly Damaged Anvil", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 145, - "legacyData": 2, - "id": "minecraft:anvil", - "unlocalizedName": "tile.anvil.veryDamaged", - "localizedName": "Very Damaged Anvil", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 146, - "legacyData": 0, - "id": "minecraft:trapped_chest", - "unlocalizedName": "tile.chestTrap", - "localizedName": "Trapped Chest", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 147, - "legacyData": 0, - "id": "minecraft:light_weighted_pressure_plate", - "unlocalizedName": "tile.weightedPlate_light", - "localizedName": "Weighted Pressure Plate (Light)", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 148, - "legacyData": 0, - "id": "minecraft:heavy_weighted_pressure_plate", - "unlocalizedName": "tile.weightedPlate_heavy", - "localizedName": "Weighted Pressure Plate (Heavy)", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 151, - "legacyData": 0, - "id": "minecraft:daylight_detector", - "unlocalizedName": "tile.daylightDetector", - "localizedName": "Daylight Sensor", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 152, - "legacyData": 0, - "id": "minecraft:redstone_block", - "unlocalizedName": "tile.blockRedstone", - "localizedName": "Block of Redstone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 153, - "legacyData": 0, - "id": "minecraft:quartz_ore", - "unlocalizedName": "tile.netherquartz", - "localizedName": "Nether Quartz Ore", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 154, - "legacyData": 0, - "id": "minecraft:hopper", - "unlocalizedName": "tile.hopper", - "localizedName": "Hopper", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 155, - "legacyData": 0, - "id": "minecraft:quartz_block", - "unlocalizedName": "tile.quartzBlock.default", - "localizedName": "Block of Quartz", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 155, - "legacyData": 1, - "id": "minecraft:quartz_block", - "unlocalizedName": "tile.quartzBlock.chiseled", - "localizedName": "Chiseled Quartz Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 155, - "legacyData": 2, - "id": "minecraft:quartz_block", - "unlocalizedName": "tile.quartzBlock.lines", - "localizedName": "Pillar Quartz Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 156, - "legacyData": 0, - "id": "minecraft:quartz_stairs", - "unlocalizedName": "tile.stairsQuartz", - "localizedName": "Quartz Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 157, - "legacyData": 0, - "id": "minecraft:activator_rail", - "unlocalizedName": "tile.activatorRail", - "localizedName": "Activator Rail", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 158, - "legacyData": 0, - "id": "minecraft:dropper", - "unlocalizedName": "tile.dropper", - "localizedName": "Dropper", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 0, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.white", - "localizedName": "White Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 1, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.orange", - "localizedName": "Orange Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 2, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.magenta", - "localizedName": "Magenta Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 3, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.lightBlue", - "localizedName": "Light Blue Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 4, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.yellow", - "localizedName": "Yellow Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 5, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.lime", - "localizedName": "Lime Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 6, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.pink", - "localizedName": "Pink Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 7, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.gray", - "localizedName": "Gray Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 8, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.silver", - "localizedName": "Light Gray Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 9, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.cyan", - "localizedName": "Cyan Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 10, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.purple", - "localizedName": "Purple Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 11, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.blue", - "localizedName": "Blue Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 12, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.brown", - "localizedName": "Brown Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 13, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.green", - "localizedName": "Green Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 14, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.red", - "localizedName": "Red Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 159, - "legacyData": 15, - "id": "minecraft:stained_hardened_clay", - "unlocalizedName": "tile.clayHardenedStained.black", - "localizedName": "Black Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 0, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.white", - "localizedName": "White Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 1, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.orange", - "localizedName": "Orange Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 2, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.magenta", - "localizedName": "Magenta Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 3, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.lightBlue", - "localizedName": "Light Blue Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 4, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.yellow", - "localizedName": "Yellow Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 5, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.lime", - "localizedName": "Lime Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 6, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.pink", - "localizedName": "Pink Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 7, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.gray", - "localizedName": "Gray Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 8, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.silver", - "localizedName": "Light Gray Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 9, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.cyan", - "localizedName": "Cyan Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 10, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.purple", - "localizedName": "Purple Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 11, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.blue", - "localizedName": "Blue Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 12, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.brown", - "localizedName": "Brown Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 13, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.green", - "localizedName": "Green Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 14, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.red", - "localizedName": "Red Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 160, - "legacyData": 15, - "id": "minecraft:stained_glass_pane", - "unlocalizedName": "tile.thinStainedGlass.black", - "localizedName": "Black Stained Glass Pane", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 161, - "legacyData": 0, - "id": "minecraft:leaves2", - "unlocalizedName": "tile.leaves.acacia", - "localizedName": "Acacia Leaves", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 161, - "legacyData": 1, - "id": "minecraft:leaves2", - "unlocalizedName": "tile.leaves.big_oak", - "localizedName": "Dark Oak Leaves", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 162, - "legacyData": 0, - "id": "minecraft:log2", - "unlocalizedName": "tile.log.acacia", - "localizedName": "Acacia Wood", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 162, - "legacyData": 1, - "id": "minecraft:log2", - "unlocalizedName": "tile.log.big_oak", - "localizedName": "Dark Oak Wood", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 163, - "legacyData": 0, - "id": "minecraft:acacia_stairs", - "unlocalizedName": "tile.stairsWoodAcacia", - "localizedName": "Acacia Wood Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 164, - "legacyData": 0, - "id": "minecraft:dark_oak_stairs", - "unlocalizedName": "tile.stairsWoodDarkOak", - "localizedName": "Dark Oak Wood Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 165, - "legacyData": 0, - "id": "minecraft:slime", - "unlocalizedName": "tile.slime", - "localizedName": "Slime Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 166, - "legacyData": 0, - "id": "minecraft:barrier", - "unlocalizedName": "tile.barrier", - "localizedName": "Barrier", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 167, - "legacyData": 0, - "id": "minecraft:iron_trapdoor", - "unlocalizedName": "tile.ironTrapdoor", - "localizedName": "Iron Trapdoor", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 168, - "legacyData": 0, - "id": "minecraft:prismarine", - "unlocalizedName": "tile.prismarine.rough", - "localizedName": "Prismarine", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 168, - "legacyData": 1, - "id": "minecraft:prismarine", - "unlocalizedName": "tile.prismarine.bricks", - "localizedName": "Prismarine Bricks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 168, - "legacyData": 2, - "id": "minecraft:prismarine", - "unlocalizedName": "tile.prismarine.dark", - "localizedName": "Dark Prismarine", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 169, - "legacyData": 0, - "id": "minecraft:sea_lantern", - "unlocalizedName": "tile.seaLantern", - "localizedName": "Sea Lantern", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 170, - "legacyData": 0, - "id": "minecraft:hay_block", - "unlocalizedName": "tile.hayBlock", - "localizedName": "Hay Bale", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 0, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.white", - "localizedName": "White Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 1, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.orange", - "localizedName": "Orange Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 2, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.magenta", - "localizedName": "Magenta Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 3, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.lightBlue", - "localizedName": "Light Blue Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 4, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.yellow", - "localizedName": "Yellow Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 5, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.lime", - "localizedName": "Lime Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 6, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.pink", - "localizedName": "Pink Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 7, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.gray", - "localizedName": "Gray Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 8, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.silver", - "localizedName": "Light Gray Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 9, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.cyan", - "localizedName": "Cyan Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 10, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.purple", - "localizedName": "Purple Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 11, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.blue", - "localizedName": "Blue Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 12, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.brown", - "localizedName": "Brown Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 13, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.green", - "localizedName": "Green Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 14, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.red", - "localizedName": "Red Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 171, - "legacyData": 15, - "id": "minecraft:carpet", - "unlocalizedName": "tile.woolCarpet.black", - "localizedName": "Black Carpet", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 172, - "legacyData": 0, - "id": "minecraft:hardened_clay", - "unlocalizedName": "tile.clayHardened", - "localizedName": "Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 173, - "legacyData": 0, - "id": "minecraft:coal_block", - "unlocalizedName": "tile.blockCoal", - "localizedName": "Block of Coal", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 174, - "legacyData": 0, - "id": "minecraft:packed_ice", - "unlocalizedName": "tile.icePacked", - "localizedName": "Packed Ice", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 175, - "legacyData": 0, - "id": "minecraft:double_plant", - "unlocalizedName": "tile.doublePlant.sunflower", - "localizedName": "Sunflower", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 175, - "legacyData": 1, - "id": "minecraft:double_plant", - "unlocalizedName": "tile.doublePlant.syringa", - "localizedName": "Lilac", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 175, - "legacyData": 2, - "id": "minecraft:double_plant", - "unlocalizedName": "tile.doublePlant.grass", - "localizedName": "Double Tallgrass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 175, - "legacyData": 3, - "id": "minecraft:double_plant", - "unlocalizedName": "tile.doublePlant.fern", - "localizedName": "Large Fern", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 175, - "legacyData": 4, - "id": "minecraft:double_plant", - "unlocalizedName": "tile.doublePlant.rose", - "localizedName": "Rose Bush", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 175, - "legacyData": 5, - "id": "minecraft:double_plant", - "unlocalizedName": "tile.doublePlant.paeonia", - "localizedName": "Peony", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 179, - "legacyData": 0, - "id": "minecraft:red_sandstone", - "unlocalizedName": "tile.redSandStone.default", - "localizedName": "Red Sandstone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 179, - "legacyData": 1, - "id": "minecraft:red_sandstone", - "unlocalizedName": "tile.redSandStone.chiseled", - "localizedName": "Chiseled Red Sandstone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 179, - "legacyData": 2, - "id": "minecraft:red_sandstone", - "unlocalizedName": "tile.redSandStone.smooth", - "localizedName": "Smooth Red Sandstone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 180, - "legacyData": 0, - "id": "minecraft:red_sandstone_stairs", - "unlocalizedName": "tile.stairsRedSandStone", - "localizedName": "Red Sandstone Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 182, - "legacyData": 0, - "id": "minecraft:stone_slab2", - "unlocalizedName": "tile.stoneSlab2.red_sandstone", - "localizedName": "Red Sandstone Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 183, - "legacyData": 0, - "id": "minecraft:spruce_fence_gate", - "unlocalizedName": "tile.spruceFenceGate", - "localizedName": "Spruce Fence Gate", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 184, - "legacyData": 0, - "id": "minecraft:birch_fence_gate", - "unlocalizedName": "tile.birchFenceGate", - "localizedName": "Birch Fence Gate", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 185, - "legacyData": 0, - "id": "minecraft:jungle_fence_gate", - "unlocalizedName": "tile.jungleFenceGate", - "localizedName": "Jungle Fence Gate", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 186, - "legacyData": 0, - "id": "minecraft:dark_oak_fence_gate", - "unlocalizedName": "tile.darkOakFenceGate", - "localizedName": "Dark Oak Fence Gate", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 187, - "legacyData": 0, - "id": "minecraft:acacia_fence_gate", - "unlocalizedName": "tile.acaciaFenceGate", - "localizedName": "Acacia Fence Gate", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 188, - "legacyData": 0, - "id": "minecraft:spruce_fence", - "unlocalizedName": "tile.spruceFence", - "localizedName": "Spruce Fence", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 189, - "legacyData": 0, - "id": "minecraft:birch_fence", - "unlocalizedName": "tile.birchFence", - "localizedName": "Birch Fence", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 190, - "legacyData": 0, - "id": "minecraft:jungle_fence", - "unlocalizedName": "tile.jungleFence", - "localizedName": "Jungle Fence", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 191, - "legacyData": 0, - "id": "minecraft:dark_oak_fence", - "unlocalizedName": "tile.darkOakFence", - "localizedName": "Dark Oak Fence", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 192, - "legacyData": 0, - "id": "minecraft:acacia_fence", - "unlocalizedName": "tile.acaciaFence", - "localizedName": "Acacia Fence", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 198, - "legacyData": 0, - "id": "minecraft:end_rod", - "unlocalizedName": "tile.endRod", - "localizedName": "End Rod", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 199, - "legacyData": 0, - "id": "minecraft:chorus_plant", - "unlocalizedName": "tile.chorusPlant", - "localizedName": "Chorus Plant", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 200, - "legacyData": 0, - "id": "minecraft:chorus_flower", - "unlocalizedName": "tile.chorusFlower", - "localizedName": "Chorus Flower", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 201, - "legacyData": 0, - "id": "minecraft:purpur_block", - "unlocalizedName": "tile.purpurBlock", - "localizedName": "Purpur Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 202, - "legacyData": 0, - "id": "minecraft:purpur_pillar", - "unlocalizedName": "tile.purpurPillar", - "localizedName": "Purpur Pillar", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 203, - "legacyData": 0, - "id": "minecraft:purpur_stairs", - "unlocalizedName": "tile.stairsPurpur", - "localizedName": "Purpur Stairs", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 205, - "legacyData": 0, - "id": "minecraft:purpur_slab", - "unlocalizedName": "tile.purpurSlab", - "localizedName": "Purpur Slab", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 206, - "legacyData": 0, - "id": "minecraft:end_bricks", - "unlocalizedName": "tile.endBricks", - "localizedName": "End Stone Bricks", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 208, - "legacyData": 0, - "id": "minecraft:grass_path", - "unlocalizedName": "tile.grassPath", - "localizedName": "Grass Path", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 210, - "legacyData": 0, - "id": "minecraft:repeating_command_block", - "unlocalizedName": "tile.repeatingCommandBlock", - "localizedName": "Repeating Command Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 211, - "legacyData": 0, - "id": "minecraft:chain_command_block", - "unlocalizedName": "tile.chainCommandBlock", - "localizedName": "Chain Command Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 213, - "legacyData": 0, - "id": "minecraft:magma", - "unlocalizedName": "tile.magma", - "localizedName": "Magma Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 214, - "legacyData": 0, - "id": "minecraft:nether_wart_block", - "unlocalizedName": "tile.netherWartBlock", - "localizedName": "Nether Wart Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 215, - "legacyData": 0, - "id": "minecraft:red_nether_brick", - "unlocalizedName": "tile.redNetherBrick", - "localizedName": "Red Nether Brick", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 216, - "legacyData": 0, - "id": "minecraft:bone_block", - "unlocalizedName": "tile.boneBlock", - "localizedName": "Bone Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 217, - "legacyData": 0, - "id": "minecraft:structure_void", - "unlocalizedName": "tile.structureVoid", - "localizedName": "Structure Void", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 218, - "legacyData": 0, - "id": "minecraft:observer", - "unlocalizedName": "tile.observer", - "localizedName": "Observer", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 219, - "legacyData": 0, - "id": "minecraft:white_shulker_box", - "unlocalizedName": "tile.shulkerBoxWhite", - "localizedName": "White Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 220, - "legacyData": 0, - "id": "minecraft:orange_shulker_box", - "unlocalizedName": "tile.shulkerBoxOrange", - "localizedName": "Orange Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 221, - "legacyData": 0, - "id": "minecraft:magenta_shulker_box", - "unlocalizedName": "tile.shulkerBoxMagenta", - "localizedName": "Magenta Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 222, - "legacyData": 0, - "id": "minecraft:light_blue_shulker_box", - "unlocalizedName": "tile.shulkerBoxLightBlue", - "localizedName": "Light Blue Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 223, - "legacyData": 0, - "id": "minecraft:yellow_shulker_box", - "unlocalizedName": "tile.shulkerBoxYellow", - "localizedName": "Yellow Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 224, - "legacyData": 0, - "id": "minecraft:lime_shulker_box", - "unlocalizedName": "tile.shulkerBoxLime", - "localizedName": "Lime Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 225, - "legacyData": 0, - "id": "minecraft:pink_shulker_box", - "unlocalizedName": "tile.shulkerBoxPink", - "localizedName": "Pink Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 226, - "legacyData": 0, - "id": "minecraft:gray_shulker_box", - "unlocalizedName": "tile.shulkerBoxGray", - "localizedName": "Gray Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 227, - "legacyData": 0, - "id": "minecraft:silver_shulker_box", - "unlocalizedName": "tile.shulkerBoxSilver", - "localizedName": "Light Gray Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 228, - "legacyData": 0, - "id": "minecraft:cyan_shulker_box", - "unlocalizedName": "tile.shulkerBoxCyan", - "localizedName": "Cyan Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 229, - "legacyData": 0, - "id": "minecraft:purple_shulker_box", - "unlocalizedName": "tile.shulkerBoxPurple", - "localizedName": "Purple Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 230, - "legacyData": 0, - "id": "minecraft:blue_shulker_box", - "unlocalizedName": "tile.shulkerBoxBlue", - "localizedName": "Blue Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 231, - "legacyData": 0, - "id": "minecraft:brown_shulker_box", - "unlocalizedName": "tile.shulkerBoxBrown", - "localizedName": "Brown Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 232, - "legacyData": 0, - "id": "minecraft:green_shulker_box", - "unlocalizedName": "tile.shulkerBoxGreen", - "localizedName": "Green Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 233, - "legacyData": 0, - "id": "minecraft:red_shulker_box", - "unlocalizedName": "tile.shulkerBoxRed", - "localizedName": "Red Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 234, - "legacyData": 0, - "id": "minecraft:black_shulker_box", - "unlocalizedName": "tile.shulkerBoxBlack", - "localizedName": "Black Shulker Box", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 235, - "legacyData": 0, - "id": "minecraft:white_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaWhite", - "localizedName": "White Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 236, - "legacyData": 0, - "id": "minecraft:orange_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaOrange", - "localizedName": "Orange Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 237, - "legacyData": 0, - "id": "minecraft:magenta_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaMagenta", - "localizedName": "Magenta Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 238, - "legacyData": 0, - "id": "minecraft:light_blue_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaLightBlue", - "localizedName": "Light Blue Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 239, - "legacyData": 0, - "id": "minecraft:yellow_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaYellow", - "localizedName": "Yellow Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 240, - "legacyData": 0, - "id": "minecraft:lime_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaLime", - "localizedName": "Lime Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 241, - "legacyData": 0, - "id": "minecraft:pink_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaPink", - "localizedName": "Pink Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 242, - "legacyData": 0, - "id": "minecraft:gray_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaGray", - "localizedName": "Gray Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 243, - "legacyData": 0, - "id": "minecraft:silver_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaSilver", - "localizedName": "Light Gray Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 244, - "legacyData": 0, - "id": "minecraft:cyan_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaCyan", - "localizedName": "Cyan Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 245, - "legacyData": 0, - "id": "minecraft:purple_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaPurple", - "localizedName": "Purple Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 246, - "legacyData": 0, - "id": "minecraft:blue_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaBlue", - "localizedName": "Blue Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 247, - "legacyData": 0, - "id": "minecraft:brown_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaBrown", - "localizedName": "Brown Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 248, - "legacyData": 0, - "id": "minecraft:green_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaGreen", - "localizedName": "Green Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 249, - "legacyData": 0, - "id": "minecraft:red_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaRed", - "localizedName": "Red Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 250, - "legacyData": 0, - "id": "minecraft:black_glazed_terracotta", - "unlocalizedName": "tile.glazedTerracottaBlack", - "localizedName": "Black Glazed Terracotta", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 0, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.white", - "localizedName": "White Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 1, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.orange", - "localizedName": "Orange Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 2, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.magenta", - "localizedName": "Magenta Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 3, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.lightBlue", - "localizedName": "Light Blue Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 4, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.yellow", - "localizedName": "Yellow Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 5, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.lime", - "localizedName": "Lime Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 6, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.pink", - "localizedName": "Pink Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 7, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.gray", - "localizedName": "Gray Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 8, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.silver", - "localizedName": "Light Gray Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 9, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.cyan", - "localizedName": "Cyan Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 10, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.purple", - "localizedName": "Purple Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 11, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.blue", - "localizedName": "Blue Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 12, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.brown", - "localizedName": "Brown Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 13, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.green", - "localizedName": "Green Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 14, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.red", - "localizedName": "Red Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 251, - "legacyData": 15, - "id": "minecraft:concrete", - "unlocalizedName": "tile.concrete.black", - "localizedName": "Black Concrete", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 0, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.white", - "localizedName": "White Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 1, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.orange", - "localizedName": "Orange Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 2, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.magenta", - "localizedName": "Magenta Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 3, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.lightBlue", - "localizedName": "Light Blue Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 4, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.yellow", - "localizedName": "Yellow Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 5, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.lime", - "localizedName": "Lime Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 6, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.pink", - "localizedName": "Pink Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 7, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.gray", - "localizedName": "Gray Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 8, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.silver", - "localizedName": "Light Gray Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 9, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.cyan", - "localizedName": "Cyan Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 10, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.purple", - "localizedName": "Purple Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 11, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.blue", - "localizedName": "Blue Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 12, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.brown", - "localizedName": "Brown Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 13, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.green", - "localizedName": "Green Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 14, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.red", - "localizedName": "Red Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 252, - "legacyData": 15, - "id": "minecraft:concrete_powder", - "unlocalizedName": "tile.concretePowder.black", - "localizedName": "Black Concrete Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 255, - "legacyData": 0, - "id": "minecraft:structure_block", - "unlocalizedName": "tile.structureBlock", - "localizedName": "Structure Block", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 256, - "legacyData": 0, - "id": "minecraft:iron_shovel", - "unlocalizedName": "item.shovelIron", - "localizedName": "Iron Shovel", - "maxDamage": 250, - "maxStackSize": 1 - }, - { - "legacyId": 257, - "legacyData": 0, - "id": "minecraft:iron_pickaxe", - "unlocalizedName": "item.pickaxeIron", - "localizedName": "Iron Pickaxe", - "maxDamage": 250, - "maxStackSize": 1 - }, - { - "legacyId": 258, - "legacyData": 0, - "id": "minecraft:iron_axe", - "unlocalizedName": "item.hatchetIron", - "localizedName": "Iron Axe", - "maxDamage": 250, - "maxStackSize": 1 - }, - { - "legacyId": 259, - "legacyData": 0, - "id": "minecraft:flint_and_steel", - "unlocalizedName": "item.flintAndSteel", - "localizedName": "Flint and Steel", - "maxDamage": 64, - "maxStackSize": 1 - }, - { - "legacyId": 260, - "legacyData": 0, - "id": "minecraft:apple", - "unlocalizedName": "item.apple", - "localizedName": "Apple", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 261, - "legacyData": 0, - "id": "minecraft:bow", - "unlocalizedName": "item.bow", - "localizedName": "Bow", - "maxDamage": 384, - "maxStackSize": 1 - }, - { - "legacyId": 262, - "legacyData": 0, - "id": "minecraft:arrow", - "unlocalizedName": "item.arrow", - "localizedName": "Arrow", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 263, - "legacyData": 0, - "id": "minecraft:coal", - "unlocalizedName": "item.coal", - "localizedName": "Coal", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 263, - "legacyData": 1, - "id": "minecraft:coal", - "unlocalizedName": "item.charcoal", - "localizedName": "Charcoal", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 264, - "legacyData": 0, - "id": "minecraft:diamond", - "unlocalizedName": "item.diamond", - "localizedName": "Diamond", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 265, - "legacyData": 0, - "id": "minecraft:iron_ingot", - "unlocalizedName": "item.ingotIron", - "localizedName": "Iron Ingot", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 266, - "legacyData": 0, - "id": "minecraft:gold_ingot", - "unlocalizedName": "item.ingotGold", - "localizedName": "Gold Ingot", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 267, - "legacyData": 0, - "id": "minecraft:iron_sword", - "unlocalizedName": "item.swordIron", - "localizedName": "Iron Sword", - "maxDamage": 250, - "maxStackSize": 1 - }, - { - "legacyId": 268, - "legacyData": 0, - "id": "minecraft:wooden_sword", - "unlocalizedName": "item.swordWood", - "localizedName": "Wooden Sword", - "maxDamage": 59, - "maxStackSize": 1 - }, - { - "legacyId": 269, - "legacyData": 0, - "id": "minecraft:wooden_shovel", - "unlocalizedName": "item.shovelWood", - "localizedName": "Wooden Shovel", - "maxDamage": 59, - "maxStackSize": 1 - }, - { - "legacyId": 270, - "legacyData": 0, - "id": "minecraft:wooden_pickaxe", - "unlocalizedName": "item.pickaxeWood", - "localizedName": "Wooden Pickaxe", - "maxDamage": 59, - "maxStackSize": 1 - }, - { - "legacyId": 271, - "legacyData": 0, - "id": "minecraft:wooden_axe", - "unlocalizedName": "item.hatchetWood", - "localizedName": "Wooden Axe", - "maxDamage": 59, - "maxStackSize": 1 - }, - { - "legacyId": 272, - "legacyData": 0, - "id": "minecraft:stone_sword", - "unlocalizedName": "item.swordStone", - "localizedName": "Stone Sword", - "maxDamage": 131, - "maxStackSize": 1 - }, - { - "legacyId": 273, - "legacyData": 0, - "id": "minecraft:stone_shovel", - "unlocalizedName": "item.shovelStone", - "localizedName": "Stone Shovel", - "maxDamage": 131, - "maxStackSize": 1 - }, - { - "legacyId": 274, - "legacyData": 0, - "id": "minecraft:stone_pickaxe", - "unlocalizedName": "item.pickaxeStone", - "localizedName": "Stone Pickaxe", - "maxDamage": 131, - "maxStackSize": 1 - }, - { - "legacyId": 275, - "legacyData": 0, - "id": "minecraft:stone_axe", - "unlocalizedName": "item.hatchetStone", - "localizedName": "Stone Axe", - "maxDamage": 131, - "maxStackSize": 1 - }, - { - "legacyId": 276, - "legacyData": 0, - "id": "minecraft:diamond_sword", - "unlocalizedName": "item.swordDiamond", - "localizedName": "Diamond Sword", - "maxDamage": 1561, - "maxStackSize": 1 - }, - { - "legacyId": 277, - "legacyData": 0, - "id": "minecraft:diamond_shovel", - "unlocalizedName": "item.shovelDiamond", - "localizedName": "Diamond Shovel", - "maxDamage": 1561, - "maxStackSize": 1 - }, - { - "legacyId": 278, - "legacyData": 0, - "id": "minecraft:diamond_pickaxe", - "unlocalizedName": "item.pickaxeDiamond", - "localizedName": "Diamond Pickaxe", - "maxDamage": 1561, - "maxStackSize": 1 - }, - { - "legacyId": 279, - "legacyData": 0, - "id": "minecraft:diamond_axe", - "unlocalizedName": "item.hatchetDiamond", - "localizedName": "Diamond Axe", - "maxDamage": 1561, - "maxStackSize": 1 - }, - { - "legacyId": 280, - "legacyData": 0, - "id": "minecraft:stick", - "unlocalizedName": "item.stick", - "localizedName": "Stick", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 281, - "legacyData": 0, - "id": "minecraft:bowl", - "unlocalizedName": "item.bowl", - "localizedName": "Bowl", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 282, - "legacyData": 0, - "id": "minecraft:mushroom_stew", - "unlocalizedName": "item.mushroomStew", - "localizedName": "Mushroom Stew", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 283, - "legacyData": 0, - "id": "minecraft:golden_sword", - "unlocalizedName": "item.swordGold", - "localizedName": "Golden Sword", - "maxDamage": 32, - "maxStackSize": 1 - }, - { - "legacyId": 284, - "legacyData": 0, - "id": "minecraft:golden_shovel", - "unlocalizedName": "item.shovelGold", - "localizedName": "Golden Shovel", - "maxDamage": 32, - "maxStackSize": 1 - }, - { - "legacyId": 285, - "legacyData": 0, - "id": "minecraft:golden_pickaxe", - "unlocalizedName": "item.pickaxeGold", - "localizedName": "Golden Pickaxe", - "maxDamage": 32, - "maxStackSize": 1 - }, - { - "legacyId": 286, - "legacyData": 0, - "id": "minecraft:golden_axe", - "unlocalizedName": "item.hatchetGold", - "localizedName": "Golden Axe", - "maxDamage": 32, - "maxStackSize": 1 - }, - { - "legacyId": 287, - "legacyData": 0, - "id": "minecraft:string", - "unlocalizedName": "item.string", - "localizedName": "String", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 288, - "legacyData": 0, - "id": "minecraft:feather", - "unlocalizedName": "item.feather", - "localizedName": "Feather", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 289, - "legacyData": 0, - "id": "minecraft:gunpowder", - "unlocalizedName": "item.sulphur", - "localizedName": "Gunpowder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 290, - "legacyData": 0, - "id": "minecraft:wooden_hoe", - "unlocalizedName": "item.hoeWood", - "localizedName": "Wooden Hoe", - "maxDamage": 59, - "maxStackSize": 1 - }, - { - "legacyId": 291, - "legacyData": 0, - "id": "minecraft:stone_hoe", - "unlocalizedName": "item.hoeStone", - "localizedName": "Stone Hoe", - "maxDamage": 131, - "maxStackSize": 1 - }, - { - "legacyId": 292, - "legacyData": 0, - "id": "minecraft:iron_hoe", - "unlocalizedName": "item.hoeIron", - "localizedName": "Iron Hoe", - "maxDamage": 250, - "maxStackSize": 1 - }, - { - "legacyId": 293, - "legacyData": 0, - "id": "minecraft:diamond_hoe", - "unlocalizedName": "item.hoeDiamond", - "localizedName": "Diamond Hoe", - "maxDamage": 1561, - "maxStackSize": 1 - }, - { - "legacyId": 294, - "legacyData": 0, - "id": "minecraft:golden_hoe", - "unlocalizedName": "item.hoeGold", - "localizedName": "Golden Hoe", - "maxDamage": 32, - "maxStackSize": 1 - }, - { - "legacyId": 295, - "legacyData": 0, - "id": "minecraft:wheat_seeds", - "unlocalizedName": "item.seeds", - "localizedName": "Seeds", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 296, - "legacyData": 0, - "id": "minecraft:wheat", - "unlocalizedName": "item.wheat", - "localizedName": "Wheat", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 297, - "legacyData": 0, - "id": "minecraft:bread", - "unlocalizedName": "item.bread", - "localizedName": "Bread", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 298, - "legacyData": 0, - "id": "minecraft:leather_helmet", - "unlocalizedName": "item.helmetCloth", - "localizedName": "Leather Cap", - "maxDamage": 55, - "maxStackSize": 1 - }, - { - "legacyId": 299, - "legacyData": 0, - "id": "minecraft:leather_chestplate", - "unlocalizedName": "item.chestplateCloth", - "localizedName": "Leather Tunic", - "maxDamage": 80, - "maxStackSize": 1 - }, - { - "legacyId": 300, - "legacyData": 0, - "id": "minecraft:leather_leggings", - "unlocalizedName": "item.leggingsCloth", - "localizedName": "Leather Pants", - "maxDamage": 75, - "maxStackSize": 1 - }, - { - "legacyId": 301, - "legacyData": 0, - "id": "minecraft:leather_boots", - "unlocalizedName": "item.bootsCloth", - "localizedName": "Leather Boots", - "maxDamage": 65, - "maxStackSize": 1 - }, - { - "legacyId": 302, - "legacyData": 0, - "id": "minecraft:chainmail_helmet", - "unlocalizedName": "item.helmetChain", - "localizedName": "Chain Helmet", - "maxDamage": 165, - "maxStackSize": 1 - }, - { - "legacyId": 303, - "legacyData": 0, - "id": "minecraft:chainmail_chestplate", - "unlocalizedName": "item.chestplateChain", - "localizedName": "Chain Chestplate", - "maxDamage": 240, - "maxStackSize": 1 - }, - { - "legacyId": 304, - "legacyData": 0, - "id": "minecraft:chainmail_leggings", - "unlocalizedName": "item.leggingsChain", - "localizedName": "Chain Leggings", - "maxDamage": 225, - "maxStackSize": 1 - }, - { - "legacyId": 305, - "legacyData": 0, - "id": "minecraft:chainmail_boots", - "unlocalizedName": "item.bootsChain", - "localizedName": "Chain Boots", - "maxDamage": 195, - "maxStackSize": 1 - }, - { - "legacyId": 306, - "legacyData": 0, - "id": "minecraft:iron_helmet", - "unlocalizedName": "item.helmetIron", - "localizedName": "Iron Helmet", - "maxDamage": 165, - "maxStackSize": 1 - }, - { - "legacyId": 307, - "legacyData": 0, - "id": "minecraft:iron_chestplate", - "unlocalizedName": "item.chestplateIron", - "localizedName": "Iron Chestplate", - "maxDamage": 240, - "maxStackSize": 1 - }, - { - "legacyId": 308, - "legacyData": 0, - "id": "minecraft:iron_leggings", - "unlocalizedName": "item.leggingsIron", - "localizedName": "Iron Leggings", - "maxDamage": 225, - "maxStackSize": 1 - }, - { - "legacyId": 309, - "legacyData": 0, - "id": "minecraft:iron_boots", - "unlocalizedName": "item.bootsIron", - "localizedName": "Iron Boots", - "maxDamage": 195, - "maxStackSize": 1 - }, - { - "legacyId": 310, - "legacyData": 0, - "id": "minecraft:diamond_helmet", - "unlocalizedName": "item.helmetDiamond", - "localizedName": "Diamond Helmet", - "maxDamage": 363, - "maxStackSize": 1 - }, - { - "legacyId": 311, - "legacyData": 0, - "id": "minecraft:diamond_chestplate", - "unlocalizedName": "item.chestplateDiamond", - "localizedName": "Diamond Chestplate", - "maxDamage": 528, - "maxStackSize": 1 - }, - { - "legacyId": 312, - "legacyData": 0, - "id": "minecraft:diamond_leggings", - "unlocalizedName": "item.leggingsDiamond", - "localizedName": "Diamond Leggings", - "maxDamage": 495, - "maxStackSize": 1 - }, - { - "legacyId": 313, - "legacyData": 0, - "id": "minecraft:diamond_boots", - "unlocalizedName": "item.bootsDiamond", - "localizedName": "Diamond Boots", - "maxDamage": 429, - "maxStackSize": 1 - }, - { - "legacyId": 314, - "legacyData": 0, - "id": "minecraft:golden_helmet", - "unlocalizedName": "item.helmetGold", - "localizedName": "Golden Helmet", - "maxDamage": 77, - "maxStackSize": 1 - }, - { - "legacyId": 315, - "legacyData": 0, - "id": "minecraft:golden_chestplate", - "unlocalizedName": "item.chestplateGold", - "localizedName": "Golden Chestplate", - "maxDamage": 112, - "maxStackSize": 1 - }, - { - "legacyId": 316, - "legacyData": 0, - "id": "minecraft:golden_leggings", - "unlocalizedName": "item.leggingsGold", - "localizedName": "Golden Leggings", - "maxDamage": 105, - "maxStackSize": 1 - }, - { - "legacyId": 317, - "legacyData": 0, - "id": "minecraft:golden_boots", - "unlocalizedName": "item.bootsGold", - "localizedName": "Golden Boots", - "maxDamage": 91, - "maxStackSize": 1 - }, - { - "legacyId": 318, - "legacyData": 0, - "id": "minecraft:flint", - "unlocalizedName": "item.flint", - "localizedName": "Flint", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 319, - "legacyData": 0, - "id": "minecraft:porkchop", - "unlocalizedName": "item.porkchopRaw", - "localizedName": "Raw Porkchop", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 320, - "legacyData": 0, - "id": "minecraft:cooked_porkchop", - "unlocalizedName": "item.porkchopCooked", - "localizedName": "Cooked Porkchop", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 321, - "legacyData": 0, - "id": "minecraft:painting", - "unlocalizedName": "item.painting", - "localizedName": "Painting", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 322, - "legacyData": 0, - "id": "minecraft:golden_apple", - "unlocalizedName": "item.appleGold", - "localizedName": "Golden Apple", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 322, - "legacyData": 1, - "id": "minecraft:golden_apple", - "unlocalizedName": "item.appleGold", - "localizedName": "Golden Apple", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 323, - "legacyData": 0, - "id": "minecraft:sign", - "unlocalizedName": "item.sign", - "localizedName": "Sign", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 324, - "legacyData": 0, - "id": "minecraft:wooden_door", - "unlocalizedName": "item.doorOak", - "localizedName": "Oak Door", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 325, - "legacyData": 0, - "id": "minecraft:bucket", - "unlocalizedName": "item.bucket", - "localizedName": "Bucket", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 326, - "legacyData": 0, - "id": "minecraft:water_bucket", - "unlocalizedName": "item.bucketWater", - "localizedName": "Water Bucket", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 327, - "legacyData": 0, - "id": "minecraft:lava_bucket", - "unlocalizedName": "item.bucketLava", - "localizedName": "Lava Bucket", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 328, - "legacyData": 0, - "id": "minecraft:minecart", - "unlocalizedName": "item.minecart", - "localizedName": "Minecart", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 329, - "legacyData": 0, - "id": "minecraft:saddle", - "unlocalizedName": "item.saddle", - "localizedName": "Saddle", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 330, - "legacyData": 0, - "id": "minecraft:iron_door", - "unlocalizedName": "item.doorIron", - "localizedName": "Iron Door", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 331, - "legacyData": 0, - "id": "minecraft:redstone", - "unlocalizedName": "item.redstone", - "localizedName": "Redstone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 332, - "legacyData": 0, - "id": "minecraft:snowball", - "unlocalizedName": "item.snowball", - "localizedName": "Snowball", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 333, - "legacyData": 0, - "id": "minecraft:boat", - "unlocalizedName": "item.boat.oak", - "localizedName": "Oak Boat", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 334, - "legacyData": 0, - "id": "minecraft:leather", - "unlocalizedName": "item.leather", - "localizedName": "Leather", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 335, - "legacyData": 0, - "id": "minecraft:milk_bucket", - "unlocalizedName": "item.milk", - "localizedName": "Milk", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 336, - "legacyData": 0, - "id": "minecraft:brick", - "unlocalizedName": "item.brick", - "localizedName": "Brick", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 337, - "legacyData": 0, - "id": "minecraft:clay_ball", - "unlocalizedName": "item.clay", - "localizedName": "Clay", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 338, - "legacyData": 0, - "id": "minecraft:reeds", - "unlocalizedName": "item.reeds", - "localizedName": "Sugar Canes", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 339, - "legacyData": 0, - "id": "minecraft:paper", - "unlocalizedName": "item.paper", - "localizedName": "Paper", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 340, - "legacyData": 0, - "id": "minecraft:book", - "unlocalizedName": "item.book", - "localizedName": "Book", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 341, - "legacyData": 0, - "id": "minecraft:slime_ball", - "unlocalizedName": "item.slimeball", - "localizedName": "Slimeball", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 342, - "legacyData": 0, - "id": "minecraft:chest_minecart", - "unlocalizedName": "item.minecartChest", - "localizedName": "Minecart with Chest", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 343, - "legacyData": 0, - "id": "minecraft:furnace_minecart", - "unlocalizedName": "item.minecartFurnace", - "localizedName": "Minecart with Furnace", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 344, - "legacyData": 0, - "id": "minecraft:egg", - "unlocalizedName": "item.egg", - "localizedName": "Egg", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 345, - "legacyData": 0, - "id": "minecraft:compass", - "unlocalizedName": "item.compass", - "localizedName": "Compass", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 346, - "legacyData": 0, - "id": "minecraft:fishing_rod", - "unlocalizedName": "item.fishingRod", - "localizedName": "Fishing Rod", - "maxDamage": 64, - "maxStackSize": 1 - }, - { - "legacyId": 347, - "legacyData": 0, - "id": "minecraft:clock", - "unlocalizedName": "item.clock", - "localizedName": "Clock", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 348, - "legacyData": 0, - "id": "minecraft:glowstone_dust", - "unlocalizedName": "item.yellowDust", - "localizedName": "Glowstone Dust", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 349, - "legacyData": 0, - "id": "minecraft:fish", - "unlocalizedName": "item.fish.cod.raw", - "localizedName": "Raw Fish", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 349, - "legacyData": 1, - "id": "minecraft:fish", - "unlocalizedName": "item.fish.salmon.raw", - "localizedName": "Raw Salmon", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 349, - "legacyData": 2, - "id": "minecraft:fish", - "unlocalizedName": "item.fish.clownfish.raw", - "localizedName": "Clownfish", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 349, - "legacyData": 3, - "id": "minecraft:fish", - "unlocalizedName": "item.fish.pufferfish.raw", - "localizedName": "Pufferfish", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 350, - "legacyData": 0, - "id": "minecraft:cooked_fish", - "unlocalizedName": "item.fish.cod.cooked", - "localizedName": "Cooked Fish", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 350, - "legacyData": 1, - "id": "minecraft:cooked_fish", - "unlocalizedName": "item.fish.salmon.cooked", - "localizedName": "Cooked Salmon", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 0, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.black", - "localizedName": "Ink Sac", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 1, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.red", - "localizedName": "Rose Red", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 2, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.green", - "localizedName": "Cactus Green", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 3, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.brown", - "localizedName": "Cocoa Beans", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 4, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.blue", - "localizedName": "Lapis Lazuli", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 5, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.purple", - "localizedName": "Purple Dye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 6, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.cyan", - "localizedName": "Cyan Dye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 7, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.silver", - "localizedName": "Light Gray Dye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 8, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.gray", - "localizedName": "Gray Dye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 9, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.pink", - "localizedName": "Pink Dye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 10, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.lime", - "localizedName": "Lime Dye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 11, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.yellow", - "localizedName": "Dandelion Yellow", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 12, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.lightBlue", - "localizedName": "Light Blue Dye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 13, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.magenta", - "localizedName": "Magenta Dye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 14, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.orange", - "localizedName": "Orange Dye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 351, - "legacyData": 15, - "id": "minecraft:dye", - "unlocalizedName": "item.dyePowder.white", - "localizedName": "Bone Meal", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 352, - "legacyData": 0, - "id": "minecraft:bone", - "unlocalizedName": "item.bone", - "localizedName": "Bone", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 353, - "legacyData": 0, - "id": "minecraft:sugar", - "unlocalizedName": "item.sugar", - "localizedName": "Sugar", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 354, - "legacyData": 0, - "id": "minecraft:cake", - "unlocalizedName": "item.cake", - "localizedName": "Cake", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 0, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.white", - "localizedName": "White Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 1, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.orange", - "localizedName": "Orange Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 2, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.magenta", - "localizedName": "Magenta Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 3, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.lightBlue", - "localizedName": "Light Blue Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 4, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.yellow", - "localizedName": "Yellow Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 5, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.lime", - "localizedName": "Lime Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 6, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.pink", - "localizedName": "Pink Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 7, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.gray", - "localizedName": "Gray Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 8, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.silver", - "localizedName": "Light Gray Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 9, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.cyan", - "localizedName": "Cyan Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 10, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.purple", - "localizedName": "Purple Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 11, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.blue", - "localizedName": "Blue Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 12, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.brown", - "localizedName": "Brown Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 13, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.green", - "localizedName": "Green Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 14, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.red", - "localizedName": "Red Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 355, - "legacyData": 15, - "id": "minecraft:bed", - "unlocalizedName": "item.bed.black", - "localizedName": "Black Bed", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 356, - "legacyData": 0, - "id": "minecraft:repeater", - "unlocalizedName": "item.diode", - "localizedName": "Redstone Repeater", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 357, - "legacyData": 0, - "id": "minecraft:cookie", - "unlocalizedName": "item.cookie", - "localizedName": "Cookie", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 358, - "legacyData": 0, - "id": "minecraft:filled_map", - "unlocalizedName": "item.map", - "localizedName": "Map", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 359, - "legacyData": 0, - "id": "minecraft:shears", - "unlocalizedName": "item.shears", - "localizedName": "Shears", - "maxDamage": 238, - "maxStackSize": 1 - }, - { - "legacyId": 360, - "legacyData": 0, - "id": "minecraft:melon", - "unlocalizedName": "item.melon", - "localizedName": "Melon", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 361, - "legacyData": 0, - "id": "minecraft:pumpkin_seeds", - "unlocalizedName": "item.seeds_pumpkin", - "localizedName": "Pumpkin Seeds", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 362, - "legacyData": 0, - "id": "minecraft:melon_seeds", - "unlocalizedName": "item.seeds_melon", - "localizedName": "Melon Seeds", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 363, - "legacyData": 0, - "id": "minecraft:beef", - "unlocalizedName": "item.beefRaw", - "localizedName": "Raw Beef", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 364, - "legacyData": 0, - "id": "minecraft:cooked_beef", - "unlocalizedName": "item.beefCooked", - "localizedName": "Steak", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 365, - "legacyData": 0, - "id": "minecraft:chicken", - "unlocalizedName": "item.chickenRaw", - "localizedName": "Raw Chicken", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 366, - "legacyData": 0, - "id": "minecraft:cooked_chicken", - "unlocalizedName": "item.chickenCooked", - "localizedName": "Cooked Chicken", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 367, - "legacyData": 0, - "id": "minecraft:rotten_flesh", - "unlocalizedName": "item.rottenFlesh", - "localizedName": "Rotten Flesh", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 368, - "legacyData": 0, - "id": "minecraft:ender_pearl", - "unlocalizedName": "item.enderPearl", - "localizedName": "Ender Pearl", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 369, - "legacyData": 0, - "id": "minecraft:blaze_rod", - "unlocalizedName": "item.blazeRod", - "localizedName": "Blaze Rod", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 370, - "legacyData": 0, - "id": "minecraft:ghast_tear", - "unlocalizedName": "item.ghastTear", - "localizedName": "Ghast Tear", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 371, - "legacyData": 0, - "id": "minecraft:gold_nugget", - "unlocalizedName": "item.goldNugget", - "localizedName": "Gold Nugget", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 372, - "legacyData": 0, - "id": "minecraft:nether_wart", - "unlocalizedName": "item.netherStalkSeeds", - "localizedName": "Nether Wart", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 373, - "legacyData": 0, - "id": "minecraft:potion", - "unlocalizedName": "item.potion", - "localizedName": "Uncraftable Potion", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 374, - "legacyData": 0, - "id": "minecraft:glass_bottle", - "unlocalizedName": "item.glassBottle", - "localizedName": "Glass Bottle", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 375, - "legacyData": 0, - "id": "minecraft:spider_eye", - "unlocalizedName": "item.spiderEye", - "localizedName": "Spider Eye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 376, - "legacyData": 0, - "id": "minecraft:fermented_spider_eye", - "unlocalizedName": "item.fermentedSpiderEye", - "localizedName": "Fermented Spider Eye", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 377, - "legacyData": 0, - "id": "minecraft:blaze_powder", - "unlocalizedName": "item.blazePowder", - "localizedName": "Blaze Powder", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 378, - "legacyData": 0, - "id": "minecraft:magma_cream", - "unlocalizedName": "item.magmaCream", - "localizedName": "Magma Cream", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 379, - "legacyData": 0, - "id": "minecraft:brewing_stand", - "unlocalizedName": "item.brewingStand", - "localizedName": "Brewing Stand", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 380, - "legacyData": 0, - "id": "minecraft:cauldron", - "unlocalizedName": "item.cauldron", - "localizedName": "Cauldron", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 381, - "legacyData": 0, - "id": "minecraft:ender_eye", - "unlocalizedName": "item.eyeOfEnder", - "localizedName": "Eye of Ender", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 382, - "legacyData": 0, - "id": "minecraft:speckled_melon", - "unlocalizedName": "item.speckledMelon", - "localizedName": "Glistering Melon", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 383, - "legacyData": 0, - "id": "minecraft:spawn_egg", - "unlocalizedName": "item.monsterPlacer", - "localizedName": "Spawn", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 384, - "legacyData": 0, - "id": "minecraft:experience_bottle", - "unlocalizedName": "item.expBottle", - "localizedName": "Bottle o\u0027 Enchanting", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 385, - "legacyData": 0, - "id": "minecraft:fire_charge", - "unlocalizedName": "item.fireball", - "localizedName": "Fire Charge", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 386, - "legacyData": 0, - "id": "minecraft:writable_book", - "unlocalizedName": "item.writingBook", - "localizedName": "Book and Quill", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 387, - "legacyData": 0, - "id": "minecraft:written_book", - "unlocalizedName": "item.writtenBook", - "localizedName": "Written Book", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 388, - "legacyData": 0, - "id": "minecraft:emerald", - "unlocalizedName": "item.emerald", - "localizedName": "Emerald", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 389, - "legacyData": 0, - "id": "minecraft:item_frame", - "unlocalizedName": "item.frame", - "localizedName": "Item Frame", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 390, - "legacyData": 0, - "id": "minecraft:flower_pot", - "unlocalizedName": "item.flowerPot", - "localizedName": "Flower Pot", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 391, - "legacyData": 0, - "id": "minecraft:carrot", - "unlocalizedName": "item.carrots", - "localizedName": "Carrot", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 392, - "legacyData": 0, - "id": "minecraft:potato", - "unlocalizedName": "item.potato", - "localizedName": "Potato", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 393, - "legacyData": 0, - "id": "minecraft:baked_potato", - "unlocalizedName": "item.potatoBaked", - "localizedName": "Baked Potato", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 394, - "legacyData": 0, - "id": "minecraft:poisonous_potato", - "unlocalizedName": "item.potatoPoisonous", - "localizedName": "Poisonous Potato", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 395, - "legacyData": 0, - "id": "minecraft:map", - "unlocalizedName": "item.emptyMap", - "localizedName": "Empty Map", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 396, - "legacyData": 0, - "id": "minecraft:golden_carrot", - "unlocalizedName": "item.carrotGolden", - "localizedName": "Golden Carrot", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 397, - "legacyData": 0, - "id": "minecraft:skull", - "unlocalizedName": "item.skull.skeleton", - "localizedName": "Skeleton Skull", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 397, - "legacyData": 1, - "id": "minecraft:skull", - "unlocalizedName": "item.skull.wither", - "localizedName": "Wither Skeleton Skull", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 397, - "legacyData": 2, - "id": "minecraft:skull", - "unlocalizedName": "item.skull.zombie", - "localizedName": "Zombie Head", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 397, - "legacyData": 3, - "id": "minecraft:skull", - "unlocalizedName": "item.skull.char", - "localizedName": "Head", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 397, - "legacyData": 4, - "id": "minecraft:skull", - "unlocalizedName": "item.skull.creeper", - "localizedName": "Creeper Head", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 397, - "legacyData": 5, - "id": "minecraft:skull", - "unlocalizedName": "item.skull.dragon", - "localizedName": "Dragon Head", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 398, - "legacyData": 0, - "id": "minecraft:carrot_on_a_stick", - "unlocalizedName": "item.carrotOnAStick", - "localizedName": "Carrot on a Stick", - "maxDamage": 25, - "maxStackSize": 1 - }, - { - "legacyId": 399, - "legacyData": 0, - "id": "minecraft:nether_star", - "unlocalizedName": "item.netherStar", - "localizedName": "Nether Star", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 400, - "legacyData": 0, - "id": "minecraft:pumpkin_pie", - "unlocalizedName": "item.pumpkinPie", - "localizedName": "Pumpkin Pie", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 401, - "legacyData": 0, - "id": "minecraft:fireworks", - "unlocalizedName": "item.fireworks", - "localizedName": "Firework Rocket", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 402, - "legacyData": 0, - "id": "minecraft:firework_charge", - "unlocalizedName": "item.fireworksCharge", - "localizedName": "Firework Star", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 403, - "legacyData": 0, - "id": "minecraft:enchanted_book", - "unlocalizedName": "item.enchantedBook", - "localizedName": "Enchanted Book", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 404, - "legacyData": 0, - "id": "minecraft:comparator", - "unlocalizedName": "item.comparator", - "localizedName": "Redstone Comparator", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 405, - "legacyData": 0, - "id": "minecraft:netherbrick", - "unlocalizedName": "item.netherbrick", - "localizedName": "Nether Brick", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 406, - "legacyData": 0, - "id": "minecraft:quartz", - "unlocalizedName": "item.netherquartz", - "localizedName": "Nether Quartz", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 407, - "legacyData": 0, - "id": "minecraft:tnt_minecart", - "unlocalizedName": "item.minecartTnt", - "localizedName": "Minecart with TNT", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 408, - "legacyData": 0, - "id": "minecraft:hopper_minecart", - "unlocalizedName": "item.minecartHopper", - "localizedName": "Minecart with Hopper", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 409, - "legacyData": 0, - "id": "minecraft:prismarine_shard", - "unlocalizedName": "item.prismarineShard", - "localizedName": "Prismarine Shard", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 410, - "legacyData": 0, - "id": "minecraft:prismarine_crystals", - "unlocalizedName": "item.prismarineCrystals", - "localizedName": "Prismarine Crystals", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 411, - "legacyData": 0, - "id": "minecraft:rabbit", - "unlocalizedName": "item.rabbitRaw", - "localizedName": "Raw Rabbit", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 412, - "legacyData": 0, - "id": "minecraft:cooked_rabbit", - "unlocalizedName": "item.rabbitCooked", - "localizedName": "Cooked Rabbit", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 413, - "legacyData": 0, - "id": "minecraft:rabbit_stew", - "unlocalizedName": "item.rabbitStew", - "localizedName": "Rabbit Stew", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 414, - "legacyData": 0, - "id": "minecraft:rabbit_foot", - "unlocalizedName": "item.rabbitFoot", - "localizedName": "Rabbit\u0027s Foot", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 415, - "legacyData": 0, - "id": "minecraft:rabbit_hide", - "unlocalizedName": "item.rabbitHide", - "localizedName": "Rabbit Hide", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 416, - "legacyData": 0, - "id": "minecraft:armor_stand", - "unlocalizedName": "item.armorStand", - "localizedName": "Armor Stand", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 417, - "legacyData": 0, - "id": "minecraft:iron_horse_armor", - "unlocalizedName": "item.horsearmormetal", - "localizedName": "Iron Horse Armor", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 418, - "legacyData": 0, - "id": "minecraft:golden_horse_armor", - "unlocalizedName": "item.horsearmorgold", - "localizedName": "Gold Horse Armor", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 419, - "legacyData": 0, - "id": "minecraft:diamond_horse_armor", - "unlocalizedName": "item.horsearmordiamond", - "localizedName": "Diamond Horse Armor", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 420, - "legacyData": 0, - "id": "minecraft:lead", - "unlocalizedName": "item.leash", - "localizedName": "Lead", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 421, - "legacyData": 0, - "id": "minecraft:name_tag", - "unlocalizedName": "item.nameTag", - "localizedName": "Name Tag", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 422, - "legacyData": 0, - "id": "minecraft:command_block_minecart", - "unlocalizedName": "item.minecartCommandBlock", - "localizedName": "Minecart with Command Block", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 423, - "legacyData": 0, - "id": "minecraft:mutton", - "unlocalizedName": "item.muttonRaw", - "localizedName": "Raw Mutton", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 424, - "legacyData": 0, - "id": "minecraft:cooked_mutton", - "unlocalizedName": "item.muttonCooked", - "localizedName": "Cooked Mutton", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 425, - "legacyData": 15, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "White Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 14, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Orange Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 13, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Magenta Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 12, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Light Blue Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 11, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Yellow Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 10, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Lime Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 9, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Pink Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 8, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Gray Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 7, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Light Gray Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 6, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Cyan Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 5, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Purple Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 4, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Blue Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 3, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Brown Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 2, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Green Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 1, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Red Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 425, - "legacyData": 0, - "id": "minecraft:banner", - "unlocalizedName": "tile.banner", - "localizedName": "Black Banner", - "maxDamage": 0, - "maxStackSize": 16 - }, - { - "legacyId": 426, - "legacyData": 0, - "id": "minecraft:end_crystal", - "unlocalizedName": "item.end_crystal", - "localizedName": "End Crystal", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 427, - "legacyData": 0, - "id": "minecraft:spruce_door", - "unlocalizedName": "item.doorSpruce", - "localizedName": "Spruce Door", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 428, - "legacyData": 0, - "id": "minecraft:birch_door", - "unlocalizedName": "item.doorBirch", - "localizedName": "Birch Door", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 429, - "legacyData": 0, - "id": "minecraft:jungle_door", - "unlocalizedName": "item.doorJungle", - "localizedName": "Jungle Door", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 430, - "legacyData": 0, - "id": "minecraft:acacia_door", - "unlocalizedName": "item.doorAcacia", - "localizedName": "Acacia Door", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 431, - "legacyData": 0, - "id": "minecraft:dark_oak_door", - "unlocalizedName": "item.doorDarkOak", - "localizedName": "Dark Oak Door", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 432, - "legacyData": 0, - "id": "minecraft:chorus_fruit", - "unlocalizedName": "item.chorusFruit", - "localizedName": "Chorus Fruit", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 433, - "legacyData": 0, - "id": "minecraft:chorus_fruit_popped", - "unlocalizedName": "item.chorusFruitPopped", - "localizedName": "Popped Chorus Fruit", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 434, - "legacyData": 0, - "id": "minecraft:beetroot", - "unlocalizedName": "item.beetroot", - "localizedName": "Beetroot", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 435, - "legacyData": 0, - "id": "minecraft:beetroot_seeds", - "unlocalizedName": "item.beetroot_seeds", - "localizedName": "Beetroot Seeds", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 436, - "legacyData": 0, - "id": "minecraft:beetroot_soup", - "unlocalizedName": "item.beetroot_soup", - "localizedName": "Beetroot Soup", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 437, - "legacyData": 0, - "id": "minecraft:dragon_breath", - "unlocalizedName": "item.dragon_breath", - "localizedName": "Dragon\u0027s Breath", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 438, - "legacyData": 0, - "id": "minecraft:splash_potion", - "unlocalizedName": "item.splash_potion", - "localizedName": "Splash Uncraftable Potion", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 439, - "legacyData": 0, - "id": "minecraft:spectral_arrow", - "unlocalizedName": "item.spectral_arrow", - "localizedName": "Spectral Arrow", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 440, - "legacyData": 0, - "id": "minecraft:tipped_arrow", - "unlocalizedName": "item.tipped_arrow", - "localizedName": "Uncraftable Tipped Arrow", - "maxDamage": 0, - "maxStackSize": 64 - }, - { - "legacyId": 441, - "legacyData": 0, - "id": "minecraft:lingering_potion", - "unlocalizedName": "item.lingering_potion", - "localizedName": "Lingering Uncraftable Potion", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 442, - "legacyData": 0, - "id": "minecraft:shield", - "unlocalizedName": "item.shield", - "localizedName": "Shield", - "maxDamage": 336, - "maxStackSize": 1 - }, - { - "legacyId": 443, - "legacyData": 0, - "id": "minecraft:elytra", - "unlocalizedName": "item.elytra", - "localizedName": "Elytra", - "maxDamage": 432, - "maxStackSize": 1 - }, - { - "legacyId": 444, - "legacyData": 0, - "id": "minecraft:spruce_boat", - "unlocalizedName": "item.boat.spruce", - "localizedName": "Spruce Boat", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 445, - "legacyData": 0, - "id": "minecraft:birch_boat", - "unlocalizedName": "item.boat.birch", - "localizedName": "Birch Boat", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 446, - "legacyData": 0, - "id": "minecraft:jungle_boat", - "unlocalizedName": "item.boat.jungle", - "localizedName": "Jungle Boat", - "maxDamage": 0, - "maxStackSize": 1 - }, - { - "legacyId": 447, - "legacyData": 0, "id": "minecraft:acacia_boat", - "unlocalizedName": "item.boat.acacia", - "localizedName": "Acacia Boat", - "maxDamage": 0, - "maxStackSize": 1 + "localizedName": "Acacia Boat" + }, + { + "id": "minecraft:acacia_button", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_door", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_fence", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_fence_gate", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_leaves", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_log", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_planks", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_pressure_plate", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_sapling", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_trapdoor", + "localizedName": "Air" + }, + { + "id": "minecraft:acacia_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:activator_rail", + "localizedName": "Air" + }, + { + "id": "minecraft:air", + "localizedName": "Air" + }, + { + "id": "minecraft:allium", + "localizedName": "Air" + }, + { + "id": "minecraft:andesite", + "localizedName": "Air" + }, + { + "id": "minecraft:anvil", + "localizedName": "Air" + }, + { + "id": "minecraft:apple", + "localizedName": "Apple" + }, + { + "id": "minecraft:armor_stand", + "localizedName": "Armor Stand" + }, + { + "id": "minecraft:arrow", + "localizedName": "Arrow" + }, + { + "id": "minecraft:azure_bluet", + "localizedName": "Air" + }, + { + "id": "minecraft:baked_potato", + "localizedName": "Baked Potato" + }, + { + "id": "minecraft:barrier", + "localizedName": "Air" + }, + { + "id": "minecraft:bat_spawn_egg", + "localizedName": "Bat Spawn Egg" + }, + { + "id": "minecraft:beacon", + "localizedName": "Air" + }, + { + "id": "minecraft:bedrock", + "localizedName": "Air" + }, + { + "id": "minecraft:beef", + "localizedName": "Raw Beef" + }, + { + "id": "minecraft:beetroot", + "localizedName": "Beetroot" + }, + { + "id": "minecraft:beetroot_seeds", + "localizedName": "Beetroot Seeds" + }, + { + "id": "minecraft:beetroot_soup", + "localizedName": "Beetroot Soup" + }, + { + "id": "minecraft:birch_boat", + "localizedName": "Birch Boat" + }, + { + "id": "minecraft:birch_button", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_door", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_fence", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_fence_gate", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_leaves", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_log", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_planks", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_pressure_plate", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_sapling", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_trapdoor", + "localizedName": "Air" + }, + { + "id": "minecraft:birch_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:black_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:black_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:black_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:black_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:black_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:black_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:black_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:black_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:black_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:black_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:black_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:blaze_powder", + "localizedName": "Blaze Powder" + }, + { + "id": "minecraft:blaze_rod", + "localizedName": "Blaze Rod" + }, + { + "id": "minecraft:blaze_spawn_egg", + "localizedName": "Blaze Spawn Egg" + }, + { + "id": "minecraft:blue_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_ice", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_orchid", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:blue_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:bone", + "localizedName": "Bone" + }, + { + "id": "minecraft:bone_block", + "localizedName": "Air" + }, + { + "id": "minecraft:bone_meal", + "localizedName": "Bone Meal" + }, + { + "id": "minecraft:book", + "localizedName": "Book" + }, + { + "id": "minecraft:bookshelf", + "localizedName": "Air" + }, + { + "id": "minecraft:bow", + "localizedName": "Bow" + }, + { + "id": "minecraft:bowl", + "localizedName": "Bowl" + }, + { + "id": "minecraft:brain_coral", + "localizedName": "Air" + }, + { + "id": "minecraft:brain_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:brain_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:bread", + "localizedName": "Bread" + }, + { + "id": "minecraft:brewing_stand", + "localizedName": "Air" + }, + { + "id": "minecraft:brick", + "localizedName": "Brick" + }, + { + "id": "minecraft:brick_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:brick_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_mushroom", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_mushroom_block", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:brown_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:bubble_coral", + "localizedName": "Air" + }, + { + "id": "minecraft:bubble_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:bubble_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:bucket", + "localizedName": "Bucket" + }, + { + "id": "minecraft:cactus", + "localizedName": "Air" + }, + { + "id": "minecraft:cactus_green", + "localizedName": "Cactus Green" + }, + { + "id": "minecraft:cake", + "localizedName": "Air" + }, + { + "id": "minecraft:carrot", + "localizedName": "Carrot" + }, + { + "id": "minecraft:carrot_on_a_stick", + "localizedName": "Carrot on a Stick" + }, + { + "id": "minecraft:carved_pumpkin", + "localizedName": "Air" + }, + { + "id": "minecraft:cauldron", + "localizedName": "Air" + }, + { + "id": "minecraft:cave_spider_spawn_egg", + "localizedName": "Cave Spider Spawn Egg" + }, + { + "id": "minecraft:chain_command_block", + "localizedName": "Air" + }, + { + "id": "minecraft:chainmail_boots", + "localizedName": "Chainmail Boots" + }, + { + "id": "minecraft:chainmail_chestplate", + "localizedName": "Chainmail Chestplate" + }, + { + "id": "minecraft:chainmail_helmet", + "localizedName": "Chainmail Helmet" + }, + { + "id": "minecraft:chainmail_leggings", + "localizedName": "Chainmail Leggings" + }, + { + "id": "minecraft:charcoal", + "localizedName": "Charcoal" + }, + { + "id": "minecraft:chest", + "localizedName": "Air" + }, + { + "id": "minecraft:chest_minecart", + "localizedName": "Minecart with Chest" + }, + { + "id": "minecraft:chicken", + "localizedName": "Raw Chicken" + }, + { + "id": "minecraft:chicken_spawn_egg", + "localizedName": "Chicken Spawn Egg" + }, + { + "id": "minecraft:chipped_anvil", + "localizedName": "Air" + }, + { + "id": "minecraft:chiseled_quartz_block", + "localizedName": "Air" + }, + { + "id": "minecraft:chiseled_red_sandstone", + "localizedName": "Air" + }, + { + "id": "minecraft:chiseled_sandstone", + "localizedName": "Air" + }, + { + "id": "minecraft:chiseled_stone_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:chorus_flower", + "localizedName": "Air" + }, + { + "id": "minecraft:chorus_fruit", + "localizedName": "Chorus Fruit" + }, + { + "id": "minecraft:chorus_plant", + "localizedName": "Air" + }, + { + "id": "minecraft:clay", + "localizedName": "Air" + }, + { + "id": "minecraft:clay_ball", + "localizedName": "Clay" + }, + { + "id": "minecraft:clock", + "localizedName": "Clock" + }, + { + "id": "minecraft:coal", + "localizedName": "Coal" + }, + { + "id": "minecraft:coal_block", + "localizedName": "Air" + }, + { + "id": "minecraft:coal_ore", + "localizedName": "Air" + }, + { + "id": "minecraft:coarse_dirt", + "localizedName": "Air" + }, + { + "id": "minecraft:cobblestone", + "localizedName": "Air" + }, + { + "id": "minecraft:cobblestone_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:cobblestone_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:cobblestone_wall", + "localizedName": "Air" + }, + { + "id": "minecraft:cobweb", + "localizedName": "Air" + }, + { + "id": "minecraft:cocoa_beans", + "localizedName": "Cocoa Beans" + }, + { + "id": "minecraft:cod", + "localizedName": "Raw Cod" + }, + { + "id": "minecraft:cod_bucket", + "localizedName": "Bucket of Cod" + }, + { + "id": "minecraft:cod_spawn_egg", + "localizedName": "Cod Spawn Egg" + }, + { + "id": "minecraft:command_block", + "localizedName": "Air" + }, + { + "id": "minecraft:command_block_minecart", + "localizedName": "Minecart with Command Block" + }, + { + "id": "minecraft:comparator", + "localizedName": "Air" + }, + { + "id": "minecraft:compass", + "localizedName": "Compass" + }, + { + "id": "minecraft:conduit", + "localizedName": "Air" + }, + { + "id": "minecraft:cooked_beef", + "localizedName": "Steak" + }, + { + "id": "minecraft:cooked_chicken", + "localizedName": "Cooked Chicken" + }, + { + "id": "minecraft:cooked_cod", + "localizedName": "Cooked Cod" + }, + { + "id": "minecraft:cooked_mutton", + "localizedName": "Cooked Mutton" + }, + { + "id": "minecraft:cooked_porkchop", + "localizedName": "Cooked Porkchop" + }, + { + "id": "minecraft:cooked_rabbit", + "localizedName": "Cooked Rabbit" + }, + { + "id": "minecraft:cooked_salmon", + "localizedName": "Cooked Salmon" + }, + { + "id": "minecraft:cookie", + "localizedName": "Cookie" + }, + { + "id": "minecraft:cow_spawn_egg", + "localizedName": "Cow Spawn Egg" + }, + { + "id": "minecraft:cracked_stone_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:crafting_table", + "localizedName": "Air" + }, + { + "id": "minecraft:creeper_head", + "localizedName": "Air" + }, + { + "id": "minecraft:creeper_spawn_egg", + "localizedName": "Creeper Spawn Egg" + }, + { + "id": "minecraft:cut_red_sandstone", + "localizedName": "Air" + }, + { + "id": "minecraft:cut_sandstone", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_dye", + "localizedName": "Cyan Dye" + }, + { + "id": "minecraft:cyan_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:cyan_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:damaged_anvil", + "localizedName": "Air" + }, + { + "id": "minecraft:dandelion", + "localizedName": "Air" + }, + { + "id": "minecraft:dandelion_yellow", + "localizedName": "Dandelion Yellow" }, { - "legacyId": 448, - "legacyData": 0, "id": "minecraft:dark_oak_boat", - "unlocalizedName": "item.boat.dark_oak", - "localizedName": "Dark Oak Boat", - "maxDamage": 0, - "maxStackSize": 1 + "localizedName": "Dark Oak Boat" }, { - "legacyId": 449, - "legacyData": 0, - "id": "minecraft:totem_of_undying", - "unlocalizedName": "item.totem", - "localizedName": "Totem of Undying", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:dark_oak_button", + "localizedName": "Air" }, { - "legacyId": 450, - "legacyData": 0, - "id": "minecraft:shulker_shell", - "unlocalizedName": "item.shulkerShell", - "localizedName": "Shulker Shell", - "maxDamage": 0, - "maxStackSize": 64 + "id": "minecraft:dark_oak_door", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_fence", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_fence_gate", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_leaves", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_log", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_planks", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_pressure_plate", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_sapling", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_trapdoor", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_oak_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_prismarine", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_prismarine_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:dark_prismarine_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:daylight_detector", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_brain_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_brain_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_bubble_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_bubble_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_bush", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_fire_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_fire_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_horn_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_horn_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_tube_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:dead_tube_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:debug_stick", + "localizedName": "Debug Stick" + }, + { + "id": "minecraft:detector_rail", + "localizedName": "Air" + }, + { + "id": "minecraft:diamond", + "localizedName": "Diamond" + }, + { + "id": "minecraft:diamond_axe", + "localizedName": "Diamond Axe" + }, + { + "id": "minecraft:diamond_block", + "localizedName": "Air" + }, + { + "id": "minecraft:diamond_boots", + "localizedName": "Diamond Boots" + }, + { + "id": "minecraft:diamond_chestplate", + "localizedName": "Diamond Chestplate" + }, + { + "id": "minecraft:diamond_helmet", + "localizedName": "Diamond Helmet" + }, + { + "id": "minecraft:diamond_hoe", + "localizedName": "Diamond Hoe" + }, + { + "id": "minecraft:diamond_horse_armor", + "localizedName": "Diamond Horse Armor" + }, + { + "id": "minecraft:diamond_leggings", + "localizedName": "Diamond Leggings" + }, + { + "id": "minecraft:diamond_ore", + "localizedName": "Air" + }, + { + "id": "minecraft:diamond_pickaxe", + "localizedName": "Diamond Pickaxe" + }, + { + "id": "minecraft:diamond_shovel", + "localizedName": "Diamond Shovel" + }, + { + "id": "minecraft:diamond_sword", + "localizedName": "Diamond Sword" + }, + { + "id": "minecraft:diorite", + "localizedName": "Air" + }, + { + "id": "minecraft:dirt", + "localizedName": "Air" + }, + { + "id": "minecraft:dispenser", + "localizedName": "Air" + }, + { + "id": "minecraft:dolphin_spawn_egg", + "localizedName": "Dolphin Spawn Egg" + }, + { + "id": "minecraft:donkey_spawn_egg", + "localizedName": "Donkey Spawn Egg" + }, + { + "id": "minecraft:dragon_breath", + "localizedName": "Dragon\u0027s Breath" + }, + { + "id": "minecraft:dragon_egg", + "localizedName": "Air" + }, + { + "id": "minecraft:dragon_head", + "localizedName": "Air" + }, + { + "id": "minecraft:dried_kelp", + "localizedName": "Dried Kelp" + }, + { + "id": "minecraft:dried_kelp_block", + "localizedName": "Air" + }, + { + "id": "minecraft:dropper", + "localizedName": "Air" + }, + { + "id": "minecraft:drowned_spawn_egg", + "localizedName": "Drowned Spawn Egg" + }, + { + "id": "minecraft:egg", + "localizedName": "Egg" + }, + { + "id": "minecraft:elder_guardian_spawn_egg", + "localizedName": "Elder Guardian Spawn Egg" + }, + { + "id": "minecraft:elytra", + "localizedName": "Elytra" + }, + { + "id": "minecraft:emerald", + "localizedName": "Emerald" + }, + { + "id": "minecraft:emerald_block", + "localizedName": "Air" + }, + { + "id": "minecraft:emerald_ore", + "localizedName": "Air" + }, + { + "id": "minecraft:enchanted_book", + "localizedName": "Enchanted Book" + }, + { + "id": "minecraft:enchanted_golden_apple", + "localizedName": "Enchanted Golden Apple" + }, + { + "id": "minecraft:enchanting_table", + "localizedName": "Air" + }, + { + "id": "minecraft:end_crystal", + "localizedName": "End Crystal" + }, + { + "id": "minecraft:end_portal_frame", + "localizedName": "Air" + }, + { + "id": "minecraft:end_rod", + "localizedName": "Air" + }, + { + "id": "minecraft:end_stone", + "localizedName": "Air" + }, + { + "id": "minecraft:end_stone_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:ender_chest", + "localizedName": "Air" + }, + { + "id": "minecraft:ender_eye", + "localizedName": "Eye of Ender" + }, + { + "id": "minecraft:ender_pearl", + "localizedName": "Ender Pearl" + }, + { + "id": "minecraft:enderman_spawn_egg", + "localizedName": "Enderman Spawn Egg" + }, + { + "id": "minecraft:endermite_spawn_egg", + "localizedName": "Endermite Spawn Egg" + }, + { + "id": "minecraft:evoker_spawn_egg", + "localizedName": "Evoker Spawn Egg" + }, + { + "id": "minecraft:experience_bottle", + "localizedName": "Bottle o\u0027 Enchanting" + }, + { + "id": "minecraft:farmland", + "localizedName": "Air" + }, + { + "id": "minecraft:feather", + "localizedName": "Feather" + }, + { + "id": "minecraft:fermented_spider_eye", + "localizedName": "Fermented Spider Eye" + }, + { + "id": "minecraft:fern", + "localizedName": "Air" + }, + { + "id": "minecraft:filled_map", + "localizedName": "Map" + }, + { + "id": "minecraft:fire_charge", + "localizedName": "Fire Charge" + }, + { + "id": "minecraft:fire_coral", + "localizedName": "Air" + }, + { + "id": "minecraft:fire_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:fire_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:firework_rocket", + "localizedName": "Firework Rocket" + }, + { + "id": "minecraft:firework_star", + "localizedName": "Firework Star" + }, + { + "id": "minecraft:fishing_rod", + "localizedName": "Fishing Rod" + }, + { + "id": "minecraft:flint", + "localizedName": "Flint" + }, + { + "id": "minecraft:flint_and_steel", + "localizedName": "Flint and Steel" + }, + { + "id": "minecraft:flower_pot", + "localizedName": "Air" + }, + { + "id": "minecraft:furnace", + "localizedName": "Air" + }, + { + "id": "minecraft:furnace_minecart", + "localizedName": "Minecart with Furnace" + }, + { + "id": "minecraft:ghast_spawn_egg", + "localizedName": "Ghast Spawn Egg" + }, + { + "id": "minecraft:ghast_tear", + "localizedName": "Ghast Tear" + }, + { + "id": "minecraft:glass", + "localizedName": "Air" + }, + { + "id": "minecraft:glass_bottle", + "localizedName": "Glass Bottle" + }, + { + "id": "minecraft:glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:glistering_melon_slice", + "localizedName": "Glistering Melon Slice" + }, + { + "id": "minecraft:glowstone", + "localizedName": "Air" + }, + { + "id": "minecraft:glowstone_dust", + "localizedName": "Glowstone Dust" + }, + { + "id": "minecraft:gold_block", + "localizedName": "Air" + }, + { + "id": "minecraft:gold_ingot", + "localizedName": "Gold Ingot" + }, + { + "id": "minecraft:gold_nugget", + "localizedName": "Gold Nugget" + }, + { + "id": "minecraft:gold_ore", + "localizedName": "Air" + }, + { + "id": "minecraft:golden_apple", + "localizedName": "Golden Apple" + }, + { + "id": "minecraft:golden_axe", + "localizedName": "Golden Axe" + }, + { + "id": "minecraft:golden_boots", + "localizedName": "Golden Boots" + }, + { + "id": "minecraft:golden_carrot", + "localizedName": "Golden Carrot" + }, + { + "id": "minecraft:golden_chestplate", + "localizedName": "Golden Chestplate" + }, + { + "id": "minecraft:golden_helmet", + "localizedName": "Golden Helmet" + }, + { + "id": "minecraft:golden_hoe", + "localizedName": "Golden Hoe" + }, + { + "id": "minecraft:golden_horse_armor", + "localizedName": "Golden Horse Armor" + }, + { + "id": "minecraft:golden_leggings", + "localizedName": "Golden Leggings" + }, + { + "id": "minecraft:golden_pickaxe", + "localizedName": "Golden Pickaxe" + }, + { + "id": "minecraft:golden_shovel", + "localizedName": "Golden Shovel" + }, + { + "id": "minecraft:golden_sword", + "localizedName": "Golden Sword" + }, + { + "id": "minecraft:granite", + "localizedName": "Air" + }, + { + "id": "minecraft:grass", + "localizedName": "Air" + }, + { + "id": "minecraft:grass_block", + "localizedName": "Air" + }, + { + "id": "minecraft:grass_path", + "localizedName": "Air" + }, + { + "id": "minecraft:gravel", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_dye", + "localizedName": "Gray Dye" + }, + { + "id": "minecraft:gray_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:gray_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:green_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:green_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:green_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:green_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:green_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:green_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:green_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:green_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:green_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:green_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:green_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:guardian_spawn_egg", + "localizedName": "Guardian Spawn Egg" + }, + { + "id": "minecraft:gunpowder", + "localizedName": "Gunpowder" + }, + { + "id": "minecraft:hay_block", + "localizedName": "Air" + }, + { + "id": "minecraft:heart_of_the_sea", + "localizedName": "Heart of the Sea" + }, + { + "id": "minecraft:heavy_weighted_pressure_plate", + "localizedName": "Air" + }, + { + "id": "minecraft:hopper", + "localizedName": "Air" + }, + { + "id": "minecraft:hopper_minecart", + "localizedName": "Minecart with Hopper" + }, + { + "id": "minecraft:horn_coral", + "localizedName": "Air" + }, + { + "id": "minecraft:horn_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:horn_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:horse_spawn_egg", + "localizedName": "Horse Spawn Egg" + }, + { + "id": "minecraft:husk_spawn_egg", + "localizedName": "Husk Spawn Egg" + }, + { + "id": "minecraft:ice", + "localizedName": "Air" + }, + { + "id": "minecraft:infested_chiseled_stone_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:infested_cobblestone", + "localizedName": "Air" + }, + { + "id": "minecraft:infested_cracked_stone_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:infested_mossy_stone_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:infested_stone", + "localizedName": "Air" + }, + { + "id": "minecraft:infested_stone_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:ink_sac", + "localizedName": "Ink Sac" + }, + { + "id": "minecraft:iron_axe", + "localizedName": "Iron Axe" + }, + { + "id": "minecraft:iron_bars", + "localizedName": "Air" + }, + { + "id": "minecraft:iron_block", + "localizedName": "Air" + }, + { + "id": "minecraft:iron_boots", + "localizedName": "Iron Boots" + }, + { + "id": "minecraft:iron_chestplate", + "localizedName": "Iron Chestplate" + }, + { + "id": "minecraft:iron_door", + "localizedName": "Air" + }, + { + "id": "minecraft:iron_helmet", + "localizedName": "Iron Helmet" + }, + { + "id": "minecraft:iron_hoe", + "localizedName": "Iron Hoe" + }, + { + "id": "minecraft:iron_horse_armor", + "localizedName": "Iron Horse Armor" + }, + { + "id": "minecraft:iron_ingot", + "localizedName": "Iron Ingot" + }, + { + "id": "minecraft:iron_leggings", + "localizedName": "Iron Leggings" }, { - "legacyId": 452, - "legacyData": 0, "id": "minecraft:iron_nugget", - "unlocalizedName": "item.ironNugget", - "localizedName": "Iron Nugget", - "maxDamage": 0, - "maxStackSize": 64 + "localizedName": "Iron Nugget" + }, + { + "id": "minecraft:iron_ore", + "localizedName": "Air" + }, + { + "id": "minecraft:iron_pickaxe", + "localizedName": "Iron Pickaxe" + }, + { + "id": "minecraft:iron_shovel", + "localizedName": "Iron Shovel" + }, + { + "id": "minecraft:iron_sword", + "localizedName": "Iron Sword" + }, + { + "id": "minecraft:iron_trapdoor", + "localizedName": "Air" + }, + { + "id": "minecraft:item_frame", + "localizedName": "Item Frame" + }, + { + "id": "minecraft:jack_o_lantern", + "localizedName": "Air" + }, + { + "id": "minecraft:jukebox", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_boat", + "localizedName": "Jungle Boat" + }, + { + "id": "minecraft:jungle_button", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_door", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_fence", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_fence_gate", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_leaves", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_log", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_planks", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_pressure_plate", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_sapling", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_trapdoor", + "localizedName": "Air" + }, + { + "id": "minecraft:jungle_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:kelp", + "localizedName": "Air" }, { - "legacyId": 453, - "legacyData": 0, "id": "minecraft:knowledge_book", - "unlocalizedName": "item.knowledgeBook", - "localizedName": "Knowledge Book", - "maxDamage": 0, - "maxStackSize": 1 + "localizedName": "Knowledge Book" }, { - "legacyId": 2256, - "legacyData": 0, - "id": "minecraft:record_13", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:ladder", + "localizedName": "Air" }, { - "legacyId": 2257, - "legacyData": 0, - "id": "minecraft:record_cat", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:lapis_block", + "localizedName": "Air" }, { - "legacyId": 2258, - "legacyData": 0, - "id": "minecraft:record_blocks", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:lapis_lazuli", + "localizedName": "Lapis Lazuli" }, { - "legacyId": 2259, - "legacyData": 0, - "id": "minecraft:record_chirp", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:lapis_ore", + "localizedName": "Air" }, { - "legacyId": 2260, - "legacyData": 0, - "id": "minecraft:record_far", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:large_fern", + "localizedName": "Air" }, { - "legacyId": 2261, - "legacyData": 0, - "id": "minecraft:record_mall", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:lava_bucket", + "localizedName": "Lava Bucket" }, { - "legacyId": 2262, - "legacyData": 0, - "id": "minecraft:record_mellohi", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:lead", + "localizedName": "Lead" }, { - "legacyId": 2263, - "legacyData": 0, - "id": "minecraft:record_stal", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:leather", + "localizedName": "Leather" }, { - "legacyId": 2264, - "legacyData": 0, - "id": "minecraft:record_strad", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:leather_boots", + "localizedName": "Leather Boots" }, { - "legacyId": 2265, - "legacyData": 0, - "id": "minecraft:record_ward", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:leather_chestplate", + "localizedName": "Leather Tunic" }, { - "legacyId": 2266, - "legacyData": 0, - "id": "minecraft:record_11", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:leather_helmet", + "localizedName": "Leather Cap" }, { - "legacyId": 2267, - "legacyData": 0, - "id": "minecraft:record_wait", - "unlocalizedName": "item.record", - "localizedName": "Music Disc", - "maxDamage": 0, - "maxStackSize": 1 + "id": "minecraft:leather_leggings", + "localizedName": "Leather Pants" + }, + { + "id": "minecraft:lever", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_dye", + "localizedName": "Light Blue Dye" + }, + { + "id": "minecraft:light_blue_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:light_blue_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_dye", + "localizedName": "Light Gray Dye" + }, + { + "id": "minecraft:light_gray_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:light_gray_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:light_weighted_pressure_plate", + "localizedName": "Air" + }, + { + "id": "minecraft:lilac", + "localizedName": "Air" + }, + { + "id": "minecraft:lily_pad", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_dye", + "localizedName": "Lime Dye" + }, + { + "id": "minecraft:lime_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:lime_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:lingering_potion", + "localizedName": "Lingering Potion" + }, + { + "id": "minecraft:llama_spawn_egg", + "localizedName": "Llama Spawn Egg" + }, + { + "id": "minecraft:magenta_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_dye", + "localizedName": "Magenta Dye" + }, + { + "id": "minecraft:magenta_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:magenta_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:magma_block", + "localizedName": "Air" + }, + { + "id": "minecraft:magma_cream", + "localizedName": "Magma Cream" + }, + { + "id": "minecraft:magma_cube_spawn_egg", + "localizedName": "Magma Cube Spawn Egg" + }, + { + "id": "minecraft:map", + "localizedName": "Empty Map" + }, + { + "id": "minecraft:melon", + "localizedName": "Air" + }, + { + "id": "minecraft:melon_seeds", + "localizedName": "Melon Seeds" + }, + { + "id": "minecraft:melon_slice", + "localizedName": "Melon Slice" + }, + { + "id": "minecraft:milk_bucket", + "localizedName": "Milk Bucket" + }, + { + "id": "minecraft:minecart", + "localizedName": "Minecart" + }, + { + "id": "minecraft:mooshroom_spawn_egg", + "localizedName": "Mooshroom Spawn Egg" + }, + { + "id": "minecraft:mossy_cobblestone", + "localizedName": "Air" + }, + { + "id": "minecraft:mossy_cobblestone_wall", + "localizedName": "Air" + }, + { + "id": "minecraft:mossy_stone_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:mule_spawn_egg", + "localizedName": "Mule Spawn Egg" + }, + { + "id": "minecraft:mushroom_stem", + "localizedName": "Air" + }, + { + "id": "minecraft:mushroom_stew", + "localizedName": "Mushroom Stew" + }, + { + "id": "minecraft:music_disc_11", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_13", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_blocks", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_cat", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_chirp", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_far", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_mall", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_mellohi", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_stal", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_strad", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_wait", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:music_disc_ward", + "localizedName": "Music Disc" + }, + { + "id": "minecraft:mutton", + "localizedName": "Raw Mutton" + }, + { + "id": "minecraft:mycelium", + "localizedName": "Air" + }, + { + "id": "minecraft:name_tag", + "localizedName": "Name Tag" + }, + { + "id": "minecraft:nautilus_shell", + "localizedName": "Nautilus Shell" + }, + { + "id": "minecraft:nether_brick", + "localizedName": "Nether Brick" + }, + { + "id": "minecraft:nether_brick_fence", + "localizedName": "Air" + }, + { + "id": "minecraft:nether_brick_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:nether_brick_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:nether_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:nether_quartz_ore", + "localizedName": "Air" + }, + { + "id": "minecraft:nether_star", + "localizedName": "Nether Star" + }, + { + "id": "minecraft:nether_wart", + "localizedName": "Nether Wart" + }, + { + "id": "minecraft:nether_wart_block", + "localizedName": "Air" + }, + { + "id": "minecraft:netherrack", + "localizedName": "Air" + }, + { + "id": "minecraft:note_block", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_boat", + "localizedName": "Oak Boat" + }, + { + "id": "minecraft:oak_button", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_door", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_fence", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_fence_gate", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_leaves", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_log", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_planks", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_pressure_plate", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_sapling", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_trapdoor", + "localizedName": "Air" + }, + { + "id": "minecraft:oak_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:observer", + "localizedName": "Air" + }, + { + "id": "minecraft:obsidian", + "localizedName": "Air" + }, + { + "id": "minecraft:ocelot_spawn_egg", + "localizedName": "Ocelot Spawn Egg" + }, + { + "id": "minecraft:orange_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_dye", + "localizedName": "Orange Dye" + }, + { + "id": "minecraft:orange_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_tulip", + "localizedName": "Air" + }, + { + "id": "minecraft:orange_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:oxeye_daisy", + "localizedName": "Air" + }, + { + "id": "minecraft:packed_ice", + "localizedName": "Air" + }, + { + "id": "minecraft:painting", + "localizedName": "Painting" + }, + { + "id": "minecraft:paper", + "localizedName": "Paper" + }, + { + "id": "minecraft:parrot_spawn_egg", + "localizedName": "Parrot Spawn Egg" + }, + { + "id": "minecraft:peony", + "localizedName": "Air" + }, + { + "id": "minecraft:petrified_oak_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:phantom_membrane", + "localizedName": "Phantom Membrane" + }, + { + "id": "minecraft:phantom_spawn_egg", + "localizedName": "Phantom Spawn Egg" + }, + { + "id": "minecraft:pig_spawn_egg", + "localizedName": "Pig Spawn Egg" + }, + { + "id": "minecraft:pink_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_dye", + "localizedName": "Pink Dye" + }, + { + "id": "minecraft:pink_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_tulip", + "localizedName": "Air" + }, + { + "id": "minecraft:pink_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:piston", + "localizedName": "Air" + }, + { + "id": "minecraft:player_head", + "localizedName": "Air" + }, + { + "id": "minecraft:podzol", + "localizedName": "Air" + }, + { + "id": "minecraft:poisonous_potato", + "localizedName": "Poisonous Potato" + }, + { + "id": "minecraft:polar_bear_spawn_egg", + "localizedName": "Polar Bear Spawn Egg" + }, + { + "id": "minecraft:polished_andesite", + "localizedName": "Air" + }, + { + "id": "minecraft:polished_diorite", + "localizedName": "Air" + }, + { + "id": "minecraft:polished_granite", + "localizedName": "Air" + }, + { + "id": "minecraft:popped_chorus_fruit", + "localizedName": "Popped Chorus Fruit" + }, + { + "id": "minecraft:poppy", + "localizedName": "Air" + }, + { + "id": "minecraft:porkchop", + "localizedName": "Raw Porkchop" + }, + { + "id": "minecraft:potato", + "localizedName": "Potato" + }, + { + "id": "minecraft:potion", + "localizedName": "Potion" + }, + { + "id": "minecraft:powered_rail", + "localizedName": "Air" + }, + { + "id": "minecraft:prismarine", + "localizedName": "Air" + }, + { + "id": "minecraft:prismarine_brick_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:prismarine_brick_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:prismarine_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:prismarine_crystals", + "localizedName": "Prismarine Crystals" + }, + { + "id": "minecraft:prismarine_shard", + "localizedName": "Prismarine Shard" + }, + { + "id": "minecraft:prismarine_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:prismarine_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:pufferfish", + "localizedName": "Pufferfish" + }, + { + "id": "minecraft:pufferfish_bucket", + "localizedName": "Bucket of Pufferfish" + }, + { + "id": "minecraft:pufferfish_spawn_egg", + "localizedName": "Pufferfish Spawn Egg" + }, + { + "id": "minecraft:pumpkin", + "localizedName": "Air" + }, + { + "id": "minecraft:pumpkin_pie", + "localizedName": "Pumpkin Pie" + }, + { + "id": "minecraft:pumpkin_seeds", + "localizedName": "Pumpkin Seeds" + }, + { + "id": "minecraft:purple_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_dye", + "localizedName": "Purple Dye" + }, + { + "id": "minecraft:purple_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:purple_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:purpur_block", + "localizedName": "Air" + }, + { + "id": "minecraft:purpur_pillar", + "localizedName": "Air" + }, + { + "id": "minecraft:purpur_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:purpur_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:quartz", + "localizedName": "Nether Quartz" + }, + { + "id": "minecraft:quartz_block", + "localizedName": "Air" + }, + { + "id": "minecraft:quartz_pillar", + "localizedName": "Air" + }, + { + "id": "minecraft:quartz_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:quartz_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:rabbit", + "localizedName": "Raw Rabbit" + }, + { + "id": "minecraft:rabbit_foot", + "localizedName": "Rabbit\u0027s Foot" + }, + { + "id": "minecraft:rabbit_hide", + "localizedName": "Rabbit Hide" + }, + { + "id": "minecraft:rabbit_spawn_egg", + "localizedName": "Rabbit Spawn Egg" + }, + { + "id": "minecraft:rabbit_stew", + "localizedName": "Rabbit Stew" + }, + { + "id": "minecraft:rail", + "localizedName": "Air" + }, + { + "id": "minecraft:red_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:red_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:red_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:red_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:red_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:red_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:red_mushroom", + "localizedName": "Air" + }, + { + "id": "minecraft:red_mushroom_block", + "localizedName": "Air" + }, + { + "id": "minecraft:red_nether_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:red_sand", + "localizedName": "Air" + }, + { + "id": "minecraft:red_sandstone", + "localizedName": "Air" + }, + { + "id": "minecraft:red_sandstone_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:red_sandstone_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:red_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:red_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:red_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:red_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:red_tulip", + "localizedName": "Air" + }, + { + "id": "minecraft:red_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:redstone", + "localizedName": "Air" + }, + { + "id": "minecraft:redstone_block", + "localizedName": "Air" + }, + { + "id": "minecraft:redstone_lamp", + "localizedName": "Air" + }, + { + "id": "minecraft:redstone_ore", + "localizedName": "Air" + }, + { + "id": "minecraft:redstone_torch", + "localizedName": "Air" + }, + { + "id": "minecraft:repeater", + "localizedName": "Air" + }, + { + "id": "minecraft:repeating_command_block", + "localizedName": "Air" + }, + { + "id": "minecraft:rose_bush", + "localizedName": "Air" + }, + { + "id": "minecraft:rose_red", + "localizedName": "Rose Red" + }, + { + "id": "minecraft:rotten_flesh", + "localizedName": "Rotten Flesh" + }, + { + "id": "minecraft:saddle", + "localizedName": "Saddle" + }, + { + "id": "minecraft:salmon", + "localizedName": "Raw Salmon" + }, + { + "id": "minecraft:salmon_bucket", + "localizedName": "Bucket of Salmon" + }, + { + "id": "minecraft:salmon_spawn_egg", + "localizedName": "Salmon Spawn Egg" + }, + { + "id": "minecraft:sand", + "localizedName": "Air" + }, + { + "id": "minecraft:sandstone", + "localizedName": "Air" + }, + { + "id": "minecraft:sandstone_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:sandstone_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:scute", + "localizedName": "Scute" + }, + { + "id": "minecraft:sea_lantern", + "localizedName": "Air" + }, + { + "id": "minecraft:sea_pickle", + "localizedName": "Air" + }, + { + "id": "minecraft:seagrass", + "localizedName": "Air" + }, + { + "id": "minecraft:shears", + "localizedName": "Shears" + }, + { + "id": "minecraft:sheep_spawn_egg", + "localizedName": "Sheep Spawn Egg" + }, + { + "id": "minecraft:shield", + "localizedName": "Shield" + }, + { + "id": "minecraft:shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:shulker_shell", + "localizedName": "Shulker Shell" + }, + { + "id": "minecraft:shulker_spawn_egg", + "localizedName": "Shulker Spawn Egg" + }, + { + "id": "minecraft:sign", + "localizedName": "Air" + }, + { + "id": "minecraft:silverfish_spawn_egg", + "localizedName": "Silverfish Spawn Egg" + }, + { + "id": "minecraft:skeleton_horse_spawn_egg", + "localizedName": "Skeleton Horse Spawn Egg" + }, + { + "id": "minecraft:skeleton_skull", + "localizedName": "Air" + }, + { + "id": "minecraft:skeleton_spawn_egg", + "localizedName": "Skeleton Spawn Egg" + }, + { + "id": "minecraft:slime_ball", + "localizedName": "Slimeball" + }, + { + "id": "minecraft:slime_block", + "localizedName": "Air" + }, + { + "id": "minecraft:slime_spawn_egg", + "localizedName": "Slime Spawn Egg" + }, + { + "id": "minecraft:smooth_quartz", + "localizedName": "Air" + }, + { + "id": "minecraft:smooth_red_sandstone", + "localizedName": "Air" + }, + { + "id": "minecraft:smooth_sandstone", + "localizedName": "Air" + }, + { + "id": "minecraft:smooth_stone", + "localizedName": "Air" + }, + { + "id": "minecraft:snow", + "localizedName": "Air" + }, + { + "id": "minecraft:snow_block", + "localizedName": "Air" + }, + { + "id": "minecraft:snowball", + "localizedName": "Snowball" + }, + { + "id": "minecraft:soul_sand", + "localizedName": "Air" + }, + { + "id": "minecraft:spawner", + "localizedName": "Air" + }, + { + "id": "minecraft:spectral_arrow", + "localizedName": "Spectral Arrow" + }, + { + "id": "minecraft:spider_eye", + "localizedName": "Spider Eye" + }, + { + "id": "minecraft:spider_spawn_egg", + "localizedName": "Spider Spawn Egg" + }, + { + "id": "minecraft:splash_potion", + "localizedName": "Splash Potion" + }, + { + "id": "minecraft:sponge", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_boat", + "localizedName": "Spruce Boat" + }, + { + "id": "minecraft:spruce_button", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_door", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_fence", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_fence_gate", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_leaves", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_log", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_planks", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_pressure_plate", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_sapling", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_trapdoor", + "localizedName": "Air" + }, + { + "id": "minecraft:spruce_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:squid_spawn_egg", + "localizedName": "Squid Spawn Egg" + }, + { + "id": "minecraft:stick", + "localizedName": "Stick" + }, + { + "id": "minecraft:sticky_piston", + "localizedName": "Air" + }, + { + "id": "minecraft:stone", + "localizedName": "Air" + }, + { + "id": "minecraft:stone_axe", + "localizedName": "Stone Axe" + }, + { + "id": "minecraft:stone_brick_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:stone_brick_stairs", + "localizedName": "Air" + }, + { + "id": "minecraft:stone_bricks", + "localizedName": "Air" + }, + { + "id": "minecraft:stone_button", + "localizedName": "Air" + }, + { + "id": "minecraft:stone_hoe", + "localizedName": "Stone Hoe" + }, + { + "id": "minecraft:stone_pickaxe", + "localizedName": "Stone Pickaxe" + }, + { + "id": "minecraft:stone_pressure_plate", + "localizedName": "Air" + }, + { + "id": "minecraft:stone_shovel", + "localizedName": "Stone Shovel" + }, + { + "id": "minecraft:stone_slab", + "localizedName": "Air" + }, + { + "id": "minecraft:stone_sword", + "localizedName": "Stone Sword" + }, + { + "id": "minecraft:stray_spawn_egg", + "localizedName": "Stray Spawn Egg" + }, + { + "id": "minecraft:string", + "localizedName": "String" + }, + { + "id": "minecraft:stripped_acacia_log", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_acacia_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_birch_log", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_birch_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_dark_oak_log", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_dark_oak_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_jungle_log", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_jungle_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_oak_log", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_oak_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_spruce_log", + "localizedName": "Air" + }, + { + "id": "minecraft:stripped_spruce_wood", + "localizedName": "Air" + }, + { + "id": "minecraft:structure_block", + "localizedName": "Air" + }, + { + "id": "minecraft:structure_void", + "localizedName": "Air" + }, + { + "id": "minecraft:sugar", + "localizedName": "Sugar" + }, + { + "id": "minecraft:sugar_cane", + "localizedName": "Air" + }, + { + "id": "minecraft:sunflower", + "localizedName": "Air" + }, + { + "id": "minecraft:tall_grass", + "localizedName": "Air" + }, + { + "id": "minecraft:terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:tipped_arrow", + "localizedName": "Tipped Arrow" + }, + { + "id": "minecraft:tnt", + "localizedName": "Air" + }, + { + "id": "minecraft:tnt_minecart", + "localizedName": "Minecart with TNT" + }, + { + "id": "minecraft:torch", + "localizedName": "Air" + }, + { + "id": "minecraft:totem_of_undying", + "localizedName": "Totem of Undying" + }, + { + "id": "minecraft:trapped_chest", + "localizedName": "Air" + }, + { + "id": "minecraft:trident", + "localizedName": "Trident" + }, + { + "id": "minecraft:tripwire_hook", + "localizedName": "Air" + }, + { + "id": "minecraft:tropical_fish", + "localizedName": "Tropical Fish" + }, + { + "id": "minecraft:tropical_fish_bucket", + "localizedName": "Bucket of Tropical Fish" + }, + { + "id": "minecraft:tropical_fish_spawn_egg", + "localizedName": "Tropical Fish Spawn Egg" + }, + { + "id": "minecraft:tube_coral", + "localizedName": "Air" + }, + { + "id": "minecraft:tube_coral_block", + "localizedName": "Air" + }, + { + "id": "minecraft:tube_coral_fan", + "localizedName": "Air" + }, + { + "id": "minecraft:turtle_egg", + "localizedName": "Air" + }, + { + "id": "minecraft:turtle_helmet", + "localizedName": "Turtle Shell" + }, + { + "id": "minecraft:turtle_spawn_egg", + "localizedName": "Turtle Spawn Egg" + }, + { + "id": "minecraft:vex_spawn_egg", + "localizedName": "Vex Spawn Egg" + }, + { + "id": "minecraft:villager_spawn_egg", + "localizedName": "Villager Spawn Egg" + }, + { + "id": "minecraft:vindicator_spawn_egg", + "localizedName": "Vindicator Spawn Egg" + }, + { + "id": "minecraft:vine", + "localizedName": "Air" + }, + { + "id": "minecraft:water_bucket", + "localizedName": "Water Bucket" + }, + { + "id": "minecraft:wet_sponge", + "localizedName": "Air" + }, + { + "id": "minecraft:wheat", + "localizedName": "Wheat" + }, + { + "id": "minecraft:wheat_seeds", + "localizedName": "Wheat Seeds" + }, + { + "id": "minecraft:white_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:white_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:white_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:white_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:white_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:white_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:white_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:white_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:white_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:white_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:white_tulip", + "localizedName": "Air" + }, + { + "id": "minecraft:white_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:witch_spawn_egg", + "localizedName": "Witch Spawn Egg" + }, + { + "id": "minecraft:wither_skeleton_skull", + "localizedName": "Air" + }, + { + "id": "minecraft:wither_skeleton_spawn_egg", + "localizedName": "Wither Skeleton Spawn Egg" + }, + { + "id": "minecraft:wolf_spawn_egg", + "localizedName": "Wolf Spawn Egg" + }, + { + "id": "minecraft:wooden_axe", + "localizedName": "Wooden Axe" + }, + { + "id": "minecraft:wooden_hoe", + "localizedName": "Wooden Hoe" + }, + { + "id": "minecraft:wooden_pickaxe", + "localizedName": "Wooden Pickaxe" + }, + { + "id": "minecraft:wooden_shovel", + "localizedName": "Wooden Shovel" + }, + { + "id": "minecraft:wooden_sword", + "localizedName": "Wooden Sword" + }, + { + "id": "minecraft:writable_book", + "localizedName": "Book and Quill" + }, + { + "id": "minecraft:written_book", + "localizedName": "Written Book" + }, + { + "id": "minecraft:yellow_banner", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_bed", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_carpet", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_concrete", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_concrete_powder", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_glazed_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_shulker_box", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_stained_glass", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_stained_glass_pane", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_terracotta", + "localizedName": "Air" + }, + { + "id": "minecraft:yellow_wool", + "localizedName": "Air" + }, + { + "id": "minecraft:zombie_head", + "localizedName": "Air" + }, + { + "id": "minecraft:zombie_horse_spawn_egg", + "localizedName": "Zombie Horse Spawn Egg" + }, + { + "id": "minecraft:zombie_pigman_spawn_egg", + "localizedName": "Zombie Pigman Spawn Egg" + }, + { + "id": "minecraft:zombie_spawn_egg", + "localizedName": "Zombie Spawn Egg" + }, + { + "id": "minecraft:zombie_villager_spawn_egg", + "localizedName": "Zombie Villager Spawn Egg" } ] \ No newline at end of file From 663dd1f4d887171a27df77032732cdfdb417918c Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 19 Jul 2018 22:41:26 +1000 Subject: [PATCH 47/74] Added an entity, weathertype, and gamemode registry. --- .../sk89q/worldedit/bukkit/BukkitEntity.java | 6 +- ...yType.java => BukkitEntityProperties.java} | 6 +- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 18 ++- .../sk89q/worldedit/bukkit/BukkitWorld.java | 47 ++++++ .../bukkit/adapter/impl/Spigot_v1_13_R1.class | Bin 19807 -> 20082 bytes .../command/util/CreatureButcher.java | 4 +- .../worldedit/command/util/EntityRemover.java | 26 ++-- .../sk89q/worldedit/entity/BaseEntity.java | 35 ++--- .../com/sk89q/worldedit/entity/Player.java | 14 +- ...{EntityType.java => EntityProperties.java} | 2 +- .../platform/AbstractPlayerActor.java | 11 +- .../extension/platform/PlayerProxy.java | 11 ++ .../extent/clipboard/io/SchematicReader.java | 3 +- .../function/entity/ExtentEntityCopy.java | 2 +- .../function/operation/ForwardExtentCopy.java | 4 +- .../registry/NamespacedRegistry.java | 47 ++---- .../sk89q/worldedit/registry/Registry.java | 69 +++++++++ .../worldedit/session/SessionManager.java | 3 +- .../com/sk89q/worldedit/world/NullWorld.java | 19 +++ .../java/com/sk89q/worldedit/world/World.java | 30 ++++ .../worldedit/world/entity/EntityType.java | 61 ++++++++ .../worldedit/world/entity/EntityTypes.java | 137 ++++++++++++++++++ .../worldedit/world/gamemode/GameMode.java | 57 ++++++++ .../worldedit/world/gamemode/GameModes.java | 47 ++++++ .../worldedit/world/weather/WeatherType.java | 57 ++++++++ .../worldedit/world/weather/WeatherTypes.java | 44 ++++++ .../sk89q/worldedit/forge/ForgeEntity.java | 11 +- ...tyType.java => ForgeEntityProperties.java} | 6 +- .../com/sk89q/worldedit/forge/ForgeWorld.java | 24 ++- .../sk89q/worldedit/sponge/SpongeEntity.java | 6 +- ...yType.java => SpongeEntityProperties.java} | 6 +- .../sk89q/worldedit/sponge/SpongePlayer.java | 13 ++ .../sk89q/worldedit/sponge/SpongeWorld.java | 36 ++++- 33 files changed, 747 insertions(+), 115 deletions(-) rename worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/{BukkitEntityType.java => BukkitEntityProperties.java} (96%) rename worldedit-core/src/main/java/com/sk89q/worldedit/entity/metadata/{EntityType.java => EntityProperties.java} (99%) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registry.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityType.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityTypes.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameMode.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameModes.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherType.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherTypes.java rename worldedit-forge/src/main/java/com/sk89q/worldedit/forge/{ForgeEntityType.java => ForgeEntityProperties.java} (95%) rename worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/{SpongeEntityType.java => SpongeEntityProperties.java} (95%) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java index 010ad55bc..085f6c8b8 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.entity.metadata.EntityType; +import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.NullWorld; @@ -105,8 +105,8 @@ class BukkitEntity implements Entity { @Override public T getFacet(Class cls) { org.bukkit.entity.Entity entity = entityRef.get(); - if (entity != null && EntityType.class.isAssignableFrom(cls)) { - return (T) new BukkitEntityType(entity); + if (entity != null && EntityProperties.class.isAssignableFrom(cls)) { + return (T) new BukkitEntityProperties(entity); } else { return null; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityType.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java similarity index 96% rename from worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityType.java rename to worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java index 67ec4d2c8..0e20172bd 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityType.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.bukkit; -import com.sk89q.worldedit.entity.metadata.EntityType; +import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.util.Enums; import org.bukkit.entity.Ambient; import org.bukkit.entity.Animals; @@ -44,14 +44,14 @@ import org.bukkit.entity.minecart.ExplosiveMinecart; import static com.google.common.base.Preconditions.checkNotNull; -class BukkitEntityType implements EntityType { +class BukkitEntityProperties implements EntityProperties { private static final org.bukkit.entity.EntityType armorStandType = Enums.findByValue(org.bukkit.entity.EntityType.class, "ARMOR_STAND"); private final Entity entity; - BukkitEntityType(Entity entity) { + BukkitEntityProperties(Entity entity) { checkNotNull(entity); this.entity = entity; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index eac2dc0af..7eed49eba 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -31,8 +31,9 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.gamemode.GameMode; +import com.sk89q.worldedit.world.gamemode.GameModes; import org.bukkit.Bukkit; -import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -126,6 +127,16 @@ public class BukkitPlayer extends AbstractPlayerActor { return new BukkitPlayerBlockBag(player); } + @Override + public GameMode getGameMode() { + return GameModes.get(player.getGameMode().name().toLowerCase()); + } + + @Override + public void setGameMode(GameMode gameMode) { + player.setGameMode(org.bukkit.GameMode.valueOf(gameMode.getId().toUpperCase())); + } + @Override public boolean hasPermission(String perm) { return (!plugin.getLocalConfiguration().noOpPermissions && player.isOp()) @@ -152,11 +163,6 @@ public class BukkitPlayer extends AbstractPlayerActor { return player; } - @Override - public boolean hasCreativeMode() { - return player.getGameMode() == GameMode.CREATIVE; - } - @Override public void floatAt(int x, int y, int z, boolean alwaysGlass) { if (alwaysGlass || !player.getAllowFlight()) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 12f2ca8b0..36dd574b9 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -38,6 +38,8 @@ import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.weather.WeatherType; +import com.sk89q.worldedit.world.weather.WeatherTypes; import org.bukkit.Effect; import org.bukkit.TreeType; import org.bukkit.World; @@ -348,6 +350,51 @@ public class BukkitWorld extends AbstractWorld { return true; } + @Override + public WeatherType getWeather() { + if (getWorld().isThundering()) { + return WeatherTypes.THUNDER_STORM; + } else if (getWorld().hasStorm()) { + return WeatherTypes.RAIN; + } + + return WeatherTypes.CLEAR; + } + + @Override + public long getRemainingWeatherDuration() { + return getWorld().getWeatherDuration(); + } + + @Override + public void setWeather(WeatherType weatherType) { + if (weatherType == WeatherTypes.THUNDER_STORM) { + getWorld().setThundering(true); + } else if (weatherType == WeatherTypes.RAIN) { + getWorld().setStorm(true); + } else { + getWorld().setStorm(false); + getWorld().setThundering(false); + } + } + + @Override + public void setWeather(WeatherType weatherType, long duration) { + // Who named these methods... + if (weatherType == WeatherTypes.THUNDER_STORM) { + getWorld().setThundering(true); + getWorld().setThunderDuration((int) duration); + getWorld().setWeatherDuration((int) duration); + } else if (weatherType == WeatherTypes.RAIN) { + getWorld().setStorm(true); + getWorld().setWeatherDuration((int) duration); + } else { + getWorld().setStorm(false); + getWorld().setThundering(false); + getWorld().setWeatherDuration((int) duration); + } + } + @Override public void simulateBlockMine(Vector pt) { getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).breakNaturally(); diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class index 3be81c1a3d8f72167fb23b2ee57a9aaf0588fcec..ccf0a882df1066b7906adcb9a49c20fd6acbe1f3 100644 GIT binary patch delta 6674 zcmZu$2YggT6Q7yA%U<4XAOr%rKtc-;QV0PA5^AJK3m`>^fDlNehZaOcIB6CTDG!h+ zC<=-NH4wN9V=0yiai4|dxYvSkd{&zM7Cwj1TW}2?@XPR^g)iWX7Bs{|8V^f< zL?}mP?j>oM;bnZq!ejWVG{@!jH49(I6BfRKZ)$u?`nRQdN1At~dC!aQ;|CUgh#y&y zgdc1C#DX^XsfC~6=N1?-_LLvL(D)?}@GFg9ThIZ&k>*=r`%VOWFRwqyf*(EDO5;x! zWZ_9+|Jj3S9&9aBzi2!q{jbvertx&FXt(aTMRCSa+Ayo`wTCnb$b8n-lI(rESudBQ22EH;C@Q2EjsI{ha3+BqQHk#T-0a3CAi{$+(P3d45T3=5Xw z5iey@CogrTE}FVputEahH`L8b-SNEGo@GG>U9G8yrk)n8p_ny#t9g8kz485Y!_nVbeROGdLf&@@MyLW}0oO=9Cb@xslT=6n6{ z65ZnEW`U+##oUD!meL}zzPDKG7rXn3owr%En3jmy1I5gx7A>RYV)YO89B)WX)dO*{ICB589crSL)L9gF2L3km3>6#NMY}bX z7}`U74g3bbBP81kt!8$7w8tAT6r@r^Ww_Z+kDjacQ91XG?c3a8_KE0-+RxH{1AoAu znw~TCJRLx2X6LqT)(0Vc!tDIq!u(;m6Ez()^a9>t;4e6>=|zJ(>5!qr#14GK&{2BH z(986Sp=0!_rsIZQqt^|cpxp>bHa3X22WyjI;0(QC=uLXd(A#uK(>sRVrS~*#72^8_ zo6!e`KBSK{eQf9x6n`4}ls>Z$)J;qJoW3yhr8Hl0gNgJtJKE4U^sT1v41G^OhzdW7 z<+5Sx`fmGTk|$a={fV7!=p_AYP@@MS!9LL_+AgS9tLqG$i4Z$s#`Lr~Q#)qNN}EzJ zzA&xFjOjCH%q_@cyM_A~X->%wzZ&|DemC?7{b}$XTx~CI?6@(yZ$Y6f`peL1I%5!# z5Zc%aO`8aV;b<9bfN|p1!QMLdMN`YKi34|*&I!{$hR)LkO&1MS&~AfuFj^}x3UR4X zq!i=CD3@{@6{a*o{X1#`bLE-%P6ljMw$p!!>F3l zM5`Zm;llcA?ljcTRR*c{awA-ysHmYp8kGa+5IiNwt{ z!&F}uDnAIRt?NPbcP#QkGNbyrykwH%}8 z7EYd))+cw)r0m?8MqRDAZ0=+?s-CiMuPRJ8YtYc!TU{eW#&9YtlW5Ot(9GLc^%GkE z5F``qV-1>m2C$o$md%!g5+W|HapGe37!wB~L|=gnjByXY)#HfoGy!dZ2LQDfCOt#XYTuO=9kr}B-uQT4E& zY8d00sI*YDeY{~kf1a9T)MVyoNK4{oqr1LvUeQ}QP;#{zY$Q47@~dqShJUcX@F zHX$x9Io{}3FQ#xx#5Tw;D4bk4KdqP34VynRe-470m|uvHm1w7@)wWl6h_*kE2&?;l z3p*hUNVId4>PKEVWsgg4Vl)d8c?fBV_PC@5(O0g@X93CotpkFax%=iJG&6u9hRTU@bbv*`3o$OU|bqL3K*qUUE3y$lwn9?KZQh zlVeHAxVEFw3a?bFZ(hm1c8MzbPNVKpcN?`z-DB_pjxOHMwfanlt8k5-+VP@mt<;XS z9qZWz8QRXyNKQQk-vYv~pdd=BJ>O@eq=Gv=7ijKl^E@99KycQ6B%=V&*>y6L{r~Wc z;TeE2a2_sjf03UsURA+FO9~gyo@H8Brjg7gCj}s87molE2V8<4K`MjrX3j~O*?W$8dp)4an`QLOc{Dv zkF8Jx9|kv%llLcT)seu%ZXx1`!Sau;=q_lsQ7 z9pLF|G9$1q)?*s5%oy}B=f5Rz;r%b4HM!EtQubL{HMwEcd?s4s2v&#Bi7TBZK5P1a zK6`;ReX*J}U1|AcpCQI$LlI`r?%dR|Efl+BtjDVkXCuasASZ+b9$_PF%p7jEvDWdJJUG8MK9_`Y}f$NP7xuFp2I4hhtm{%oZ9wuQjb40)tOu=N|AVc? zvm*T20T`GXfb>!rl$xjYH*Yh)qpV0vr<8%4kyWxfajO8^Z z0I`>yay+ZPKanAqimjk6ra?z+4LvZOquqwV*cPTUxC*fYtilY~gqiRFc6J;%nhl)5 zRc#6<>G!ApTJzV2;n(GW#@`mRi>>RZGS1m&vi8-NA&;rH`qZWtngK+?* zkekh38D9z$2Bsc`CP{n1?=FWt#!-IMjRBY_liUShQUE5W6my`aWV(E=08A}|X&elW zSST16CL<>p(Vvydz|&G;GWE|6rbD4@s5=qtT<5)896CISS_;G6hTxu ztj%GDH33)`1Y4-<9qI<5t`ES*Alxg|O%An4sG97pwRsbFf!oxz{=1{i_bz1-)3Bsd7tx*KYNldB{gdN4%oFQC19*=s0tJIU_urnuW zZ8#T$;#k`iy;nFG?871J z4K;BV&Spe);zM^1*C{s_@Bvup;3y7y;#|CmadaBuaUR~xpy41_A#XX(XI`wrR*3T! zUKQe8z!(;2B|v1@MTmE>bt|LloFCep1y8i|H%Q~c_~__5H5gI+J;ls&HYBj#j3^jc z=|-tX2fDJGYw_S9XMCnhwRcBLF@NDv~@9<9$l5h5;zAgMm%HXIJ#8t@WWMwv`^1w-^moi;W zX1(kjf=QBOugLHipPB*av7_QdiXduj5k!~68Uf$h0K6K2<3V^$CN?;zTrU$F0`Phe zP6)NgS-wfAMg9Q15r8*?@RrPMab`Bl%$5MW9e{U&@UBd3btbZ8Vru~23&8t9xLPK* zJ3DNXiR}USAP64{b!QP|l|v1N_(xJScFGOl)%OHFu6J?Gzr7}?#fUkq_jZpU& zK^z0FF1q%^w>e6c!goUh@I51}I6EExm4iS2cMdX`HsZbTg9EfK{dYKNCqV1Ox2iR0 zGd-Fwk8+J9Y|OA(j~f_r|3G`DEnyn)m0>w<BdZo3>IyW~GEkN5Vo85rCgd;g>4~ z4X!3AG9-wtevmik-&=7V_pzL0FHvV)8^-@1P*JK*cb{6JR;!iZBl!sA&l`&1rv}xe QNN3cNlBi|ns2#QZAFX-V9RL6T delta 6491 zcmZu#2Y6J)6Q7yAyS=>Igpd%(1xS(5QV2m>F0@dT7C?#+iV%wQ9t1=@iYSVL@&pVB z3KkHhNc1it7MfVFU>7U)ii!#XQvNe9A>{98zVCMT&Fsw1%>HI}H-9{cU#!RAYZv#v z001r3atpq}hopJf0v~R+a0@;X0VnWLjgMLQIBpg4HjPhsal6JRH9jST9U6CfahD8t z%j~Bu+=C?=pYh_e5g5X-5KApA!x9T3aIZAw7Cwj1TW~GD5R~DI7Vg9S79`;TjR&Pa zB$StgcUT%0co|=@@KtM>W1J{X5dUE6sb-yzj#g@Iwnf!ebVs z;l~<3v7iNhYT;-2xdld?JrTq&G#=*xeyQ;*3)OI8h^K-C!Un%525@iqwgc|FFfUg`FPrgf8!Zx&gvkZ z6J7tvwDV&11!*oybBP-QX^>+;6hVqyY&^MR0LW*Np-79OsD?$+R8v!o1*7pHFU4|C zwdCUf?;*tryS7DjDBeeYJgq4~Q(aBZX3MlpP0eC}sF4M?$aiy1*%mC4VGA!^&3K@e7A(O-K59j+ebk29 zYRa)-xrE(Nz(=`w+Jc~=b{6DNdrciQb+lk5b+TX;rfV%& zOWiG4M?Ez4)YQv@_0-#f4V15`5AO{1wO|weq^X~#>nzwz{Vmu+130=gP}86Yx}FAm zX^6z7K+{l7!C@9WDJE^F;hIKhy1{~-G}3}yG)hyUrqLGcp)nSe&{$35G~MWfSQ>9Z z7!PThplPB7B%&uq zv&@5>pPDvm+Qh}fZsj|Q57{2G-*rOM!}byLW909eHgooIMbWgSWPjvrihM-VqnaLb z!1{PeUi3b6ZRHItamO@8YbV1{(>6^{l(dblg)ZL5`|N(T)+U^S(}uRwlZKw69h!C; z+C{q!{06_Tj%yzEw4pszV(1xMkI=-v&zoouj~nQDmO>SusrJWlk+ESaHE8PQ%=^afQg!rz(2K1hx_vr&o9~$}y z*K-UF9ixv$Nmip|`$TQi_!Iin&}Y(o&J8xAFF3}Aj?s|18PlL~Jt%$ia- zZG4v9%-_6jT~*Jh`fP_vR7ngrqmosMR#zc3b+&41l+WJcpBVcFD^U%MN>vTnN!17; z+ur6kgEXyTNt?uD}_L9d^c457KzD_DnJ~~&xE!93=uYs=%hm~nvEBs2eThveS206e?>t+wDpP=T@r*<%| zvHei}#?i^@8ev>(@D^N%5Nj{48SB-myHPz`(L+X!RXEY2271qh_jEM$J}5_PpegQF8=BHwkerLL2*J zLamas$;W({ZKnic?UuEo?M-!jF}Y2zM~E0du4v%=8RL44MQ9{5?UZK6T=NiG+kLZI z+by#Wsrl+=`=6`~&j7VRLMbXbH9zQavt*C4C7AsRsuSv#lGj@p87#Cvxq2o$Hm(RE zmnYYq~dNhDyWtiwN%|^@Il@PEXMV=E2kCSZU=HMy6%t)xHzYd zJu)ZCE)1k*o`7!v;a5-)Bc+vZk1A_p!|9S_}k#+j|1j@Qj_3n;tyN9K#%d z5pWLv;r=}TJUr_HTm(z13UmKvS_h_)@Y2&l5dSof2+nY8In)*4hPy$u)vlO@h%%e! zqe2(!u%yUU>gvdIgsbf%xu(?>Eo*q?wbis}M^?0GN1tfn0>`p{+ooN{fGd&@LlkVO zCRrCF&|`AV-1XE3R{FVxwoV~I(k>MOALx$u@zuvHJy=I z3*(putg|-OVafm3z?JjAVs+KOV^zwrDyyc~Q!Q3vH4bKTxP<>ZSZV1YXfXKS+77U# z2din*m7ZUT8Dc%GFUss-`v!fl#Ow&$@wy|K%(xN6R3Lyyn21R%;bu>hF$Ktp9`E#d zh}L*jCuH9nV5+0@Wc#`uujqW6W!|Z#)2h;Gar7EGI^7jISw|ym?C9v#VL9XRy$-n! z9&cn!4S)nEDiLhg+$tS&u?aS1iAb1)X_(IY6$9figY_zihmn}cBNrq>0XE~28&Y8a zW?^%VP;-9RWMd1^(2d_4S2H5Lj!%hzmtZPHXl$vml}^CcysXAH8ry2j;l&XHnClq1 ztz#J*Il5C{$H*DrgX#PX5tv&rlGO{$BcKb6!FJdlyezw|%J6NKhBJ-LkW`XUN9@Fg z$HE%N85j6rmE(*XlHg9q84omsrH(V&F_!^$3DO@2KIR>JF^`QElO0PtV;8ZM$8WOp z9_~BX!}9#;4a>n4grQZyo#}U%LXUFjS>Si2`Q2e?yAN{0&}%pD=Gh9)*jw@%2iswy zvxOa4M+5LXKDtF)l|LOAWL?4D-AE?maL(1S1Cf-62SbxDt`$o$Cf0VkSRVn?ZBTf>sQuPM8g& z7*6ByYKCG6m48R6#=R|KfdpC*;S8pyF5zq;;oj7WS;$#OQvOgQEBD%2( zAsZPX`3|&KIJjVF2VoiZ!M=>`hAo z@B&BpmTJP)WEcLI?5!f(Q)GjVb&LKb%hq)Z!(y4miL|8PawwK^4E&xDPzY|T2uB!} zy_n(GWpF#Y#@!tX25-H1Izw{H#ktk4+pwzIaVsbsf(2ZV_EwEfUmkJoujF!th_0MB z9R6Zt43)g*ZLKWTI0%Q~aNsKn<7@=pz&lzKyW&V3#hDnux>$&#!G&Yk0y&r?g3h$D zJgi`jW2T&pjlg>WxTM^uar_0Ssc`~h=R5>7PRz|sJr5}wC!OJQVKUDpoWehTs_?R$ z#`F@yN3&7O(qCp=?oQtirWgj7!*WKMwO}RmT8iC zcLzKfez%k3Z7U;q>1a9R6l8?q9?`wB7-Gs{RRIgE48gr&xKF679jYzV)gib)3~PkC z)}gKw>e>)I5QgHQkk>op4MJWYf(OH}QK)$ib(2u@Lhw)+9v13mhq^_mn?vwO7#qa(I%xe<}<+Wcp4=$u3qBgqy(?TcW<2K;HW-y z#o1WII64i9I0tWH(C{W#A#WMZWm&AkR)yp|o>d_^pD`TCi>E@g=OQFJ*t(ffbuI`k z&Vo12`Rl83L1J87ttdtmKWl zfmFXMj_b^RsRgkNpUdDmKrr|=H*URjtbQpR3~&wGUf_3U@P9vdT+YZxdQ@D2`*Zzk z$(Nm5ooLkOS|3EYK(Gmy{e>ay?;;MZmrtBoxR_0igkHFW=P5{l4!D$QF39J9y57c7 za#zKrV*c$szk+v1W${kn_ce#Ana4THmutL}&+QC_f{wE1ZcTX4_D%SOpoJhqg)^fQy4a@(Pqf~19G2R#5CY5 z!&1DT)93;InuBW?LV)F$0g2@dNV_rt { - EntityType registryType = entity.getFacet(EntityType.class); + EntityProperties registryType = entity.getFacet(EntityProperties.class); if (registryType != null) { if (type.matches(registryType)) { entity.remove(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java index 4b8237400..5c853a2a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.entity; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.world.NbtValued; +import com.sk89q.worldedit.world.entity.EntityType; import javax.annotation.Nullable; @@ -41,27 +42,27 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class BaseEntity implements NbtValued { - private String id; + private EntityType type; private CompoundTag nbtData; /** * Create a new base entity. * - * @param id the entity type ID + * @param type the entity type * @param nbtData NBT data */ - public BaseEntity(String id, CompoundTag nbtData) { - setTypeId(id); + public BaseEntity(EntityType type, CompoundTag nbtData) { + this(type); setNbtData(nbtData); } /** * Create a new base entity with no NBT data. * - * @param id the entity type ID + * @param type the entity type */ - public BaseEntity(String id) { - setTypeId(id); + public BaseEntity(EntityType type) { + this.type = type; } /** @@ -71,7 +72,7 @@ public class BaseEntity implements NbtValued { */ public BaseEntity(BaseEntity other) { checkNotNull(other); - setTypeId(other.getTypeId()); + this.type = other.getType(); setNbtData(other.getNbtData()); } @@ -92,22 +93,12 @@ public class BaseEntity implements NbtValued { } /** - * Get the entity that determines the type of entity. + * Get the type of entity. * - * @return the entity ID + * @return the entity type */ - public String getTypeId() { - return id; - } - - /** - * Set the entity ID that determines the type of entity. - * - * @param id the id - */ - public void setTypeId(String id) { - checkNotNull(id); - this.id = id; + public EntityType getType() { + return this.type; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index 690eb027a..958f811fa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -29,6 +29,7 @@ import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.gamemode.GameMode; /** * Represents a player @@ -86,11 +87,18 @@ public interface Player extends Entity, Actor { BlockBag getInventoryBlockBag(); /** - * Return whether this actor has creative mode. + * Return this actor's game mode. * - * @return true if creative mode is enabled + * @return the game mode */ - boolean hasCreativeMode(); + GameMode getGameMode(); + + /** + * Sets the player to the given game mode. + * + * @param gameMode The game mode + */ + void setGameMode(GameMode gameMode); /** * Find a position for the actor to stand that is not inside a block. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/metadata/EntityType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/metadata/EntityProperties.java similarity index 99% rename from worldedit-core/src/main/java/com/sk89q/worldedit/entity/metadata/EntityType.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/entity/metadata/EntityProperties.java index 44bf37888..6e343ba84 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/metadata/EntityType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/metadata/EntityProperties.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.entity.metadata; /** * Describes various classes of entities. */ -public interface EntityType { +public interface EntityProperties { /** * Test whether the entity is a player-derived entity. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index 70d989efd..f30aeaa5b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -27,6 +27,8 @@ import com.sk89q.worldedit.blocks.BlockType; 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.gamemode.GameMode; +import com.sk89q.worldedit.world.gamemode.GameModes; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.Player; @@ -474,8 +476,13 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { } @Override - public boolean hasCreativeMode() { - return false; + public GameMode getGameMode() { + return GameModes.SURVIVAL; + } + + @Override + public void setGameMode(GameMode gameMode) { + } @SuppressWarnings("CloneDoesntCallSuperClone") diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 7c5cd3119..8b6af45d8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -29,6 +29,7 @@ import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.gamemode.GameMode; import javax.annotation.Nullable; @@ -144,4 +145,14 @@ class PlayerProxy extends AbstractPlayerActor { public SessionKey getSessionKey() { return basePlayer.getSessionKey(); } + + @Override + public GameMode getGameMode() { + return basePlayer.getGameMode(); + } + + @Override + public void setGameMode(GameMode gameMode) { + basePlayer.setGameMode(gameMode); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java index 29f2b3a1a..28918fda3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java @@ -42,6 +42,7 @@ import com.sk89q.worldedit.extent.clipboard.io.legacycompat.SignCompatibilityHan import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.entity.EntityTypes; import com.sk89q.worldedit.world.storage.NBTConversions; import java.io.IOException; @@ -256,7 +257,7 @@ public class SchematicReader implements ClipboardReader { Location location = NBTConversions.toLocation(clipboard, compound.getListTag("Pos"), compound.getListTag("Rotation")); if (!id.isEmpty()) { - BaseEntity state = new BaseEntity(id, compound); + BaseEntity state = new BaseEntity(EntityTypes.get(id), compound); clipboard.createEntity(location, state); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java index 58663ab3c..5fbda8908 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java @@ -167,7 +167,7 @@ public class ExtentEntityCopy implements EntityFunction { } } - return new BaseEntity(state.getTypeId(), builder.build()); + return new BaseEntity(state.getType(), builder.build()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java index e3c676914..c5c1b10a1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.function.operation; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Entity; -import com.sk89q.worldedit.entity.metadata.EntityType; +import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.CombinedRegionFunction; import com.sk89q.worldedit.function.RegionFunction; @@ -261,7 +261,7 @@ public class ForwardExtentCopy implements Operation { // Switch to entities.removeIf after Java 8 cutoff. Iterator entityIterator = entities.iterator(); while (entityIterator.hasNext()) { - EntityType type = entityIterator.next().getFacet(EntityType.class); + EntityProperties type = entityIterator.next().getFacet(EntityProperties.class); if (type != null && !type.isPasteable()) { entityIterator.remove(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java index 9ac26a808..d3b151f6e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java @@ -19,59 +19,38 @@ package com.sk89q.worldedit.registry; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Nullable; - import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; -public final class NamespacedRegistry implements Iterable { +import javax.annotation.Nullable; + +public final class NamespacedRegistry extends Registry { private static final String MINECRAFT_NAMESPACE = "minecraft"; - private final Map map = new HashMap<>(); - private final String name; + private final String defaultNamespace; public NamespacedRegistry(final String name) { - this.name = name; + this(name, MINECRAFT_NAMESPACE); + } + + public NamespacedRegistry(final String name, final String defaultNamespace) { + super(name); + this.defaultNamespace = defaultNamespace; } public @Nullable V get(final String key) { - checkState(key.equals(key.toLowerCase()), "key must be lowercase"); - return this.map.get(this.orDefaultNamespace(key)); + return super.get(this.orDefaultNamespace(key)); } public V register(final String key, final V value) { requireNonNull(key, "key"); - requireNonNull(value, "value"); checkState(key.indexOf(':') > -1, "key is not namespaced"); - checkState(key.equals(key.toLowerCase()), "key must be lowercase"); - checkState(!this.map.containsKey(key), "key '%s' already has an associated %s", key, this.name); - this.map.put(key, value); - return value; - } - - public Set keySet() { - return Collections.unmodifiableSet(this.map.keySet()); - } - - public Collection values() { - return Collections.unmodifiableCollection(this.map.values()); + return super.register(key, value); } private String orDefaultNamespace(final String key) { if (key.indexOf(':') == -1) { - return MINECRAFT_NAMESPACE + ':' + key; + return defaultNamespace + ':' + key; } return key; } - - @Override - public Iterator iterator() { - return this.map.values().iterator(); - } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registry.java new file mode 100644 index 000000000..7545068de --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registry.java @@ -0,0 +1,69 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.registry; + +import static com.google.common.base.Preconditions.checkState; +import static java.util.Objects.requireNonNull; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import javax.annotation.Nullable; + +public class Registry implements Iterable { + private final Map map = new HashMap<>(); + private final String name; + + public Registry(final String name) { + this.name = name; + } + + public @Nullable V get(final String key) { + checkState(key.equals(key.toLowerCase()), "key must be lowercase"); + return this.map.get(key); + } + + public V register(final String key, final V value) { + requireNonNull(key, "key"); + requireNonNull(value, "value"); + checkState(key.equals(key.toLowerCase()), "key must be lowercase"); + checkState(!this.map.containsKey(key), "key '%s' already has an associated %s", key, this.name); + this.map.put(key, value); + return value; + } + + public Set keySet() { + return Collections.unmodifiableSet(this.map.keySet()); + } + + public Collection values() { + return Collections.unmodifiableCollection(this.map.values()); + } + + @Override + public Iterator iterator() { + return this.map.values().iterator(); + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java index 887f45a3f..d59dc5eb0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java @@ -33,6 +33,7 @@ import com.sk89q.worldedit.session.storage.SessionStore; import com.sk89q.worldedit.session.storage.VoidStore; import com.sk89q.worldedit.util.concurrency.EvenMoreExecutors; import com.sk89q.worldedit.util.eventbus.Subscribe; +import com.sk89q.worldedit.world.gamemode.GameModes; import javax.annotation.Nullable; import java.io.File; @@ -186,7 +187,7 @@ public class SessionManager { session.setUseInventory(config.useInventory && !(config.useInventoryOverride && (owner.hasPermission("worldedit.inventory.unrestricted") - || (config.useInventoryCreativeOverride && (!(owner instanceof Player) || ((Player) owner).hasCreativeMode()))))); + || (config.useInventoryCreativeOverride && (!(owner instanceof Player) || ((Player) owner).getGameMode() == GameModes.CREATIVE))))); return session; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java index e108aa94c..4f7098f0e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -36,6 +36,7 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.weather.WeatherType; import java.util.Collections; import java.util.List; @@ -101,6 +102,24 @@ public class NullWorld extends AbstractWorld { return false; } + @Override + public WeatherType getWeather() { + return null; + } + + @Override + public long getRemainingWeatherDuration() { + return 0; + } + + @Override + public void setWeather(WeatherType weatherType) { + } + + @Override + public void setWeather(WeatherType weatherType, long duration) { + } + @Override public BlockState getBlock(Vector position) { return BlockTypes.AIR.getDefaultState(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index 5e03cfcd8..cf5ad39f7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -34,6 +34,7 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.TreeGenerator; +import com.sk89q.worldedit.world.weather.WeatherType; /** * Represents a world (dimension). @@ -202,6 +203,35 @@ public interface World extends Extent { */ boolean queueBlockBreakEffect(Platform server, Vector position, BlockType blockType, double priority); + /** + * Gets the weather type of the world. + * + * @return The weather + */ + WeatherType getWeather(); + + /** + * Gets the remaining weather duration. + * + * @return The weather duration + */ + long getRemainingWeatherDuration(); + + /** + * Sets the weather type of the world. + * + * @param weatherType The weather type + */ + void setWeather(WeatherType weatherType); + + /** + * Sets the weather type of the world. + * + * @param weatherType The weather type + * @param duration The duration of the weather + */ + void setWeather(WeatherType weatherType, long duration); + @Override boolean equals(Object other); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityType.java new file mode 100644 index 000000000..1f7cb5925 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityType.java @@ -0,0 +1,61 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.entity; + +import com.sk89q.worldedit.registry.NamespacedRegistry; + +public class EntityType { + + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("entity type"); + + private String id; + + public EntityType(String id) { + // If it has no namespace, assume minecraft. + if (!id.contains(":")) { + id = "minecraft:" + id; + } + this.id = id; + } + + public String getId() { + return this.id; + } + + /** + * Gets the name of this item, or the ID if the name cannot be found. + * + * @return The name, or ID + */ + public String getName() { + return getId(); + } + + @Override + public int hashCode() { + return this.id.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof EntityType && this.id.equals(((EntityType) obj).id); + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityTypes.java new file mode 100644 index 000000000..9c8d44210 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityTypes.java @@ -0,0 +1,137 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.entity; + +import javax.annotation.Nullable; + +public class EntityTypes { + + public static final EntityType AREA_EFFECT_CLOUD = register("minecraft:area_effect_cloud"); + public static final EntityType ARMOR_STAND = register("minecraft:armor_stand"); + public static final EntityType ARROW = register("minecraft:arrow"); + public static final EntityType BAT = register("minecraft:bat"); + public static final EntityType BLAZE = register("minecraft:blaze"); + public static final EntityType BOAT = register("minecraft:boat"); + public static final EntityType CAVE_SPIDER = register("minecraft:cave_spider"); + public static final EntityType CHEST_MINECART = register("minecraft:chest_minecart"); + public static final EntityType CHICKEN = register("minecraft:chicken"); + public static final EntityType COD = register("minecraft:cod"); + public static final EntityType COMMAND_BLOCK_MINECART = register("minecraft:command_block_minecart"); + public static final EntityType COW = register("minecraft:cow"); + public static final EntityType CREEPER = register("minecraft:creeper"); + public static final EntityType DOLPHIN = register("minecraft:dolphin"); + public static final EntityType DONKEY = register("minecraft:donkey"); + public static final EntityType DRAGON_FIREBALL = register("minecraft:dragon_fireball"); + public static final EntityType DROWNED = register("minecraft:drowned"); + public static final EntityType EGG = register("minecraft:egg"); + public static final EntityType ELDER_GUARDIAN = register("minecraft:elder_guardian"); + public static final EntityType END_CRYSTAL = register("minecraft:end_crystal"); + public static final EntityType ENDER_DRAGON = register("minecraft:ender_dragon"); + public static final EntityType ENDER_PEARL = register("minecraft:ender_pearl"); + public static final EntityType ENDERMAN = register("minecraft:enderman"); + public static final EntityType ENDERMITE = register("minecraft:endermite"); + public static final EntityType EVOKER = register("minecraft:evoker"); + public static final EntityType EVOKER_FANGS = register("minecraft:evoker_fangs"); + public static final EntityType EXPERIENCE_BOTTLE = register("minecraft:experience_bottle"); + public static final EntityType EXPERIENCE_ORB = register("minecraft:experience_orb"); + public static final EntityType EYE_OF_ENDER = register("minecraft:eye_of_ender"); + public static final EntityType FALLING_BLOCK = register("minecraft:falling_block"); + public static final EntityType FIREBALL = register("minecraft:fireball"); + public static final EntityType FIREWORK_ROCKET = register("minecraft:firework_rocket"); + public static final EntityType FISHING_BOBBER = register("minecraft:fishing_bobber"); + public static final EntityType FURNACE_MINECART = register("minecraft:furnace_minecart"); + public static final EntityType GHAST = register("minecraft:ghast"); + public static final EntityType GIANT = register("minecraft:giant"); + public static final EntityType GUARDIAN = register("minecraft:guardian"); + public static final EntityType HOPPER_MINECART = register("minecraft:hopper_minecart"); + public static final EntityType HORSE = register("minecraft:horse"); + public static final EntityType HUSK = register("minecraft:husk"); + public static final EntityType ILLUSIONER = register("minecraft:illusioner"); + public static final EntityType IRON_GOLEM = register("minecraft:iron_golem"); + public static final EntityType ITEM = register("minecraft:item"); + public static final EntityType ITEM_FRAME = register("minecraft:item_frame"); + public static final EntityType LEASH_KNOT = register("minecraft:leash_knot"); + public static final EntityType LIGHTNING_BOLT = register("minecraft:lightning_bolt"); + public static final EntityType LLAMA = register("minecraft:llama"); + public static final EntityType LLAMA_SPIT = register("minecraft:llama_spit"); + public static final EntityType MAGMA_CUBE = register("minecraft:magma_cube"); + public static final EntityType MINECART = register("minecraft:minecart"); + public static final EntityType MOOSHROOM = register("minecraft:mooshroom"); + public static final EntityType MULE = register("minecraft:mule"); + public static final EntityType OCELOT = register("minecraft:ocelot"); + public static final EntityType PAINTING = register("minecraft:painting"); + public static final EntityType PARROT = register("minecraft:parrot"); + public static final EntityType PHANTOM = register("minecraft:phantom"); + public static final EntityType PIG = register("minecraft:pig"); + public static final EntityType PLAYER = register("minecraft:player"); + public static final EntityType POLAR_BEAR = register("minecraft:polar_bear"); + public static final EntityType POTION = register("minecraft:potion"); + public static final EntityType PUFFERFISH = register("minecraft:pufferfish"); + public static final EntityType RABBIT = register("minecraft:rabbit"); + public static final EntityType SALMON = register("minecraft:salmon"); + public static final EntityType SHEEP = register("minecraft:sheep"); + public static final EntityType SHULKER = register("minecraft:shulker"); + public static final EntityType SHULKER_BULLET = register("minecraft:shulker_bullet"); + public static final EntityType SILVERFISH = register("minecraft:silverfish"); + public static final EntityType SKELETON = register("minecraft:skeleton"); + public static final EntityType SKELETON_HORSE = register("minecraft:skeleton_horse"); + public static final EntityType SLIME = register("minecraft:slime"); + public static final EntityType SMALL_FIREBALL = register("minecraft:small_fireball"); + public static final EntityType SNOW_GOLEM = register("minecraft:snow_golem"); + public static final EntityType SNOWBALL = register("minecraft:snowball"); + public static final EntityType SPAWNER_MINECART = register("minecraft:spawner_minecart"); + public static final EntityType SPECTRAL_ARROW = register("minecraft:spectral_arrow"); + public static final EntityType SPIDER = register("minecraft:spider"); + public static final EntityType SQUID = register("minecraft:squid"); + public static final EntityType STRAY = register("minecraft:stray"); + public static final EntityType TNT = register("minecraft:tnt"); + public static final EntityType TNT_MINECART = register("minecraft:tnt_minecart"); + public static final EntityType TRIDENT = register("minecraft:trident"); + public static final EntityType TROPICAL_FISH = register("minecraft:tropical_fish"); + public static final EntityType TURTLE = register("minecraft:turtle"); + public static final EntityType VEX = register("minecraft:vex"); + public static final EntityType VILLAGER = register("minecraft:villager"); + public static final EntityType VINDICATOR = register("minecraft:vindicator"); + public static final EntityType WITCH = register("minecraft:witch"); + public static final EntityType WITHER = register("minecraft:wither"); + public static final EntityType WITHER_SKELETON = register("minecraft:wither_skeleton"); + public static final EntityType WITHER_SKULL = register("minecraft:wither_skull"); + public static final EntityType WOLF = register("minecraft:wolf"); + public static final EntityType ZOMBIE = register("minecraft:zombie"); + public static final EntityType ZOMBIE_HORSE = register("minecraft:zombie_horse"); + public static final EntityType ZOMBIE_PIGMAN = register("minecraft:zombie_pigman"); + public static final EntityType ZOMBIE_VILLAGER = register("minecraft:zombie_villager"); + + private EntityTypes() { + } + + private static EntityType register(final String id) { + return register(new EntityType(id)); + } + + public static EntityType register(final EntityType entityType) { + return EntityType.REGISTRY.register(entityType.getId(), entityType); + } + + public static @Nullable EntityType get(final String id) { + return EntityType.REGISTRY.get(id); + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameMode.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameMode.java new file mode 100644 index 000000000..bb0d0d6cf --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameMode.java @@ -0,0 +1,57 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.gamemode; + +import com.sk89q.worldedit.registry.Registry; + +public class GameMode { + + public static final Registry REGISTRY = new Registry<>("game mode"); + + private String id; + + public GameMode(String id) { + this.id = id; + } + + public String getId() { + return this.id; + } + + /** + * Gets the name of this game mode, or the ID if the name cannot be found. + * + * @return The name, or ID + */ + public String getName() { + return getId(); + } + + @Override + public int hashCode() { + return this.id.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof GameMode && this.id.equals(((GameMode) obj).id); + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameModes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameModes.java new file mode 100644 index 000000000..ab5b9fc69 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameModes.java @@ -0,0 +1,47 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.gamemode; + +import javax.annotation.Nullable; + +public class GameModes { + + public static final GameMode NOT_SET = register(""); + public static final GameMode SURVIVAL = register("survival"); + public static final GameMode CREATIVE = register("creative"); + public static final GameMode ADVENTURE = register("adventure"); + public static final GameMode SPECTATOR = register("spectator"); + + private GameModes() { + } + + private static GameMode register(final String id) { + return register(new GameMode(id)); + } + + public static GameMode register(final GameMode gameMode) { + return GameMode.REGISTRY.register(gameMode.getId(), gameMode); + } + + public static @Nullable GameMode get(final String id) { + return GameMode.REGISTRY.get(id); + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherType.java new file mode 100644 index 000000000..dac65115f --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherType.java @@ -0,0 +1,57 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.weather; + +import com.sk89q.worldedit.registry.Registry; + +public class WeatherType { + + public static final Registry REGISTRY = new Registry<>("weather type"); + + private String id; + + public WeatherType(String id) { + this.id = id; + } + + public String getId() { + return this.id; + } + + /** + * Gets the name of this weather, or the ID if the name cannot be found. + * + * @return The name, or ID + */ + public String getName() { + return getId(); + } + + @Override + public int hashCode() { + return this.id.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof WeatherType && this.id.equals(((WeatherType) obj).id); + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherTypes.java new file mode 100644 index 000000000..1aa1c9f12 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherTypes.java @@ -0,0 +1,44 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.world.weather; + +import javax.annotation.Nullable; + +public class WeatherTypes { + + public static final WeatherType CLEAR = register("clear"); + public static final WeatherType RAIN = register("rain"); + public static final WeatherType THUNDER_STORM = register("thunder_storm"); + + private WeatherTypes() { + } + + private static WeatherType register(final String id) { + return register(new WeatherType(id)); + } + + public static WeatherType register(final WeatherType weatherType) { + return WeatherType.REGISTRY.register(weatherType.getId(), weatherType); + } + + public static @Nullable WeatherType get(final String id) { + return WeatherType.REGISTRY.get(id); + } +} diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java index efc32d43e..5d93dc942 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java @@ -22,10 +22,11 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; -import com.sk89q.worldedit.entity.metadata.EntityType; +import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.NullWorld; +import com.sk89q.worldedit.world.entity.EntityTypes; import net.minecraft.entity.EntityList; import net.minecraft.nbt.NBTTagCompound; @@ -40,7 +41,7 @@ class ForgeEntity implements Entity { ForgeEntity(net.minecraft.entity.Entity entity) { checkNotNull(entity); - this.entityRef = new WeakReference(entity); + this.entityRef = new WeakReference<>(entity); } @Override @@ -51,7 +52,7 @@ class ForgeEntity implements Entity { if (id != null) { NBTTagCompound tag = new NBTTagCompound(); entity.writeToNBT(tag); - return new BaseEntity(id, NBTConverter.fromNative(tag)); + return new BaseEntity(EntityTypes.get(id), NBTConverter.fromNative(tag)); } else { return null; } @@ -99,8 +100,8 @@ class ForgeEntity implements Entity { public T getFacet(Class cls) { net.minecraft.entity.Entity entity = entityRef.get(); if (entity != null) { - if (EntityType.class.isAssignableFrom(cls)) { - return (T) new ForgeEntityType(entity); + if (EntityProperties.class.isAssignableFrom(cls)) { + return (T) new ForgeEntityProperties(entity); } else { return null; } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityType.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java similarity index 95% rename from worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityType.java rename to worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java index 59d7c2eb3..d5e543ca9 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityType.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.entity.metadata.EntityType; +import com.sk89q.worldedit.entity.metadata.EntityProperties; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.IMerchant; @@ -45,11 +45,11 @@ import net.minecraft.entity.player.EntityPlayerMP; import static com.google.common.base.Preconditions.checkNotNull; -public class ForgeEntityType implements EntityType { +public class ForgeEntityProperties implements EntityProperties { private final Entity entity; - public ForgeEntityType(Entity entity) { + public ForgeEntityProperties(Entity entity) { checkNotNull(entity); this.entity = entity; } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 7a3400b82..86f458425 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -47,6 +47,7 @@ import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.registry.LegacyMapper; +import com.sk89q.worldedit.world.weather.WeatherType; import net.minecraft.block.Block; import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockOldLeaf; @@ -350,6 +351,27 @@ public class ForgeWorld extends AbstractWorld { return generator != null && generator.generate(getWorld(), random, ForgeAdapter.toBlockPos(position)); } + @Override + public WeatherType getWeather() { + // TODO Weather implementation + return null; + } + + @Override + public long getRemainingWeatherDuration() { + return 0; + } + + @Override + public void setWeather(WeatherType weatherType) { + + } + + @Override + public void setWeather(WeatherType weatherType, long duration) { + + } + @Override public BlockState getBlock(Vector position) { World world = getWorld(); @@ -421,7 +443,7 @@ public class ForgeWorld extends AbstractWorld { @Override public Entity createEntity(Location location, BaseEntity entity) { World world = getWorld(); - net.minecraft.entity.Entity createdEntity = EntityList.createEntityByIDFromName(new ResourceLocation(entity.getTypeId()), world); + net.minecraft.entity.Entity createdEntity = EntityList.createEntityByIDFromName(new ResourceLocation(entity.getType().getId()), world); if (createdEntity != null) { CompoundTag nativeTag = entity.getNbtData(); if (nativeTag != null) { diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java index 160c51c71..1ec0f3a85 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.sponge; import com.flowpowered.math.vector.Vector3d; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; -import com.sk89q.worldedit.entity.metadata.EntityType; +import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.NullWorld; @@ -90,8 +90,8 @@ class SpongeEntity implements Entity { public T getFacet(Class cls) { org.spongepowered.api.entity.Entity entity = entityRef.get(); if (entity != null) { - if (EntityType.class.isAssignableFrom(cls)) { - return (T) new SpongeEntityType(entity); + if (EntityProperties.class.isAssignableFrom(cls)) { + return (T) new SpongeEntityProperties(entity); } else { return null; } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityType.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityProperties.java similarity index 95% rename from worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityType.java rename to worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityProperties.java index 834994bc7..2c2fb8852 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityType.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntityProperties.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.sponge; import static com.google.common.base.Preconditions.checkNotNull; -import com.sk89q.worldedit.entity.metadata.EntityType; +import com.sk89q.worldedit.entity.metadata.EntityProperties; import org.spongepowered.api.data.key.Keys; import org.spongepowered.api.entity.Entity; import org.spongepowered.api.entity.ExperienceOrb; @@ -46,11 +46,11 @@ import org.spongepowered.api.text.Text; import java.util.Optional; -public class SpongeEntityType implements EntityType { +public class SpongeEntityProperties implements EntityProperties { private final Entity entity; - public SpongeEntityType(Entity entity) { + public SpongeEntityProperties(Entity entity) { checkNotNull(entity); this.entity = entity; } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index 0bfaa3b6f..cc79d3e5e 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -23,6 +23,8 @@ import com.flowpowered.math.vector.Vector3d; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.world.gamemode.GameMode; +import com.sk89q.worldedit.world.gamemode.GameModes; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; @@ -170,6 +172,17 @@ public class SpongePlayer extends AbstractPlayerActor { return null; } + @Override + public GameMode getGameMode() { + return GameModes.get(player.getGameModeData().type().get().getId()); + } + + @Override + public void setGameMode(GameMode gameMode) { + player.getGameModeData().type().set(Sponge.getRegistry().getType(org.spongepowered.api.entity.living.player.gamemode.GameMode.class, + gameMode.getId()).get()); + } + @Override public SessionKey getSessionKey() { return new SessionKeyImpl(player.getUniqueId(), player.getName()); diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index 0129d9d0e..c8bfc6366 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.sponge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.flowpowered.math.vector.Vector3d; import com.flowpowered.math.vector.Vector3i; import com.sk89q.worldedit.EditSession; @@ -27,15 +29,17 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.registry.state.Property; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.item.ItemTypes; +import com.sk89q.worldedit.world.weather.WeatherType; +import com.sk89q.worldedit.world.weather.WeatherTypes; import org.spongepowered.api.Sponge; import org.spongepowered.api.block.BlockSnapshot; import org.spongepowered.api.block.BlockState; @@ -49,15 +53,15 @@ import org.spongepowered.api.entity.EntityType; import org.spongepowered.api.entity.EntityTypes; import org.spongepowered.api.world.BlockChangeFlags; import org.spongepowered.api.world.World; +import org.spongepowered.api.world.weather.Weather; -import javax.annotation.Nullable; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * An adapter to Minecraft worlds for WorldEdit. @@ -266,7 +270,7 @@ public abstract class SpongeWorld extends AbstractWorld { public Entity createEntity(Location location, BaseEntity entity) { World world = getWorld(); - EntityType entityType = Sponge.getRegistry().getType(EntityType.class, entity.getTypeId()).get(); + EntityType entityType = Sponge.getRegistry().getType(EntityType.class, entity.getType().getId()).get(); Vector3d pos = new Vector3d(location.getX(), location.getY(), location.getZ()); org.spongepowered.api.entity.Entity newEnt = world.createEntity(entityType, pos); @@ -289,6 +293,26 @@ public abstract class SpongeWorld extends AbstractWorld { return null; } + @Override + public WeatherType getWeather() { + return WeatherTypes.get(getWorld().getWeather().getId()); + } + + @Override + public long getRemainingWeatherDuration() { + return getWorld().getRemainingDuration(); + } + + @Override + public void setWeather(WeatherType weatherType) { + getWorld().setWeather(Sponge.getRegistry().getType(Weather.class, weatherType.getId()).get()); + } + + @Override + public void setWeather(WeatherType weatherType, long duration) { + getWorld().setWeather(Sponge.getRegistry().getType(Weather.class, weatherType.getId()).get(), duration); + } + /** * Thrown when the reference to the world is lost. */ From 2239d14a01d08efea5deb92b9c39164d0a0bc338 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sat, 21 Jul 2018 20:35:23 +1000 Subject: [PATCH 48/74] Fixed //replace and masks with states. --- .../sk89q/worldedit/function/mask/BlockMask.java | 8 +++++++- .../worldedit/registry/state/AbstractProperty.java | 13 +++++++++++++ .../com/sk89q/worldedit/world/block/BlockState.java | 12 +++++++++--- 3 files changed, 29 insertions(+), 4 deletions(-) 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 772b64942..f44ce27e6 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 @@ -95,7 +95,13 @@ public class BlockMask extends AbstractExtentMask { @Override public boolean test(Vector vector) { BlockStateHolder block = getExtent().getBlock(vector); - return blocks.contains(block) || blocks.contains(block); + for (BlockStateHolder testBlock : blocks) { + if (testBlock.equalsFuzzy(block)) { + return true; + } + } + + return false; } @Nullable 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 905d0466b..8079bae0e 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 @@ -53,4 +53,17 @@ public abstract class AbstractProperty implements Property { checkState(this.name == null, "name already set"); this.name = name; } + + @Override + public int hashCode() { + return name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Property)) { + return false; + } + return getName().equals(((Property) obj).getName()); + } } 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 94159c223..7adfdded5 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 @@ -31,9 +31,12 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; +import java.util.Set; import java.util.stream.Collectors; /** @@ -167,7 +170,7 @@ public class BlockState implements BlockStateHolder { return false; } - List differingProperties = new ArrayList<>(); + Set differingProperties = new HashSet<>(); for (Object state : o.getStates().keySet()) { if (getState((Property) state) == null) { differingProperties.add((Property) state); @@ -179,8 +182,11 @@ public class BlockState implements BlockStateHolder { } } - for (Property property : differingProperties) { - if (!getState(property).equals(o.getState(property))) { + for (Property property : getStates().keySet()) { + if (differingProperties.contains(property)) { + continue; + } + if (!Objects.equals(getState(property), o.getState(property))) { return false; } } From 65420af09e5f71b1b1e8d42bdb0940b58f711559 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 22 Jul 2018 15:36:50 +1000 Subject: [PATCH 49/74] Fixed //fill and //rotate --- .../sk89q/worldedit/bukkit/BukkitAdapter.java | 45 ++++++++++++++++++- .../java/com/sk89q/worldedit/BlockVector.java | 6 +-- .../com/sk89q/worldedit/BlockVector2D.java | 6 +-- .../worldedit/command/ClipboardCommands.java | 14 +++--- .../worldedit/command/UtilityCommands.java | 7 +-- .../transform/BlockTransformExtent.java | 9 ++-- .../sk89q/worldedit/session/PasteBuilder.java | 7 +-- 7 files changed, 65 insertions(+), 29 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java index edfbb9c7e..4f41c7e94 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Function; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; @@ -32,6 +34,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.gamemode.GameMode; +import com.sk89q.worldedit.world.gamemode.GameModes; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import org.bukkit.Bukkit; @@ -39,8 +43,6 @@ import org.bukkit.Material; import org.bukkit.block.data.BlockData; import org.bukkit.inventory.ItemStack; -import static com.google.common.base.Preconditions.checkNotNull; - import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -238,6 +240,45 @@ public class BukkitAdapter { return Material.getMaterial(blockType.getId().replace("minecraft:", "").toUpperCase()); } + /** + * Create a WorldEdit GameMode from a Bukkit one. + * + * @param gameMode Bukkit GameMode + * @return WorldEdit GameMode + */ + public static GameMode adapt(org.bukkit.GameMode gameMode) { + checkNotNull(gameMode); + return GameModes.get(gameMode.name().toLowerCase()); + } + + /** + * Converts a Material to a BlockType + * + * @param material The material + * @return The blocktype + */ + public static BlockType asBlockType(Material material) { + checkNotNull(material); + if (!material.isBlock()) { + throw new IllegalArgumentException(material.getKey().toString() + " is not a block!"); + } + return BlockTypes.get(material.getKey().toString()); + } + + /** + * Converts a Material to a ItemType + * + * @param material The material + * @return The itemtype + */ + public static ItemType asItemType(Material material) { + checkNotNull(material); + if (!material.isItem()) { + throw new IllegalArgumentException(material.getKey().toString() + " is not an item!"); + } + return ItemTypes.get(material.getKey().toString()); + } + private static Map blockStateCache = new HashMap<>(); /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector.java index c444d80d1..633bab3eb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector.java @@ -37,7 +37,7 @@ public class BlockVector extends Vector { * @param position the other position */ public BlockVector(Vector position) { - super(position); + this(position.getBlockX(), position.getBlockY(), position.getBlockZ()); } /** @@ -59,7 +59,7 @@ public class BlockVector extends Vector { * @param z the Z coordinate */ public BlockVector(float x, float y, float z) { - super(x, y, z); + this((int) x, (int) y, (int) z); } /** @@ -70,7 +70,7 @@ public class BlockVector extends Vector { * @param z the Z coordinate */ public BlockVector(double x, double y, double z) { - super(x, y, z); + this((int) x, (int) y, (int) z); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector2D.java index 07d54430b..cdf0cb36a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector2D.java @@ -36,7 +36,7 @@ public class BlockVector2D extends Vector2D { * @param position the position to copy */ public BlockVector2D(Vector2D position) { - super(position); + this(position.getBlockX(), position.getBlockZ()); } /** @@ -56,7 +56,7 @@ public class BlockVector2D extends Vector2D { * @param z the Z coordinate */ public BlockVector2D(float x, float z) { - super(x, z); + this((int) x, (int) z); } /** @@ -66,7 +66,7 @@ public class BlockVector2D extends Vector2D { * @param z the Z coordinate */ public BlockVector2D(double x, double z) { - super(x, z); + this((int) x, (int) z); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 3feca48b5..284550e93 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -19,10 +19,18 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.PLACEMENT; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; @@ -43,10 +51,6 @@ import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.PLACEMENT; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; - /** * Clipboard commands. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 8230d1e87..3fa96d9d8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -104,12 +104,7 @@ public class UtilityCommands { int depth = args.argsLength() > 2 ? Math.max(1, args.getInteger(2)) : 1; Vector pos = session.getPlacementPosition(player); - int affected; - if (pattern instanceof BlockPattern) { - affected = editSession.fillXZ(pos, ((BlockPattern) pattern).getBlock(), radius, depth, false); - } else { - affected = editSession.fillXZ(pos, pattern, radius, depth, false); - } + int affected = editSession.fillXZ(pos, pattern, radius, depth, false); player.print(affected + " block(s) have been created."); } 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 4ff6771c4..06f36079f 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 @@ -74,8 +74,7 @@ public class BlockTransformExtent extends AbstractDelegateExtent { * @return the same block */ private T transformBlock(T block, boolean reverse) { - transform(block, reverse ? transform.inverse() : transform); - return block; + return transform(block, reverse ? transform.inverse() : transform); } @Override @@ -126,11 +125,11 @@ public class BlockTransformExtent extends AbstractDelegateExtent { for (Property property : block.getBlockType().getProperties()) { if (property instanceof DirectionalProperty) { - Vector value = (Vector) block.getState(property); + Direction value = (Direction) block.getState(property); if (value != null) { - Vector newValue = getNewStateValue((DirectionalProperty) property, transform, value); + Vector newValue = getNewStateValue((DirectionalProperty) property, transform, value.toVector()); if (newValue != null) { - changedBlock.with(property, newValue); + changedBlock = (T) changedBlock.with(property, Direction.findClosest(newValue, Direction.Flag.ALL)); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java index 3fcce7100..e4a9ade5a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java @@ -19,9 +19,9 @@ package com.sk89q.worldedit.session; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.transform.BlockTransformExtent; @@ -29,9 +29,6 @@ import com.sk89q.worldedit.function.mask.ExistingBlockMask; import com.sk89q.worldedit.function.operation.ForwardExtentCopy; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.math.transform.Transform; -import com.sk89q.worldedit.world.registry.Registries; - -import static com.google.common.base.Preconditions.checkNotNull; /** * Builds an operation to paste the contents of a clipboard. From af74627b69894b0e7fc9ec267fa5557dbe9e34c8 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 22 Jul 2018 20:41:37 +1000 Subject: [PATCH 50/74] Switch to release 1.13 API --- worldedit-bukkit/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 7232b2648..447f3f447 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -10,7 +10,7 @@ repositories { dependencies { compile project(':worldedit-core') compile 'com.sk89q:dummypermscompat:1.8' - compile 'org.bukkit:bukkit:1.13-pre7-R0.1-SNAPSHOT' // zzz + compile 'org.bukkit:bukkit:1.13-R0.1-SNAPSHOT' // zzz testCompile 'org.mockito:mockito-core:1.9.0-rc1' } From 5f551d1ed44bc214e0dd9a5dc155f066e78e0309 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 23 Jul 2018 11:05:33 +1000 Subject: [PATCH 51/74] Include default blockstate information. --- .../worldedit/world/block/BlockType.java | 10 + .../worldedit/world/block/BlockTypes.java | 684 +++++++++--------- 2 files changed, 356 insertions(+), 338 deletions(-) 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 70584f54a..506c05ac0 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 @@ -108,6 +108,16 @@ public class BlockType { return ImmutableList.copyOf(this.getPropertyMap().values()); } + /** + * Gets a property by name. + * + * @param name The name + * @return The property + */ + public Property getProperty(String name) { + return getPropertyMap().get(name); + } + /** * Gets the default state of this block type. * 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 f2352d189..d8bc3d84a 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 @@ -19,6 +19,10 @@ package com.sk89q.worldedit.world.block; +import com.sk89q.worldedit.util.Direction; + +import java.util.function.Function; + import javax.annotation.Nullable; /** @@ -26,252 +30,252 @@ import javax.annotation.Nullable; */ public final class BlockTypes { - public static final BlockType ACACIA_BUTTON = register("minecraft:acacia_button"); - public static final BlockType ACACIA_DOOR = register("minecraft:acacia_door"); - public static final BlockType ACACIA_FENCE = register("minecraft:acacia_fence"); - public static final BlockType ACACIA_FENCE_GATE = register("minecraft:acacia_fence_gate"); - public static final BlockType ACACIA_LEAVES = register("minecraft:acacia_leaves"); - public static final BlockType ACACIA_LOG = register("minecraft:acacia_log"); + public static final BlockType ACACIA_BUTTON = register("minecraft:acacia_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType ACACIA_DOOR = register("minecraft:acacia_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType ACACIA_FENCE = register("minecraft:acacia_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + public static final BlockType ACACIA_FENCE_GATE = register("minecraft:acacia_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType ACACIA_LEAVES = register("minecraft:acacia_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + public static final BlockType ACACIA_LOG = register("minecraft:acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); public static final BlockType ACACIA_PLANKS = register("minecraft:acacia_planks"); - public static final BlockType ACACIA_PRESSURE_PLATE = register("minecraft:acacia_pressure_plate"); - public static final BlockType ACACIA_SAPLING = register("minecraft:acacia_sapling"); - public static final BlockType ACACIA_SLAB = register("minecraft:acacia_slab"); - public static final BlockType ACACIA_STAIRS = register("minecraft:acacia_stairs"); - public static final BlockType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor"); - public static final BlockType ACACIA_WOOD = register("minecraft:acacia_wood"); - public static final BlockType ACTIVATOR_RAIL = register("minecraft:activator_rail"); + public static final BlockType ACACIA_PRESSURE_PLATE = register("minecraft:acacia_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType ACACIA_SAPLING = register("minecraft:acacia_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + public static final BlockType ACACIA_SLAB = register("minecraft:acacia_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType ACACIA_STAIRS = register("minecraft:acacia_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType ACACIA_WOOD = register("minecraft:acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType ACTIVATOR_RAIL = register("minecraft:activator_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); public static final BlockType AIR = register("minecraft:air"); public static final BlockType ALLIUM = register("minecraft:allium"); public static final BlockType ANDESITE = register("minecraft:andesite"); - public static final BlockType ANVIL = register("minecraft:anvil"); - public static final BlockType ATTACHED_MELON_STEM = register("minecraft:attached_melon_stem"); - public static final BlockType ATTACHED_PUMPKIN_STEM = register("minecraft:attached_pumpkin_stem"); + public static final BlockType ANVIL = register("minecraft:anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType ATTACHED_MELON_STEM = register("minecraft:attached_melon_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType ATTACHED_PUMPKIN_STEM = register("minecraft:attached_pumpkin_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType AZURE_BLUET = register("minecraft:azure_bluet"); public static final BlockType BARRIER = register("minecraft:barrier"); public static final BlockType BEACON = register("minecraft:beacon"); public static final BlockType BEDROCK = register("minecraft:bedrock"); - public static final BlockType BEETROOTS = register("minecraft:beetroots"); - public static final BlockType BIRCH_BUTTON = register("minecraft:birch_button"); - public static final BlockType BIRCH_DOOR = register("minecraft:birch_door"); - public static final BlockType BIRCH_FENCE = register("minecraft:birch_fence"); - public static final BlockType BIRCH_FENCE_GATE = register("minecraft:birch_fence_gate"); - public static final BlockType BIRCH_LEAVES = register("minecraft:birch_leaves"); - public static final BlockType BIRCH_LOG = register("minecraft:birch_log"); + public static final BlockType BEETROOTS = register("minecraft:beetroots", state -> state.with(state.getBlockType().getProperty("age"), 0)); + public static final BlockType BIRCH_BUTTON = register("minecraft:birch_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType BIRCH_DOOR = register("minecraft:birch_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType BIRCH_FENCE = register("minecraft:birch_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + public static final BlockType BIRCH_FENCE_GATE = register("minecraft:birch_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType BIRCH_LEAVES = register("minecraft:birch_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + public static final BlockType BIRCH_LOG = register("minecraft:birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); public static final BlockType BIRCH_PLANKS = register("minecraft:birch_planks"); - public static final BlockType BIRCH_PRESSURE_PLATE = register("minecraft:birch_pressure_plate"); - public static final BlockType BIRCH_SAPLING = register("minecraft:birch_sapling"); - public static final BlockType BIRCH_SLAB = register("minecraft:birch_slab"); - public static final BlockType BIRCH_STAIRS = register("minecraft:birch_stairs"); - public static final BlockType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor"); - public static final BlockType BIRCH_WOOD = register("minecraft:birch_wood"); - public static final BlockType BLACK_BANNER = register("minecraft:black_banner"); - public static final BlockType BLACK_BED = register("minecraft:black_bed"); + public static final BlockType BIRCH_PRESSURE_PLATE = register("minecraft:birch_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType BIRCH_SAPLING = register("minecraft:birch_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + public static final BlockType BIRCH_SLAB = register("minecraft:birch_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType BIRCH_STAIRS = register("minecraft:birch_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType BIRCH_WOOD = register("minecraft:birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType BLACK_BANNER = register("minecraft:black_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType BLACK_BED = register("minecraft:black_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType BLACK_CARPET = register("minecraft:black_carpet"); public static final BlockType BLACK_CONCRETE = register("minecraft:black_concrete"); public static final BlockType BLACK_CONCRETE_POWDER = register("minecraft:black_concrete_powder"); - public static final BlockType BLACK_GLAZED_TERRACOTTA = register("minecraft:black_glazed_terracotta"); - public static final BlockType BLACK_SHULKER_BOX = register("minecraft:black_shulker_box"); + public static final BlockType BLACK_GLAZED_TERRACOTTA = register("minecraft:black_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType BLACK_SHULKER_BOX = register("minecraft:black_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType BLACK_STAINED_GLASS = register("minecraft:black_stained_glass"); - public static final BlockType BLACK_STAINED_GLASS_PANE = register("minecraft:black_stained_glass_pane"); + public static final BlockType BLACK_STAINED_GLASS_PANE = register("minecraft:black_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType BLACK_TERRACOTTA = register("minecraft:black_terracotta"); - public static final BlockType BLACK_WALL_BANNER = register("minecraft:black_wall_banner"); + public static final BlockType BLACK_WALL_BANNER = register("minecraft:black_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType BLACK_WOOL = register("minecraft:black_wool"); - public static final BlockType BLUE_BANNER = register("minecraft:blue_banner"); - public static final BlockType BLUE_BED = register("minecraft:blue_bed"); + public static final BlockType BLUE_BANNER = register("minecraft:blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType BLUE_BED = register("minecraft:blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType BLUE_CARPET = register("minecraft:blue_carpet"); public static final BlockType BLUE_CONCRETE = register("minecraft:blue_concrete"); public static final BlockType BLUE_CONCRETE_POWDER = register("minecraft:blue_concrete_powder"); - public static final BlockType BLUE_GLAZED_TERRACOTTA = register("minecraft:blue_glazed_terracotta"); + public static final BlockType BLUE_GLAZED_TERRACOTTA = register("minecraft:blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType BLUE_ICE = register("minecraft:blue_ice"); public static final BlockType BLUE_ORCHID = register("minecraft:blue_orchid"); - public static final BlockType BLUE_SHULKER_BOX = register("minecraft:blue_shulker_box"); + public static final BlockType BLUE_SHULKER_BOX = register("minecraft:blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType BLUE_STAINED_GLASS = register("minecraft:blue_stained_glass"); - public static final BlockType BLUE_STAINED_GLASS_PANE = register("minecraft:blue_stained_glass_pane"); + public static final BlockType BLUE_STAINED_GLASS_PANE = register("minecraft:blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType BLUE_TERRACOTTA = register("minecraft:blue_terracotta"); - public static final BlockType BLUE_WALL_BANNER = register("minecraft:blue_wall_banner"); + public static final BlockType BLUE_WALL_BANNER = register("minecraft:blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType BLUE_WOOL = register("minecraft:blue_wool"); - public static final BlockType BONE_BLOCK = register("minecraft:bone_block"); + public static final BlockType BONE_BLOCK = register("minecraft:bone_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); public static final BlockType BOOKSHELF = register("minecraft:bookshelf"); public static final BlockType BRAIN_CORAL = register("minecraft:brain_coral"); public static final BlockType BRAIN_CORAL_BLOCK = register("minecraft:brain_coral_block"); - public static final BlockType BRAIN_CORAL_FAN = register("minecraft:brain_coral_fan"); - public static final BlockType BRAIN_CORAL_WALL_FAN = register("minecraft:brain_coral_wall_fan"); - public static final BlockType BREWING_STAND = register("minecraft:brewing_stand"); - public static final BlockType BRICK_SLAB = register("minecraft:brick_slab"); - public static final BlockType BRICK_STAIRS = register("minecraft:brick_stairs"); + public static final BlockType BRAIN_CORAL_FAN = register("minecraft:brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType BRAIN_CORAL_WALL_FAN = register("minecraft:brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType BREWING_STAND = register("minecraft:brewing_stand", state -> state.with(state.getBlockType().getProperty("has_bottle_0"), false).with(state.getBlockType().getProperty("has_bottle_1"), false).with(state.getBlockType().getProperty("has_bottle_2"), false)); + public static final BlockType BRICK_SLAB = register("minecraft:brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType BRICK_STAIRS = register("minecraft:brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); public static final BlockType BRICKS = register("minecraft:bricks"); - public static final BlockType BROWN_BANNER = register("minecraft:brown_banner"); - public static final BlockType BROWN_BED = register("minecraft:brown_bed"); + public static final BlockType BROWN_BANNER = register("minecraft:brown_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType BROWN_BED = register("minecraft:brown_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType BROWN_CARPET = register("minecraft:brown_carpet"); public static final BlockType BROWN_CONCRETE = register("minecraft:brown_concrete"); public static final BlockType BROWN_CONCRETE_POWDER = register("minecraft:brown_concrete_powder"); - public static final BlockType BROWN_GLAZED_TERRACOTTA = register("minecraft:brown_glazed_terracotta"); + public static final BlockType BROWN_GLAZED_TERRACOTTA = register("minecraft:brown_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType BROWN_MUSHROOM = register("minecraft:brown_mushroom"); - public static final BlockType BROWN_MUSHROOM_BLOCK = register("minecraft:brown_mushroom_block"); - public static final BlockType BROWN_SHULKER_BOX = register("minecraft:brown_shulker_box"); + public static final BlockType BROWN_MUSHROOM_BLOCK = register("minecraft:brown_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); + public static final BlockType BROWN_SHULKER_BOX = register("minecraft:brown_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType BROWN_STAINED_GLASS = register("minecraft:brown_stained_glass"); - public static final BlockType BROWN_STAINED_GLASS_PANE = register("minecraft:brown_stained_glass_pane"); + public static final BlockType BROWN_STAINED_GLASS_PANE = register("minecraft:brown_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType BROWN_TERRACOTTA = register("minecraft:brown_terracotta"); - public static final BlockType BROWN_WALL_BANNER = register("minecraft:brown_wall_banner"); + public static final BlockType BROWN_WALL_BANNER = register("minecraft:brown_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType BROWN_WOOL = register("minecraft:brown_wool"); - public static final BlockType BUBBLE_COLUMN = register("minecraft:bubble_column"); + public static final BlockType BUBBLE_COLUMN = register("minecraft:bubble_column", state -> state.with(state.getBlockType().getProperty("drag"), true)); public static final BlockType BUBBLE_CORAL = register("minecraft:bubble_coral"); public static final BlockType BUBBLE_CORAL_BLOCK = register("minecraft:bubble_coral_block"); - public static final BlockType BUBBLE_CORAL_FAN = register("minecraft:bubble_coral_fan"); - public static final BlockType BUBBLE_CORAL_WALL_FAN = register("minecraft:bubble_coral_wall_fan"); - public static final BlockType CACTUS = register("minecraft:cactus"); - public static final BlockType CAKE = register("minecraft:cake"); - public static final BlockType CARROTS = register("minecraft:carrots"); - public static final BlockType CARVED_PUMPKIN = register("minecraft:carved_pumpkin"); - public static final BlockType CAULDRON = register("minecraft:cauldron"); + public static final BlockType BUBBLE_CORAL_FAN = register("minecraft:bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType BUBBLE_CORAL_WALL_FAN = register("minecraft:bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType CACTUS = register("minecraft:cactus", state -> state.with(state.getBlockType().getProperty("age"), 0)); + public static final BlockType CAKE = register("minecraft:cake", state -> state.with(state.getBlockType().getProperty("bites"), 0)); + public static final BlockType CARROTS = register("minecraft:carrots", state -> state.with(state.getBlockType().getProperty("age"), 0)); + public static final BlockType CARVED_PUMPKIN = register("minecraft:carved_pumpkin", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType CAULDRON = register("minecraft:cauldron", state -> state.with(state.getBlockType().getProperty("level"), 0)); public static final BlockType CAVE_AIR = register("minecraft:cave_air"); - public static final BlockType CHAIN_COMMAND_BLOCK = register("minecraft:chain_command_block"); - public static final BlockType CHEST = register("minecraft:chest"); - public static final BlockType CHIPPED_ANVIL = register("minecraft:chipped_anvil"); + public static final BlockType CHAIN_COMMAND_BLOCK = register("minecraft:chain_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType CHEST = register("minecraft:chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType CHIPPED_ANVIL = register("minecraft:chipped_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType CHISELED_QUARTZ_BLOCK = register("minecraft:chiseled_quartz_block"); public static final BlockType CHISELED_RED_SANDSTONE = register("minecraft:chiseled_red_sandstone"); public static final BlockType CHISELED_SANDSTONE = register("minecraft:chiseled_sandstone"); public static final BlockType CHISELED_STONE_BRICKS = register("minecraft:chiseled_stone_bricks"); - public static final BlockType CHORUS_FLOWER = register("minecraft:chorus_flower"); - public static final BlockType CHORUS_PLANT = register("minecraft:chorus_plant"); + public static final BlockType CHORUS_FLOWER = register("minecraft:chorus_flower", state -> state.with(state.getBlockType().getProperty("age"), 0)); + public static final BlockType CHORUS_PLANT = register("minecraft:chorus_plant", state -> state.with(state.getBlockType().getProperty("down"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType CLAY = register("minecraft:clay"); public static final BlockType COAL_BLOCK = register("minecraft:coal_block"); public static final BlockType COAL_ORE = register("minecraft:coal_ore"); public static final BlockType COARSE_DIRT = register("minecraft:coarse_dirt"); public static final BlockType COBBLESTONE = register("minecraft:cobblestone"); - public static final BlockType COBBLESTONE_SLAB = register("minecraft:cobblestone_slab"); - public static final BlockType COBBLESTONE_STAIRS = register("minecraft:cobblestone_stairs"); - public static final BlockType COBBLESTONE_WALL = register("minecraft:cobblestone_wall"); + public static final BlockType COBBLESTONE_SLAB = register("minecraft:cobblestone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType COBBLESTONE_STAIRS = register("minecraft:cobblestone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType COBBLESTONE_WALL = register("minecraft:cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType COBWEB = register("minecraft:cobweb"); - public static final BlockType COCOA = register("minecraft:cocoa"); - public static final BlockType COMMAND_BLOCK = register("minecraft:command_block"); - public static final BlockType COMPARATOR = register("minecraft:comparator"); + public static final BlockType COCOA = register("minecraft:cocoa", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType COMMAND_BLOCK = register("minecraft:command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType COMPARATOR = register("minecraft:comparator", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("mode"), "compare").with(state.getBlockType().getProperty("powered"), false)); public static final BlockType CONDUIT = register("minecraft:conduit"); public static final BlockType CRACKED_STONE_BRICKS = register("minecraft:cracked_stone_bricks"); public static final BlockType CRAFTING_TABLE = register("minecraft:crafting_table"); - public static final BlockType CREEPER_HEAD = register("minecraft:creeper_head"); - public static final BlockType CREEPER_WALL_HEAD = register("minecraft:creeper_wall_head"); + public static final BlockType CREEPER_HEAD = register("minecraft:creeper_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType CREEPER_WALL_HEAD = register("minecraft:creeper_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType CUT_RED_SANDSTONE = register("minecraft:cut_red_sandstone"); public static final BlockType CUT_SANDSTONE = register("minecraft:cut_sandstone"); - public static final BlockType CYAN_BANNER = register("minecraft:cyan_banner"); - public static final BlockType CYAN_BED = register("minecraft:cyan_bed"); + public static final BlockType CYAN_BANNER = register("minecraft:cyan_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType CYAN_BED = register("minecraft:cyan_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType CYAN_CARPET = register("minecraft:cyan_carpet"); public static final BlockType CYAN_CONCRETE = register("minecraft:cyan_concrete"); public static final BlockType CYAN_CONCRETE_POWDER = register("minecraft:cyan_concrete_powder"); - public static final BlockType CYAN_GLAZED_TERRACOTTA = register("minecraft:cyan_glazed_terracotta"); - public static final BlockType CYAN_SHULKER_BOX = register("minecraft:cyan_shulker_box"); + public static final BlockType CYAN_GLAZED_TERRACOTTA = register("minecraft:cyan_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType CYAN_SHULKER_BOX = register("minecraft:cyan_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType CYAN_STAINED_GLASS = register("minecraft:cyan_stained_glass"); - public static final BlockType CYAN_STAINED_GLASS_PANE = register("minecraft:cyan_stained_glass_pane"); + public static final BlockType CYAN_STAINED_GLASS_PANE = register("minecraft:cyan_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType CYAN_TERRACOTTA = register("minecraft:cyan_terracotta"); - public static final BlockType CYAN_WALL_BANNER = register("minecraft:cyan_wall_banner"); + public static final BlockType CYAN_WALL_BANNER = register("minecraft:cyan_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType CYAN_WOOL = register("minecraft:cyan_wool"); - public static final BlockType DAMAGED_ANVIL = register("minecraft:damaged_anvil"); + public static final BlockType DAMAGED_ANVIL = register("minecraft:damaged_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType DANDELION = register("minecraft:dandelion"); - public static final BlockType DARK_OAK_BUTTON = register("minecraft:dark_oak_button"); - public static final BlockType DARK_OAK_DOOR = register("minecraft:dark_oak_door"); - public static final BlockType DARK_OAK_FENCE = register("minecraft:dark_oak_fence"); - public static final BlockType DARK_OAK_FENCE_GATE = register("minecraft:dark_oak_fence_gate"); - public static final BlockType DARK_OAK_LEAVES = register("minecraft:dark_oak_leaves"); - public static final BlockType DARK_OAK_LOG = register("minecraft:dark_oak_log"); + public static final BlockType DARK_OAK_BUTTON = register("minecraft:dark_oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType DARK_OAK_DOOR = register("minecraft:dark_oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType DARK_OAK_FENCE = register("minecraft:dark_oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + public static final BlockType DARK_OAK_FENCE_GATE = register("minecraft:dark_oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType DARK_OAK_LEAVES = register("minecraft:dark_oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + public static final BlockType DARK_OAK_LOG = register("minecraft:dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); public static final BlockType DARK_OAK_PLANKS = register("minecraft:dark_oak_planks"); - public static final BlockType DARK_OAK_PRESSURE_PLATE = register("minecraft:dark_oak_pressure_plate"); - public static final BlockType DARK_OAK_SAPLING = register("minecraft:dark_oak_sapling"); - public static final BlockType DARK_OAK_SLAB = register("minecraft:dark_oak_slab"); - public static final BlockType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs"); - public static final BlockType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor"); - public static final BlockType DARK_OAK_WOOD = register("minecraft:dark_oak_wood"); + public static final BlockType DARK_OAK_PRESSURE_PLATE = register("minecraft:dark_oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType DARK_OAK_SAPLING = register("minecraft:dark_oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + public static final BlockType DARK_OAK_SLAB = register("minecraft:dark_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType DARK_OAK_WOOD = register("minecraft:dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); public static final BlockType DARK_PRISMARINE = register("minecraft:dark_prismarine"); - public static final BlockType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab"); - public static final BlockType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs"); - public static final BlockType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector"); + public static final BlockType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector", state -> state.with(state.getBlockType().getProperty("inverted"), false).with(state.getBlockType().getProperty("power"), 0)); public static final BlockType DEAD_BRAIN_CORAL_BLOCK = register("minecraft:dead_brain_coral_block"); - public static final BlockType DEAD_BRAIN_CORAL_FAN = register("minecraft:dead_brain_coral_fan"); - public static final BlockType DEAD_BRAIN_CORAL_WALL_FAN = register("minecraft:dead_brain_coral_wall_fan"); + public static final BlockType DEAD_BRAIN_CORAL_FAN = register("minecraft:dead_brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType DEAD_BRAIN_CORAL_WALL_FAN = register("minecraft:dead_brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); public static final BlockType DEAD_BUBBLE_CORAL_BLOCK = register("minecraft:dead_bubble_coral_block"); - public static final BlockType DEAD_BUBBLE_CORAL_FAN = register("minecraft:dead_bubble_coral_fan"); - public static final BlockType DEAD_BUBBLE_CORAL_WALL_FAN = register("minecraft:dead_bubble_coral_wall_fan"); + public static final BlockType DEAD_BUBBLE_CORAL_FAN = register("minecraft:dead_bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType DEAD_BUBBLE_CORAL_WALL_FAN = register("minecraft:dead_bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); public static final BlockType DEAD_BUSH = register("minecraft:dead_bush"); public static final BlockType DEAD_FIRE_CORAL_BLOCK = register("minecraft:dead_fire_coral_block"); - public static final BlockType DEAD_FIRE_CORAL_FAN = register("minecraft:dead_fire_coral_fan"); - public static final BlockType DEAD_FIRE_CORAL_WALL_FAN = register("minecraft:dead_fire_coral_wall_fan"); + public static final BlockType DEAD_FIRE_CORAL_FAN = register("minecraft:dead_fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType DEAD_FIRE_CORAL_WALL_FAN = register("minecraft:dead_fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); public static final BlockType DEAD_HORN_CORAL_BLOCK = register("minecraft:dead_horn_coral_block"); - public static final BlockType DEAD_HORN_CORAL_FAN = register("minecraft:dead_horn_coral_fan"); - public static final BlockType DEAD_HORN_CORAL_WALL_FAN = register("minecraft:dead_horn_coral_wall_fan"); + public static final BlockType DEAD_HORN_CORAL_FAN = register("minecraft:dead_horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType DEAD_HORN_CORAL_WALL_FAN = register("minecraft:dead_horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); public static final BlockType DEAD_TUBE_CORAL_BLOCK = register("minecraft:dead_tube_coral_block"); - public static final BlockType DEAD_TUBE_CORAL_FAN = register("minecraft:dead_tube_coral_fan"); - public static final BlockType DEAD_TUBE_CORAL_WALL_FAN = register("minecraft:dead_tube_coral_wall_fan"); - public static final BlockType DETECTOR_RAIL = register("minecraft:detector_rail"); + public static final BlockType DEAD_TUBE_CORAL_FAN = register("minecraft:dead_tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType DEAD_TUBE_CORAL_WALL_FAN = register("minecraft:dead_tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType DETECTOR_RAIL = register("minecraft:detector_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); public static final BlockType DIAMOND_BLOCK = register("minecraft:diamond_block"); public static final BlockType DIAMOND_ORE = register("minecraft:diamond_ore"); public static final BlockType DIORITE = register("minecraft:diorite"); public static final BlockType DIRT = register("minecraft:dirt"); - public static final BlockType DISPENSER = register("minecraft:dispenser"); + public static final BlockType DISPENSER = register("minecraft:dispenser", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); public static final BlockType DRAGON_EGG = register("minecraft:dragon_egg"); - public static final BlockType DRAGON_HEAD = register("minecraft:dragon_head"); - public static final BlockType DRAGON_WALL_HEAD = register("minecraft:dragon_wall_head"); + public static final BlockType DRAGON_HEAD = register("minecraft:dragon_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType DRAGON_WALL_HEAD = register("minecraft:dragon_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType DRIED_KELP_BLOCK = register("minecraft:dried_kelp_block"); - public static final BlockType DROPPER = register("minecraft:dropper"); + public static final BlockType DROPPER = register("minecraft:dropper", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); public static final BlockType EMERALD_BLOCK = register("minecraft:emerald_block"); public static final BlockType EMERALD_ORE = register("minecraft:emerald_ore"); public static final BlockType ENCHANTING_TABLE = register("minecraft:enchanting_table"); public static final BlockType END_GATEWAY = register("minecraft:end_gateway"); public static final BlockType END_PORTAL = register("minecraft:end_portal"); - public static final BlockType END_PORTAL_FRAME = register("minecraft:end_portal_frame"); - public static final BlockType END_ROD = register("minecraft:end_rod"); + public static final BlockType END_PORTAL_FRAME = register("minecraft:end_portal_frame", state -> state.with(state.getBlockType().getProperty("eye"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType END_ROD = register("minecraft:end_rod", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType END_STONE = register("minecraft:end_stone"); public static final BlockType END_STONE_BRICKS = register("minecraft:end_stone_bricks"); - public static final BlockType ENDER_CHEST = register("minecraft:ender_chest"); - public static final BlockType FARMLAND = register("minecraft:farmland"); + public static final BlockType ENDER_CHEST = register("minecraft:ender_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType FARMLAND = register("minecraft:farmland", state -> state.with(state.getBlockType().getProperty("moisture"), 0)); public static final BlockType FERN = register("minecraft:fern"); - public static final BlockType FIRE = register("minecraft:fire"); + public static final BlockType FIRE = register("minecraft:fire", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType FIRE_CORAL = register("minecraft:fire_coral"); public static final BlockType FIRE_CORAL_BLOCK = register("minecraft:fire_coral_block"); - public static final BlockType FIRE_CORAL_FAN = register("minecraft:fire_coral_fan"); - public static final BlockType FIRE_CORAL_WALL_FAN = register("minecraft:fire_coral_wall_fan"); + public static final BlockType FIRE_CORAL_FAN = register("minecraft:fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType FIRE_CORAL_WALL_FAN = register("minecraft:fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); public static final BlockType FLOWER_POT = register("minecraft:flower_pot"); - public static final BlockType FROSTED_ICE = register("minecraft:frosted_ice"); - public static final BlockType FURNACE = register("minecraft:furnace"); + public static final BlockType FROSTED_ICE = register("minecraft:frosted_ice", state -> state.with(state.getBlockType().getProperty("age"), 0)); + public static final BlockType FURNACE = register("minecraft:furnace", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), false)); public static final BlockType GLASS = register("minecraft:glass"); - public static final BlockType GLASS_PANE = register("minecraft:glass_pane"); + public static final BlockType GLASS_PANE = register("minecraft:glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType GLOWSTONE = register("minecraft:glowstone"); public static final BlockType GOLD_BLOCK = register("minecraft:gold_block"); public static final BlockType GOLD_ORE = register("minecraft:gold_ore"); public static final BlockType GRANITE = register("minecraft:granite"); public static final BlockType GRASS = register("minecraft:grass"); - public static final BlockType GRASS_BLOCK = register("minecraft:grass_block"); + public static final BlockType GRASS_BLOCK = register("minecraft:grass_block", state -> state.with(state.getBlockType().getProperty("snowy"), false)); public static final BlockType GRASS_PATH = register("minecraft:grass_path"); public static final BlockType GRAVEL = register("minecraft:gravel"); - public static final BlockType GRAY_BANNER = register("minecraft:gray_banner"); - public static final BlockType GRAY_BED = register("minecraft:gray_bed"); + public static final BlockType GRAY_BANNER = register("minecraft:gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType GRAY_BED = register("minecraft:gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType GRAY_CARPET = register("minecraft:gray_carpet"); public static final BlockType GRAY_CONCRETE = register("minecraft:gray_concrete"); public static final BlockType GRAY_CONCRETE_POWDER = register("minecraft:gray_concrete_powder"); - public static final BlockType GRAY_GLAZED_TERRACOTTA = register("minecraft:gray_glazed_terracotta"); - public static final BlockType GRAY_SHULKER_BOX = register("minecraft:gray_shulker_box"); + public static final BlockType GRAY_GLAZED_TERRACOTTA = register("minecraft:gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType GRAY_SHULKER_BOX = register("minecraft:gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType GRAY_STAINED_GLASS = register("minecraft:gray_stained_glass"); - public static final BlockType GRAY_STAINED_GLASS_PANE = register("minecraft:gray_stained_glass_pane"); + public static final BlockType GRAY_STAINED_GLASS_PANE = register("minecraft:gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType GRAY_TERRACOTTA = register("minecraft:gray_terracotta"); - public static final BlockType GRAY_WALL_BANNER = register("minecraft:gray_wall_banner"); + public static final BlockType GRAY_WALL_BANNER = register("minecraft:gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType GRAY_WOOL = register("minecraft:gray_wool"); - public static final BlockType GREEN_BANNER = register("minecraft:green_banner"); - public static final BlockType GREEN_BED = register("minecraft:green_bed"); + public static final BlockType GREEN_BANNER = register("minecraft:green_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType GREEN_BED = register("minecraft:green_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType GREEN_CARPET = register("minecraft:green_carpet"); public static final BlockType GREEN_CONCRETE = register("minecraft:green_concrete"); public static final BlockType GREEN_CONCRETE_POWDER = register("minecraft:green_concrete_powder"); - public static final BlockType GREEN_GLAZED_TERRACOTTA = register("minecraft:green_glazed_terracotta"); - public static final BlockType GREEN_SHULKER_BOX = register("minecraft:green_shulker_box"); + public static final BlockType GREEN_GLAZED_TERRACOTTA = register("minecraft:green_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType GREEN_SHULKER_BOX = register("minecraft:green_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType GREEN_STAINED_GLASS = register("minecraft:green_stained_glass"); - public static final BlockType GREEN_STAINED_GLASS_PANE = register("minecraft:green_stained_glass_pane"); + public static final BlockType GREEN_STAINED_GLASS_PANE = register("minecraft:green_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType GREEN_TERRACOTTA = register("minecraft:green_terracotta"); - public static final BlockType GREEN_WALL_BANNER = register("minecraft:green_wall_banner"); + public static final BlockType GREEN_WALL_BANNER = register("minecraft:green_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType GREEN_WOOL = register("minecraft:green_wool"); - public static final BlockType HAY_BLOCK = register("minecraft:hay_block"); - public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = register("minecraft:heavy_weighted_pressure_plate"); - public static final BlockType HOPPER = register("minecraft:hopper"); + public static final BlockType HAY_BLOCK = register("minecraft:hay_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = register("minecraft:heavy_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); + public static final BlockType HOPPER = register("minecraft:hopper", state -> state.with(state.getBlockType().getProperty("enabled"), true).with(state.getBlockType().getProperty("facing"), Direction.DOWN)); public static final BlockType HORN_CORAL = register("minecraft:horn_coral"); public static final BlockType HORN_CORAL_BLOCK = register("minecraft:horn_coral_block"); - public static final BlockType HORN_CORAL_FAN = register("minecraft:horn_coral_fan"); - public static final BlockType HORN_CORAL_WALL_FAN = register("minecraft:horn_coral_wall_fan"); + public static final BlockType HORN_CORAL_FAN = register("minecraft:horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType HORN_CORAL_WALL_FAN = register("minecraft:horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); public static final BlockType ICE = register("minecraft:ice"); public static final BlockType INFESTED_CHISELED_STONE_BRICKS = register("minecraft:infested_chiseled_stone_bricks"); public static final BlockType INFESTED_COBBLESTONE = register("minecraft:infested_cobblestone"); @@ -279,159 +283,159 @@ public final class BlockTypes { public static final BlockType INFESTED_MOSSY_STONE_BRICKS = register("minecraft:infested_mossy_stone_bricks"); public static final BlockType INFESTED_STONE = register("minecraft:infested_stone"); public static final BlockType INFESTED_STONE_BRICKS = register("minecraft:infested_stone_bricks"); - public static final BlockType IRON_BARS = register("minecraft:iron_bars"); + public static final BlockType IRON_BARS = register("minecraft:iron_bars", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType IRON_BLOCK = register("minecraft:iron_block"); - public static final BlockType IRON_DOOR = register("minecraft:iron_door"); + public static final BlockType IRON_DOOR = register("minecraft:iron_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); public static final BlockType IRON_ORE = register("minecraft:iron_ore"); - public static final BlockType IRON_TRAPDOOR = register("minecraft:iron_trapdoor"); - public static final BlockType JACK_O_LANTERN = register("minecraft:jack_o_lantern"); - public static final BlockType JUKEBOX = register("minecraft:jukebox"); - public static final BlockType JUNGLE_BUTTON = register("minecraft:jungle_button"); - public static final BlockType JUNGLE_DOOR = register("minecraft:jungle_door"); - public static final BlockType JUNGLE_FENCE = register("minecraft:jungle_fence"); - public static final BlockType JUNGLE_FENCE_GATE = register("minecraft:jungle_fence_gate"); - public static final BlockType JUNGLE_LEAVES = register("minecraft:jungle_leaves"); - public static final BlockType JUNGLE_LOG = register("minecraft:jungle_log"); + public static final BlockType IRON_TRAPDOOR = register("minecraft:iron_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType JACK_O_LANTERN = register("minecraft:jack_o_lantern", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType JUKEBOX = register("minecraft:jukebox", state -> state.with(state.getBlockType().getProperty("has_record"), false)); + public static final BlockType JUNGLE_BUTTON = register("minecraft:jungle_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType JUNGLE_DOOR = register("minecraft:jungle_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType JUNGLE_FENCE = register("minecraft:jungle_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + public static final BlockType JUNGLE_FENCE_GATE = register("minecraft:jungle_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType JUNGLE_LEAVES = register("minecraft:jungle_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + public static final BlockType JUNGLE_LOG = register("minecraft:jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); public static final BlockType JUNGLE_PLANKS = register("minecraft:jungle_planks"); - public static final BlockType JUNGLE_PRESSURE_PLATE = register("minecraft:jungle_pressure_plate"); - public static final BlockType JUNGLE_SAPLING = register("minecraft:jungle_sapling"); - public static final BlockType JUNGLE_SLAB = register("minecraft:jungle_slab"); - public static final BlockType JUNGLE_STAIRS = register("minecraft:jungle_stairs"); - public static final BlockType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor"); - public static final BlockType JUNGLE_WOOD = register("minecraft:jungle_wood"); - public static final BlockType KELP = register("minecraft:kelp"); + public static final BlockType JUNGLE_PRESSURE_PLATE = register("minecraft:jungle_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType JUNGLE_SAPLING = register("minecraft:jungle_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + public static final BlockType JUNGLE_SLAB = register("minecraft:jungle_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType JUNGLE_STAIRS = register("minecraft:jungle_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType JUNGLE_WOOD = register("minecraft:jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType KELP = register("minecraft:kelp", state -> state.with(state.getBlockType().getProperty("age"), 0)); public static final BlockType KELP_PLANT = register("minecraft:kelp_plant"); - public static final BlockType LADDER = register("minecraft:ladder"); + public static final BlockType LADDER = register("minecraft:ladder", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); public static final BlockType LAPIS_BLOCK = register("minecraft:lapis_block"); public static final BlockType LAPIS_ORE = register("minecraft:lapis_ore"); - public static final BlockType LARGE_FERN = register("minecraft:large_fern"); - public static final BlockType LAVA = register("minecraft:lava"); - public static final BlockType LEVER = register("minecraft:lever"); - public static final BlockType LIGHT_BLUE_BANNER = register("minecraft:light_blue_banner"); - public static final BlockType LIGHT_BLUE_BED = register("minecraft:light_blue_bed"); + public static final BlockType LARGE_FERN = register("minecraft:large_fern", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + public static final BlockType LAVA = register("minecraft:lava", state -> state.with(state.getBlockType().getProperty("level"), 0)); + public static final BlockType LEVER = register("minecraft:lever", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType LIGHT_BLUE_BANNER = register("minecraft:light_blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType LIGHT_BLUE_BED = register("minecraft:light_blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType LIGHT_BLUE_CARPET = register("minecraft:light_blue_carpet"); public static final BlockType LIGHT_BLUE_CONCRETE = register("minecraft:light_blue_concrete"); public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = register("minecraft:light_blue_concrete_powder"); - public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = register("minecraft:light_blue_glazed_terracotta"); - public static final BlockType LIGHT_BLUE_SHULKER_BOX = register("minecraft:light_blue_shulker_box"); + public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = register("minecraft:light_blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType LIGHT_BLUE_SHULKER_BOX = register("minecraft:light_blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType LIGHT_BLUE_STAINED_GLASS = register("minecraft:light_blue_stained_glass"); - public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = register("minecraft:light_blue_stained_glass_pane"); + public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = register("minecraft:light_blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType LIGHT_BLUE_TERRACOTTA = register("minecraft:light_blue_terracotta"); - public static final BlockType LIGHT_BLUE_WALL_BANNER = register("minecraft:light_blue_wall_banner"); + public static final BlockType LIGHT_BLUE_WALL_BANNER = register("minecraft:light_blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType LIGHT_BLUE_WOOL = register("minecraft:light_blue_wool"); - public static final BlockType LIGHT_GRAY_BANNER = register("minecraft:light_gray_banner"); - public static final BlockType LIGHT_GRAY_BED = register("minecraft:light_gray_bed"); + public static final BlockType LIGHT_GRAY_BANNER = register("minecraft:light_gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType LIGHT_GRAY_BED = register("minecraft:light_gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType LIGHT_GRAY_CARPET = register("minecraft:light_gray_carpet"); public static final BlockType LIGHT_GRAY_CONCRETE = register("minecraft:light_gray_concrete"); public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = register("minecraft:light_gray_concrete_powder"); - public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = register("minecraft:light_gray_glazed_terracotta"); - public static final BlockType LIGHT_GRAY_SHULKER_BOX = register("minecraft:light_gray_shulker_box"); + public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = register("minecraft:light_gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType LIGHT_GRAY_SHULKER_BOX = register("minecraft:light_gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType LIGHT_GRAY_STAINED_GLASS = register("minecraft:light_gray_stained_glass"); - public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = register("minecraft:light_gray_stained_glass_pane"); + public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = register("minecraft:light_gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType LIGHT_GRAY_TERRACOTTA = register("minecraft:light_gray_terracotta"); - public static final BlockType LIGHT_GRAY_WALL_BANNER = register("minecraft:light_gray_wall_banner"); + public static final BlockType LIGHT_GRAY_WALL_BANNER = register("minecraft:light_gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType LIGHT_GRAY_WOOL = register("minecraft:light_gray_wool"); - public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = register("minecraft:light_weighted_pressure_plate"); - public static final BlockType LILAC = register("minecraft:lilac"); + public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = register("minecraft:light_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); + public static final BlockType LILAC = register("minecraft:lilac", state -> state.with(state.getBlockType().getProperty("half"), "lower")); public static final BlockType LILY_PAD = register("minecraft:lily_pad"); - public static final BlockType LIME_BANNER = register("minecraft:lime_banner"); - public static final BlockType LIME_BED = register("minecraft:lime_bed"); + public static final BlockType LIME_BANNER = register("minecraft:lime_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType LIME_BED = register("minecraft:lime_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType LIME_CARPET = register("minecraft:lime_carpet"); public static final BlockType LIME_CONCRETE = register("minecraft:lime_concrete"); public static final BlockType LIME_CONCRETE_POWDER = register("minecraft:lime_concrete_powder"); - public static final BlockType LIME_GLAZED_TERRACOTTA = register("minecraft:lime_glazed_terracotta"); - public static final BlockType LIME_SHULKER_BOX = register("minecraft:lime_shulker_box"); + public static final BlockType LIME_GLAZED_TERRACOTTA = register("minecraft:lime_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType LIME_SHULKER_BOX = register("minecraft:lime_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType LIME_STAINED_GLASS = register("minecraft:lime_stained_glass"); - public static final BlockType LIME_STAINED_GLASS_PANE = register("minecraft:lime_stained_glass_pane"); + public static final BlockType LIME_STAINED_GLASS_PANE = register("minecraft:lime_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType LIME_TERRACOTTA = register("minecraft:lime_terracotta"); - public static final BlockType LIME_WALL_BANNER = register("minecraft:lime_wall_banner"); + public static final BlockType LIME_WALL_BANNER = register("minecraft:lime_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType LIME_WOOL = register("minecraft:lime_wool"); - public static final BlockType MAGENTA_BANNER = register("minecraft:magenta_banner"); - public static final BlockType MAGENTA_BED = register("minecraft:magenta_bed"); + public static final BlockType MAGENTA_BANNER = register("minecraft:magenta_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType MAGENTA_BED = register("minecraft:magenta_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType MAGENTA_CARPET = register("minecraft:magenta_carpet"); public static final BlockType MAGENTA_CONCRETE = register("minecraft:magenta_concrete"); public static final BlockType MAGENTA_CONCRETE_POWDER = register("minecraft:magenta_concrete_powder"); - public static final BlockType MAGENTA_GLAZED_TERRACOTTA = register("minecraft:magenta_glazed_terracotta"); - public static final BlockType MAGENTA_SHULKER_BOX = register("minecraft:magenta_shulker_box"); + public static final BlockType MAGENTA_GLAZED_TERRACOTTA = register("minecraft:magenta_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType MAGENTA_SHULKER_BOX = register("minecraft:magenta_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType MAGENTA_STAINED_GLASS = register("minecraft:magenta_stained_glass"); - public static final BlockType MAGENTA_STAINED_GLASS_PANE = register("minecraft:magenta_stained_glass_pane"); + public static final BlockType MAGENTA_STAINED_GLASS_PANE = register("minecraft:magenta_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType MAGENTA_TERRACOTTA = register("minecraft:magenta_terracotta"); - public static final BlockType MAGENTA_WALL_BANNER = register("minecraft:magenta_wall_banner"); + public static final BlockType MAGENTA_WALL_BANNER = register("minecraft:magenta_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType MAGENTA_WOOL = register("minecraft:magenta_wool"); public static final BlockType MAGMA_BLOCK = register("minecraft:magma_block"); public static final BlockType MELON = register("minecraft:melon"); - public static final BlockType MELON_STEM = register("minecraft:melon_stem"); + public static final BlockType MELON_STEM = register("minecraft:melon_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); public static final BlockType MOSSY_COBBLESTONE = register("minecraft:mossy_cobblestone"); - public static final BlockType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall"); + public static final BlockType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType MOSSY_STONE_BRICKS = register("minecraft:mossy_stone_bricks"); - public static final BlockType MOVING_PISTON = register("minecraft:moving_piston"); - public static final BlockType MUSHROOM_STEM = register("minecraft:mushroom_stem"); - public static final BlockType MYCELIUM = register("minecraft:mycelium"); - public static final BlockType NETHER_BRICK_FENCE = register("minecraft:nether_brick_fence"); - public static final BlockType NETHER_BRICK_SLAB = register("minecraft:nether_brick_slab"); - public static final BlockType NETHER_BRICK_STAIRS = register("minecraft:nether_brick_stairs"); + public static final BlockType MOVING_PISTON = register("minecraft:moving_piston", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "normal")); + public static final BlockType MUSHROOM_STEM = register("minecraft:mushroom_stem", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); + public static final BlockType MYCELIUM = register("minecraft:mycelium", state -> state.with(state.getBlockType().getProperty("snowy"), false)); + public static final BlockType NETHER_BRICK_FENCE = register("minecraft:nether_brick_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + public static final BlockType NETHER_BRICK_SLAB = register("minecraft:nether_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType NETHER_BRICK_STAIRS = register("minecraft:nether_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); public static final BlockType NETHER_BRICKS = register("minecraft:nether_bricks"); - public static final BlockType NETHER_PORTAL = register("minecraft:nether_portal"); + public static final BlockType NETHER_PORTAL = register("minecraft:nether_portal", state -> state.with(state.getBlockType().getProperty("axis"), "x")); public static final BlockType NETHER_QUARTZ_ORE = register("minecraft:nether_quartz_ore"); - public static final BlockType NETHER_WART = register("minecraft:nether_wart"); + public static final BlockType NETHER_WART = register("minecraft:nether_wart", state -> state.with(state.getBlockType().getProperty("age"), 0)); public static final BlockType NETHER_WART_BLOCK = register("minecraft:nether_wart_block"); public static final BlockType NETHERRACK = register("minecraft:netherrack"); - public static final BlockType NOTE_BLOCK = register("minecraft:note_block"); - public static final BlockType OAK_BUTTON = register("minecraft:oak_button"); - public static final BlockType OAK_DOOR = register("minecraft:oak_door"); - public static final BlockType OAK_FENCE = register("minecraft:oak_fence"); - public static final BlockType OAK_FENCE_GATE = register("minecraft:oak_fence_gate"); - public static final BlockType OAK_LEAVES = register("minecraft:oak_leaves"); - public static final BlockType OAK_LOG = register("minecraft:oak_log"); + public static final BlockType NOTE_BLOCK = register("minecraft:note_block", state -> state.with(state.getBlockType().getProperty("instrument"), "HARP").with(state.getBlockType().getProperty("note"), 0).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType OAK_BUTTON = register("minecraft:oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType OAK_DOOR = register("minecraft:oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType OAK_FENCE = register("minecraft:oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + public static final BlockType OAK_FENCE_GATE = register("minecraft:oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType OAK_LEAVES = register("minecraft:oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + public static final BlockType OAK_LOG = register("minecraft:oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); public static final BlockType OAK_PLANKS = register("minecraft:oak_planks"); - public static final BlockType OAK_PRESSURE_PLATE = register("minecraft:oak_pressure_plate"); - public static final BlockType OAK_SAPLING = register("minecraft:oak_sapling"); - public static final BlockType OAK_SLAB = register("minecraft:oak_slab"); - public static final BlockType OAK_STAIRS = register("minecraft:oak_stairs"); - public static final BlockType OAK_TRAPDOOR = register("minecraft:oak_trapdoor"); - public static final BlockType OAK_WOOD = register("minecraft:oak_wood"); - public static final BlockType OBSERVER = register("minecraft:observer"); + public static final BlockType OAK_PRESSURE_PLATE = register("minecraft:oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType OAK_SAPLING = register("minecraft:oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + public static final BlockType OAK_SLAB = register("minecraft:oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType OAK_STAIRS = register("minecraft:oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType OAK_TRAPDOOR = register("minecraft:oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType OAK_WOOD = register("minecraft:oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType OBSERVER = register("minecraft:observer", state -> state.with(state.getBlockType().getProperty("facing"), Direction.SOUTH).with(state.getBlockType().getProperty("powered"), false)); public static final BlockType OBSIDIAN = register("minecraft:obsidian"); - public static final BlockType ORANGE_BANNER = register("minecraft:orange_banner"); - public static final BlockType ORANGE_BED = register("minecraft:orange_bed"); + public static final BlockType ORANGE_BANNER = register("minecraft:orange_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType ORANGE_BED = register("minecraft:orange_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType ORANGE_CARPET = register("minecraft:orange_carpet"); public static final BlockType ORANGE_CONCRETE = register("minecraft:orange_concrete"); public static final BlockType ORANGE_CONCRETE_POWDER = register("minecraft:orange_concrete_powder"); - public static final BlockType ORANGE_GLAZED_TERRACOTTA = register("minecraft:orange_glazed_terracotta"); - public static final BlockType ORANGE_SHULKER_BOX = register("minecraft:orange_shulker_box"); + public static final BlockType ORANGE_GLAZED_TERRACOTTA = register("minecraft:orange_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType ORANGE_SHULKER_BOX = register("minecraft:orange_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType ORANGE_STAINED_GLASS = register("minecraft:orange_stained_glass"); - public static final BlockType ORANGE_STAINED_GLASS_PANE = register("minecraft:orange_stained_glass_pane"); + public static final BlockType ORANGE_STAINED_GLASS_PANE = register("minecraft:orange_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType ORANGE_TERRACOTTA = register("minecraft:orange_terracotta"); public static final BlockType ORANGE_TULIP = register("minecraft:orange_tulip"); - public static final BlockType ORANGE_WALL_BANNER = register("minecraft:orange_wall_banner"); + public static final BlockType ORANGE_WALL_BANNER = register("minecraft:orange_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType ORANGE_WOOL = register("minecraft:orange_wool"); public static final BlockType OXEYE_DAISY = register("minecraft:oxeye_daisy"); public static final BlockType PACKED_ICE = register("minecraft:packed_ice"); - public static final BlockType PEONY = register("minecraft:peony"); - public static final BlockType PETRIFIED_OAK_SLAB = register("minecraft:petrified_oak_slab"); - public static final BlockType PINK_BANNER = register("minecraft:pink_banner"); - public static final BlockType PINK_BED = register("minecraft:pink_bed"); + public static final BlockType PEONY = register("minecraft:peony", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + public static final BlockType PETRIFIED_OAK_SLAB = register("minecraft:petrified_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType PINK_BANNER = register("minecraft:pink_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType PINK_BED = register("minecraft:pink_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType PINK_CARPET = register("minecraft:pink_carpet"); public static final BlockType PINK_CONCRETE = register("minecraft:pink_concrete"); public static final BlockType PINK_CONCRETE_POWDER = register("minecraft:pink_concrete_powder"); - public static final BlockType PINK_GLAZED_TERRACOTTA = register("minecraft:pink_glazed_terracotta"); - public static final BlockType PINK_SHULKER_BOX = register("minecraft:pink_shulker_box"); + public static final BlockType PINK_GLAZED_TERRACOTTA = register("minecraft:pink_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType PINK_SHULKER_BOX = register("minecraft:pink_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType PINK_STAINED_GLASS = register("minecraft:pink_stained_glass"); - public static final BlockType PINK_STAINED_GLASS_PANE = register("minecraft:pink_stained_glass_pane"); + public static final BlockType PINK_STAINED_GLASS_PANE = register("minecraft:pink_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType PINK_TERRACOTTA = register("minecraft:pink_terracotta"); public static final BlockType PINK_TULIP = register("minecraft:pink_tulip"); - public static final BlockType PINK_WALL_BANNER = register("minecraft:pink_wall_banner"); + public static final BlockType PINK_WALL_BANNER = register("minecraft:pink_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType PINK_WOOL = register("minecraft:pink_wool"); - public static final BlockType PISTON = register("minecraft:piston"); - public static final BlockType PISTON_HEAD = register("minecraft:piston_head"); - public static final BlockType PLAYER_HEAD = register("minecraft:player_head"); - public static final BlockType PLAYER_WALL_HEAD = register("minecraft:player_wall_head"); - public static final BlockType PODZOL = register("minecraft:podzol"); + public static final BlockType PISTON = register("minecraft:piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType PISTON_HEAD = register("minecraft:piston_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("short"), false).with(state.getBlockType().getProperty("type"), "normal")); + public static final BlockType PLAYER_HEAD = register("minecraft:player_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType PLAYER_WALL_HEAD = register("minecraft:player_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType PODZOL = register("minecraft:podzol", state -> state.with(state.getBlockType().getProperty("snowy"), false)); public static final BlockType POLISHED_ANDESITE = register("minecraft:polished_andesite"); public static final BlockType POLISHED_DIORITE = register("minecraft:polished_diorite"); public static final BlockType POLISHED_GRANITE = register("minecraft:polished_granite"); public static final BlockType POPPY = register("minecraft:poppy"); - public static final BlockType POTATOES = register("minecraft:potatoes"); + public static final BlockType POTATOES = register("minecraft:potatoes", state -> state.with(state.getBlockType().getProperty("age"), 0)); public static final BlockType POTTED_ACACIA_SAPLING = register("minecraft:potted_acacia_sapling"); public static final BlockType POTTED_ALLIUM = register("minecraft:potted_allium"); public static final BlockType POTTED_AZURE_BLUET = register("minecraft:potted_azure_bluet"); @@ -453,172 +457,172 @@ public final class BlockTypes { public static final BlockType POTTED_RED_TULIP = register("minecraft:potted_red_tulip"); public static final BlockType POTTED_SPRUCE_SAPLING = register("minecraft:potted_spruce_sapling"); public static final BlockType POTTED_WHITE_TULIP = register("minecraft:potted_white_tulip"); - public static final BlockType POWERED_RAIL = register("minecraft:powered_rail"); + public static final BlockType POWERED_RAIL = register("minecraft:powered_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); public static final BlockType PRISMARINE = register("minecraft:prismarine"); - public static final BlockType PRISMARINE_BRICK_SLAB = register("minecraft:prismarine_brick_slab"); - public static final BlockType PRISMARINE_BRICK_STAIRS = register("minecraft:prismarine_brick_stairs"); + public static final BlockType PRISMARINE_BRICK_SLAB = register("minecraft:prismarine_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType PRISMARINE_BRICK_STAIRS = register("minecraft:prismarine_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); public static final BlockType PRISMARINE_BRICKS = register("minecraft:prismarine_bricks"); - public static final BlockType PRISMARINE_SLAB = register("minecraft:prismarine_slab"); - public static final BlockType PRISMARINE_STAIRS = register("minecraft:prismarine_stairs"); + public static final BlockType PRISMARINE_SLAB = register("minecraft:prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType PRISMARINE_STAIRS = register("minecraft:prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); public static final BlockType PUMPKIN = register("minecraft:pumpkin"); - public static final BlockType PUMPKIN_STEM = register("minecraft:pumpkin_stem"); - public static final BlockType PURPLE_BANNER = register("minecraft:purple_banner"); - public static final BlockType PURPLE_BED = register("minecraft:purple_bed"); + public static final BlockType PUMPKIN_STEM = register("minecraft:pumpkin_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); + public static final BlockType PURPLE_BANNER = register("minecraft:purple_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType PURPLE_BED = register("minecraft:purple_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType PURPLE_CARPET = register("minecraft:purple_carpet"); public static final BlockType PURPLE_CONCRETE = register("minecraft:purple_concrete"); public static final BlockType PURPLE_CONCRETE_POWDER = register("minecraft:purple_concrete_powder"); - public static final BlockType PURPLE_GLAZED_TERRACOTTA = register("minecraft:purple_glazed_terracotta"); - public static final BlockType PURPLE_SHULKER_BOX = register("minecraft:purple_shulker_box"); + public static final BlockType PURPLE_GLAZED_TERRACOTTA = register("minecraft:purple_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType PURPLE_SHULKER_BOX = register("minecraft:purple_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType PURPLE_STAINED_GLASS = register("minecraft:purple_stained_glass"); - public static final BlockType PURPLE_STAINED_GLASS_PANE = register("minecraft:purple_stained_glass_pane"); + public static final BlockType PURPLE_STAINED_GLASS_PANE = register("minecraft:purple_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType PURPLE_TERRACOTTA = register("minecraft:purple_terracotta"); - public static final BlockType PURPLE_WALL_BANNER = register("minecraft:purple_wall_banner"); + public static final BlockType PURPLE_WALL_BANNER = register("minecraft:purple_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType PURPLE_WOOL = register("minecraft:purple_wool"); public static final BlockType PURPUR_BLOCK = register("minecraft:purpur_block"); - public static final BlockType PURPUR_PILLAR = register("minecraft:purpur_pillar"); - public static final BlockType PURPUR_SLAB = register("minecraft:purpur_slab"); - public static final BlockType PURPUR_STAIRS = register("minecraft:purpur_stairs"); + public static final BlockType PURPUR_PILLAR = register("minecraft:purpur_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType PURPUR_SLAB = register("minecraft:purpur_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType PURPUR_STAIRS = register("minecraft:purpur_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); public static final BlockType QUARTZ_BLOCK = register("minecraft:quartz_block"); - public static final BlockType QUARTZ_PILLAR = register("minecraft:quartz_pillar"); - public static final BlockType QUARTZ_SLAB = register("minecraft:quartz_slab"); - public static final BlockType QUARTZ_STAIRS = register("minecraft:quartz_stairs"); - public static final BlockType RAIL = register("minecraft:rail"); - public static final BlockType RED_BANNER = register("minecraft:red_banner"); - public static final BlockType RED_BED = register("minecraft:red_bed"); + public static final BlockType QUARTZ_PILLAR = register("minecraft:quartz_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType QUARTZ_SLAB = register("minecraft:quartz_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType QUARTZ_STAIRS = register("minecraft:quartz_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType RAIL = register("minecraft:rail", state -> state.with(state.getBlockType().getProperty("shape"), "north_south")); + public static final BlockType RED_BANNER = register("minecraft:red_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType RED_BED = register("minecraft:red_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType RED_CARPET = register("minecraft:red_carpet"); public static final BlockType RED_CONCRETE = register("minecraft:red_concrete"); public static final BlockType RED_CONCRETE_POWDER = register("minecraft:red_concrete_powder"); - public static final BlockType RED_GLAZED_TERRACOTTA = register("minecraft:red_glazed_terracotta"); + public static final BlockType RED_GLAZED_TERRACOTTA = register("minecraft:red_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType RED_MUSHROOM = register("minecraft:red_mushroom"); - public static final BlockType RED_MUSHROOM_BLOCK = register("minecraft:red_mushroom_block"); + public static final BlockType RED_MUSHROOM_BLOCK = register("minecraft:red_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); public static final BlockType RED_NETHER_BRICKS = register("minecraft:red_nether_bricks"); public static final BlockType RED_SAND = register("minecraft:red_sand"); public static final BlockType RED_SANDSTONE = register("minecraft:red_sandstone"); - public static final BlockType RED_SANDSTONE_SLAB = register("minecraft:red_sandstone_slab"); - public static final BlockType RED_SANDSTONE_STAIRS = register("minecraft:red_sandstone_stairs"); - public static final BlockType RED_SHULKER_BOX = register("minecraft:red_shulker_box"); + public static final BlockType RED_SANDSTONE_SLAB = register("minecraft:red_sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType RED_SANDSTONE_STAIRS = register("minecraft:red_sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType RED_SHULKER_BOX = register("minecraft:red_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType RED_STAINED_GLASS = register("minecraft:red_stained_glass"); - public static final BlockType RED_STAINED_GLASS_PANE = register("minecraft:red_stained_glass_pane"); + public static final BlockType RED_STAINED_GLASS_PANE = register("minecraft:red_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType RED_TERRACOTTA = register("minecraft:red_terracotta"); public static final BlockType RED_TULIP = register("minecraft:red_tulip"); - public static final BlockType RED_WALL_BANNER = register("minecraft:red_wall_banner"); + public static final BlockType RED_WALL_BANNER = register("minecraft:red_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType RED_WOOL = register("minecraft:red_wool"); public static final BlockType REDSTONE_BLOCK = register("minecraft:redstone_block"); - public static final BlockType REDSTONE_LAMP = register("minecraft:redstone_lamp"); - public static final BlockType REDSTONE_ORE = register("minecraft:redstone_ore"); - public static final BlockType REDSTONE_TORCH = register("minecraft:redstone_torch"); - public static final BlockType REDSTONE_WALL_TORCH = register("minecraft:redstone_wall_torch"); - public static final BlockType REDSTONE_WIRE = register("minecraft:redstone_wire"); - public static final BlockType REPEATER = register("minecraft:repeater"); - public static final BlockType REPEATING_COMMAND_BLOCK = register("minecraft:repeating_command_block"); - public static final BlockType ROSE_BUSH = register("minecraft:rose_bush"); + public static final BlockType REDSTONE_LAMP = register("minecraft:redstone_lamp", state -> state.with(state.getBlockType().getProperty("lit"), false)); + public static final BlockType REDSTONE_ORE = register("minecraft:redstone_ore", state -> state.with(state.getBlockType().getProperty("lit"), false)); + public static final BlockType REDSTONE_TORCH = register("minecraft:redstone_torch", state -> state.with(state.getBlockType().getProperty("lit"), true)); + public static final BlockType REDSTONE_WALL_TORCH = register("minecraft:redstone_wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), true)); + public static final BlockType REDSTONE_WIRE = register("minecraft:redstone_wire", state -> state.with(state.getBlockType().getProperty("east"), "none").with(state.getBlockType().getProperty("north"), "none").with(state.getBlockType().getProperty("power"), 0).with(state.getBlockType().getProperty("south"), "none").with(state.getBlockType().getProperty("west"), "none")); + public static final BlockType REPEATER = register("minecraft:repeater", state -> state.with(state.getBlockType().getProperty("delay"), 1).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("locked"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType REPEATING_COMMAND_BLOCK = register("minecraft:repeating_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType ROSE_BUSH = register("minecraft:rose_bush", state -> state.with(state.getBlockType().getProperty("half"), "lower")); public static final BlockType SAND = register("minecraft:sand"); public static final BlockType SANDSTONE = register("minecraft:sandstone"); - public static final BlockType SANDSTONE_SLAB = register("minecraft:sandstone_slab"); - public static final BlockType SANDSTONE_STAIRS = register("minecraft:sandstone_stairs"); + public static final BlockType SANDSTONE_SLAB = register("minecraft:sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType SANDSTONE_STAIRS = register("minecraft:sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); public static final BlockType SEA_LANTERN = register("minecraft:sea_lantern"); - public static final BlockType SEA_PICKLE = register("minecraft:sea_pickle"); + public static final BlockType SEA_PICKLE = register("minecraft:sea_pickle", state -> state.with(state.getBlockType().getProperty("pickles"), 1).with(state.getBlockType().getProperty("waterlogged"), true)); public static final BlockType SEAGRASS = register("minecraft:seagrass"); - public static final BlockType SHULKER_BOX = register("minecraft:shulker_box"); - public static final BlockType SIGN = register("minecraft:sign"); - public static final BlockType SKELETON_SKULL = register("minecraft:skeleton_skull"); - public static final BlockType SKELETON_WALL_SKULL = register("minecraft:skeleton_wall_skull"); + public static final BlockType SHULKER_BOX = register("minecraft:shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + public static final BlockType SIGN = register("minecraft:sign", state -> state.with(state.getBlockType().getProperty("rotation"), 0).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType SKELETON_SKULL = register("minecraft:skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType SKELETON_WALL_SKULL = register("minecraft:skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType SLIME_BLOCK = register("minecraft:slime_block"); public static final BlockType SMOOTH_QUARTZ = register("minecraft:smooth_quartz"); public static final BlockType SMOOTH_RED_SANDSTONE = register("minecraft:smooth_red_sandstone"); public static final BlockType SMOOTH_SANDSTONE = register("minecraft:smooth_sandstone"); public static final BlockType SMOOTH_STONE = register("minecraft:smooth_stone"); - public static final BlockType SNOW = register("minecraft:snow"); + public static final BlockType SNOW = register("minecraft:snow", state -> state.with(state.getBlockType().getProperty("layers"), 1)); public static final BlockType SNOW_BLOCK = register("minecraft:snow_block"); public static final BlockType SOUL_SAND = register("minecraft:soul_sand"); public static final BlockType SPAWNER = register("minecraft:spawner"); public static final BlockType SPONGE = register("minecraft:sponge"); - public static final BlockType SPRUCE_BUTTON = register("minecraft:spruce_button"); - public static final BlockType SPRUCE_DOOR = register("minecraft:spruce_door"); - public static final BlockType SPRUCE_FENCE = register("minecraft:spruce_fence"); - public static final BlockType SPRUCE_FENCE_GATE = register("minecraft:spruce_fence_gate"); - public static final BlockType SPRUCE_LEAVES = register("minecraft:spruce_leaves"); - public static final BlockType SPRUCE_LOG = register("minecraft:spruce_log"); + public static final BlockType SPRUCE_BUTTON = register("minecraft:spruce_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType SPRUCE_DOOR = register("minecraft:spruce_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType SPRUCE_FENCE = register("minecraft:spruce_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + public static final BlockType SPRUCE_FENCE_GATE = register("minecraft:spruce_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType SPRUCE_LEAVES = register("minecraft:spruce_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + public static final BlockType SPRUCE_LOG = register("minecraft:spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); public static final BlockType SPRUCE_PLANKS = register("minecraft:spruce_planks"); - public static final BlockType SPRUCE_PRESSURE_PLATE = register("minecraft:spruce_pressure_plate"); - public static final BlockType SPRUCE_SAPLING = register("minecraft:spruce_sapling"); - public static final BlockType SPRUCE_SLAB = register("minecraft:spruce_slab"); - public static final BlockType SPRUCE_STAIRS = register("minecraft:spruce_stairs"); - public static final BlockType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor"); - public static final BlockType SPRUCE_WOOD = register("minecraft:spruce_wood"); - public static final BlockType STICKY_PISTON = register("minecraft:sticky_piston"); + public static final BlockType SPRUCE_PRESSURE_PLATE = register("minecraft:spruce_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType SPRUCE_SAPLING = register("minecraft:spruce_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + public static final BlockType SPRUCE_SLAB = register("minecraft:spruce_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType SPRUCE_STAIRS = register("minecraft:spruce_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType SPRUCE_WOOD = register("minecraft:spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STICKY_PISTON = register("minecraft:sticky_piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType STONE = register("minecraft:stone"); - public static final BlockType STONE_BRICK_SLAB = register("minecraft:stone_brick_slab"); - public static final BlockType STONE_BRICK_STAIRS = register("minecraft:stone_brick_stairs"); + public static final BlockType STONE_BRICK_SLAB = register("minecraft:stone_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType STONE_BRICK_STAIRS = register("minecraft:stone_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); public static final BlockType STONE_BRICKS = register("minecraft:stone_bricks"); - public static final BlockType STONE_BUTTON = register("minecraft:stone_button"); - public static final BlockType STONE_PRESSURE_PLATE = register("minecraft:stone_pressure_plate"); - public static final BlockType STONE_SLAB = register("minecraft:stone_slab"); - public static final BlockType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log"); - public static final BlockType STRIPPED_ACACIA_WOOD = register("minecraft:stripped_acacia_wood"); - public static final BlockType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log"); - public static final BlockType STRIPPED_BIRCH_WOOD = register("minecraft:stripped_birch_wood"); - public static final BlockType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log"); - public static final BlockType STRIPPED_DARK_OAK_WOOD = register("minecraft:stripped_dark_oak_wood"); - public static final BlockType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log"); - public static final BlockType STRIPPED_JUNGLE_WOOD = register("minecraft:stripped_jungle_wood"); - public static final BlockType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log"); - public static final BlockType STRIPPED_OAK_WOOD = register("minecraft:stripped_oak_wood"); - public static final BlockType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log"); - public static final BlockType STRIPPED_SPRUCE_WOOD = register("minecraft:stripped_spruce_wood"); - public static final BlockType STRUCTURE_BLOCK = register("minecraft:structure_block"); + public static final BlockType STONE_BUTTON = register("minecraft:stone_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType STONE_PRESSURE_PLATE = register("minecraft:stone_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + public static final BlockType STONE_SLAB = register("minecraft:stone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_ACACIA_WOOD = register("minecraft:stripped_acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_BIRCH_WOOD = register("minecraft:stripped_birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_DARK_OAK_WOOD = register("minecraft:stripped_dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_JUNGLE_WOOD = register("minecraft:stripped_jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_OAK_WOOD = register("minecraft:stripped_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRIPPED_SPRUCE_WOOD = register("minecraft:stripped_spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + public static final BlockType STRUCTURE_BLOCK = register("minecraft:structure_block", state -> state.with(state.getBlockType().getProperty("mode"), "SAVE")); public static final BlockType STRUCTURE_VOID = register("minecraft:structure_void"); - public static final BlockType SUGAR_CANE = register("minecraft:sugar_cane"); - public static final BlockType SUNFLOWER = register("minecraft:sunflower"); - public static final BlockType TALL_GRASS = register("minecraft:tall_grass"); - public static final BlockType TALL_SEAGRASS = register("minecraft:tall_seagrass"); + public static final BlockType SUGAR_CANE = register("minecraft:sugar_cane", state -> state.with(state.getBlockType().getProperty("age"), 0)); + public static final BlockType SUNFLOWER = register("minecraft:sunflower", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + public static final BlockType TALL_GRASS = register("minecraft:tall_grass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + public static final BlockType TALL_SEAGRASS = register("minecraft:tall_seagrass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); public static final BlockType TERRACOTTA = register("minecraft:terracotta"); public static final BlockType TNT = register("minecraft:tnt"); public static final BlockType TORCH = register("minecraft:torch"); - public static final BlockType TRAPPED_CHEST = register("minecraft:trapped_chest"); - public static final BlockType TRIPWIRE = register("minecraft:tripwire"); - public static final BlockType TRIPWIRE_HOOK = register("minecraft:tripwire_hook"); + public static final BlockType TRAPPED_CHEST = register("minecraft:trapped_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType TRIPWIRE = register("minecraft:tripwire", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("disarmed"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("west"), false)); + public static final BlockType TRIPWIRE_HOOK = register("minecraft:tripwire_hook", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); public static final BlockType TUBE_CORAL = register("minecraft:tube_coral"); public static final BlockType TUBE_CORAL_BLOCK = register("minecraft:tube_coral_block"); - public static final BlockType TUBE_CORAL_FAN = register("minecraft:tube_coral_fan"); - public static final BlockType TUBE_CORAL_WALL_FAN = register("minecraft:tube_coral_wall_fan"); - public static final BlockType TURTLE_EGG = register("minecraft:turtle_egg"); - public static final BlockType VINE = register("minecraft:vine"); + public static final BlockType TUBE_CORAL_FAN = register("minecraft:tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType TUBE_CORAL_WALL_FAN = register("minecraft:tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + public static final BlockType TURTLE_EGG = register("minecraft:turtle_egg", state -> state.with(state.getBlockType().getProperty("eggs"), 1).with(state.getBlockType().getProperty("hatch"), 0)); + public static final BlockType VINE = register("minecraft:vine", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType VOID_AIR = register("minecraft:void_air"); - public static final BlockType WALL_SIGN = register("minecraft:wall_sign"); - public static final BlockType WALL_TORCH = register("minecraft:wall_torch"); - public static final BlockType WATER = register("minecraft:water"); + public static final BlockType WALL_SIGN = register("minecraft:wall_sign", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); + public static final BlockType WALL_TORCH = register("minecraft:wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType WATER = register("minecraft:water", state -> state.with(state.getBlockType().getProperty("level"), 0)); public static final BlockType WET_SPONGE = register("minecraft:wet_sponge"); - public static final BlockType WHEAT = register("minecraft:wheat"); - public static final BlockType WHITE_BANNER = register("minecraft:white_banner"); - public static final BlockType WHITE_BED = register("minecraft:white_bed"); + public static final BlockType WHEAT = register("minecraft:wheat", state -> state.with(state.getBlockType().getProperty("age"), 0)); + public static final BlockType WHITE_BANNER = register("minecraft:white_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType WHITE_BED = register("minecraft:white_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType WHITE_CARPET = register("minecraft:white_carpet"); public static final BlockType WHITE_CONCRETE = register("minecraft:white_concrete"); public static final BlockType WHITE_CONCRETE_POWDER = register("minecraft:white_concrete_powder"); - public static final BlockType WHITE_GLAZED_TERRACOTTA = register("minecraft:white_glazed_terracotta"); - public static final BlockType WHITE_SHULKER_BOX = register("minecraft:white_shulker_box"); + public static final BlockType WHITE_GLAZED_TERRACOTTA = register("minecraft:white_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType WHITE_SHULKER_BOX = register("minecraft:white_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType WHITE_STAINED_GLASS = register("minecraft:white_stained_glass"); - public static final BlockType WHITE_STAINED_GLASS_PANE = register("minecraft:white_stained_glass_pane"); + public static final BlockType WHITE_STAINED_GLASS_PANE = register("minecraft:white_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType WHITE_TERRACOTTA = register("minecraft:white_terracotta"); public static final BlockType WHITE_TULIP = register("minecraft:white_tulip"); - public static final BlockType WHITE_WALL_BANNER = register("minecraft:white_wall_banner"); + public static final BlockType WHITE_WALL_BANNER = register("minecraft:white_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType WHITE_WOOL = register("minecraft:white_wool"); - public static final BlockType WITHER_SKELETON_SKULL = register("minecraft:wither_skeleton_skull"); - public static final BlockType WITHER_SKELETON_WALL_SKULL = register("minecraft:wither_skeleton_wall_skull"); - public static final BlockType YELLOW_BANNER = register("minecraft:yellow_banner"); - public static final BlockType YELLOW_BED = register("minecraft:yellow_bed"); + public static final BlockType WITHER_SKELETON_SKULL = register("minecraft:wither_skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType WITHER_SKELETON_WALL_SKULL = register("minecraft:wither_skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType YELLOW_BANNER = register("minecraft:yellow_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType YELLOW_BED = register("minecraft:yellow_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); public static final BlockType YELLOW_CARPET = register("minecraft:yellow_carpet"); public static final BlockType YELLOW_CONCRETE = register("minecraft:yellow_concrete"); public static final BlockType YELLOW_CONCRETE_POWDER = register("minecraft:yellow_concrete_powder"); - public static final BlockType YELLOW_GLAZED_TERRACOTTA = register("minecraft:yellow_glazed_terracotta"); - public static final BlockType YELLOW_SHULKER_BOX = register("minecraft:yellow_shulker_box"); + public static final BlockType YELLOW_GLAZED_TERRACOTTA = register("minecraft:yellow_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + public static final BlockType YELLOW_SHULKER_BOX = register("minecraft:yellow_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); public static final BlockType YELLOW_STAINED_GLASS = register("minecraft:yellow_stained_glass"); - public static final BlockType YELLOW_STAINED_GLASS_PANE = register("minecraft:yellow_stained_glass_pane"); + public static final BlockType YELLOW_STAINED_GLASS_PANE = register("minecraft:yellow_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); public static final BlockType YELLOW_TERRACOTTA = register("minecraft:yellow_terracotta"); - public static final BlockType YELLOW_WALL_BANNER = register("minecraft:yellow_wall_banner"); + public static final BlockType YELLOW_WALL_BANNER = register("minecraft:yellow_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); public static final BlockType YELLOW_WOOL = register("minecraft:yellow_wool"); - public static final BlockType ZOMBIE_HEAD = register("minecraft:zombie_head"); - public static final BlockType ZOMBIE_WALL_HEAD = register("minecraft:zombie_wall_head"); + public static final BlockType ZOMBIE_HEAD = register("minecraft:zombie_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + public static final BlockType ZOMBIE_WALL_HEAD = register("minecraft:zombie_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); private BlockTypes() { } @@ -627,6 +631,10 @@ public final class BlockTypes { return register(new BlockType(id)); } + private static BlockType register(final String id, Function values) { + return register(new BlockType(id, values)); + } + public static BlockType register(final BlockType block) { return BlockType.REGISTRY.register(block.getId(), block); } From 9f9fda72b79434d74e8c2e13cce11a13201867b2 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 23 Jul 2018 12:48:11 +1000 Subject: [PATCH 52/74] Re-add legacy support to block parser, and fix query tool. --- .../com/sk89q/worldedit/blocks/BaseBlock.java | 6 +- .../worldedit/command/tool/QueryTool.java | 6 +- .../extension/factory/DefaultBlockParser.java | 126 ++++++++++-------- .../extension/input/ParserContext.java | 19 +++ .../worldedit/world/block/BlockState.java | 5 + .../world/registry/LegacyMapper.java | 5 +- 6 files changed, 108 insertions(+), 59 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 10e0814d1..d9c976c65 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -227,7 +227,11 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { @Override public String toString() { - return "Block{State: " + this.toImmutableState().toString() + ", NBT: " + String.valueOf(getNbtData()) + "}"; +// if (getNbtData() != null) { // TODO Maybe make some JSON serialiser to make this not awful. +// return blockState.getAsString() + " {" + String.valueOf(getNbtData()) + "}"; +// } else { + return blockState.getAsString(); +// } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index 435da2cdb..5a8f6165e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -47,10 +47,10 @@ public class QueryTool implements BlockTool { BlockStateHolder block = editSession.getFullBlock(clicked.toVector()); player.print("\u00A79@" + clicked.toVector() + ": " + "\u00A7e" - + "#" + block.getBlockType() + "\u00A77" + " (" - + block.getBlockType().getId() + ") " + + block.getBlockType().getName() + "\u00A77" + " (" + + block.toString() + ") " + "\u00A7f" - + "[" + block.getStates().toString() + "]" + " (" + world.getBlockLightLevel(clicked.toVector()) + "/" + world.getBlockLightLevel(clicked.toVector().add(0, 1, 0)) + ")"); + + " (" + world.getBlockLightLevel(clicked.toVector()) + "/" + world.getBlockLightLevel(clicked.toVector().add(0, 1, 0)) + ")"); if (block instanceof MobSpawnerBlock) { player.printRaw("\u00A7e" + "Mob Type: " diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 5d58d0e49..7c90051bc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -44,6 +44,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.registry.LegacyMapper; import java.util.HashMap; import java.util.Map; @@ -185,71 +186,90 @@ class DefaultBlockParser extends InputParser { } private BlockStateHolder parseLogic(String input, ParserContext context) throws InputParseException { - BlockType blockType; + BlockType blockType = null; Map, Object> blockStates = new HashMap<>(); String[] blockAndExtraData = input.trim().split("\\|"); blockAndExtraData[0] = woolMapper(blockAndExtraData[0]); - Matcher matcher = blockStatePattern.matcher(blockAndExtraData[0]); - if (!matcher.matches() || matcher.groupCount() < 2 || matcher.groupCount() > 3) { - throw new InputParseException("Invalid format"); - } - String typeString = matcher.group(1); - String[] stateProperties = EMPTY_STRING_ARRAY; - if (matcher.groupCount() >= 2 && matcher.group(2) != null) { - stateProperties = matcher.group(2).split(","); - } - if ("hand".equalsIgnoreCase(typeString)) { - // Get the block type from the item in the user's hand. - final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND); - if (blockInHand.getClass() != BaseBlock.class) { - return blockInHand; - } + BlockState state = null; - blockType = blockInHand.getBlockType(); - blockStates = blockInHand.getStates(); - } else if ("offhand".equalsIgnoreCase(typeString)) { - // Get the block type from the item in the user's off hand. - final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.OFF_HAND); - if (blockInHand.getClass() != BaseBlock.class) { - return blockInHand; - } - - blockType = blockInHand.getBlockType(); - blockStates = blockInHand.getStates(); - } else if ("pos1".equalsIgnoreCase(typeString)) { - // Get the block type from the "primary position" - final World world = context.requireWorld(); - final BlockVector primaryPosition; + // Legacy matcher + if (context.isTryingLegacy()) { try { - primaryPosition = context.requireSession().getRegionSelector(world).getPrimaryPosition(); - } catch (IncompleteRegionException e) { - throw new InputParseException("Your selection is not complete."); - } - final BlockState blockInHand = world.getBlock(primaryPosition); - - blockType = blockInHand.getBlockType(); - blockStates = blockInHand.getStates(); - } else { - // Attempt to lookup a block from ID or name. - blockType = BlockTypes.get(typeString); - - if (blockType == null) { - throw new NoMatchException("Does not match a valid block type: '" + input + "'"); + String[] split = blockAndExtraData[0].split(":"); + if (split.length == 1) { + state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0])); + } else { + state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0]), Integer.parseInt(split[1])); + } + if (state != null) { + blockType = state.getBlockType(); + } + } catch (NumberFormatException e) { } } - BlockState state; + if (state == null) { + Matcher matcher = blockStatePattern.matcher(blockAndExtraData[0]); // TODO Move away from regex because it's hella slow + if (!matcher.matches() || matcher.groupCount() < 2 || matcher.groupCount() > 3) { + throw new InputParseException("Invalid format"); + } + String typeString = matcher.group(1); + String[] stateProperties = EMPTY_STRING_ARRAY; + if (matcher.groupCount() >= 2 && matcher.group(2) != null) { + stateProperties = matcher.group(2).split(","); + } - if (!context.isPreferringWildcard()) { - // No wildcards allowed => eliminate them. (Start with default state) - state = blockType.getDefaultState(); - } else { - state = new BlockState(blockType, blockStates); + if ("hand".equalsIgnoreCase(typeString)) { + // Get the block type from the item in the user's hand. + final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND); + if (blockInHand.getClass() != BaseBlock.class) { + return blockInHand; + } + + blockType = blockInHand.getBlockType(); + blockStates = blockInHand.getStates(); + } else if ("offhand".equalsIgnoreCase(typeString)) { + // Get the block type from the item in the user's off hand. + final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.OFF_HAND); + if (blockInHand.getClass() != BaseBlock.class) { + return blockInHand; + } + + blockType = blockInHand.getBlockType(); + blockStates = blockInHand.getStates(); + } else if ("pos1".equalsIgnoreCase(typeString)) { + // Get the block type from the "primary position" + final World world = context.requireWorld(); + final BlockVector primaryPosition; + try { + primaryPosition = context.requireSession().getRegionSelector(world).getPrimaryPosition(); + } catch (IncompleteRegionException e) { + throw new InputParseException("Your selection is not complete."); + } + final BlockState blockInHand = world.getBlock(primaryPosition); + + blockType = blockInHand.getBlockType(); + blockStates = blockInHand.getStates(); + } else { + // Attempt to lookup a block from ID or name. + blockType = BlockTypes.get(typeString); + + if (blockType == null) { + throw new NoMatchException("Does not match a valid block type: '" + input + "'"); + } + } + + if (!context.isPreferringWildcard()) { + // No wildcards allowed => eliminate them. (Start with default state) + state = blockType.getDefaultState(); + } else { + state = new BlockState(blockType, blockStates); + } + + state = applyProperties(state, stateProperties); } - state = applyProperties(state, stateProperties); - // Check if the item is allowed if (context.isRestricted()) { Actor actor = context.requireActor(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java index b2f61e880..d6fced5eb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java @@ -40,6 +40,7 @@ public class ParserContext { private @Nullable World world; private @Nullable Actor actor; private boolean restricted = true; + private boolean tryLegacy = true; private boolean preferringWildcard; /** @@ -60,6 +61,7 @@ public class ParserContext { setActor(other.getActor()); setRestricted(other.isRestricted()); setPreferringWildcard(other.isPreferringWildcard()); + setTryLegacy(other.isTryingLegacy()); } /** @@ -229,4 +231,21 @@ public class ParserContext { this.preferringWildcard = preferringWildcard; } + /** + * Set whether legacy IDs should be attempted. + * + * @param tryLegacy true if legacy IDs should be attempted + */ + public void setTryLegacy(boolean tryLegacy) { + this.tryLegacy = tryLegacy; + } + + /** + * Get whether legacy IDs should be tried. + * + * @return true if legacy should be tried + */ + public boolean isTryingLegacy() { + return tryLegacy; + } } 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 7adfdded5..8828d12f2 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 @@ -212,4 +212,9 @@ public class BlockState implements BlockStateHolder { this.values.put(property, value); return this; } + + @Override + public String toString() { + return getAsString(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index 8950b8242..6b1be416f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -81,13 +81,14 @@ public class LegacyMapper { ParserContext parserContext = new ParserContext(); parserContext.setPreferringWildcard(false); parserContext.setRestricted(false); + parserContext.setTryLegacy(false); // This is legacy. Don't match itself. for (Map.Entry blockEntry : dataFile.blocks.entrySet()) { try { blockMap.put(blockEntry.getKey(), (BlockState) WorldEdit.getInstance().getBlockFactory().parseFromInput(blockEntry.getValue(), parserContext)); } catch (Exception e) { - log.warning("Unknown block: " + blockEntry.getValue()); + log.fine("Unknown block: " + blockEntry.getValue()); } } @@ -95,7 +96,7 @@ public class LegacyMapper { try { itemMap.put(itemEntry.getKey(), ItemTypes.get(itemEntry.getValue())); } catch (Exception e) { - log.warning("Unknown item: " + itemEntry.getValue()); + log.fine("Unknown item: " + itemEntry.getValue()); } } } From 3f1f52d1f1981b66712009803b43c5c02816010e Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 24 Jul 2018 11:21:29 +1000 Subject: [PATCH 53/74] Made a few schematic related fixes. Made the deprecation error more obvious. --- .../com/sk89q/worldedit/CuboidClipboard.java | 80 +++++-------------- .../extent/clipboard/io/ClipboardFormat.java | 4 +- .../schematic/MCEditSchematicFormat.java | 11 ++- .../worldedit/schematic/SchematicFormat.java | 36 --------- 4 files changed, 27 insertions(+), 104 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java index 820426fbb..b286802bb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java @@ -22,8 +22,6 @@ package com.sk89q.worldedit; import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.command.ClipboardCommands; import com.sk89q.worldedit.command.SchematicCommands; import com.sk89q.worldedit.entity.Entity; @@ -32,11 +30,9 @@ import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.function.operation.ForwardExtentCopy; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.schematic.SchematicFormat; -import com.sk89q.worldedit.world.DataException; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; -import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -83,7 +79,7 @@ public class CuboidClipboard { checkNotNull(size); this.size = size; - data = new BaseBlock[size.getBlockX()][size.getBlockY()][size.getBlockZ()]; + data = new BlockStateHolder[size.getBlockX()][size.getBlockY()][size.getBlockZ()]; origin = new Vector(); offset = new Vector(); } @@ -100,7 +96,7 @@ public class CuboidClipboard { checkNotNull(origin); this.size = size; - data = new BaseBlock[size.getBlockX()][size.getBlockY()][size.getBlockZ()]; + data = new BlockStateHolder[size.getBlockX()][size.getBlockY()][size.getBlockZ()]; this.origin = origin; offset = new Vector(); } @@ -119,7 +115,7 @@ public class CuboidClipboard { checkNotNull(offset); this.size = size; - data = new BaseBlock[size.getBlockX()][size.getBlockY()][size.getBlockZ()]; + data = new BlockStateHolder[size.getBlockX()][size.getBlockY()][size.getBlockZ()]; this.origin = origin; this.offset = offset; } @@ -160,8 +156,12 @@ public class CuboidClipboard { for (int x = 0; x < size.getBlockX(); ++x) { for (int y = 0; y < size.getBlockY(); ++y) { for (int z = 0; z < size.getBlockZ(); ++z) { - data[x][y][z] = - editSession.getBlock(new Vector(x, y, z).add(getOrigin())); + BaseBlock fullBlock = editSession.getFullBlock(new Vector(x, y, z).add(getOrigin())); + if (fullBlock.getNbtData() != null) { + data[x][y][z] = fullBlock; + } else { + data[x][y][z] = fullBlock.toImmutableState(); + } } } } @@ -179,7 +179,12 @@ public class CuboidClipboard { for (int z = 0; z < size.getBlockZ(); ++z) { final Vector pt = new Vector(x, y, z).add(getOrigin()); if (region.contains(pt)) { - data[x][y][z] = editSession.getBlock(pt); + BaseBlock fullBlock = editSession.getFullBlock(pt); + if (fullBlock.getNbtData() != null) { + data[x][y][z] = fullBlock; + } else { + data[x][y][z] = fullBlock.toImmutableState(); + } } else { data[x][y][z] = null; } @@ -287,26 +292,6 @@ public class CuboidClipboard { this.entities.add(new CopiedEntity(entity)); } - /** - * Get the block at the given position. - * - *

If the position is out of bounds, air will be returned.

- * - * @param position the point, relative to the origin of the copy (0, 0, 0) and not to the actual copy origin - * @return air, if this block was outside the (non-cuboid) selection while copying - * @throws ArrayIndexOutOfBoundsException if the position is outside the bounds of the CuboidClipboard - * @deprecated use {@link #getBlock(Vector)} instead - */ - @Deprecated - public BlockStateHolder getPoint(Vector position) throws ArrayIndexOutOfBoundsException { - final BlockStateHolder block = getBlock(position); - if (block == null) { - return BlockTypes.AIR.getDefaultState(); - } - - return block; - } - /** * Get the block at the given position. * @@ -327,7 +312,7 @@ public class CuboidClipboard { * @param block the block to set * @throws ArrayIndexOutOfBoundsException if the position is outside the bounds of the CuboidClipboard */ - public void setBlock(Vector position, BaseBlock block) { + public void setBlock(Vector position, BlockStateHolder block) { data[position.getBlockX()][position.getBlockY()][position.getBlockZ()] = block; } @@ -340,35 +325,6 @@ public class CuboidClipboard { return size; } - /** - * Saves the clipboard data to a .schematic-format file. - * - * @param path the path to the file to save - * @throws IOException thrown on I/O error - * @throws DataException thrown on error writing the data for other reasons - * @deprecated use {@link SchematicFormat#MCEDIT} - */ - @Deprecated - public void saveSchematic(File path) throws IOException, DataException { - checkNotNull(path); - SchematicFormat.MCEDIT.save(this, path); - } - - /** - * Load a .schematic file into a clipboard. - * - * @param path the path to the file to load - * @return a clipboard - * @throws IOException thrown on I/O error - * @throws DataException thrown on error writing the data for other reasons - * @deprecated use {@link SchematicFormat#MCEDIT} - */ - @Deprecated - public static CuboidClipboard loadSchematic(File path) throws DataException, IOException { - checkNotNull(path); - return SchematicFormat.MCEDIT.load(path); - } - /** * Get the origin point, which corresponds to where the copy was * originally copied from. The origin is the lowest possible X, Y, and diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java index c654c9d82..2c035094f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java @@ -57,7 +57,7 @@ public enum ClipboardFormat { @Override public ClipboardWriter getWriter(OutputStream outputStream) throws IOException { - throw new UnsupportedOperationException("This clipboard format is deprecated."); + throw new IOException("This clipboard format no longer supports saving."); } @Override @@ -85,7 +85,7 @@ public enum ClipboardFormat { * * @param aliases an array of aliases by which this format may be referred to */ - private ClipboardFormat(String ... aliases) { + ClipboardFormat(String... aliases) { this.aliases = aliases; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java index af4638e30..7c3f0fc7a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java @@ -34,6 +34,8 @@ import com.sk89q.worldedit.CuboidClipboard; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.DataException; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.registry.LegacyMapper; import java.io.DataInputStream; import java.io.File; @@ -181,12 +183,13 @@ public class MCEditSchematicFormat extends SchematicFormat { for (int z = 0; z < length; ++z) { int index = y * width * length + z * width + x; BlockVector pt = new BlockVector(x, y, z); - BaseBlock block = getBlockForId(blocks[index], blockData[index]); + BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(blocks[index], blockData[index]); if (tileEntitiesMap.containsKey(pt)) { - block.setNbtData(new CompoundTag(tileEntitiesMap.get(pt))); + clipboard.setBlock(pt, new BaseBlock(state, new CompoundTag(tileEntitiesMap.get(pt)))); + } else { + clipboard.setBlock(pt, state); } - clipboard.setBlock(pt, block); } } } @@ -201,7 +204,7 @@ public class MCEditSchematicFormat extends SchematicFormat { @Override public void save(CuboidClipboard clipboard, File file) throws IOException, DataException { - throw new UnsupportedOperationException("Saving is deprecated"); + throw new DataException("This clipboard format no longer supports saving."); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java index 1f87a0da9..48c59f954 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java @@ -83,42 +83,6 @@ public abstract class SchematicFormat { return lookupNames; } - public BaseBlock getBlockForId(int id, short data) { - BaseBlock block; - switch (id) { - /*case BlockID.WALL_SIGN: - case BlockID.SIGN_POST: - block = new SignBlock(id, data); - break; - - case BlockID.CHEST: - block = new ChestBlock(data); - break; - - case BlockID.FURNACE: - case BlockID.BURNING_FURNACE: - block = new FurnaceBlock(id, data); - break; - - case BlockID.DISPENSER: - block = new DispenserBlock(data); - break; - - case BlockID.MOB_SPAWNER: - block = new MobSpawnerBlock(id); - break; - - case BlockID.NOTE_BLOCK: - block = new NoteBlock(data); - break;*/ - - default: - block = new BaseBlock(id, data); - break; - } - return block; - } - /** * Loads a schematic from the given file into a CuboidClipboard * @param file The file to load from From bc2279f2f612345032d526966a353054654d9a52 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 24 Jul 2018 11:50:57 +1000 Subject: [PATCH 54/74] Refactor schematics to use kenzierocks registerable system. --- .../src/main/java/com/sk89q/jnbt/ListTag.java | 5 +- .../com/sk89q/worldedit/CuboidClipboard.java | 388 ------------------ .../java/com/sk89q/worldedit/WorldEdit.java | 92 ++--- .../worldedit/command/SchematicCommands.java | 24 +- .../clipboard/io/BuiltInClipboardFormat.java | 107 +++++ .../extent/clipboard/io/ClipboardFormat.java | 109 +---- .../extent/clipboard/io/ClipboardFormats.java | 125 ++++++ .../extent/clipboard/io/ClipboardReader.java | 3 +- .../extent/clipboard/io/SchematicReader.java | 4 + .../schematic/MCEditSchematicFormat.java | 249 ----------- .../worldedit/schematic/SchematicFormat.java | 107 ----- 11 files changed, 309 insertions(+), 904 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java index 3cbe42977..1b8d1fa21 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java @@ -79,11 +79,10 @@ public final class ListTag extends Tag { */ @Nullable public Tag getIfExists(int index) { - try { - return value.get(index); - } catch (NoSuchElementException e) { + if (index >= value.size()) { return null; } + return value.get(index); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java deleted file mode 100644 index b286802bb..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java +++ /dev/null @@ -1,388 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.command.ClipboardCommands; -import com.sk89q.worldedit.command.SchematicCommands; -import com.sk89q.worldedit.entity.Entity; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.function.operation.ForwardExtentCopy; -import com.sk89q.worldedit.regions.CuboidRegion; -import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; - -import java.util.ArrayList; -import java.util.List; - -/** - * The clipboard remembers the state of a cuboid region. - * - * @deprecated This is slowly being replaced with {@link Clipboard}, which is - * far more versatile. Transforms are supported using affine - * transformations and full entity support is provided because - * the clipboard properly implements {@link Extent}. However, - * the new clipboard class is only available in WorldEdit 6.x and - * beyond. We intend on keeping this deprecated class in WorldEdit - * for an extended amount of time so there is no rush to - * switch (but new features will not be supported). To copy between - * a clipboard and a world (or between any two {@code Extent}s), - * one can use {@link ForwardExtentCopy}. See - * {@link ClipboardCommands} and {@link SchematicCommands} for - * more information. - */ -@Deprecated -public class CuboidClipboard { - - /** - * An enum of possible flip directions. - */ - public enum FlipDirection { - NORTH_SOUTH, - WEST_EAST, - UP_DOWN - } - - private BlockStateHolder[][][] data; - private Vector offset; - private Vector origin; - private Vector size; - private List entities = new ArrayList<>(); - - /** - * Constructs the clipboard. - * - * @param size the dimensions of the clipboard (should be at least 1 on every dimension) - */ - public CuboidClipboard(Vector size) { - checkNotNull(size); - - this.size = size; - data = new BlockStateHolder[size.getBlockX()][size.getBlockY()][size.getBlockZ()]; - origin = new Vector(); - offset = new Vector(); - } - - /** - * Constructs the clipboard. - * - * @param size the dimensions of the clipboard (should be at least 1 on every dimension) - * @param origin the origin point where the copy was made, which must be the - * {@link CuboidRegion#getMinimumPoint()} relative to the copy - */ - public CuboidClipboard(Vector size, Vector origin) { - checkNotNull(size); - checkNotNull(origin); - - this.size = size; - data = new BlockStateHolder[size.getBlockX()][size.getBlockY()][size.getBlockZ()]; - this.origin = origin; - offset = new Vector(); - } - - /** - * Constructs the clipboard. - * - * @param size the dimensions of the clipboard (should be at least 1 on every dimension) - * @param origin the origin point where the copy was made, which must be the - * {@link CuboidRegion#getMinimumPoint()} relative to the copy - * @param offset the offset from the minimum point of the copy where the user was - */ - public CuboidClipboard(Vector size, Vector origin, Vector offset) { - checkNotNull(size); - checkNotNull(origin); - checkNotNull(offset); - - this.size = size; - data = new BlockStateHolder[size.getBlockX()][size.getBlockY()][size.getBlockZ()]; - this.origin = origin; - this.offset = offset; - } - - /** - * Get the width (X-direction) of the clipboard. - * - * @return width - */ - public int getWidth() { - return size.getBlockX(); - } - - /** - * Get the length (Z-direction) of the clipboard. - * - * @return length - */ - public int getLength() { - return size.getBlockZ(); - } - - /** - * Get the height (Y-direction) of the clipboard. - * - * @return height - */ - public int getHeight() { - return size.getBlockY(); - } - - /** - * Copies blocks to the clipboard. - * - * @param editSession the EditSession from which to take the blocks - */ - public void copy(EditSession editSession) { - for (int x = 0; x < size.getBlockX(); ++x) { - for (int y = 0; y < size.getBlockY(); ++y) { - for (int z = 0; z < size.getBlockZ(); ++z) { - BaseBlock fullBlock = editSession.getFullBlock(new Vector(x, y, z).add(getOrigin())); - if (fullBlock.getNbtData() != null) { - data[x][y][z] = fullBlock; - } else { - data[x][y][z] = fullBlock.toImmutableState(); - } - } - } - } - } - - /** - * Copies blocks to the clipboard. - * - * @param editSession The EditSession from which to take the blocks - * @param region A region that further constrains which blocks to take. - */ - public void copy(EditSession editSession, Region region) { - for (int x = 0; x < size.getBlockX(); ++x) { - for (int y = 0; y < size.getBlockY(); ++y) { - for (int z = 0; z < size.getBlockZ(); ++z) { - final Vector pt = new Vector(x, y, z).add(getOrigin()); - if (region.contains(pt)) { - BaseBlock fullBlock = editSession.getFullBlock(pt); - if (fullBlock.getNbtData() != null) { - data[x][y][z] = fullBlock; - } else { - data[x][y][z] = fullBlock.toImmutableState(); - } - } else { - data[x][y][z] = null; - } - } - } - } - } - - /** - * Paste the clipboard at the given location using the given {@code EditSession}. - * - *

This method blocks the server/game until the entire clipboard is - * pasted. In the future, {@link ForwardExtentCopy} will be recommended, - * which, if combined with the proposed operation scheduler framework, - * will not freeze the game/server.

- * - * @param editSession the EditSession to which blocks are to be copied to - * @param newOrigin the new origin point (must correspond to the minimum point of the cuboid) - * @param noAir true to not copy air blocks in the source - * @throws MaxChangedBlocksException thrown if too many blocks were changed - */ - public void paste(EditSession editSession, Vector newOrigin, boolean noAir) throws MaxChangedBlocksException { - paste(editSession, newOrigin, noAir, false); - } - - /** - * Paste the clipboard at the given location using the given {@code EditSession}. - * - *

This method blocks the server/game until the entire clipboard is - * pasted. In the future, {@link ForwardExtentCopy} will be recommended, - * which, if combined with the proposed operation scheduler framework, - * will not freeze the game/server.

- * - * @param editSession the EditSession to which blocks are to be copied to - * @param newOrigin the new origin point (must correspond to the minimum point of the cuboid) - * @param noAir true to not copy air blocks in the source - * @param entities true to copy entities - * @throws MaxChangedBlocksException thrown if too many blocks were changed - */ - public void paste(EditSession editSession, Vector newOrigin, boolean noAir, boolean entities) throws MaxChangedBlocksException { - place(editSession, newOrigin.add(offset), noAir); - if (entities) { - pasteEntities(newOrigin.add(offset)); - } - } - - /** - * Paste the clipboard at the given location using the given {@code EditSession}. - * - *

This method blocks the server/game until the entire clipboard is - * pasted. In the future, {@link ForwardExtentCopy} will be recommended, - * which, if combined with the proposed operation scheduler framework, - * will not freeze the game/server.

- * - * @param editSession the EditSession to which blocks are to be copied to - * @param newOrigin the new origin point (must correspond to the minimum point of the cuboid) - * @param noAir true to not copy air blocks in the source - * @throws MaxChangedBlocksException thrown if too many blocks were changed - */ - public void place(EditSession editSession, Vector newOrigin, boolean noAir) throws MaxChangedBlocksException { - for (int x = 0; x < size.getBlockX(); ++x) { - for (int y = 0; y < size.getBlockY(); ++y) { - for (int z = 0; z < size.getBlockZ(); ++z) { - final BlockStateHolder block = data[x][y][z]; - if (block == null) { - continue; - } - - if (noAir && block.getBlockType() == BlockTypes.AIR) { - continue; - } - - editSession.setBlock(new Vector(x, y, z).add(newOrigin), block); - } - } - } - } - - /** - * Paste the stored entities to the given position. - * - * @param newOrigin the new origin - * @return a list of entities that were pasted - */ - public Entity[] pasteEntities(Vector newOrigin) { - Entity[] entities = new Entity[this.entities.size()]; - for (int i = 0; i < this.entities.size(); ++i) { - CopiedEntity copied = this.entities.get(i); - if (copied.entity.getExtent().createEntity( - copied.entity.getLocation().setPosition(copied.relativePosition.add(newOrigin)), - copied.entity.getState() - ) != null) { - entities[i] = copied.entity; - } - } - return entities; - } - - /** - * Store an entity. - * - * @param entity the entity - */ - public void storeEntity(Entity entity) { - this.entities.add(new CopiedEntity(entity)); - } - - /** - * Get the block at the given position. - * - *

If the position is out of bounds, air will be returned.

- * - * @param position the point, relative to the origin of the copy (0, 0, 0) and not to the actual copy origin - * @return null, if this block was outside the (non-cuboid) selection while copying - * @throws ArrayIndexOutOfBoundsException if the position is outside the bounds of the CuboidClipboard - */ - public BlockStateHolder getBlock(Vector position) throws ArrayIndexOutOfBoundsException { - return data[position.getBlockX()][position.getBlockY()][position.getBlockZ()]; - } - - /** - * Set the block at a position in the clipboard. - * - * @param position the point, relative to the origin of the copy (0, 0, 0) and not to the actual copy origin. - * @param block the block to set - * @throws ArrayIndexOutOfBoundsException if the position is outside the bounds of the CuboidClipboard - */ - public void setBlock(Vector position, BlockStateHolder block) { - data[position.getBlockX()][position.getBlockY()][position.getBlockZ()] = block; - } - - /** - * Get the dimensions of the clipboard. - * - * @return the dimensions, where (1, 1, 1) is 1 wide, 1 across, 1 deep - */ - public Vector getSize() { - return size; - } - - /** - * Get the origin point, which corresponds to where the copy was - * originally copied from. The origin is the lowest possible X, Y, and - * Z components of the cuboid region that was copied. - * - * @return the origin - */ - public Vector getOrigin() { - return origin; - } - - /** - * Set the origin point, which corresponds to where the copy was - * originally copied from. The origin is the lowest possible X, Y, and - * Z components of the cuboid region that was copied. - * - * @param origin the origin to set - */ - public void setOrigin(Vector origin) { - checkNotNull(origin); - this.origin = origin; - } - - /** - * Get the offset of the player to the clipboard's minimum point - * (minimum X, Y, Z coordinates). - * - *

The offset is inverse (multiplied by -1).

- * - * @return the offset the offset - */ - public Vector getOffset() { - return offset; - } - - /** - * Set the offset of the player to the clipboard's minimum point - * (minimum X, Y, Z coordinates). - * - *

The offset is inverse (multiplied by -1).

- * - * @param offset the new offset - */ - public void setOffset(Vector offset) { - this.offset = offset; - } - - /** - * Stores a copied entity. - */ - private class CopiedEntity { - private final Entity entity; - private final Vector relativePosition; - - private CopiedEntity(Entity entity) { - this.entity = entity; - this.relativePosition = entity.getLocation().toVector().subtract(getOrigin()); - } - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 5880047d8..c2c18ede2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -22,10 +22,10 @@ package com.sk89q.worldedit; import static com.sk89q.worldedit.event.platform.Interaction.HIT; import static com.sk89q.worldedit.event.platform.Interaction.OPEN; -import com.sk89q.worldedit.CuboidClipboard.FlipDirection; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; -import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.platform.BlockInteractEvent; import com.sk89q.worldedit.event.platform.InputType; @@ -51,6 +51,7 @@ import com.sk89q.worldedit.util.io.file.FilenameException; import com.sk89q.worldedit.util.io.file.FilenameResolutionException; import com.sk89q.worldedit.util.io.file.InvalidFilenameException; import com.sk89q.worldedit.util.logging.WorldEditPrefixHandler; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.BundledItemData; import com.sk89q.worldedit.world.registry.LegacyMapper; @@ -61,6 +62,8 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; +import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -253,15 +256,8 @@ public class WorldEdit { throw new FileSelectionAbortedException("No file selected"); } } else { - if (defaultExt != null && filename.lastIndexOf('.') == -1) { - filename += "." + defaultExt; - } - - if (!filename.matches("^[A-Za-z0-9_\\- \\./\\\\'\\$@~!%\\^\\*\\(\\)\\[\\]\\+\\{\\},\\?]+\\.[A-Za-z0-9]+$")) { - throw new InvalidFilenameException(filename, "Invalid characters or extension missing"); - } - - f = new File(dir, filename); + List exts = extensions == null ? ImmutableList.of(defaultExt) : Lists.asList(defaultExt, extensions); + return getSafeFileWithExtensions(dir, filename, exts, isSave); } try { @@ -280,6 +276,39 @@ public class WorldEdit { } } + private File getSafeFileWithExtensions(File dir, String filename, List exts, boolean isSave) throws InvalidFilenameException { + if (isSave) { + // First is default, only use that. + if (exts.size() != 1) { + exts = exts.subList(0, 1); + } + } + File result = null; + for (Iterator iter = exts.iterator(); iter.hasNext() && (result == null || !result.exists());) { + result = getSafeFileWithExtension(dir, filename, iter.next()); + } + if (result == null) { + throw new InvalidFilenameException(filename, "Invalid characters or extension missing"); + } + return result; + } + + private File getSafeFileWithExtension(File dir, String filename, String extension) { + if (extension != null && filename.lastIndexOf('.') == -1) { + filename += "." + extension; + } + + if (!checkFilename(filename)) { + return null; + } + + return new File(dir, filename); + } + + private boolean checkFilename(String filename) { + return filename.matches("^[A-Za-z0-9_\\- \\./\\\\'\\$@~!%\\^\\*\\(\\)\\[\\]\\+\\{\\},\\?]+\\.[A-Za-z0-9]+$"); + } + /** * Load the bundled mappings. */ @@ -431,47 +460,6 @@ public class WorldEdit { return dir; } - /** - * Get diagonal direction vector for a player's direction. May return - * null if a direction could not be found. - * - * @param player the player - * @param dirStr the direction string - * @return a direction vector - * @throws UnknownDirectionException thrown if the direction is not known - */ - public Vector getDiagonalDirection(Player player, String dirStr) throws UnknownDirectionException { - return getPlayerDirection(player, dirStr.toLowerCase()).vector(); - } - - /** - * Get the flip direction for a player's direction. - * - * @param player the player - * @param dirStr the direction string - * @return a direction vector - * @throws UnknownDirectionException thrown if the direction is not known - */ - public FlipDirection getFlipDirection(Player player, String dirStr) throws UnknownDirectionException { - final PlayerDirection dir = getPlayerDirection(player, dirStr); - switch (dir) { - case WEST: - case EAST: - return FlipDirection.WEST_EAST; - - case NORTH: - case SOUTH: - return FlipDirection.NORTH_SOUTH; - - case UP: - case DOWN: - return FlipDirection.UP_DOWN; - - default: - throw new UnknownDirectionException(dir.name()); - } - } - /** * Flush a block bag's changes to a player. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index f3744bcb5..2f85734e7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -35,6 +35,7 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; +import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter; import com.sk89q.worldedit.function.operation.Operations; @@ -44,7 +45,6 @@ import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; import com.sk89q.worldedit.util.io.Closer; import com.sk89q.worldedit.util.io.file.FilenameException; -import com.sk89q.worldedit.world.registry.Registries; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; @@ -93,14 +93,17 @@ public class SchematicCommands { LocalConfiguration config = worldEdit.getConfiguration(); File dir = worldEdit.getWorkingDirectoryFile(config.saveDir); - File f = worldEdit.getSafeOpenFile(player, dir, filename, "schematic", "schematic"); + File f = worldEdit.getSafeOpenFile(player, dir, filename, "schematic", ClipboardFormats.getFileExtensionArray()); if (!f.exists()) { player.printError("Schematic " + filename + " does not exist!"); return; } - ClipboardFormat format = ClipboardFormat.findByAlias(formatName); + ClipboardFormat format = ClipboardFormats.findByFile(f); + if (format == null) { + format = ClipboardFormats.findByAlias(formatName); + } if (format == null) { player.printError("Unknown schematic format: " + formatName); return; @@ -109,7 +112,7 @@ public class SchematicCommands { try (Closer closer = Closer.create()) { FileInputStream fis = closer.register(new FileInputStream(f)); BufferedInputStream bis = closer.register(new BufferedInputStream(fis)); - ClipboardReader reader = format.getReader(bis); + ClipboardReader reader = closer.register(format.getReader(bis)); Clipboard clipboard = reader.read(); session.setClipboard(new ClipboardHolder(clipboard)); @@ -134,14 +137,15 @@ public class SchematicCommands { LocalConfiguration config = worldEdit.getConfiguration(); File dir = worldEdit.getWorkingDirectoryFile(config.saveDir); - File f = worldEdit.getSafeSaveFile(player, dir, filename, "schematic", "schematic"); - ClipboardFormat format = ClipboardFormat.findByAlias(formatName); + ClipboardFormat format = ClipboardFormats.findByAlias(formatName); if (format == null) { player.printError("Unknown schematic format: " + formatName); return; } + File f = worldEdit.getSafeSaveFile(player, dir, filename, format.getPrimaryFileExtension()); + ClipboardHolder holder = session.getClipboard(); Clipboard clipboard = holder.getClipboard(); Transform transform = holder.getTransform(); @@ -218,9 +222,9 @@ public class SchematicCommands { actor.print("Available clipboard formats (Name: Lookup names)"); StringBuilder builder; boolean first = true; - for (ClipboardFormat format : ClipboardFormat.values()) { + for (ClipboardFormat format : ClipboardFormats.getAll()) { builder = new StringBuilder(); - builder.append(format.name()).append(": "); + builder.append(format.getName()).append(": "); for (String lookupName : format.getAliases()) { if (!first) { builder.append(", "); @@ -325,10 +329,10 @@ public class SchematicCommands { StringBuilder build = new StringBuilder(); build.append("\u00a72"); - ClipboardFormat format = ClipboardFormat.findByFile(file); + ClipboardFormat format = ClipboardFormats.findByFile(file); boolean inRoot = file.getParentFile().getName().equals(prefix); build.append(inRoot ? file.getName() : file.getPath().split(Pattern.quote(prefix + File.separator))[1]) - .append(": ").append(format == null ? "Unknown" : format.name()); + .append(": ").append(format == null ? "Unknown" : format.getName()); result.add(build.toString()); } return result; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java new file mode 100644 index 000000000..46ee0eab3 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java @@ -0,0 +1,107 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.extent.clipboard.io; + +import com.google.common.collect.ImmutableSet; +import com.sk89q.jnbt.NBTConstants; +import com.sk89q.jnbt.NBTInputStream; + +import java.io.DataInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Set; +import java.util.zip.GZIPInputStream; + +/** + * A collection of supported clipboard formats. + */ +public enum BuiltInClipboardFormat implements ClipboardFormat { + + /** + * The Schematic format used by many software. + */ + MCEDIT_SCHEMATIC("mcedit", "mce", "schematic") { + + @Override + public String getPrimaryFileExtension() { + return "schematic"; + } + + @Override + public ClipboardReader getReader(InputStream inputStream) throws IOException { + NBTInputStream nbtStream = new NBTInputStream(new GZIPInputStream(inputStream)); + return new SchematicReader(nbtStream); + } + + @Override + public ClipboardWriter getWriter(OutputStream outputStream) throws IOException { + throw new IOException("This format does not support saving"); + } + + @Override + public boolean isFormat(File file) { + DataInputStream str = null; + try { + str = new DataInputStream(new GZIPInputStream(new FileInputStream(file))); + if ((str.readByte() & 0xFF) != NBTConstants.TYPE_COMPOUND) { + return false; + } + byte[] nameBytes = new byte[str.readShort() & 0xFFFF]; + str.readFully(nameBytes); + String name = new String(nameBytes, NBTConstants.CHARSET); + return name.equals("Schematic"); + } catch (IOException e) { + return false; + } finally { + if (str != null) { + try { + str.close(); + } catch (IOException ignored) { + } + } + } + } + }; + + private final ImmutableSet aliases; + + BuiltInClipboardFormat(String... aliases) { + this.aliases = ImmutableSet.copyOf(aliases); + } + + @Override + public String getName() { + return name(); + } + + @Override + public Set getAliases() { + return this.aliases; + } + + @Override + public Set getFileExtensions() { + return ImmutableSet.of(getPrimaryFileExtension()); + } + +} \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java index 2c035094f..fd16d57c2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java @@ -19,84 +19,30 @@ package com.sk89q.worldedit.extent.clipboard.io; -import com.sk89q.jnbt.NBTConstants; -import com.sk89q.jnbt.NBTInputStream; - -import javax.annotation.Nullable; -import java.io.DataInputStream; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.Arrays; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; import java.util.Set; -import java.util.zip.GZIPInputStream; - -import static com.google.common.base.Preconditions.checkNotNull; /** * A collection of supported clipboard formats. */ -public enum ClipboardFormat { +public interface ClipboardFormat { /** - * The Schematic format used by many software. - */ - SCHEMATIC("mcedit", "mce", "schematic") { - @Override - public ClipboardReader getReader(InputStream inputStream) throws IOException { - NBTInputStream nbtStream = new NBTInputStream(new GZIPInputStream(inputStream)); - return new SchematicReader(nbtStream); - } - - @Override - public ClipboardWriter getWriter(OutputStream outputStream) throws IOException { - throw new IOException("This clipboard format no longer supports saving."); - } - - @Override - public boolean isFormat(File file) { - try (DataInputStream str = new DataInputStream(new GZIPInputStream(new FileInputStream(file)))) { - if ((str.readByte() & 0xFF) != NBTConstants.TYPE_COMPOUND) { - return false; - } - byte[] nameBytes = new byte[str.readShort() & 0xFFFF]; - str.readFully(nameBytes); - String name = new String(nameBytes, NBTConstants.CHARSET); - return name.equals("Schematic"); - } catch (IOException e) { - return false; - } - } - }; - - private static final Map aliasMap = new HashMap<>(); - - private final String[] aliases; - - /** - * Create a new instance. + * Returns the name of this format. * - * @param aliases an array of aliases by which this format may be referred to + * @return The name of the format */ - ClipboardFormat(String... aliases) { - this.aliases = aliases; - } + String getName(); /** * Get a set of aliases. * * @return a set of aliases */ - public Set getAliases() { - return Collections.unmodifiableSet(new HashSet<>(Arrays.asList(aliases))); - } + Set getAliases(); /** * Create a reader. @@ -105,7 +51,7 @@ public enum ClipboardFormat { * @return a reader * @throws IOException thrown on I/O error */ - public abstract ClipboardReader getReader(InputStream inputStream) throws IOException; + ClipboardReader getReader(InputStream inputStream) throws IOException; /** * Create a writer. @@ -114,7 +60,7 @@ public enum ClipboardFormat { * @return a writer * @throws IOException thrown on I/O error */ - public abstract ClipboardWriter getWriter(OutputStream outputStream) throws IOException; + ClipboardWriter getWriter(OutputStream outputStream) throws IOException; /** * Return whether the given file is of this format. @@ -122,45 +68,20 @@ public enum ClipboardFormat { * @param file the file * @return true if the given file is of this format */ - public abstract boolean isFormat(File file); - - static { - for (ClipboardFormat format : EnumSet.allOf(ClipboardFormat.class)) { - for (String key : format.aliases) { - aliasMap.put(key, format); - } - } - } + boolean isFormat(File file); /** - * Find the clipboard format named by the given alias. + * Get the file extension this format primarily uses. * - * @param alias the alias - * @return the format, otherwise null if none is matched + * @return The primary file extension */ - @Nullable - public static ClipboardFormat findByAlias(String alias) { - checkNotNull(alias); - return aliasMap.get(alias.toLowerCase().trim()); - } + String getPrimaryFileExtension(); /** - * Detect the format given a file. + * Get the file extensions this format is commonly known to use. This should + * include {@link #getPrimaryFileExtension()}. * - * @param file the file - * @return the format, otherwise null if one cannot be detected + * @return The file extensions this format might be known by */ - @Nullable - public static ClipboardFormat findByFile(File file) { - checkNotNull(file); - - for (ClipboardFormat format : EnumSet.allOf(ClipboardFormat.class)) { - if (format.isFormat(file)) { - return format; - } - } - - return null; - } - + Set getFileExtensions(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java new file mode 100644 index 000000000..9663a9b1f --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java @@ -0,0 +1,125 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.extent.clipboard.io; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; +import com.google.common.collect.Multimaps; +import com.sk89q.worldedit.WorldEdit; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import javax.annotation.Nullable; + +public class ClipboardFormats { + + private static final Map aliasMap = new HashMap<>(); + private static final Multimap fileExtensionMap = HashMultimap.create(); + private static final List registeredFormats = new ArrayList<>(); + + public static void registerClipboardFormat(ClipboardFormat format) { + checkNotNull(format); + + for (String key : format.getAliases()) { + String lowKey = key.toLowerCase(Locale.ENGLISH); + ClipboardFormat old = aliasMap.put(lowKey, format); + if (old != null) { + aliasMap.put(lowKey, old); + WorldEdit.logger.warning(format.getClass().getName() + " cannot override existing alias '" + lowKey + "' used by " + old.getClass().getName()); + } + } + for (String ext : format.getFileExtensions()) { + String lowExt = ext.toLowerCase(Locale.ENGLISH); + fileExtensionMap.put(lowExt, format); + } + registeredFormats.add(format); + } + + static { + for (BuiltInClipboardFormat format : BuiltInClipboardFormat.values()) { + registerClipboardFormat(format); + } + } + + /** + * Find the clipboard format named by the given alias. + * + * @param alias + * the alias + * @return the format, otherwise null if none is matched + */ + @Nullable + public static ClipboardFormat findByAlias(String alias) { + checkNotNull(alias); + return aliasMap.get(alias.toLowerCase(Locale.ENGLISH).trim()); + } + + /** + * Detect the format of given a file. + * + * @param file + * the file + * @return the format, otherwise null if one cannot be detected + */ + @Nullable + public static ClipboardFormat findByFile(File file) { + checkNotNull(file); + + for (ClipboardFormat format : registeredFormats) { + if (format.isFormat(file)) { + return format; + } + } + + return null; + } + + /** + * @return a multimap from a file extension to the potential matching formats. + */ + public static Multimap getFileExtensionMap() { + return Multimaps.unmodifiableMultimap(fileExtensionMap); + } + + public static Collection getAll() { + return Collections.unmodifiableCollection(registeredFormats); + } + + /** + * Not public API, only used by SchematicCommands. + * It is not in SchematicCommands because it may rely on internal register calls. + */ + public static String[] getFileExtensionArray() { + return fileExtensionMap.keySet().toArray(new String[fileExtensionMap.keySet().size()]); + } + + private ClipboardFormats() { + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java index 40808d755..1448ca123 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.extent.clipboard.io; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.world.registry.Registries; +import java.io.Closeable; import java.io.IOException; /** @@ -29,7 +30,7 @@ import java.io.IOException; * * @see Clipboard */ -public interface ClipboardReader { +public interface ClipboardReader extends Closeable { /** * Read a {@code Clipboard}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java index 28918fda3..89d88c1cc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java @@ -297,4 +297,8 @@ public class SchematicReader implements ClipboardReader { return expected.cast(test); } + @Override + public void close() throws IOException { + inputStream.close(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java deleted file mode 100644 index 7c3f0fc7a..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.schematic; - -import com.sk89q.jnbt.ByteArrayTag; -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.IntTag; -import com.sk89q.jnbt.ListTag; -import com.sk89q.jnbt.NBTConstants; -import com.sk89q.jnbt.NBTInputStream; -import com.sk89q.jnbt.NamedTag; -import com.sk89q.jnbt.ShortTag; -import com.sk89q.jnbt.StringTag; -import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.BlockVector; -import com.sk89q.worldedit.CuboidClipboard; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.DataException; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.registry.LegacyMapper; - -import java.io.DataInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.zip.GZIPInputStream; - -public class MCEditSchematicFormat extends SchematicFormat { - - private static final int MAX_SIZE = Short.MAX_VALUE - Short.MIN_VALUE; - - protected MCEditSchematicFormat() { - super("MCEdit", "mcedit", "mce"); - } - - public CuboidClipboard load(InputStream stream) throws IOException, DataException { - NBTInputStream nbtStream = new NBTInputStream( - new GZIPInputStream(stream)); - - Vector origin = new Vector(); - Vector offset = new Vector(); - - // Schematic tag - NamedTag rootTag = nbtStream.readNamedTag(); - nbtStream.close(); - if (!rootTag.getName().equals("Schematic")) { - throw new DataException("Tag \"Schematic\" does not exist or is not first"); - } - - CompoundTag schematicTag = (CompoundTag) rootTag.getTag(); - - // Check - Map schematic = schematicTag.getValue(); - if (!schematic.containsKey("Blocks")) { - throw new DataException("Schematic file is missing a \"Blocks\" tag"); - } - - // Get information - short width = getChildTag(schematic, "Width", ShortTag.class).getValue(); - short length = getChildTag(schematic, "Length", ShortTag.class).getValue(); - short height = getChildTag(schematic, "Height", ShortTag.class).getValue(); - - try { - int originX = getChildTag(schematic, "WEOriginX", IntTag.class).getValue(); - int originY = getChildTag(schematic, "WEOriginY", IntTag.class).getValue(); - int originZ = getChildTag(schematic, "WEOriginZ", IntTag.class).getValue(); - origin = new Vector(originX, originY, originZ); - } catch (DataException e) { - // No origin data - } - - try { - int offsetX = getChildTag(schematic, "WEOffsetX", IntTag.class).getValue(); - int offsetY = getChildTag(schematic, "WEOffsetY", IntTag.class).getValue(); - int offsetZ = getChildTag(schematic, "WEOffsetZ", IntTag.class).getValue(); - offset = new Vector(offsetX, offsetY, offsetZ); - } catch (DataException e) { - // No offset data - } - - // Check type of Schematic - String materials = getChildTag(schematic, "Materials", StringTag.class).getValue(); - if (!materials.equals("Alpha")) { - throw new DataException("Schematic file is not an Alpha schematic"); - } - - // Get blocks - byte[] blockId = getChildTag(schematic, "Blocks", ByteArrayTag.class).getValue(); - byte[] blockData = getChildTag(schematic, "Data", ByteArrayTag.class).getValue(); - byte[] addId = new byte[0]; - short[] blocks = new short[blockId.length]; // Have to later combine IDs - - // We support 4096 block IDs using the same method as vanilla Minecraft, where - // the highest 4 bits are stored in a separate byte array. - if (schematic.containsKey("AddBlocks")) { - addId = getChildTag(schematic, "AddBlocks", ByteArrayTag.class).getValue(); - } - - // Combine the AddBlocks data with the first 8-bit block ID - for (int index = 0; index < blockId.length; index++) { - if ((index >> 1) >= addId.length) { // No corresponding AddBlocks index - blocks[index] = (short) (blockId[index] & 0xFF); - } else { - if ((index & 1) == 0) { - blocks[index] = (short) (((addId[index >> 1] & 0x0F) << 8) + (blockId[index] & 0xFF)); - } else { - blocks[index] = (short) (((addId[index >> 1] & 0xF0) << 4) + (blockId[index] & 0xFF)); - } - } - } - - // Need to pull out tile entities - List tileEntities = getChildTag(schematic, "TileEntities", ListTag.class) - .getValue(); - Map> tileEntitiesMap = - new HashMap<>(); - - for (Tag tag : tileEntities) { - if (!(tag instanceof CompoundTag)) continue; - CompoundTag t = (CompoundTag) tag; - - int x = 0; - int y = 0; - int z = 0; - - Map values = new HashMap<>(); - - for (Map.Entry entry : t.getValue().entrySet()) { - switch (entry.getKey()) { - case "x": - if (entry.getValue() instanceof IntTag) { - x = ((IntTag) entry.getValue()).getValue(); - } - break; - case "y": - if (entry.getValue() instanceof IntTag) { - y = ((IntTag) entry.getValue()).getValue(); - } - break; - case "z": - if (entry.getValue() instanceof IntTag) { - z = ((IntTag) entry.getValue()).getValue(); - } - break; - } - - values.put(entry.getKey(), entry.getValue()); - } - - BlockVector vec = new BlockVector(x, y, z); - tileEntitiesMap.put(vec, values); - } - - Vector size = new Vector(width, height, length); - CuboidClipboard clipboard = new CuboidClipboard(size); - clipboard.setOrigin(origin); - clipboard.setOffset(offset); - - for (int x = 0; x < width; ++x) { - for (int y = 0; y < height; ++y) { - for (int z = 0; z < length; ++z) { - int index = y * width * length + z * width + x; - BlockVector pt = new BlockVector(x, y, z); - BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(blocks[index], blockData[index]); - - if (tileEntitiesMap.containsKey(pt)) { - clipboard.setBlock(pt, new BaseBlock(state, new CompoundTag(tileEntitiesMap.get(pt)))); - } else { - clipboard.setBlock(pt, state); - } - } - } - } - - return clipboard; - } - - @Override - public CuboidClipboard load(File file) throws IOException, DataException { - return load(new FileInputStream(file)); - } - - @Override - public void save(CuboidClipboard clipboard, File file) throws IOException, DataException { - throw new DataException("This clipboard format no longer supports saving."); - } - - @Override - public boolean isOfFormat(File file) { - try (DataInputStream str = new DataInputStream(new GZIPInputStream(new FileInputStream(file)))) { - if ((str.readByte() & 0xFF) != NBTConstants.TYPE_COMPOUND) { - return false; - } - byte[] nameBytes = new byte[str.readShort() & 0xFFFF]; - str.readFully(nameBytes); - String name = new String(nameBytes, NBTConstants.CHARSET); - return name.equals("Schematic"); - } catch (IOException e) { - return false; - } - // blargh - } - - /** - * Get child tag of a NBT structure. - * - * @param items The parent tag map - * @param key The name of the tag to get - * @param expected The expected type of the tag - * @return child tag casted to the expected type - * @throws DataException if the tag does not exist or the tag is not of the expected type - */ - private static T getChildTag(Map items, String key, - Class expected) throws DataException { - - if (!items.containsKey(key)) { - throw new DataException("Schematic file is missing a \"" + key + "\" tag"); - } - Tag tag = items.get(key); - if (!expected.isInstance(tag)) { - throw new DataException( - key + " tag is not of tag type " + expected.getName()); - } - return expected.cast(tag); - } - -} \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java deleted file mode 100644 index 48c59f954..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/schematic/SchematicFormat.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.schematic; - -import com.sk89q.worldedit.CuboidClipboard; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.DataException; - -import java.io.File; -import java.io.IOException; -import java.util.*; - -public abstract class SchematicFormat { - - private static final Map SCHEMATIC_FORMATS = new HashMap<>(); - - // Built-in schematic formats - public static final SchematicFormat MCEDIT = new MCEditSchematicFormat(); - - public static Set getFormats() { - return Collections.unmodifiableSet(new HashSet<>(SCHEMATIC_FORMATS.values())); - } - - public static SchematicFormat getFormat(String lookupName) { - return SCHEMATIC_FORMATS.get(lookupName.toLowerCase()); - } - - public static SchematicFormat getFormat(File file) { - if (!file.isFile()) { - return null; - } - - for (SchematicFormat format : SCHEMATIC_FORMATS.values()) { - if (format.isOfFormat(file)) { - return format; - } - } - return null; - } - - private final String name; - private final String[] lookupNames; - - protected SchematicFormat(String name, String... lookupNames) { - this.name = name; - List registeredLookupNames = new ArrayList<>(lookupNames.length); - for (int i = 0; i < lookupNames.length; ++i) { - if (i == 0 || !SCHEMATIC_FORMATS.containsKey(lookupNames[i].toLowerCase())) { - SCHEMATIC_FORMATS.put(lookupNames[i].toLowerCase(), this); - registeredLookupNames.add(lookupNames[i].toLowerCase()); - } - } - this.lookupNames = registeredLookupNames.toArray(new String[registeredLookupNames.size()]); - } - - /** - * Gets the official/display name for this schematic format - * - * @return The display name for this schematic format - */ - public String getName() { - return name; - } - - public String[] getLookupNames() { - return lookupNames; - } - - /** - * Loads a schematic from the given file into a CuboidClipboard - * @param file The file to load from - * @return The CuboidClipboard containing the contents of this schematic - * @throws IOException If an error occurs while reading data - * @throws DataException if data is not in the correct format - */ - public abstract CuboidClipboard load(File file) throws IOException, DataException; - - /** - * Saves the data from the specified CuboidClipboard to the given file, overwriting any - * existing data in the file - * @param clipboard The clipboard to get data from - * @param file The file to save to - * @throws IOException If an error occurs while writing data - * @throws DataException If the clipboard has data which cannot be stored - */ - public abstract void save(CuboidClipboard clipboard, File file) throws IOException, DataException; - - public abstract boolean isOfFormat(File file); - -} From 965e9774116aa4d984f86ef945368ccd3d63803e Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 24 Jul 2018 17:12:50 +1000 Subject: [PATCH 55/74] Fixed a few more errors, and added legacy support to the item parser. --- .../com/sk89q/worldedit/blocks/LazyBlock.java | 2 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 3 +- .../com/sk89q/worldedit/blocks/BaseItem.java | 28 +-------------- .../sk89q/worldedit/blocks/BaseItemStack.java | 35 ------------------- .../extension/factory/DefaultItemParser.java | 24 +++++++++++-- .../extent/clipboard/io/SchematicReader.java | 16 +++++---- .../legacycompat/NBTCompatibilityHandler.java | 5 +-- .../SignCompatibilityHandler.java | 5 +-- .../com/sk89q/worldedit/world/NbtValued.java | 2 +- .../worldedit/world/chunk/AnvilChunk.java | 15 ++++---- .../sk89q/worldedit/world/chunk/OldChunk.java | 10 +++--- .../world/registry/BundledItemRegistry.java | 4 ++- .../worldedit/world/storage/ChunkStore.java | 8 ++--- 13 files changed, 56 insertions(+), 101 deletions(-) diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java index feb85e932..a26d50026 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java @@ -78,7 +78,7 @@ public class LazyBlock extends BaseBlock { public CompoundTag getNbtData() { if (!loaded) { BaseBlock loadedBlock = extent.getFullBlock(position); - super.setNbtData(loadedBlock.getNbtData()); + this.nbtData = loadedBlock.getNbtData(); loaded = true; } return super.getNbtData(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index d9c976c65..f29a2d5ef 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -52,8 +52,7 @@ import javax.annotation.Nullable; public class BaseBlock implements BlockStateHolder, TileEntityBlock { private BlockState blockState; - @Nullable - private CompoundTag nbtData; + @Nullable CompoundTag nbtData; /** * Construct a block with a state. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java index 6a25186ac..114609e63 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItem.java @@ -20,10 +20,8 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; -import com.sk89q.worldedit.world.item.ItemType; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.NbtValued; -import com.sk89q.worldedit.world.registry.LegacyMapper; +import com.sk89q.worldedit.world.item.ItemType; import javax.annotation.Nullable; @@ -39,20 +37,6 @@ public class BaseItem implements NbtValued { @Nullable private CompoundTag nbtData; - /** - * Construct the object. - * - * @param id ID of the item - */ - @Deprecated - public BaseItem(int id) { - ItemType type = LegacyMapper.getInstance().getItemFromLegacy(id); - if (type == null) { - type = ItemTypes.AIR; - } - this.itemType = type; - } - /** * Construct the object. * @@ -73,16 +57,6 @@ public class BaseItem implements NbtValued { this.nbtData = tag; } - /** - * Get the type of item. - * - * @return the id - */ - @Deprecated - public int getLegacyId() { - return this.itemType.getLegacyId(); - } - /** * Get the type of item. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java index c9e69732b..6a1a0cbd5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseItemStack.java @@ -31,16 +31,6 @@ public class BaseItemStack extends BaseItem { private int amount = 1; - /** - * Construct the object with default stack size of one, with data value of 0. - * - * @param id with data value of 0. - */ - @Deprecated - public BaseItemStack(int id) { - super(id); - } - /** * Construct the object with default stack size of one, with damage value of 0. * @@ -50,18 +40,6 @@ public class BaseItemStack extends BaseItem { super(itemType); } - /** - * Construct the object. - * - * @param id type ID - * @param amount amount in the stack - */ - @Deprecated - public BaseItemStack(int id, int amount) { - super(id); - this.amount = amount; - } - /** * Construct the object. * @@ -73,19 +51,6 @@ public class BaseItemStack extends BaseItem { this.amount = amount; } - /** - * Construct the object. - * - * @param id type ID - * @param amount amount in the stack - * @param data data value - */ - @Deprecated - public BaseItemStack(int id, int amount, short data) { - super(id); - this.amount = amount; - } - /** * Construct the object. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java index d39356cbe..48923a4bf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java @@ -25,6 +25,8 @@ import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.internal.registry.InputParser; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.registry.LegacyMapper; public class DefaultItemParser extends InputParser { @@ -34,8 +36,26 @@ public class DefaultItemParser extends InputParser { @Override public BaseItem parseFromInput(String input, ParserContext context) throws InputParseException { - BaseItem item = WorldEdit.getInstance().getPlatformManager() - .queryCapability(Capability.GAME_HOOKS).getRegistries().getItemRegistry().createFromId(input); + BaseItem item = null; + // Legacy matcher + if (context.isTryingLegacy()) { + try { + String[] split = input.split(":"); + ItemType type; + if (split.length == 1) { + type = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0])); + } else { + type = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0]), Integer.parseInt(split[1])); + } + item = new BaseItem(type); + } catch (NumberFormatException e) { + } + } + + if (item == null) { + item = WorldEdit.getInstance().getPlatformManager() + .queryCapability(Capability.GAME_HOOKS).getRegistries().getItemRegistry().createFromId(input); + } if (item == null) { throw new InputParseException("'" + input + "' did not match any item"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java index 89d88c1cc..a1f32ee01 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java @@ -42,7 +42,9 @@ import com.sk89q.worldedit.extent.clipboard.io.legacycompat.SignCompatibilityHan import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.entity.EntityTypes; +import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.storage.NBTConversions; import java.io.IOException; @@ -196,7 +198,7 @@ public class SchematicReader implements ClipboardReader { } int index = y * width * length + z * width + x; - BaseBlock block = new BaseBlock(blocks[index], blockData[index]); + BlockState block = LegacyMapper.getInstance().getBlockFromLegacy(blocks[index], blockData[index]); for (NBTCompatibilityHandler handler : COMPATIBILITY_HANDLERS) { if (handler.isAffectedBlock(block)) { handler.updateNBT(block, values); @@ -218,14 +220,14 @@ public class SchematicReader implements ClipboardReader { for (int z = 0; z < length; ++z) { int index = y * width * length + z * width + x; BlockVector pt = new BlockVector(x, y, z); - BaseBlock block = new BaseBlock(blocks[index], blockData[index]); - - if (tileEntitiesMap.containsKey(pt)) { - block.setNbtData(new CompoundTag(tileEntitiesMap.get(pt))); - } + BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(blocks[index], blockData[index]); try { - clipboard.setBlock(region.getMinimumPoint().add(pt), block); + if (tileEntitiesMap.containsKey(pt)) { + clipboard.setBlock(region.getMinimumPoint().add(pt), new BaseBlock(state, new CompoundTag(tileEntitiesMap.get(pt)))); + } else { + clipboard.setBlock(region.getMinimumPoint().add(pt), state); + } } catch (WorldEditException e) { switch (failedBlockSets) { case 0: diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java index 83f981a6f..cfe6007c9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java @@ -21,10 +21,11 @@ package com.sk89q.worldedit.extent.clipboard.io.legacycompat; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.Map; public interface NBTCompatibilityHandler { - boolean isAffectedBlock(BaseBlock block); - void updateNBT(BaseBlock block, Map values); + boolean isAffectedBlock(BlockStateHolder block); + void updateNBT(BlockStateHolder block, Map values); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java index 4cff21c0c..566f34812 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java @@ -27,18 +27,19 @@ import com.google.gson.JsonSyntaxException; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Map; public class SignCompatibilityHandler implements NBTCompatibilityHandler { @Override - public boolean isAffectedBlock(BaseBlock block) { + public boolean isAffectedBlock(BlockStateHolder block) { return block.getBlockType() == BlockTypes.SIGN || block.getBlockType() == BlockTypes.WALL_SIGN; } @Override - public void updateNBT(BaseBlock block, Map values) { + public void updateNBT(BlockStateHolder block, Map values) { for (int i = 0; i < 4; ++i) { String key = "Text" + (i + 1); Tag value = values.get(key); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NbtValued.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NbtValued.java index 50262730d..458a16957 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NbtValued.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NbtValued.java @@ -36,7 +36,7 @@ public interface NbtValued { * * @return true if there is NBT data */ - public boolean hasNbtData(); + boolean hasNbtData(); /** * Get the object's NBT data (tile entity data). The returned tag, if diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java index 36046193f..ffc3f6791 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java @@ -29,16 +29,18 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.TileEntityBlock; import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.storage.InvalidFormatException; -import javax.annotation.Nullable; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; + public class AnvilChunk implements Chunk { private CompoundTag rootTag; @@ -256,16 +258,11 @@ public class AnvilChunk implements Chunk { public BaseBlock getBlock(Vector position) throws DataException { int id = getBlockID(position); int data = getBlockData(position); - BaseBlock block; - - block = new BaseBlock(id, data); + BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(id, data); CompoundTag tileEntity = getBlockTileEntity(position); - if (tileEntity != null) { - ((TileEntityBlock) block).setNbtData(tileEntity); - } - return block; + return new BaseBlock(state, tileEntity); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java index 64df0dd88..a78ea896f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java @@ -28,9 +28,11 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.storage.InvalidFormatException; import java.util.HashMap; @@ -178,14 +180,10 @@ public class OldChunk implements Chunk { throw new DataException("Chunk does not contain position " + position); } - BaseBlock block = new BaseBlock(id, dataVal); - + BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(id, dataVal); CompoundTag tileEntity = getBlockTileEntity(position); - if (tileEntity != null) { - block.setNbtData(tileEntity); - } - return block; + return new BaseBlock(state, tileEntity); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java index c40ce80ec..11e723f21 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.blocks.BaseItem; +import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import javax.annotation.Nullable; @@ -33,6 +34,7 @@ public class BundledItemRegistry implements ItemRegistry { @Nullable @Override public BaseItem createFromId(String id) { - return new BaseItem(ItemTypes.get(id)); + ItemType itemType = ItemTypes.get(id); + return itemType == null ? null : new BaseItem(itemType); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java index 57296cc3e..f096496f7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java @@ -30,13 +30,14 @@ import com.sk89q.worldedit.world.chunk.AnvilChunk; import com.sk89q.worldedit.world.chunk.Chunk; import com.sk89q.worldedit.world.chunk.OldChunk; +import java.io.Closeable; import java.io.IOException; import java.util.Map; /** * Represents chunk storage mechanisms. */ -public abstract class ChunkStore { +public abstract class ChunkStore implements Closeable { /** * >> to chunk @@ -86,11 +87,6 @@ public abstract class ChunkStore { return new OldChunk(world, tag); } - /** - * Close resources. - * - * @throws IOException on I/O error - */ public void close() throws IOException { } From 1090c44a2e736b0f0e19c7f6c7b7ca1adbcd09a8 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 24 Jul 2018 20:46:35 +1000 Subject: [PATCH 56/74] Parser must use lowercase. --- .../sk89q/worldedit/extension/factory/DefaultBlockParser.java | 2 +- .../sk89q/worldedit/extension/factory/DefaultItemParser.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 7c90051bc..d8865ec4a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -253,7 +253,7 @@ class DefaultBlockParser extends InputParser { blockStates = blockInHand.getStates(); } else { // Attempt to lookup a block from ID or name. - blockType = BlockTypes.get(typeString); + blockType = BlockTypes.get(typeString.toLowerCase()); if (blockType == null) { throw new NoMatchException("Does not match a valid block type: '" + input + "'"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java index 48923a4bf..d2319a609 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultItemParser.java @@ -54,7 +54,7 @@ public class DefaultItemParser extends InputParser { if (item == null) { item = WorldEdit.getInstance().getPlatformManager() - .queryCapability(Capability.GAME_HOOKS).getRegistries().getItemRegistry().createFromId(input); + .queryCapability(Capability.GAME_HOOKS).getRegistries().getItemRegistry().createFromId(input.toLowerCase()); } if (item == null) { From fc5a6a01b383edadef69b2f5b0581162d84b8873 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 25 Jul 2018 15:17:24 +1000 Subject: [PATCH 57/74] Update gradle --- gradle/wrapper/gradle-wrapper.jar | Bin 54712 -> 54413 bytes gradle/wrapper/gradle-wrapper.properties | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 247226b9984a2563b89a526748a027ce7202c702..0d4a9516871afd710a9d84d89e31ba77745607bd 100644 GIT binary patch delta 22993 zcmZ6SV|ON87o=meW81cE+qP}qv2EM7la6iMwmQZE+<7+)i${yw*|%$ab=)7o5Td44Y&pFBPQi+mP_@6U}hAlpHM z^a2bnD_N^JndEeHVE{Hw+ze;ofhjK2IyU)H#8C(w?z^)IrQ|O{qUR!N=|d^i2veMj zQ_g56=4{k4QDP5En8!qt$JhgYj|S?r{9@ z1GF!5oW#fmCqLPY3HI#B{RJjJ%8-T0n=Y>2TaPR+{c0c5833Y;mACL98oRG#-hHxx z$Bx5hU7~hyC(VwUb}ENa9?NPHSw|{^SJ*j~tC=oC{;ZGqEc;S9U$G)%@3ZFo>sqz5U(v$Mc*sJx*_EV~ zav`6iIgUI(A3zwKVh&shFi7ogud2B;JyoFc48Mimo113x-i?MYPhZ9<05v1t+N=Lm zhF)~bU4wM%;S%%l7;};#Qaa(Z#A6yGgTKj=lr|J*G0{N{H${(DP=Lsdz_%{mXsPTx zMVx)HJ?s~56%%PKoYD4OyqC|?H?*!a$?7}|@Y!tCBN+>on8+(~+Qzjsjlb;k8U+(K9ew`O3(lTRvP|XfQqdlDkE>Z5I6RX{T>ih?OSB10PV#)p_Z#8Xw~h(s{La zx)lp&0f-y9bY6KEZx{Zf>H(}SJcnsLHCQ2{_2wlK%Nfsp@~iIAC4>G;`Hn8weMLvr zZ&`6Wp2=}^>s2P%tPaEOcz)}JCKT=$>%sL)>b*30d;QsH_SPlqdSp|xnR#&zhdSJS zv3HC^e790~XJ$Q+dn*roz6N86C0@#=0>kmF0N&CgkUaH>XH>YkwTBqlUrdaP)-(m| zJEZ6(>`88VBk?ga-s*#>xcvQc?!2KVZvU`+o43$7jC&dQzl#q=>+fuFiBOdE2B9I$8GT4#vSMHKtFw)=3omcx*(l+sLsEMm z4rSVd7lmo3$X*#66<)JOgS4)!>o?Tv-M%;8vDrH4m(sF!y*@#G<0m{W4 zN5=J;UlOJyL_r%vnAz5|e>twhMqnLM&7R1f?bPnL^w}orPG1c^g{in$j8Ma;Sy++X zsrBGbb3vLvy$zk?uj(6Nz|P8kxNE!j&oryn;?D}~kS$*gKwG>|b*H52xz?!>+`snb zYNDua9R%#K-n&HFZn{jUQ<*4R03xSW$c4d(2Q$9nJCT+;+1o8ZpLQ#GuXd$psX7;4 zSL)vSQ(vJ-hrjsOCzsuCZb)?V>-92r8DY{pOtERIudKqAqMq0Xs>IB(lGMn#;;e4a zn@h{KLIPWqYoItx{p$6;^+WvIuwL5_{zd4u?O*W7jdl9nLFX7ymU zV4Y9u=AM>M;>dBc?J~wtfZpRj?-2~q8ivjNV|Q*T(av-rxfLa1?%>(Rr(dr=YcAzc zoXKgJ?}z;4t7;Uwz^!91-gOKs#@wO_ph8TCJtR1hl>@vd+*P_ObWzuJmgy*C>!f5iGnlo(}QqC?sotZ==fcV5%E@r17U0w-t zetCL*QWOJH3 zBK=XKf7A#X9UeJPf2r1xqFm7QGH(e?y!ksn2?1fTd)RsE8oQ zuppYfxqT9B^DvJGp-}Z|kmil?j&=*Zn+T0sV^V=rHEe60U2Ar0YxG?&|L5k}*2nJE z70q|Pj|F-1F)`s^gTBw1_MCr!S&zQ>wV#(~7g5%H08Rn^Z2BlgEOD$sRuBk)71&CA zLV-=Nlvn$J3IEW;07@}nY;v2^Y80{~fkKjnsb7qjO0fOG)T)dU7j9lOkNT>dig#y@ z1%x-*f(jRAUX`DuzxiDjE0aX7anJ(X5XYF<~L@+kVNN3%~xbh{M5?BO0j{=_V>HtyjCT)*!E(vvg?U*M59*b1x-qo1Ke zCYQ_lPqo25DHlcpv}7p8(zuv&7TT%{t&diar$ZlG1)UtN4OJeTlE~($ zM~3|xoz4ejd&=kd4F5up9$};S9!++*gnjg=OABKqNs4a*wZ=hHue;LfsO@7kEfxn` z!)|lEqt0vVV>8w!111~bZrR;(S%H36W8WxCvfG(s<*G-V*V59_suf-4Dga2Ez>srw zza(F3DGS-q+Oe`utkCb>TJGw0YwnuJ8NIy*6B*a= zQKwjR+iB)^Lu8j-@*P-GTU{?|;3)O7{5%Wc%vF5it#EjliWkXNYRV#}x7Y^^pqKMNcVEIAKu9*cpc%g&6#Eo)lW>wl_3V2BM zOM%(^VVcLf`Kpi^HrB>fDl?WC)Xn}^m1xU$$eCWyT3+G`iz-W+&9zr=n+CQ8YVx??JMqg~USbQA5vZ=c?+VX);fv0-yo z4xW}w3L z5LUkrPJX*iH#qa%HHpcE&4UoN96m#zpz~pA!z##Mm2{Gc*d)$Z@#1OgKyWam&0ypX zo-WN)d-1_ScG4o#PbqBebS@+jwLZ7Brq0m0b9*4wm#wKyFsJGlrK^3Q`4uc8U#b8u z%AZ+MAsVGN2N&%EjL1~K`Qpw{XxJ?JkUonh4GtMZLUrMhXXtFKX_QJRztB=0j_Zl5TriG@ zsUzm6VD?HLXMCe4+aK+y0kMDMmJb2?ER?>2CtL3bsecDNs(dl_=w|q+0V=E=8YiFU zW1Qd+91fBrbR=aK&1_3APj;cgouR^(_D;_Blu7f+g`R^jg0Pmy_)8S4RVs~ z)i7)&3cCrZP;P|L;m`QEiwnE+U)No`)XSK`Uu&&*{SA|^PoTyPkZSzn9?SqeXJMkn zo@B#Bs1g2LFlvEe#A;WJ0q(s+2~~cuYR7avb1Wks;P5|qL>yS$telk2;!ZuByAUy5 zb&*!Rh4gmm_||LxJjWM}cbpBw-Eq`4)SR~I$7eLhFBfT9y)El(I{7%3?Z_JzF5w3j zdk3e4w9T-s)GoX#@REwyOi2MoxGJt8Cd5r-C7DQcxibOC*?QhS6+^Pa!rJ4^DpHN< zDuQZ}#)aF`EFoD{*PgcbnKgDV(}Z{FyI zZxM(E)HQRfhkpl6njrF_R+nevB&ct#qL=uI#XDDMzQ#K^@Db_jCM<_r`qE0K%6s=$ z(Y&`*R(kk(YVC}we`x&(GJ|>w6la2k8h((1@!v~xj=`z9!*DM@0xTfu;e1fG@_0g~#6SZsQ~) zOc%-qQs>HPYb}~W6KSf38=5^?|AYhcxAIZvt8G$XpTO9@UFE3qi^N~z!~?63)|t*$ z^&6VSS3fC6(a!YqC^EYB(}l@aqb)bCc^v#JIzk7GjW;$z>b(QZECFsC7Qwyw zU1eC-tt#rXy@2&ctBYvq+N;_jadw0*N0I^N?t$=L011Y zMZc1|@yx!Aq>@xI&8}}pw5ztBJ1!JMW3w(^dFpbkE+F5Jx0185&VK4!otR`Sqp+1H zg*gen(H=Hkz#u%g_XcMY>QYCdYfLSlm}BC2fywGR5Sq_%1Iom7=VpmP1V$dAILV0O z)$Aexp5kQbpAFbb!Kh(57Yk7l4v0|Du^+Cz3hKP4+Rx!s!Acsoc&h zU}rt?^C~tw?92nnO6E@DR5XuyoY*~@8Xg2Ae5bYM6y#{#LeQ5K_o=rB2qNng$NP9w zKIRTgxLi!KK`GlsS}_@)2AZzu*fl8yAP6uvGgbG;%;Kamv@LmAz$1W|4713()xn4H z0+@240#SA>rMz(DB9xvyNSd!)A^s^+A)lxu(3jIhTr|I>N@yq->gFskr0BGKk9@EF z95Tn;fz|9NtQCHP`0K&L==+|f{8JIy00Q5Hk%%qV_>|%kE}oiS)PP=V|xv^Aj*xxJYATn8ndhA3IH{q#LapZ`}mW%gOa&^8>#B$u5kQl_&oKD z78AiLK_v*&M>F+ld9BTQlr@!C!gL-}{{YeJr>dFEkPpqq9}|!80byyZqcx8)T~Aqm zU0%eW^$a5C@0*cRI^PJFLPKanCRa=?$v>Co5<5gkb0*!D*as8&Xoa;S$`LFb06<@$ zYp93xnL1bh;AYK+;6t3h(PYamTf#ekKgU_W8JXp2giKeGAg~|S1Y-GwDaS3{-vrLu zRNqxt%HoshIT~AF`N{escG%rv?Pbo`lUPdkjPCKk`|TjkxT6Y6VnM+FZ77O2Ulp9v zvinA@QsR~Q68kB*>-4eO_2kBX2B5uT=zFEiR!~8qKQGwc@v%}@#AL5YShPW)VP!3K zt<6Ek|3y>%sPLSpt+wLblp%a6Wld`X#@;#*jx|@}nJHz2Ln~~qL^)+V_uUl2v7}HJ zeV`FfR|@iGa!1Q-gXSqHxbA}#r!IiCWb#YCCHqU6%XY=zg(xmOY`FIQ3;-&@l<7Vf z;)ZHQS5CqoL}0KKy)gPfpYHmjOCU5CekaW>x)+x14F5&Rmj*G-l7U>omOfDTK9j1j zpar)li&fBR7fQBkQQ0!1vf!K&aQk@1q!Xy>?BU(z{MK?tRW(`68oDq5$@~h^ zk`BtRp@;`!hjc!pC6{ey2x!>x!M%EHaDm4wqY%8~!Bn%O86Qu^oLISl`d8}ajgF2~ z2cJ4tQCCxxUuDyi8ua1Sz9bA}>~C`bGJ@XQQ#unJ7)odNo=RueSD>L%!9 zP-_m%YjTNu2K)7Lzq8_zcTU9)2*xe-kEkEkz5${GPn%2I*LM#F1sx4=8cgeC4{%2gwm|D7MG;{Q&WPC)QOT*lZ#AE+F5Xn)05*^7=!v z*DCi({PW-8lv)I~4c z*R3h8J|0Ej@H2$X;E=ev-@LfJ=CQlDmOZEcUZC_R$`6I0Dw9Bz;2T28y6#AACEJ6X3l^msXBDD?M-@N^2fF3Cb7^Y?=4a` z<|{KAfz~f5>TwY`oq5Awyh#xnTz?9X z%1d_XrFtQ_AxKKxITd%k0?4Du(H==)^gbvdLi$()o%(qe*iGy5yFM?Nac_m{;WC8` z1jxWISB0=|0(N1j=LmTHqZ#EU3ifWnzvl?T0OINUhRj5{Qfc4tK%SouJBS;vh&(^L zL)V|I2wmWXJGdY4wEuLt!~Mf;-{K3Neda%)!gmM+FGxCW4Fseu&n-&?Quhe4@BRfwy-*8blxbGJYz$0&kF27rJIhc;7GWC%K>5N zfK0f}p!fLxy@>)2L)m_1-reZQ!p@#QXd+vG?(kU4iWciI-0^sSB>Igxj5o0LtG*#O z1w?Ls#RncSQ0;yp3xBgh!6MAXXv2yi?U17{;uXc@8?;_JuYnE8MgIA?h~b`v3-QZG zuLrOdH7KjcnM?_2I=zd7PW?mf3$1za6|?`wnR#F63&OvhBMxvZxqsbsx1r+gJ0=WO_|Z*Vn#KercJu)pD2IJ;To(ePv| zxS!o{-GZrSaLvtNUdw-ijTZ2t=XqV1^0`CIiVV8^?2L*%vmO2gZ3alHQoyv_ECCOJ z0|9X$Bm;^FlM`m(0J-Wq9w=(4KjiS4tXP|WESH=yU`n9vmbC@7g(%yt86<6J#6ql? z%Yv6=Gh{m=qF%2U_D48QMj#!bYbLen^L_6v-b9w~WXqDJ$P?)ayv_5ceqKCYeqOA8 zzCPFXfO-P%jMoFfu^dK_28DUrj*NNGouo7!q7R&L@Ajo}0UCu-MpEMRalEWpcaxOE z^Gg4;(bMQ_Y?OL1j@FQpQz@g2$52J2;MPLh$-AeXcyls#HYi(3_guN-}P=hiN7bCi6QmtIcgmg&;1I#p~;5+(hjN9XLEifBF zrKj+8*(}f39i2@@=ugSsO4&|9oW3SrwWd~FE31!xh)uke+T*1p%X|+gY-g0y;p|)u z^@TmRr)`MULNe=WXsuRr)=@%ca;>)96ocjfY+90Vs=~z0o{yc#2ysl0>!)SJOXv z7ASRdxnnZI3Vx1dyJYj%_;l3iTCZA(;hI9t7ONr6RBT8Ivwfqj=tf6V*6$(JSkNSu z0frE($>}7(0z_4AoiF99Zn6&#$EiG?zbgI%_FCNzy{05->UEesS_X!%reYkAS&IGQ zt*VPrfOo1|U3J(RZT6MNdt=53N{N!FetUf_&(is$P!#+lNNs)rR(G9N536Itcj^>=KGaC(3^U4Y*o!S!gun zxeH=X&tUTK(5m2&PQgX>Vw~k^=~!X|^4CdD0F?o{YqbUmI8fu0wxCxhiBU)x{^69M zct;Ik4HG6)-#U1_NBaWrV?~$=;POd3x%O5Ef{-752-! z^7g)QPT&UnG6$cjLG=%@K@MW)J9E;icn_JSHrli9!;F8$w>C03+|+q_Js!TS(kS2R z0Fn`xx3J^9YpJ`h%;Z7Us+?|owL8YkjtlS09{QJuxU==;pZOm-w=M3 zBM6CFz*obYk=8_n^>=&n0jfbJ&D&q(fRM+YZ`NPtS#OLr1mlD!qFH|loWZZYG=C7P zZ`8tQh4~k#gXg*Rd#J?Cs2nXZ)xqTfwHBFiiO+(We0U(^K z^0>rLLoI0j)ie@4pS`kIluA|Ylg{L`wn)qPoRCfOe?|`ZDJ;=UgK-LAm`7VR9H+s( zf(?X(#q%>$@?yaEsQpn!akhU<6Ws{@BXp^(Z)faN#qTbsyf0KgtD7tg}} zta4q_9&4h+U6OwE+=dCFW1UqJfRt>d;@X$5*)PU zW2<@%Xynk>b1uy|X&w{k>`!xyOn6FTIXNA>z9Ih!oT7VlPWMG>f^;h267>K&gdwV9 z56yV6KXRBCJwkhw!&V)9moJ;$iJhI2%MoMX@WDPFEg!IaXVrD&_Fn~G&fXn znAJ)q#kC}AMA1Z5KKN;!pWHILmg#F%aTRBh(X=NlvVJcMWPGOXh&L_w$jYciOaAy@pe0-QqYZhuN5399Z)+f&cV4XGPCq0 z)ny>I`RWJB33#Kl_9LqYiy17|UyfD9EH|2JR@*&nlZf*e1B{-8`Fngkp}RRl+MW7H z- ztRSAQB3)SDBvGQ?mg3Xu!G?5V1R1v4n6Qt>qGxA-drc0@KlVFez2Z9k7K1ZP-d38P zG%v5q@A_r2xu7WgkE!+rp8#+W-vZ>b!2UCwnJf9tnT1`EWr8^0Af!0a*MoOKA7H(f zHfOwSG0^Pb_!$z(Cc=wx{B$R@1^`!}G$f>Hw50`>Ya^|&?S?zWwXW;2 zJWTt7jJ@M6f)fZho&=P~0kmVvPgArOOl&^tO~%Gv2F|+?y9zKpeqb~vp)#krixH3Y ztQb;jGj=l*gj47_s#!s*zU~fbr_^(rhA@E=Sk}2HNb$ZxEm%^?E3zNdkED#@B#mL9 z8!EpI5TzJE#JxBFf~1{XDwsNoyO3cJu}Sw7=TAUH4CZ6HuZqZ zVndtGUR#fa?-tRN;Y6)t`81!-Wg*kW-8y{Ob#Hp#37^-|R$ann6;fLJ;l20}@d__C z*B=(iL7eEi@|q{NAO9`w*UmGJSU8d7QjIS<4m^76)2_RXqBhpnk%WDHIr263iTSfA zDB%&du)wnI80lpG6+pvE;5L!EFS4C&=dXPRU=+=!?oCDRv>q;vX9b;r0b6Rs4T7-- z|0v^VVx#~qrI+iSnmGo~0y? zyW>tYdr`PE&o%hS1CVM|bR*iGt3fmye;`t> z|BDEZVmAViYp0{%G1RZ+Uw`7$Kb@^xIU!LL5A4gZ8h;^3;S*CvMBT73y&$R zNWT{gDQv-n0cg#F#USS(V#Qm5i%Hz_BxQ&FU_oaZ&6Sh%O9Roe>gn|BLZvK%C!r=W z96CqnBm6hrR^Fmg{3Tb8;kJabHWF1^(Y0)no|^6#5=&1yKtR5*KtR07j)A1fihgte%Mu|%h7cfXDMi@j_CJw!DeM(?97b{)$$A#el|P|B zAwRG@O9o7R1fnv$$)V5wU~zit37TyN!00@{)>;d2b!|mei9 z&JXz@lY_^;GfOtyVpeA@Qw~yCta)#ZmdCPlENx+rmXb|&RcW->6eV;Q+=1Fnp_SE| zYqb$Z_DPxo#7UWv<*GJ7&W@Eeh|Vi1=EYT%0$%l{fN%JMA9kq03e|3<30A>&hn2I> z5YuVQo>seMVr|v+C-I{?)DaQCo4?O!V>4*lL%$7;Chg8)O@fC|XFYy*T z9{#Cvfdoqducc(4mK?0w0rLYA(0QN*ed*l@GrXCp86rpL}U3+Jy-EnS~SW^CSMbj>fDueVHBQ{D{NOIl<7H zstvd^ZmX`$M{kF6t9T)C#*FLm0d&XHrnn74<~Y z#lX|s!Y^d-u?1MZ9s$e&n!7?`p>V6O*=aAu`U7YZeMPmKh~o1wZ=N*pY+0HjU-&;z2beZJ#w$CoC`BZE3~6p2q?B#(C*M&?xDNU z)d=5W>6+PnVN|jxc1&4?iHN|qL}6ffemTcd#^}lbBvP#|w+@h6$z>M_y0-Gw0>`1# zTt+60MT8+Hg-aHTmi==w@o3IF-+0)#_-Ia%Z)z)#q`aZ>i9eu2Wg+TI<{Fkx`_4K0 z9DT9IT^3+@FEs5ud`J24JMe=SoNy0X?QTDV{^Ysq%`wx(Bib1u*joK@pUy3;`bhHW zyN{Bg#DV)D>`}t`EWM=?I4hgMn~F(@eV6PM;kwl#)GM!ho(49LkC)s~1jLEM)wo1{ zi~Xv?1&#WaY%e?n02BFFc6p1y>-hMMD}G_H4p}Q`BOsDXJ3J}C%Yj&B{|#HtSz9Nr zlAX)-1bvXL($LJH@hC`wGj$y42bKj5XT)+&uY{}luLT_Y`0(2|y|+#x1cwui%5+Va zk3QtxgFR+H=B%qw@d1|&3s@DU8@Ys=Y3Pp0D=S=*5Yu|jBrB}sT9_%wmP%s>s+{Dp zbeLF3C}pV)x@M_Mau5ZoAwq1WVIAc35k)2XkZi6W zZ*X8-k56d*V>Vhdxg|pEF?gvqfzNES|$DqTT%|N z;>AfF4^(v+BaI)oZnSRGbRz$&_$0fAGUUg9I9dR*zSjhbKZ4%%Vh+&rjKa!) zIl?NtrXOtfj0-;_>*?QOczlr&^Tg^V>lrMnm-dt!yaH)ju(1i-waU)IProNuVvi}F zZ<1S6Yi29dOtXewZpSh20r1;XH-=~v$XWiY6<3Ha8rx*k+o{M%vrdamHy~3y*GB3% zB`&IibHWfCi_j9qMQL;jB2_m0k6%fzi!9c`=E@>fOx;{@`n$I(NRhs$jNELc@|W^k z*+hQ0&oo&%h?k?Uq48KH9X3gARqwb7FC6{b?abE7-Ko_wgU1l)1Y7~T)UUeE*rRhA zWM=ziDUHYa+82~Vny;7x8&o5cw9uQRNj6zzTiYwQkwyHmt0xzAF|&tkivH6EEaJd)G=Z+HnIMV-a5+%HTFC&y2FY={ZBdB@KP!iLc- zPh>5=q{A+M?}5wXM#zdW-=;KSv)|v)0dW}>-Z0LZMCh~d1lZ)qTs0_*vt6387AT3M zq)lpup)qeR5Gnc@q#OOPlBJ5?3RfsNyC) z3C2i$36Df@(;tu#q&bO>OnixtR1m~nB$$nCRI9CS)GG|wR;aFi;qqnPgh!=D_fh+D z0(y1$nfr{_|Bfbv7zHZU87DCXErHO`KX9X2W*NIF0FbhBL)Cd|ZG;QVx!L6HI6T~7 zRFC^+d%6Sc4X|OU4EbR6MroQ`5^HagVS~A4(ry)#YQY;HL#oDZ?8nq`*a9Nw;D~7& z*GVr@u&m*PE-~mLLl*Mwv6dCcX0)f=JQs!?=cpRoU<^%P)+#|XOGJyS%u?CtZ3=W+ z-6q=>0esxBNy&(*3z+98;svE$JAPULb31;_+^?bDq`k(pb`%@B%xu8UamH;MK5h^+ z)y#Xju!}-+dSpjIS8F}=3Vvom_Z_zc(hB=ZoNNNmm%OWQ&xWK!=pTtUHWiAc@}@I$1!KjBLBaRu7ABiM&p zfH08Nc=a0a9IVgWv+4CGUyISc&m1ft1Hs*$Ae|+CX#@Z%Z%h%WrYD56hGW^C&h+IZ zA^^VfiIpBl=;3u`C?j_h!Q6hSr@U9r%put3 z@YpQ$Y3J$^MT8;V<~T>-R>SU-6Rej4AYL#f8SR%*8bWFEMVv{&5Q$~Z&>th%=Y1lw z%;Mo;1Y_9k579%ZiM%_S*D2UvJzf&II3-0^U6TB=f2hp4&+!wVOOJ^u$;K$a6NJA5 zf(S*%IpOryrCLha16NC$``UWzw^4dRh*d_q7qa;Gcrv-ZO4J}4X7T-$xhQySfZ~p< znY8(1>_CDBPGvown5LuOpOY#of>Oqq2fe(*>WBuBVQsIkJpn6h%%P@8c?2hPm*Msl zUjaoZ!0`7W#dEaFv*0gQ@F6ckq=A$ASD4G8#~1OB*Q}67t zG+BC7Pc?5a)6EN<_{hFq(A4%HjOZwzeBk}H{`OhQ(|24bq~ckDqNEsWfHs&TonQLr z+iw!^wk)p4BF2dSborh9y#X_*=Mcsl;{Pr~E}4VZl4QylDS(~Ak|OHZuLsV~DjF7L zM7(TJ6Qn6zB2hu)Y&a%GmLcPS2FB`i)-AdN?84h9$A^_KQDodOhCh%%%ENZsG<+Id z8u<-Z``Op5$>#s#ZHj|cabS%|%J4hZ*rl=)tGgo@pe9nueJE z2U854u5z7#TcAL8x50e?r^A(frtA^+xxn5G_(7(x%$7Mex$|AHcP=VEKsu;9L+&I&~(R* zer9sOA>pbqz-O4zB@3NpI=?RvF1dGWfYC4L04!Es^Y#GY;-}xkRwXoZD$m=<^)FgC zyox7WrvB{sJR~i2t2Bu!4Vk455Z1q+)Mm{ z3KZ@XK)5+9XjBG$^NGAoL68m&r_(WjR8E>(0yUw*h#Yhm22GBZ;T%KoUq5?_X(NbS zhs)fNPBhhzPgE(c{qI)t1NbqFu%l;wN_Xu~(j1nVZXt;4#2 z+usN2u0X55MKyPs#aV$;!wJ7GX8*g;b}QJ$yCDhsPq_%(`l|`9+w*efxmu`4H4bYq)e4U67u|V zR?jYSL#&V3FpR3xmWoW}#`+>4u+->kDVRxa?JI}!fMQ!Na*?*{DDy@t&ms0`w=HV^ z!$B6DYyhJT9Mf;+$q70{fsbRZFww%*fB(DMvG9+F4h|kese_v?*ef!>gA0ha%*J_r4|M99AEKfKYY$!WA3xfTGK`l_^DO?@leJ838=6CQ# zuy=2k+1ev^(OsQp6Gs!zg=eKfaj1*j@+MMajPe&9flg>s-1f#|BUN#1H7vBD)DFD= z5od1SR+s49 zl~|qKy8-!-8}1=S2iDuaFW~jg-F81_nN{DaewVB+`t{j)={nj4(L8Q3)s*Sa?|{yx zF}~~@{?=p{vmvKRuwEiJZx3-sY7Jb;@{>gsQkc*e%Mfy(upVZjBGaYOY5t6XK0@PZ zz%9uKQw8{na-LaXqg06|f(h!BVx0AO9wfJdGKp{w1|vRWeG-EblgTMd%Bx-<=CSsP zkEgL-9wzagu-B|y(pPwn z>-c5^VI|8otYrNaeY6yXatveP1DWFR4%1wKam2r^h#q{}NR?=3@J5|{szW5{-Z!8- zgK&?Edz~+-WE$PfLtxrIly*4!`FWb_!~8-W5VZV&CLs$sz^=ZXa# zh@M$)p9nuu@0je~tD@Eoo5M1pirQ^IX^W77#!X;MmQyzGF=?dZ1-OzWkzREWC^2g)t*uskxz(iBO3!I%ZT~K z(PE?3v}5OvQ5=7W@`mvzP!xrr|G&J)qKj~zJXFBrwwL8>*X4Hl>*wk z8%sq5f(&`KL}`@~R%Rpz0*%awdT_ejNg+p1@j-AzBn%7@8*U>N?W#{& zZ<1Iz=O7k$m)LylDc>^9sCUl0mPuvLNLuZ`V~(lo#OveM-f0GT_m*Z8E$<)Ojl=6G zic68a(1yZ%ZqsDc4HsI^H-}I~k0_GuUW+DRsTmuvrngnq8K?FyTkdv6EV`W+>V^=2 ztpLId&*Oa&LYEHEI+43%(WL~qqh!T>wbdUYgJSOLN?JJZqjABWJmoN=8J%K1Vhk|B z-D}Sv4EdTF#qF;QlC5~4Rn>lW3(feSL=?umt7f1f;b|D1j~h#7jB!I4Aw4;3jiBH~ zYZ_zn7<`P>9j)F7j;YXIbwol#sINMKqEP2Cr7(!)4!juv>}VG0`Kif;zJTg@wRUa#SdS)()i8Usbpv}(%MJ^oV>_jc5eN2gTr)M z1|@$%|5v-6X%amC$*@^U0QarX($FYHG&*8+OR6SRBw^`@l1Qm!aal%EZ=A^zI4$>y z+qAd({)uczp9hdg^3i5M%EL@sk#fuE(CjDEp3hx2hr`QNdwf1{N~5(2QZu`4uO_8t zMzfKzK0`bm?YUi2T&NhVS=e#dqiV~9A!<}NocYRLIvk1H$;4SLpqLM<2i1q(OZ>`T zq@$Zyar2gY=3FooZsX=i@_knxm9k#zUwoVxA+dm=gqlW3A?ddF4q}!(3({wu zD|VeTln-f-pWbySlrYwD{hX>%19qdBm<8-V5hr3?4Ntl9;F@ReD7L7FBU`hXK1j#T zUQszH#4kc(T%YeDfM%DnrO%xrdy#Z~xn{GV;qY7E8I6W(`g^um*w^0zEC>(PB@`tY z0>2}L5bZ?g-2Cs&bG}>h(k72D_4$Okl)i3Tg-&q16k(VP)U-z91L&cpKHO^J6gGww z{R(0?VxRDRe}a(z)5TTCMfELlN@)e8S-O!BSENNiq}!#tySrATOTbGm-O??Mbc1wv zcc-AfmEU{M=R5!G+&SNwd+*+J?q_#qzEi>z+s0FYl~~wFGWpZd#7BD4oUnb`dBFgh za0q?!f~e#iHX?kdWLBH|y;Cnb6(;M*`R4H$%2WisWddsuT?7`MBhfOY#0qf+SANR; z>%jAOsPD;${V3QicGXRH2PnJ zTD>~iqnL2{W|~!%PEn&C8eu3IOh7%_fl6b?GV4;%(EcLD249m%SY{{ zdMi}B-WR^83Ax_Lj}5&jA`N)`lIR$Fgo0__N+!{T3?MA1;L^)@q5iWV3I0PO4N;f9 zMTP&&ZGeZxpWkQ3T1Ii%VwIO{M-}jY$}!_(IzFh$cT}8L(6bu9F?j})c)>|Mhc`fR z>Eavc%v`hi1q{fi&_So(67s)vnC{K8SVK?M_^fG$46NKzIFwjPu}3tw45#c zzWk^f2eS-GgbWp3Ea&0LxtFhmXy5&U|2@5G!{j<%yzw|819P%1DBu#Fq7?q*v)HeJ z5nhH)i}#9zmDNCHJm(j_B9dQxYZ8`mYrb1Yp9@QBP+?toc=e3%WLZXcxsL{=vJI;G z=zF=|HtsQ=P5DN}dIVL&EpivP3fA=9pgAKiQ<;tovRVle16Y_Dk)={bcsAMCY}tZh{+zj!py4^EV1XSj@x=OMAv2Y}#^K&~f3xTj7sGIhy8DF!$ za1)1iySu5j+d5qzmwa4Wb>)j+8awvHhW4~mo-mU0Elx#;30Yo;ef08*3i`U*E^tTr zN-5G17PYDo{eFErft^COk3Q&HaQ{5W^S{0!A> zl>=4`sscInA_{3IUWlA>We#k7Lq98-BFY%XsygQ3ydL_#=$%I?Mvuis^IHJyR0U;j z#lDULtM}tDRn8j4F~B47Ix`cW4QrC~O-vuGTWzE;Xb(j@I?qrIBARC~ga=uT8v|C4 zdfY84Apjc^T6nHRM`$r-(n&1=(ZKw45}FuoaflkzXcK#V=~Q@Ph?xv<_TX$X(Y}xw zuZHGCfyOC>D^5aT+0OLTnqc6S5VV3DZ-LVOC3j+ZErF$M0=hI{EpRfwwy#Zn}T09xf|M5#JLCC zm*7v=|4LF>F|@$k)2}hzi41O{PiVFui_48*YtSTxk-6GhOjqQbG!hEiLE9 z;9^X571`{)K7j9-Vw$HY%2^*PEN_*c=b9*RCpBgFT4Otl54_P0CwysgRN|!5Zj#+F ziCbnM`eIUhjvUP2u3|0D^De2%T9nCvx35G^HgRmgj;H=BuT#seOucma9oK@+w@@P2 z-1yJ?!85jdqV|=7RwE%lW1$%mOywHO%uh{Yn)WhN;zrXLtIrQCYYa5;Gt%uutJ<+_ zxeTccpmCf*h*A+x`y0@PW+T)6Wh_Qidpths zwPP?Lzzq|aGh{*M&A^)!d3!j0S@udbJHB$zDDeCv*8shSP1oK_!wMQphL?hK+le#1 zqf1Fr#5HEM*=A1&Q|dw?k~k8Km=hczMw-+J(PEVkSa~L;MaiJi?WQVLd!PAz6CA(9 zX!Gp@<3N6h*xj>Cbu~U((!DB!d>RLpSdAvm!v05M7CBU+#n>6OqvMrRyNp&^27$M3 zpTC9D8SFNVkc3rmR(0s8XpJ=cOTAXbR`M3RCSS z_$NzGqQsYS@5cd5^Of9dI||`~ei^}51T?m#2=It zDFhbV*GO2)jeeGgYK`nDjSqf&^pt`_z1}Q3y~@e}hiNO1Z>uF!amYCIY`oX*qa}wD zP25vl-&iBZ=3NiVDvrrk3dxM40sBuDF(BlcRYGL$RR-iVz!D_q0IK@fFd#khCQ07A$Sr06q7guH#Q&DC6 zU^*Jbw%%zR($S|xV+#`#fgS$l>Vhj7iPoR_!t(PVsz)Fgti1?2tvx-3tlyBCH{CsPvKp zG_mR+l4N8p_L9~;TN{}BRa$yV^u4Z?NR9L+>R4rZCv>;jBewykht|9H4b-kZDa`!9 zG|7ymGXpqkgI99J(3UH3p5E0oaTF&k@drjC*9{HyNmjvhi_l6MHt%PUo5UgKy0k+L z!xiauxz|k8ZC6=d>ul65q|04;EhoCD!!dn0s#Ib;s{Ir~p=2SxV=0sEW?ydbY#k9| z30@GE2T%!qAb9$Qs|2S{S_jT3UmmP+b1ocJblS^s=%|tEs)0g@l2#IoT`q}SPc_NP z`7EI^gu1FWK0Q%E5U%l3Fm1G1=JftP>qnDg*m^{^3LgmO))r15dKH8x*oj$4G)Y{G zm^QLb7AQayX>lqG!M#P{XJ9VpAw|C;a(zRK4#v;OY!Wo_-|P?}?<5xtS3^~19lCpG zI@5j_z(tuAGq_IA!HWU2Nl+`#- zn~)SlLYJ|P6{7gwaq_Us3meRQM@(>r@WKzsB3p9pDL}&aP+dtE?D_3mJ89cWq%UP$ zn4I4z_qMq@*Wn#rbXvswkD^nWCm+?AE-F<^>-#wzPkQN^)|V_V<_>!)7pz{!x_Yrt zlf=LOQTajk$?}P23MJWHGT+V`^iJ!U2V_Xb7hO;Aj4=S1XYqV7|MI z{MBgr&S$0nMOePl)&?xG?AXgTT@;_(W~ z#G*r7mQ5#)*JSF_fRIkq!A-FRYeKP&y;qtD=_2f=F~!z$WhH!$K=fE8yk+Vo%CE5= z_xa66zi(bj2+}K^&t(QrmgSmB9z8y6TL6`A(%(|$$2LMhjy#(x?aOBpMvZB0fTMn0uRE0}%*F)?Y^t)Wg!3 zIzv01V<|8~Q`Te&Qf%4#z`af0^`ceSU2G8J!BXeBhpzK5cQ6U+#z=Z;nHdiFai$(h z9>wp8X5XgUp zgN2p(oeIOxH>U3018!*k28>Ww+eWd(LH$6VH4EaU>_RZLH$!ugEg{HOk-Jf^MZ$AA zk1(k~)ccORPU!t;$hp#+dh!Y}He^b+0*a1RmRNZT{4DXnYq=F}hYC%E#TAh@hBYXyI8x49!GS|Q5zLOy`HQIhin$|WL6n`B6D zrfY_d&~8lA<{6e&(XjHD$zM{jG;PN|wJV?ZPY?*M6==K4E7xs~@Nq|s?<>5HX$*L} z;aaQm^ZnjNX|3?9wg_HcR{7XlKc;LQpZTEMo5m++#{{6weMFh+sTUR|JPqTW8Dnm< zUS0&ce(d%|)Cc;|b)`ZVPwo~+N1)Q7(H~VZPZ2eU`*r_fJHphRS(NFq^N`o)n6zbT zfdLCc?VR1HO3~|wmbPCSBgBuH3Y~oKNS8Wlw$Hki0&JB9Qz6BVwgp;mfb&vhHtD)d z7M;T5SJ?8MOgP&vCrcvqHiNI9u;u&PO+fs^pV;$@&9BfvS1kl&Ip%0OqzAc54&K#r z`qK}_vQ3EZHKy|EMwj+@CeW*|YbqU;N=;1W^AdNN^G>^@MBdzbOgxLj&?q2()>^bn z7dOuApHJGcgWSDXL_FAgbN+HW9>M#0{B?D(A-Q2$BIjaPg0(4DY%@PeY25%aBMTqc zJ@|TydOB_eini035UA9(^^9#^CRAUby&95W*gaq)m}YIZq>n0v*u#20_3a3hqbm0J(%L+PFS1F<0ASn+oz2x=YrDI zAhk2MP}U*Kv(FJK!h2L-hSN77%$`Ge%wi}_#Q}4mEHCwS>&5IhK_}CLGVPcY@_EZS zGOT58j_S?AaW=eRuIS1JPoyV}Lf)!n-m2@nmP;HOCW4IHeuVE_Nayw?$)vf~o+6HI z(0a)`d8I{NC*v=>^I~)Kkhm#MuF&svJvI{3fyQZ`gbGAb_DZ`!bf~RzmJisA7(4Ka z>sA$uwGbyY&pZU}9bc;H}g zaUzzZP1kKGFjRlP$4W*4W+k)h?f8hgCe(Mau2{-@-z7iM^rEGFig*SS&WC;*%T|qc z{4RxYbB(L5;~N@<5aaOOhu3F(L(5xMY|v`6j?x3OqTH7ds~Vm5uft!cwj_tQ@=kSo zF+DFGzpJ!%YDnGCvkfzEIny{j+@3qPwR1}Usfsd#n7Z=b>ak!}(JPG^EoZ0dydll? z6i4FQ!q7(PUGJ9_-#;};*r7DcVQ@$hzAwE%8=$VLY*!RpjGjFLHT*(h-AF7EcA|tz zjh=_+)D20uG~1&%TNhk_L_XK`Jxr6iOVvzaH!dxXuVD#5uzeTdqq93rk8G>|aFHSV zYx~d@_xYghj6!1&`yEBR;}Pjy2!%&l?4{}CFI_c3%Ipm9haOgDSBi^}msMMKJ^|PV z6yI-@$Yz_?Qw+AM;|FadNoON-Gk%ys@n&uHy&$sd_$bG=*H`OP<#Ab|;iqL=(VX6w zqv1!HkAG#Le7X@*cUVhw?0UI#IPh!3qe5oY2zIx$^He;g2|4*0x#z?3c)NY__fuzd zg!qAxdP_hVMa|s%k)u1MTz7KQUxsPtU$?9EZCEm_B8%0KyTjaZL+!&IwOTn_`O72M z=wr&$)({;o9UI3B*Pefjcl0Lge#+w$x)wYCZOe_IyO39BZLqZ(R7(5f0wg3`A8}2q zbGr3Ys1mPw`4K$WCyW4Gw)5arq97V5@@@ zu^AxgOCkqk?@xJApJR&K;Jb(k3JjB6*JNWldc?h2*2e7)HBk`f$i`reH zh)F<3mmJ~_aNMPXG(&uEjzvOsZ=OJj1Fy~h&j<#}x;2nEXn^u=GQf-m7vSk(K_X|n zw@_ev3_U``BrcWHnL;YSH=zD{x0^s&TkPM9h zHe-4qqMrq^4XEuGKsqr78jQif;|UyqcYqYh%M5-<0_d92-K#R;Dr#%M*9HX44hSRF z*ucf7zh^*ySjh+o4F7x42t;7@)ZF=@XsV%a`(S?wDXM>bYBq!k2PPxOJoK90#$|qoWpXUKQ$Ns z@1^`Bz!}dBufiY%UX9^A_$R-8G)#b$6Ma9yF+v6UofynRL_o-ee*-*!xo?QM2WiLR z{|9+Xn^psXGlAhK=YUqQfmXiUQGiq zHDSS@JquEIGhj7tf|S$(EVuH*mkfNFwgLPTY*fGZ_J8*?{H(-(&J35nwgJHtEDwp> He{25*U#n`e delta 23309 zcmZ6SV^}8a7wz+8>&dq5$+m6Vt|!}1w(Xi+lbdYYb`z&M?{&_n|M_}<{#|SBwfDN? zs~|gSAd|S^V2$Y6M8LqnG?RtZU;$@2O)M@gDmf^!r`wweps`C1=|{9rncMIhS|WKjX!Jmw%Vn=VP~_ z55^e(s|``_t^<)cbzh7PmrZ^=Nr?;?8v?@~4W(#HLzOHpg1z`)PU$RrvPjlsk(oS@ zJfL8TUPd8=$Q;}(?VqfU&O=UR1>%W(B=af8ARdsC*f(qTZ^j@VqvpGp@t2KIqIMP; zE|58BdDTZR$S?-Iib5z+-n9w{kq_aFe96g(elK1Kio2I&N? z*UJZEwrCIIl7DU0)_T#q$0!caeGH{nGr6-3#g&S4S%y4jl_7E@`4s(xmeXU)5zldoE=$_tTN6mloD zWq`$u>(urjii0fwYS2E6i|6hS1KeThC7ZKqxI^ppKzUy1vu zs7INf-et~{mF(kkB4+6yLe0cMha$2TCo3s`P`9(7N&#!nVmVGVvlmdlMVZKRmaokY z6LSfUt<*l3BT^4g{NYGzmCx$X9Od1eoqJkI4=cF(7i)!K>*Y-~;1*w39tOwJyup~? znaL@g!cu2Qt26xFF|?LApU>iia-o^E<_tG*q+~T97AyN8Y2Yp9G%KNi(DVyRy1UWL zabz;bMD|H{r9BD{!4KF!zUi2CEM)$^$fP&2>MoGjaEaURnD<#`H0BAo8A2xHcln+0 zVw{m6;vd?VEq4A&MWn91DO>W1HOZ8jpAhRUGS+_Qpy?9pr#t3lE*OR5;g7Sscpm@= zBx%mL6GQsBaL>j>JKUCvIJLFTaWmh22Jwh5IdB`|8@cU9?UN{at`|e)ActbB%JNbh*i)>-HSsPQ?AB?<c!y{pwnZ^;%-*wDG2Z_^j^=_-i)ZaT5ixJ zW}lvsT|fcV2u}haT5dIsT@!O0n-Rix6&~-`+-bPAtGOHS=R9FsrJNvi+1(sZ{V+FrdjI#*!NQ!)(y%n zkSNY^i$rnXh6%oRJ!l^+h@GML(#6=lUIO8n-dfB?QU~5A@O;(Uo`mCvTJwPVC%Sa6 zhCStxiJG2IWxOiWWr^BdeTf%|+9Kg-7XKz+w?~Gg3s=<%UvR4IwpVw#e#W0chCZlb~^bLsv8C z{qO#`9GlxFJJNbs#mlK9uJyf+mt;qfQc8K3;r!L?nr9V3M|5Ijp2=*JS3p)8xXHqw4! z^&XlBc;wO}t_Jf#qc2<{Ol{UM+q(}K3aesjdd@vd!NDuF4o66+IkJ!1p}MYMv=s1F z(?pe!B3tZ8OXPZtCX2}AsNFeJK7nnN&iA(B+KkgM;&v2wpN3LJcC`CBxoAu@0>&u0 zkvqMr`1S$)DPg&As(YUY?d&(oSm+zn4slP;@Q+ORJD|qMEXV5yv$7l{6ebuLEbM=7 zC<2y;&?!uT0S5L=3kF8=-;0y06{v=j6o_^F>nHWg$;|Y0BeZBoEjju)ktYWYUJ6MQ zDTxUy$pM8|O57IZOr9M2r6#ea?sc(8JC;{vnT9$#2VI-T>V|Gz+scZSUBGosK!ek{ zUxO3vEzr`@(J@7&|0u)BvhTR|+pX_0z~`@%lAxS8!dnUIUl(CKiR?lSpM|i8IpC38 z$;4>~YTAQ$IQ47PZXlC5X+Dh^sFW7=-aMa7!6d4}RVB*t&}JbFE1#&CRzU1zR^3}O z$tuzt*$%z{z4%;!d${63;G8!7gd_Yk(i%At#RV=SqB4E*s6{^;-iGe6Go}X15cMb= zo;d{&E5=cfA^p8T!VEffMSF1v0Qt$qCG;_lupR{16K4<7NQH7{;r8n^_ccg$kqvQc zK;?$nFhz~JG`aXkoC}MUcRuhyrauZIhV+EfqfU})x?xW2Mwmy04=zm{Y4De%w#QuIz)i8%_{|Uk zxMs8?KH@pgW1R92cOO!15%+*{eAkZC>e*iF{B!%YHE;V3a$QbW0$Ae;wa(Y zct(6~j{1$(CKrRpgulP=fvYT790tX=3pFLaJuO`$ZByQ-@Z~NZ(cTLyhtHOR*&$3? ztkA{LGm1l|+4HH5d^P-xg6N#pehj_cn~l{uxgxcQlIVi>)}o0l)6dy!+66>7Oxs=C z8VG1+4k|?gt9AqLSG?LB+h-1m!Tl!f<;GvAfbFRMds_Nv>fFNm#>foFBhlWBBs$8l-8 zGQ;`9OE%xEwP7Q2f%W~Q*=SM<%g#lRq~8SFb>GFWezG8Kppz$_jGm@v)FJ}A0N&v? zExtRFV1!Bp0K%av0Xf)rrcEQNtxd?=sNJJnfW?E-IGandT4RQ8E_2;x?brPu%ON)Y z_hyG*q{(0r*l`O^wZ3MBYN^+ozU1qUS=;rK|Iijg_%ODya1%ATvl8;vq(u7~{9vCq zDm$$bj@ndLfH$rdN>WA!8S{PYw0%0dY?>Q~wxRv%ru8_+V!hjn=PF~1KI7sOw%h~) zr}(|wlHCsCxyi;$;h5@+J^M*@)kf{LKCmecCD$j3crJ)Xnbr@wQ!^co6%1yz2$G9W zEaR=ECfrXD>TTLCy(S}5=Bhz)%6JM6EsgS)EFpn7KzvE_&?2d=+{{+;=+r#$;vrv; z!I<;5Yxz5=tmUI4&| z$8&VS_NWvFkW2wBW$qdTHG`V$q4Sw?8kS0%6QF|K6yZ&0X^#GD7HyK4)x2Gq318M< z!mP7`l&?r|emf&AG_zV(zzx){&a`68SP)7DG*V~4Ss;v^(Q7mYR|B1OVbuLO{_O2g*)JcKpJ=9B8iCMsQabXr8MpciTQu(h@! zGaJ&y&i)J@q0Z5A^Tk1N)1lJW%x&#%DY1xJdH}6xVz=|0Z%OoI=W9_es{7^}DxX6F z-~H0wZG_7T7Maz3v-4HX@!t8<>dTocpI`;67l`^`;*_cfQzZ)TCAt*Lw%zLnyEXdK ze^)+u^hoV9kB?<&^yND#ztQ_cww;>Mb2=5FepF8w9X5!C+asY(GuqkGtCZ6CmrQWq zbE7V=V>Fv$iJw7-J88aQ_h}q&zIvtsZ}<3j@xFG)%_ps{|81wHqq)QK$rP0EY=gl5_+G7ShWKc->Iv7S5g7FnJ@8xu{O7PU z+4`9&TIxeRKvpy&lmkWgb81(`hIzZ>0sO0eVmDNyW0JOI%99%0E*g1SE&`blIVM+? zfH|QZq9otV)VE-z?3S&SYbeUDjp#BRN$-;Ny1x3LLoG>yQWDyj8bC7@xiHfjneX zN<-*RBJID938kn*6qlcE7yGR`b~?TVM~Z1b&Ir>`9zk?JDV;*^0H5+nKmuF#!*f{7 zSAqELH*M${*fpf(oz826Ca4(H-G?$cjlhT(*fc8*p}|?&e*tMg5@QBDd^?*M-B=Sy z6R}^pD}wq{HiU3BlAyDXqQTjke-O9CF&nHJ1T+7LK3e(9A7cNdNdIl-Xozc6E}u|) z)7S|$75PWn^t3V8n!KDn0c@CTT`w?fWKCP9RGp8)xEMdAiK_DrSegTcuq!AIpo5(G z$Y!pbS=LI%9HK`tPhh_m&|0d{qJ?EBY7Q!|)xXew7u_Xle8K&$dQf^}jQiVRQ8?lB zIIA8QxhsKmq4QDs#Q)Vf_*?l+P-Kkx?UPh4v1(rZ3(J4%H}=&O0q{D`gFL3)W}TMT zPx{|oa0j&B9Pv3u_)qmWZvXg+-^ZKDdWpT%h0lZ+$w^Xw+s}@a#>MhIwla>{mnKw8 z(mA*$+`ixpVGC`C(cCCLqbbWuoS@3%vr|1r^HmRgs#g*!0E-ErPVhJRRXFI9VNXS5 zz~2b^dDIgNM{G~v39#9!bXifG_tux8uws_&SN;!-AM0xfn`(bvUAnuF2W7$%Iu4z= zwP<(_)tK0vjU(O@0`EP~e$O2m8~WzvB#jfDBb>t~Mj5+qRxe0er(PtSwWa<%b2h<-1Q0`5kFI} z7{hQ$byd--s-h&~22<>Vx?mhjS&ty-d(Gr1SL34EZf*L@HLa z;l2TvWj=yBvjvv2#K^6lqs#Wa{|8Td|0t+j90i>kKHh|A-A%xUrjjIX$AfSTwnFmM zk>R{+_c4Y>KgA&=`Gq|^9}>2TNwAa41c0PM9x;X3e>4_v$p6XfJ2W+13&GyCsvo?j z_(I1ea0MJ?<>p*o=fZVC@L=eXzb~f5a^@hFoW2&ZTlYEWi90o)+7>es{jl&iK!OhxI88%RHe4qO*F|`so}Yv)B`S8Y zIF6L2t>F<5Zk`b1_$nOQ_ibII4f15twB-m_3b#efc}` zVQ69)`qTX)y^+k|vF!@^p|8X#EG>|Zh-=a|JM0-EYFie=n!d0JiK!>)WX>~N31>i= z|IFPsl$Xq%3D6qMcV>D)0qQza?Sh(P2W!nV8$_n@X4Tw9AU~e>X-&N;`Jknd1zJt{ zG75r`lbSYOi1@;)$`=~6CO!|kAtO+)c93;6c26pL=KdNa46KCkcE z3x&q9GM;cB1DK9AC}|zW+6!Dr5UBnG9}%*bx5TCe647%9d60}(yEB5QWK851?x{Kf ztMnArx7p*OBDhs?wjW~fSJ8t+HGK_k;RPPBtT1pOuN5~)yQ9oF`5?-0XW>F>>>zz* zYa)F`c#XMw=}1UY4oXSxGty?=d1}TZ*A*JqP~t6Wj5g{IOYyxsED(9P0r=zD$=Q@7 zNC>OR8yad{ibCMLHbfY}iGM~*eflS7@8_5gzWV`%UR6a=T+LFBw`}b)@`9`Jn>*YM z`%U49_Y#MeQ1{fWUb}C zon@s5g1;Mm+MEOIy9TDn4+S5Qu>F%ZxBD>t+YaCiQ4pH4q$ zfmy5Y!3t}8(3>0gvXw7(_7-fmL40uQ<2#^G@lUAZsOZ~_ z{f=sChUzQ;LDGk^_lewyzUv8@D;PD3b55!KX>0$Jd69mvBhqrdCdd?Zi@`VEFfzl= zn))+pCn$q>bc=XVY0m49kKbbO^B7vxh>gD2#c?E~ zKhSp|VaWa7tn@`qPt8Zf@27+-QK9}f_-?TL85WN~0@%;ldG$gEJY{k`c@NrBpBj$* z9gjgeDaXl0f1H5rI!^+Pxvh-dI$ANVHcT6#ulW(J*m}(t`|GEqkSYhpio=5v9xpXuIJ} zebY-F9Ru7LD~$M0CX#Eup6XX&6w#r$kyInEyz-cuyC?*6Qt}mg^aoi+6>)Cn`75P4 zs*)0M-Onp{l;2lKD8cS;R?y5K-Os^vXut*o&t)SZA%W%yTWTNHxd{K%wRxLw&!z|6 zGu&bF+MVzIh*-B0;%6RHcx?JaB%zcsbs=-kdz7^O@nU@^QV82Iu@*w%(-fX;ITJIV zN)$dfn|l|eJVPmb@>??bhSe=7tbfCx2?+6jS4xoJ?k9R|+zyof9qiCjT+{Bwh(v|vlhf#+^DLVP{+ulp9)0~!cGv8 z%^&{7Ijvj-l-m>!j%u#6^aP-OBYaBnX;U5?Q_sG=TKxJ@Xe^a{?cJnx!#(u*? zcE;K*oRjQflI_%NJENGl!guHf&wS5)`_A7J^T_ahO9AC_d<1LBWvF4>Ye&sY$H%g(|o;It{fCSlfRt5?d0`a@PQck{f-}$aqmFD&q8U&m%t_O zVa&gC){kfz{#5QgMd=Lr2)8v1WW4v58{LH4il8$SkrYapxu^?F7%d!g zmZI5>A3&|9bXmbfk&~1e^+PwWIXX+%NuT2kl#?1xY-4)PXS4MI+Wb2I3#?iQPwCG^(p~i)iTy$=_I|Ohp*bcrf0LY~PH<>1{Bx9)q%|G<%|U+L z2RxCn{J_Vnu&9?AP|4iCa*y193VB68@zSD=f4O)Q{@LVrh|*nE2&CvcVnOUR&J(MV zo#?JHG4n4y_yt_!{Zl(HLJuQT^#QF{-2rYg&)rx$jYxmj{e*NcebuSj15cwVZ9YHZ zto&}@1VMNsXmryqFPo-0k6sjg%kjqa0=x%5(eBwwv_*ppU}PD5bmZ!)N)YaHNTC^@ zJv}U;h8*Q|>45Q~jg6qAiWqxr$UyBtX4v)l{C9H#ucihi88$otDY9EqT}iqLDyXm& zVR9wCwj0m$@v%E}_njss#KO3w!>*)H0d;!!<*^{w`51C%qTWpbp6T6FCvcP!-6!dR z)HYCxpG=<_Xpt{EAt1K7rPlgWgyNBXMNp)*Jh_EFN~Xir8JZBC$P_=kWB4&TdWty; zv0m6_=&A(x^&Y*mk$mWeV(NcW`i~umWoxcG41lRL5nu8FvC_8$a@nu%?EznWS8U?OOyJsRj5II z*#o9QO}^9{0m=v2=|jWvg0RxOuTHVNmLUalT@3!JPy5$4uV&$C7M;H|<+~2`%v8X- z#o?JOCa*^g+ZMJ77m5kwBN*S@LCElIFO9!jDk68kX7lofs?3fT7!Gc*yEmU39M&4X zxY6hUo0!ao7*>zmN?Rt^UI`D@Z~83kv!|)JW4#7x&f&+2X1V^N_QtpM){nEbErI2e zP!4F0t_?HY_^wA9Fw6ydnkE5=O!6DhPISHuMtSwAeNLQ{e~U6hPc-MH2XgNq;0FiRZvCb#FGj zl$`{wwG->UW;tA(x;`GI6dj#pZB1j36W*oBeaPcI2#;s|!6+4-aa_#8>nH#49t|LZ zu3%p03D5X)J(Y$>=b z^f14vMImD=G+LuKtp<}Sjkd(RQPD6S4IBvO9?KtW7t+dIIm_kWXXE zAj@Gvi=XF1Gk;2xqze#-L4ob~@4i%piV< zQ3-DsrLd?E2qIW%Aj?vY(~>C3#9ZD&ygr51pBf*^leLR^<- zA}!A4o-vl?OZ%^ea7shQrq~xoR_~Pe>cP1|=tn(#`j~rl!*S4X!9t5`pbVFKA2Yn* zmO(_@u$>w!l}3rNWt(P965>K!IjtlcGY&kwPCU;$E)Q}f@ZiZ3g)vb^!G{7-p(~x$ zVo2U8ySg4unyq!CCjg69VbFIyM;Ej^k=#>zOa@p~{-xiezi@ix1K@hwOOGc|(gzR) z@NPF#SICOW;aDv9^*UhS+$Dh{URpiu=MBZ`jO_d39LvQqhav{+&ag%S0w({^f#@1C z6WDUV^NHYqfw`bPv6>($bShR#W8FbSB6fFPi%^rP`DCk&u5u^4u~cCz%Cs=Kjw!;N zk`0d@<2DF?DM|@oJg3DfqKDdfdN=262FK7{)kbxC<`q81W^)lid{v6+-BEz(@r}NO zMr=P$P}_!{b}U7C|rj#7*nBk;$G$mbX_Gcj_BHi?eB2bAOvx08p!FV zgA0mrjp9`SGT*4dRbgsVTyUW62r6}N#+kvLlrAC$5sqbaxxj(Z|6Ux8P=pprAi%(A ze}LxFsX@SLbkLnIK2XIUc3d38J-Ub0%Z_llp3_U>p8VCopEO#wIGVU0#X_LHrldJJ zgjKgiiVk{}})WSG+%n4%brL^nBr%l_#r^W(gOB6>C3!oyU zI=H00GzI-`SjPv)5!w91!e-zzvg^8dY&f(98+OR4X~_jp)#osGH2@((_Th+Cb_}vC zrEjX(uodEQ0sWHvhGm(GV;Ns|6CY;ZcDimqtEgVIV7&a6(+QY~WJWY#SZWFPGeP6W zjaaF9&~J3?@&p!ep>6w4v0b12$#tw7$L!3pQ{<67{sxmJ#Mv>F5y#^1?6<#8e?R)> z?yQ-pv5k6QaX)B}DnxXe{UsT?a%n3txqsaj;pXwt0s_jr6rUO&=_ub={m+&!zl%%` z>RubpJx9v$rx-846iK|(x;LLmiG%56pGKxc+rAsGXj9$`{|J#!g4v+Rs98^)+oQxd z`it0Rs6&T75sAlWuFQ>H%w>i{tV?d*&>TRa%A!x6@kS@Zc8Qlfsj3q5*CHNKZpE;s zB8!nu0;`f(BU;c7(dr7%X#Az#JBxslvX*Nv=U|Nh2swvUz@ks4uC1hgddXopm;wRQ#V#bxu=b^B^y(a)mq z!I{?3^r~k)tM{_+lApzkZeC`vRE+~J`69xRnYC8QcgRSJ z=VY5p-_kZmWFos8ZwO$rX1gSt?IFdeF^)cwW$~-4PPZ$QJ3ggw64h}2CMUhET+gF> zj)pUUjRrrWNN2rT7uaA2mGejexW0%|#G@e=?v7gY!Hy7Fq*<%BI3-^1vT^pGVL3|J z)^4>1HRO$NLH_;0si6@sTWze@r84fWTi#RU^-6^txLgf;&i8M=ot;o1`UrUoI{O4g zL9G|Yk(bC8M7JB~qR-Wti6|8ej)<}=OXt&~$bWv~$3~vr3beKa6!%`4B_UW2(Wzxe z5fI$;%OiARn!)=Z+jWh(cG`b;xl;@nrgtuqtj znZ~_uDk-6HSg5oECQ*O#^*3wSEO87O2B@xN7kr5>T9jsCkJIgwInGE>jb36bA`XQ9 zo5~=vw#Yf;2SU@yl9^`hSDz+xCGyNUzd-M2Tnwdg*Zk;3broa!smXZFQdEL%sT4SH zZs=2S*%W;kg3IMcC)#UBr^A@>%U6((TP)*J73IZeB7V8?ukA(pyENvk7z~{`*0g2E zn&RSgs+QlT!Vkm~=+JvZ+$-m#{9v(*uQi3Vc4glUJD__*HjI&#C|0g&OL+>zqk;Dh zzhRZ;FJ!NE`h(9$7>l*T)xA%Y*Wbemxx@5iPlfP{{Bh8s#XXCEPzoxapI&?uExB!O zDh#7XfZ@#8N>>Bl?9&0>1sjW|@djeVdZIxFV?WIC%Q*+lQvHVjD!(Z4hom~zp5D1( z=A?StP=HmqN{xa~4kLlVw}5wy*@1vpNJxZ*s3+=$`nM$|*lRJSQ5(D{G((@R!~xT@ z)+hcM%+K*bcBmJYCs*R4;Sl-Al ziwy19z6dyZbO+Y#;$#%?E0PE(!hqBx8B;t}R3L>;mrsX4o%E8M6r*RM=5OaA>^v4$ zoCWwHR=EpyEBEnvxj3dnvr|8P7k~Yc$fbrPPpflY|9l3Oi!sW3eM8|~!x7pGG=d;+ zCM!~+A%qTz4wkgw_eL_ZUyc2rr2wZ) z_;Ju9!>Bh?d4g`1GgntH#72D()_cQ22`RyGe5&5X2^Dz^8EF=m)X{yn$1Hp4*L_M`GysT`wZ;GoJuz8$K*|Qc(|j z?_9=B$DsmK=d9SQ6^p|vR^Zsa2no%;$LizQ%G#-zls2T4ZdjhPS7mkIVIaxB1-uEW zP@yQtrBRbkzk!C1V`ne>>E!8S>5+1RTej5vO=aJ7u-Gx`QhORHAUTZXuJO-nqbQLz z{RDM;!dYC@{nctaj^)N*C}W6aKoNFxKi8`V=jx}nucbMT)P%ow(sdT`4#jM~J4?h- z+^W5U2dbUqY376dj2Kdl@&rSse|AgRnxYvAIVLi`KiGg~1qh~Vx@A%O#-FXYT!+g% zk5^5XZ=%aqYlcl!KwH{o1dgFEKHuyJMPe+Ad8_oW@)L1xkR!Iv23TozK~Vsilvu({ zE4;1E7S(PpWMeSIQvDq4;SpL9$Q+%M-dg;Z}Z%N<1WFBnBusOaf@Cgk)34jh5{Zt*GgJk8X=4?AJ@8J;w2Bm z&Ayqn4s|smt9QL^ILD>w*95!a8!U@1+OuTXSp0XTSn2!O=UpJ+eYc=a(8|*Dzdmwf z^v{peoX5P|tvgz8U=VxI*6u{OO?DR0+ zZtjo2YchBnaW6Q!WfXjS_@n2a@?hfYD-ZEcl0#gg)H^ePN8{it9FW?_hbFGz;l%`y zxMwB*@d$+f2k|2JN?GHhKG;B!i>h2(YNve?WQTte6$T1h&j>GaXt25PR1$R~*haIy zZn;WcLDP$+ep=BUw7zZ{9pzx(vC4c8oc46@rpf_E3U@Y$>|IPYz6*#Opyfzm8{exB zx8O#XO}TJtWjM!l1Yp46lFq4atuXj(J0wRC8)Nvl;MXv}Axt!aN1hJah zI!;gxa3Umly?=yRCbYu5+?cxDRPHae8hoAfLCg0pvLLm~?TH4sJXlB;b)3fX`})k- z<6^@8)pmJU!IEDnz~e97{Lv}~Hz@vIo0*QgWFPth&NjS*uI&Y~QONAm;GN$x+zJ}3 zJp$^jvvpr5FJ(G*L3Cd{4lOrssl(X;e3JcLAZpfLvag>nrSw%9=QMxY6V^z&dnKMs z=^5(oI@fps4&+Gg&Bqc# ze^B8P5rp@4zfsP0a=W(W_EX3mdRiYB27r^;hI~Hj69L9>rZmQoniC1<+_ukBD{({OxRpPF?m%X}WTTMLBCt@_K$H%l7R>WhF~(N7nl!xuunTHx59 z=G{FRu3K7Yr9(h)-gbF)BIR}ofXhSFZK>2D9^XZU|`olFPk;T z(uNIVg+1x6J(jm`HGHoVgFsOZ`Aua-O@?8{79e6ySD-J5zb?Ws z4^~ieJ35Rr*(dR=DIL*@8|TdeW9WB9{{STq`S-nHH6(qjw!Bwv_VWyv?Yf}cN*VwR z-rIG*?7@%_4`JNqyyB@10+_)3)p{Hc9V^(c-k0ElbH3HX0mGJH%7q)(n*1K|ugKGk zs`6YY4Qs0rEe`d``k2Kk9y{5e!D6KHQs=iZ{D){p6`pW+2awD1SOy`f3RYwkQ!KXd;bG_#|Z6-t7wN8B>X-qg^WE45I? z4VxC2;<=!-<0|f5NR0H5s zCiea0i;szHv_YP5Hn%wQsl{W8&kyHtM%J1td>9$EsZ}JF0zM?dF*)UqWTPV{7yhbX zZ(sXEgsLQht_1p9(WH|rlHrZrdr<2Y>e2T+h4g-JgP7z1@x$58_z+b`>5$7-M$Q{g z15{}l(4tMv5}oFz{c~z&+nG=6FI``sarL9}h+9722o7c?h5#juET2GGq4le5{?s2@ zs~&IK*q^!kzk!qvrQSgVGK$z1SAS%dEOgHN>beS7HSfL%xZZWS|GwE17ted(5kCjb zhAWmj1zPYyXkjJvGi+n{^gg>`#CIs&$XN1YXutbB?yJrgj0#+}6eDbtLNf)jX=_teC!e|j z7o>}&h*KuCp{p$keK z-nM<*`tZ2K#TN|HFZ?T9ivT#s3TCOI9&}U)TZA13X!!zU| z{q^RWk?Lvsa>Fgw_=9YX8W$B>e9@Orss!P5+KCua#24%#(KcdXM-XYVr3Oubh)qYI z*5=A}h5u$LXutW_(6oXhzA6eb`3*wo0-=vNPXcMR&_kO6Qnl_?zJ!z#9i_&hQ@h84 z{VEVBrP6$y@ehkRTVFjEzh1#{vXe1_rM-sjH#svPCEZ%Y-b2_u=y~-sjBQlG zHYt|Pci2+*S!{?z^?|EFWCRWg0e7)63Lg(Rv)>az87C!D`}Xx5Wm27i%|7+KBOD?B z;>jXUWX2O%Viw`nAy&tr$uHP0CBk z2Ozr^vLW@Qdbk2B^53T({3wn1LtsusHS2|Id|T9v!Xsl<(#NZq45gH!ExBqF2R#QY z1FJql@DT6g^oBoD1==6bASHyb^IW=E%R$VD#V7$tvc7|z2_eI)_)>2jI+Tc*uJO5? z$HAy6(@Igtaaf3goM7NaDKlN;+QfcxALBX+AI1|bc3>7_3kV9UB+P!bE2Z6BA(&p( zL@xS^5obUsn2-f+kxn-5HbORjwwX&9a%-$@HBK5HmbpWN3?+1C*`+uk0piv?l-6i( z81yDk4>+2G5)154;&jg_{|j_mf1_LGe?V8m{5Qc;gYFWDfY*u`|HY$rgRX1OCaj{s zy&tA%U6}Bke=6Y7St*dRmpBH1?bo_E?cFCgD~VF~aQ_Zb6vX2xgo02ka`n=67qTS| z3T9@evfRqOPHw*b{r&tAnAA*Zg23T2hdMN5xu3`a^7_6$Xo)&XSXYrNY!u zBAHajEl1&I2`HCt#uk^MKTpE})v#$amCn?-khuhnDhR-r=k zG3bg{(^-M2!i3knpHC4#?BS_@8b#t$yZ-TcHpnluQ?BW$S8VC1^We=Uc&1ZTNFLsr z(4sxZ8pY1%Xr?|=oIuG?qdngg!x<5-d>n7pN884*|8}g&Db0@ff*|*cACaB-c)o7`Qkj=;CqPgUH;=Dc;bjFi)BmzdAyKQ^`5(J=|A{g8|K0N4CBT3# zlF@;7N{h<4fr_j1Dtx$y#Zw4TYMREW;33N5&XO(W;2;3{&-D4JlzK`Bsegbk)V^2f zIEskbFPa0t6&UIqOi2UeC9K4nv>IHk4dXDACiO^&UXPMB|+Y)4$ z(R{uPm$Y{KQ`BiU5R(SQADf*pA^YO$q=0%T$CD(KPegrobD1gU<1# z{w(?{qwl5v-1fzMN4wCvyNl8mI`#=0zZ40t*sBmWIFZ0b=YWIHrZXv5FcNqd4+~EI zbag1|8Lm>Ch8o1W^}|TaR>k~ZS}x_eejdNr0mK2dXTp)!lY!_)-YvRA6ppk@-)|n$ zd=a7E1gHEL^kIeHFNvlyV4GQj2o%3waXYX>K1eg<;g&hi7 zI;2iHmKoy7bdIB#RBJJ1VwR!^0$gLfgSY-a#&hlUXF=1cE>Pbkze`(0)55@^rRFWK zQb3dGlE6ijw$xt+6B#twAsQQu7PJS{QKNVmHFyBbm+UfRQIol&=C9hClY2qaF z!$0nd;=Ib~MK_^d-A;G--EIU=XQpm{{tN`KJXj~GFHEH}D^C{DiEyJ;U&xFsGa*Gn zvaqRMU?_Li$~RbWHX4GA;CabG?EEG8m8^&Cl>=O{Jlk}1%QES=i)=ehX)*2g?3iHD zyAoW@p><%Tur(B8F<-UUs=aOZ4Es*ME5SYe84L> z`F;c%^t2w&jrq|{$weiY;PScRCZ8lHFd&*5R#|)3ngQq$F}BMJZZ{RhUitEkHO7$S zSsP;#E;ASIQj1(^FAzunYwGa(6%(;djoMDk^5JlupFY<=~fD=M?kQ={(}P zwD?Db@p{2}78aVprx(8PhCwZ|{;8yyG|qi^Lq^2tfT2-pGnoLzn;tDXh&u>X;sUi< zf0HN65t-~Eln07#3Q5XFgr-`x5|DmkfxfvSX6*g>_c=)HnoLH-ZkOV{S>7;<^Req( znQe$fZebD&AgK9`#bTzV_K;Gf28*(eJI#iXyY{j}a`MQj+2>dYr-g^&vV)%-i-J0m z2OYM~O(YMxvTUp}6>1h(r|9&COUb%YaJO#+^(FAQZNih^5&l=5aX%f7fS|@K6=0Xe zxo+V@iSe%}?V_?js=~0eq$yNX3V5soNoNi;AU5-EInVZCAhhC+z*;PhGzV+`XGxq> z8&+B|Cz0n);@ghjZjVok(eHqNh=pMu2yjz+jZdazPNoAP!4ka!Tur6zG8F+Wg=RfSaj~9dMIDHGAt2SX$bjH%R`C$`o zFQP`B@iD6cXnnAP1*AG22IpD?XizE6Ih?ajYe+@}d<*sb6IAwU9g$sY2>+*xuMCSS z>e?O#>Fy3G3CW?mK}JBNQ&bolK{`ho21bOVARUqd0us{U&^d&FbV*2wbm@zH&-M8E zoL?*Mz4pG&KKuMw>t1^aXLNWjy?DTSf;|>7wC>csY%ulGjlmnoboYqzJ>`npSFO|_ zl10aWh*VNWzhF(tTi@BPHyS3Dn9j0pdXgMXgC~b> z;g!{fGjx=7sRab8sQoC+lUJy^W-(H?(m}-mpzT z$&JR16O#>l$2>#p#I2&0_X!5n&IN>~e)VrgNq0V+&fMhs%F)|c_Eh4Nz#N8!FmeS0 z=AaN6MJ6Amk&up}?IpbCNm{?Ic1YAD8g-$1pt>e=^F&RU+94t;AyPO zpmSb(MX>sqwY;Y#V{&-Z1Ao<^M@Fg|&GF(viD0C({gw+uRu;wk-xS&v0qqg=b$fEn zr^uAINv_-^1g4>ea0>Bbb8UhEzwLMSIcihp@B+Er-Gvt~&)0WZ*_up(e})CHS- z0CPc32hD-Iz$8EJkswJbI}yxt&@$ z2;Fmm$>Rsf; zU6v}<+ZQzd{)bkde7OTGWQODYUhJCujAW2#sB+FK1LH^JSJT*$gFs!pHyqCgqcrdg zQvzRuFEv(t2a*7Q$&mmGlVv06eVPbTe(^&@)!_9lA>7C)Urn9Fkly=mQ$Tt}x#PS? zdL_BmLB_>pMr!w>^-9b3p170*&B;6O?HtXU&jdURnDKWq-)ucjNg23L%yqo7vMm=- z-aIkAwZB*6Gk2m^sblFU-2jZ(qY+J&C!?Mu^ugsFKScR-Y%vRVkh=0(s z#D8&+jUSsTALC%&TY-E#xpj7*5^+!35(NZV+-0}xwL`?+KiU_y?;Q&YtnGqBJn@BM zSILo3ulG-m-BYT+{lx1*;GY@bhw(1S=*w5B>eje=GiRYZR`s*@Ei$M*YPt?Q&H4_+ ztg_vaI{m&mIyFt2(bP^&s)Yxg_)xEg2Qcb`diu%lo|QrtT^@lJcZ{TTVM!PEg_=^2 zj}opcN=)-lFi@v>lTK3Yb+ zI0Vx_T3g}zI*FZO=J)PU{LHt?Wc_)@ryo?(X-!|c2XpZ*M{=t=%j8{wUTb2y_5nivXh~)R=J!QG7HA;FP+dF@1virgV?^9wuFuMy^59X z>8EWAMtV94XH+^KO;f>3=xasCCj=KhHhAw$e@hk>Ix}{K_@o+I?pqh}I@XvrmKdeE z+f!Nfi1I$+Yb=%NeQH4O)%+DNb+*ged@9aItrGPur7Cti>o#Q8$QEK!CqnL0;uxFC zf4k(p6lJN_wu`Nh^VdEB3vebDjGOYSASmqL3aDcMbBtx&{t3k^P zN^TN{>5pLvykgbz^c_MbS;E@NJnxe-Y2s4MRjBXoT2d0?tU%vdaOQ8lo%KqfhKdu^ z&^JienvK*bol5WG)h z=Stx|nbItb^GVvp%9wz{&r0fW0wN*D1$o~f10;M~C5p;}C%!h7a-M$d=kZe!8yrHO zKv_aWvbs{8s1%nDwla=0y4`FZ#W0}bJPQ-W_i0cuqSaRN5O)rIe$JWANp%-YA7;`a zGEz2zc-k(N!X6tL^~k@_dMIDGib&_MFrc8eih|75j*5IC+J^OTL$kUQ!3Fd%Q`LZ; zmGx2eCR~cbYmBg;<`z3Oej%Ega)@kT9e*0JqIcFj>l!PP;Fn6DWSH=w?pF4@$R5RX z6{hc!JvQ#a&uK;3A+IB!XOfnNOniB~3rkIPQR@DYkyMj2_KM$gI&w^SrOtmB-3_cr zpVVrSlGPS*xCB{pP<~8()19F_jZrEq$<@)jsafl|1s4}0o7D#@U-NymZKD$AGwkvG z zbCj|vu@r}PQ!x3~`};g1tDZj?Nwld{G+E^g9(efvF0DLDsWajk*~X5t^0PQkwKP2x z-phEp4tVZET3SzGJRhL~ zdsa!x`zYCC#w|0`AY|7CVM|i^m~U%)*0(L9UvS0+P?@x;}EvIX|?|0a;X;fY+VLq&k22+kB8`dV~f4eixaUS z5Vp6b0&)=(920>?bvXFNR3Zl7*lPBRN@^RW^}id@9A8A`9!|BJG7#2iDnpLFNZ`GT z0q`^Vuss?T*)|{AOI8J&AE>~dMZqySY=zJ9j)5JE<+z`maftiG!&p|zxiHx%S~-JT zGL{x=^!h`?QeZ??FBs}{V!T?pvbu?aLt8Uv?ZD%xnX)7Uw;=|ugKcPfyY5eYI`d+r z`kWxPFQqc5&v1oAROQ5Dexqvbak?D1X~QvWpHW7Oc0?8p6g|rj9vXn{u17(UM8B zR6jz}Q7~Yu6H?F(qr`dI3B$!jk6O-#vaveX7$B$xV^UfjethC!aQr^tCP^+R4mUSL zusb+umlEC4NOegynT_j;^}$-%>AX%78qj+Z%)Q_5$8P;x?s%DM({Xg4A*#1hlAPF! zMndDWJA^heH)97zI}?MQ7MnJ+R0#_=A>8NrXi#OV{_PHS=}sW>k;EyHo{e&EL4JU^ zmz5y{c%hj=zZt=w)~`hr43IVH!z1H3Er^Gh6774|!?097O3pz)yDiV1WrR2!7q)5; z;UIJm)P;R~-J~~qpVXbDU%9nYo{A>tFD(YGz0)|`++=zvc-6G|va{@^5((b1dy`vs z>9BN>p{asDnjaq4ux6J--6vO0N3orVZ@;qGP~qv8qQHjP(56UrxhVP}4}R#G|L(VF zM9GHe#93E-$_|Po4RaRU;e90OOIbJT+C^VF=YEtO z)-b|kq@bSsTAFI%j0tvPRNt(z(mP|L7o%d@s5F1a+cPD{gj#9TlGQ}G$MJWQwrKju z;Lh^wtjXkr30rQgmXT!AGMt@bW30BK{V~Dsft{KC4494bTUyiR$pOYL55)kTh-%jTyd>A@XN-%#*O!Ra0w!6gBjR9R%d+LuI!&+kN5f#%9HYgTx zHglh<6i0=H#xZ_ku~vt%WxJpcN=-aO-v;h%y}lE7Ml4QO@TO^|%+)qC0TVbXFzIH; zz-v7ncS7XuD_u%oAUol)ADHBi`Fh(3t{XTBF}5}Zc_`9F0$8VH%W^)@R@3j;Xfx)a z;^sOo+Cp{nonQ}Sa@j3DlzbO~MH!jxXYKn$P<~LmuGYWMW8&>nUo4?=trc;$5iI{i z!|%Chk+mwpi%h#5#C<#Zq%%~ngwup=O%?o7UnYJ^ zuD1FqS4KMsJM~kKQ z%{7ZI)9!;-lr_2FW|4c~ijsGDo|)uAU9dz_*5<~I+tE`RBxA|Kc1{`Zik|oP#gFwc z(;pci%8WNZ@gfaf5rzVC%JENr;huloDPR1JI;5=+FWzE39L8kuQTQftq_3p^wQBYI zJLLi^>37NMlPCIm`lc@e9PX?5u^>CYbnp0_j7S!!1U~c+h8H|TpVI3_ER3nxF)!b_ z%>0ZeC%RAi?PM&E%T&6433nlOX_;Aiixi2Izks>SBPUwZwRLig7A4)rX!lfmuz9j7 zxSLZ|(kyOE#tp+QTbsN*{nnyf#^0VxP*G&SFAW`Oki&aeaTL(R)6lC?ye&i((!e+# z#Z#UI{$bD=3pWAh(w95W?CrekV^kfWUHYc2X)ry~h&L~mnmbPZ`hxeo7(Wh1J@h^2 ztFmlk)KG%ABXW3eD@Q7-2)ze&rFoCWpv#?C z5#MGbuj&I=$NM$xc|3dX8A}LXr?5!!lSw!GY!B#P!UJWia--I8I5I7GGhaRgEg(f- zijNp{`0`uo(2P)qHD_m_*#+y#3^Y?&FcYkoR z#w%x$0woA4GeST-1KUA=W9yJ(lTl?zA%dzN?O2j}q~z+FYphj1HkLh>9o9S%m2rhJ z;ZNS`bSCAGEl2X^K&GNY_}&qtj|j;~z^(Ho_(WT)nk$n=lFqkBdMt7{X(xAt)%E1E z63WConqU0F^A`@0_7G;HD}PgeyTBQQ>%7>&pv9<#DZr0qfss|U7Yh7n}Xgvp)Ij9R49bm?D^{Wg)OGA6xIY6YYIti%B{u$RdXW2(h!yj)G))M z#E1{Yr5K*Ob%2@%2b`kBqU|U7Iko+)f#TRw)}0EJShjD9Rr}Nv#Sf* zE5@RF;6(Go_x$>p{Z#1owa;r^$R>GzV8T;>nqO5{7dIsjVFgZrjgrMMu(td+n<5dE zEyp9z-{xiwMQsWcxf^pkje}6+$C5nF;Yv;7X#^32_!WAZ(Q&QZy{k`zOk)NnoCWHC z&E87(8iguW3$Q-i34T#<8l*!zrg3EL9nM8^Uzb)k=(}EPdBu`sStw;uh1pb#mLD8( z@^}<~(z*4qjXJAaO2le2mZAsedurQ5-!250FuRDh`| z4^m^3VUiO+QSwdeG$rJ7|E%BxeE@7f-hh;=CSx!o)!enCsC{?~J!9cp-^`NpDbry+{Dp;a z>=8b4ft$Q=J6v8F9eDqaY2hbO%)(Njf7&|Q=gi`qd2-~W9yz~cc_^@;rLbze(S0d> z6|Nf!C7&nGeIm(Ytu_gI%W30r`$E{Cph--#HKRr48N2L4p#!M#j_`#{_%Zxs9PtHx z#Qk{=DrTed8s{SsRxrKpLkD+4^b~g8Z~5lfO0mVFE{-C=A!MFpBMSG-A~+>jRY9Hn z^vv`ePtUfp$j8|%DS3vw@2%HBl|o-}%}4l*>K5EOzP__BAd$mQh=2=>RE zuP58*;8>398n>mungi~gIl))?Evi12#@80maEZ$4y&d=EVlJ2k4PCAsVMuM8<*kE1 zUgBofV7KKz95p%&;bQaP$fHJ=V=(_F&h}$bJjmk4`c3d==9#@zP?I86fn*udErQ}JpVmZEtsZ%L!pfwXEtIuV>7#a10FUJc}@cQr~%*ng!jrN%GPG` zPTv;hous<=b85RWBqJXb69T-E8n;XC=*6C16xS42@F##WyH>{Mp-KjliK{b-2QyXc z@eeicj*X}+q3}{Q#Rr2WKo?!XX0sgmc7k3LIFzS(D<^pf1K!3rR=bMi81n>#jDlZ8 z!3zo__U91RE0t7TcnI7@KDU4488_Q6od6*p{vCjYQJ)$=XS=fyb^mOyW78zU zNS2-2TOrfX&bTlmmie6JadhWzXseIOcAvm#2F>qwz2`$eIDWIhuSOmVlci{`)Hl}<(Q4DF37-K7Oa zuw07_Kr0I+VAoFybav5W2m^~<#$Xoy8;njj3*&$9>Lmez*shoT_rVjm0cHLH{m-?A ze?d%QH=x~a2{2sqMwIOl2a`i@#4K$hAgM7{*Xk{c8}+hR0Ze8Kz->8!Cw;saZUC}R7Mx`Z5Wyh8uRdNdul==12dMPxfQOxd z_5?qdAz7by@jKo3syx;C)`Z38rnH~op% zT`7HdAdt*I+9{M&Q|0zv)(Gx`4q%*OanpUXcWvY;E#;vgT^ z4GSJ19ijpohTIsnhQt{EGM7Ohxqn6;gx!EzhVEkBu$_Rt>ycD(H%6XeKE}U{k^db@ z6Mqfj0aAv!82>5F{}UcR@fsurJR2fq{8QU3!~lT`uHT8|KOovSeXN&i#u zj7MKDBl%_qp%HB03z{11|CN}2Tsuxv{^Q_c_><(vxn>14UX%Vs{)svYxR0nY{>cX~ zUHe_HdD{yA_<6FfgRldHSl<`C0#*>Hq%})BdxF4HRHG&Wo+m@yGgq DEfii8 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d5f79406d..a95009c3b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Aug 01 22:20:41 PDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip From 64e0d9969651527cad1cf9915193043456e9fa3b Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 26 Jul 2018 22:49:58 +1000 Subject: [PATCH 58/74] Improvements to the legacy mapper. Still a lot of work. --- .../worldedit/world/registry/legacy.json | 70 ++++++++++--------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json index 08fbfb150..ac0766b63 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json @@ -8,10 +8,10 @@ "1:4": "minecraft:polished_diorite", "1:5": "minecraft:andesite", "1:6": "minecraft:polished_andesite", - "2:0": "minecraft:grass[snowy=false]", - "3:0": "minecraft:dirt[variant=dirt,snowy=false]", - "3:1": "minecraft:dirt[variant=coarse_dirt,snowy=false]", - "3:2": "minecraft:dirt[variant=podzol,snowy=false]", + "2:0": "minecraft:grass_block[snowy=false]", + "3:0": "minecraft:dirt", + "3:1": "minecraft:coarse_dirt", + "3:2": "minecraft:podzol[snowy=false]", "4:0": "minecraft:cobblestone", "5:0": "minecraft:oak_planks", "5:1": "minecraft:spruce_planks", @@ -102,22 +102,22 @@ "14:0": "minecraft:gold_ore", "15:0": "minecraft:iron_ore", "16:0": "minecraft:coal_ore", - "17:0": "minecraft:log[variant=oak,axis=y]", - "17:1": "minecraft:log[variant=spruce,axis=y]", - "17:2": "minecraft:log[variant=birch,axis=y]", - "17:3": "minecraft:log[variant=jungle,axis=y]", - "17:4": "minecraft:log[variant=oak,axis=x]", - "17:5": "minecraft:log[variant=spruce,axis=x]", - "17:6": "minecraft:log[variant=birch,axis=x]", - "17:7": "minecraft:log[variant=jungle,axis=x]", - "17:8": "minecraft:log[variant=oak,axis=z]", - "17:9": "minecraft:log[variant=spruce,axis=z]", - "17:10": "minecraft:log[variant=birch,axis=z]", - "17:11": "minecraft:log[variant=jungle,axis=z]", - "17:12": "minecraft:log[variant=oak,axis=none]", - "17:13": "minecraft:log[variant=spruce,axis=none]", - "17:14": "minecraft:log[variant=birch,axis=none]", - "17:15": "minecraft:log[variant=jungle,axis=none]", + "17:0": "minecraft:oak_log[axis=y]", + "17:1": "minecraft:spruce_log[axis=y]", + "17:2": "minecraft:birch_log[axis=y]", + "17:3": "minecraft:jungle_log[axis=y]", + "17:4": "minecraft:oak_log[axis=x]", + "17:5": "minecraft:spruce_log[axis=x]", + "17:6": "minecraft:birch_log[axis=x]", + "17:7": "minecraft:jungle_log[axis=x]", + "17:8": "minecraft:oak_log[axis=z]", + "17:9": "minecraft:spruce_log[axis=z]", + "17:10": "minecraft:birch_log[axis=z]", + "17:11": "minecraft:jungle_log[axis=z]", + "17:12": "minecraft:oak_log[axis=none]", + "17:13": "minecraft:spruce_log[axis=none]", + "17:14": "minecraft:birch_log[axis=none]", + "17:15": "minecraft:jungle_log[axis=none]", "18:0": "minecraft:oak_leaves[check_decay=false,decayable=true]", "18:1": "minecraft:spruce_leaves[check_decay=false,decayable=true]", "18:2": "minecraft:birch_leaves[check_decay=false,decayable=true]", @@ -155,18 +155,22 @@ "24:1": "minecraft:chiseled_sandstone", "24:2": "minecraft:cut_sandstone", "25:0": "minecraft:note_block", - "26:0": "minecraft:bed[part=foot,facing=south,occupied=false]", - "26:1": "minecraft:bed[part=foot,facing=west,occupied=false]", - "26:2": "minecraft:bed[part=foot,facing=north,occupied=false]", - "26:3": "minecraft:bed[part=foot,facing=east,occupied=false]", - "26:8": "minecraft:bed[part=head,facing=south,occupied=false]", - "26:9": "minecraft:bed[part=head,facing=west,occupied=false]", - "26:10": "minecraft:bed[part=head,facing=north,occupied=false]", - "26:11": "minecraft:bed[part=head,facing=east,occupied=false]", - "26:12": "minecraft:bed[part=head,facing=south,occupied=true]", - "26:13": "minecraft:bed[part=head,facing=west,occupied=true]", - "26:14": "minecraft:bed[part=head,facing=north,occupied=true]", - "26:15": "minecraft:bed[part=head,facing=east,occupied=true]", + "26:0": "minecraft:red_bed[part=foot,facing=south,occupied=false]", + "26:1": "minecraft:red_bed[part=foot,facing=west,occupied=false]", + "26:2": "minecraft:red_bed[part=foot,facing=north,occupied=false]", + "26:3": "minecraft:red_bed[part=foot,facing=east,occupied=false]", + "26:4": "minecraft:red_bed[part=foot,facing=south,occupied=true]", + "26:5": "minecraft:red_bed[part=foot,facing=west,occupied=true]", + "26:6": "minecraft:red_bed[part=foot,facing=north,occupied=true]", + "26:7": "minecraft:red_bed[part=foot,facing=east,occupied=true]", + "26:8": "minecraft:red_bed[part=head,facing=south,occupied=false]", + "26:9": "minecraft:red_bed[part=head,facing=west,occupied=false]", + "26:10": "minecraft:red_bed[part=head,facing=north,occupied=false]", + "26:11": "minecraft:red_bed[part=head,facing=east,occupied=false]", + "26:12": "minecraft:red_bed[part=head,facing=south,occupied=true]", + "26:13": "minecraft:red_bed[part=head,facing=west,occupied=true]", + "26:14": "minecraft:red_bed[part=head,facing=north,occupied=true]", + "26:15": "minecraft:red_bed[part=head,facing=east,occupied=true]", "27:0": "minecraft:golden_rail[shape=north_south,powered=false]", "27:1": "minecraft:golden_rail[shape=east_west,powered=false]", "27:2": "minecraft:golden_rail[shape=ascending_east,powered=false]", @@ -333,7 +337,7 @@ "51:13": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=13]", "51:14": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=14]", "51:15": "minecraft:fire[east=false,south=false,north=false,west=false,up=false,age=15]", - "52:0": "minecraft:mob_spawner", + "52:0": "minecraft:spawner", "53:0": "minecraft:oak_stairs[half=bottom,shape=outer_right,facing=east]", "53:1": "minecraft:oak_stairs[half=bottom,shape=outer_right,facing=west]", "53:2": "minecraft:oak_stairs[half=bottom,shape=outer_right,facing=south]", From db21f51a18ba1ea1b3d86424909439386fc16d3f Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 29 Jul 2018 18:27:30 +1000 Subject: [PATCH 59/74] Fixed up data cycler command, and the fixwater & fixlava commands. --- .../java/com/sk89q/worldedit/EditSession.java | 31 +++++------- .../worldedit/command/UtilityCommands.java | 8 +--- .../command/tool/BlockDataCyler.java | 48 ++++++++++++++----- .../extent/reorder/MultiStageReorder.java | 33 ++++++++----- 4 files changed, 71 insertions(+), 49 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 7d07a5a23..b0f58edf0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -27,11 +27,6 @@ import static com.sk89q.worldedit.regions.Regions.minimumBlockY; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockCategories; -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.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.event.extent.EditSessionEvent; @@ -108,6 +103,11 @@ import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.world.NullWorld; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockCategories; +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 java.util.ArrayList; import java.util.Collections; @@ -1137,35 +1137,28 @@ public class EditSession implements Extent { * * @param origin the original position * @param radius the radius to fix - * @param moving the block ID of the moving liquid - * @param stationary the block ID of the stationary liquid + * @param fluid the type of the fluid * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int fixLiquid(Vector origin, double radius, BlockType moving, BlockType stationary) throws MaxChangedBlocksException { + public int fixLiquid(Vector origin, double radius, BlockType fluid) throws MaxChangedBlocksException { checkNotNull(origin); checkArgument(radius >= 0, "radius >= 0 required"); // Our origins can only be liquids - BlockMask liquidMask = new BlockMask( - this, - moving.getDefaultState(), - stationary.getDefaultState()); + BlockMask liquidMask = new BlockMask(this, new BlockState(fluid, new HashMap<>())); // But we will also visit air blocks - MaskIntersection blockMask = - new MaskUnion(liquidMask, - new BlockMask( - this, - BlockTypes.AIR.getDefaultState())); + MaskIntersection blockMask = new MaskUnion(liquidMask, new BlockMask(this, BlockTypes.AIR.getDefaultState())); // There are boundaries that the routine needs to stay in MaskIntersection mask = new MaskIntersection( new BoundedHeightMask(0, Math.min(origin.getBlockY(), getWorld().getMaxY())), new RegionMask(new EllipsoidRegion(null, origin, new Vector(radius, radius, radius))), - blockMask); + blockMask + ); - BlockReplace replace = new BlockReplace(this, new BlockPattern(stationary.getDefaultState())); + BlockReplace replace = new BlockReplace(this, new BlockPattern(fluid.getDefaultState())); NonRisingVisitor visitor = new NonRisingVisitor(mask, replace); // Around the origin in a 3x3 block diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 3fa96d9d8..4a428e0c2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -170,9 +170,7 @@ public class UtilityCommands { double radius = Math.max(0, args.getDouble(0)); we.checkMaxRadius(radius); - // TODO Investigate with a real build of 1.13 - int affected = editSession.fixLiquid( - session.getPlacementPosition(player), radius, BlockTypes.LAVA, BlockTypes.LAVA); + int affected = editSession.fixLiquid(session.getPlacementPosition(player), radius, BlockTypes.LAVA); player.print(affected + " block(s) have been changed."); } @@ -189,9 +187,7 @@ public class UtilityCommands { double radius = Math.max(0, args.getDouble(0)); we.checkMaxRadius(radius); - // TODO Investigate with a real build of 1.13 - int affected = editSession.fixLiquid( - session.getPlacementPosition(player), radius, BlockTypes.WATER, BlockTypes.WATER); + int affected = editSession.fixLiquid(session.getPlacementPosition(player), radius, BlockTypes.WATER); player.print(affected + " block(s) have been changed."); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java index 4e025ff7e..faee49faf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.google.common.collect.Lists; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -26,10 +27,16 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockState; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + /** * A mode that cycles the data values of supported blocks. */ @@ -40,6 +47,8 @@ public class BlockDataCyler implements DoubleActionBlockTool { return player.hasPermission("worldedit.tool.data-cycler"); } + private Map> selectedProperties = new HashMap<>(); + private boolean handleCycle(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked, boolean forward) { @@ -57,19 +66,36 @@ public class BlockDataCyler implements DoubleActionBlockTool { if (block.getStates().keySet().isEmpty()) { player.printError("That block's data cannot be cycled!"); } else { - BlockState newBlock = block; + Property currentProperty = selectedProperties.get(player.getUniqueId()); - // TODO Forward = cycle value, Backward = Next property - // int increment = forward ? 1 : -1; - // BaseBlock newBlock = new BaseBlock(type, BlockData.cycle(type, data, increment)); - EditSession editSession = session.createEditSession(player); + if (currentProperty == null || (forward && block.getState(currentProperty) == null)) { + currentProperty = block.getStates().keySet().stream().findFirst().get(); + selectedProperties.put(player.getUniqueId(), currentProperty); + } - try { - editSession.setBlock(clicked.toVector(), newBlock); - } catch (MaxChangedBlocksException e) { - player.printError("Max blocks change limit reached."); - } finally { - session.remember(editSession); + if (forward) { + block.getState(currentProperty); + int index = currentProperty.getValues().indexOf(block.getState(currentProperty)); + index = (index + 1) % currentProperty.getValues().size(); + BlockState newBlock = block.with(currentProperty, currentProperty.getValues().get(index)); + + EditSession editSession = session.createEditSession(player); + + try { + editSession.setBlock(clicked.toVector(), newBlock); + player.print("Value of " + currentProperty.getName() + " is now " + currentProperty.getValues().get(index).toString()); + } catch (MaxChangedBlocksException e) { + player.printError("Max blocks change limit reached."); + } finally { + session.remember(editSession); + } + } else { + List> properties = Lists.newArrayList(block.getStates().keySet()); + int index = properties.indexOf(currentProperty); + index = (index + 1) % properties.size(); + currentProperty = properties.get(index); + selectedProperties.put(player.getUniqueId(), currentProperty); + player.print("Now cycling " + currentProperty.getName()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index 8edea8381..57be96226 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -26,19 +26,26 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.Blocks; -import com.sk89q.worldedit.world.block.BlockCategories; -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.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.operation.BlockMapEntryPlacer; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.OperationQueue; import com.sk89q.worldedit.function.operation.RunContext; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.collection.TupleArrayList; +import com.sk89q.worldedit.world.block.BlockCategories; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; -import java.util.*; +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * Re-orders blocks into several stages. @@ -151,16 +158,16 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder assert (blockTypes.containsKey(current)); final BlockStateHolder blockStateHolder = blockTypes.get(current); -// final int data = baseBlock.getData(); if (BlockCategories.DOORS.contains(blockStateHolder.getBlockType())) { -// TODO if ((data & 0x8) == 0) { -// // Deal with lower door halves being attached to the floor AND the upper half -// BlockVector upperBlock = current.add(0, 1, 0).toBlockVector(); -// if (blocks.contains(upperBlock) && !walked.contains(upperBlock)) { -// walked.addFirst(upperBlock); -// } -// } + Property halfProperty = blockStateHolder.getBlockType().getProperty("half"); + if (blockStateHolder.getState(halfProperty).equals("lower")) { + // Deal with lower door halves being attached to the floor AND the upper half + BlockVector upperBlock = current.add(0, 1, 0).toBlockVector(); + if (blocks.contains(upperBlock) && !walked.contains(upperBlock)) { + walked.addFirst(upperBlock); + } + } } else if (BlockCategories.RAILS.contains(blockStateHolder.getBlockType())) { BlockVector lowerBlock = current.add(0, -1, 0).toBlockVector(); if (blocks.contains(lowerBlock) && !walked.contains(lowerBlock)) { From 521238b4eb4564f9089439e0de7d954d498276dd Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 30 Jul 2018 21:55:53 +1000 Subject: [PATCH 60/74] Fixed a few clipboard related issues. --- .../java/com/sk89q/worldedit/BlockVector.java | 6 ++--- .../com/sk89q/worldedit/BlockVector2D.java | 6 ++--- .../worldedit/extent/ChangeSetExtent.java | 3 ++- .../extent/clipboard/BlockArrayClipboard.java | 8 +++---- .../function/operation/ForwardExtentCopy.java | 23 ++++++++----------- .../function/pattern/ClipboardPattern.java | 2 +- .../pattern/RepeatingExtentPattern.java | 2 +- .../com/sk89q/worldedit/forge/ForgeWorld.java | 2 +- 8 files changed, 24 insertions(+), 28 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector.java index 633bab3eb..c444d80d1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector.java @@ -37,7 +37,7 @@ public class BlockVector extends Vector { * @param position the other position */ public BlockVector(Vector position) { - this(position.getBlockX(), position.getBlockY(), position.getBlockZ()); + super(position); } /** @@ -59,7 +59,7 @@ public class BlockVector extends Vector { * @param z the Z coordinate */ public BlockVector(float x, float y, float z) { - this((int) x, (int) y, (int) z); + super(x, y, z); } /** @@ -70,7 +70,7 @@ public class BlockVector extends Vector { * @param z the Z coordinate */ public BlockVector(double x, double y, double z) { - this((int) x, (int) y, (int) z); + super(x, y, z); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector2D.java index cdf0cb36a..07d54430b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/BlockVector2D.java @@ -36,7 +36,7 @@ public class BlockVector2D extends Vector2D { * @param position the position to copy */ public BlockVector2D(Vector2D position) { - this(position.getBlockX(), position.getBlockZ()); + super(position); } /** @@ -56,7 +56,7 @@ public class BlockVector2D extends Vector2D { * @param z the Z coordinate */ public BlockVector2D(float x, float z) { - this((int) x, (int) z); + super(x, z); } /** @@ -66,7 +66,7 @@ public class BlockVector2D extends Vector2D { * @param z the Z coordinate */ public BlockVector2D(double x, double z) { - this((int) x, (int) z); + super(x, z); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java index e9c78e088..f57056f7a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -59,7 +60,7 @@ public class ChangeSetExtent extends AbstractDelegateExtent { @Override public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException { - BlockStateHolder previous = getBlock(location); + BaseBlock previous = getFullBlock(location); changeSet.add(new BlockChange(location.toBlockVector(), previous, block)); return super.setBlock(location, block); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index 8a0e19bfc..0cc32149c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -65,7 +65,7 @@ public class BlockArrayClipboard implements Clipboard { this.origin = region.getMinimumPoint(); Vector dimensions = getDimensions(); - blocks = new BaseBlock[dimensions.getBlockX()][dimensions.getBlockY()][dimensions.getBlockZ()]; + blocks = new BlockStateHolder[dimensions.getBlockX()][dimensions.getBlockY()][dimensions.getBlockZ()]; } @Override @@ -146,10 +146,10 @@ public class BlockArrayClipboard implements Clipboard { Vector v = position.subtract(region.getMinimumPoint()); BlockStateHolder block = blocks[v.getBlockX()][v.getBlockY()][v.getBlockZ()]; if (block != null) { - if (block instanceof BlockState) { - return new BaseBlock((BlockState) block); - } else if (block instanceof BaseBlock) { + if (block instanceof BaseBlock) { return (BaseBlock) block; + } else { + return new BaseBlock(block.toImmutableState()); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java index c5c1b10a1..3a9a38d4e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java @@ -19,6 +19,10 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.collect.Lists; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Entity; @@ -37,12 +41,8 @@ import com.sk89q.worldedit.math.transform.Identity; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.regions.Region; -import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Makes a copy of a portion of one extent to another extent or another point. * @@ -257,16 +257,11 @@ public class ForwardExtentCopy implements Operation { if (copyingEntities) { ExtentEntityCopy entityCopy = new ExtentEntityCopy(from, destination, to, currentTransform); entityCopy.setRemoving(removingEntities); - List entities = source.getEntities(region); - // Switch to entities.removeIf after Java 8 cutoff. - Iterator entityIterator = entities.iterator(); - while (entityIterator.hasNext()) { - EntityProperties type = entityIterator.next().getFacet(EntityProperties.class); - - if (type != null && !type.isPasteable()) { - entityIterator.remove(); - } - } + List entities = Lists.newArrayList(source.getEntities(region)); + entities.removeIf(entity -> { + EntityProperties properties = entity.getFacet(EntityProperties.class); + return properties != null && !properties.isPasteable(); + }); EntityVisitor entityVisitor = new EntityVisitor(entities.iterator(), entityCopy); return new DelegateOperation(this, new OperationQueue(blockVisitor, entityVisitor)); } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java index 0c180c531..708f2bb4e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java @@ -50,7 +50,7 @@ public class ClipboardPattern extends AbstractPattern { int yp = Math.abs(position.getBlockY()) % size.getBlockY(); int zp = Math.abs(position.getBlockZ()) % size.getBlockZ(); - return clipboard.getBlock(clipboard.getMinimumPoint().add(new Vector(xp, yp, zp))); + return clipboard.getFullBlock(clipboard.getMinimumPoint().add(new Vector(xp, yp, zp))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java index c833a289d..6a9581ff3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java @@ -89,7 +89,7 @@ public class RepeatingExtentPattern extends AbstractPattern { int x = base.getBlockX() % size.getBlockX(); int y = base.getBlockY() % size.getBlockY(); int z = base.getBlockZ() % size.getBlockZ(); - return extent.getBlock(new Vector(x, y, z)); + return extent.getFullBlock(new Vector(x, y, z)); } } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 86f458425..14d6bd107 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -305,7 +305,7 @@ public class ForgeWorld extends AbstractWorld { ForgeWorld from = new ForgeWorld(freshWorld); try { for (BlockVector vec : region) { - editSession.setBlock(vec, from.getBlock(vec)); + editSession.setBlock(vec, from.getFullBlock(vec)); } } catch (MaxChangedBlocksException e) { throw new RuntimeException(e); From 1480606b52f5427e0b0bc35bb273234d27eb5d45 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 30 Jul 2018 23:26:06 +1000 Subject: [PATCH 61/74] Fixed a few more issues found looking over the changeset. --- .../ConfigurationPermissionsResolver.java | 8 +- .../sk89q/wepif/NijiPermissionsResolver.java | 2 +- .../worldedit/bukkit/BukkitBiomeRegistry.java | 3 +- .../bukkit/BukkitCommandInspector.java | 4 +- .../worldedit/bukkit/BukkitCommandSender.java | 11 ++- .../sk89q/worldedit/bukkit/BukkitEntity.java | 5 +- .../bukkit/BukkitEntityProperties.java | 4 +- .../bukkit/BukkitPlayerBlockBag.java | 4 +- .../sk89q/worldedit/bukkit/BukkitWorld.java | 6 -- .../bukkit/adapter/BukkitImplAdapter.java | 2 +- .../sk89q/wepif/DinnerPermsResolverTest.java | 8 +- .../sk89q/wepif/TestOfflinePermissible.java | 6 +- .../com/sk89q/worldedit/blocks/LazyBlock.java | 92 ------------------- .../com/sk89q/worldedit/blocks/SignBlock.java | 2 +- .../com/sk89q/jnbt/CompoundTagBuilder.java | 4 +- .../src/main/java/com/sk89q/jnbt/ListTag.java | 6 +- .../java/com/sk89q/jnbt/ListTagBuilder.java | 4 +- .../java/com/sk89q/jnbt/NBTOutputStream.java | 4 +- .../main/java/com/sk89q/jnbt/NBTUtils.java | 4 +- .../util/commands/CommandException.java | 5 +- .../java/com/sk89q/util/yaml/YAMLNode.java | 3 +- .../com/sk89q/util/yaml/YAMLProcessor.java | 15 ++- .../java/com/sk89q/worldedit/EditSession.java | 14 +-- .../sk89q/worldedit/EditSessionFactory.java | 4 +- .../sk89q/worldedit/LocalConfiguration.java | 2 +- .../com/sk89q/worldedit/LocalSession.java | 4 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 2 +- .../sk89q/worldedit/blocks/ClothColor.java | 7 +- .../worldedit/command/BiomeCommands.java | 6 +- .../worldedit/command/BrushCommands.java | 2 +- .../worldedit/command/ChunkCommands.java | 13 ++- .../worldedit/command/GeneralCommands.java | 14 ++- .../worldedit/command/GenerationCommands.java | 9 +- .../worldedit/command/HistoryCommands.java | 9 +- .../worldedit/command/NavigationCommands.java | 6 +- .../worldedit/command/RegionCommands.java | 19 ++-- .../worldedit/command/ScriptingCommands.java | 6 +- .../worldedit/command/SelectionCommands.java | 49 +++++++--- .../worldedit/command/SnapshotCommands.java | 6 +- .../command/SnapshotUtilCommands.java | 10 +- .../command/SuperPickaxeCommands.java | 6 +- .../sk89q/worldedit/command/ToolCommands.java | 17 +++- .../worldedit/command/ToolUtilCommands.java | 5 +- .../worldedit/command/UtilityCommands.java | 4 +- .../worldedit/command/WorldEditCommands.java | 5 +- .../command/argument/ItemParser.java | 2 +- .../command/argument/PatternParser.java | 3 +- .../command/argument/ReplaceParser.java | 4 +- .../command/composition/ApplyCommand.java | 4 +- .../command/composition/SelectionCommand.java | 4 +- .../composition/ShapedBrushCommand.java | 4 +- .../worldedit/command/tool/AreaPickaxe.java | 8 +- .../worldedit/command/tool/BlockReplacer.java | 9 +- .../worldedit/command/tool/DistanceWand.java | 3 +- .../command/tool/FloatingTreeRemover.java | 11 +-- .../worldedit/command/tool/FloodFillTool.java | 13 ++- .../command/tool/LongRangeBuildTool.java | 4 +- .../worldedit/command/tool/QueryTool.java | 2 +- .../command/tool/RecursivePickaxe.java | 15 +-- .../worldedit/command/tool/SinglePickaxe.java | 6 +- .../worldedit/command/tool/TreePlanter.java | 8 +- .../command/tool/brush/CylinderBrush.java | 2 +- .../command/tool/brush/GravityBrush.java | 6 +- .../tool/brush/HollowCylinderBrush.java | 2 +- .../command/tool/brush/HollowSphereBrush.java | 2 +- .../command/tool/brush/SmoothBrush.java | 4 +- .../command/tool/brush/SphereBrush.java | 2 +- .../sk89q/worldedit/entity/BaseEntity.java | 4 +- .../event/extent/EditSessionEvent.java | 8 +- .../event/platform/BlockInteractEvent.java | 4 +- .../event/platform/CommandEvent.java | 4 +- .../platform/CommandSuggestionEvent.java | 4 +- .../platform/ConfigurationLoadEvent.java | 4 +- .../event/platform/PlayerInputEvent.java | 4 +- .../extension/factory/BlockFactory.java | 4 +- .../factory/HashTagPatternParser.java | 2 +- .../factory/RandomPatternParser.java | 4 +- .../factory/SingleBlockPatternParser.java | 2 +- .../platform/AbstractPlayerActor.java | 20 ++-- .../extension/platform/CommandManager.java | 38 ++++++-- .../extension/platform/Platform.java | 3 +- .../extension/platform/PlayerProxy.java | 6 +- .../extent/AbstractDelegateExtent.java | 18 ++-- .../worldedit/extent/ChangeSetExtent.java | 8 +- .../com/sk89q/worldedit/extent/Extent.java | 5 +- .../sk89q/worldedit/extent/InputExtent.java | 26 +----- .../sk89q/worldedit/extent/MaskingExtent.java | 6 +- .../sk89q/worldedit/extent/NullExtent.java | 17 ++-- .../sk89q/worldedit/extent/OutputExtent.java | 2 +- .../extent/buffer/ForgetfulExtentBuffer.java | 9 +- .../extent/cache/LastAccessExtentCache.java | 15 ++- .../extent/clipboard/BlockArrayClipboard.java | 17 ++-- .../extent/clipboard/StoredEntity.java | 4 +- .../extent/clipboard/io/ClipboardReader.java | 1 - .../legacycompat/NBTCompatibilityHandler.java | 1 - .../SignCompatibilityHandler.java | 1 - .../worldedit/extent/inventory/BlockBag.java | 2 +- .../extent/inventory/BlockBagExtent.java | 4 +- .../transform/BlockTransformExtent.java | 6 -- .../extent/validation/BlockChangeLimiter.java | 6 +- .../validation/DataValidatorExtent.java | 8 +- .../extent/world/BlockQuirkExtent.java | 6 +- .../extent/world/ChunkLoadingExtent.java | 6 +- .../extent/world/FastModeExtent.java | 6 +- .../extent/world/SurvivalModeExtent.java | 4 +- .../function/CombinedRegionFunction.java | 9 +- .../sk89q/worldedit/function/EditContext.java | 4 +- .../function/FlatRegionMaskingFilter.java | 4 +- .../worldedit/function/GroundFunction.java | 4 +- .../function/RegionMaskingFilter.java | 4 +- .../function/biome/BiomeReplace.java | 4 +- .../function/block/BlockReplace.java | 6 +- .../function/block/ExtentBlockCopy.java | 4 +- .../worldedit/function/block/Naturalizer.java | 23 +++-- .../function/entity/ExtentEntityCopy.java | 4 +- .../worldedit/function/factory/Apply.java | 6 +- .../worldedit/function/factory/Deform.java | 6 +- .../worldedit/function/factory/Paint.java | 10 +- .../function/generator/FloraGenerator.java | 6 +- .../function/generator/ForestGenerator.java | 8 +- .../generator/GardenPatchGenerator.java | 4 +- .../function/mask/AbstractExtentMask.java | 4 +- .../worldedit/function/mask/BiomeMask2D.java | 4 +- .../worldedit/function/mask/BlockMask.java | 11 ++- .../function/mask/BoundedHeightMask.java | 4 +- .../function/mask/ExistingBlockMask.java | 4 +- .../function/mask/ExpressionMask.java | 4 +- .../function/mask/ExpressionMask2D.java | 4 +- .../function/mask/FuzzyBlockMask.java | 2 +- .../function/mask/MaskIntersection.java | 5 +- .../function/mask/MaskIntersection2D.java | 4 +- .../worldedit/function/mask/MaskUnion.java | 3 +- .../sk89q/worldedit/function/mask/Masks.java | 7 +- .../worldedit/function/mask/NoiseFilter.java | 6 +- .../function/mask/NoiseFilter2D.java | 6 +- .../worldedit/function/mask/OffsetMask.java | 4 +- .../worldedit/function/mask/OffsetMask2D.java | 4 +- .../worldedit/function/mask/RegionMask.java | 4 +- .../function/mask/SolidBlockMask.java | 2 +- .../operation/BlockMapEntryPlacer.java | 6 +- .../function/operation/ChangeSetExecutor.java | 6 +- .../function/operation/DelegateOperation.java | 4 +- .../function/operation/OperationQueue.java | 4 +- .../function/pattern/BlockPattern.java | 4 +- .../function/pattern/ClipboardPattern.java | 8 +- .../function/pattern/RandomPattern.java | 4 +- .../pattern/RepeatingExtentPattern.java | 8 +- .../function/util/FlatRegionOffset.java | 4 +- .../worldedit/function/util/RegionOffset.java | 4 +- .../function/visitor/BreadthFirstSearch.java | 14 ++- .../function/visitor/DownwardVisitor.java | 4 +- .../function/visitor/EntityVisitor.java | 4 +- .../function/visitor/FlatRegionVisitor.java | 4 +- .../function/visitor/LayerVisitor.java | 6 +- .../function/visitor/RecursiveVisitor.java | 4 +- .../function/visitor/RegionVisitor.java | 2 +- .../worldedit/history/change/BlockChange.java | 6 +- .../worldedit/history/change/Change.java | 2 +- .../history/change/EntityCreate.java | 4 +- .../history/change/EntityRemove.java | 4 +- .../history/changeset/ArrayListHistory.java | 4 +- .../changeset/BlockOptimizedHistory.java | 8 +- .../command/CommandLoggingHandler.java | 9 +- .../command/UserCommandCompleter.java | 4 +- .../internal/command/WorldEditBinding.java | 2 +- .../expression/parser/ParserProcessors.java | 6 +- .../internal/registry/AbstractFactory.java | 6 +- .../internal/registry/InputParser.java | 2 +- .../internal/util/DocumentationPrinter.java | 15 ++- .../worldedit/math/convolution/HeightMap.java | 2 +- .../KochanekBartelsInterpolation.java | 4 +- .../interpolation/LinearInterpolation.java | 4 +- .../ReparametrisingInterpolation.java | 4 +- .../math/transform/CombinedTransform.java | 4 +- .../worldedit/math/transform/Transforms.java | 4 +- .../worldedit/regions/AbstractRegion.java | 10 +- .../sk89q/worldedit/regions/CuboidRegion.java | 11 ++- .../sk89q/worldedit/regions/NullRegion.java | 10 +- .../com/sk89q/worldedit/regions/Region.java | 3 +- .../worldedit/regions/RegionSelector.java | 3 +- .../worldedit/regions/TransformRegion.java | 5 +- .../iterator/FlatRegion3DIterator.java | 4 +- .../regions/iterator/FlatRegionIterator.java | 4 +- .../regions/iterator/RegionIterator.java | 4 +- .../worldedit/regions/polyhedron/Edge.java | 4 +- .../regions/polyhedron/Triangle.java | 4 +- .../selector/CuboidRegionSelector.java | 10 +- .../selector/CylinderRegionSelector.java | 16 +++- .../selector/EllipsoidRegionSelector.java | 10 +- .../regions/shape/ArbitraryShape.java | 2 +- .../worldedit/regions/shape/RegionShape.java | 2 +- .../shape/WorldEditExpressionEnvironment.java | 6 +- .../registry/state/AbstractProperty.java | 3 - .../scripting/CraftScriptContext.java | 10 +- .../scripting/CraftScriptEngine.java | 1 + .../scripting/RhinoCraftScriptEngine.java | 7 +- .../scripting/java/RhinoScriptEngine.java | 16 ++-- .../java/RhinoScriptEngineFactory.java | 1 + .../worldedit/session/SessionManager.java | 5 +- .../session/request/RequestSelection.java | 7 +- .../session/storage/JsonFileSessionStore.java | 4 +- .../java/com/sk89q/worldedit/util/Enums.java | 4 +- .../sk89q/worldedit/util/FileDialogUtil.java | 5 +- .../com/sk89q/worldedit/util/GuavaUtil.java | 4 +- .../com/sk89q/worldedit/util/Location.java | 4 +- .../com/sk89q/worldedit/util/TargetBlock.java | 6 +- .../worldedit/util/YAMLConfiguration.java | 2 - .../util/collection/DoubleArrayList.java | 4 +- .../util/collection/FastListIterator.java | 6 +- .../worldedit/util/command/Dispatcher.java | 3 +- .../util/command/InvalidUsageException.java | 4 +- .../util/command/PrimaryAliasComparator.java | 3 +- .../command/binding/PrimitiveBindings.java | 3 +- .../util/command/composition/FlagParser.java | 5 +- .../command/parametric/ParametricBuilder.java | 4 +- .../parametric/ParametricCallable.java | 21 ++++- .../parametric/StringArgumentStack.java | 2 +- .../worldedit/util/eventbus/EventHandler.java | 4 +- .../util/eventbus/HierarchyCache.java | 6 +- .../util/eventbus/MethodEventHandler.java | 4 +- .../worldedit/util/eventbus/Subscribe.java | 6 +- .../worldedit/util/formatting/Style.java | 6 +- .../formatting/component/CommandUsageBox.java | 6 +- .../util/formatting/component/MessageBox.java | 4 +- .../util/function/LevenshteinDistance.java | 5 +- .../com/sk89q/worldedit/util/io/Closer.java | 4 +- .../util/logging/DynamicStreamHandler.java | 10 +- .../worldedit/util/logging/LogFormat.java | 4 +- .../sk89q/worldedit/world/AbstractWorld.java | 12 +-- .../com/sk89q/worldedit/world/NullWorld.java | 12 +-- .../java/com/sk89q/worldedit/world/World.java | 4 +- .../worldedit/world/biome/BiomeName.java | 4 +- .../worldedit/world/block/BlockState.java | 2 - .../sk89q/worldedit/world/chunk/OldChunk.java | 4 +- .../world/registry/BiomeRegistry.java | 3 +- .../world/registry/BlockRegistry.java | 1 - .../world/registry/LegacyMapper.java | 4 +- .../world/registry/NullBiomeRegistry.java | 3 +- .../worldedit/world/snapshot/Snapshot.java | 9 +- .../world/snapshot/SnapshotDateParser.java | 3 +- .../world/snapshot/SnapshotRepository.java | 3 +- .../world/snapshot/SnapshotRestore.java | 1 - .../world/storage/LegacyChunkStore.java | 2 +- .../world/storage/NBTConversions.java | 4 +- .../world/storage/ZippedLegacyChunkStore.java | 2 +- .../storage/ZippedMcRegionChunkStore.java | 2 +- .../util/commands/CommandContextTest.java | 8 +- .../java/com/sk89q/worldedit/VectorTest.java | 6 +- .../internal/expression/ExpressionTest.java | 10 +- .../sk89q/worldedit/util/LocationTest.java | 6 +- .../sk89q/worldedit/forge/CommandWrapper.java | 9 +- .../sk89q/worldedit/forge/CommonProxy.java | 3 +- .../worldedit/forge/ForgeBiomeRegistry.java | 2 +- .../sk89q/worldedit/forge/ForgeEntity.java | 5 +- .../forge/ForgeEntityProperties.java | 4 +- .../forge/ForgePermissionsProvider.java | 3 +- .../sk89q/worldedit/forge/ForgePlayer.java | 2 +- .../worldedit/forge/ForgeRegistries.java | 2 +- .../com/sk89q/worldedit/forge/ForgeWorld.java | 12 +-- .../forge/InternalPacketHandler.java | 5 +- .../com/sk89q/worldedit/forge/KeyHandler.java | 2 - .../sk89q/worldedit/forge/NBTConverter.java | 35 ++++++- .../worldedit/forge/TileEntityUtils.java | 9 +- .../worldedit/forge/WECUIPacketHandler.java | 4 +- .../forge/net/LeftClickAirEventMessage.java | 1 - .../worldedit/sponge/CUIChannelHandler.java | 6 +- .../worldedit/sponge/SpongeBiomeRegistry.java | 3 +- .../worldedit/sponge/SpongeCommandSender.java | 7 +- .../sk89q/worldedit/sponge/SpongeEntity.java | 5 +- .../sponge/SpongePermissionsProvider.java | 1 - .../sk89q/worldedit/sponge/SpongePlayer.java | 6 +- .../sponge/adapter/SpongeImplAdapter.java | 2 - 272 files changed, 922 insertions(+), 812 deletions(-) delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java index b309265d6..d61674c1e 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java @@ -19,16 +19,16 @@ package com.sk89q.wepif; +import com.sk89q.util.yaml.YAMLNode; +import com.sk89q.util.yaml.YAMLProcessor; +import org.bukkit.OfflinePlayer; + import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import com.sk89q.util.yaml.YAMLNode; -import com.sk89q.util.yaml.YAMLProcessor; -import org.bukkit.OfflinePlayer; - public class ConfigurationPermissionsResolver implements PermissionsResolver { private YAMLProcessor config; private Map> userPermissionsCache; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java index 182a29faf..fe23bfa46 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java @@ -19,6 +19,7 @@ package com.sk89q.wepif; +import com.nijikokun.bukkit.Permissions.Permissions; import com.sk89q.util.yaml.YAMLProcessor; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; @@ -27,7 +28,6 @@ import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; -import com.nijikokun.bukkit.Permissions.Permissions; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java index 8a69eaf31..cb0fea4de 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java @@ -25,11 +25,12 @@ import com.sk89q.worldedit.world.biome.BiomeData; import com.sk89q.worldedit.world.registry.BiomeRegistry; import org.bukkit.block.Biome; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A biome registry for Bukkit. */ diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java index 8f4b8e5ae..b392c50ac 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.bukkit.util.CommandInspector; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extension.platform.Actor; @@ -30,8 +32,6 @@ import org.bukkit.command.CommandSender; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - class BukkitCommandInspector implements CommandInspector { private static final Logger logger = Logger.getLogger(BukkitCommandInspector.class.getCanonicalName()); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java index df7fdd520..55929af02 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java @@ -19,19 +19,20 @@ package com.sk89q.worldedit.bukkit; -import com.sk89q.worldedit.session.SessionKey; -import com.sk89q.worldedit.util.auth.AuthorizationException; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIEvent; +import com.sk89q.worldedit.session.SessionKey; +import com.sk89q.worldedit.util.auth.AuthorizationException; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import javax.annotation.Nullable; import java.io.File; import java.util.UUID; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; public class BukkitCommandSender implements Actor { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java index 085f6c8b8..418980ad7 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -28,10 +30,9 @@ import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.NullWorld; -import javax.annotation.Nullable; import java.lang.ref.WeakReference; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * An adapter to adapt a Bukkit entity into a WorldEdit one. diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java index 0e20172bd..86618f62f 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.util.Enums; import org.bukkit.entity.Ambient; @@ -42,8 +44,6 @@ import org.bukkit.entity.Tameable; import org.bukkit.entity.Villager; import org.bukkit.entity.minecart.ExplosiveMinecart; -import static com.google.common.base.Preconditions.checkNotNull; - class BukkitEntityProperties implements EntityProperties { private static final org.bukkit.entity.EntityType armorStandType = diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index cc0ce26df..7334a48c8 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -20,13 +20,13 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBagException; import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; import com.sk89q.worldedit.extent.inventory.OutOfSpaceException; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockTypes; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 36dd574b9..81ef4af75 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -29,7 +29,6 @@ import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.history.change.BlockChange; @@ -418,11 +417,6 @@ public class BukkitWorld extends AbstractWorld { } } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(getBlock(position), this, position); - } - @Override public BaseBlock getFullBlock(Vector position) { BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 359ddd90d..f16a6716e 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -20,9 +20,9 @@ package com.sk89q.worldedit.bukkit.adapter; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.world.block.BlockType; import org.bukkit.Location; import org.bukkit.block.Biome; diff --git a/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java b/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java index 8e80a57bc..e207e7b8d 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java @@ -19,13 +19,15 @@ package com.sk89q.wepif; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import org.bukkit.Server; import org.bukkit.plugin.PluginManager; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.*; - -import static org.mockito.Mockito.*; public class DinnerPermsResolverTest { private DinnerPermsResolver resolver; diff --git a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java index a67351cd5..21c83228f 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java @@ -28,7 +28,11 @@ import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.UUID; public class TestOfflinePermissible implements OfflinePlayer, Permissible { private boolean op; diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java deleted file mode 100644 index a26d50026..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.extent.Extent; - -/** - * A implementation of a lazy block for {@link Extent#getLazyBlock(Vector)} - * that takes the block's ID and metadata, but will defer loading of NBT - * data until time of access. - * - *

NBT data is later loaded using a call to {@link Extent#getBlock(Vector)} - * with a stored {@link Extent} and location.

- * - *

All mutators on this object will throw an - * {@link UnsupportedOperationException}.

- */ -public class LazyBlock extends BaseBlock { - - private final Extent extent; - private final Vector position; - private boolean loaded = false; - - /** - * Create a new lazy block. - * - * @param type the block type - * @param extent the extent to later load the full block data from - * @param position the position to later load the full block data from - */ - public LazyBlock(BlockType type, Extent extent, Vector position) { - super(type); - checkNotNull(extent); - checkNotNull(position); - this.extent = extent; - this.position = position; - } - - /** - * Create a new lazy block. - * - * @param state the block state - * @param extent the extent to later load the full block data from - * @param position the position to later load the full block data from - */ - public LazyBlock(BlockState state, Extent extent, Vector position) { - super(state); - checkNotNull(extent); - checkNotNull(position); - this.extent = extent; - this.position = position; - } - - @Override - public CompoundTag getNbtData() { - if (!loaded) { - BaseBlock loadedBlock = extent.getFullBlock(position); - this.nbtData = loadedBlock.getNbtData(); - loaded = true; - } - return super.getNbtData(); - } - - @Override - public void setNbtData(CompoundTag nbtData) { - throw new UnsupportedOperationException("This object is immutable"); - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java index e4b7d28b8..d9d209a44 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java @@ -22,8 +22,8 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.util.gson.GsonUtil; +import com.sk89q.worldedit.world.block.BlockState; import java.util.HashMap; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java index 0bd661967..c6d8fe9e8 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java @@ -19,11 +19,11 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.HashMap; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Helps create compound tags. */ diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java index 1b8d1fa21..7a2482344 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java @@ -19,12 +19,12 @@ package com.sk89q.jnbt; -import javax.annotation.Nullable; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.Collections; import java.util.List; -import java.util.NoSuchElementException; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * The {@code TAG_List} tag. diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java index cd1f11e25..c410ec3ae 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java @@ -19,13 +19,13 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Helps create list tags. */ diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java index a54ea6e26..ddf1168be 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java @@ -19,6 +19,8 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import java.io.Closeable; import java.io.DataOutputStream; import java.io.IOException; @@ -26,8 +28,6 @@ import java.io.OutputStream; import java.util.List; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * This class writes NBT, or Named Binary Tag * {@code Tag} objects to an underlying {@code OutputStream}. diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java index 428ff4d86..440738c4e 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java @@ -19,13 +19,13 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.world.storage.InvalidFormatException; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A class which contains NBT-related utility methods. * diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java index 1dcbdde1e..4345793d1 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java @@ -19,12 +19,13 @@ package com.sk89q.minecraft.util.commands; -import javax.annotation.Nullable; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.ArrayList; import java.util.List; import java.util.ListIterator; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; public class CommandException extends Exception { diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java index 22b09cd48..677ca5ecb 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java @@ -23,12 +23,13 @@ import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; + /** * Represents a configuration node. */ diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java index 0d09fe64f..45ffd8776 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java @@ -24,15 +24,22 @@ import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.emitter.ScalarAnalysis; -import org.yaml.snakeyaml.nodes.Node; import org.yaml.snakeyaml.nodes.Tag; import org.yaml.snakeyaml.reader.UnicodeReader; -import org.yaml.snakeyaml.representer.Represent; import org.yaml.snakeyaml.representer.Representer; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.Map.Entry; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index b0f58edf0..687cc0be5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -26,7 +26,6 @@ import static com.sk89q.worldedit.regions.Regions.maximumBlockY; import static com.sk89q.worldedit.regions.Regions.minimumBlockY; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.event.extent.EditSessionEvent; @@ -399,11 +398,6 @@ public class EditSession implements Extent { return bypassNone.setBiome(position, biome); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return world.getLazyBlock(position); - } - @Override public BlockState getBlock(Vector position) { return world.getBlock(position); @@ -1146,7 +1140,7 @@ public class EditSession implements Extent { checkArgument(radius >= 0, "radius >= 0 required"); // Our origins can only be liquids - BlockMask liquidMask = new BlockMask(this, new BlockState(fluid, new HashMap<>())); + BlockMask liquidMask = new BlockMask(this, fluid.getDefaultState().toFuzzy()); // But we will also visit air blocks MaskIntersection blockMask = new MaskUnion(liquidMask, new BlockMask(this, BlockTypes.AIR.getDefaultState())); @@ -1508,7 +1502,7 @@ public class EditSession implements Extent { // Snow should not cover these blocks if (id.getMaterial().isTranslucent()) { // Add snow on leaves - if (BlockCategories.LEAVES.contains(id)) { + if (!BlockCategories.LEAVES.contains(id)) { break; } } @@ -1678,7 +1672,7 @@ public class EditSession implements Extent { for (int z = minZ; z <= maxZ; ++z) { Vector pt = new Vector(x, y, z); - BlockType type = getLazyBlock(pt).getBlockType(); + BlockType type = getBlock(pt).getBlockType(); if (map.containsKey(type)) { map.get(type).increment(); @@ -1692,7 +1686,7 @@ public class EditSession implements Extent { } } else { for (Vector pt : region) { - BlockType type = getLazyBlock(pt).getBlockType(); + BlockType type = getBlock(pt).getBlockType(); if (map.containsKey(type)) { map.get(type).increment(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java index 8af5071c6..094da742e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.world.World; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Creates new {@link EditSession}s. To get an instance of this factory, * use {@link WorldEdit#getEditSessionFactory()}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java index 6b5e54de4..2d931f91f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java @@ -19,9 +19,9 @@ package com.sk89q.worldedit; +import com.sk89q.worldedit.util.logging.LogFormat; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.item.ItemTypes; -import com.sk89q.worldedit.util.logging.LogFormat; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index 6677c9579..c42be0914 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -25,8 +25,6 @@ import com.sk89q.jchronic.Chronic; import com.sk89q.jchronic.Options; import com.sk89q.jchronic.utils.Span; import com.sk89q.jchronic.utils.Time; -import com.sk89q.worldedit.world.item.ItemType; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.command.tool.BlockTool; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.InvalidToolBindException; @@ -46,6 +44,8 @@ import com.sk89q.worldedit.regions.selector.RegionSelectorType; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.snapshot.Snapshot; import java.util.Calendar; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index f29a2d5ef..9fd469057 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -22,12 +22,12 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.registry.state.Property; 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.function.mask.Mask; import com.sk89q.worldedit.world.registry.LegacyMapper; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java index 23562fdf0..dd3ba1fc2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.blocks; -import javax.annotation.Nullable; -import java.util.Map; -import java.util.HashMap; import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; /** * The colors for wool. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java index 94cd303ea..70deb8133 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; @@ -53,9 +56,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; - /** * Implements biome-related commands such as "/biomelist". */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index f1ce2ba38..045dc6fbe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -30,7 +30,6 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.brush.ButcherBrush; import com.sk89q.worldedit.command.tool.brush.ClipboardBrush; @@ -50,6 +49,7 @@ import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Commands to set brush shape. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java index dfa646400..ae96027b0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java @@ -19,11 +19,19 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector2D; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.math.MathUtils; import com.sk89q.worldedit.util.Location; @@ -35,9 +43,6 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; - /** * Commands for working with chunks. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java index adf0ced28..3e1ecec7b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java @@ -19,19 +19,23 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Sets; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.item.ItemType; -import com.sk89q.worldedit.world.item.ItemTypes; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.util.command.parametric.Optional; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; /** * General WorldEdit commands. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java index aa6640ba2..381de7a8a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java @@ -19,6 +19,11 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.ALL; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.PLACEMENT; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; @@ -32,7 +37,6 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.annotation.Selection; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.util.command.binding.Range; import com.sk89q.worldedit.util.command.binding.Switch; @@ -40,9 +44,6 @@ import com.sk89q.worldedit.util.command.binding.Text; import com.sk89q.worldedit.util.command.parametric.Optional; import com.sk89q.worldedit.world.biome.BaseBiome; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.*; - /** * Commands for the generation of shapes and other objects. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java index a895e183f..8b76b68d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java @@ -19,14 +19,17 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Commands to undo, redo, and clear history. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java index 6a7e72f53..082b29c6e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; @@ -32,9 +35,6 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.command.parametric.Optional; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; - /** * Commands for moving the player around. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 61f2edb75..4bc7d084a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -19,10 +19,22 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.ALL; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.ORIENTATION_REGION; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; +import static com.sk89q.worldedit.regions.Regions.asFlatRegion; +import static com.sk89q.worldedit.regions.Regions.maximumBlockY; +import static com.sk89q.worldedit.regions.Regions.minimumBlockY; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.function.GroundFunction; @@ -45,7 +57,6 @@ import com.sk89q.worldedit.regions.ConvexPolyhedralRegion; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionOperationException; -import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.util.command.binding.Range; import com.sk89q.worldedit.util.command.binding.Switch; @@ -55,10 +66,6 @@ import com.sk89q.worldedit.util.command.parametric.Optional; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.*; -import static com.sk89q.worldedit.regions.Regions.*; - /** * Commands that operate on regions. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java index 3cb190e15..922dfcb69 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.ALL; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; @@ -31,9 +34,6 @@ import com.sk89q.worldedit.entity.Player; import java.io.File; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.ALL; - /** * Commands related to scripting. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 9d118681c..fb4d9824e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -34,8 +34,6 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits; @@ -59,6 +57,9 @@ import com.sk89q.worldedit.util.formatting.Style; import com.sk89q.worldedit.util.formatting.StyledFragment; import com.sk89q.worldedit.util.formatting.component.CommandListBox; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.storage.ChunkStore; import java.util.ArrayList; @@ -651,7 +652,7 @@ public class SelectionCommands { help = "Gets the distribution of blocks in the selection.\n" + "The -c flag gets the distribution of your clipboard.\n" + - "The -d flag separates blocks by data", + "The -d flag separates blocks by state", flags = "cd", min = 0, max = 0 @@ -660,32 +661,50 @@ public class SelectionCommands { public void distr(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException, CommandException { int size; - List> distributionData; + boolean useData = args.hasFlag('d'); + List> distribution = null; + List> distributionData = null; if (args.hasFlag('c')) { // TODO: Update for new clipboard throw new CommandException("Needs to be re-written again"); } else { - distributionData = editSession.getBlockDistributionWithData(session.getSelection(player.getWorld())); + if (useData) { + distributionData = editSession.getBlockDistributionWithData(session.getSelection(player.getWorld())); + } else { + distribution = editSession.getBlockDistribution(session.getSelection(player.getWorld())); + } size = session.getSelection(player.getWorld()).getArea(); } - if (distributionData.size() <= 0) { // *Should* always be false + if ((useData && distributionData.size() <= 0) || (!useData && distribution.size() <= 0)) { // *Should* always be false player.printError("No blocks counted."); return; } player.print("# total blocks: " + size); - for (Countable c : distributionData) { - String name = c.getID().getBlockType().getName(); - String str = String.format("%-7s (%.3f%%) %s #%s%s", - String.valueOf(c.getAmount()), - c.getAmount() / (double) size * 100, - name, - c.getID().getBlockType().getId(), - c.getID().getStates()); - player.print(str); + if (useData) { + for (Countable c : distributionData) { + String name = c.getID().getBlockType().getName(); + String str = String.format("%-7s (%.3f%%) %s #%s%s", + String.valueOf(c.getAmount()), + c.getAmount() / (double) size * 100, + name, + c.getID().getBlockType().getId(), + c.getID().getStates()); + player.print(str); + } + } else { + for (Countable c : distribution) { + String name = c.getID().getName(); + String str = String.format("%-7s (%.3f%%) %s #%s", + String.valueOf(c.getAmount()), + c.getAmount() / (double) size * 100, + name, + c.getID().getId()); + player.print(str); + } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java index 8c7676eee..4cd0e0079 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java @@ -24,7 +24,11 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.world.snapshot.InvalidSnapshotException; import com.sk89q.worldedit.world.snapshot.Snapshot; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java index 7dc61dba7..fcd5445a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java @@ -19,11 +19,17 @@ package com.sk89q.worldedit.command; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.world.DataException; @@ -37,8 +43,6 @@ import java.io.File; import java.io.IOException; import java.util.logging.Logger; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; - public class SnapshotUtilCommands { private static final Logger logger = Logger.getLogger("Minecraft.WorldEdit"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java index 116d71a81..5fa571265 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java @@ -22,7 +22,11 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.command.tool.AreaPickaxe; import com.sk89q.worldedit.command.tool.RecursivePickaxe; import com.sk89q.worldedit.command.tool.SinglePickaxe; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 806b6258a..7b80fbd73 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -22,15 +22,26 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.command.tool.BlockDataCyler; +import com.sk89q.worldedit.command.tool.BlockReplacer; +import com.sk89q.worldedit.command.tool.DistanceWand; +import com.sk89q.worldedit.command.tool.FloatingTreeRemover; +import com.sk89q.worldedit.command.tool.FloodFillTool; +import com.sk89q.worldedit.command.tool.LongRangeBuildTool; +import com.sk89q.worldedit.command.tool.QueryTool; +import com.sk89q.worldedit.command.tool.TreePlanter; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; -import com.sk89q.worldedit.command.tool.*; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.TreeGenerator; +import com.sk89q.worldedit.world.block.BlockStateHolder; public class ToolCommands { private final WorldEdit we; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java index 3302c9981..e74dd129f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java @@ -22,7 +22,10 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.pattern.Pattern; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 4a428e0c2..f20b54d51 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -33,8 +33,6 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.command.util.CreatureButcher; import com.sk89q.worldedit.command.util.EntityRemover; import com.sk89q.worldedit.entity.Entity; @@ -66,6 +64,8 @@ import com.sk89q.worldedit.util.formatting.component.Code; import com.sk89q.worldedit.util.formatting.component.CommandListBox; import com.sk89q.worldedit.util.formatting.component.CommandUsageBox; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.ArrayList; import java.util.List; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java index 6cfa41059..c849d1469 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java @@ -22,7 +22,10 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.platform.ConfigurationLoadEvent; import com.sk89q.worldedit.extension.platform.Actor; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java index 878fc013c..880c17fb8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java @@ -24,13 +24,13 @@ import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseItem; -import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.command.argument.CommandArgs; +import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.world.World; public class ItemParser extends SimpleCommand { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java index 524da7792..e8d209e4c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java @@ -23,15 +23,14 @@ import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extension.input.InputParseException; -import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.command.argument.CommandArgs; +import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.world.World; public class PatternParser extends SimpleCommand { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java index eed6e383c..4d98103c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.argument; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extent.NullExtent; @@ -30,8 +32,6 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.SimpleCommand; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class ReplaceParser extends SimpleCommand> { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java index 50c0710ea..a73748e4c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.composition; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.command.argument.RegionFunctionParser; @@ -30,8 +32,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.CommandExecutor; import com.sk89q.worldedit.util.command.composition.SimpleCommand; -import static com.google.common.base.Preconditions.checkNotNull; - public class ApplyCommand extends SimpleCommand> { private final CommandExecutor> functionParser; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java index 4206d6947..087963aed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.composition; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.sk89q.minecraft.util.commands.CommandException; @@ -41,8 +43,6 @@ import com.sk89q.worldedit.util.command.composition.SimpleCommand; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - public class SelectionCommand extends SimpleCommand { private final CommandExecutor> delegate; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java index 0bf486328..e2bc2f14f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.composition; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.minecraft.util.commands.CommandPermissionsException; @@ -40,8 +42,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.CommandExecutor; import com.sk89q.worldedit.util.command.composition.SimpleCommand; -import static com.google.common.base.Preconditions.checkNotNull; - public class ShapedBrushCommand extends SimpleCommand { private final CommandExecutor> delegate; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java index e5b638bd5..6401eb993 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java @@ -24,20 +24,18 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -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.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; /** * A super pickaxe mode that will remove blocks in an area. */ public class AreaPickaxe implements BlockTool { - private static final BlockState air = BlockTypes.AIR.getDefaultState(); private int range; public AreaPickaxe(int range) { @@ -78,7 +76,7 @@ public class AreaPickaxe implements BlockTool { ((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType, clicked.toVector().distanceSq(pos)); - editSession.setBlock(pos, air); + editSession.setBlock(pos, BlockTypes.AIR.getDefaultState()); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java index 21095b28b..9d0b9c9fc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java @@ -19,13 +19,16 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; /** * A mode that replaces one block. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java index a1b51e256..7488c14ad 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java @@ -19,7 +19,8 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index 5487b63d0..5f2d822cc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -24,16 +24,16 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockCategories; -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.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockCategories; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.HashSet; import java.util.LinkedList; @@ -44,7 +44,6 @@ import java.util.Set; * to anything else) */ public class FloatingTreeRemover implements BlockTool { - private static final BlockState AIR = BlockTypes.AIR.getDefaultState(); private int rangeSq; public FloatingTreeRemover() { @@ -89,7 +88,7 @@ public class FloatingTreeRemover implements BlockTool { for (Vector blockVector : blockSet) { final BlockState otherState = editSession.getBlock(blockVector); if (isTreeBlock(otherState.getBlockType())) { - editSession.setBlock(blockVector, AIR); + editSession.setBlock(blockVector, BlockTypes.AIR.getDefaultState()); } } } catch (MaxChangedBlocksException e) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java index 99a4d2857..3d178cb9c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java @@ -19,15 +19,20 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.HashSet; import java.util.Set; @@ -54,7 +59,7 @@ public class FloodFillTool implements BlockTool { public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { World world = (World) clicked.getExtent(); - BlockType initialType = world.getLazyBlock(clicked.toVector()).getBlockType(); + BlockType initialType = world.getBlock(clicked.toVector()).getBlockType(); if (initialType == BlockTypes.AIR) { return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index e0ab56643..908ec5325 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -23,12 +23,12 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; /** * A tool that can place (or remove) blocks at a distance. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index 5a8f6165e..1ad0441a4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -23,11 +23,11 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.blocks.MobSpawnerBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Looks up information about a block. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java index c2f2b6bee..f513cb075 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java @@ -19,14 +19,18 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; -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.BlockVector; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.HashSet; import java.util.Set; @@ -37,7 +41,6 @@ import java.util.Set; */ public class RecursivePickaxe implements BlockTool { - private static final BlockState air = BlockTypes.AIR.getDefaultState(); private double range; public RecursivePickaxe(double range) { @@ -95,7 +98,7 @@ public class RecursivePickaxe implements BlockTool { world.queueBlockBreakEffect(server, pos, initialType, distanceSq); - editSession.setBlock(pos, air); + editSession.setBlock(pos, BlockTypes.AIR.getDefaultState()); recurse(server, editSession, world, pos.add(1, 0, 0).toBlockVector(), origin, size, initialType, visited); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java index 40274abcb..f3f4c9945 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java @@ -23,12 +23,12 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; /** * A super pickaxe mode that removes one block. @@ -43,7 +43,7 @@ public class SinglePickaxe implements BlockTool { @Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { World world = (World) clicked.getExtent(); - final BlockType blockType = world.getLazyBlock(clicked.toVector()).getBlockType(); + final BlockType blockType = world.getBlock(clicked.toVector()).getBlockType(); if (blockType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java index 998c87fd5..436d42104 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java @@ -19,11 +19,15 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; -import com.sk89q.worldedit.util.*; +import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.util.TreeGenerator; /** * Plants a tree. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java index 3aa52262c..10db344ca 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java @@ -22,9 +22,9 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.world.block.BlockTypes; public class CylinderBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java index 2dcce3bea..eae099ed4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java @@ -23,11 +23,13 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.function.pattern.Pattern; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class GravityBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java index dc6bd9459..7da259c33 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java @@ -23,9 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.world.block.BlockTypes; public class HollowCylinderBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java index 2fa5d3902..b5009221b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java @@ -23,9 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.world.block.BlockTypes; public class HollowSphereBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java index d52ebbd4b..df76950d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java @@ -20,11 +20,11 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.math.convolution.HeightMap; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.convolution.GaussianKernel; +import com.sk89q.worldedit.math.convolution.HeightMap; import com.sk89q.worldedit.math.convolution.HeightMapFilter; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java index 120539b82..781ee6d1f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java @@ -23,9 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.world.block.BlockTypes; public class SphereBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java index 5c853a2a6..456acaa3d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.entity; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.world.NbtValued; import com.sk89q.worldedit.world.entity.EntityType; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Represents a mutable "snapshot" of an entity. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java index 81f1f131b..d1bf6a238 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java @@ -19,19 +19,19 @@ package com.sk89q.worldedit.event.extent; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.EditSession.Stage; + import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.EditSession.Stage; - /** * Raised (several times) when a new {@link EditSession} is being instantiated. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java index 2fdb4e443..7549518ad 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.event.Cancellable; import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Called when a block is interacted with. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandEvent.java index 0790787f4..6d3791b86 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandEvent.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.event.AbstractCancellable; import com.sk89q.worldedit.extension.platform.Actor; -import static com.google.common.base.Preconditions.checkNotNull; - /** * This class is currently only for internal use. Do not post or catch this event. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java index 8fa39c0ff..75483745e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Posted when suggestions for auto-completion are requested for command input. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java index 73d23131c..1bfc11724 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.event.Event; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Raised when the configuration has been loaded or re-loaded. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java index 2bc39ee97..67ef25268 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.Cancellable; import com.sk89q.worldedit.event.Event; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Raised whenever a player sends input. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java index 90ff8d365..f8c3a5e95 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java @@ -21,10 +21,10 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.internal.registry.AbstractFactory; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.HashSet; import java.util.Set; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java index 1c7a0d646..fe28aafe8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java @@ -22,12 +22,12 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.EmptyClipboardException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.function.pattern.ClipboardPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.registry.InputParser; -import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.session.ClipboardHolder; class HashTagPatternParser extends InputParser { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java index 87b3862fc..45373ec26 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java @@ -20,13 +20,13 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.RandomPattern; import com.sk89q.worldedit.internal.registry.InputParser; +import com.sk89q.worldedit.world.block.BlockStateHolder; class RandomPatternParser extends InputParser { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java index 17833cf97..cd3adb5e7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java @@ -20,11 +20,11 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.registry.InputParser; -import com.sk89q.worldedit.extension.input.InputParseException; class SingleBlockPatternParser extends InputParser { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index f30aeaa5b..41a495c40 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -24,13 +24,6 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockType; -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.gamemode.GameMode; -import com.sk89q.worldedit.world.gamemode.GameModes; -import com.sk89q.worldedit.world.item.ItemType; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.internal.cui.CUIEvent; @@ -38,6 +31,13 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TargetBlock; import com.sk89q.worldedit.util.auth.AuthorizationException; +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.gamemode.GameMode; +import com.sk89q.worldedit.world.gamemode.GameModes; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import java.io.File; @@ -103,7 +103,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { byte free = 0; - while (y <= world.getMinimumPoint().getBlockY() + 2) { + while (y <= world.getMaximumPoint().getBlockY() + 2) { if (!world.getBlock(new Vector(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) { ++free; } else { @@ -310,12 +310,12 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public Location getBlockIn() { - return getLocation(); + return getLocation().setPosition(getLocation().toVector().toBlockVector()); } @Override public Location getBlockOn() { - return getLocation().setY(getLocation().getY() - 1); + return getLocation().setPosition(getLocation().setY(getLocation().getY() - 1).toVector().toBlockVector()); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java index 5c010c1f8..12f56a81a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.extension.platform; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.util.command.composition.LegacyCommandAdapter.adapt; + import com.google.common.base.Joiner; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; @@ -28,15 +31,41 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.command.*; +import com.sk89q.worldedit.command.BiomeCommands; +import com.sk89q.worldedit.command.BrushCommands; +import com.sk89q.worldedit.command.ChunkCommands; +import com.sk89q.worldedit.command.ClipboardCommands; +import com.sk89q.worldedit.command.GeneralCommands; +import com.sk89q.worldedit.command.GenerationCommands; +import com.sk89q.worldedit.command.HistoryCommands; +import com.sk89q.worldedit.command.NavigationCommands; +import com.sk89q.worldedit.command.RegionCommands; +import com.sk89q.worldedit.command.SchematicCommands; +import com.sk89q.worldedit.command.ScriptingCommands; +import com.sk89q.worldedit.command.SelectionCommands; +import com.sk89q.worldedit.command.SnapshotCommands; +import com.sk89q.worldedit.command.SnapshotUtilCommands; +import com.sk89q.worldedit.command.SuperPickaxeCommands; +import com.sk89q.worldedit.command.ToolCommands; +import com.sk89q.worldedit.command.ToolUtilCommands; +import com.sk89q.worldedit.command.UtilityCommands; +import com.sk89q.worldedit.command.WorldEditCommands; import com.sk89q.worldedit.command.argument.ReplaceParser; import com.sk89q.worldedit.command.argument.TreeGeneratorParser; -import com.sk89q.worldedit.command.composition.*; +import com.sk89q.worldedit.command.composition.ApplyCommand; +import com.sk89q.worldedit.command.composition.DeformCommand; +import com.sk89q.worldedit.command.composition.PaintCommand; +import com.sk89q.worldedit.command.composition.SelectionCommand; +import com.sk89q.worldedit.command.composition.ShapedBrushCommand; import com.sk89q.worldedit.event.platform.CommandEvent; import com.sk89q.worldedit.event.platform.CommandSuggestionEvent; import com.sk89q.worldedit.function.factory.Deform; import com.sk89q.worldedit.function.factory.Deform.Mode; -import com.sk89q.worldedit.internal.command.*; +import com.sk89q.worldedit.internal.command.ActorAuthorizer; +import com.sk89q.worldedit.internal.command.CommandLoggingHandler; +import com.sk89q.worldedit.internal.command.UserCommandCompleter; +import com.sk89q.worldedit.internal.command.WorldEditBinding; +import com.sk89q.worldedit.internal.command.WorldEditExceptionConverter; import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.InvalidUsageException; @@ -58,9 +87,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.util.command.composition.LegacyCommandAdapter.adapt; - /** * Handles the registration and invocation of commands. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java index 517c98e93..3b37a98b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java @@ -25,10 +25,11 @@ import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.registry.Registries; -import javax.annotation.Nullable; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; + /** * Represents a platform that WorldEdit has been implemented for. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 8b6af45d8..27da6be8a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.extension.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.BaseEntity; @@ -31,11 +33,9 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.gamemode.GameMode; -import javax.annotation.Nullable; - import java.util.UUID; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; class PlayerProxy extends AbstractPlayerActor { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java index bb956d4ae..a33c56fd5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java @@ -19,26 +19,25 @@ package com.sk89q.worldedit.extent; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.OperationQueue; -import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.biome.BaseBiome; - -import javax.annotation.Nullable; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * A base class for {@link Extent}s that merely passes extents onto another. @@ -71,11 +70,6 @@ public abstract class AbstractDelegateExtent implements Extent { return extent.getBlock(position); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return extent.getLazyBlock(position); - } - @Override public BaseBlock getFullBlock(Vector position) { return extent.getFullBlock(position); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java index f57056f7a..590622a72 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.extent; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.history.change.BlockChange; @@ -31,13 +32,12 @@ import com.sk89q.worldedit.history.change.EntityRemove; import com.sk89q.worldedit.history.changeset.ChangeSet; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; - -import javax.annotation.Nullable; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Stores changes to a {@link ChangeSet}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java index 617dff41f..5ed584351 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java @@ -22,11 +22,12 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; -import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.util.Location; + +import java.util.List; import javax.annotation.Nullable; -import java.util.List; /** * A world, portion of a world, clipboard, or other object that can have blocks diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java index 39e4bd12f..fc7d70081 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java @@ -22,10 +22,9 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockState; /** * Provides the current state of blocks, entities, and so on. @@ -48,29 +47,6 @@ public interface InputExtent { */ BlockState getBlock(Vector position); - /** - * Get a lazy, immutable snapshot of the block at the given location that only - * immediately contains information about the block's type (and metadata). - * - *

Further information (such as NBT data) will be available by the - * time of access. Therefore, it is not recommended that - * this method is used if the world is being simulated at the time of - * call. If the block needs to be stored for future use, then this method should - * definitely not be used. Moreover, the block that is returned is immutable (or - * should be), and therefore modifications should not be attempted on it. If a - * modifiable copy is required, then the block should be cloned.

- * - *

This method exists because it is sometimes important to inspect the block - * at a given location, but {@link #getBlock(Vector)} may be too expensive in - * the underlying implementation. It is also not possible to implement - * caching if the returned object is mutable, so this methods allows caching - * implementations to be used.

- * - * @param position position of the block - * @return the block - */ - LazyBlock getLazyBlock(Vector position); - /** * Get a immutable snapshot of the block at the given location. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java index ea8ca7c14..cbd21675c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.extent; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.function.mask.Mask; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Requires that all mutating methods pass a given {@link Mask}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java index f73152476..2753948cd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java @@ -23,21 +23,21 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; -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.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; -import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * An extent that returns air blocks for all blocks and does not * pass on any changes. @@ -77,11 +77,6 @@ public class NullExtent implements Extent { return BlockTypes.AIR.getDefaultState(); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(BlockTypes.AIR, this, position); - } - @Override public BaseBlock getFullBlock(Vector position) { return new BaseBlock(getBlock(position)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java index 424e84165..36747fd97 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java @@ -22,9 +22,9 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockStateHolder; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java index a8b5636ed..3905f4ccb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java @@ -24,9 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -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.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; @@ -35,6 +32,8 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.AbstractRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionOperationException; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Iterator; import java.util.LinkedHashMap; @@ -49,8 +48,6 @@ import java.util.Map; */ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pattern { - private static final BlockState AIR = BlockTypes.AIR.getDefaultState(); - private final Map buffer = new LinkedHashMap<>(); private final Mask mask; private Vector min = null; @@ -110,7 +107,7 @@ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pat if (block != null) { return block; } else { - return AIR; + return BlockTypes.AIR.getDefaultState(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java index 2a61679c7..b4c4e267a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java @@ -21,14 +21,13 @@ package com.sk89q.worldedit.extent.cache; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockState; /** - * Returns the same cached {@link BaseBlock} for repeated calls to - * {@link #getLazyBlock(Vector)} with the same position. + * Returns the same cached {@link BlockState} for repeated calls to + * {@link #getBlock(Vector)} with the same position. */ public class LastAccessExtentCache extends AbstractDelegateExtent { @@ -44,13 +43,13 @@ public class LastAccessExtentCache extends AbstractDelegateExtent { } @Override - public LazyBlock getLazyBlock(Vector position) { + public BlockState getBlock(Vector position) { BlockVector blockVector = position.toBlockVector(); CachedBlock lastBlock = this.lastBlock; if (lastBlock != null && lastBlock.position.equals(blockVector)) { return lastBlock.block; } else { - LazyBlock block = super.getLazyBlock(position); + BlockState block = super.getBlock(position); this.lastBlock = new CachedBlock(blockVector, block); return block; } @@ -58,9 +57,9 @@ public class LastAccessExtentCache extends AbstractDelegateExtent { private static class CachedBlock { private final BlockVector position; - private final LazyBlock block; + private final BlockState block; - private CachedBlock(BlockVector position, LazyBlock block) { + private CachedBlock(BlockVector position, BlockState block) { this.position = position; this.block = block; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index 0cc32149c..fc31c2886 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -19,27 +19,27 @@ package com.sk89q.worldedit.extent.clipboard; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; -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.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Stores block data as a multi-dimensional array of {@link BaseBlock}s and @@ -135,11 +135,6 @@ public class BlockArrayClipboard implements Clipboard { return BlockTypes.AIR.getDefaultState(); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(getBlock(position), null, position); - } - @Override public BaseBlock getFullBlock(Vector position) { if (region.contains(position)) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java index 4311ada18..4b56e5e06 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.extent.clipboard; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An implementation of {@link Entity} that stores a {@link BaseEntity} with it. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java index 1448ca123..94f76fe5f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.extent.clipboard.io; import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.world.registry.Registries; import java.io.Closeable; import java.io.IOException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java index cfe6007c9..16a60c80d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.extent.clipboard.io.legacycompat; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java index 566f34812..ae2d5f055 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java @@ -26,7 +26,6 @@ import com.google.gson.JsonPrimitive; import com.google.gson.JsonSyntaxException; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java index aeee7a339..d55771266 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java @@ -19,9 +19,9 @@ package com.sk89q.worldedit.extent.inventory; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.util.Location; /** * Represents a source to get blocks from and store removed ones. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index 894dda9d4..343181e25 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java @@ -21,12 +21,12 @@ package com.sk89q.worldedit.extent.inventory; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; +import com.sk89q.worldedit.extent.Extent; 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.extent.AbstractDelegateExtent; -import com.sk89q.worldedit.extent.Extent; import java.util.HashMap; import java.util.Map; 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 06f36079f..a4630bb8d 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 @@ -24,7 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.transform.Transform; @@ -82,11 +81,6 @@ public class BlockTransformExtent extends AbstractDelegateExtent { return transformBlock(super.getBlock(position), false); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return transformBlock(super.getLazyBlock(position), false); - } - @Override public BaseBlock getFullBlock(Vector position) { return transformBlock(super.getFullBlock(position), false); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java index 04266af6d..c3332a250 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.extent.validation; +import static com.google.common.base.Preconditions.checkArgument; + import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; - -import static com.google.common.base.Preconditions.checkArgument; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Limits the number of blocks that can be changed before a diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index 720a4d8a9..ffb2b175a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -19,15 +19,15 @@ package com.sk89q.worldedit.extent.validation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; /** * Validates set data to prevent creating invalid blocks and such. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index 5e33b6455..25591defb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -23,12 +23,12 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -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.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Handles various quirks when setting blocks, such as ice turning diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java index e98e9d8dc..845276a58 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.extent.world; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Automatically loads chunks when blocks are accessed. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java index b11210bdf..9ad839a32 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java @@ -19,21 +19,21 @@ package com.sk89q.worldedit.extent.world; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.HashSet; import java.util.List; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Implements "fast mode" which may skip physics, lighting, etc. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java index c8f1b2741..97d8ee9c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java @@ -23,11 +23,11 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Makes changes to the world as if a player had done so during survival mode. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java index 2a0a4f992..ba853eba9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java @@ -19,12 +19,15 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import java.util.*; - -import static com.google.common.base.Preconditions.checkNotNull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; /** * Executes several region functions in order. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java index d9ee8c917..07c1515ba 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.Region; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - public class EditContext { private Extent destination; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java index 35a9802e4..ff287632c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.mask.Mask2D; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Passes calls to {@link #apply(com.sk89q.worldedit.Vector2D)} to the * delegate {@link com.sk89q.worldedit.function.FlatRegionFunction} if they diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java index ae130d6c6..2b14b57b2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.mask.Mask; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Applies a {@link RegionFunction} to the first ground block. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java index 1f773a188..673d411d2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.mask.Mask; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Passes calls to {@link #apply(com.sk89q.worldedit.Vector)} to the * delegate {@link com.sk89q.worldedit.function.RegionFunction} if they diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java index f877adce5..ac5fdf98d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function.biome; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.FlatRegionFunction; import com.sk89q.worldedit.world.biome.BaseBiome; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Replaces the biome at the locations that this function is applied to. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java index a95c512e6..0013ade94 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function.block; -import com.sk89q.worldedit.extent.Extent; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Replaces blocks with a given pattern. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java index be1e39ec9..70dbf6bb2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.block; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTagBuilder; import com.sk89q.worldedit.Vector; @@ -31,8 +33,6 @@ import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Direction.Flag; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Copies blocks from one extent to another. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java index fd8cc5b7c..1c56d8a4f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java @@ -19,17 +19,16 @@ package com.sk89q.worldedit.function.block; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Sets; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.LayerFunction; import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.Mask; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Makes a layer of grass on top, three layers of dirt below, and smooth stone @@ -38,10 +37,6 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class Naturalizer implements LayerFunction { - private static final BlockState grass = BlockTypes.GRASS_BLOCK.getDefaultState(); - private static final BlockState dirt = BlockTypes.DIRT.getDefaultState(); - private static final BlockState stone = BlockTypes.STONE.getDefaultState(); - private final EditSession editSession; private final Mask mask; private int affected = 0; @@ -54,7 +49,11 @@ public class Naturalizer implements LayerFunction { public Naturalizer(EditSession editSession) { checkNotNull(editSession); this.editSession = editSession; - this.mask = new BlockMask(editSession, Sets.newHashSet(grass, dirt, stone)); + this.mask = new BlockMask(editSession, Sets.newHashSet( + BlockTypes.GRASS_BLOCK.getDefaultState(), + BlockTypes.DIRT.getDefaultState(), + BlockTypes.STONE.getDefaultState() + )); } /** @@ -77,15 +76,15 @@ public class Naturalizer implements LayerFunction { affected++; switch (depth) { case 0: - editSession.setBlock(position, grass); + editSession.setBlock(position, BlockTypes.GRASS_BLOCK.getDefaultState()); break; case 1: case 2: case 3: - editSession.setBlock(position, dirt); + editSession.setBlock(position, BlockTypes.DIRT.getDefaultState()); break; default: - editSession.setBlock(position, stone); + editSession.setBlock(position, BlockTypes.STONE.getDefaultState()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java index 5fbda8908..e157de444 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.entity; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTagBuilder; import com.sk89q.worldedit.Vector; @@ -33,8 +35,6 @@ import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Direction.Flag; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Copies entities provided to the function to the provided destination * {@code Extent}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java index 7ff183a37..324fe72f1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.function.factory; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.worldedit.function.Contextual; import com.sk89q.worldedit.function.EditContext; import com.sk89q.worldedit.function.RegionFunction; @@ -27,9 +30,6 @@ import com.sk89q.worldedit.function.visitor.RegionVisitor; import com.sk89q.worldedit.regions.NullRegion; import com.sk89q.worldedit.regions.Region; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class Apply implements Contextual { private final Region region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java index f255050b7..d80ad4570 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.function.factory; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; @@ -34,9 +37,6 @@ import com.sk89q.worldedit.regions.Region; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class Deform implements Contextual { private Extent destination; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Paint.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Paint.java index b88c09bbf..908608b81 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Paint.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Paint.java @@ -19,6 +19,12 @@ package com.sk89q.worldedit.function.factory; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.regions.Regions.asFlatRegion; +import static com.sk89q.worldedit.regions.Regions.maximumBlockY; +import static com.sk89q.worldedit.regions.Regions.minimumBlockY; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.NullExtent; import com.sk89q.worldedit.function.Contextual; @@ -33,10 +39,6 @@ import com.sk89q.worldedit.math.noise.RandomNoise; import com.sk89q.worldedit.regions.NullRegion; import com.sk89q.worldedit.regions.Region; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.regions.Regions.*; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class Paint implements Contextual { private final Extent destination; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index 348e533d5..3f6265de7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -22,12 +22,12 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.RandomPattern; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Generates flora (which may include tall grass, flowers, etc.). @@ -106,7 +106,7 @@ public class FloraGenerator implements RegionFunction { public boolean apply(Vector position) throws WorldEditException { BlockStateHolder block = editSession.getBlock(position); - if (block.getBlockType() == BlockTypes.GRASS) { + if (block.getBlockType() == BlockTypes.GRASS_BLOCK) { editSession.setBlock(position.add(0, 1, 0), temperatePattern.apply(position)); return true; } else if (block.getBlockType() == BlockTypes.SAND) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index a76066adf..bf37a4d9c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -22,11 +22,11 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.function.RegionFunction; +import com.sk89q.worldedit.util.TreeGenerator; 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.function.RegionFunction; -import com.sk89q.worldedit.util.TreeGenerator; /** * Generates forests by searching for the ground starting from the given upper Y @@ -53,10 +53,10 @@ public class ForestGenerator implements RegionFunction { BlockStateHolder block = editSession.getBlock(position); BlockType t = block.getBlockType(); - if (t == BlockTypes.GRASS || t == BlockTypes.DIRT) { + if (t == BlockTypes.GRASS_BLOCK || t == BlockTypes.DIRT) { treeType.generate(editSession, position.add(0, 1, 0)); return true; - } else if (t == BlockTypes.TALL_GRASS || t == BlockTypes.DEAD_BUSH || t == BlockTypes.POPPY || t == BlockTypes.DANDELION) { // TODO: This list needs to be moved + } else if (t == BlockTypes.GRASS || t == BlockTypes.DEAD_BUSH || t == BlockTypes.POPPY || t == BlockTypes.DANDELION) { // TODO: This list needs to be moved editSession.setBlock(position, BlockTypes.AIR.getDefaultState()); treeType.generate(editSession, position); return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index ad9d906fb..b23af44ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -163,7 +163,7 @@ public class GardenPatchGenerator implements RegionFunction { position = position.add(0, 1, 0); } - if (editSession.getBlock(position.add(0, -1, 0)).getBlockType() != BlockTypes.GRASS) { + if (editSession.getBlock(position.add(0, -1, 0)).getBlockType() != BlockTypes.GRASS_BLOCK) { return false; } @@ -187,7 +187,7 @@ public class GardenPatchGenerator implements RegionFunction { * @return a pumpkin pattern */ public static Pattern getPumpkinPattern() { - return new BlockPattern(BlockTypes.CARVED_PUMPKIN.getDefaultState()); + return new BlockPattern(BlockTypes.PUMPKIN.getDefaultState()); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java index 3a7d89aa2..dbb3f28cc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.extent.Extent; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.extent.Extent; + /** * An abstract implementation of {@link Mask} that takes uses an {@link Extent}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java index b1d8be833..d7bf33c8a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.biome.BaseBiome; @@ -28,8 +30,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Tests true if the biome at applied points is the same as the one given. */ 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 f44ce27e6..0eee90887 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 @@ -19,17 +19,18 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.Vector; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockStateHolder; -import javax.annotation.Nullable; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * A mask that checks whether blocks at the given positions are matched by diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java index fe35ff1ef..3622926e3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkArgument; + import com.sk89q.worldedit.Vector; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkArgument; - /** * Has the criteria where the Y value of passed positions must be within * a certain range of Y values (inclusive). diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java index c942ddc5c..552197d10 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java @@ -19,9 +19,9 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockTypes; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java index d1d1e374b..d662e0fa3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.internal.expression.ExpressionException; @@ -27,8 +29,6 @@ import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that evaluates an expression. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java index 52fc28c57..2b4031ca8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.internal.expression.runtime.EvaluationException; -import static com.google.common.base.Preconditions.checkNotNull; - public class ExpressionMask2D extends AbstractMask2D { private final Expression expression; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java index bf6d904b2..8b47e2c2c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java @@ -21,8 +21,8 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.Blocks; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.Collection; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java index 2d1fadaaa..5968b3b6c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java @@ -19,9 +19,10 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -29,7 +30,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Combines several masks and requires that all masks return true diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java index 75905f49f..07e43be38 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import java.util.Arrays; @@ -26,8 +28,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Tests true if all contained masks test true. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java index 941cf0c14..a54794255 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java @@ -21,11 +21,12 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import javax.annotation.Nullable; + /** * Combines several masks and requires that one or more masks return true * when a certain position is tested. It serves as a logical OR operation diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java index 82b5a5176..007520485 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java @@ -19,12 +19,13 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Various utility functions related to {@link Mask} and {@link Mask2D}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java index 61dd7b73a..04c793bde 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.math.noise.NoiseGenerator; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that uses a noise generator and returns true whenever the noise * generator returns a value above the given density. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java index 6a2146c58..fdcbcd59b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.Vector2D; -import com.sk89q.worldedit.math.noise.NoiseGenerator; - import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector2D; +import com.sk89q.worldedit.math.noise.NoiseGenerator; + /** * A mask that uses a noise generator and returns true whenever the noise * generator returns a value above the given density. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java index b5358cb30..d8d3d455f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Checks whether another mask tests true for a position that is offset * a given vector. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java index 50d2835ba..74daead9d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.Vector2D; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector2D; + /** * Checks whether another mask tests true for a position that is offset * a given vector. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java index 1ddf891fe..7d2d78dfc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.regions.Region; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that tests whether given positions are contained within a region. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java index 7137ca221..917c22f36 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockState; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java index 6db38a2d8..1f3bf2a22 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java @@ -19,18 +19,18 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.Iterator; import java.util.List; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Sets block from an iterator of {@link Map.Entry} containing a * {@link BlockVector} as the key and a {@link BaseBlock} as the value. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java index 93c0348e2..54ea500f0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java @@ -19,16 +19,16 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.history.UndoContext; import com.sk89q.worldedit.history.change.Change; import com.sk89q.worldedit.history.changeset.ChangeSet; -import com.sk89q.worldedit.history.UndoContext; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Performs an undo or redo from a given {@link ChangeSet}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java index 509b103c1..69560ec56 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Executes a delegete operation, but returns to another operation upon * completing the delegate. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java index f4b2a95d7..53e79fa3d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Lists; import com.sk89q.worldedit.WorldEditException; @@ -27,8 +29,6 @@ import java.util.Collection; import java.util.Deque; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Executes multiple queues in order. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java index 66f112a61..ebab2aa5f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.pattern; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A pattern that returns the same {@link BaseBlock} each time. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java index 708f2bb4e..6f08d5b34 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.pattern; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extent.clipboard.Clipboard; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.extent.clipboard.Clipboard; +import com.sk89q.worldedit.world.block.BlockStateHolder; + /** * A pattern that reads from {@link Clipboard}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java index e27d0d274..c28c147f9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.pattern; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.world.block.BlockStateHolder; @@ -26,8 +28,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Uses a random pattern of a weighted list of patterns. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java index 6a9581ff3..659fef612 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.pattern; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extent.Extent; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockStateHolder; + /** * Returns the blocks from {@link Extent}, repeating when out of bounds. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java index c01e9bc9d..6a21a50c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.util; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.FlatRegionFunction; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Offsets the position parameter by adding a given offset vector. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java index 4d5338eaf..c1f395be6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.util; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.RegionFunction; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Offsets the position parameter by adding a given offset vector. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java index 84d8ab366..1601caf40 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java @@ -19,16 +19,22 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.RegionFunction; +import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; -import java.util.*; - -import static com.google.common.base.Preconditions.checkNotNull; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Queue; +import java.util.Set; /** * Performs a breadth-first search starting from points added with diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java index ae57a4418..3788d547d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.mask.Mask; import java.util.Collection; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Visits adjacent points on the same X-Z plane as long as the points * pass the given mask, and then executes the provided region diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java index b4c301ae4..c3ce36567 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.EntityFunction; @@ -28,8 +30,6 @@ import com.sk89q.worldedit.function.operation.RunContext; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Visits entities as provided by an {@code Iterator}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java index 23dd74e4e..1f0d96e42 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.FlatRegionFunction; @@ -28,8 +30,6 @@ import com.sk89q.worldedit.regions.FlatRegion; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Applies region functions to columns in a {@link FlatRegion}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/LayerVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/LayerVisitor.java index f128b1301..b6dcf4882 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/LayerVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/LayerVisitor.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; @@ -31,9 +34,6 @@ import com.sk89q.worldedit.regions.FlatRegion; import java.util.List; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Visits the layers within a region. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java index 79bef13b4..ac89393a3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.mask.Mask; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An implementation of an {@link BreadthFirstSearch} that uses a mask to * determine where a block should be visited. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java index caec36d7d..d6fc7d45c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java @@ -21,8 +21,8 @@ package com.sk89q.worldedit.function.visitor; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.RegionFunction; +import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; import com.sk89q.worldedit.regions.Region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java index a1761f833..4bb94aa09 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.history.change; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.history.UndoContext; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Represents a block change that may be undone or replayed. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java index f9f644fe1..006839291 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.history.change; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.history.changeset.ChangeSet; import com.sk89q.worldedit.history.UndoContext; +import com.sk89q.worldedit.history.changeset.ChangeSet; /** * Describes a change that can be undone or re-applied. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityCreate.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityCreate.java index 80d0bbcaa..e74f0cc84 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityCreate.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityCreate.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.history.change; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.history.UndoContext; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Logs the creation of an entity and removes the entity upon undo. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityRemove.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityRemove.java index eef480a91..79f79e31a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityRemove.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityRemove.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.history.change; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.history.UndoContext; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Tracks the removal of an entity. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java index fb871a214..bc13a5755 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.history.changeset; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Lists; import com.sk89q.worldedit.history.change.Change; @@ -26,8 +28,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Stores all {@link Change}s in an {@link ArrayList}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java index 982f8503d..3239789bc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java @@ -19,20 +19,20 @@ package com.sk89q.worldedit.history.changeset; +import static com.google.common.base.Preconditions.checkNotNull; +import static java.util.Map.Entry; + import com.google.common.base.Function; import com.google.common.collect.Iterators; import com.sk89q.worldedit.BlockVector; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.history.change.BlockChange; import com.sk89q.worldedit.history.change.Change; import com.sk89q.worldedit.util.collection.TupleArrayList; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.ArrayList; import java.util.Iterator; -import static com.google.common.base.Preconditions.checkNotNull; -import static java.util.Map.Entry; - /** * An extension of {@link ArrayListHistory} that stores {@link BlockChange}s * separately in two {@link ArrayList}s. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java index 71c9751e7..a6371961f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java @@ -19,10 +19,15 @@ package com.sk89q.worldedit.internal.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.command.parametric.AbstractInvokeListener; @@ -35,8 +40,6 @@ import java.lang.reflect.Method; import java.util.logging.Handler; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Logs called commands to a logger. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java index 5e0bbdbb7..a93363295 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.internal.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extension.platform.Actor; @@ -33,8 +35,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Provides the names of connected users as suggestions. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java index 31e5f1a65..1d7d7d99b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java @@ -27,7 +27,6 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.NoMatchException; @@ -50,6 +49,7 @@ import com.sk89q.worldedit.util.command.parametric.ParameterException; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.Biomes; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.registry.BiomeRegistry; import java.util.Arrays; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java index d1810bc9f..b50997cc6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java @@ -26,7 +26,11 @@ import com.sk89q.worldedit.internal.expression.runtime.Conditional; import com.sk89q.worldedit.internal.expression.runtime.Operators; import com.sk89q.worldedit.internal.expression.runtime.RValue; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Map; /** * Helper classfor Parser. Contains processors for statements and operators. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java index 4f4f36ea6..506663a81 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java @@ -19,16 +19,16 @@ package com.sk89q.worldedit.internal.registry; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.NoMatchException; +import com.sk89q.worldedit.extension.input.ParserContext; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An abstract implementation of a factory for internal usage. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java index 059c95ba4..77c05c2e3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.internal.registry; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; /** * Input parser interface for {@link AbstractFactory}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java index c82570597..4f9f130c9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java @@ -22,7 +22,20 @@ package com.sk89q.worldedit.internal.util; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.NestedCommand; -import com.sk89q.worldedit.command.*; +import com.sk89q.worldedit.command.BiomeCommands; +import com.sk89q.worldedit.command.ChunkCommands; +import com.sk89q.worldedit.command.ClipboardCommands; +import com.sk89q.worldedit.command.GeneralCommands; +import com.sk89q.worldedit.command.GenerationCommands; +import com.sk89q.worldedit.command.HistoryCommands; +import com.sk89q.worldedit.command.NavigationCommands; +import com.sk89q.worldedit.command.RegionCommands; +import com.sk89q.worldedit.command.ScriptingCommands; +import com.sk89q.worldedit.command.SelectionCommands; +import com.sk89q.worldedit.command.SnapshotUtilCommands; +import com.sk89q.worldedit.command.ToolCommands; +import com.sk89q.worldedit.command.ToolUtilCommands; +import com.sk89q.worldedit.command.UtilityCommands; import java.io.File; import java.io.FileOutputStream; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index a1bae435f..0cfd4c35f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -24,9 +24,9 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.regions.Region; /** * Allows applications of Kernels onto the region's height map. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java index f953d3de6..f5f41313b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java @@ -21,13 +21,13 @@ package com.sk89q.worldedit.math.interpolation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A Kochanek-Bartels interpolation; continuous in the 2nd derivative. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java index 00fa7c12f..ea1962119 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java @@ -21,12 +21,12 @@ package com.sk89q.worldedit.math.interpolation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Simple linear interpolation. Mainly used for testing. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java index 7b67c6a86..d6920b829 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java @@ -21,6 +21,8 @@ package com.sk89q.worldedit.math.interpolation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import java.util.List; @@ -28,8 +30,6 @@ import java.util.Map.Entry; import java.util.TreeMap; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Reparametrises another interpolation function by arc length. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java index 46cd72177..646e2a209 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.math.transform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import java.util.ArrayList; @@ -26,8 +28,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Combines several transforms in order. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java index 71286507b..5d0412259 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.math.transform; -import com.sk89q.worldedit.util.Location; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.util.Location; + /** * Various utility methods related to {@link Transform}s. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java index 9bc7159f6..44f7070cb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java @@ -19,13 +19,19 @@ package com.sk89q.worldedit.regions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.regions.iterator.RegionIterator; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.storage.ChunkStore; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; public abstract class AbstractRegion implements Region { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java index 711d729d8..8269821c1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java @@ -19,7 +19,13 @@ package com.sk89q.worldedit.regions; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.storage.ChunkStore; @@ -27,9 +33,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An axis-aligned cuboid. It can be defined using two corners of the cuboid. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java index 7730b6756..5f1c9653e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java @@ -19,11 +19,17 @@ package com.sk89q.worldedit.regions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.World; -import java.util.*; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; /** * A region that contains no points. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java index a84227075..ae72793a2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java @@ -25,10 +25,11 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.List; import java.util.Set; +import javax.annotation.Nullable; + /** * Represents a physical shape. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java index 1e7e723f6..52329f86c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java @@ -27,9 +27,10 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.List; +import javax.annotation.Nullable; + /** * Region selectors create {@link Region}s from a series of "selected points." * They are used, for example, to allow users to create a {@link CuboidRegion} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java index cff94d8cd..338d5f0e9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.regions; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; @@ -26,12 +28,11 @@ import com.sk89q.worldedit.math.transform.Identity; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Transforms another region according to a provided vector {@code Transform}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java index 7cfeff11e..8c6628616 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.regions.iterator; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.regions.FlatRegion; @@ -26,8 +28,6 @@ import com.sk89q.worldedit.regions.FlatRegion; import java.util.Iterator; import java.util.NoSuchElementException; -import static com.google.common.base.Preconditions.checkNotNull; - public class FlatRegion3DIterator implements Iterator { private Iterator flatIterator; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java index 6657613b2..60018afeb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.regions.iterator; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.regions.Region; import java.util.Iterator; -import static com.google.common.base.Preconditions.checkNotNull; - public class FlatRegionIterator implements Iterator { private Region region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java index 9d3b4542d..35700595c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.regions.iterator; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.regions.Region; import java.util.Iterator; -import static com.google.common.base.Preconditions.checkNotNull; - public class RegionIterator implements Iterator { private final Region region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java index 875af7659..3495fee83 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.regions.polyhedron; -import com.sk89q.worldedit.Vector; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector; + public class Edge { private final Vector start; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java index ed1ee46c8..01bd7f8ae 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.regions.polyhedron; -import com.sk89q.worldedit.Vector; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector; + public class Triangle { private String tag = "Triangle"; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java index fdafcd41b..182c08f0f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java @@ -19,7 +19,12 @@ package com.sk89q.worldedit.regions.selector; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIRegion; import com.sk89q.worldedit.internal.cui.SelectionPointEvent; @@ -29,11 +34,10 @@ import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Creates a {@code CuboidRegion} from a user's selections. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java index 592d05f15..8e4ce873c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java @@ -19,21 +19,29 @@ package com.sk89q.worldedit.regions.selector; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.extension.platform.Actor; -import com.sk89q.worldedit.internal.cui.*; +import com.sk89q.worldedit.internal.cui.CUIRegion; +import com.sk89q.worldedit.internal.cui.SelectionCylinderEvent; +import com.sk89q.worldedit.internal.cui.SelectionMinMaxEvent; +import com.sk89q.worldedit.internal.cui.SelectionPointEvent; import com.sk89q.worldedit.regions.CylinderRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Creates a {@code CylinderRegionSelector} from a user's selections. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java index e01e667da..ca32ac3dc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java @@ -19,7 +19,12 @@ package com.sk89q.worldedit.regions.selector; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIRegion; import com.sk89q.worldedit.internal.cui.SelectionEllipsoidPointEvent; @@ -30,11 +35,10 @@ import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Creates a {@code EllipsoidRegionSelector} from a user's selections. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java index c1eb744d6..7629637d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java @@ -22,9 +22,9 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Generates solid and hollow shapes according to materials returned by the diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java index ba5d8d587..e8419cf00 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Generates solid and hollow shapes according to materials returned by the diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java index 6f5cb958a..8757235a3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java @@ -53,7 +53,7 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockData(double x, double y, double z) { - return editSession.getLazyBlock(new Vector(x, y, z)).getData(); + return 0; } @Override @@ -63,7 +63,7 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockDataAbs(double x, double y, double z) { - return editSession.getLazyBlock(new Vector(x, y, z)).getData(); + return 0; } @Override @@ -73,7 +73,7 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockDataRel(double x, double y, double z) { - return editSession.getLazyBlock(new Vector(x, y, z)).getData(); + return 0; } public void setCurrentBlock(Vector current) { 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 8079bae0e..75e0765c4 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 @@ -21,9 +21,6 @@ package com.sk89q.worldedit.registry.state; import static com.google.common.base.Preconditions.checkState; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - import java.util.List; public abstract class AbstractProperty implements Property { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java index 125220020..98c62ec59 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java @@ -19,14 +19,20 @@ package com.sk89q.worldedit.scripting; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.DisallowedItemException; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.UnknownItemException; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.command.InsufficientArgumentsException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.io.file.FilenameException; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.io.File; import java.util.ArrayList; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java index fbadc0fa1..e86ae6efc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.scripting; import java.util.Map; + import javax.script.ScriptException; public interface CraftScriptEngine { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java index 7f3354bbc..79d51cefb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java @@ -19,8 +19,7 @@ package com.sk89q.worldedit.scripting; -import java.util.Map; -import javax.script.ScriptException; +import com.sk89q.worldedit.WorldEditException; import org.mozilla.javascript.Context; import org.mozilla.javascript.ImporterTopLevel; import org.mozilla.javascript.JavaScriptException; @@ -29,7 +28,9 @@ import org.mozilla.javascript.Scriptable; import org.mozilla.javascript.ScriptableObject; import org.mozilla.javascript.WrappedException; -import com.sk89q.worldedit.WorldEditException; +import java.util.Map; + +import javax.script.ScriptException; public class RhinoCraftScriptEngine implements CraftScriptEngine { private int timeLimit; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java index bf64e4e12..afab20c3a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java @@ -19,6 +19,14 @@ package com.sk89q.worldedit.scripting.java; +import com.sk89q.worldedit.scripting.RhinoContextFactory; +import org.mozilla.javascript.Context; +import org.mozilla.javascript.ImporterTopLevel; +import org.mozilla.javascript.JavaScriptException; +import org.mozilla.javascript.RhinoException; +import org.mozilla.javascript.Scriptable; +import org.mozilla.javascript.ScriptableObject; + import java.io.IOException; import java.io.Reader; @@ -30,14 +38,6 @@ import javax.script.ScriptEngineFactory; import javax.script.ScriptException; import javax.script.SimpleBindings; -import org.mozilla.javascript.Context; -import org.mozilla.javascript.ImporterTopLevel; -import org.mozilla.javascript.JavaScriptException; -import org.mozilla.javascript.RhinoException; -import org.mozilla.javascript.Scriptable; -import org.mozilla.javascript.ScriptableObject; -import com.sk89q.worldedit.scripting.RhinoContextFactory; - public class RhinoScriptEngine extends AbstractScriptEngine { private ScriptEngineFactory factory; private Context cx; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java index 89cca721e..ee312229c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.scripting.java; import java.util.ArrayList; import java.util.Collections; import java.util.List; + import javax.script.ScriptEngine; import javax.script.ScriptEngineFactory; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java index d59dc5eb0..aa9b9e5df 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.session; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; @@ -35,7 +37,6 @@ import com.sk89q.worldedit.util.concurrency.EvenMoreExecutors; import com.sk89q.worldedit.util.eventbus.Subscribe; import com.sk89q.worldedit.world.gamemode.GameModes; -import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.util.HashMap; @@ -48,7 +49,7 @@ import java.util.concurrent.Callable; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Session manager for WorldEdit. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java index b6392f093..72ae6ef2b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java @@ -19,7 +19,12 @@ package com.sk89q.worldedit.session.request; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.regions.NullRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionOperationException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java index 962ae4426..d7b2a9893 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.session.storage; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonIOException; @@ -38,8 +40,6 @@ import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Stores sessions as JSON files in a directory. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java index 9f397c127..7e9160eb0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util; -import javax.annotation.Nullable; - import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; + /** * Helper methods for enums. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java index 927692140..b44850ca7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java @@ -21,13 +21,14 @@ package com.sk89q.worldedit.util; import com.sk89q.util.StringUtil; -import javax.swing.*; -import javax.swing.filechooser.FileFilter; import java.io.File; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import javax.swing.JFileChooser; +import javax.swing.filechooser.FileFilter; + public final class FileDialogUtil { private FileDialogUtil() { } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java index 1e6fddbfa..861858aed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util; -import javax.annotation.Nullable; - import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; + public final class GuavaUtil { private GuavaUtil() {} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java index e48aa77c0..521545b37 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.util; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extent.Extent; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Represents a location in a world with has a direction. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java index 03ba6f76c..a703e6baf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java @@ -20,9 +20,9 @@ package com.sk89q.worldedit.util; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockTypes; /** * This class uses an inefficient method to figure out what block a player @@ -102,7 +102,7 @@ public class TargetBlock { boolean searchForLastBlock = true; Location lastBlock = null; while (getNextBlock() != null) { - if (world.getLazyBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) { + if (world.getBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) { if (searchForLastBlock) { lastBlock = getCurrentBlock(); if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= world.getMaxY()) { @@ -124,7 +124,7 @@ public class TargetBlock { * @return Block */ public Location getTargetBlock() { - while (getNextBlock() != null && world.getLazyBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) ; + while (getNextBlock() != null && world.getBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) ; return getCurrentBlock(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index 2b7939363..c6ab2b7db 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -24,8 +24,6 @@ import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.session.SessionManager; -import com.sk89q.worldedit.world.registry.BundledItemData; -import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import java.io.IOException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java index d3bf38793..70c233704 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.util.collection; -import java.util.List; import java.util.ArrayList; -import java.util.Map; import java.util.Iterator; +import java.util.List; import java.util.ListIterator; +import java.util.Map; import java.util.NoSuchElementException; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java index 75aea6b29..3182502f6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.util.collection; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A fast iterator for lists that uses an internal index integer * and caches the size of the list. The size of the list cannot change diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java index 568db508e..a7f1405f8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.util.command; -import javax.annotation.Nullable; import java.util.Collection; import java.util.Set; +import javax.annotation.Nullable; + /** * Executes a command based on user input. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java index f121a2fe8..0ffbc4c1e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.util.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Thrown when a command is not used properly. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java index b7b980acf..bca779d4b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.util.command; -import javax.annotation.Nullable; import java.util.Comparator; import java.util.regex.Pattern; +import javax.annotation.Nullable; + /** * Compares the primary aliases of two {@link CommandMapping} using * {@link String#compareTo(String)}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java index 2a5ee0ccf..3a4d78edf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java @@ -28,9 +28,10 @@ import com.sk89q.worldedit.util.command.parametric.BindingHelper; import com.sk89q.worldedit.util.command.parametric.BindingMatch; import com.sk89q.worldedit.util.command.parametric.ParameterException; -import javax.annotation.Nullable; import java.lang.annotation.Annotation; +import javax.annotation.Nullable; + /** * Handles basic Java types such as {@link String}s, {@link Byte}s, etc. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java index 2309adb53..479a62d6f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java @@ -25,15 +25,16 @@ import com.google.common.collect.Maps; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.util.command.argument.CommandArgs; -import com.sk89q.worldedit.util.command.composition.FlagParser.FlagData; import com.sk89q.worldedit.util.command.argument.MissingArgumentException; +import com.sk89q.worldedit.util.command.composition.FlagParser.FlagData; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import javax.annotation.Nullable; + public class FlagParser implements CommandExecutor { private final Map> flags = Maps.newHashMap(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java index 6204422b4..422cd9982 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.util.command.parametric; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.ImmutableBiMap.Builder; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; @@ -43,8 +45,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Creates commands using annotations placed on methods and individual parameters of * such methods. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java index d24ebbb8f..10932717d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java @@ -20,15 +20,30 @@ package com.sk89q.worldedit.util.command.parametric; import com.google.common.primitives.Chars; -import com.sk89q.minecraft.util.commands.*; -import com.sk89q.worldedit.util.command.*; +import com.sk89q.minecraft.util.commands.Command; +import com.sk89q.minecraft.util.commands.CommandContext; +import com.sk89q.minecraft.util.commands.CommandException; +import com.sk89q.minecraft.util.commands.CommandLocals; +import com.sk89q.minecraft.util.commands.CommandPermissions; +import com.sk89q.minecraft.util.commands.CommandPermissionsException; +import com.sk89q.minecraft.util.commands.WrappedCommandException; +import com.sk89q.worldedit.util.command.CommandCallable; +import com.sk89q.worldedit.util.command.InvalidUsageException; +import com.sk89q.worldedit.util.command.MissingParameterException; +import com.sk89q.worldedit.util.command.Parameter; +import com.sk89q.worldedit.util.command.SimpleDescription; +import com.sk89q.worldedit.util.command.UnconsumedParameterException; import com.sk89q.worldedit.util.command.binding.Switch; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Type; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * The implementation of a {@link CommandCallable} for the {@link ParametricBuilder}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/StringArgumentStack.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/StringArgumentStack.java index 7d93070fa..9d4142adc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/StringArgumentStack.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/StringArgumentStack.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.util.command.parametric; import com.sk89q.minecraft.util.commands.CommandContext; -import com.sk89q.worldedit.util.command.MissingParameterException; import com.sk89q.util.StringUtil; +import com.sk89q.worldedit.util.command.MissingParameterException; /** * A virtual scope that does not actually read from the underlying diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java index 6488af945..aaafb4dc8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util.eventbus; -import java.lang.reflect.InvocationTargetException; - import static com.google.common.base.Preconditions.checkNotNull; +import java.lang.reflect.InvocationTargetException; + /** * Event handler object for {@link EventBus} that is able to dispatch * an event. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java index 5644e2aa3..92f1cb56b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java @@ -23,7 +23,11 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.sk89q.worldedit.internal.annotation.RequiresNewerGuava; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.WeakHashMap; /** * Holds a cache of class hierarchy. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java index a0575e83f..1d825927e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util.eventbus; -import java.lang.reflect.Method; - import static com.google.common.base.Preconditions.checkNotNull; +import java.lang.reflect.Method; + /** * Invokes a {@link Method} to dispatch an event. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java index 6616ea65e..88b3222ee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.util.eventbus; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.*; -import static java.lang.annotation.RetentionPolicy.*; - /** * Used to mark methods as event handlers. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java index c6fd71ddb..e46e6a7a4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.util.formatting; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Maps; import java.util.Map; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * All supported color values for chat. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java index adfbc1ec5..00a16c24e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.util.formatting.component; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extension.platform.CommandManager; import com.sk89q.worldedit.util.command.CommandCallable; @@ -28,12 +30,10 @@ import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.PrimaryAliasComparator; import com.sk89q.worldedit.util.formatting.StyledFragment; -import javax.annotation.Nullable; import java.util.ArrayList; -import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * A box to describe usage of a command. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java index 757006d7c..086ce05e9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.util.formatting.component; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.util.formatting.ColorCodeBuilder; import com.sk89q.worldedit.util.formatting.Style; import com.sk89q.worldedit.util.formatting.StyledFragment; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Makes for a box with a border above and below. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java index 723db8123..1020d92cd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java @@ -19,12 +19,13 @@ package com.sk89q.worldedit.util.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Function; -import javax.annotation.Nullable; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Provides a Levenshtein distance between a given string and each string diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java index ff1793082..2872aa48f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.util.io; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Throwables; @@ -31,8 +33,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.ZipFile; -import static com.google.common.base.Preconditions.checkNotNull; - public final class Closer implements Closeable { private static final Logger logger = Logger.getLogger(Closer.class.getCanonicalName()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/DynamicStreamHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/DynamicStreamHandler.java index 500b77aef..0c9e89c8c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/DynamicStreamHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/DynamicStreamHandler.java @@ -19,9 +19,15 @@ package com.sk89q.worldedit.util.logging; -import javax.annotation.Nullable; import java.io.UnsupportedEncodingException; -import java.util.logging.*; +import java.util.logging.Filter; +import java.util.logging.Formatter; +import java.util.logging.Level; +import java.util.logging.LogRecord; +import java.util.logging.SimpleFormatter; +import java.util.logging.StreamHandler; + +import javax.annotation.Nullable; /** * A {@link StreamHandler} delegate that allows for the swap and disable of diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java index 05a4c8378..d48b3d89a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.util.logging; +import java.io.PrintWriter; +import java.io.StringWriter; import java.util.Date; import java.util.logging.Formatter; import java.util.logging.LogRecord; -import java.io.PrintWriter; -import java.io.StringWriter; /** * A standard logging format for WorldEdit. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index b506c20ce..d0c399c0d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -24,17 +24,15 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -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.extension.platform.Platform; import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.util.Direction; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; -import java.util.HashMap; import java.util.PriorityQueue; import javax.annotation.Nullable; @@ -65,8 +63,8 @@ public abstract class AbstractWorld implements World { @Override public Mask createLiquidMask() { return new BlockMask(this, - new BlockState(BlockTypes.LAVA, new HashMap<>()), - new BlockState(BlockTypes.WATER, new HashMap<>())); + BlockTypes.LAVA.getDefaultState().toFuzzy(), + BlockTypes.WATER.getDefaultState().toFuzzy()); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java index 4f7098f0e..328784589 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -26,16 +26,15 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.LazyBlock; -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.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.biome.BaseBiome; +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.weather.WeatherType; import java.util.Collections; @@ -125,11 +124,6 @@ public class NullWorld extends AbstractWorld { return BlockTypes.AIR.getDefaultState(); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(getBlock(position), this, position); - } - @Override public BaseBlock getFullBlock(Vector position) { return new BaseBlock(getBlock(position)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index cf5ad39f7..ed0234e6c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -26,14 +26,14 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.TreeGenerator; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.weather.WeatherType; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java index 145d891cb..45018ed41 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.world.biome; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Function; import com.sk89q.worldedit.world.registry.BiomeRegistry; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Returns the name of a biome using a given {@code BiomeRegistry}. */ 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 8828d12f2..908a2ba67 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 @@ -27,7 +27,6 @@ import com.google.common.collect.Table; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.registry.state.Property; -import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -37,7 +36,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; -import java.util.stream.Collectors; /** * An immutable class that represents the state a block can be in. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java index a78ea896f..6094ac297 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java @@ -28,10 +28,10 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.DataException; 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.registry.LegacyMapper; import com.sk89q.worldedit.world.storage.InvalidFormatException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java index ab3942463..8a581b7a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java @@ -22,9 +22,10 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BiomeData; -import javax.annotation.Nullable; import java.util.List; +import javax.annotation.Nullable; + /** * Provides information on biomes. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index df22df349..a871a2812 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockType; -import java.util.List; import java.util.Map; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index 6b1be416f..12d3ae2b1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -27,11 +27,11 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.input.ParserContext; +import com.sk89q.worldedit.util.gson.VectorAdapter; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; -import com.sk89q.worldedit.extension.input.ParserContext; -import com.sk89q.worldedit.util.gson.VectorAdapter; import java.io.IOException; import java.net.URL; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java index 8bbf7c1ff..551cbc039 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java @@ -22,10 +22,11 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BiomeData; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A biome registry that knows nothing. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java index d087b5b28..6b9cafcb5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java @@ -22,7 +22,14 @@ package com.sk89q.worldedit.world.snapshot; import com.sk89q.worldedit.world.DataException; -import com.sk89q.worldedit.world.storage.*; +import com.sk89q.worldedit.world.storage.ChunkStore; +import com.sk89q.worldedit.world.storage.FileLegacyChunkStore; +import com.sk89q.worldedit.world.storage.FileMcRegionChunkStore; +import com.sk89q.worldedit.world.storage.TrueZipLegacyChunkStore; +import com.sk89q.worldedit.world.storage.TrueZipMcRegionChunkStore; +import com.sk89q.worldedit.world.storage.ZippedLegacyChunkStore; +import com.sk89q.worldedit.world.storage.ZippedMcRegionChunkStore; + import java.io.File; import java.io.IOException; import java.util.Calendar; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java index b3d499148..0c1887e37 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.world.snapshot; -import javax.annotation.Nullable; import java.io.File; import java.util.Calendar; +import javax.annotation.Nullable; + /** * A name parser attempts to make sense of a filename for a snapshot. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java index 2add97ec8..72650a408 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java @@ -23,7 +23,6 @@ package com.sk89q.worldedit.world.snapshot; import com.sk89q.worldedit.world.storage.MissingWorldException; -import javax.annotation.Nullable; import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; @@ -31,6 +30,8 @@ import java.util.Calendar; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A repository contains zero or more snapshots. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java index 1ccfef753..d55e7815c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java @@ -31,7 +31,6 @@ import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.chunk.Chunk; import com.sk89q.worldedit.world.storage.ChunkStore; import com.sk89q.worldedit.world.storage.MissingChunkException; -import com.sk89q.worldedit.world.storage.MissingWorldException; import java.io.IOException; import java.util.ArrayList; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java index 12c8f6d63..568c4615e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.world.storage; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.NBTInputStream; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java index ad10929ae..6b61bddf9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.world.storage; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.ListTag; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Utility methods for working with NBT data used in Minecraft. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java index 30c9fa41a..967e456ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java @@ -24,11 +24,11 @@ import com.sk89q.worldedit.world.DataException; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.util.Enumeration; import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; -import java.util.Enumeration; /** * Represents the chunk store used by Minecraft alpha but zipped. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java index b6c7ff569..e8979d06c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java @@ -26,11 +26,11 @@ import com.sk89q.worldedit.world.DataException; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.util.Enumeration; import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; -import java.util.Enumeration; /** * Represents the chunk store used by Minecraft alpha but zipped. diff --git a/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java b/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java index bcdf19dd2..2b9a50013 100644 --- a/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java +++ b/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java @@ -19,6 +19,12 @@ package com.sk89q.minecraft.util.commands; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import org.junit.Before; import org.junit.Test; @@ -27,8 +33,6 @@ import java.util.HashSet; import java.util.logging.Level; import java.util.logging.Logger; -import static org.junit.Assert.*; - public class CommandContextTest { private static final Logger log = Logger.getLogger(CommandContextTest.class.getCanonicalName()); diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java index fea68dbf0..51d50f93b 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java @@ -19,8 +19,10 @@ package com.sk89q.worldedit; -import org.junit.*; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; public class VectorTest { @Test diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java index d60ed68f9..1d0456d01 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java @@ -19,17 +19,17 @@ package com.sk89q.worldedit.internal.expression; +import static java.lang.Math.atan2; +import static java.lang.Math.sin; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + import com.sk89q.worldedit.internal.expression.lexer.LexerException; import com.sk89q.worldedit.internal.expression.parser.ParserException; import com.sk89q.worldedit.internal.expression.runtime.EvaluationException; import com.sk89q.worldedit.internal.expression.runtime.ExpressionEnvironment; import org.junit.Test; -import static java.lang.Math.atan2; -import static java.lang.Math.sin; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - public class ExpressionTest { @Test public void testEvaluate() throws ExpressionException { diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java index 1acdbc892..b7944d476 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.util; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.world.World; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; - /** * Tests {@link Location}. */ diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java index 38cd3c8ca..1ad0f10ca 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java @@ -20,16 +20,17 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.util.command.CommandMapping; - -import java.util.Arrays; -import java.util.List; -import javax.annotation.Nullable; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Nullable; + public class CommandWrapper extends CommandBase { private CommandMapping command; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommonProxy.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommonProxy.java index fbb07b9d2..18a7de68f 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommonProxy.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommonProxy.java @@ -19,9 +19,8 @@ package com.sk89q.worldedit.forge; -import net.minecraftforge.fml.common.network.NetworkRegistry; - import com.sk89q.worldedit.forge.gui.GuiHandler; +import net.minecraftforge.fml.common.network.NetworkRegistry; public class CommonProxy { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java index e637138f9..96efd1fe8 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java @@ -22,10 +22,10 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BiomeData; import com.sk89q.worldedit.world.registry.BiomeRegistry; +import net.minecraft.world.biome.Biome; import java.util.ArrayList; import java.util.List; -import net.minecraft.world.biome.Biome; /** * Provides access to biome data in Forge. diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java index 5d93dc942..54e28c244 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.forge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -30,10 +32,9 @@ import com.sk89q.worldedit.world.entity.EntityTypes; import net.minecraft.entity.EntityList; import net.minecraft.nbt.NBTTagCompound; -import javax.annotation.Nullable; import java.lang.ref.WeakReference; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; class ForgeEntity implements Entity { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java index d5e543ca9..bf6a16ae2 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.forge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.metadata.EntityProperties; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -43,8 +45,6 @@ import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import static com.google.common.base.Preconditions.checkNotNull; - public class ForgeEntityProperties implements EntityProperties { private final Entity entity; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java index 15f4d6657..bc6820c0d 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java @@ -19,12 +19,11 @@ package com.sk89q.worldedit.forge; -import org.spongepowered.api.entity.living.player.Player; - import net.minecraft.command.ICommand; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.GameType; import net.minecraftforge.fml.common.FMLCommonHandler; +import org.spongepowered.api.entity.living.player.Player; public interface ForgePermissionsProvider { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index 8de41de5d..d4b906fc4 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.forge; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; @@ -30,6 +29,7 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.item.ItemTypes; import io.netty.buffer.Unpooled; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java index bbdde9048..7b8737fd8 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.world.registry.BiomeRegistry; -import com.sk89q.worldedit.world.registry.ItemRegistry; import com.sk89q.worldedit.world.registry.BundledRegistries; +import com.sk89q.worldedit.world.registry.ItemRegistry; /** * World data for the Forge platform. diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 14d6bd107..5c717c3ff 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -32,10 +32,6 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.internal.Constants; @@ -46,6 +42,9 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.weather.WeatherType; import net.minecraft.block.Block; @@ -381,11 +380,6 @@ public class ForgeWorld extends AbstractWorld { return LegacyMapper.getInstance().getBlockFromLegacy(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state)); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(getBlock(position), this, position); - } - @Override public BaseBlock getFullBlock(Vector position) { BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/InternalPacketHandler.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/InternalPacketHandler.java index 029ca2602..afac351ac 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/InternalPacketHandler.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/InternalPacketHandler.java @@ -19,14 +19,13 @@ package com.sk89q.worldedit.forge; -import java.nio.charset.Charset; - import com.sk89q.worldedit.forge.net.LeftClickAirEventMessage; - import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.relauncher.Side; +import java.nio.charset.Charset; + public class InternalPacketHandler { public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8"); public static SimpleNetworkWrapper CHANNEL; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java index a89d2edc2..76e726884 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java @@ -20,13 +20,11 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.forge.gui.GuiHandler; - import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent; - import org.lwjgl.input.Keyboard; public class KeyHandler { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/NBTConverter.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/NBTConverter.java index 1b2eb4487..aef3956f4 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/NBTConverter.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/NBTConverter.java @@ -19,11 +19,40 @@ package com.sk89q.worldedit.forge; -import com.sk89q.jnbt.*; -import net.minecraft.nbt.*; +import com.sk89q.jnbt.ByteArrayTag; +import com.sk89q.jnbt.ByteTag; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.DoubleTag; +import com.sk89q.jnbt.EndTag; +import com.sk89q.jnbt.FloatTag; +import com.sk89q.jnbt.IntArrayTag; +import com.sk89q.jnbt.IntTag; +import com.sk89q.jnbt.ListTag; +import com.sk89q.jnbt.LongTag; +import com.sk89q.jnbt.ShortTag; +import com.sk89q.jnbt.StringTag; +import com.sk89q.jnbt.Tag; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagByte; +import net.minecraft.nbt.NBTTagByteArray; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagEnd; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.nbt.NBTTagIntArray; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagLong; +import net.minecraft.nbt.NBTTagShort; +import net.minecraft.nbt.NBTTagString; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Set; /** * Converts between JNBT and Minecraft NBT classes. diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java index 77befeb4a..803407766 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java @@ -19,17 +19,18 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.Vector; +import static com.google.common.base.Preconditions.checkNotNull; -import java.lang.reflect.Constructor; -import javax.annotation.Nullable; +import com.sk89q.worldedit.Vector; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagInt; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import static com.google.common.base.Preconditions.checkNotNull; +import java.lang.reflect.Constructor; + +import javax.annotation.Nullable; /** * Utility methods for setting tile entities in the world. diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java index 01f421c59..c6cf673e4 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java @@ -20,8 +20,6 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.LocalSession; - -import java.nio.charset.Charset; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.NetHandlerPlayServer; import net.minecraft.network.PacketBuffer; @@ -33,6 +31,8 @@ import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientCustomPacketE import net.minecraftforge.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; +import java.nio.charset.Charset; + public class WECUIPacketHandler { public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8"); public static FMLEventChannel WECUI_CHANNEL; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/LeftClickAirEventMessage.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/LeftClickAirEventMessage.java index 68deef4a2..7273439a3 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/LeftClickAirEventMessage.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/LeftClickAirEventMessage.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.forge.net; import com.sk89q.worldedit.forge.ForgeWorldEdit; - import io.netty.buffer.ByteBuf; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java index 863e48e9c..7be50e8d1 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java @@ -23,7 +23,11 @@ import com.sk89q.worldedit.LocalSession; import org.spongepowered.api.Platform; import org.spongepowered.api.Sponge; import org.spongepowered.api.entity.living.player.Player; -import org.spongepowered.api.network.*; +import org.spongepowered.api.network.ChannelBinding; +import org.spongepowered.api.network.ChannelBuf; +import org.spongepowered.api.network.PlayerConnection; +import org.spongepowered.api.network.RawDataListener; +import org.spongepowered.api.network.RemoteConnection; import java.nio.charset.StandardCharsets; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeBiomeRegistry.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeBiomeRegistry.java index 606937b04..1b1955bdb 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeBiomeRegistry.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeBiomeRegistry.java @@ -25,10 +25,11 @@ import com.sk89q.worldedit.world.registry.BiomeRegistry; import org.spongepowered.api.Sponge; import org.spongepowered.api.world.biome.BiomeType; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nullable; + /** * Provides access to biome data in Sponge. */ diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java index a2a3fa138..bf1ceb7bd 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.sponge; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; @@ -30,12 +33,10 @@ import org.spongepowered.api.text.format.TextColor; import org.spongepowered.api.text.format.TextColors; import org.spongepowered.api.text.serializer.TextSerializers; -import javax.annotation.Nullable; import java.io.File; import java.util.UUID; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; public class SpongeCommandSender implements Actor { diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java index 1ec0f3a85..9aa728310 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.sponge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.flowpowered.math.vector.Vector3d; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -28,10 +30,9 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.NullWorld; import org.spongepowered.api.world.World; -import javax.annotation.Nullable; import java.lang.ref.WeakReference; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; class SpongeEntity implements Entity { diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePermissionsProvider.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePermissionsProvider.java index 6b324ce80..d9970ecb1 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePermissionsProvider.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePermissionsProvider.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.sponge; import org.spongepowered.api.Sponge; import org.spongepowered.api.command.CommandCallable; import org.spongepowered.api.entity.living.player.Player; -import org.spongepowered.api.service.context.Contextual; import org.spongepowered.api.service.permission.PermissionDescription; import org.spongepowered.api.service.permission.PermissionService; import org.spongepowered.api.service.permission.SubjectReference; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index cc79d3e5e..37774dbc8 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -23,9 +23,6 @@ import com.flowpowered.math.vector.Vector3d; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.gamemode.GameMode; -import com.sk89q.worldedit.world.gamemode.GameModes; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; @@ -33,6 +30,9 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.gamemode.GameMode; +import com.sk89q.worldedit.world.gamemode.GameModes; +import com.sk89q.worldedit.world.item.ItemTypes; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.type.HandTypes; import org.spongepowered.api.entity.living.player.Player; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java index 5987a7335..a134e1ac3 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java @@ -25,9 +25,7 @@ import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.sponge.SpongeWorld; import com.sk89q.worldedit.util.Location; -import org.spongepowered.api.block.BlockType; import org.spongepowered.api.entity.Entity; -import org.spongepowered.api.item.ItemType; import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.world.World; import org.spongepowered.api.world.biome.BiomeType; From 57eaa5f8f2fb87ec2b38ce7d7689dc67314ad406 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 30 Jul 2018 23:38:36 +1000 Subject: [PATCH 62/74] Using toBlockPoint appears to fix a fair few issues. --- worldedit-core/src/main/java/com/sk89q/worldedit/Vector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/Vector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/Vector.java index 84067738c..a47210ce6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/Vector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/Vector.java @@ -754,7 +754,8 @@ public class Vector implements Comparable { * @return a new {@code BlockVector} */ public BlockVector toBlockVector() { - return new BlockVector(this); + return toBlockPoint(); +// return new BlockVector(this); TODO Look into this further. } /** From fdb7ada29519a2a95fe3c39238aa80d9a1ab4872 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 31 Jul 2018 12:11:10 +1000 Subject: [PATCH 63/74] Added some error handling for legacy conversions of schematics. --- .../extent/clipboard/io/SchematicReader.java | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java index a1f32ee01..4e83fb301 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java @@ -43,6 +43,7 @@ import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.storage.NBTConversions; @@ -199,9 +200,11 @@ public class SchematicReader implements ClipboardReader { int index = y * width * length + z * width + x; BlockState block = LegacyMapper.getInstance().getBlockFromLegacy(blocks[index], blockData[index]); - for (NBTCompatibilityHandler handler : COMPATIBILITY_HANDLERS) { - if (handler.isAffectedBlock(block)) { - handler.updateNBT(block, values); + if (block != null) { + for (NBTCompatibilityHandler handler : COMPATIBILITY_HANDLERS) { + if (handler.isAffectedBlock(block)) { + handler.updateNBT(block, values); + } } } @@ -223,10 +226,14 @@ public class SchematicReader implements ClipboardReader { BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(blocks[index], blockData[index]); try { - if (tileEntitiesMap.containsKey(pt)) { - clipboard.setBlock(region.getMinimumPoint().add(pt), new BaseBlock(state, new CompoundTag(tileEntitiesMap.get(pt)))); + if (state != null) { + if (tileEntitiesMap.containsKey(pt)) { + clipboard.setBlock(region.getMinimumPoint().add(pt), new BaseBlock(state, new CompoundTag(tileEntitiesMap.get(pt)))); + } else { + clipboard.setBlock(region.getMinimumPoint().add(pt), state); + } } else { - clipboard.setBlock(region.getMinimumPoint().add(pt), state); + log.warning("Unknown block when pasting schematic: " + blocks[index] + ":" + blockData[index] + ". Please report this issue."); } } catch (WorldEditException e) { switch (failedBlockSets) { @@ -259,8 +266,13 @@ public class SchematicReader implements ClipboardReader { Location location = NBTConversions.toLocation(clipboard, compound.getListTag("Pos"), compound.getListTag("Rotation")); if (!id.isEmpty()) { - BaseEntity state = new BaseEntity(EntityTypes.get(id), compound); - clipboard.createEntity(location, state); + EntityType entityType = EntityTypes.get(id.toLowerCase()); + if (entityType != null) { + BaseEntity state = new BaseEntity(entityType, compound); + clipboard.createEntity(location, state); + } else { + log.warning("Unknown entity when pasting schematic: " + id.toLowerCase()); + } } } } From c05c33cab0a7ebfeaa3d76d51adc0f6201fa5371 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 31 Jul 2018 16:14:36 +1000 Subject: [PATCH 64/74] Make a lot of progress on legacy conversions. --- .../main/java/com/sk89q/util/StringUtil.java | 22 + .../extension/factory/BlockFactory.java | 4 +- .../extension/factory/DefaultBlockParser.java | 20 +- .../factory/RandomPatternParser.java | 4 +- .../world/registry/LegacyMapper.java | 41 +- .../worldedit/world/registry/legacy.json | 430 +++++++++--------- 6 files changed, 280 insertions(+), 241 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java b/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java index 90bb2f5b6..2571f71f9 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java @@ -19,7 +19,9 @@ package com.sk89q.util; +import java.util.ArrayList; import java.util.Collection; +import java.util.List; import java.util.Map; /** @@ -301,4 +303,24 @@ public final class StringUtil { return type; } + + public static List parseListInQuotes(String[] input, char delimiter, char quoteOpen, char quoteClose) { + List parsableBlocks = new ArrayList<>(); + StringBuilder buffer = new StringBuilder(); + for (String split : input) { + if (split.indexOf(quoteOpen) != -1 && split.indexOf(quoteClose) == -1) { + buffer.append(split).append(delimiter); + } else if (split.indexOf(quoteClose) != -1 && split.indexOf(quoteOpen) == -1) { + buffer.append(split); + parsableBlocks.add(buffer.toString()); + buffer = new StringBuilder(); + } else if (buffer.length() == 0) { + parsableBlocks.add(split); + } else { + buffer.append(split).append(delimiter); + } + } + + return parsableBlocks; + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java index f8c3a5e95..bc85f245a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory; +import com.sk89q.util.StringUtil; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.extension.input.InputParseException; @@ -59,7 +60,8 @@ public class BlockFactory extends AbstractFactory { */ public Set parseFromListInput(String input, ParserContext context) throws InputParseException { Set blocks = new HashSet<>(); - for (String token : input.split(",")) { + String[] splits = input.split(","); + for (String token : StringUtil.parseListInQuotes(splits, ',', '[', ']')) { blocks.add(parseFromInput(token, context)); } return blocks; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index d8865ec4a..83959d638 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -48,8 +48,6 @@ import com.sk89q.worldedit.world.registry.LegacyMapper; import java.util.HashMap; import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** * Parses block input strings. @@ -98,7 +96,6 @@ class DefaultBlockParser extends InputParser { } } - private static Pattern blockStatePattern = Pattern.compile("([a-z:_]+)(?:\\[([a-zA-Z0-9=, _]+)])?", Pattern.CASE_INSENSITIVE); private static String[] EMPTY_STRING_ARRAY = new String[]{}; /** @@ -210,14 +207,21 @@ class DefaultBlockParser extends InputParser { } if (state == null) { - Matcher matcher = blockStatePattern.matcher(blockAndExtraData[0]); // TODO Move away from regex because it's hella slow - if (!matcher.matches() || matcher.groupCount() < 2 || matcher.groupCount() > 3) { + String typeString; + String stateString = null; + int stateStart = blockAndExtraData[0].indexOf('['); + if (stateStart == -1) { + typeString = blockAndExtraData[0]; + } else { + typeString = blockAndExtraData[0].substring(0, stateStart); + stateString = blockAndExtraData[0].substring(stateStart + 1, blockAndExtraData[0].length() - 1); + } + if (typeString == null || typeString.isEmpty()) { throw new InputParseException("Invalid format"); } - String typeString = matcher.group(1); String[] stateProperties = EMPTY_STRING_ARRAY; - if (matcher.groupCount() >= 2 && matcher.group(2) != null) { - stateProperties = matcher.group(2).split(","); + if (stateString != null) { + stateProperties = stateString.split(","); } if ("hand".equalsIgnoreCase(typeString)) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java index 45373ec26..010a6f01f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory; +import com.sk89q.util.StringUtil; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; @@ -39,7 +40,8 @@ class RandomPatternParser extends InputParser { BlockFactory blockRegistry = worldEdit.getBlockFactory(); RandomPattern randomPattern = new RandomPattern(); - for (String token : input.split(",")) { + String[] splits = input.split(","); + for (String token : StringUtil.parseListInQuotes(splits, ',', '[', ']')) { BlockStateHolder block; double chance; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index 12d3ae2b1..78bc48131 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.world.registry; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; import com.google.common.io.Resources; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -48,8 +48,10 @@ public class LegacyMapper { private static final Logger log = Logger.getLogger(LegacyMapper.class.getCanonicalName()); private static LegacyMapper INSTANCE; - private BiMap blockMap = HashBiMap.create(); - private BiMap itemMap = HashBiMap.create(); + private Multimap stringToBlockMap = HashMultimap.create(); + private Multimap blockToStringMap = HashMultimap.create(); + private Multimap stringToItemMap = HashMultimap.create(); + private Multimap itemToStringMap = HashMultimap.create(); /** * Create a new instance. @@ -85,58 +87,63 @@ public class LegacyMapper { for (Map.Entry blockEntry : dataFile.blocks.entrySet()) { try { - blockMap.put(blockEntry.getKey(), - (BlockState) WorldEdit.getInstance().getBlockFactory().parseFromInput(blockEntry.getValue(), parserContext)); + String id = blockEntry.getKey(); + BlockState state = WorldEdit.getInstance().getBlockFactory().parseFromInput(blockEntry.getValue(), parserContext).toImmutableState(); + blockToStringMap.put(state, id); + stringToBlockMap.put(id, state); } catch (Exception e) { - log.fine("Unknown block: " + blockEntry.getValue()); + log.warning("Unknown block: " + blockEntry.getValue()); } } for (Map.Entry itemEntry : dataFile.items.entrySet()) { try { - itemMap.put(itemEntry.getKey(), ItemTypes.get(itemEntry.getValue())); + String id = itemEntry.getKey(); + ItemType type = ItemTypes.get(itemEntry.getValue()); + itemToStringMap.put(type, id); + stringToItemMap.put(id, type); } catch (Exception e) { - log.fine("Unknown item: " + itemEntry.getValue()); + log.warning("Unknown item: " + itemEntry.getValue()); } } } @Nullable public ItemType getItemFromLegacy(int legacyId) { - return itemMap.get(legacyId + ":0"); + return getItemFromLegacy(legacyId, 0); } @Nullable public ItemType getItemFromLegacy(int legacyId, int data) { - return itemMap.get(legacyId + ":" + data); + return stringToItemMap.get(legacyId + ":" + data).stream().findFirst().orElse(null); } @Nullable public int[] getLegacyFromItem(ItemType itemType) { - if (!itemMap.inverse().containsKey(itemType)) { + if (!itemToStringMap.containsKey(itemType)) { return null; } else { - String value = itemMap.inverse().get(itemType); + String value = itemToStringMap.get(itemType).stream().findFirst().get(); return Arrays.stream(value.split(":")).mapToInt(Integer::parseInt).toArray(); } } @Nullable public BlockState getBlockFromLegacy(int legacyId) { - return blockMap.get(legacyId + ":0"); + return getBlockFromLegacy(legacyId, 0); } @Nullable public BlockState getBlockFromLegacy(int legacyId, int data) { - return blockMap.get(legacyId + ":" + data); + return stringToBlockMap.get(legacyId + ":" + data).stream().findFirst().orElse(null); } @Nullable public int[] getLegacyFromBlock(BlockState blockState) { - if (!blockMap.inverse().containsKey(blockState)) { + if (!blockToStringMap.containsKey(blockState)) { return null; } else { - String value = blockMap.inverse().get(blockState); + String value = blockToStringMap.get(blockState).stream().findFirst().get(); return Arrays.stream(value.split(":")).mapToInt(Integer::parseInt).toArray(); } } diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json index ac0766b63..b31e89925 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json @@ -114,26 +114,26 @@ "17:9": "minecraft:spruce_log[axis=z]", "17:10": "minecraft:birch_log[axis=z]", "17:11": "minecraft:jungle_log[axis=z]", - "17:12": "minecraft:oak_log[axis=none]", - "17:13": "minecraft:spruce_log[axis=none]", - "17:14": "minecraft:birch_log[axis=none]", - "17:15": "minecraft:jungle_log[axis=none]", - "18:0": "minecraft:oak_leaves[check_decay=false,decayable=true]", - "18:1": "minecraft:spruce_leaves[check_decay=false,decayable=true]", - "18:2": "minecraft:birch_leaves[check_decay=false,decayable=true]", - "18:3": "minecraft:jungle_leaves[check_decay=false,decayable=true]", - "18:4": "minecraft:oak_leaves[check_decay=false,decayable=false]", - "18:5": "minecraft:spruce_leaves[check_decay=false,decayable=false]", - "18:6": "minecraft:birch_leaves[check_decay=false,decayable=false]", - "18:7": "minecraft:jungle_leaves[check_decay=false,decayable=false]", - "18:8": "minecraft:oak_leaves[check_decay=true,decayable=true]", - "18:9": "minecraft:spruce_leaves[check_decay=true,decayable=true]", - "18:10": "minecraft:birch_leaves[check_decay=true,decayable=true]", - "18:11": "minecraft:jungle_leaves[check_decay=true,decayable=true]", - "18:12": "minecraft:oak_leaves[check_decay=true,decayable=false]", - "18:13": "minecraft:spruce_leaves[check_decay=true,decayable=false]", - "18:14": "minecraft:birch_leaves[check_decay=true,decayable=false]", - "18:15": "minecraft:jungle_leaves[check_decay=true,decayable=false]", + "17:12": "minecraft:oak_wood", + "17:13": "minecraft:spruce_wood", + "17:14": "minecraft:birch_wood", + "17:15": "minecraft:jungle_wood", + "18:0": "minecraft:oak_leaves[persistent=false,distance=1]", + "18:1": "minecraft:spruce_leaves[persistent=false,distance=1]", + "18:2": "minecraft:birch_leaves[persistent=false,distance=1]", + "18:3": "minecraft:jungle_leaves[persistent=false,distance=1]", + "18:4": "minecraft:oak_leaves[persistent=true,distance=1]", + "18:5": "minecraft:spruce_leaves[persistent=true,distance=1]", + "18:6": "minecraft:birch_leaves[persistent=true,distance=1]", + "18:7": "minecraft:jungle_leaves[persistent=true,distance=1]", + "18:8": "minecraft:oak_leaves[persistent=false,distance=1]", + "18:9": "minecraft:spruce_leaves[persistent=false,distance=1]", + "18:10": "minecraft:birch_leaves[persistent=false,distance=1]", + "18:11": "minecraft:jungle_leaves[persistent=false,distance=1]", + "18:12": "minecraft:oak_leaves[persistent=true,distance=1]", + "18:13": "minecraft:spruce_leaves[persistent=true,distance=1]", + "18:14": "minecraft:birch_leaves[persistent=true,distance=1]", + "18:15": "minecraft:jungle_leaves[persistent=true,distance=1]", "19:0": "minecraft:sponge", "19:1": "minecraft:wet_sponge", "20:0": "minecraft:glass", @@ -171,18 +171,18 @@ "26:13": "minecraft:red_bed[part=head,facing=west,occupied=true]", "26:14": "minecraft:red_bed[part=head,facing=north,occupied=true]", "26:15": "minecraft:red_bed[part=head,facing=east,occupied=true]", - "27:0": "minecraft:golden_rail[shape=north_south,powered=false]", - "27:1": "minecraft:golden_rail[shape=east_west,powered=false]", - "27:2": "minecraft:golden_rail[shape=ascending_east,powered=false]", - "27:3": "minecraft:golden_rail[shape=ascending_west,powered=false]", - "27:4": "minecraft:golden_rail[shape=ascending_north,powered=false]", - "27:5": "minecraft:golden_rail[shape=ascending_south,powered=false]", - "27:8": "minecraft:golden_rail[shape=north_south,powered=true]", - "27:9": "minecraft:golden_rail[shape=east_west,powered=true]", - "27:10": "minecraft:golden_rail[shape=ascending_east,powered=true]", - "27:11": "minecraft:golden_rail[shape=ascending_west,powered=true]", - "27:12": "minecraft:golden_rail[shape=ascending_north,powered=true]", - "27:13": "minecraft:golden_rail[shape=ascending_south,powered=true]", + "27:0": "minecraft:powered_rail[shape=north_south,powered=false]", + "27:1": "minecraft:powered_rail[shape=east_west,powered=false]", + "27:2": "minecraft:powered_rail[shape=ascending_east,powered=false]", + "27:3": "minecraft:powered_rail[shape=ascending_west,powered=false]", + "27:4": "minecraft:powered_rail[shape=ascending_north,powered=false]", + "27:5": "minecraft:powered_rail[shape=ascending_south,powered=false]", + "27:8": "minecraft:powered_rail[shape=north_south,powered=true]", + "27:9": "minecraft:powered_rail[shape=east_west,powered=true]", + "27:10": "minecraft:powered_rail[shape=ascending_east,powered=true]", + "27:11": "minecraft:powered_rail[shape=ascending_west,powered=true]", + "27:12": "minecraft:powered_rail[shape=ascending_north,powered=true]", + "27:13": "minecraft:powered_rail[shape=ascending_south,powered=true]", "28:0": "minecraft:detector_rail[shape=north_south,powered=false]", "28:1": "minecraft:detector_rail[shape=east_west,powered=false]", "28:2": "minecraft:detector_rail[shape=ascending_east,powered=false]", @@ -239,7 +239,7 @@ "35:0": "minecraft:white_wool", "35:1": "minecraft:orange_wool", "35:2": "minecraft:magenta_wool", - "35:3": "minecraft:wool[color=lightblue]", + "35:3": "minecraft:light_blue_wool", "35:4": "minecraft:yellow_wool", "35:5": "minecraft:lime_wool", "35:6": "minecraft:pink_wool", @@ -311,8 +311,8 @@ "44:14": "minecraft:nether_brick_slab[type=top]", "44:15": "minecraft:quartz_slab[type=top]", "45:0": "minecraft:bricks", - "46:0": "minecraft:tnt[explode=false]", - "46:1": "minecraft:tnt[explode=true]", + "46:0": "minecraft:tnt[unstable=false]", + "46:1": "minecraft:tnt[unstable=true]", "47:0": "minecraft:bookshelf", "48:0": "minecraft:mossy_cobblestone", "49:0": "minecraft:obsidian", @@ -556,8 +556,8 @@ "87:0": "minecraft:netherrack", "88:0": "minecraft:soul_sand", "89:0": "minecraft:glowstone", - "90:1": "minecraft:portal[axis=x]", - "90:2": "minecraft:portal[axis=z]", + "90:1": "minecraft:nether_portal[axis=x]", + "90:2": "minecraft:nether_portal[axis=z]", "91:0": "minecraft:jack_o_lantern[facing=south]", "91:1": "minecraft:jack_o_lantern[facing=west]", "91:2": "minecraft:jack_o_lantern[facing=north]", @@ -569,42 +569,42 @@ "92:4": "minecraft:cake[bites=4]", "92:5": "minecraft:cake[bites=5]", "92:6": "minecraft:cake[bites=6]", - "93:0": "minecraft:unpowered_repeater[delay=1,facing=south,locked=false]", - "93:1": "minecraft:unpowered_repeater[delay=1,facing=west,locked=false]", - "93:2": "minecraft:unpowered_repeater[delay=1,facing=north,locked=false]", - "93:3": "minecraft:unpowered_repeater[delay=1,facing=east,locked=false]", - "93:4": "minecraft:unpowered_repeater[delay=2,facing=south,locked=false]", - "93:5": "minecraft:unpowered_repeater[delay=2,facing=west,locked=false]", - "93:6": "minecraft:unpowered_repeater[delay=2,facing=north,locked=false]", - "93:7": "minecraft:unpowered_repeater[delay=2,facing=east,locked=false]", - "93:8": "minecraft:unpowered_repeater[delay=3,facing=south,locked=false]", - "93:9": "minecraft:unpowered_repeater[delay=3,facing=west,locked=false]", - "93:10": "minecraft:unpowered_repeater[delay=3,facing=north,locked=false]", - "93:11": "minecraft:unpowered_repeater[delay=3,facing=east,locked=false]", - "93:12": "minecraft:unpowered_repeater[delay=4,facing=south,locked=false]", - "93:13": "minecraft:unpowered_repeater[delay=4,facing=west,locked=false]", - "93:14": "minecraft:unpowered_repeater[delay=4,facing=north,locked=false]", - "93:15": "minecraft:unpowered_repeater[delay=4,facing=east,locked=false]", - "94:0": "minecraft:powered_repeater[delay=1,facing=south,locked=false]", - "94:1": "minecraft:powered_repeater[delay=1,facing=west,locked=false]", - "94:2": "minecraft:powered_repeater[delay=1,facing=north,locked=false]", - "94:3": "minecraft:powered_repeater[delay=1,facing=east,locked=false]", - "94:4": "minecraft:powered_repeater[delay=2,facing=south,locked=false]", - "94:5": "minecraft:powered_repeater[delay=2,facing=west,locked=false]", - "94:6": "minecraft:powered_repeater[delay=2,facing=north,locked=false]", - "94:7": "minecraft:powered_repeater[delay=2,facing=east,locked=false]", - "94:8": "minecraft:powered_repeater[delay=3,facing=south,locked=false]", - "94:9": "minecraft:powered_repeater[delay=3,facing=west,locked=false]", - "94:10": "minecraft:powered_repeater[delay=3,facing=north,locked=false]", - "94:11": "minecraft:powered_repeater[delay=3,facing=east,locked=false]", - "94:12": "minecraft:powered_repeater[delay=4,facing=south,locked=false]", - "94:13": "minecraft:powered_repeater[delay=4,facing=west,locked=false]", - "94:14": "minecraft:powered_repeater[delay=4,facing=north,locked=false]", - "94:15": "minecraft:powered_repeater[delay=4,facing=east,locked=false]", + "93:0": "minecraft:repeater[delay=1,facing=south,locked=false,powered=false]", + "93:1": "minecraft:repeater[delay=1,facing=west,locked=false,powered=false]", + "93:2": "minecraft:repeater[delay=1,facing=north,locked=false,powered=false]", + "93:3": "minecraft:repeater[delay=1,facing=east,locked=false,powered=false]", + "93:4": "minecraft:repeater[delay=2,facing=south,locked=false,powered=false]", + "93:5": "minecraft:repeater[delay=2,facing=west,locked=false,powered=false]", + "93:6": "minecraft:repeater[delay=2,facing=north,locked=false,powered=false]", + "93:7": "minecraft:repeater[delay=2,facing=east,locked=false,powered=false]", + "93:8": "minecraft:repeater[delay=3,facing=south,locked=false,powered=false]", + "93:9": "minecraft:repeater[delay=3,facing=west,locked=false,powered=false]", + "93:10": "minecraft:repeater[delay=3,facing=north,locked=false,powered=false]", + "93:11": "minecraft:repeater[delay=3,facing=east,locked=false,powered=false]", + "93:12": "minecraft:repeater[delay=4,facing=south,locked=false,powered=false]", + "93:13": "minecraft:repeater[delay=4,facing=west,locked=false,powered=false]", + "93:14": "minecraft:repeater[delay=4,facing=north,locked=false,powered=false]", + "93:15": "minecraft:repeater[delay=4,facing=east,locked=false,powered=false]", + "94:0": "minecraft:repeater[delay=1,facing=south,locked=false,powered=true]", + "94:1": "minecraft:repeater[delay=1,facing=west,locked=false,powered=true]", + "94:2": "minecraft:repeater[delay=1,facing=north,locked=false,powered=true]", + "94:3": "minecraft:repeater[delay=1,facing=east,locked=false,powered=true]", + "94:4": "minecraft:repeater[delay=2,facing=south,locked=false,powered=true]", + "94:5": "minecraft:repeater[delay=2,facing=west,locked=false,powered=true]", + "94:6": "minecraft:repeater[delay=2,facing=north,locked=false,powered=true]", + "94:7": "minecraft:repeater[delay=2,facing=east,locked=false,powered=true]", + "94:8": "minecraft:repeater[delay=3,facing=south,locked=false,powered=true]", + "94:9": "minecraft:repeater[delay=3,facing=west,locked=false,powered=true]", + "94:10": "minecraft:repeater[delay=3,facing=north,locked=false,powered=true]", + "94:11": "minecraft:repeater[delay=3,facing=east,locked=false,powered=true]", + "94:12": "minecraft:repeater[delay=4,facing=south,locked=false,powered=true]", + "94:13": "minecraft:repeater[delay=4,facing=west,locked=false,powered=true]", + "94:14": "minecraft:repeater[delay=4,facing=north,locked=false,powered=true]", + "94:15": "minecraft:repeater[delay=4,facing=east,locked=false,powered=true]", "95:0": "minecraft:white_stained_glass", "95:1": "minecraft:orange_stained_glass", "95:2": "minecraft:magenta_stained_glass", - "95:3": "minecraft:stained_glass[color=lightblue]", + "95:3": "minecraft:light_blue_stained_glass", "95:4": "minecraft:yellow_stained_glass", "95:5": "minecraft:lime_stained_glass", "95:6": "minecraft:pink_stained_glass", @@ -671,23 +671,23 @@ "100:15": "minecraft:mushroom_stem[north=true,east=true,south=true,west=true,up=true,down=true]", "101:0": "minecraft:iron_bars[east=false,south=false,north=false,west=false]", "102:0": "minecraft:glass_pane[east=false,south=false,north=false,west=false]", - "103:0": "minecraft:melon_block", - "104:0": "minecraft:pumpkin_stem[facing=east,age=0]", - "104:1": "minecraft:pumpkin_stem[facing=east,age=1]", - "104:2": "minecraft:pumpkin_stem[facing=east,age=2]", - "104:3": "minecraft:pumpkin_stem[facing=east,age=3]", - "104:4": "minecraft:pumpkin_stem[facing=east,age=4]", - "104:5": "minecraft:pumpkin_stem[facing=east,age=5]", - "104:6": "minecraft:pumpkin_stem[facing=east,age=6]", - "104:7": "minecraft:pumpkin_stem[facing=east,age=7]", - "105:0": "minecraft:melon_stem[facing=east,age=0]", - "105:1": "minecraft:melon_stem[facing=east,age=1]", - "105:2": "minecraft:melon_stem[facing=east,age=2]", - "105:3": "minecraft:melon_stem[facing=east,age=3]", - "105:4": "minecraft:melon_stem[facing=east,age=4]", - "105:5": "minecraft:melon_stem[facing=east,age=5]", - "105:6": "minecraft:melon_stem[facing=east,age=6]", - "105:7": "minecraft:melon_stem[facing=east,age=7]", + "103:0": "minecraft:melon", + "104:0": "minecraft:pumpkin_stem[age=0]", + "104:1": "minecraft:pumpkin_stem[age=1]", + "104:2": "minecraft:pumpkin_stem[age=2]", + "104:3": "minecraft:pumpkin_stem[age=3]", + "104:4": "minecraft:pumpkin_stem[age=4]", + "104:5": "minecraft:pumpkin_stem[age=5]", + "104:6": "minecraft:pumpkin_stem[age=6]", + "104:7": "minecraft:pumpkin_stem[age=7]", + "105:0": "minecraft:melon_stem[age=0]", + "105:1": "minecraft:melon_stem[age=1]", + "105:2": "minecraft:melon_stem[age=2]", + "105:3": "minecraft:melon_stem[age=3]", + "105:4": "minecraft:melon_stem[age=4]", + "105:5": "minecraft:melon_stem[age=5]", + "105:6": "minecraft:melon_stem[age=6]", + "105:7": "minecraft:melon_stem[age=7]", "106:0": "minecraft:vine[east=false,south=false,north=false,west=false,up=false]", "106:1": "minecraft:vine[east=false,south=true,north=false,west=false,up=false]", "106:2": "minecraft:vine[east=false,south=false,north=false,west=true,up=false]", @@ -885,22 +885,22 @@ "138:0": "minecraft:beacon", "139:0": "minecraft:cobblestone_wall[east=false,south=false,north=false,west=false,variant=cobblestone,up=false]", "139:1": "minecraft:cobblestone_wall[east=false,south=false,north=false,west=false,variant=mossy_cobblestone,up=false]", - "140:0": "minecraft:flower_pot[contents=cactus,legacy_data=0]", - "140:1": "minecraft:flower_pot[contents=cactus,legacy_data=1]", - "140:2": "minecraft:flower_pot[contents=cactus,legacy_data=2]", - "140:3": "minecraft:flower_pot[contents=cactus,legacy_data=3]", - "140:4": "minecraft:flower_pot[contents=cactus,legacy_data=4]", - "140:5": "minecraft:flower_pot[contents=cactus,legacy_data=5]", - "140:6": "minecraft:flower_pot[contents=cactus,legacy_data=6]", - "140:7": "minecraft:flower_pot[contents=cactus,legacy_data=7]", - "140:8": "minecraft:flower_pot[contents=cactus,legacy_data=8]", - "140:9": "minecraft:flower_pot[contents=cactus,legacy_data=9]", - "140:10": "minecraft:flower_pot[contents=cactus,legacy_data=10]", - "140:11": "minecraft:flower_pot[contents=cactus,legacy_data=11]", - "140:12": "minecraft:flower_pot[contents=cactus,legacy_data=12]", - "140:13": "minecraft:flower_pot[contents=cactus,legacy_data=13]", - "140:14": "minecraft:flower_pot[contents=cactus,legacy_data=14]", - "140:15": "minecraft:flower_pot[contents=cactus,legacy_data=15]", + "140:0": "minecraft:flower_pot", + "140:1": "minecraft:potted_poppy", + "140:2": "minecraft:potted_dandelion", + "140:3": "minecraft:potted_oak_sapling", + "140:4": "minecraft:potted_spruce_sapling", + "140:5": "minecraft:potted_birch_sapling", + "140:6": "minecraft:potted_jungle_sapling", + "140:7": "minecraft:potted_red_mushroom", + "140:8": "minecraft:potted_brown_mushroom", + "140:9": "minecraft:potted_cactus", + "140:10": "minecraft:potted_dead_bush", + "140:11": "minecraft:potted_fern", + "140:12": "minecraft:potted_acacia_sapling", + "140:13": "minecraft:potted_dark_oak_sapling", + "140:14": "minecraft:potted_blue_orchid", + "140:15": "minecraft:potted_allium", "141:0": "minecraft:carrots[age=0]", "141:1": "minecraft:carrots[age=1]", "141:2": "minecraft:carrots[age=2]", @@ -917,30 +917,30 @@ "142:5": "minecraft:potatoes[age=5]", "142:6": "minecraft:potatoes[age=6]", "142:7": "minecraft:potatoes[age=7]", - "143:0": "minecraft:wooden_button[powered=false,facing=down]", - "143:1": "minecraft:wooden_button[powered=false,facing=east]", - "143:2": "minecraft:wooden_button[powered=false,facing=west]", - "143:3": "minecraft:wooden_button[powered=false,facing=south]", - "143:4": "minecraft:wooden_button[powered=false,facing=north]", - "143:5": "minecraft:wooden_button[powered=false,facing=up]", - "143:8": "minecraft:wooden_button[powered=true,facing=down]", - "143:9": "minecraft:wooden_button[powered=true,facing=east]", - "143:10": "minecraft:wooden_button[powered=true,facing=west]", - "143:11": "minecraft:wooden_button[powered=true,facing=south]", - "143:12": "minecraft:wooden_button[powered=true,facing=north]", - "143:13": "minecraft:wooden_button[powered=true,facing=up]", - "144:0": "minecraft:skull[nodrop=false,facing=down]", - "144:1": "minecraft:skull[nodrop=false,facing=up]", - "144:2": "minecraft:skull[nodrop=false,facing=north]", - "144:3": "minecraft:skull[nodrop=false,facing=south]", - "144:4": "minecraft:skull[nodrop=false,facing=west]", - "144:5": "minecraft:skull[nodrop=false,facing=east]", - "144:8": "minecraft:skull[nodrop=true,facing=down]", - "144:9": "minecraft:skull[nodrop=true,facing=up]", - "144:10": "minecraft:skull[nodrop=true,facing=north]", - "144:11": "minecraft:skull[nodrop=true,facing=south]", - "144:12": "minecraft:skull[nodrop=true,facing=west]", - "144:13": "minecraft:skull[nodrop=true,facing=east]", + "143:0": "minecraft:oak_button[powered=false,facing=down,face=ceiling]", + "143:1": "minecraft:oak_button[powered=false,facing=east,face=wall]", + "143:2": "minecraft:oak_button[powered=false,facing=west,face=wall]", + "143:3": "minecraft:oak_button[powered=false,facing=south,face=wall]", + "143:4": "minecraft:oak_button[powered=false,facing=north,face=wall]", + "143:5": "minecraft:oak_button[powered=false,facing=up,face=floor]", + "143:8": "minecraft:oak_button[powered=true,facing=down,face=ceiling]", + "143:9": "minecraft:oak_button[powered=true,facing=east,face=wall]", + "143:10": "minecraft:oak_button[powered=true,facing=west,face=wall]", + "143:11": "minecraft:oak_button[powered=true,facing=south,face=wall]", + "143:12": "minecraft:oak_button[powered=true,facing=north,face=wall]", + "143:13": "minecraft:oak_button[powered=true,facing=up,face=floor]", + "144:0": "minecraft:skeleton_skull[rotation=0]", + "144:1": "minecraft:skeleton_skull[rotation=4]", + "144:2": "minecraft:skeleton_wall_skull[facing=north]", + "144:3": "minecraft:skeleton_wall_skull[facing=south]", + "144:4": "minecraft:skeleton_wall_skull[facing=west]", + "144:5": "minecraft:skeleton_wall_skull[facing=east]", + "144:8": "minecraft:skeleton_skull[rotation=8]", + "144:9": "minecraft:skeleton_skull[rotation=12]", + "144:10": "minecraft:skeleton_wall_skull[facing=north]", + "144:11": "minecraft:skeleton_wall_skull[facing=south]", + "144:12": "minecraft:skeleton_wall_skull[facing=west]", + "144:13": "minecraft:skeleton_wall_skull[facing=east]", "145:0": "minecraft:anvil[facing=south]", "145:1": "minecraft:anvil[facing=west]", "145:2": "minecraft:anvil[facing=north]", @@ -989,38 +989,38 @@ "148:13": "minecraft:heavy_weighted_pressure_plate[power=13]", "148:14": "minecraft:heavy_weighted_pressure_plate[power=14]", "148:15": "minecraft:heavy_weighted_pressure_plate[power=15]", - "149:0": "minecraft:unpowered_comparator[mode=compare,powered=false,facing=south]", - "149:1": "minecraft:unpowered_comparator[mode=compare,powered=false,facing=west]", - "149:2": "minecraft:unpowered_comparator[mode=compare,powered=false,facing=north]", - "149:3": "minecraft:unpowered_comparator[mode=compare,powered=false,facing=east]", - "149:4": "minecraft:unpowered_comparator[mode=subtract,powered=false,facing=south]", - "149:5": "minecraft:unpowered_comparator[mode=subtract,powered=false,facing=west]", - "149:6": "minecraft:unpowered_comparator[mode=subtract,powered=false,facing=north]", - "149:7": "minecraft:unpowered_comparator[mode=subtract,powered=false,facing=east]", - "149:8": "minecraft:unpowered_comparator[mode=compare,powered=true,facing=south]", - "149:9": "minecraft:unpowered_comparator[mode=compare,powered=true,facing=west]", - "149:10": "minecraft:unpowered_comparator[mode=compare,powered=true,facing=north]", - "149:11": "minecraft:unpowered_comparator[mode=compare,powered=true,facing=east]", - "149:12": "minecraft:unpowered_comparator[mode=subtract,powered=true,facing=south]", - "149:13": "minecraft:unpowered_comparator[mode=subtract,powered=true,facing=west]", - "149:14": "minecraft:unpowered_comparator[mode=subtract,powered=true,facing=north]", - "149:15": "minecraft:unpowered_comparator[mode=subtract,powered=true,facing=east]", - "150:0": "minecraft:powered_comparator[mode=compare,powered=false,facing=south]", - "150:1": "minecraft:powered_comparator[mode=compare,powered=false,facing=west]", - "150:2": "minecraft:powered_comparator[mode=compare,powered=false,facing=north]", - "150:3": "minecraft:powered_comparator[mode=compare,powered=false,facing=east]", - "150:4": "minecraft:powered_comparator[mode=subtract,powered=false,facing=south]", - "150:5": "minecraft:powered_comparator[mode=subtract,powered=false,facing=west]", - "150:6": "minecraft:powered_comparator[mode=subtract,powered=false,facing=north]", - "150:7": "minecraft:powered_comparator[mode=subtract,powered=false,facing=east]", - "150:8": "minecraft:powered_comparator[mode=compare,powered=true,facing=south]", - "150:9": "minecraft:powered_comparator[mode=compare,powered=true,facing=west]", - "150:10": "minecraft:powered_comparator[mode=compare,powered=true,facing=north]", - "150:11": "minecraft:powered_comparator[mode=compare,powered=true,facing=east]", - "150:12": "minecraft:powered_comparator[mode=subtract,powered=true,facing=south]", - "150:13": "minecraft:powered_comparator[mode=subtract,powered=true,facing=west]", - "150:14": "minecraft:powered_comparator[mode=subtract,powered=true,facing=north]", - "150:15": "minecraft:powered_comparator[mode=subtract,powered=true,facing=east]", + "149:0": "minecraft:comparator[mode=compare,powered=false,facing=south]", + "149:1": "minecraft:comparator[mode=compare,powered=false,facing=west]", + "149:2": "minecraft:comparator[mode=compare,powered=false,facing=north]", + "149:3": "minecraft:comparator[mode=compare,powered=false,facing=east]", + "149:4": "minecraft:comparator[mode=subtract,powered=false,facing=south]", + "149:5": "minecraft:comparator[mode=subtract,powered=false,facing=west]", + "149:6": "minecraft:comparator[mode=subtract,powered=false,facing=north]", + "149:7": "minecraft:comparator[mode=subtract,powered=false,facing=east]", + "149:8": "minecraft:comparator[mode=compare,powered=false,facing=south]", + "149:9": "minecraft:comparator[mode=compare,powered=false,facing=west]", + "149:10": "minecraft:comparator[mode=compare,powered=false,facing=north]", + "149:11": "minecraft:comparator[mode=compare,powered=false,facing=east]", + "149:12": "minecraft:comparator[mode=subtract,powered=false,facing=south]", + "149:13": "minecraft:comparator[mode=subtract,powered=false,facing=west]", + "149:14": "minecraft:comparator[mode=subtract,powered=false,facing=north]", + "149:15": "minecraft:comparator[mode=subtract,powered=false,facing=east]", + "150:0": "minecraft:comparator[mode=compare,powered=true,facing=south]", + "150:1": "minecraft:comparator[mode=compare,powered=true,facing=west]", + "150:2": "minecraft:comparator[mode=compare,powered=true,facing=north]", + "150:3": "minecraft:comparator[mode=compare,powered=true,facing=east]", + "150:4": "minecraft:comparator[mode=subtract,powered=true,facing=south]", + "150:5": "minecraft:comparator[mode=subtract,powered=true,facing=west]", + "150:6": "minecraft:comparator[mode=subtract,powered=true,facing=north]", + "150:7": "minecraft:comparator[mode=subtract,powered=true,facing=east]", + "150:8": "minecraft:comparator[mode=compare,powered=true,facing=south]", + "150:9": "minecraft:comparator[mode=compare,powered=true,facing=west]", + "150:10": "minecraft:comparator[mode=compare,powered=true,facing=north]", + "150:11": "minecraft:comparator[mode=compare,powered=true,facing=east]", + "150:12": "minecraft:comparator[mode=subtract,powered=true,facing=south]", + "150:13": "minecraft:comparator[mode=subtract,powered=true,facing=west]", + "150:14": "minecraft:comparator[mode=subtract,powered=true,facing=north]", + "150:15": "minecraft:comparator[mode=subtract,powered=true,facing=east]", "151:0": "minecraft:daylight_detector[inverted=false,power=0]", "151:1": "minecraft:daylight_detector[inverted=false,power=1]", "151:2": "minecraft:daylight_detector[inverted=false,power=2]", @@ -1051,9 +1051,9 @@ "154:13": "minecraft:hopper[facing=east,enabled=false]", "155:0": "minecraft:quartz_block", "155:1": "minecraft:chiseled_quartz_block", - "155:2": "minecraft:quartz_block[variant=lines]", - "155:3": "minecraft:quartz_block[variant=lines]", - "155:4": "minecraft:quartz_block[variant=lines]", + "155:2": "minecraft:quartz_pillar[axis=y]", + "155:6": "minecraft:quartz_pillar[axis=x]", + "155:10": "minecraft:quartz_pillar[axis=z]", "156:0": "minecraft:quartz_stairs[half=bottom,shape=outer_right,facing=east]", "156:1": "minecraft:quartz_stairs[half=bottom,shape=outer_right,facing=west]", "156:2": "minecraft:quartz_stairs[half=bottom,shape=outer_right,facing=south]", @@ -1089,7 +1089,7 @@ "159:0": "minecraft:white_terracotta", "159:1": "minecraft:orange_terracotta", "159:2": "minecraft:magenta_terracotta", - "159:3": "minecraft:stained_hardened_clay[color=lightblue]", + "159:3": "minecraft:light_blue_terracotta", "159:4": "minecraft:yellow_terracotta", "159:5": "minecraft:lime_terracotta", "159:6": "minecraft:pink_terracotta", @@ -1102,38 +1102,38 @@ "159:13": "minecraft:green_terracotta", "159:14": "minecraft:red_terracotta", "159:15": "minecraft:black_terracotta", - "160:0": "minecraft:stained_glass_pane[east=false,color=white,south=false,north=false,west=false]", - "160:1": "minecraft:stained_glass_pane[east=false,color=orange,south=false,north=false,west=false]", - "160:2": "minecraft:stained_glass_pane[east=false,color=magenta,south=false,north=false,west=false]", - "160:3": "minecraft:stained_glass_pane[east=false,color=lightblue,south=false,north=false,west=false]", - "160:4": "minecraft:stained_glass_pane[east=false,color=yellow,south=false,north=false,west=false]", - "160:5": "minecraft:stained_glass_pane[east=false,color=lime,south=false,north=false,west=false]", - "160:6": "minecraft:stained_glass_pane[east=false,color=pink,south=false,north=false,west=false]", - "160:7": "minecraft:stained_glass_pane[east=false,color=gray,south=false,north=false,west=false]", - "160:8": "minecraft:stained_glass_pane[east=false,color=silver,south=false,north=false,west=false]", - "160:9": "minecraft:stained_glass_pane[east=false,color=cyan,south=false,north=false,west=false]", - "160:10": "minecraft:stained_glass_pane[east=false,color=purple,south=false,north=false,west=false]", - "160:11": "minecraft:stained_glass_pane[east=false,color=blue,south=false,north=false,west=false]", - "160:12": "minecraft:stained_glass_pane[east=false,color=brown,south=false,north=false,west=false]", - "160:13": "minecraft:stained_glass_pane[east=false,color=green,south=false,north=false,west=false]", - "160:14": "minecraft:stained_glass_pane[east=false,color=red,south=false,north=false,west=false]", - "160:15": "minecraft:stained_glass_pane[east=false,color=black,south=false,north=false,west=false]", - "161:0": "minecraft:acacia_leaves[check_decay=false,decayable=true]", - "161:1": "minecraft:dark_oak_leaves[check_decay=false,decayable=true]", - "161:4": "minecraft:acacia_leaves[check_decay=false,decayable=false]", - "161:5": "minecraft:dark_oak_leaves[check_decay=false,decayable=false]", - "161:8": "minecraft:acacia_leaves[check_decay=true,decayable=true]", - "161:9": "minecraft:dark_oak_leaves[check_decay=true,decayable=true]", - "161:12": "minecraft:acacia_leaves[check_decay=true,decayable=false]", - "161:13": "minecraft:dark_oak_leaves[check_decay=true,decayable=false]", - "162:0": "minecraft:log2[variant=acacia,axis=y]", - "162:1": "minecraft:log2[variant=dark_oak,axis=y]", - "162:4": "minecraft:log2[variant=acacia,axis=x]", - "162:5": "minecraft:log2[variant=dark_oak,axis=x]", - "162:8": "minecraft:log2[variant=acacia,axis=z]", - "162:9": "minecraft:log2[variant=dark_oak,axis=z]", - "162:12": "minecraft:log2[variant=acacia,axis=none]", - "162:13": "minecraft:log2[variant=dark_oak,axis=none]", + "160:0": "minecraft:white_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:1": "minecraft:orange_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:2": "minecraft:magenta_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:3": "minecraft:light_blue_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:4": "minecraft:yellow_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:5": "minecraft:lime_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:6": "minecraft:pink_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:7": "minecraft:gray_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:8": "minecraft:light_gray_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:9": "minecraft:cyan_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:10": "minecraft:purple_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:11": "minecraft:blue_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:12": "minecraft:brown_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:13": "minecraft:green_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:14": "minecraft:red_stained_glass_pane[east=false,south=false,north=false,west=false]", + "160:15": "minecraft:black_stained_glass_pane[east=false,south=false,north=false,west=false]", + "161:0": "minecraft:acacia_leaves[persistent=false,distance=1]", + "161:1": "minecraft:dark_oak_leaves[persistent=false,distance=1]", + "161:4": "minecraft:acacia_leaves[persistent=true,distance=1]", + "161:5": "minecraft:dark_oak_leaves[persistent=true,distance=1]", + "161:8": "minecraft:acacia_leaves[persistent=false,distance=1]", + "161:9": "minecraft:dark_oak_leaves[persistent=false,distance=1]", + "161:12": "minecraft:acacia_leaves[persistent=true,distance=1]", + "161:13": "minecraft:dark_oak_leaves[persistent=true,distance=1]", + "162:0": "minecraft:acacia_log[axis=y]", + "162:1": "minecraft:dark_oak_log[axis=y]", + "162:4": "minecraft:acacia_log[axis=x]", + "162:5": "minecraft:dark_oak_log[axis=x]", + "162:8": "minecraft:acacia_log[axis=z]", + "162:9": "minecraft:dark_oak_log[axis=z]", + "162:12": "minecraft:acacia_wood", + "162:13": "minecraft:dark_oak_wood", "163:0": "minecraft:acacia_stairs[half=bottom,shape=outer_right,facing=east]", "163:1": "minecraft:acacia_stairs[half=bottom,shape=outer_right,facing=west]", "163:2": "minecraft:acacia_stairs[half=bottom,shape=outer_right,facing=south]", @@ -1178,7 +1178,7 @@ "171:0": "minecraft:white_carpet", "171:1": "minecraft:orange_carpet", "171:2": "minecraft:magenta_carpet", - "171:3": "minecraft:carpet[color=lightblue]", + "171:3": "minecraft:light_blue_carpet", "171:4": "minecraft:yellow_carpet", "171:5": "minecraft:lime_carpet", "171:6": "minecraft:pink_carpet", @@ -1194,16 +1194,18 @@ "172:0": "minecraft:terracotta", "173:0": "minecraft:coal_block", "174:0": "minecraft:packed_ice", - "175:0": "minecraft:double_plant[half=lower,variant=sunflower,facing=east]", - "175:1": "minecraft:double_plant[half=lower,variant=syringa,facing=east]", - "175:2": "minecraft:double_plant[half=lower,variant=double_grass,facing=east]", - "175:3": "minecraft:double_plant[half=lower,variant=double_fern,facing=east]", - "175:4": "minecraft:double_plant[half=lower,variant=double_rose,facing=east]", - "175:5": "minecraft:double_plant[half=lower,variant=paeonia,facing=east]", - "175:8": "minecraft:double_plant[half=upper,variant=paeonia,facing=south]", - "175:9": "minecraft:double_plant[half=upper,variant=paeonia,facing=west]", - "175:10": "minecraft:double_plant[half=upper,variant=paeonia,facing=north]", - "175:11": "minecraft:double_plant[half=upper,variant=paeonia,facing=east]", + "175:0": "minecraft:sunflower[half=lower]", + "175:1": "minecraft:lilac[half=lower]", + "175:2": "minecraft:tall_grass[half=lower]", + "175:3": "minecraft:large_fern[half=lower]", + "175:4": "minecraft:rose_bush[half=lower]", + "175:5": "minecraft:peony[half=lower]", + "175:8": "minecraft:sunflower[half=upper]", + "175:9": "minecraft:lilac[half=upper]", + "175:10": "minecraft:tall_grass[half=upper]", + "175:11": "minecraft:large_fern[half=upper]", + "175:12": "minecraft:rose_bush[half=upper]", + "175:13": "minecraft:peony[half=upper]", "176:0": "minecraft:white_banner[rotation=0]", "176:1": "minecraft:white_banner[rotation=1]", "176:2": "minecraft:white_banner[rotation=2]", @@ -1645,7 +1647,7 @@ "251:0": "minecraft:white_concrete", "251:1": "minecraft:orange_concrete", "251:2": "minecraft:magenta_concrete", - "251:3": "minecraft:concrete[color=lightblue]", + "251:3": "minecraft:light_blue_concrete", "251:4": "minecraft:yellow_concrete", "251:5": "minecraft:lime_concrete", "251:6": "minecraft:pink_concrete", @@ -1661,7 +1663,7 @@ "252:0": "minecraft:white_concrete_powder", "252:1": "minecraft:orange_concrete_powder", "252:2": "minecraft:magenta_concrete_powder", - "252:3": "minecraft:concrete_powder[color=lightblue]", + "252:3": "minecraft:light_blue_concrete_powder", "252:4": "minecraft:yellow_concrete_powder", "252:5": "minecraft:lime_concrete_powder", "252:6": "minecraft:pink_concrete_powder", @@ -1841,7 +1843,7 @@ "100:0": "minecraft:red_mushroom_block", "101:0": "minecraft:iron_bars", "102:0": "minecraft:glass_pane", - "103:0": "minecraft:melon_block", + "103:0": "minecraft:melon", "106:0": "minecraft:vine", "107:0": "minecraft:oak_fence_gate", "108:0": "minecraft:brick_stairs", @@ -2156,7 +2158,7 @@ "348:0": "minecraft:glowstone_dust", "349:0": "minecraft:cod", "349:1": "minecraft:salmon", - "349:2": "minecraft:clownfish", + "349:2": "minecraft:tropical_fish", "349:3": "minecraft:pufferfish", "350:0": "minecraft:cooked_cod", "350:1": "minecraft:cooked_salmon", @@ -2199,7 +2201,7 @@ "357:0": "minecraft:cookie", "358:0": "minecraft:filled_map", "359:0": "minecraft:shears", - "360:0": "minecraft:melon", + "360:0": "minecraft:melon_slice", "361:0": "minecraft:pumpkin_seeds", "362:0": "minecraft:melon_seeds", "363:0": "minecraft:beef", @@ -2221,8 +2223,8 @@ "379:0": "minecraft:brewing_stand", "380:0": "minecraft:cauldron", "381:0": "minecraft:ender_eye", - "382:0": "minecraft:speckled_melon", - "383:0": "minecraft:spawn_egg", + "382:0": "minecraft:glistering_melon_slice", + "383:0": "minecraft:pig_spawn_egg", "384:0": "minecraft:experience_bottle", "385:0": "minecraft:fire_charge", "386:0": "minecraft:writable_book", @@ -2292,7 +2294,7 @@ "430:0": "minecraft:acacia_door", "431:0": "minecraft:dark_oak_door", "432:0": "minecraft:chorus_fruit", - "433:0": "minecraft:chorus_fruit_popped", + "433:0": "minecraft:popped_chorus_fruit", "434:0": "minecraft:beetroot", "435:0": "minecraft:beetroot_seeds", "436:0": "minecraft:beetroot_soup", From a4b9ceaeb2685cacb5fa31a3dd95468f17834c69 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Tue, 31 Jul 2018 23:19:54 +1000 Subject: [PATCH 65/74] Finish off the last of the legacy mapper warnings (Excluding TNT as I've got the 1.13.1 names) --- .../worldedit/world/registry/legacy.json | 174 +++++++++--------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json index b31e89925..5e93ce540 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json @@ -409,18 +409,18 @@ "63:13": "minecraft:sign[rotation=13]", "63:14": "minecraft:sign[rotation=14]", "63:15": "minecraft:sign[rotation=15]", - "64:0": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=east,open=false]", - "64:1": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=south,open=false]", - "64:2": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=west,open=false]", - "64:3": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=north,open=false]", - "64:4": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=east,open=true]", - "64:5": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=south,open=true]", - "64:6": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=west,open=true]", - "64:7": "minecraft:wooden_door[hinge=right,half=lower,powered=false,facing=north,open=true]", - "64:8": "minecraft:wooden_door[hinge=left,half=upper,powered=false,facing=east,open=false]", - "64:9": "minecraft:wooden_door[hinge=right,half=upper,powered=false,facing=east,open=false]", - "64:10": "minecraft:wooden_door[hinge=left,half=upper,powered=true,facing=east,open=false]", - "64:11": "minecraft:wooden_door[hinge=right,half=upper,powered=true,facing=east,open=false]", + "64:0": "minecraft:oak_door[hinge=right,half=lower,powered=false,facing=east,open=false]", + "64:1": "minecraft:oak_door[hinge=right,half=lower,powered=false,facing=south,open=false]", + "64:2": "minecraft:oak_door[hinge=right,half=lower,powered=false,facing=west,open=false]", + "64:3": "minecraft:oak_door[hinge=right,half=lower,powered=false,facing=north,open=false]", + "64:4": "minecraft:oak_door[hinge=right,half=lower,powered=false,facing=east,open=true]", + "64:5": "minecraft:oak_door[hinge=right,half=lower,powered=false,facing=south,open=true]", + "64:6": "minecraft:oak_door[hinge=right,half=lower,powered=false,facing=west,open=true]", + "64:7": "minecraft:oak_door[hinge=right,half=lower,powered=false,facing=north,open=true]", + "64:8": "minecraft:oak_door[hinge=left,half=upper,powered=false,facing=east,open=false]", + "64:9": "minecraft:oak_door[hinge=right,half=upper,powered=false,facing=east,open=false]", + "64:10": "minecraft:oak_door[hinge=left,half=upper,powered=true,facing=east,open=false]", + "64:11": "minecraft:oak_door[hinge=right,half=upper,powered=true,facing=east,open=false]", "65:2": "minecraft:ladder[facing=north]", "65:3": "minecraft:ladder[facing=south]", "65:4": "minecraft:ladder[facing=west]", @@ -435,34 +435,34 @@ "66:7": "minecraft:rail[shape=south_west]", "66:8": "minecraft:rail[shape=north_west]", "66:9": "minecraft:rail[shape=north_east]", - "67:0": "minecraft:stone_stairs[half=bottom,shape=outer_right,facing=east]", - "67:1": "minecraft:stone_stairs[half=bottom,shape=outer_right,facing=west]", - "67:2": "minecraft:stone_stairs[half=bottom,shape=outer_right,facing=south]", - "67:3": "minecraft:stone_stairs[half=bottom,shape=outer_right,facing=north]", - "67:4": "minecraft:stone_stairs[half=top,shape=outer_right,facing=east]", - "67:5": "minecraft:stone_stairs[half=top,shape=outer_right,facing=west]", - "67:6": "minecraft:stone_stairs[half=top,shape=outer_right,facing=south]", - "67:7": "minecraft:stone_stairs[half=top,shape=outer_right,facing=north]", + "67:0": "minecraft:cobblestone_stairs[half=bottom,shape=outer_right,facing=east]", + "67:1": "minecraft:cobblestone_stairs[half=bottom,shape=outer_right,facing=west]", + "67:2": "minecraft:cobblestone_stairs[half=bottom,shape=outer_right,facing=south]", + "67:3": "minecraft:cobblestone_stairs[half=bottom,shape=outer_right,facing=north]", + "67:4": "minecraft:cobblestone_stairs[half=top,shape=outer_right,facing=east]", + "67:5": "minecraft:cobblestone_stairs[half=top,shape=outer_right,facing=west]", + "67:6": "minecraft:cobblestone_stairs[half=top,shape=outer_right,facing=south]", + "67:7": "minecraft:cobblestone_stairs[half=top,shape=outer_right,facing=north]", "68:2": "minecraft:wall_sign[facing=north]", "68:3": "minecraft:wall_sign[facing=south]", "68:4": "minecraft:wall_sign[facing=west]", "68:5": "minecraft:wall_sign[facing=east]", - "69:0": "minecraft:lever[powered=false,facing=down_x]", - "69:1": "minecraft:lever[powered=false,facing=east]", - "69:2": "minecraft:lever[powered=false,facing=west]", - "69:3": "minecraft:lever[powered=false,facing=south]", - "69:4": "minecraft:lever[powered=false,facing=north]", - "69:5": "minecraft:lever[powered=false,facing=up_z]", - "69:6": "minecraft:lever[powered=false,facing=up_x]", - "69:7": "minecraft:lever[powered=false,facing=down_z]", - "69:8": "minecraft:lever[powered=true,facing=down_x]", - "69:9": "minecraft:lever[powered=true,facing=east]", - "69:10": "minecraft:lever[powered=true,facing=west]", - "69:11": "minecraft:lever[powered=true,facing=south]", - "69:12": "minecraft:lever[powered=true,facing=north]", - "69:13": "minecraft:lever[powered=true,facing=up_z]", - "69:14": "minecraft:lever[powered=true,facing=up_x]", - "69:15": "minecraft:lever[powered=true,facing=down_z]", + "69:0": "minecraft:lever[powered=false,facing=north,face=ceiling]", + "69:1": "minecraft:lever[powered=false,facing=east,face=wall]", + "69:2": "minecraft:lever[powered=false,facing=west,face=wall]", + "69:3": "minecraft:lever[powered=false,facing=south,face=wall]", + "69:4": "minecraft:lever[powered=false,facing=north,face=wall]", + "69:5": "minecraft:lever[powered=false,facing=east,face=floor]", + "69:6": "minecraft:lever[powered=false,facing=north,face=floor]", + "69:7": "minecraft:lever[powered=false,facing=east,face=ceiling]", + "69:8": "minecraft:lever[powered=true,facing=north,face=ceiling]", + "69:9": "minecraft:lever[powered=true,facing=east,face=wall]", + "69:10": "minecraft:lever[powered=true,facing=west,face=wall]", + "69:11": "minecraft:lever[powered=true,facing=south,face=wall]", + "69:12": "minecraft:lever[powered=true,facing=north,face=wall]", + "69:13": "minecraft:lever[powered=true,facing=east,face=floor]", + "69:14": "minecraft:lever[powered=true,facing=north,face=floor]", + "69:15": "minecraft:lever[powered=true,facing=east,face=ceiling]", "70:0": "minecraft:stone_pressure_plate[powered=false]", "70:1": "minecraft:stone_pressure_plate[powered=true]", "71:0": "minecraft:iron_door[hinge=right,half=lower,powered=false,facing=east,open=false]", @@ -491,18 +491,18 @@ "76:3": "minecraft:redstone_wall_torch[facing=south,lit=true]", "76:4": "minecraft:redstone_wall_torch[facing=north,lit=true]", "76:5": "minecraft:redstone_torch[lit=true]", - "77:0": "minecraft:stone_button[powered=false,facing=down]", - "77:1": "minecraft:stone_button[powered=false,facing=east]", - "77:2": "minecraft:stone_button[powered=false,facing=west]", - "77:3": "minecraft:stone_button[powered=false,facing=south]", - "77:4": "minecraft:stone_button[powered=false,facing=north]", - "77:5": "minecraft:stone_button[powered=false,facing=up]", - "77:8": "minecraft:stone_button[powered=true,facing=down]", - "77:9": "minecraft:stone_button[powered=true,facing=east]", - "77:10": "minecraft:stone_button[powered=true,facing=west]", - "77:11": "minecraft:stone_button[powered=true,facing=south]", - "77:12": "minecraft:stone_button[powered=true,facing=north]", - "77:13": "minecraft:stone_button[powered=true,facing=up]", + "77:0": "minecraft:stone_button[powered=false,facing=east,face=ceiling]", + "77:1": "minecraft:stone_button[powered=false,facing=east,face=wall]", + "77:2": "minecraft:stone_button[powered=false,facing=west,face=wall]", + "77:3": "minecraft:stone_button[powered=false,facing=south,face=wall]", + "77:4": "minecraft:stone_button[powered=false,facing=north,face=wall]", + "77:5": "minecraft:stone_button[powered=false,facing=east,face=floor]", + "77:8": "minecraft:stone_button[powered=true,facing=south,face=ceiling]", + "77:9": "minecraft:stone_button[powered=true,facing=east,face=wall]", + "77:10": "minecraft:stone_button[powered=true,facing=west,face=wall]", + "77:11": "minecraft:stone_button[powered=true,facing=south,face=wall]", + "77:12": "minecraft:stone_button[powered=true,facing=north,face=wall]", + "77:13": "minecraft:stone_button[powered=true,facing=south,face=floor]", "78:0": "minecraft:snow[layers=1]", "78:1": "minecraft:snow[layers=2]", "78:2": "minecraft:snow[layers=3]", @@ -548,7 +548,7 @@ "83:15": "minecraft:sugar_cane[age=15]", "84:0": "minecraft:jukebox[has_record=false]", "84:1": "minecraft:jukebox[has_record=true]", - "85:0": "minecraft:fence[east=false,south=false,north=false,west=false]", + "85:0": "minecraft:oak_fence[east=false,south=false,north=false,west=false]", "86:0": "minecraft:carved_pumpkin[facing=south]", "86:1": "minecraft:carved_pumpkin[facing=west]", "86:2": "minecraft:carved_pumpkin[facing=north]", @@ -617,22 +617,22 @@ "95:13": "minecraft:green_stained_glass", "95:14": "minecraft:red_stained_glass", "95:15": "minecraft:black_stained_glass", - "96:0": "minecraft:trapdoor[half=bottom,facing=north,open=false]", - "96:1": "minecraft:trapdoor[half=bottom,facing=south,open=false]", - "96:2": "minecraft:trapdoor[half=bottom,facing=west,open=false]", - "96:3": "minecraft:trapdoor[half=bottom,facing=east,open=false]", - "96:4": "minecraft:trapdoor[half=bottom,facing=north,open=true]", - "96:5": "minecraft:trapdoor[half=bottom,facing=south,open=true]", - "96:6": "minecraft:trapdoor[half=bottom,facing=west,open=true]", - "96:7": "minecraft:trapdoor[half=bottom,facing=east,open=true]", - "96:8": "minecraft:trapdoor[half=top,facing=north,open=false]", - "96:9": "minecraft:trapdoor[half=top,facing=south,open=false]", - "96:10": "minecraft:trapdoor[half=top,facing=west,open=false]", - "96:11": "minecraft:trapdoor[half=top,facing=east,open=false]", - "96:12": "minecraft:trapdoor[half=top,facing=north,open=true]", - "96:13": "minecraft:trapdoor[half=top,facing=south,open=true]", - "96:14": "minecraft:trapdoor[half=top,facing=west,open=true]", - "96:15": "minecraft:trapdoor[half=top,facing=east,open=true]", + "96:0": "minecraft:oak_trapdoor[half=bottom,facing=north,open=false,powered=false]", + "96:1": "minecraft:oak_trapdoor[half=bottom,facing=south,open=false,powered=false]", + "96:2": "minecraft:oak_trapdoor[half=bottom,facing=west,open=false,powered=false]", + "96:3": "minecraft:oak_trapdoor[half=bottom,facing=east,open=false,powered=false]", + "96:4": "minecraft:oak_trapdoor[half=bottom,facing=north,open=true,powered=true]", + "96:5": "minecraft:oak_trapdoor[half=bottom,facing=south,open=true,powered=true]", + "96:6": "minecraft:oak_trapdoor[half=bottom,facing=west,open=true,powered=true]", + "96:7": "minecraft:oak_trapdoor[half=bottom,facing=east,open=true,powered=true]", + "96:8": "minecraft:oak_trapdoor[half=top,facing=north,open=false,powered=false]", + "96:9": "minecraft:oak_trapdoor[half=top,facing=south,open=false,powered=false]", + "96:10": "minecraft:oak_trapdoor[half=top,facing=west,open=false,powered=false]", + "96:11": "minecraft:oak_trapdoor[half=top,facing=east,open=false,powered=false]", + "96:12": "minecraft:oak_trapdoor[half=top,facing=north,open=true,powered=true]", + "96:13": "minecraft:oak_trapdoor[half=top,facing=south,open=true,powered=true]", + "96:14": "minecraft:oak_trapdoor[half=top,facing=west,open=true,powered=true]", + "96:15": "minecraft:oak_trapdoor[half=top,facing=east,open=true,powered=true]", "97:0": "minecraft:infested_stone", "97:1": "minecraft:infested_cobblestone", "97:2": "minecraft:infested_stone_bricks", @@ -704,22 +704,22 @@ "106:13": "minecraft:vine[east=true,south=true,north=true,west=false,up=false]", "106:14": "minecraft:vine[east=true,south=false,north=true,west=true,up=false]", "106:15": "minecraft:vine[east=true,south=true,north=true,west=true,up=false]", - "107:0": "minecraft:fence_gate[in_wall=false,powered=false,facing=south,open=false]", - "107:1": "minecraft:fence_gate[in_wall=false,powered=false,facing=west,open=false]", - "107:2": "minecraft:fence_gate[in_wall=false,powered=false,facing=north,open=false]", - "107:3": "minecraft:fence_gate[in_wall=false,powered=false,facing=east,open=false]", - "107:4": "minecraft:fence_gate[in_wall=false,powered=false,facing=south,open=true]", - "107:5": "minecraft:fence_gate[in_wall=false,powered=false,facing=west,open=true]", - "107:6": "minecraft:fence_gate[in_wall=false,powered=false,facing=north,open=true]", - "107:7": "minecraft:fence_gate[in_wall=false,powered=false,facing=east,open=true]", - "107:8": "minecraft:fence_gate[in_wall=false,powered=true,facing=south,open=false]", - "107:9": "minecraft:fence_gate[in_wall=false,powered=true,facing=west,open=false]", - "107:10": "minecraft:fence_gate[in_wall=false,powered=true,facing=north,open=false]", - "107:11": "minecraft:fence_gate[in_wall=false,powered=true,facing=east,open=false]", - "107:12": "minecraft:fence_gate[in_wall=false,powered=true,facing=south,open=true]", - "107:13": "minecraft:fence_gate[in_wall=false,powered=true,facing=west,open=true]", - "107:14": "minecraft:fence_gate[in_wall=false,powered=true,facing=north,open=true]", - "107:15": "minecraft:fence_gate[in_wall=false,powered=true,facing=east,open=true]", + "107:0": "minecraft:oak_fence_gate[in_wall=false,powered=false,facing=south,open=false]", + "107:1": "minecraft:oak_fence_gate[in_wall=false,powered=false,facing=west,open=false]", + "107:2": "minecraft:oak_fence_gate[in_wall=false,powered=false,facing=north,open=false]", + "107:3": "minecraft:oak_fence_gate[in_wall=false,powered=false,facing=east,open=false]", + "107:4": "minecraft:oak_fence_gate[in_wall=false,powered=false,facing=south,open=true]", + "107:5": "minecraft:oak_fence_gate[in_wall=false,powered=false,facing=west,open=true]", + "107:6": "minecraft:oak_fence_gate[in_wall=false,powered=false,facing=north,open=true]", + "107:7": "minecraft:oak_fence_gate[in_wall=false,powered=false,facing=east,open=true]", + "107:8": "minecraft:oak_fence_gate[in_wall=false,powered=true,facing=south,open=false]", + "107:9": "minecraft:oak_fence_gate[in_wall=false,powered=true,facing=west,open=false]", + "107:10": "minecraft:oak_fence_gate[in_wall=false,powered=true,facing=north,open=false]", + "107:11": "minecraft:oak_fence_gate[in_wall=false,powered=true,facing=east,open=false]", + "107:12": "minecraft:oak_fence_gate[in_wall=false,powered=true,facing=south,open=true]", + "107:13": "minecraft:oak_fence_gate[in_wall=false,powered=true,facing=west,open=true]", + "107:14": "minecraft:oak_fence_gate[in_wall=false,powered=true,facing=north,open=true]", + "107:15": "minecraft:oak_fence_gate[in_wall=false,powered=true,facing=east,open=true]", "108:0": "minecraft:brick_stairs[half=bottom,shape=outer_right,facing=east]", "108:1": "minecraft:brick_stairs[half=bottom,shape=outer_right,facing=west]", "108:2": "minecraft:brick_stairs[half=bottom,shape=outer_right,facing=south]", @@ -883,8 +883,8 @@ "137:12": "minecraft:command_block[conditional=true,facing=west]", "137:13": "minecraft:command_block[conditional=true,facing=east]", "138:0": "minecraft:beacon", - "139:0": "minecraft:cobblestone_wall[east=false,south=false,north=false,west=false,variant=cobblestone,up=false]", - "139:1": "minecraft:cobblestone_wall[east=false,south=false,north=false,west=false,variant=mossy_cobblestone,up=false]", + "139:0": "minecraft:cobblestone_wall[east=false,south=false,north=false,west=false,up=false]", + "139:1": "minecraft:mossy_cobblestone_wall[east=false,south=false,north=false,west=false,up=false]", "140:0": "minecraft:flower_pot", "140:1": "minecraft:potted_poppy", "140:2": "minecraft:potted_dandelion", @@ -917,18 +917,18 @@ "142:5": "minecraft:potatoes[age=5]", "142:6": "minecraft:potatoes[age=6]", "142:7": "minecraft:potatoes[age=7]", - "143:0": "minecraft:oak_button[powered=false,facing=down,face=ceiling]", + "143:0": "minecraft:oak_button[powered=false,facing=east,face=ceiling]", "143:1": "minecraft:oak_button[powered=false,facing=east,face=wall]", "143:2": "minecraft:oak_button[powered=false,facing=west,face=wall]", "143:3": "minecraft:oak_button[powered=false,facing=south,face=wall]", "143:4": "minecraft:oak_button[powered=false,facing=north,face=wall]", - "143:5": "minecraft:oak_button[powered=false,facing=up,face=floor]", - "143:8": "minecraft:oak_button[powered=true,facing=down,face=ceiling]", + "143:5": "minecraft:oak_button[powered=false,facing=east,face=floor]", + "143:8": "minecraft:oak_button[powered=true,facing=south,face=ceiling]", "143:9": "minecraft:oak_button[powered=true,facing=east,face=wall]", "143:10": "minecraft:oak_button[powered=true,facing=west,face=wall]", "143:11": "minecraft:oak_button[powered=true,facing=south,face=wall]", "143:12": "minecraft:oak_button[powered=true,facing=north,face=wall]", - "143:13": "minecraft:oak_button[powered=true,facing=up,face=floor]", + "143:13": "minecraft:oak_button[powered=true,facing=south,face=floor]", "144:0": "minecraft:skeleton_skull[rotation=0]", "144:1": "minecraft:skeleton_skull[rotation=4]", "144:2": "minecraft:skeleton_wall_skull[facing=north]", From a75d9e896b56589f06d8431977258552648f3a99 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 2 Aug 2018 14:15:49 +1000 Subject: [PATCH 66/74] Start work on the Sponge schematic format. This should work but it may not, it's untested. --- .../com/sk89q/worldedit/blocks/BaseBlock.java | 12 - .../worldedit/command/SchematicCommands.java | 2 +- .../clipboard/io/BuiltInClipboardFormat.java | 67 +++++- ...Reader.java => MCEditSchematicReader.java} | 40 +--- .../clipboard/io/NBTSchematicReader.java | 44 ++++ .../clipboard/io/SpongeSchematicReader.java | 220 ++++++++++++++++++ .../clipboard/io/SpongeSchematicWriter.java | 174 ++++++++++++++ .../sk89q/worldedit/world/item/ItemType.java | 18 -- 8 files changed, 499 insertions(+), 78 deletions(-) rename worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/{SchematicReader.java => MCEditSchematicReader.java} (90%) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicWriter.java diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 9fd469057..a3ebc113d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -111,18 +111,6 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { this(other.toImmutableState(), other.getNbtData()); } - /** - * Get the block's data value. - * - * Broken - do not use - * - * @return data value (0-15) - */ - @Deprecated - public int getData() { - return 0; - } - /** * Gets a map of state to statevalue * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 2f85734e7..cc8df7c24 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -133,7 +133,7 @@ public class SchematicCommands { ) @Deprecated @CommandPermissions({ "worldedit.clipboard.save", "worldedit.schematic.save" }) - public void save(Player player, LocalSession session, @Optional("schematic") String formatName, String filename) throws CommandException, WorldEditException { + public void save(Player player, LocalSession session, @Optional("sponge") String formatName, String filename) throws CommandException, WorldEditException { LocalConfiguration config = worldEdit.getConfiguration(); File dir = worldEdit.getWorkingDirectoryFile(config.saveDir); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java index 46ee0eab3..574c5b881 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.extent.clipboard.io; import com.google.common.collect.ImmutableSet; import com.sk89q.jnbt.NBTConstants; import com.sk89q.jnbt.NBTInputStream; +import com.sk89q.jnbt.NBTOutputStream; import java.io.DataInputStream; import java.io.File; @@ -31,6 +32,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.Set; import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; /** * A collection of supported clipboard formats. @@ -38,7 +40,7 @@ import java.util.zip.GZIPInputStream; public enum BuiltInClipboardFormat implements ClipboardFormat { /** - * The Schematic format used by many software. + * The Schematic format used by MCEdit. */ MCEDIT_SCHEMATIC("mcedit", "mce", "schematic") { @@ -50,7 +52,7 @@ public enum BuiltInClipboardFormat implements ClipboardFormat { @Override public ClipboardReader getReader(InputStream inputStream) throws IOException { NBTInputStream nbtStream = new NBTInputStream(new GZIPInputStream(inputStream)); - return new SchematicReader(nbtStream); + return new MCEditSchematicReader(nbtStream); } @Override @@ -60,25 +62,66 @@ public enum BuiltInClipboardFormat implements ClipboardFormat { @Override public boolean isFormat(File file) { - DataInputStream str = null; - try { - str = new DataInputStream(new GZIPInputStream(new FileInputStream(file))); + try (DataInputStream str = new DataInputStream(new GZIPInputStream(new FileInputStream(file)))) { if ((str.readByte() & 0xFF) != NBTConstants.TYPE_COMPOUND) { return false; } byte[] nameBytes = new byte[str.readShort() & 0xFFFF]; str.readFully(nameBytes); String name = new String(nameBytes, NBTConstants.CHARSET); - return name.equals("Schematic"); + if (!name.equals("Schematic")) { + return false; + } + str.readByte(); // Ignore + nameBytes = new byte[str.readShort() & 0xFFFF]; + str.readFully(nameBytes); + name = new String(nameBytes, NBTConstants.CHARSET); + return !name.equals("Version"); } catch (IOException e) { return false; - } finally { - if (str != null) { - try { - str.close(); - } catch (IOException ignored) { - } + } + } + }, + SPONGE_SCHEMATIC("sponge", "schem") { + + @Override + public String getPrimaryFileExtension() { + return "schem"; + } + + @Override + public ClipboardReader getReader(InputStream inputStream) throws IOException { + NBTInputStream nbtStream = new NBTInputStream(new GZIPInputStream(inputStream)); + return new SpongeSchematicReader(nbtStream); + } + + @Override + public ClipboardWriter getWriter(OutputStream outputStream) throws IOException { + NBTOutputStream nbtStream = new NBTOutputStream(new GZIPOutputStream(outputStream)); + return new SpongeSchematicWriter(nbtStream); + } + + @Override + public boolean isFormat(File file) { + try (DataInputStream str = new DataInputStream(new GZIPInputStream(new FileInputStream(file)))) { + if ((str.readByte() & 0xFF) != NBTConstants.TYPE_COMPOUND) { + return false; } + byte[] nameBytes = new byte[str.readShort() & 0xFFFF]; + str.readFully(nameBytes); + String name = new String(nameBytes, NBTConstants.CHARSET); + if (!name.equals("Schematic")) { + return false; + } + if ((str.readByte() & 0xFF) != NBTConstants.TYPE_INT) { + return false; + } + nameBytes = new byte[str.readShort() & 0xFFFF]; + str.readFully(nameBytes); + name = new String(nameBytes, NBTConstants.CHARSET); + return name.equals("Version"); + } catch (IOException e) { + return false; } } }; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java similarity index 90% rename from worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java index 4e83fb301..13d99b452 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java @@ -56,20 +56,19 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import javax.annotation.Nullable; - /** - * Reads schematic files based that are compatible with MCEdit and other editors. + * Reads schematic files that are compatible with MCEdit and other editors. */ -public class SchematicReader implements ClipboardReader { +public class MCEditSchematicReader extends NBTSchematicReader { private static final List COMPATIBILITY_HANDLERS = new ArrayList<>(); static { COMPATIBILITY_HANDLERS.add(new SignCompatibilityHandler()); + // TODO Add a handler for skulls, flower pots, note blocks, etc. } - private static final Logger log = Logger.getLogger(SchematicReader.class.getCanonicalName()); + private static final Logger log = Logger.getLogger(MCEditSchematicReader.class.getCanonicalName()); private final NBTInputStream inputStream; /** @@ -77,7 +76,7 @@ public class SchematicReader implements ClipboardReader { * * @param inputStream the input stream to read from */ - public SchematicReader(NBTInputStream inputStream) { + public MCEditSchematicReader(NBTInputStream inputStream) { checkNotNull(inputStream); this.inputStream = inputStream; } @@ -282,35 +281,6 @@ public class SchematicReader implements ClipboardReader { return clipboard; } - private static T requireTag(Map items, String key, Class expected) throws IOException { - if (!items.containsKey(key)) { - throw new IOException("Schematic file is missing a \"" + key + "\" tag"); - } - - Tag tag = items.get(key); - if (!expected.isInstance(tag)) { - throw new IOException(key + " tag is not of tag type " + expected.getName()); - } - - return expected.cast(tag); - } - - @Nullable - private static T getTag(CompoundTag tag, Class expected, String key) { - Map items = tag.getValue(); - - if (!items.containsKey(key)) { - return null; - } - - Tag test = items.get(key); - if (!expected.isInstance(test)) { - return null; - } - - return expected.cast(test); - } - @Override public void close() throws IOException { inputStream.close(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java new file mode 100644 index 000000000..d5d6d0bf8 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java @@ -0,0 +1,44 @@ +package com.sk89q.worldedit.extent.clipboard.io; + +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.Tag; + +import java.io.IOException; +import java.util.Map; + +import javax.annotation.Nullable; + +/** + * Base class for NBT schematic readers + */ +public abstract class NBTSchematicReader implements ClipboardReader { + + protected static T requireTag(Map items, String key, Class expected) throws IOException { + if (!items.containsKey(key)) { + throw new IOException("Schematic file is missing a \"" + key + "\" tag"); + } + + Tag tag = items.get(key); + if (!expected.isInstance(tag)) { + throw new IOException(key + " tag is not of tag type " + expected.getName()); + } + + return expected.cast(tag); + } + + @Nullable + protected static T getTag(CompoundTag tag, Class expected, String key) { + Map items = tag.getValue(); + + if (!items.containsKey(key)) { + return null; + } + + Tag test = items.get(key); + if (!expected.isInstance(test)) { + return null; + } + + return expected.cast(test); + } +} 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 new file mode 100644 index 000000000..a1aa21a03 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java @@ -0,0 +1,220 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.extent.clipboard.io; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.jnbt.ByteArrayTag; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.IntArrayTag; +import com.sk89q.jnbt.IntTag; +import com.sk89q.jnbt.ListTag; +import com.sk89q.jnbt.NBTInputStream; +import com.sk89q.jnbt.NamedTag; +import com.sk89q.jnbt.ShortTag; +import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; +import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; +import com.sk89q.worldedit.extent.clipboard.Clipboard; +import com.sk89q.worldedit.extent.clipboard.io.legacycompat.NBTCompatibilityHandler; +import com.sk89q.worldedit.regions.CuboidRegion; +import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.world.block.BlockState; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +/** + * Reads schematic files using the Sponge Schematic Specification. + */ +public class SpongeSchematicReader extends NBTSchematicReader { + + private static final List COMPATIBILITY_HANDLERS = new ArrayList<>(); + + static { + // If NBT Compat handlers are needed - add them here. + } + + private static final Logger log = Logger.getLogger(SpongeSchematicReader.class.getCanonicalName()); + private final NBTInputStream inputStream; + + /** + * Create a new instance. + * + * @param inputStream the input stream to read from + */ + public SpongeSchematicReader(NBTInputStream inputStream) { + checkNotNull(inputStream); + this.inputStream = inputStream; + } + + @Override + public Clipboard read() throws IOException { + NamedTag rootTag = inputStream.readNamedTag(); + if (!rootTag.getName().equals("Schematic")) { + throw new IOException("Tag 'Schematic' does not exist or is not first"); + } + CompoundTag schematicTag = (CompoundTag) rootTag.getTag(); + + // Check + Map schematic = schematicTag.getValue(); + int version = requireTag(schematic, "Version", IntTag.class).getValue(); + switch (version) { + case 1: + return readVersion1(schematic); + default: + throw new IOException("This schematic version is currently not supported"); + } + } + + private Clipboard readVersion1(Map schematic) throws IOException { + Vector origin; + Region region; + + Map metadata = requireTag(schematic, "Metadata", CompoundTag.class).getValue(); + + int width = requireTag(schematic, "Width", ShortTag.class).getValue(); + int height = requireTag(schematic, "Height", ShortTag.class).getValue(); + int length = requireTag(schematic, "Length", ShortTag.class).getValue(); + + int[] offsetParts = requireTag(schematic, "Offset", IntArrayTag.class).getValue(); + if (offsetParts.length != 3) { + throw new IOException("Invalid offset specified in schematic."); + } + + Vector offset = new Vector(offsetParts[0], offsetParts[1], offsetParts[2]); + + if (metadata.containsKey("WEOriginX")) { + // We appear to have WorldEdit Metadata + int originX = requireTag(metadata, "WEOriginX", IntTag.class).getValue(); + int originY = requireTag(metadata, "WEOriginY", IntTag.class).getValue(); + int originZ = requireTag(metadata, "WEOriginZ", IntTag.class).getValue(); + Vector min = new Vector(originX, originY, originZ); + origin = min.subtract(offset); + region = new CuboidRegion(min, min.add(width, height, length).subtract(Vector.ONE)); + } else { + origin = Vector.ZERO.subtract(offset); + region = new CuboidRegion(origin, origin.add(width, height, length).subtract(Vector.ONE)); + } + + int paletteMax = requireTag(schematic, "PaletteMax", IntTag.class).getValue(); + Map paletteObject = requireTag(schematic, "Palette", CompoundTag.class).getValue(); + if (paletteObject.size() != paletteMax) { + throw new IOException("Differing given palette size to actual size"); + } + + Map palette = new HashMap<>(); + + ParserContext parserContext = new ParserContext(); + + for (String palettePart : paletteObject.keySet()) { + int id = requireTag(paletteObject, palettePart, IntTag.class).getValue(); + BlockState state; + try { + state = WorldEdit.getInstance().getBlockFactory().parseFromInput(palettePart, parserContext).toImmutableState(); + } catch (InputParseException e) { + throw new IOException("Invalid BlockState in schematic: " + palettePart + ". Are you missing a mod of using a schematic made in a newer version of Minecraft?"); + } + palette.put(id, state); + } + + byte[] blocks = requireTag(schematic, "BlockData", ByteArrayTag.class).getValue(); + + Map> tileEntitiesMap = new HashMap<>(); + try { + List> tileEntityTags = requireTag(schematic, "TileEntities", ListTag.class).getValue().stream() + .map(tag -> (CompoundTag) tag) + .map(CompoundTag::getValue) + .collect(Collectors.toList()); + + for (Map tileEntity : tileEntityTags) { + int[] pos = requireTag(schematic, "Pos", IntArrayTag.class).getValue(); + tileEntitiesMap.put(new BlockVector(pos[0], pos[1], pos[2]), tileEntity); + } + } catch (Exception e) { + throw new IOException("Failed to load Tile Entities: " + e.getMessage()); + } + + BlockArrayClipboard clipboard = new BlockArrayClipboard(region); + clipboard.setOrigin(origin); + + int index = 0; + int i = 0; + int value = 0; + int varint_length = 0; + while (i < blocks.length) { + value = 0; + varint_length = 0; + + while (true) { + value |= (blocks[i] & 127) << (varint_length++ * 7); + if (varint_length > 5) { + throw new RuntimeException("VarInt too big (probably corrupted data)"); + } + if ((blocks[i] & 128) != 128) { + i++; + break; + } + i++; + } + // index = (y * length + z) * width + x + int y = index / (width * length); + int z = (index % (width * length)) / width; + int x = (index % (width * length)) % width; + BlockState state = palette.get(value); + BlockVector pt = new BlockVector(x, y, z); + try { + if (tileEntitiesMap.containsKey(pt)) { + Map values = tileEntitiesMap.get(pt); + for (NBTCompatibilityHandler handler : COMPATIBILITY_HANDLERS) { + if (handler.isAffectedBlock(state)) { + handler.updateNBT(state, values); + } + } + clipboard.setBlock(pt, new BaseBlock(state, new CompoundTag(values))); + } else { + clipboard.setBlock(pt, state); + } + } catch (WorldEditException e) { + throw new IOException("Failed to load a block in the schematic"); + } + + index++; + } + + return clipboard; + } + + @Override + public void close() throws IOException { + inputStream.close(); + } +} 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 new file mode 100644 index 000000000..fc97a35f6 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicWriter.java @@ -0,0 +1,174 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.extent.clipboard.io; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.jnbt.ByteArrayTag; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.IntArrayTag; +import com.sk89q.jnbt.IntTag; +import com.sk89q.jnbt.ListTag; +import com.sk89q.jnbt.NBTOutputStream; +import com.sk89q.jnbt.ShortTag; +import com.sk89q.jnbt.StringTag; +import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.extent.clipboard.Clipboard; +import com.sk89q.worldedit.regions.Region; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Writes schematic files using the Sponge schematic format. + */ +public class SpongeSchematicWriter implements ClipboardWriter { + + private static final int MAX_SIZE = Short.MAX_VALUE - Short.MIN_VALUE; + private final NBTOutputStream outputStream; + + /** + * Create a new schematic writer. + * + * @param outputStream the output stream to write to + */ + public SpongeSchematicWriter(NBTOutputStream outputStream) { + checkNotNull(outputStream); + this.outputStream = outputStream; + } + + @Override + public void write(Clipboard clipboard) throws IOException { + // For now always write the latest version. Maybe provide support for earlier if more appear. + outputStream.writeNamedTag("Schematic", new CompoundTag(write1(clipboard))); + } + + /** + * Writes a version 1 schematic file. + * + * @param clipboard The clipboard + * @return The schematic map + * @throws IOException If an error occurs + */ + private Map write1(Clipboard clipboard) throws IOException { + Region region = clipboard.getRegion(); + Vector origin = clipboard.getOrigin(); + Vector min = region.getMinimumPoint(); + Vector offset = min.subtract(origin); + int width = region.getWidth(); + int height = region.getHeight(); + int length = region.getLength(); + + if (width > MAX_SIZE) { + throw new IllegalArgumentException("Width of region too large for a .schematic"); + } + if (height > MAX_SIZE) { + throw new IllegalArgumentException("Height of region too large for a .schematic"); + } + if (length > MAX_SIZE) { + throw new IllegalArgumentException("Length of region too large for a .schematic"); + } + + Map schematic = new HashMap<>(); + schematic.put("Version", new IntTag(1)); + + Map metadata = new HashMap<>(); + metadata.put("WEOriginX", new IntTag(min.getBlockX())); + metadata.put("WEOriginY", new IntTag(min.getBlockY())); + metadata.put("WEOriginZ", new IntTag(min.getBlockZ())); + + schematic.put("Metadata", new CompoundTag(metadata)); + + schematic.put("Width", new ShortTag((short) width)); + schematic.put("Height", new ShortTag((short) height)); + schematic.put("Length", new ShortTag((short) length)); + + schematic.put("Offset", new IntArrayTag(new int[]{ + offset.getBlockX(), + offset.getBlockY(), + offset.getBlockZ(), + })); + + int paletteMax = 0; + Map palette = new HashMap<>(); + + List tileEntities = new ArrayList<>(); + + ByteArrayOutputStream buffer = new ByteArrayOutputStream(width * height * length); + + for (Vector point : region) { + BaseBlock block = clipboard.getFullBlock(point); + if (block.getNbtData() != null) { + Map values = new HashMap<>(); + for (Map.Entry entry : block.getNbtData().getValue().entrySet()) { + values.put(entry.getKey(), entry.getValue()); + } + + values.put("Id", new StringTag(block.getNbtId())); + values.put("Pos", new IntArrayTag(new int[]{ + point.getBlockX(), + point.getBlockY(), + point.getBlockZ() + })); + + CompoundTag tileEntityTag = new CompoundTag(values); + tileEntities.add(tileEntityTag); + } + + String blockKey = block.toImmutableState().getAsString(); + int blockId; + if (palette.containsKey(blockKey)) { + blockId = palette.get(blockKey); + } else { + blockId = paletteMax; + palette.put(blockKey, blockId); + paletteMax ++; + } + + while ((blockId & -128) != 0) { + buffer.write(blockId & 127 | 128); + blockId >>>= 7; + } + buffer.write(blockId); + } + + schematic.put("PaletteMax", new IntTag(paletteMax)); + + Map paletteTag = new HashMap<>(); + palette.forEach((key, value) -> paletteTag.put(key, new IntTag(value))); + + schematic.put("Palette", new CompoundTag(paletteTag)); + schematic.put("BlockData", new ByteArrayTag(buffer.toByteArray())); + schematic.put("TileEntities", new ListTag(CompoundTag.class, tileEntities)); + + return schematic; + } + + @Override + public void close() throws IOException { + outputStream.close(); + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java index d49f28ddc..6452451d0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.registry.NamespacedRegistry; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.registry.BundledItemData; -import com.sk89q.worldedit.world.registry.LegacyMapper; import javax.annotation.Nullable; @@ -79,23 +78,6 @@ public class ItemType { return BlockTypes.get(this.id); } - /** - * Gets the legacy ID. Needed for legacy reasons. - * - * DO NOT USE THIS. - * - * @return legacy id or 0, if unknown - */ - @Deprecated - public int getLegacyId() { - int ids[] = LegacyMapper.getInstance().getLegacyFromItem(this); - if (ids != null) { - return ids[0]; - } else { - return 0; - } - } - @Override public int hashCode() { return this.id.hashCode(); From ea349bdbf1da940db3b147908cbd956adfc87730 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 2 Aug 2018 14:45:26 +1000 Subject: [PATCH 67/74] Fix checkstyle issues. --- .../clipboard/io/NBTSchematicReader.java | 19 +++++++++++++++++++ .../clipboard/io/SpongeSchematicReader.java | 8 ++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java index d5d6d0bf8..424dffcc6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java @@ -1,3 +1,22 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + package com.sk89q.worldedit.extent.clipboard.io; import com.sk89q.jnbt.CompoundTag; 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 a1aa21a03..ad1609ccd 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 @@ -169,14 +169,14 @@ public class SpongeSchematicReader extends NBTSchematicReader { int index = 0; int i = 0; int value = 0; - int varint_length = 0; + int varintLength = 0; while (i < blocks.length) { value = 0; - varint_length = 0; + varintLength = 0; while (true) { - value |= (blocks[i] & 127) << (varint_length++ * 7); - if (varint_length > 5) { + value |= (blocks[i] & 127) << (varintLength++ * 7); + if (varintLength > 5) { throw new RuntimeException("VarInt too big (probably corrupted data)"); } if ((blocks[i] & 128) != 128) { From 2c1b234e38a1487d5e4f5eb208bf250722ad023a Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 2 Aug 2018 22:53:25 +1000 Subject: [PATCH 68/74] Fixed some issues with Sponge schematics. --- .../clipboard/io/BuiltInClipboardFormat.java | 49 +++++++++---------- .../clipboard/io/SpongeSchematicReader.java | 11 +++-- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java index 574c5b881..5c8672f08 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java @@ -20,16 +20,18 @@ package com.sk89q.worldedit.extent.clipboard.io; import com.google.common.collect.ImmutableSet; -import com.sk89q.jnbt.NBTConstants; +import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.NBTInputStream; import com.sk89q.jnbt.NBTOutputStream; +import com.sk89q.jnbt.NamedTag; +import com.sk89q.jnbt.Tag; -import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.Map; import java.util.Set; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; @@ -62,24 +64,22 @@ public enum BuiltInClipboardFormat implements ClipboardFormat { @Override public boolean isFormat(File file) { - try (DataInputStream str = new DataInputStream(new GZIPInputStream(new FileInputStream(file)))) { - if ((str.readByte() & 0xFF) != NBTConstants.TYPE_COMPOUND) { + try (NBTInputStream str = new NBTInputStream(new GZIPInputStream(new FileInputStream(file)))) { + NamedTag rootTag = str.readNamedTag(); + if (!rootTag.getName().equals("Schematic")) { return false; } - byte[] nameBytes = new byte[str.readShort() & 0xFFFF]; - str.readFully(nameBytes); - String name = new String(nameBytes, NBTConstants.CHARSET); - if (!name.equals("Schematic")) { + CompoundTag schematicTag = (CompoundTag) rootTag.getTag(); + + // Check + Map schematic = schematicTag.getValue(); + if (!schematic.containsKey("Blocks")) { return false; } - str.readByte(); // Ignore - nameBytes = new byte[str.readShort() & 0xFFFF]; - str.readFully(nameBytes); - name = new String(nameBytes, NBTConstants.CHARSET); - return !name.equals("Version"); } catch (IOException e) { return false; } + return true; } }, SPONGE_SCHEMATIC("sponge", "schem") { @@ -103,26 +103,23 @@ public enum BuiltInClipboardFormat implements ClipboardFormat { @Override public boolean isFormat(File file) { - try (DataInputStream str = new DataInputStream(new GZIPInputStream(new FileInputStream(file)))) { - if ((str.readByte() & 0xFF) != NBTConstants.TYPE_COMPOUND) { + try (NBTInputStream str = new NBTInputStream(new GZIPInputStream(new FileInputStream(file)))) { + NamedTag rootTag = str.readNamedTag(); + if (!rootTag.getName().equals("Schematic")) { return false; } - byte[] nameBytes = new byte[str.readShort() & 0xFFFF]; - str.readFully(nameBytes); - String name = new String(nameBytes, NBTConstants.CHARSET); - if (!name.equals("Schematic")) { + CompoundTag schematicTag = (CompoundTag) rootTag.getTag(); + + // Check + Map schematic = schematicTag.getValue(); + if (!schematic.containsKey("Version")) { return false; } - if ((str.readByte() & 0xFF) != NBTConstants.TYPE_INT) { - return false; - } - nameBytes = new byte[str.readShort() & 0xFFFF]; - str.readFully(nameBytes); - name = new String(nameBytes, NBTConstants.CHARSET); - return name.equals("Version"); } catch (IOException e) { return false; } + + return true; } }; 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 ad1609ccd..593cd4432 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 @@ -119,7 +119,7 @@ public class SpongeSchematicReader extends NBTSchematicReader { int originZ = requireTag(metadata, "WEOriginZ", IntTag.class).getValue(); Vector min = new Vector(originX, originY, originZ); origin = min.subtract(offset); - region = new CuboidRegion(min, min.add(width, height, length).subtract(Vector.ONE)); + region = new CuboidRegion(origin, origin.add(width, height, length).subtract(Vector.ONE)); } else { origin = Vector.ZERO.subtract(offset); region = new CuboidRegion(origin, origin.add(width, height, length).subtract(Vector.ONE)); @@ -134,6 +134,9 @@ public class SpongeSchematicReader extends NBTSchematicReader { Map palette = new HashMap<>(); ParserContext parserContext = new ParserContext(); + parserContext.setRestricted(false); + parserContext.setTryLegacy(false); + parserContext.setPreferringWildcard(false); for (String palettePart : paletteObject.keySet()) { int id = requireTag(paletteObject, palettePart, IntTag.class).getValue(); @@ -186,9 +189,9 @@ public class SpongeSchematicReader extends NBTSchematicReader { i++; } // index = (y * length + z) * width + x - int y = index / (width * length); - int z = (index % (width * length)) / width; - int x = (index % (width * length)) % width; + int y = origin.getBlockY() + index / (width * length); + int z = origin.getBlockZ() + (index % (width * length)) / width; + int x = origin.getBlockX() + (index % (width * length)) % width; BlockState state = palette.get(value); BlockVector pt = new BlockVector(x, y, z); try { From 7773ef6f9a4e77590b51459625cfa3afb45ecb25 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 3 Aug 2018 19:49:36 +1000 Subject: [PATCH 69/74] Fixed a few issues with Sponge schematic handling. --- .../clipboard/io/SpongeSchematicReader.java | 2 +- .../clipboard/io/SpongeSchematicWriter.java | 73 +++++++++++-------- .../com/sk89q/worldedit/regions/Region.java | 35 +++++---- 3 files changed, 59 insertions(+), 51 deletions(-) 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 593cd4432..92a468c3f 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 @@ -159,7 +159,7 @@ public class SpongeSchematicReader extends NBTSchematicReader { .collect(Collectors.toList()); for (Map tileEntity : tileEntityTags) { - int[] pos = requireTag(schematic, "Pos", IntArrayTag.class).getValue(); + int[] pos = requireTag(tileEntity, "Pos", IntArrayTag.class).getValue(); tileEntitiesMap.put(new BlockVector(pos[0], pos[1], pos[2]), tileEntity); } } catch (Exception e) { 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 fc97a35f6..a737ff266 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 @@ -30,6 +30,7 @@ import com.sk89q.jnbt.NBTOutputStream; import com.sk89q.jnbt.ShortTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.extent.clipboard.Clipboard; @@ -119,40 +120,48 @@ public class SpongeSchematicWriter implements ClipboardWriter { ByteArrayOutputStream buffer = new ByteArrayOutputStream(width * height * length); - for (Vector point : region) { - BaseBlock block = clipboard.getFullBlock(point); - if (block.getNbtData() != null) { - Map values = new HashMap<>(); - for (Map.Entry entry : block.getNbtData().getValue().entrySet()) { - values.put(entry.getKey(), entry.getValue()); + for (int y = 0; y < height; y++) { + int y0 = min.getBlockY() + y; + for (int z = 0; z < length; z++) { + int z0 = min.getBlockZ() + z; + for (int x = 0; x < width; x++) { + int x0 = min.getBlockX() + x; + BlockVector point = new BlockVector(x0, y0, z0); + BaseBlock block = clipboard.getFullBlock(point); + if (block.getNbtData() != null) { + Map values = new HashMap<>(); + for (Map.Entry entry : block.getNbtData().getValue().entrySet()) { + values.put(entry.getKey(), entry.getValue()); + } + + values.put("Id", new StringTag(block.getNbtId())); + values.put("Pos", new IntArrayTag(new int[]{ + point.getBlockX(), + point.getBlockY(), + point.getBlockZ() + })); + + CompoundTag tileEntityTag = new CompoundTag(values); + tileEntities.add(tileEntityTag); + } + + String blockKey = block.toImmutableState().getAsString(); + int blockId; + if (palette.containsKey(blockKey)) { + blockId = palette.get(blockKey); + } else { + blockId = paletteMax; + palette.put(blockKey, blockId); + paletteMax++; + } + + while ((blockId & -128) != 0) { + buffer.write(blockId & 127 | 128); + blockId >>>= 7; + } + buffer.write(blockId); } - - values.put("Id", new StringTag(block.getNbtId())); - values.put("Pos", new IntArrayTag(new int[]{ - point.getBlockX(), - point.getBlockY(), - point.getBlockZ() - })); - - CompoundTag tileEntityTag = new CompoundTag(values); - tileEntities.add(tileEntityTag); } - - String blockKey = block.toImmutableState().getAsString(); - int blockId; - if (palette.containsKey(blockKey)) { - blockId = palette.get(blockKey); - } else { - blockId = paletteMax; - palette.put(blockKey, blockId); - paletteMax ++; - } - - while ((blockId & -128) != 0) { - buffer.write(blockId & 127 | 128); - blockId >>>= 7; - } - buffer.write(blockId); } schematic.put("PaletteMax", new IntTag(paletteMax)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java index ae72793a2..77bfa8440 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java @@ -40,14 +40,14 @@ public interface Region extends Iterable, Cloneable { * * @return min. point */ - public Vector getMinimumPoint(); + Vector getMinimumPoint(); /** * Get the upper point of a region. * * @return max. point */ - public Vector getMaximumPoint(); + Vector getMaximumPoint(); /** * Get the center point of a region. @@ -56,35 +56,35 @@ public interface Region extends Iterable, Cloneable { * * @return center point */ - public Vector getCenter(); + Vector getCenter(); /** * Get the number of blocks in the region. * * @return number of blocks */ - public int getArea(); + int getArea(); /** * Get X-size. * * @return width */ - public int getWidth(); + int getWidth(); /** * Get Y-size. * * @return height */ - public int getHeight(); + int getHeight(); /** * Get Z-size. * * @return length */ - public int getLength(); + int getLength(); /** * Expand the region. @@ -92,7 +92,7 @@ public interface Region extends Iterable, Cloneable { * @param changes array/arguments with multiple related changes * @throws RegionOperationException */ - public void expand(Vector... changes) throws RegionOperationException; + void expand(Vector... changes) throws RegionOperationException; /** * Contract the region. @@ -100,7 +100,7 @@ public interface Region extends Iterable, Cloneable { * @param changes array/arguments with multiple related changes * @throws RegionOperationException */ - public void contract(Vector... changes) throws RegionOperationException; + void contract(Vector... changes) throws RegionOperationException; /** * Shift the region. @@ -108,7 +108,7 @@ public interface Region extends Iterable, Cloneable { * @param change the change * @throws RegionOperationException */ - public void shift(Vector change) throws RegionOperationException; + void shift(Vector change) throws RegionOperationException; /** * Returns true based on whether the region contains the point. @@ -116,43 +116,42 @@ public interface Region extends Iterable, Cloneable { * @param position the position * @return true if contained */ - public boolean contains(Vector position); + boolean contains(Vector position); /** * Get a list of chunks. * * @return a list of chunk coordinates */ - public Set getChunks(); + Set getChunks(); /** * Return a list of 16*16*16 chunks in a region * * @return the chunk cubes this region overlaps with */ - public Set getChunkCubes(); + Set getChunkCubes(); /** * Sets the world that the selection is in. * * @return the world, or null */ - @Nullable - public World getWorld(); + @Nullable World getWorld(); /** * Sets the world that the selection is in. * * @param world the world, which may be null */ - public void setWorld(@Nullable World world); + void setWorld(@Nullable World world); /** * Make a clone of the region. * * @return a cloned version */ - public Region clone(); + Region clone(); /** * Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis. @@ -160,5 +159,5 @@ public interface Region extends Iterable, Cloneable { * @param maxPoints maximum number of points to generate. -1 for no limit. * @return the points. */ - public List polygonize(int maxPoints); + List polygonize(int maxPoints); } From 2f3bc59e1b79ce1360a5240cff6eecb6fee96f1a Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 3 Aug 2018 20:58:58 +1000 Subject: [PATCH 70/74] Fixed //move --- .../src/main/java/com/sk89q/worldedit/EditSession.java | 2 +- .../main/java/com/sk89q/worldedit/command/RegionCommands.java | 3 ++- .../com/sk89q/worldedit/internal/command/WorldEditBinding.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 687cc0be5..6ec84dfcc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -1046,7 +1046,7 @@ public class EditSession implements Extent { * @return number of blocks moved * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int moveRegion(Region region, Vector dir, int distance, boolean copyAir, BaseBlock replacement) throws MaxChangedBlocksException { + public int moveRegion(Region region, Vector dir, int distance, boolean copyAir, BlockStateHolder replacement) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(dir); checkArgument(distance >= 1, "distance >= 1 required"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 4bc7d084a..90f7203e3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -62,6 +62,7 @@ import com.sk89q.worldedit.util.command.binding.Range; import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.binding.Text; import com.sk89q.worldedit.util.command.parametric.Optional; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.ArrayList; import java.util.List; @@ -275,7 +276,7 @@ public class RegionCommands { @Selection Region region, @Optional("1") @Range(min = 1) int count, @Optional(Direction.AIM) @Direction Vector direction, - @Optional("air") BaseBlock replace, + @Optional("air") BlockStateHolder replace, @Switch('s') boolean moveSelection) throws WorldEditException { int affected = editSession.moveRegion(region, direction, count, true, replace); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java index 1d7d7d99b..eb06a9455 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java @@ -49,6 +49,7 @@ import com.sk89q.worldedit.util.command.parametric.ParameterException; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.Biomes; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.registry.BiomeRegistry; @@ -168,7 +169,7 @@ public class WorldEditBinding extends BindingHelper { * @throws ParameterException on error * @throws WorldEditException on error */ - @BindingMatch(type = BaseBlock.class, + @BindingMatch(type = {BaseBlock.class, BlockState.class, BlockStateHolder.class}, behavior = BindingBehavior.CONSUMES, consumedCount = 1) public BlockStateHolder getBaseBlock(ArgumentStack context) throws ParameterException, WorldEditException { From 3d265ff9b9af5c1eed9d0740cb63bac32f7dd63c Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 3 Aug 2018 21:18:57 +1000 Subject: [PATCH 71/74] Added entity translations --- .../clipboard/io/MCEditSchematicReader.java | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java index 13d99b452..ba6d5ad3b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java @@ -261,7 +261,7 @@ public class MCEditSchematicReader extends NBTSchematicReader { for (Tag tag : entityTags) { if (tag instanceof CompoundTag) { CompoundTag compound = (CompoundTag) tag; - String id = compound.getString("id"); + String id = convertEntityId(compound.getString("id")); Location location = NBTConversions.toLocation(clipboard, compound.getListTag("Pos"), compound.getListTag("Rotation")); if (!id.isEmpty()) { @@ -281,6 +281,36 @@ public class MCEditSchematicReader extends NBTSchematicReader { return clipboard; } + private String convertEntityId(String id) { + switch(id) { + case "xp_orb": + return "experience_orb"; + case "xp_bottle": + return "experience_bottle"; + case "eye_of_ender_signal": + return "eye_of_ender"; + case "ender_crystal": + return "end_crystal"; + case "fireworks_rocket": + return "firework_rocket"; + case "commandblock_minecart": + return "command_block_minecart"; + case "snowman": + return "snow_golem"; + case "villager_golem": + return "iron_golem"; + case "evocation_fangs": + return "evoker_fangs"; + case "evocation_illager": + return "evoker"; + case "vindication_illager": + return "vindicator"; + case "illusion_illager": + return "illusioner"; + } + return id; + } + @Override public void close() throws IOException { inputStream.close(); From b2bc043eebcce49a15f0d40aa7e1e8430aa91c49 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 3 Aug 2018 21:51:30 +1000 Subject: [PATCH 72/74] Added 155:3 and 155:4 translation --- .../resources/com/sk89q/worldedit/world/registry/legacy.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json index 5e93ce540..de49e6443 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json @@ -1052,6 +1052,8 @@ "155:0": "minecraft:quartz_block", "155:1": "minecraft:chiseled_quartz_block", "155:2": "minecraft:quartz_pillar[axis=y]", + "155:3": "minecraft:quartz_pillar[axis=x]", + "155:4": "minecraft:quartz_pillar[axis=z]", "155:6": "minecraft:quartz_pillar[axis=x]", "155:10": "minecraft:quartz_pillar[axis=z]", "156:0": "minecraft:quartz_stairs[half=bottom,shape=outer_right,facing=east]", From b2769befdb1529d62702efb834bdcc9c72b7ce56 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 3 Aug 2018 23:01:56 +1000 Subject: [PATCH 73/74] Added a few utility methods. --- .../sk89q/worldedit/bukkit/BukkitAdapter.java | 21 +++++++++++++++++++ .../extension/factory/DefaultBlockParser.java | 5 ++++- .../worldedit/world/block/BlockState.java | 8 +++---- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java index 4f41c7e94..f1181cf50 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java @@ -41,6 +41,7 @@ import com.sk89q.worldedit.world.item.ItemTypes; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.data.BlockData; +import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import java.util.HashMap; @@ -106,6 +107,26 @@ public class BukkitAdapter { return new BukkitWorld(world); } + /** + * Create a WorldEdit Player from a Bukkit Player. + * + * @param player The Bukkit player + * @return The WorldEdit player + */ + public static BukkitPlayer adapt(Player player) { + return WorldEditPlugin.getInstance().wrapPlayer(player); + } + + /** + * Create a Bukkit Player from a WorldEdit Player. + * + * @param player The WorldEdit player + * @return The Bukkit player + */ + public static Player adapt(com.sk89q.worldedit.entity.Player player) { + return ((BukkitPlayer) player).getPlayer(); + } + /** * Create a Bukkit world from a WorldEdit world. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java index 83959d638..f7bf9770d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultBlockParser.java @@ -268,7 +268,10 @@ class DefaultBlockParser extends InputParser { // No wildcards allowed => eliminate them. (Start with default state) state = blockType.getDefaultState(); } else { - state = new BlockState(blockType, blockStates); + state = blockType.getDefaultState().toFuzzy(); + for (Map.Entry, Object> blockState : blockStates.entrySet()) { + state = state.with((Property) blockState.getKey(), blockState.getValue()); + } } state = applyProperties(state, stateProperties); 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 908a2ba67..f32159e55 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 @@ -50,7 +50,7 @@ public class BlockState implements BlockStateHolder { // Neighbouring state table. private Table, Object, BlockState> states; - BlockState(BlockType blockType) { + private BlockState(BlockType blockType) { this.blockType = blockType; this.values = new LinkedHashMap<>(); this.fuzzy = false; @@ -62,13 +62,13 @@ public class BlockState implements BlockStateHolder { * @param blockType The block type * @param values The block state values */ - public BlockState(BlockType blockType, Map, Object> values) { + private BlockState(BlockType blockType, Map, Object> values) { this.blockType = blockType; this.values = values; this.fuzzy = true; } - public static Map, Object>, BlockState> generateStateMap(BlockType blockType) { + static Map, Object>, BlockState> generateStateMap(BlockType blockType) { Map, Object>, BlockState> stateMap = new LinkedHashMap<>(); List properties = blockType.getProperties(); @@ -105,7 +105,7 @@ public class BlockState implements BlockStateHolder { return stateMap; } - public void populate(Map, Object>, BlockState> stateMap) { + private void populate(Map, Object>, BlockState> stateMap) { final Table, Object, BlockState> states = HashBasedTable.create(); for(final Map.Entry, Object> entry : this.values.entrySet()) { From 38cff7c7b2c09b9c948e717ee70fbdd67b295784 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sat, 4 Aug 2018 10:59:14 +1000 Subject: [PATCH 74/74] Fixed up tile entities in Sponge schematics. --- .../clipboard/io/BuiltInClipboardFormat.java | 2 +- .../clipboard/io/SpongeSchematicReader.java | 16 ++++++++-------- .../clipboard/io/SpongeSchematicWriter.java | 19 ++++++++++--------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java index 5c8672f08..3f3063032 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java @@ -73,7 +73,7 @@ public enum BuiltInClipboardFormat implements ClipboardFormat { // Check Map schematic = schematicTag.getValue(); - if (!schematic.containsKey("Blocks")) { + if (!schematic.containsKey("Materials")) { return false; } } catch (IOException e) { 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 92a468c3f..73f0cee8c 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 @@ -110,18 +110,18 @@ public class SpongeSchematicReader extends NBTSchematicReader { throw new IOException("Invalid offset specified in schematic."); } - Vector offset = new Vector(offsetParts[0], offsetParts[1], offsetParts[2]); + Vector min = new Vector(offsetParts[0], offsetParts[1], offsetParts[2]); - if (metadata.containsKey("WEOriginX")) { + if (metadata.containsKey("WEOffsetX")) { // We appear to have WorldEdit Metadata - int originX = requireTag(metadata, "WEOriginX", IntTag.class).getValue(); - int originY = requireTag(metadata, "WEOriginY", IntTag.class).getValue(); - int originZ = requireTag(metadata, "WEOriginZ", IntTag.class).getValue(); - Vector min = new Vector(originX, originY, originZ); + int offsetX = requireTag(metadata, "WEOffsetX", IntTag.class).getValue(); + int offsetY = requireTag(metadata, "WEOffsetY", IntTag.class).getValue(); + int offsetZ = requireTag(metadata, "WEOffsetZ", IntTag.class).getValue(); + Vector offset = new Vector(offsetX, offsetY, offsetZ); origin = min.subtract(offset); region = new CuboidRegion(origin, origin.add(width, height, length).subtract(Vector.ONE)); } else { - origin = Vector.ZERO.subtract(offset); + origin = min; region = new CuboidRegion(origin, origin.add(width, height, length).subtract(Vector.ONE)); } @@ -160,7 +160,7 @@ public class SpongeSchematicReader extends NBTSchematicReader { for (Map tileEntity : tileEntityTags) { int[] pos = requireTag(tileEntity, "Pos", IntArrayTag.class).getValue(); - tileEntitiesMap.put(new BlockVector(pos[0], pos[1], pos[2]), tileEntity); + tileEntitiesMap.put(origin.add(new BlockVector(pos[0], pos[1], pos[2])).toBlockVector(), tileEntity); } } catch (Exception e) { throw new IOException("Failed to load Tile Entities: " + e.getMessage()); 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 a737ff266..e93b498e3 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 @@ -97,9 +97,9 @@ public class SpongeSchematicWriter implements ClipboardWriter { schematic.put("Version", new IntTag(1)); Map metadata = new HashMap<>(); - metadata.put("WEOriginX", new IntTag(min.getBlockX())); - metadata.put("WEOriginY", new IntTag(min.getBlockY())); - metadata.put("WEOriginZ", new IntTag(min.getBlockZ())); + metadata.put("WEOffsetX", new IntTag(offset.getBlockX())); + metadata.put("WEOffsetY", new IntTag(offset.getBlockY())); + metadata.put("WEOffsetZ", new IntTag(offset.getBlockZ())); schematic.put("Metadata", new CompoundTag(metadata)); @@ -107,10 +107,11 @@ public class SpongeSchematicWriter implements ClipboardWriter { schematic.put("Height", new ShortTag((short) height)); schematic.put("Length", new ShortTag((short) length)); + // The Sponge format Offset refers to the 'min' points location in the world. That's our 'Origin' schematic.put("Offset", new IntArrayTag(new int[]{ - offset.getBlockX(), - offset.getBlockY(), - offset.getBlockZ(), + min.getBlockX(), + min.getBlockY(), + min.getBlockZ(), })); int paletteMax = 0; @@ -136,9 +137,9 @@ public class SpongeSchematicWriter implements ClipboardWriter { values.put("Id", new StringTag(block.getNbtId())); values.put("Pos", new IntArrayTag(new int[]{ - point.getBlockX(), - point.getBlockY(), - point.getBlockZ() + x, + y, + z })); CompoundTag tileEntityTag = new CompoundTag(values);