diff --git a/src/main/java/fox/spiteful/avaritia/items/tools/ItemAxeInfinity.java b/src/main/java/fox/spiteful/avaritia/items/tools/ItemAxeInfinity.java index f034451..284b01e 100644 --- a/src/main/java/fox/spiteful/avaritia/items/tools/ItemAxeInfinity.java +++ b/src/main/java/fox/spiteful/avaritia/items/tools/ItemAxeInfinity.java @@ -45,7 +45,7 @@ public class ItemAxeInfinity extends ItemAxe { setUnlocalizedName("infinity_axe"); setTextureName("avaritia:infinity_axe"); setCreativeTab(Avaritia.tab); - FMLCommonHandler.instance().bus().register(this); + FMLCommonHandler.instance().bus().register(new EventHandler()); } @Override @@ -128,19 +128,6 @@ public class ItemAxeInfinity extends ItemAxe { return false; } - @SubscribeEvent - public void onTickEnd(TickEvent.WorldTickEvent event) { - if (event.phase == TickEvent.Phase.END) { - int dim = event.world.provider.dimensionId; - if (blockSwappers.containsKey(dim)) { - List swappers = blockSwappers.get(dim); - List swappersSafe = new ArrayList<>(swappers); - swappers.clear(); - for (BlockSwapper s : swappersSafe) if (s != null) s.tick(); - } - } - } - private static BlockSwapper addBlockSwapper(World world, EntityPlayer player, ItemStack stack, ChunkCoordinates origCoords, ChunkCoordinates coords, int steps, boolean leaves, boolean force, List posChecked) { @@ -234,4 +221,19 @@ public class ItemAxeInfinity extends ItemAxe { } } + public static class EventHandler { + + @SubscribeEvent + public void onTickEnd(TickEvent.WorldTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + int dim = event.world.provider.dimensionId; + if (blockSwappers.containsKey(dim)) { + List swappers = blockSwappers.get(dim); + List swappersSafe = new ArrayList<>(swappers); + swappers.clear(); + for (BlockSwapper s : swappersSafe) if (s != null) s.tick(); + } + } + } + } }