diff --git a/src/main/java/tconstruct/armor/TinkerArmorEvents.java b/src/main/java/tconstruct/armor/TinkerArmorEvents.java index 70a079a4..a6c5d7ba 100644 --- a/src/main/java/tconstruct/armor/TinkerArmorEvents.java +++ b/src/main/java/tconstruct/armor/TinkerArmorEvents.java @@ -34,8 +34,7 @@ import tconstruct.library.modifier.IModifyable; import tconstruct.util.config.PHConstruct; import tconstruct.util.network.ArmourGuiSyncPacket; -@Optional.Interface(iface = "com.kuba6000.mobsinfo.api.IMobExtraInfoProvider", modid = "mobsinfo") -public class TinkerArmorEvents implements IMobExtraInfoProvider { +public class TinkerArmorEvents { public void registerEvents() { MinecraftForge.EVENT_BUS.register(new EventHandler()); @@ -80,39 +79,6 @@ public class TinkerArmorEvents implements IMobExtraInfoProvider { } } - @Optional.Method(modid = "mobsinfo") - @Override - public void provideExtraDropsInformation(@Nonnull String entityString, @Nonnull ArrayList drops, - @Nonnull MobRecipe recipe) { - if (recipe.entity instanceof IMob) { - MobDrop drop = new MobDrop( - new ItemStack(TinkerArmor.heartCanister, 1, 1), - MobDrop.DropType.Normal, - 50, - null, - null, - false, - false); - drops.add(drop); - } - - if (recipe.entity instanceof IBossDisplayData) { - String entityName = recipe.entity.getClass().getSimpleName().toLowerCase(); - for (String name : PHConstruct.heartDropBlacklist) - if (name.toLowerCase(Locale.US).equals(entityName)) return; - - MobDrop drop = new MobDrop( - new ItemStack(TinkerArmor.heartCanister, recipe.entity instanceof EntityDragon ? 5 : 1, 3), - MobDrop.DropType.Normal, - 10000, - null, - null, - false, - false); - drops.add(drop); - } - } - /* Abilities */ public void armorMineSpeed(PlayerEvent.BreakSpeed event) { if (event.entityPlayer == null) return; @@ -181,7 +147,8 @@ public class TinkerArmorEvents implements IMobExtraInfoProvider { } } - public class EventHandler { + @Optional.Interface(iface = "com.kuba6000.mobsinfo.api.IMobExtraInfoProvider", modid = "mobsinfo") + public class EventHandler implements IMobExtraInfoProvider { @SubscribeEvent public void onLivingDropWrapper(LivingDropsEvent event) { @@ -213,5 +180,38 @@ public class TinkerArmorEvents implements IMobExtraInfoProvider { public void joinWorldWrapper(EntityJoinWorldEvent event) { TinkerArmorEvents.this.joinWorld(event); } + + @Optional.Method(modid = "mobsinfo") + @Override + public void provideExtraDropsInformation(@Nonnull String entityString, @Nonnull ArrayList drops, + @Nonnull MobRecipe recipe) { + if (recipe.entity instanceof IMob) { + MobDrop drop = new MobDrop( + new ItemStack(TinkerArmor.heartCanister, 1, 1), + MobDrop.DropType.Normal, + 50, + null, + null, + false, + false); + drops.add(drop); + } + + if (recipe.entity instanceof IBossDisplayData) { + String entityName = recipe.entity.getClass().getSimpleName().toLowerCase(); + for (String name : PHConstruct.heartDropBlacklist) + if (name.toLowerCase(Locale.US).equals(entityName)) return; + + MobDrop drop = new MobDrop( + new ItemStack(TinkerArmor.heartCanister, recipe.entity instanceof EntityDragon ? 5 : 1, 3), + MobDrop.DropType.Normal, + 10000, + null, + null, + false, + false); + drops.add(drop); + } + } } } diff --git a/src/main/java/tconstruct/world/TinkerWorldEvents.java b/src/main/java/tconstruct/world/TinkerWorldEvents.java index 51d2a359..322f3e48 100644 --- a/src/main/java/tconstruct/world/TinkerWorldEvents.java +++ b/src/main/java/tconstruct/world/TinkerWorldEvents.java @@ -38,8 +38,7 @@ import tconstruct.tools.TinkerTools; import tconstruct.util.ItemHelper; import tconstruct.util.config.PHConstruct; -@Optional.Interface(iface = "com.kuba6000.mobsinfo.api.IMobExtraInfoProvider", modid = "mobsinfo") -public class TinkerWorldEvents implements IMobExtraInfoProvider { +public class TinkerWorldEvents { public void registerEvents() { MinecraftForge.EVENT_BUS.register(new EventHandler()); @@ -131,30 +130,8 @@ public class TinkerWorldEvents implements IMobExtraInfoProvider { } } - @Optional.Method(modid = "mobsinfo") - @Override - public void provideExtraDropsInformation(@Nonnull String entityString, @Nonnull ArrayList drops, - @Nonnull MobRecipe recipe) { - if (recipe.entity.getClass() == EntityGhast.class) { - if (PHConstruct.uhcGhastDrops) { - for (MobDrop drop : drops) { - if (drop.stack.getItem() == Items.ghast_tear) { - drop.stack = new ItemStack(Items.gold_ingot); - drop.reconstructableStack = new ConstructableItemStack(drop.stack); - } - } - } else { - for (MobDrop drop : drops) { - if (drop.stack.getItem() == Items.ghast_tear) { - drop.chance += 10000; - drop.clampChance(); - } - } - } - } - } - - public class EventHandler { + @Optional.Interface(iface = "com.kuba6000.mobsinfo.api.IMobExtraInfoProvider", modid = "mobsinfo") + public class EventHandler implements IMobExtraInfoProvider { @SubscribeEvent public void onLivingSpawn(LivingSpawnEvent.SpecialSpawn event) { @@ -177,5 +154,28 @@ public class TinkerWorldEvents implements IMobExtraInfoProvider { public void onLivingDrop(LivingDropsEvent event) { TinkerWorldEvents.this.onLivingDrop(event); } + + @Optional.Method(modid = "mobsinfo") + @Override + public void provideExtraDropsInformation(@Nonnull String entityString, @Nonnull ArrayList drops, + @Nonnull MobRecipe recipe) { + if (recipe.entity.getClass() == EntityGhast.class) { + if (PHConstruct.uhcGhastDrops) { + for (MobDrop drop : drops) { + if (drop.stack.getItem() == Items.ghast_tear) { + drop.stack = new ItemStack(Items.gold_ingot); + drop.reconstructableStack = new ConstructableItemStack(drop.stack); + } + } + } else { + for (MobDrop drop : drops) { + if (drop.stack.getItem() == Items.ghast_tear) { + drop.chance += 10000; + drop.clampChance(); + } + } + } + } + } } }