(World worldIn, BlockPos pos, IBlockState state)
| 160 | } |
| 161 | |
| 162 | public void breakBlock(World worldIn, BlockPos pos, IBlockState state) |
| 163 | { |
| 164 | if (!worldIn.isRemote) |
| 165 | { |
| 166 | if (!state.getValue(NODROP)) |
| 167 | { |
| 168 | TileEntity tileentity = worldIn.getTileEntity(pos); |
| 169 | |
| 170 | if (tileentity instanceof TileEntitySkull) |
| 171 | { |
| 172 | TileEntitySkull tileentityskull = (TileEntitySkull)tileentity; |
| 173 | ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(worldIn, pos)); |
| 174 | |
| 175 | if (tileentityskull.getSkullType() == 3 && tileentityskull.getPlayerProfile() != null) |
| 176 | { |
| 177 | itemstack.setTagCompound(new NBTTagCompound()); |
| 178 | NBTTagCompound nbttagcompound = new NBTTagCompound(); |
| 179 | NBTUtil.writeGameProfile(nbttagcompound, tileentityskull.getPlayerProfile()); |
| 180 | itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound); |
| 181 | } |
| 182 | |
| 183 | spawnAsEntity(worldIn, pos, itemstack); |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | super.breakBlock(worldIn, pos, state); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Get the Item that this Block should drop when harvested. |
nothing calls this directly
no test coverage detected