diff --git a/modules/v1_9_R1/src/main/java/com/dsh105/echopet/compat/nms/v1_9_R1/NMSImpl.java b/modules/v1_9_R1/src/main/java/com/dsh105/echopet/compat/nms/v1_9_R1/NMSImpl.java index 4b20e407..6139d686 100644 --- a/modules/v1_9_R1/src/main/java/com/dsh105/echopet/compat/nms/v1_9_R1/NMSImpl.java +++ b/modules/v1_9_R1/src/main/java/com/dsh105/echopet/compat/nms/v1_9_R1/NMSImpl.java @@ -40,6 +40,7 @@ import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_9_R1.CraftWorld; +import org.bukkit.entity.Creature; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.entity.CreatureSpawnEvent; @@ -104,7 +105,8 @@ public EntityPet spawn(IPet pet, Player owner) { EntityPet entityPet = (EntityPet) pet.getPetType().getNewEntityPetInstance(mcWorld, pet); entityPet.spawnIn(mcWorld); - entityPet.getPet().getCraftPet().setCollidable(false); + //noinspection RedundantCast - the version of craftbukkit we compile against doesn't have this method, but the version of bukkit does + ((Creature) entityPet.getBukkitEntity()).setCollidable(false); entityPet.setLocation(new Location(mcWorld.getWorld(), l.getX(), l.getY(), l.getZ(), l.getYaw(), l.getPitch())); if (!l.getChunk().isLoaded()) { l.getChunk().load(); diff --git a/modules/v1_9_R2/src/main/java/com/dsh105/echopet/compat/nms/v1_9_R2/NMSImpl.java b/modules/v1_9_R2/src/main/java/com/dsh105/echopet/compat/nms/v1_9_R2/NMSImpl.java index 59bdd433..4345af23 100644 --- a/modules/v1_9_R2/src/main/java/com/dsh105/echopet/compat/nms/v1_9_R2/NMSImpl.java +++ b/modules/v1_9_R2/src/main/java/com/dsh105/echopet/compat/nms/v1_9_R2/NMSImpl.java @@ -103,7 +103,7 @@ public EntityPet spawn(IPet pet, Player owner) { EntityPet entityPet = (EntityPet) pet.getPetType().getNewEntityPetInstance(mcWorld, pet); entityPet.spawnIn(mcWorld); - entityPet.getPet().getCraftPet().setCollidable(false); + entityPet.getBukkitEntity().setCollidable(false); entityPet.setLocation(new Location(mcWorld.getWorld(), l.getX(), l.getY(), l.getZ(), l.getYaw(), l.getPitch())); if (!l.getChunk().isLoaded()) { l.getChunk().load();