From d06ba6e5de181b4e04b0efe3d53575159a9c3a8f Mon Sep 17 00:00:00 2001 From: ata4 Date: Mon, 6 Jun 2016 14:52:12 +0200 Subject: [PATCH 1/2] Should've tested the AI without elytra equipped... --- .../dragon/server/entity/ai/EntityAIDragonCatchOwner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/info/ata4/minecraft/dragon/server/entity/ai/EntityAIDragonCatchOwner.java b/src/main/java/info/ata4/minecraft/dragon/server/entity/ai/EntityAIDragonCatchOwner.java index a5748f57..8adbdb3d 100644 --- a/src/main/java/info/ata4/minecraft/dragon/server/entity/ai/EntityAIDragonCatchOwner.java +++ b/src/main/java/info/ata4/minecraft/dragon/server/entity/ai/EntityAIDragonCatchOwner.java @@ -55,7 +55,7 @@ public boolean shouldExecute() { // don't catch if owner has a working Elytra equipped // note: isBroken() is misleading, it actually checks if the items is usable ItemStack itemStack = owner.getItemStackFromSlot(EntityEquipmentSlot.CHEST); - if (itemStack.getItem() == Items.elytra && ItemElytra.isBroken(itemStack)) { + if (itemStack != null && itemStack.getItem() == Items.elytra && ItemElytra.isBroken(itemStack)) { return false; } From 0d9363aeee6f6838b39e21c9f557c5e055da476e Mon Sep 17 00:00:00 2001 From: ata4 Date: Wed, 8 Jun 2016 12:41:09 +0200 Subject: [PATCH 2/2] Removed unused follow owner AI for ground --- .../ai/ground/EntityAIDragonFollowOwner.java | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/main/java/info/ata4/minecraft/dragon/server/entity/ai/ground/EntityAIDragonFollowOwner.java diff --git a/src/main/java/info/ata4/minecraft/dragon/server/entity/ai/ground/EntityAIDragonFollowOwner.java b/src/main/java/info/ata4/minecraft/dragon/server/entity/ai/ground/EntityAIDragonFollowOwner.java deleted file mode 100644 index 08327072..00000000 --- a/src/main/java/info/ata4/minecraft/dragon/server/entity/ai/ground/EntityAIDragonFollowOwner.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - ** 2013 November 05 - ** - ** The author disclaims copyright to this source code. In place of - ** a legal notice, here is a blessing: - ** May you do good and not evil. - ** May you find forgiveness for yourself and forgive others. - ** May you share freely, never taking more than you give. - */ -package info.ata4.minecraft.dragon.server.entity.ai.ground; - -import info.ata4.minecraft.dragon.server.entity.EntityTameableDragon; -import net.minecraft.entity.ai.EntityAIFollowOwner; - -/** - * Modified EntityAIFollowOwner that won't run if the pet is sitting. - * - * @author Nico Bergemann - */ -public class EntityAIDragonFollowOwner extends EntityAIFollowOwner { - - private final EntityTameableDragon dragon; - - public EntityAIDragonFollowOwner(EntityTameableDragon dragon, double followSpeedIn, float minDistIn, float maxDistIn) { - super(dragon, followSpeedIn, minDistIn, maxDistIn); - this.dragon = dragon; - } - - /** - * Updates the task - */ - @Override - public void updateTask() { - // don't move when sitting - if (dragon.isSitting()) { - return; - } - - super.updateTask(); - } -}