From d5012bb07216b14543f5dd4f8ab1ecceb0486031 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 3 Jan 2018 16:49:57 +1000 Subject: [PATCH] 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();