diff options
Diffstat (limited to 'src/main/java/kubatech/nei/Mob_Handler.java')
-rw-r--r-- | src/main/java/kubatech/nei/Mob_Handler.java | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/main/java/kubatech/nei/Mob_Handler.java b/src/main/java/kubatech/nei/Mob_Handler.java index 5418aa1488..36fbb97231 100644 --- a/src/main/java/kubatech/nei/Mob_Handler.java +++ b/src/main/java/kubatech/nei/Mob_Handler.java @@ -36,6 +36,7 @@ import java.nio.FloatBuffer; import java.util.*; import java.util.List; import kubatech.api.LoaderReference; +import kubatech.api.mobhandler.MobDrop; import kubatech.api.utils.FastRandom; import kubatech.api.utils.InfernalHelper; import kubatech.api.utils.MobUtils; @@ -78,6 +79,8 @@ public class Mob_Handler extends TemplateRecipeHandler { AVERAGE_REMINDER, MOD, MAX_HEALTH, + LOOTABLE, + PLAYER_ONLY, ; final String key; @@ -108,7 +111,7 @@ public class Mob_Handler extends TemplateRecipeHandler { public static int cycleTicksStatic = Math.abs((int) System.currentTimeMillis()); private static final int itemsPerRow = 8, itemXShift = 18, itemYShift = 18, nextRowYShift = 35; - public static void addRecipe(EntityLiving e, List<MobRecipeLoader.MobDrop> drop) { + public static void addRecipe(EntityLiving e, List<MobDrop> drop) { List<MobPositionedStack> positionedStacks = new ArrayList<>(); int xorigin = 7, xoffset = xorigin, @@ -117,8 +120,8 @@ public class Mob_Handler extends TemplateRecipeHandler { raredrops = 0, additionaldrops = 0, infernaldrops = 0; - MobRecipeLoader.MobDrop.DropType i = null; - for (MobRecipeLoader.MobDrop d : drop) { + MobDrop.DropType i = null; + for (MobDrop d : drop) { if (i == d.type) { xoffset += itemXShift; if (xoffset >= xorigin + (itemXShift * itemsPerRow)) { @@ -131,10 +134,10 @@ public class Mob_Handler extends TemplateRecipeHandler { yoffset += nextRowYShift; } i = d.type; - if (d.type == MobRecipeLoader.MobDrop.DropType.Normal) normaldrops++; - else if (d.type == MobRecipeLoader.MobDrop.DropType.Rare) raredrops++; - else if (d.type == MobRecipeLoader.MobDrop.DropType.Additional) additionaldrops++; - else if (d.type == MobRecipeLoader.MobDrop.DropType.Infernal) break; // dont render infernal drops + if (d.type == MobDrop.DropType.Normal) normaldrops++; + else if (d.type == MobDrop.DropType.Rare) raredrops++; + else if (d.type == MobDrop.DropType.Additional) additionaldrops++; + else if (d.type == MobDrop.DropType.Infernal) break; // dont render infernal drops positionedStacks.add(new MobPositionedStack( d.stack.copy(), xoffset, @@ -142,7 +145,9 @@ public class Mob_Handler extends TemplateRecipeHandler { d.type, d.chance, d.enchantable, - d.damages != null ? new ArrayList<>(d.damages.keySet()) : null)); + d.damages != null ? new ArrayList<>(d.damages.keySet()) : null, + d.lootable, + d.playerOnly)); } instance.addRecipeInt(e, positionedStacks, normaldrops, raredrops, additionaldrops, infernaldrops); } @@ -424,7 +429,7 @@ public class Mob_Handler extends TemplateRecipeHandler { public static class MobPositionedStack extends PositionedStack { - public final MobRecipeLoader.MobDrop.DropType type; + public final MobDrop.DropType type; public final int chance; public final boolean enchantable; public final boolean randomdamage; @@ -436,10 +441,12 @@ public class Mob_Handler extends TemplateRecipeHandler { Object object, int x, int y, - MobRecipeLoader.MobDrop.DropType type, + MobDrop.DropType type, int chance, Integer enchantable, - List<Integer> damages) { + List<Integer> damages, + boolean lootable, + boolean isPlayerOnly) { super(object, x, y, false); rand = new FastRandom(); this.type = type; @@ -455,6 +462,8 @@ public class Mob_Handler extends TemplateRecipeHandler { if (chance != 10000) extratooltip.appendTag(new NBTTagString( EnumChatFormatting.RESET + CHANCE.get() + (chance / 100) + "." + (chance % 100) + "%")); + if (lootable) extratooltip.appendTag(new NBTTagString(EnumChatFormatting.RESET + LOOTABLE.get())); + if (isPlayerOnly) extratooltip.appendTag(new NBTTagString(EnumChatFormatting.RESET + PLAYER_ONLY.get())); extratooltip.appendTag(new NBTTagString(EnumChatFormatting.RESET + AVERAGE_REMINDER.get())); NBTTagCompound itemtag = this.items[0].getTagCompound(); |