From 158d0c378f9aa4925c753626884de1b5567b8bee Mon Sep 17 00:00:00 2001 From: DSH105 Date: Wed, 1 Oct 2014 14:03:09 +1000 Subject: [PATCH] Ensure that the pet goal selector *always* exists --- .../dsh105/echopet/compat/nms/v1_6_R3/entity/EntityPet.java | 5 +++++ .../dsh105/echopet/compat/nms/v1_7_R1/entity/EntityPet.java | 5 +++++ .../dsh105/echopet/compat/nms/v1_7_R2/entity/EntityPet.java | 5 +++++ .../dsh105/echopet/compat/nms/v1_7_R3/entity/EntityPet.java | 5 +++++ .../dsh105/echopet/compat/nms/v1_7_R4/entity/EntityPet.java | 5 +++++ .../echopet/compat/nms/v1_8_Spigot/entity/EntityPet.java | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/modules/v1_6_R3/src/main/java/com/dsh105/echopet/compat/nms/v1_6_R3/entity/EntityPet.java b/modules/v1_6_R3/src/main/java/com/dsh105/echopet/compat/nms/v1_6_R3/entity/EntityPet.java index 5d684056..29290a22 100644 --- a/modules/v1_6_R3/src/main/java/com/dsh105/echopet/compat/nms/v1_6_R3/entity/EntityPet.java +++ b/modules/v1_6_R3/src/main/java/com/dsh105/echopet/compat/nms/v1_6_R3/entity/EntityPet.java @@ -223,6 +223,11 @@ protected void bi() { this.getEntitySenses().a(); + // If this ever happens... + if (this.petGoalSelector == null) { + this.remove(false); + return; + } this.petGoalSelector.updateGoals(); this.getNavigation().f(); diff --git a/modules/v1_7_R1/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R1/entity/EntityPet.java b/modules/v1_7_R1/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R1/entity/EntityPet.java index 1f45e874..24e38d8f 100644 --- a/modules/v1_7_R1/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R1/entity/EntityPet.java +++ b/modules/v1_7_R1/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R1/entity/EntityPet.java @@ -224,6 +224,11 @@ protected void bn() { this.getEntitySenses().a(); + // If this ever happens... + if (this.petGoalSelector == null) { + this.remove(false); + return; + } this.petGoalSelector.updateGoals(); this.getNavigation().f(); diff --git a/modules/v1_7_R2/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R2/entity/EntityPet.java b/modules/v1_7_R2/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R2/entity/EntityPet.java index 7dcea84b..a6fceda6 100644 --- a/modules/v1_7_R2/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R2/entity/EntityPet.java +++ b/modules/v1_7_R2/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R2/entity/EntityPet.java @@ -224,6 +224,11 @@ protected void bm() { this.getEntitySenses().a(); + // If this ever happens... + if (this.petGoalSelector == null) { + this.remove(false); + return; + } this.petGoalSelector.updateGoals(); this.getNavigation().f(); diff --git a/modules/v1_7_R3/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R3/entity/EntityPet.java b/modules/v1_7_R3/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R3/entity/EntityPet.java index a2f6e97b..f51893f8 100644 --- a/modules/v1_7_R3/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R3/entity/EntityPet.java +++ b/modules/v1_7_R3/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R3/entity/EntityPet.java @@ -225,6 +225,11 @@ protected void bm() { this.getEntitySenses().a(); + // If this ever happens... + if (this.petGoalSelector == null) { + this.remove(false); + return; + } this.petGoalSelector.updateGoals(); this.getNavigation().f(); diff --git a/modules/v1_7_R4/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R4/entity/EntityPet.java b/modules/v1_7_R4/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R4/entity/EntityPet.java index a0014417..8c7b340c 100644 --- a/modules/v1_7_R4/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R4/entity/EntityPet.java +++ b/modules/v1_7_R4/src/main/java/com/dsh105/echopet/compat/nms/v1_7_R4/entity/EntityPet.java @@ -225,6 +225,11 @@ protected void bn() { this.getEntitySenses().a(); + // If this ever happens... + if (this.petGoalSelector == null) { + this.remove(false); + return; + } this.petGoalSelector.updateGoals(); this.getNavigation().f(); diff --git a/modules/v1_8_Spigot/src/main/java/com/dsh105/echopet/compat/nms/v1_8_Spigot/entity/EntityPet.java b/modules/v1_8_Spigot/src/main/java/com/dsh105/echopet/compat/nms/v1_8_Spigot/entity/EntityPet.java index f1ba5852..3b3598ea 100644 --- a/modules/v1_8_Spigot/src/main/java/com/dsh105/echopet/compat/nms/v1_8_Spigot/entity/EntityPet.java +++ b/modules/v1_8_Spigot/src/main/java/com/dsh105/echopet/compat/nms/v1_8_Spigot/entity/EntityPet.java @@ -227,6 +227,11 @@ protected void bn() { this.getEntitySenses().a(); + // If this ever happens... + if (this.petGoalSelector == null) { + this.remove(false); + return; + } this.petGoalSelector.updateGoals(); this.getNavigation().f();