From c2932cc54f408cf689dc23a2fbb097cb588a590e Mon Sep 17 00:00:00 2001 From: Wizjany Date: Mon, 25 Feb 2013 01:22:05 -0500 Subject: [PATCH] Cleanup forge code. Make it singleplayer friendly. --- .../sk89q/worldedit/forge/ForgeBiomeType.java | 3 +- .../worldedit/forge/ForgeBiomeTypes.java | 13 ++-- .../worldedit/forge/ForgeConfiguration.java | 3 +- .../sk89q/worldedit/forge/ForgePlayer.java | 11 ++- .../worldedit/forge/ForgeServerInterface.java | 21 +++--- .../com/sk89q/worldedit/forge/ForgeUtil.java | 12 ++-- .../com/sk89q/worldedit/forge/ForgeWorld.java | 71 +++++++++++-------- .../worldedit/forge/TileEntityBaseBlock.java | 10 ++- .../worldedit/forge/WECUIPacketHandler.java | 9 ++- .../forge/WorldEditForgeListener.java | 20 +++--- .../sk89q/worldedit/forge/WorldEditMod.java | 58 +++++++-------- .../forge/selections/CuboidSelection.java | 3 +- .../selections/Polygonal2DSelection.java | 8 ++- .../forge/selections/RegionSelection.java | 4 +- .../worldedit/forge/selections/Selection.java | 3 +- 15 files changed, 134 insertions(+), 115 deletions(-) diff --git a/src/forge/java/com/sk89q/worldedit/forge/ForgeBiomeType.java b/src/forge/java/com/sk89q/worldedit/forge/ForgeBiomeType.java index 48fbea3b1..87e9bcb13 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/ForgeBiomeType.java +++ b/src/forge/java/com/sk89q/worldedit/forge/ForgeBiomeType.java @@ -1,8 +1,9 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.BiomeType; import net.minecraft.world.biome.BiomeGenBase; +import com.sk89q.worldedit.BiomeType; + public class ForgeBiomeType implements BiomeType { private BiomeGenBase biome; diff --git a/src/forge/java/com/sk89q/worldedit/forge/ForgeBiomeTypes.java b/src/forge/java/com/sk89q/worldedit/forge/ForgeBiomeTypes.java index 2c0c44611..435583582 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/ForgeBiomeTypes.java +++ b/src/forge/java/com/sk89q/worldedit/forge/ForgeBiomeTypes.java @@ -1,16 +1,17 @@ package com.sk89q.worldedit.forge; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.world.biome.BiomeGenBase; + import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import com.sk89q.worldedit.BiomeType; import com.sk89q.worldedit.BiomeTypes; import com.sk89q.worldedit.UnknownBiomeTypeException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import net.minecraft.world.biome.BiomeGenBase; public class ForgeBiomeTypes implements BiomeTypes { private static BiMap biomes = HashBiMap.create(); diff --git a/src/forge/java/com/sk89q/worldedit/forge/ForgeConfiguration.java b/src/forge/java/com/sk89q/worldedit/forge/ForgeConfiguration.java index c68effb2e..a52232cfc 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/ForgeConfiguration.java +++ b/src/forge/java/com/sk89q/worldedit/forge/ForgeConfiguration.java @@ -1,8 +1,9 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.util.PropertiesConfiguration; import java.io.File; +import com.sk89q.worldedit.util.PropertiesConfiguration; + public class ForgeConfiguration extends PropertiesConfiguration { public ForgeConfiguration(WorldEditMod mod) { diff --git a/src/forge/java/com/sk89q/worldedit/forge/ForgePlayer.java b/src/forge/java/com/sk89q/worldedit/forge/ForgePlayer.java index 54c758e86..8954a8e81 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/src/forge/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -1,7 +1,10 @@ package com.sk89q.worldedit.forge; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.network.packet.Packet250CustomPayload; + import com.sk89q.util.StringUtil; -import com.sk89q.wepif.PermissionsResolverManager; import com.sk89q.worldedit.LocalPlayer; import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; @@ -9,12 +12,6 @@ import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.bags.BlockBag; import com.sk89q.worldedit.cui.CUIEvent; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.network.NetServerHandler; -import net.minecraft.network.packet.Packet250CustomPayload; - public class ForgePlayer extends LocalPlayer { private EntityPlayerMP player; diff --git a/src/forge/java/com/sk89q/worldedit/forge/ForgeServerInterface.java b/src/forge/java/com/sk89q/worldedit/forge/ForgeServerInterface.java index 0fb26af8c..a67af9e0f 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/ForgeServerInterface.java +++ b/src/forge/java/com/sk89q/worldedit/forge/ForgeServerInterface.java @@ -1,23 +1,23 @@ package com.sk89q.worldedit.forge; -import com.sk89q.minecraft.util.commands.Command; -import com.sk89q.minecraft.util.commands.CommandsManager; -import com.sk89q.worldedit.BiomeTypes; -import com.sk89q.worldedit.LocalWorld; -import com.sk89q.worldedit.ServerInterface; -import cpw.mods.fml.server.FMLServerHandler; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Map; + import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.command.ServerCommandManager; import net.minecraft.entity.EntityList; import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; import net.minecraft.world.WorldServer; +import com.sk89q.minecraft.util.commands.Command; +import com.sk89q.worldedit.BiomeTypes; +import com.sk89q.worldedit.LocalWorld; +import com.sk89q.worldedit.ServerInterface; + +import cpw.mods.fml.common.FMLCommonHandler; + public class ForgeServerInterface extends ServerInterface { private WorldEditMod mod; private MinecraftServer server; @@ -25,7 +25,7 @@ public class ForgeServerInterface extends ServerInterface { public ForgeServerInterface() { this.mod = WorldEditMod.inst; - this.server = FMLServerHandler.instance().getServer(); + this.server = FMLCommonHandler.instance().getMinecraftServerInstance(); this.biomes = new ForgeBiomeTypes(); } @@ -59,7 +59,8 @@ public class ForgeServerInterface extends ServerInterface { @Override public void onCommandRegistration(List commands) { - ServerCommandManager mcMan = (ServerCommandManager) FMLServerHandler.instance().getServer().getCommandManager(); + if (server == null) return; + ServerCommandManager mcMan = (ServerCommandManager) server.getCommandManager(); for (Command cmd : commands) { for (int i = 0; i < cmd.aliases().length; i++) { final String name = cmd.aliases()[i]; diff --git a/src/forge/java/com/sk89q/worldedit/forge/ForgeUtil.java b/src/forge/java/com/sk89q/worldedit/forge/ForgeUtil.java index 3afa50e9d..3b3963f8d 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/ForgeUtil.java +++ b/src/forge/java/com/sk89q/worldedit/forge/ForgeUtil.java @@ -1,19 +1,19 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.blocks.BaseItemStack; - -import cpw.mods.fml.server.FMLServerHandler; - import java.util.Map; -import java.util.Map.Entry; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; +import com.sk89q.worldedit.blocks.BaseItemStack; + +import cpw.mods.fml.common.FMLCommonHandler; + public class ForgeUtil { public static boolean hasPermission(EntityPlayerMP player, String perm) { - return FMLServerHandler.instance().getServer().getConfigurationManager().getOps().contains(player.username); + // TODO fix WEPIF + return FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().areCommandsAllowed(player.username); } public static ItemStack toForgeItemStack(BaseItemStack item) { diff --git a/src/forge/java/com/sk89q/worldedit/forge/ForgeWorld.java b/src/forge/java/com/sk89q/worldedit/forge/ForgeWorld.java index 6d850e841..7683bece8 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/src/forge/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -1,29 +1,7 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.BiomeType; -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.EntityType; -import com.sk89q.worldedit.LocalWorld; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.Vector2D; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.TileEntityBlock; -import com.sk89q.worldedit.blocks.SignBlock; -import com.sk89q.worldedit.blocks.NoteBlock; -import com.sk89q.worldedit.blocks.SkullBlock; -import com.sk89q.worldedit.blocks.DispenserBlock; -import com.sk89q.worldedit.blocks.MobSpawnerBlock; -import com.sk89q.worldedit.blocks.ChestBlock; -import com.sk89q.worldedit.blocks.ContainerBlock; -import com.sk89q.worldedit.blocks.FurnaceBlock; -import com.sk89q.worldedit.foundation.Block; -import com.sk89q.worldedit.regions.Region; -import java.lang.reflect.Field; import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityHanging; import net.minecraft.entity.EntityLiving; @@ -44,21 +22,32 @@ import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.tileentity.TileEntityNote; import net.minecraft.tileentity.TileEntitySign; import net.minecraft.tileentity.TileEntitySkull; -import net.minecraft.util.LongHashMap; import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.gen.ChunkProviderServer; + +import com.sk89q.worldedit.BiomeType; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.EntityType; +import com.sk89q.worldedit.LocalWorld; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; +import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.BaseItemStack; +import com.sk89q.worldedit.blocks.MobSpawnerBlock; +import com.sk89q.worldedit.blocks.NoteBlock; +import com.sk89q.worldedit.blocks.SignBlock; +import com.sk89q.worldedit.blocks.SkullBlock; +import com.sk89q.worldedit.blocks.TileEntityBlock; +import com.sk89q.worldedit.foundation.Block; +import com.sk89q.worldedit.regions.Region; public class ForgeWorld extends LocalWorld { + // TODO fix world leaks (see net.minecraftforge.common.getIDs()Z;) private World world; public ForgeWorld(World world) { @@ -382,9 +371,31 @@ public class ForgeWorld extends LocalWorld { } EntityLiving ent = (EntityLiving) obj; - if (((ent instanceof EntityPlayer)) || ((!killAnimals) && ((ent instanceof EntityAnimal))) || ((!killPets) && ((ent instanceof EntityTameable)) && (((EntityTameable) ent).isTamed())) || ((!killGolems) && ((ent instanceof EntityGolem))) || ((!killNPCs) && ((ent instanceof EntityVillager))) || ((!killAmbient) && ((ent instanceof EntityAmbientCreature)))) { + if (ent instanceof EntityPlayer) { continue; } + + if (!killAnimals && ent instanceof EntityAnimal) { + continue; + } + + if (!killPets && ent instanceof EntityTameable && ((EntityTameable) ent).isTamed()) { + continue; // tamed pet + } + + if (!killGolems && ent instanceof EntityGolem) { + continue; + } + + if (!killNPCs && ent instanceof EntityVillager) { + continue; + } + + if (!killAmbient && ent instanceof EntityAmbientCreature) { + continue; + } + + if ((radius < 0.0D) || (origin.distanceSq(new Vector(ent.posX, ent.posY, ent.posZ)) <= radiusSq)) { ent.isDead = true; num++; diff --git a/src/forge/java/com/sk89q/worldedit/forge/TileEntityBaseBlock.java b/src/forge/java/com/sk89q/worldedit/forge/TileEntityBaseBlock.java index f82e947c5..e310514fe 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/TileEntityBaseBlock.java +++ b/src/forge/java/com/sk89q/worldedit/forge/TileEntityBaseBlock.java @@ -1,18 +1,16 @@ package com.sk89q.worldedit.forge; import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.TileEntityBlock; - -import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagInt; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.blocks.TileEntityBlock; + public class TileEntityBaseBlock extends BaseBlock implements TileEntityBlock { private TileEntity tile; diff --git a/src/forge/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java b/src/forge/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java index 0f88be7fd..f707bf9af 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java +++ b/src/forge/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java @@ -1,13 +1,16 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.LocalSession; -import cpw.mods.fml.common.network.IPacketHandler; -import cpw.mods.fml.common.network.Player; import java.nio.charset.Charset; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet250CustomPayload; +import com.sk89q.worldedit.LocalSession; + +import cpw.mods.fml.common.network.IPacketHandler; +import cpw.mods.fml.common.network.Player; + public class WECUIPacketHandler implements IPacketHandler { public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8"); diff --git a/src/forge/java/com/sk89q/worldedit/forge/WorldEditForgeListener.java b/src/forge/java/com/sk89q/worldedit/forge/WorldEditForgeListener.java index d312602e0..b46f789f9 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/WorldEditForgeListener.java +++ b/src/forge/java/com/sk89q/worldedit/forge/WorldEditForgeListener.java @@ -1,22 +1,23 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.LocalPlayer; -import com.sk89q.worldedit.LocalWorld; -import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldVector; -import net.minecraft.command.ICommand; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.event.CommandEvent; import net.minecraftforge.event.Event.Result; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; + +import com.sk89q.worldedit.LocalPlayer; +import com.sk89q.worldedit.LocalWorld; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldVector; public class WorldEditForgeListener { + @ForgeSubscribe public void onCommandEvent(CommandEvent event) { + if (WorldEditMod.inst.getWorldEdit() == null) return; if ((event.sender instanceof EntityPlayerMP)) { + if (((EntityPlayerMP) event.sender).worldObj.isRemote) return; String[] split = new String[event.parameters.length + 1]; System.arraycopy(event.parameters, 0, split, 1, event.parameters.length); split[0] = ("/" + event.command.getCommandName()); @@ -27,9 +28,8 @@ public class WorldEditForgeListener { @ForgeSubscribe public void onPlayerInteract(PlayerInteractEvent event) { - if (event.useItem == Result.DENY) { - return; - } + if (WorldEditMod.inst.getWorldEdit() == null) return; + if (event.useItem == Result.DENY || event.entity.worldObj.isRemote) return; LocalPlayer player = WorldEditMod.inst.wrapPlayer((EntityPlayerMP) event.entityPlayer); LocalWorld world = WorldEditMod.inst.getWorld(event.entityPlayer.worldObj); diff --git a/src/forge/java/com/sk89q/worldedit/forge/WorldEditMod.java b/src/forge/java/com/sk89q/worldedit/forge/WorldEditMod.java index 59b711f9b..e6cbbd09d 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/WorldEditMod.java +++ b/src/forge/java/com/sk89q/worldedit/forge/WorldEditMod.java @@ -1,23 +1,5 @@ package com.sk89q.worldedit.forge; -import com.sk89q.util.yaml.YAMLProcessor; -import com.sk89q.wepif.PermissionsResolverManager; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.LocalWorld; -import com.sk89q.worldedit.ServerInterface; -import com.sk89q.worldedit.WorldEdit; -import cpw.mods.fml.common.FMLLog; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.Init; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.Mod.PostInit; -import cpw.mods.fml.common.Mod.PreInit; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -29,9 +11,25 @@ import java.util.zip.ZipEntry; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; -import net.minecraft.world.WorldServer; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.EventBus; + +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.LocalWorld; +import com.sk89q.worldedit.ServerInterface; +import com.sk89q.worldedit.WorldEdit; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.ServerStarting; +import cpw.mods.fml.common.Mod.ServerStopping; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.event.FMLServerStoppingEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; @Mod(modid = "WorldEdit", name = "WorldEdit", version = "5.5.2-forge-alpha1") public class WorldEditMod { @@ -46,7 +44,6 @@ public class WorldEditMod { private ForgeConfiguration config; private File workingDir; - @SideOnly(Side.SERVER) @Mod.PreInit public void preInit(FMLPreInitializationEvent event) { logger = Logger.getLogger(((Mod) getClass().getAnnotation(Mod.class)).modid()); @@ -66,23 +63,28 @@ public class WorldEditMod { // PermissionsResolverManager.initialize(this, this.workingDir); } - @SideOnly(Side.SERVER) @Mod.Init public void init(FMLInitializationEvent event) { - this.server = new ForgeServerInterface(); - this.controller = new WorldEdit(this.server, this.config); - - NetworkRegistry.instance().registerChannel(new WECUIPacketHandler(), "WECUI"); + if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { + NetworkRegistry.instance().registerChannel(new WECUIPacketHandler(), "WECUI"); + } /* else { + WE CUI stuff here? + } */ MinecraftForge.EVENT_BUS.register(new WorldEditForgeListener()); } - @SideOnly(Side.SERVER) @Mod.PostInit public void postInit(FMLPostInitializationEvent event) { logger.info("WorldEdit " + WorldEdit.getVersion() + " Loaded"); } + @ServerStarting + public void serverStarting(FMLServerStartingEvent event) { + this.server = new ForgeServerInterface(); + this.controller = new WorldEdit(this.server, this.config); + } + public ForgeConfiguration getConfig() { return this.config; } @@ -156,4 +158,4 @@ public class WorldEditMod { } } } -} \ No newline at end of file +} diff --git a/src/forge/java/com/sk89q/worldedit/forge/selections/CuboidSelection.java b/src/forge/java/com/sk89q/worldedit/forge/selections/CuboidSelection.java index c1359d959..dcdad00de 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/selections/CuboidSelection.java +++ b/src/forge/java/com/sk89q/worldedit/forge/selections/CuboidSelection.java @@ -1,12 +1,13 @@ package com.sk89q.worldedit.forge.selections; +import net.minecraft.world.World; + import com.sk89q.worldedit.Location; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.forge.WorldEditMod; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegionSelector; import com.sk89q.worldedit.regions.RegionSelector; -import net.minecraft.world.World; public class CuboidSelection extends RegionSelection { protected CuboidRegion cuboid; diff --git a/src/forge/java/com/sk89q/worldedit/forge/selections/Polygonal2DSelection.java b/src/forge/java/com/sk89q/worldedit/forge/selections/Polygonal2DSelection.java index aad2be9eb..d54828dad 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/selections/Polygonal2DSelection.java +++ b/src/forge/java/com/sk89q/worldedit/forge/selections/Polygonal2DSelection.java @@ -1,13 +1,15 @@ package com.sk89q.worldedit.forge.selections; +import java.util.Collections; +import java.util.List; + +import net.minecraft.world.World; + import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.forge.WorldEditMod; import com.sk89q.worldedit.regions.Polygonal2DRegion; import com.sk89q.worldedit.regions.Polygonal2DRegionSelector; import com.sk89q.worldedit.regions.RegionSelector; -import java.util.Collections; -import java.util.List; -import net.minecraft.world.World; public class Polygonal2DSelection extends RegionSelection { protected Polygonal2DRegion poly2d; diff --git a/src/forge/java/com/sk89q/worldedit/forge/selections/RegionSelection.java b/src/forge/java/com/sk89q/worldedit/forge/selections/RegionSelection.java index 1c0d21e5e..7b923a781 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/selections/RegionSelection.java +++ b/src/forge/java/com/sk89q/worldedit/forge/selections/RegionSelection.java @@ -1,12 +1,12 @@ package com.sk89q.worldedit.forge.selections; -import com.sk89q.worldedit.LocalWorld; +import net.minecraft.world.World; + import com.sk89q.worldedit.Location; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.forge.WorldEditMod; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionSelector; -import net.minecraft.world.World; public abstract class RegionSelection implements Selection { private World world; diff --git a/src/forge/java/com/sk89q/worldedit/forge/selections/Selection.java b/src/forge/java/com/sk89q/worldedit/forge/selections/Selection.java index eb1ec8a31..815b5a530 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/selections/Selection.java +++ b/src/forge/java/com/sk89q/worldedit/forge/selections/Selection.java @@ -1,9 +1,10 @@ package com.sk89q.worldedit.forge.selections; +import net.minecraft.world.World; + import com.sk89q.worldedit.Location; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.regions.RegionSelector; -import net.minecraft.world.World; public abstract interface Selection { public abstract Location getMinimumPoint();