Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-2170

Water Flowing over Player Skull Crashes Server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • None
    • Mac OS, Spigot 1.9 - also happens on Spigot 1.8

      If a player skull is placed in the world, and then water flows over it, it will crash the server.

      [15:23:11 ERROR]: Encountered an unexpected exception
      net.minecraft.server.v1_9_R1.ReportedException: Exception while ticking a block
      	at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:787) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at java.lang.Thread.run(Thread.java:744) [?:1.7.0_45]
      Caused by: java.lang.NullPointerException
      	at net.minecraft.server.v1_9_R1.BlockSkull.dropNaturally(BlockSkull.java:96) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.Block.b(Block.java:300) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.BlockFlowing.flow(BlockFlowing.java:158) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.BlockFlowing.b(BlockFlowing.java:114) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.WorldServer.a(WorldServer.java:734) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.WorldServer.doTick(WorldServer.java:248) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:776) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	... 4 more
      [15:23:11 ERROR]: 	Cause of unexpected exception was
      java.lang.NullPointerException
      	at net.minecraft.server.v1_9_R1.BlockSkull.dropNaturally(BlockSkull.java:96) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.Block.b(Block.java:300) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.BlockFlowing.flow(BlockFlowing.java:158) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.BlockFlowing.b(BlockFlowing.java:114) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.WorldServer.a(WorldServer.java:734) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.WorldServer.doTick(WorldServer.java:248) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:776) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) ~[spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot-1.9.2-R0.1-SNAPSHOT.jar:git-Spigot-944aa20-8d16fc0]
      	at java.lang.Thread.run(Thread.java:744) [?:1.7.0_45]
      

      The offending code is here:

          // CraftBukkit start - Special case dropping so we can get info from the tile entity
          @Override
          public void dropNaturally(World world, BlockPosition blockposition, IBlockData iblockdata, float f, int i) {
              if (world.random.nextFloat() < f) {
                  TileEntitySkull tileentityskull = (TileEntitySkull) world.getTileEntity(blockposition);
                  ItemStack itemstack = this.a(world, blockposition, iblockdata);
      
                  if (tileentityskull.getSkullType() == 3 && tileentityskull.getGameProfile() != null) {
                      itemstack.setTag(new NBTTagCompound());
                      NBTTagCompound nbttagcompound = new NBTTagCompound();
      
                      GameProfileSerializer.serialize(nbttagcompound, tileentityskull.getGameProfile());
                      itemstack.getTag().set("SkullOwner", nbttagcompound);
                  }
      
                  a(world, blockposition, itemstack);
              }
          }
          // CraftBukkit end
      

      Matching up line numbers, the implication is that "tileentityskull" is null, though I'm not sure why. I don't have a fix (yet?)

            Unassigned Unassigned
            NathanWolf Nathan Wolf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: