mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 09:51:12 +01:00
SPIGOT-5943: Calling get BlockStateMeta#getBlockState causes NPE with shield with banner
This commit is contained in:
parent
567e245fff
commit
4309566390
1 changed files with 3 additions and 1 deletions
|
@ -268,10 +268,12 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getBlockState() {
|
public BlockState getBlockState() {
|
||||||
|
Material stateMaterial = material; // Only actually used for jigsaws
|
||||||
if (blockEntityTag != null) {
|
if (blockEntityTag != null) {
|
||||||
switch (material) {
|
switch (material) {
|
||||||
case SHIELD:
|
case SHIELD:
|
||||||
blockEntityTag.setString("id", "banner");
|
blockEntityTag.setString("id", "banner");
|
||||||
|
stateMaterial = shieldToBannerHack(blockEntityTag);
|
||||||
break;
|
break;
|
||||||
case SHULKER_BOX:
|
case SHULKER_BOX:
|
||||||
case WHITE_SHULKER_BOX:
|
case WHITE_SHULKER_BOX:
|
||||||
|
@ -298,7 +300,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TileEntity te = (blockEntityTag == null) ? null : TileEntity.create(CraftMagicNumbers.getBlock(material).getBlockData(), blockEntityTag);
|
TileEntity te = (blockEntityTag == null) ? null : TileEntity.create(CraftMagicNumbers.getBlock(stateMaterial).getBlockData(), blockEntityTag);
|
||||||
|
|
||||||
switch (material) {
|
switch (material) {
|
||||||
case ACACIA_SIGN:
|
case ACACIA_SIGN:
|
||||||
|
|
Loading…
Reference in a new issue