Fix sign sticker on 1.14+

This commit is contained in:
Phoenix616 2020-07-08 21:01:33 +01:00
parent 8c1c80e138
commit d1f6b1616b
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0

View File

@ -51,12 +51,17 @@ public class SignSticker implements Listener {
return;
}
int index = signBlock.getType().name().indexOf("SIGN");
if (index < 0) {
return;
}
Material newMaterial = Material.valueOf(signBlock.getType().name().substring(0, index) + "WALL_SIGN");
signBlock.setType(Material.WALL_SIGN);
signBlock.setType(newMaterial);
org.bukkit.block.Sign sign = (org.bukkit.block.Sign) signBlock.getState();
WallSign signMaterial = (WallSign) Bukkit.createBlockData(Material.WALL_SIGN);
WallSign signMaterial = (WallSign) Bukkit.createBlockData(newMaterial);
signMaterial.setFacing(shopBlockFace.getOppositeFace());
sign.setBlockData(signMaterial);