From cabb0d6613d6803a63ae937ad67308ff6bc1e78f Mon Sep 17 00:00:00 2001 From: Henry Loenwind Date: Wed, 31 May 2017 15:03:02 +0200 Subject: [PATCH] Fix mising drop items * re #177 --- .../enderzoo/entity/EntityConcussionCreeper.java | 9 +++++++++ .../java/crazypants/enderzoo/entity/EntityDireSlime.java | 8 +++++++- .../java/crazypants/enderzoo/entity/EntityDireWolf.java | 8 ++++++++ .../java/crazypants/enderzoo/entity/EntityEnderminy.java | 9 +++++++++ src/main/java/crazypants/enderzoo/entity/EntityOwl.java | 8 ++++++++ .../crazypants/enderzoo/entity/EntityWitherWitch.java | 9 +++++++++ 6 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/main/java/crazypants/enderzoo/entity/EntityConcussionCreeper.java b/src/main/java/crazypants/enderzoo/entity/EntityConcussionCreeper.java index fdf05cc..e3b6506 100644 --- a/src/main/java/crazypants/enderzoo/entity/EntityConcussionCreeper.java +++ b/src/main/java/crazypants/enderzoo/entity/EntityConcussionCreeper.java @@ -3,6 +3,8 @@ import java.lang.reflect.Field; import java.util.List; +import javax.annotation.Nullable; + import crazypants.enderzoo.EnderZoo; import crazypants.enderzoo.Log; import crazypants.enderzoo.config.Config; @@ -13,6 +15,7 @@ import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; @@ -106,6 +109,12 @@ protected Item getDropItem() { } } + @Override + @Nullable + protected ResourceLocation getLootTable() { + return null; // use getDropItem() instead + } + private void setTimeSinceIgnited(int i) { if (fTimeSinceIgnited == null) { return; diff --git a/src/main/java/crazypants/enderzoo/entity/EntityDireSlime.java b/src/main/java/crazypants/enderzoo/entity/EntityDireSlime.java index a636bb2..61f39b1 100644 --- a/src/main/java/crazypants/enderzoo/entity/EntityDireSlime.java +++ b/src/main/java/crazypants/enderzoo/entity/EntityDireSlime.java @@ -129,7 +129,13 @@ protected EntitySlime createInstance() { @Override protected Item getDropItem() { - return Items.CLAY_BALL; + return this.getSlimeSize() == 4 ? Item.getItemFromBlock(Blocks.CLAY) : Items.CLAY_BALL; + } + + @Override + @Nullable + protected ResourceLocation getLootTable() { + return null; // use getDropItem() instead } @Override diff --git a/src/main/java/crazypants/enderzoo/entity/EntityDireWolf.java b/src/main/java/crazypants/enderzoo/entity/EntityDireWolf.java index 02fcfa7..db8fd2f 100644 --- a/src/main/java/crazypants/enderzoo/entity/EntityDireWolf.java +++ b/src/main/java/crazypants/enderzoo/entity/EntityDireWolf.java @@ -2,6 +2,8 @@ import java.util.List; +import javax.annotation.Nullable; + import crazypants.enderzoo.config.Config; import crazypants.enderzoo.entity.ai.EntityAIAttackOnCollideAggressive; import crazypants.enderzoo.entity.ai.EntityAINearestAttackableTargetBounded; @@ -166,6 +168,12 @@ protected Item getDropItem() { return Item.getItemById(-1); } + @Override + @Nullable + protected ResourceLocation getLootTable() { + return null; // use getDropItem() instead + } + public float getTailRotation() { if (isAngry()) { return (float) Math.PI / 2; diff --git a/src/main/java/crazypants/enderzoo/entity/EntityEnderminy.java b/src/main/java/crazypants/enderzoo/entity/EntityEnderminy.java index e81d185..13a1f4a 100644 --- a/src/main/java/crazypants/enderzoo/entity/EntityEnderminy.java +++ b/src/main/java/crazypants/enderzoo/entity/EntityEnderminy.java @@ -4,6 +4,8 @@ import java.util.List; import java.util.UUID; +import javax.annotation.Nullable; + import crazypants.enderzoo.EnderZoo; import crazypants.enderzoo.config.Config; import crazypants.enderzoo.vec.VecUtil; @@ -35,6 +37,7 @@ import net.minecraft.util.EntityDamageSource; import net.minecraft.util.EntityDamageSourceIndirect; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.AxisAlignedBB; @@ -272,6 +275,12 @@ protected Item getDropItem() { return Items.ENDER_PEARL; } + @Override + @Nullable + protected ResourceLocation getLootTable() { + return null; // use getDropItem() instead + } + @Override protected void dropFewItems(boolean hitByPlayer, int looting) { Item item = getDropItem(); diff --git a/src/main/java/crazypants/enderzoo/entity/EntityOwl.java b/src/main/java/crazypants/enderzoo/entity/EntityOwl.java index a036580..3eddad1 100644 --- a/src/main/java/crazypants/enderzoo/entity/EntityOwl.java +++ b/src/main/java/crazypants/enderzoo/entity/EntityOwl.java @@ -1,5 +1,7 @@ package crazypants.enderzoo.entity; +import javax.annotation.Nullable; + import crazypants.enderzoo.EnderZoo; import crazypants.enderzoo.config.Config; import crazypants.enderzoo.entity.ai.EntityAIFlyingAttackOnCollide; @@ -418,6 +420,12 @@ protected Item getDropItem() { return Items.FEATHER; } + @Override + @Nullable + protected ResourceLocation getLootTable() { + return null; // use getDropItem() instead + } + @Override public float getMaxTurnRate() { return turnRate; diff --git a/src/main/java/crazypants/enderzoo/entity/EntityWitherWitch.java b/src/main/java/crazypants/enderzoo/entity/EntityWitherWitch.java index 3090ec0..218e2a4 100644 --- a/src/main/java/crazypants/enderzoo/entity/EntityWitherWitch.java +++ b/src/main/java/crazypants/enderzoo/entity/EntityWitherWitch.java @@ -3,6 +3,8 @@ import java.util.ArrayList; import java.util.List; +import javax.annotation.Nullable; + import crazypants.enderzoo.EnderZoo; import crazypants.enderzoo.config.Config; import crazypants.enderzoo.entity.EntityWitherCat.GrowthMode; @@ -31,6 +33,7 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -119,6 +122,12 @@ protected void dropFewItems(boolean hitByPlayer, int lootingLevel) { } } + @Override + @Nullable + protected ResourceLocation getLootTable() { + return null; // use getDropItem() instead + } + @Override public void setRevengeTarget(EntityLivingBase target) { EntityLivingBase curTarget = getAITarget();