From c564278dd6a0ae59434361361527d6299b898945 Mon Sep 17 00:00:00 2001 From: sk89q Date: Thu, 10 Jul 2014 14:50:40 -0700 Subject: [PATCH] Revert Extent.createEntity() taking a Vector. --- .../java/com/sk89q/worldedit/bukkit/BukkitWorld.java | 2 +- .../java/com/sk89q/worldedit/forge/ForgeWorld.java | 3 ++- src/main/java/com/sk89q/worldedit/EditSession.java | 4 ++-- .../worldedit/extent/AbstractDelegateExtent.java | 6 ++++-- src/main/java/com/sk89q/worldedit/extent/Extent.java | 5 +++-- .../java/com/sk89q/worldedit/extent/NullExtent.java | 3 ++- .../extent/clipboard/BlockArrayClipboard.java | 4 ++-- .../sk89q/worldedit/internal/LocalWorldAdapter.java | 4 ++-- .../java/com/sk89q/worldedit/world/NullWorld.java | 11 +++-------- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/bukkit/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/src/bukkit/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 3a02fb266..72a774ede 100644 --- a/src/bukkit/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/src/bukkit/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -233,7 +233,7 @@ public class BukkitWorld extends LocalWorld { @Nullable @Override - public com.sk89q.worldedit.entity.Entity createEntity(Vector position, BaseEntity entity) { + public com.sk89q.worldedit.entity.Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) { throw new UnsupportedOperationException("Not implemented yet"); } diff --git a/src/forge/java/com/sk89q/worldedit/forge/ForgeWorld.java b/src/forge/java/com/sk89q/worldedit/forge/ForgeWorld.java index ad826f6c4..5087799a7 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/src/forge/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -33,6 +33,7 @@ import com.sk89q.worldedit.blocks.LazyBlock; 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.AbstractWorld; import com.sk89q.worldedit.world.registry.LegacyWorldData; @@ -509,7 +510,7 @@ public class ForgeWorld extends AbstractWorld { @Nullable @Override - public Entity createEntity(Vector position, BaseEntity entity) { + public Entity createEntity(Location location, BaseEntity entity) { World world = getWorld(); net.minecraft.entity.Entity createdEntity = EntityList.createEntityByName(entity.getTypeId(), world); if (createdEntity != null) { diff --git a/src/main/java/com/sk89q/worldedit/EditSession.java b/src/main/java/com/sk89q/worldedit/EditSession.java index 1de0cfcd9..7ad6b867f 100644 --- a/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/src/main/java/com/sk89q/worldedit/EditSession.java @@ -589,8 +589,8 @@ public class EditSession implements Extent { @Override @Nullable - public Entity createEntity(Vector position, BaseEntity entity) { - return world.createEntity(position, entity); + public Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) { + return world.createEntity(location, entity); } /** diff --git a/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java b/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java index 445eeeebc..666c33872 100644 --- a/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java @@ -26,8 +26,10 @@ 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 javax.annotation.Nullable; + import java.util.List; import static com.google.common.base.Preconditions.checkNotNull; @@ -75,8 +77,8 @@ public abstract class AbstractDelegateExtent implements Extent { @Override @Nullable - public Entity createEntity(Vector position, BaseEntity entity) { - return extent.createEntity(position, entity); + public Entity createEntity(Location location, BaseEntity entity) { + return extent.createEntity(location, entity); } @Override diff --git a/src/main/java/com/sk89q/worldedit/extent/Extent.java b/src/main/java/com/sk89q/worldedit/extent/Extent.java index 2048ca007..14bacb425 100644 --- a/src/main/java/com/sk89q/worldedit/extent/Extent.java +++ b/src/main/java/com/sk89q/worldedit/extent/Extent.java @@ -22,6 +22,7 @@ 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 javax.annotation.Nullable; import java.util.List; @@ -69,10 +70,10 @@ public interface Extent extends InputExtent, OutputExtent { /** * Create an entity at the given location. * - * @param position the position * @param entity the entity + * @param location the location * @return a reference to the created entity, or null if the entity could not be created */ - @Nullable Entity createEntity(Vector position, BaseEntity entity); + @Nullable Entity createEntity(Location location, BaseEntity entity); } diff --git a/src/main/java/com/sk89q/worldedit/extent/NullExtent.java b/src/main/java/com/sk89q/worldedit/extent/NullExtent.java index a24f4cf48..5f8f84644 100644 --- a/src/main/java/com/sk89q/worldedit/extent/NullExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/NullExtent.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.blocks.BaseBlock; 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 javax.annotation.Nullable; import java.util.Collections; @@ -55,7 +56,7 @@ public class NullExtent implements Extent { @Nullable @Override - public Entity createEntity(Vector position, BaseEntity entity) { + public Entity createEntity(Location location, BaseEntity entity) { return null; } diff --git a/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index 29a66372a..5c40d42e2 100644 --- a/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -99,8 +99,8 @@ public class BlockArrayClipboard implements Clipboard { @Nullable @Override - public Entity createEntity(Vector position, BaseEntity entity) { - ClipboardEntity ret = new ClipboardEntity(new Location(this, position), entity); + public Entity createEntity(Location location, BaseEntity entity) { + ClipboardEntity ret = new ClipboardEntity(location, entity); entities.add(ret); return ret; } diff --git a/src/main/java/com/sk89q/worldedit/internal/LocalWorldAdapter.java b/src/main/java/com/sk89q/worldedit/internal/LocalWorldAdapter.java index 30e7e00db..dd04767b5 100644 --- a/src/main/java/com/sk89q/worldedit/internal/LocalWorldAdapter.java +++ b/src/main/java/com/sk89q/worldedit/internal/LocalWorldAdapter.java @@ -330,8 +330,8 @@ public class LocalWorldAdapter extends LocalWorld { @Override @Nullable - public Entity createEntity(Vector position, BaseEntity entity) { - return world.createEntity(position, entity); + public Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) { + return world.createEntity(location, entity); } @Override diff --git a/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/src/main/java/com/sk89q/worldedit/world/NullWorld.java index b65aecd98..937ba9c3b 100644 --- a/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -19,19 +19,14 @@ package com.sk89q.worldedit.world; -import com.sk89q.worldedit.BiomeType; -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.EntityType; -import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.Vector2D; -import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.*; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BlockID; 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.registry.LegacyWorldData; import com.sk89q.worldedit.world.registry.WorldData; @@ -121,7 +116,7 @@ public class NullWorld extends AbstractWorld { @Nullable @Override - public Entity createEntity(Vector position, BaseEntity entity) { + public Entity createEntity(Location location, BaseEntity entity) { return null; } }