[SPIGOT-6758] NPE when placing a sign with NBT data due to ItemSign#openSign not being reset in some situations Created: 15/Oct/21 Updated: 16/Oct/21 Resolved: 16/Oct/21 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | blablubbabc | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | BlockPlaceEvent, NBT, creative, sign |
Version: | This server is running CraftBukkit version dev-Spigot-dc75aca-11c9299 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) |
Guidelines Read: | Yes |
Description |
[Server thread/FATAL]: Error executing task on Server java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.block.entity.TileEntitySign.a(java.util.UUID)" because "tileentitysign" is null at net.minecraft.server.level.EntityPlayer.openSign(EntityPlayer.java:1315) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.world.item.ItemStack.placeItem(ItemStack.java:388) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:538) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1527) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.network.protocol.game.PacketPlayInUseItem.a(PacketPlayInUseItem.java:33) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.network.protocol.game.PacketPlayInUseItem.a(PacketPlayInUseItem.java:1) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:30) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.util.thread.IAsyncTaskHandler.executeTask(SourceFile:151) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.util.thread.IAsyncTaskHandler.executeNext(SourceFile:125) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.server.MinecraftServer.bf(MinecraftServer.java:1148) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.server.MinecraftServer.executeNext(MinecraftServer.java:1141) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.util.thread.IAsyncTaskHandler.awaitTasks(SourceFile:134) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.server.MinecraftServer.sleepForTick(MinecraftServer.java:1125) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1054) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[spigot-1.17.1-SNAPSHOT.jar:dev-Spigot-dc75aca-11c9299] at java.lang.Thread.run(Thread.java:831) [?:?] Reproduction steps:
The issue is that for the sign placement attempt of the survival player, ItemStack#placeItem will eventually invoke ItemSign#a, which remembers the block placement location in ItemSign#openSign. But this location is never cleared during the subsequent further handling of the block placement, because the handling is prematurely aborted due to the BlockPlaceEvent being cancelled.
|