Bug: OTG 1.12.2 - v6 using Entity() in BO3 to spawn an item_frame
totemo opened this issue ยท 4 comments
I'm running Spigot 1.12.2 final build:
This server is running CraftBukkit version git-Spigot-dcd1643-d7bebef (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)
I'm getting a server crash every time OTG spawns a BO3 containing the following code:
Entity(0,2,-7,item_frame,1,elytra.txt)
where elytra.txt
contains:
{Facing:0,Item:{id:"minecraft:elytra",Count:1}}
This NBT data works fine with the corresponding 1.12.2 /summon
command.
OTG also crashes if I omit the NBT file, i.e.:
Entity(0,2,-7,item_frame,1)
The stack trace is:
[03:51:27] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.server.v1_12_R1.ReportedException: Exception ticking world
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:812) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Caused by: java.lang.NullPointerException
at com.pg85.otg.bukkit.BukkitWorld.SpawnEntity(BukkitWorld.java:1051) ~[?:?]
at com.pg85.otg.customobjects.bo3.BO3.trySpawnAt(BO3.java:340) ~[?:?]
at com.pg85.otg.customobjects.CustomObjectCoordinate.spawnWithChecks(CustomObjectCoordinate.java:174) ~[?:?]
at com.pg85.otg.customobjects.CustomObjectStructure.spawnForChunk(CustomObjectStructure.java:6231) ~[?:?]
at com.pg85.otg.generator.resource.CustomStructureGen.spawnInChunk(CustomStructureGen.java:84) ~[?:?]
at com.pg85.otg.generator.resource.Resource.process(Resource.java:152) ~[?:?]
at com.pg85.otg.generator.ObjectSpawner.populate(ObjectSpawner.java:259) ~[?:?]
at com.pg85.otg.bukkit.generator.OTGBlockPopulator.populate(OTGBlockPopulator.java:30) ~[?:?]
at net.minecraft.server.v1_12_R1.Chunk.a(Chunk.java:979) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.Chunk.loadNearby(Chunk.java:943) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.ChunkProviderServer.originalGetChunkAt(ChunkProviderServer.java:173) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:140) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.PlayerChunk.a(PlayerChunk.java:112) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.PlayerChunkMap.flush(PlayerChunkMap.java:169) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.WorldServer.doTick(WorldServer.java:320) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:801) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
... 4 more
[03:51:27] [Server thread/ERROR]: Cause of unexpected exception was
java.lang.NullPointerException: null
at com.pg85.otg.bukkit.BukkitWorld.SpawnEntity(BukkitWorld.java:1051) ~[?:?]
at com.pg85.otg.customobjects.bo3.BO3.trySpawnAt(BO3.java:340) ~[?:?]
at com.pg85.otg.customobjects.CustomObjectCoordinate.spawnWithChecks(CustomObjectCoordinate.java:174) ~[?:?]
at com.pg85.otg.customobjects.CustomObjectStructure.spawnForChunk(CustomObjectStructure.java:6231) ~[?:?]
at com.pg85.otg.generator.resource.CustomStructureGen.spawnInChunk(CustomStructureGen.java:84) ~[?:?]
at com.pg85.otg.generator.resource.Resource.process(Resource.java:152) ~[?:?]
at com.pg85.otg.generator.ObjectSpawner.populate(ObjectSpawner.java:259) ~[?:?]
at com.pg85.otg.bukkit.generator.OTGBlockPopulator.populate(OTGBlockPopulator.java:30) ~[?:?]
at net.minecraft.server.v1_12_R1.Chunk.a(Chunk.java:979) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.Chunk.loadNearby(Chunk.java:943) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.ChunkProviderServer.originalGetChunkAt(ChunkProviderServer.java:173) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:140) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.PlayerChunk.a(PlayerChunk.java:112) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.PlayerChunkMap.flush(PlayerChunkMap.java:169) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.WorldServer.doTick(WorldServer.java:320) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:801) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-dcd1643-d7bebef]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Side observation: the in-file comments in the BO3 state that I can inline NBT text. This is not the case. For a shulker that I summon in the same file:
Entity(-6,1,0,SHULKER,1,{Color:15})
spawns the default purple shulker. Whereas:
Entity(-6,1,0,SHULKER,1,shulker.txt)
spawns a shulker with whatever NBT tags I put in the shulker.txt
file. In the case of shulkers, I'm happy with purple ones, but it would be nice to have item frames specified by inline NBT text, if that didn't crash.
For v8_r3 i've at least made sure this doesn't cause any crashes and logs a warning if spawnLog = true. Facing for item frames still doesn't work properly for Forge or Spigot, both platforms having different problems (frames not spawning, indestructible frames, frames popping off when they shouldn't, frames not being destroyed when their supporting block is destroyed etc). Unfortunately it looks like this will take too much time to fix for v8, will have to wait until after 1.13.
*Btw, the note about the nametag in the BO3's means to say you can supply a name tag for the mob instead of an nbt tag. A name tag literally meaning just a name (such as "Bob") for a name tag for the entity, the name tag is shown above the entity in-game. I suppose I should make this more clear.
Should be fixed as of #549