diff --git a/dependencies.gradle b/dependencies.gradle index 203574d727..c9489da09c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -6,6 +6,7 @@ dependencies { compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.0:api") {} //For TiC to work compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.6.14-GTNH:dev") compileOnly("curse.maven:skinport-234948:3212017") + compileOnly("com.github.GTNewHorizons:Mobs-Info:0.4.1-GTNH:dev") // For Thaumcraft runtime compileOnly ("com.github.GTNewHorizons:Baubles:1.0.4:dev") diff --git a/src/main/java/twilightforest/entity/boss/EntityTFLich.java b/src/main/java/twilightforest/entity/boss/EntityTFLich.java index 24b2a91c2c..05d2290db0 100644 --- a/src/main/java/twilightforest/entity/boss/EntityTFLich.java +++ b/src/main/java/twilightforest/entity/boss/EntityTFLich.java @@ -1,7 +1,10 @@ package twilightforest.entity.boss; +import java.util.ArrayList; import java.util.List; +import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; @@ -30,6 +33,10 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; +import com.kuba6000.mobsinfo.api.IMobInfoProvider; +import com.kuba6000.mobsinfo.api.MobDrop; + +import cpw.mods.fml.common.Optional; import twilightforest.TFAchievementPage; import twilightforest.TFFeature; import twilightforest.TwilightForestMod; @@ -40,7 +47,8 @@ import twilightforest.world.TFWorldChunkManager; import twilightforest.world.WorldProviderTwilightForest; -public class EntityTFLich extends EntityMob implements IBossDisplayData { +@Optional.Interface(iface = "com.kuba6000.mobsinfo.api.IMobInfoProvider", modid = "mobsinfo") +public class EntityTFLich extends EntityMob implements IBossDisplayData, IMobInfoProvider { private static final int DATA_ISCLONE = 21; private static final int DATA_SHIELDSTRENGTH = 17; @@ -121,6 +129,7 @@ public ItemStack getHeldItem() { @Override protected void dropFewItems(boolean par1, int par2) { + // EVERY CHANGE MADE IN HERE MUST BE ALSO MADE IN provideDropsInformation dropScepter(); int totalDrops = this.rand.nextInt(3 + par2) + 2; @@ -143,6 +152,42 @@ protected void dropFewItems(boolean par1, int par2) { this.entityDropItem(new ItemStack(TFItems.trophy, 1, 2), 0); } + @Optional.Method(modid = "mobsinfo") + @Override + public void provideDropsInformation(@Nonnull ArrayList drops) { + // scepter + drops.add(MobDrop.create(new ItemStack(TFItems.scepterZombie)).withChance(0.3333d)); + drops.add(MobDrop.create(new ItemStack(TFItems.scepterLifeDrain)).withChance(0.3333d)); + drops.add(MobDrop.create(new ItemStack(TFItems.scepterTwilight)).withChance(0.3333d)); + // gold thing + double chance = MobDrop.getChanceBasedOnFromTo(2, 4) / 5d; + drops.add( + MobDrop.create(new ItemStack(Items.golden_sword)).withChance(chance).withRandomEnchant(25) + .withLooting()); + drops.add( + MobDrop.create(new ItemStack(Items.golden_helmet)).withChance(chance).withRandomEnchant(25) + .withLooting()); + drops.add( + MobDrop.create(new ItemStack(Items.golden_chestplate)).withChance(chance).withRandomEnchant(25) + .withLooting()); + drops.add( + MobDrop.create(new ItemStack(Items.golden_leggings)).withChance(chance).withRandomEnchant(25) + .withLooting()); + drops.add( + MobDrop.create(new ItemStack(Items.golden_boots)).withChance(chance).withRandomEnchant(25) + .withLooting()); + // ender pearl + drops.add( + MobDrop.create(new ItemStack(Items.ender_pearl)).withChance(MobDrop.getChanceBasedOnFromTo(1, 4)) + .withLooting()); + // bones + drops.add( + MobDrop.create(new ItemStack(Items.bone)).withChance(MobDrop.getChanceBasedOnFromTo(5, 9)) + .withLooting()); + // trophy + drops.add(MobDrop.create(new ItemStack(TFItems.trophy, 1, 2))); + } + private void dropScepter() { int scepterType = rand.nextInt(3); switch (scepterType) { @@ -1101,5 +1146,4 @@ public void onDeath(DamageSource par1DamageSource) { public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; } - }