From 8aef06b29e8373eae5e52a01e5a6ba90a5e5161d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 3 Apr 2019 17:00:59 +1100 Subject: [PATCH] * haven't done one of these in a while *continuing with merge in previous commit --- .../java/com/sk89q/worldedit/CuboidClipboard.java | 5 ----- .../java/com/sk89q/worldedit/extent/Extent.java | 10 ++++++++++ .../com/sk89q/worldedit/world/biome/BiomeType.java | 13 +++++++++---- .../com/sk89q/worldedit/world/biome/BiomeTypes.java | 5 ++++- 4 files changed, 23 insertions(+), 10 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 bb87f2c5d..3df93c3bf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/CuboidClipboard.java @@ -149,11 +149,6 @@ public class CuboidClipboard { return clipboard; } - private BaseBlock adapt(BlockState state) { -// if (state instanceof BaseBlock) return (BaseBlock) state; - return new BaseBlock(state); - } - /* ------------------------------------------------------------------------------------------------------------- */ public BaseBlock getBlock(BlockVector3 position) { 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 0a5a951e0..778eb014e 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,13 +22,23 @@ package com.sk89q.worldedit.extent; import com.boydti.fawe.jnbt.anvil.generator.*; import com.boydti.fawe.object.PseudoRandom; import com.boydti.fawe.object.clipboard.WorldCopyClipboard; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; +import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; +import com.sk89q.worldedit.function.mask.Mask; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.registry.state.PropertyGroup; +import com.sk89q.worldedit.session.ClipboardHolder; +import com.sk89q.worldedit.util.Countable; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import javax.annotation.Nullable; import java.util.ArrayList; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeType.java index 7dc155253..cdba7555c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeType.java @@ -27,11 +27,16 @@ import com.sk89q.worldedit.registry.NamespacedRegistry; public class BiomeType { public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("biome type"); + private final int internalId; + private final String id; - private String id; - - public BiomeType(String id) { + protected BiomeType(String id, int internalId) { this.id = id; + this.internalId = internalId; + } + + public int getInternalId() { + return internalId; } /** @@ -50,7 +55,7 @@ public class BiomeType { @Override public int hashCode() { - return this.id.hashCode(); + return this.internalId; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeTypes.java index a9d07a5fc..bc9a5c571 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeTypes.java @@ -103,8 +103,11 @@ public class BiomeTypes { private BiomeTypes() { } + private static int index = 0; + private static BiomeType register(final String id) { - return register(new BiomeType(id)); + // TODO implement registry + return register(new BiomeType(id, index++)); } public static BiomeType register(final BiomeType biome) {