diff --git a/common/biomesoplenty/BiomesOPlenty.java b/common/biomesoplenty/BiomesOPlenty.java index d918be173..18ff1821f 100644 --- a/common/biomesoplenty/BiomesOPlenty.java +++ b/common/biomesoplenty/BiomesOPlenty.java @@ -17,17 +17,17 @@ import biomesoplenty.configuration.BOPVanillaCompat; import biomesoplenty.configuration.configfile.BOPConfiguration; import biomesoplenty.configuration.configfile.BOPConfigurationIDs; import biomesoplenty.configuration.configfile.BOPConfigurationMisc; +import biomesoplenty.eventhandlers.BonemealEventHandler; +import biomesoplenty.eventhandlers.BreakSpeedEventHandler; +import biomesoplenty.eventhandlers.EntityEventHandler; +import biomesoplenty.eventhandlers.FlipperMovementEventHandler; +import biomesoplenty.eventhandlers.FluidEventHandler; +import biomesoplenty.eventhandlers.VillageMaterialEventHandler; import biomesoplenty.handlers.BOPCraftHandler; -import biomesoplenty.handlers.BonemealHandler; -import biomesoplenty.handlers.BreakSpeedHandler; -import biomesoplenty.handlers.EntityEventHandler; -import biomesoplenty.handlers.FlipperMovementEventHandler; -import biomesoplenty.handlers.FluidEventHandler; import biomesoplenty.handlers.MovementHandler; import biomesoplenty.handlers.SoundHandler; import biomesoplenty.handlers.TickHandlerClient; import biomesoplenty.handlers.TickHandlerServer; -import biomesoplenty.handlers.VillageMaterialEventHandler; import biomesoplenty.helpers.AchievementHelper; import biomesoplenty.helpers.CreativeTabsBOP; import biomesoplenty.helpers.Version; @@ -104,13 +104,12 @@ public class BiomesOPlenty if (ForgeVersion.buildVersion >= 891 || proxy instanceof ClientProxy) MinecraftForge.TERRAIN_GEN_BUS.register(new VillageMaterialEventHandler()); MinecraftForge.EVENT_BUS.register(new AchievementHelper()); - MinecraftForge.EVENT_BUS.register(new BonemealHandler()); + MinecraftForge.EVENT_BUS.register(new BonemealEventHandler()); MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); MinecraftForge.EVENT_BUS.register(new FluidEventHandler()); - MinecraftForge.EVENT_BUS.register(new BreakSpeedHandler()); + MinecraftForge.EVENT_BUS.register(new BreakSpeedEventHandler()); MinecraftForge.EVENT_BUS.register(new MovementHandler()); MinecraftForge.EVENT_BUS.register(new FlipperMovementEventHandler()); - //MinecraftForge.EVENT_BUS.register(new AxeChopHandler()); proxy.registerRenderers(); diff --git a/common/biomesoplenty/handlers/BonemealHandler.java b/common/biomesoplenty/eventhandlers/BonemealEventHandler.java similarity index 98% rename from common/biomesoplenty/handlers/BonemealHandler.java rename to common/biomesoplenty/eventhandlers/BonemealEventHandler.java index c3357cc55..2e0695b45 100644 --- a/common/biomesoplenty/handlers/BonemealHandler.java +++ b/common/biomesoplenty/eventhandlers/BonemealEventHandler.java @@ -1,4 +1,4 @@ -package biomesoplenty.handlers; +package biomesoplenty.eventhandlers; import net.minecraft.block.Block; import net.minecraftforge.event.Event.Result; @@ -13,7 +13,7 @@ import biomesoplenty.worldgen.WorldGenGiantFlowerYellow; import biomesoplenty.worldgen.WorldGenCattailBonemeal; import biomesoplenty.worldgen.WorldGenKelp; -public class BonemealHandler +public class BonemealEventHandler { @ForgeSubscribe diff --git a/common/biomesoplenty/handlers/BreakSpeedHandler.java b/common/biomesoplenty/eventhandlers/BreakSpeedEventHandler.java similarity index 97% rename from common/biomesoplenty/handlers/BreakSpeedHandler.java rename to common/biomesoplenty/eventhandlers/BreakSpeedEventHandler.java index 548e412ec..7cd782c79 100644 --- a/common/biomesoplenty/handlers/BreakSpeedHandler.java +++ b/common/biomesoplenty/eventhandlers/BreakSpeedEventHandler.java @@ -1,4 +1,4 @@ -package biomesoplenty.handlers; +package biomesoplenty.eventhandlers; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -14,7 +14,7 @@ import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.player.PlayerEvent; import biomesoplenty.api.Blocks; -public class BreakSpeedHandler +public class BreakSpeedEventHandler { @ForgeSubscribe public void breakSpeed(PlayerEvent.BreakSpeed event) diff --git a/common/biomesoplenty/handlers/EntityEventHandler.java b/common/biomesoplenty/eventhandlers/EntityEventHandler.java similarity index 96% rename from common/biomesoplenty/handlers/EntityEventHandler.java rename to common/biomesoplenty/eventhandlers/EntityEventHandler.java index b08a81d82..0e05ff2a6 100644 --- a/common/biomesoplenty/handlers/EntityEventHandler.java +++ b/common/biomesoplenty/eventhandlers/EntityEventHandler.java @@ -1,4 +1,4 @@ -package biomesoplenty.handlers; +package biomesoplenty.eventhandlers; import net.minecraft.block.Block; import net.minecraft.block.BlockColored; diff --git a/common/biomesoplenty/handlers/FlipperMovementEventHandler.java b/common/biomesoplenty/eventhandlers/FlipperMovementEventHandler.java similarity index 97% rename from common/biomesoplenty/handlers/FlipperMovementEventHandler.java rename to common/biomesoplenty/eventhandlers/FlipperMovementEventHandler.java index b44fc5f2c..1ecb89df8 100644 --- a/common/biomesoplenty/handlers/FlipperMovementEventHandler.java +++ b/common/biomesoplenty/eventhandlers/FlipperMovementEventHandler.java @@ -1,4 +1,4 @@ -package biomesoplenty.handlers; +package biomesoplenty.eventhandlers; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; diff --git a/common/biomesoplenty/handlers/FluidEventHandler.java b/common/biomesoplenty/eventhandlers/FluidEventHandler.java similarity index 98% rename from common/biomesoplenty/handlers/FluidEventHandler.java rename to common/biomesoplenty/eventhandlers/FluidEventHandler.java index 51ef836da..292a255a9 100644 --- a/common/biomesoplenty/handlers/FluidEventHandler.java +++ b/common/biomesoplenty/eventhandlers/FluidEventHandler.java @@ -1,4 +1,4 @@ -package biomesoplenty.handlers; +package biomesoplenty.eventhandlers; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; diff --git a/common/biomesoplenty/handlers/VillageMaterialEventHandler.java b/common/biomesoplenty/eventhandlers/VillageMaterialEventHandler.java similarity index 99% rename from common/biomesoplenty/handlers/VillageMaterialEventHandler.java rename to common/biomesoplenty/eventhandlers/VillageMaterialEventHandler.java index 6e1a2e624..19ccdcad0 100644 --- a/common/biomesoplenty/handlers/VillageMaterialEventHandler.java +++ b/common/biomesoplenty/eventhandlers/VillageMaterialEventHandler.java @@ -1,4 +1,4 @@ -package biomesoplenty.handlers; +package biomesoplenty.eventhandlers; import net.minecraft.block.Block; import net.minecraftforge.event.Event.Result; diff --git a/common/biomesoplenty/handlers/AxeChopHandler.java b/common/biomesoplenty/handlers/AxeChopHandler.java deleted file mode 100644 index 2cac01c2f..000000000 --- a/common/biomesoplenty/handlers/AxeChopHandler.java +++ /dev/null @@ -1,75 +0,0 @@ -package biomesoplenty.handlers; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumToolMaterial; -import net.minecraft.item.Item; -import net.minecraft.item.ItemAxe; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.event.ForgeSubscribe; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; -import biomesoplenty.configuration.BOPItems; - -public class AxeChopHandler -{ - @ForgeSubscribe - public void chopTree(PlayerInteractEvent event) - { - ItemStack itemstack = event.entityPlayer.getCurrentEquippedItem(); - EntityPlayer player = event.entityPlayer; - World world = player.worldObj; - - if (event.action == Action.RIGHT_CLICK_BLOCK) - { - if (itemstack != null) - { - Item item = Item.itemsList[itemstack.itemID]; - - if (item instanceof ItemAxe) - { - if (Block.blocksList[world.getBlockId(event.x, event.y, event.z)].isWood(world, event.x, event.y, event.z)) - { - EnumToolMaterial toolMaterial = EnumToolMaterial.valueOf(((ItemAxe)item).getToolMaterialName()); - - player.swingItem(); - player.playSound("dig.wood", 1.0F, 0.25F); - - if (toolMaterial != EnumToolMaterial.WOOD && toolMaterial != EnumToolMaterial.STONE && toolMaterial != BOPItems.EnumToolMaterialMud) - { - int firstBlockId = world.getBlockId(event.x, event.y, event.z); - int logNo = 0; - - itemstack.damageItem(4, player); - - for (int l = 0; world.getBlockId(event.x, event.y + l, event.z) == firstBlockId; l++) - { - if (!world.isRemote) - { - logNo += l * 2; - } - } - - if (world.rand.nextInt(15 + logNo) == 0) - { - for (int i = 0; world.getBlockId(event.x, event.y + i, event.z) == firstBlockId; i++) - { - if (!world.isRemote) - { - itemstack.damageItem(2, player); - world.destroyBlock(event.x, event.y + i, event.z, true); - } - } - } - } - else - { - itemstack.damageItem(7, player); - } - } - } - } - } - } -}