Arnuh / EchoPet

Adds pets to your Minecraft Server!
GNU General Public License v3.0
25 stars 12 forks source link

NullPointerException: null #84

Open mibby opened 3 years ago

mibby commented 3 years ago

EchoPets dev 9 Paper 1.16.5

Going through my logs searching for errors, found these two.

[18:48:58] [Server thread/ERROR]: [EchoPet] Task #7684510 for EchoPet v1.0.8-SNAPSHOT-b9 generated an exception
[18:48:58] [Server thread/ERROR]: [EchoPet] Suspected Plugins: 
[18:48:58] [Server thread/ERROR]: [EchoPet]     EchoPet{enabled,ver=1.0.8-SNAPSHOT-b9,path=plugins/EchoPet.jar}
[18:48:58] [Server thread/ERROR]: [EchoPet] Exception details below: 
java.lang.NullPointerException: null
    at com.dsh105.echopet.api.pet.TameablePet.setTamed(TameablePet.java:39) ~[?:?]
    at com.dsh105.echopet.compat.api.entity.PetData.lambda$static$10(PetData.java:137) ~[?:?]
    at com.dsh105.echopet.api.pet.Pet.spawnPet(Pet.java:96) ~[?:?]
    at com.dsh105.echopet.listeners.PetOwnerListener$1.run(PetOwnerListener.java:171) ~[?:?]
    at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:99) ~[1.16.5-patched.jar:git-Yatopia-update/upstream-"08567c2"]
    at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:469) ~[1.16.5-patched.jar:git-Yatopia-update/upstream-"08567c2"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1386) ~[1.16.5-patched.jar:git-Yatopia-update/upstream-"08567c2"]
    at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:397) ~[1.16.5-patched.jar:git-Yatopia-update/upstream-"08567c2"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1295) ~[1.16.5-patched.jar:git-Yatopia-update/upstream-"08567c2"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1016) ~[1.16.5-patched.jar:git-Yatopia-update/upstream-"08567c2"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:176) ~[1.16.5-patched.jar:git-Yatopia-update/upstream-"08567c2"]
    at java.lang.Thread.run(Thread.java:832) [?:?]
[08:17:04] [Server thread/ERROR]: [EchoPet] Task #579731 for EchoPet v1.0.8-SNAPSHOT-b9 generated an exception
[08:17:04] [Server thread/ERROR]: [EchoPet] Suspected Plugins: 
[08:17:04] [Server thread/ERROR]: [EchoPet]     EchoPet{enabled,ver=1.0.8-SNAPSHOT-b9,path=plugins/EchoPet.jar}
[08:17:04] [Server thread/ERROR]: [EchoPet] Exception details below: 
java.lang.NullPointerException: null
    at com.dsh105.echopet.api.pet.AgeablePet.setBaby(AgeablePet.java:18) ~[?:?]
    at com.dsh105.echopet.compat.api.entity.PetData.lambda$static$2(PetData.java:72) ~[?:?]
    at com.dsh105.echopet.api.pet.Pet.spawnPet(Pet.java:96) ~[?:?]
    at com.dsh105.echopet.listeners.PetOwnerListener$4.run(PetOwnerListener.java:299) ~[?:?]
    at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[1.16.5-patched.jar:git-Yatopia-ver/1.16.5-"f295cbb"]
    at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:469) ~[1.16.5-patched.jar:git-Yatopia-ver/1.16.5-"f295cbb"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1386) ~[1.16.5-patched.jar:git-Yatopia-ver/1.16.5-"f295cbb"]
    at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:398) ~[1.16.5-patched.jar:git-Yatopia-ver/1.16.5-"f295cbb"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1295) ~[1.16.5-patched.jar:git-Yatopia-ver/1.16.5-"f295cbb"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1016) ~[1.16.5-patched.jar:git-Yatopia-ver/1.16.5-"f295cbb"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:176) ~[1.16.5-patched.jar:git-Yatopia-ver/1.16.5-"f295cbb"]
    at java.lang.Thread.run(Thread.java:832) [?:?]
Arnuh commented 3 years ago

These errors look like they are related to the actual entity not existing. Could be due to another plugin preventing the spawn?

What's weird is spawning checks if the entity exists before applying its PetData. Could be due to teleportToOwner causing the pet to be removed.