Only listen to WallSign when creating shops.

This commit is contained in:
Len 2024-07-20 16:20:54 +02:00 committed by destro174
parent 851d816abf
commit 4e1f2d57bc
2 changed files with 6 additions and 8 deletions

View File

@ -81,11 +81,10 @@ public class PlayerListener extends EventListener {
return;
BlockFace facing;
BlockData data = b.getState().getBlockData();
if (data instanceof WallSign) {
facing = ((Directional) data).getFacing();
} else {
facing = ((Rotatable) data).getRotation();
if (!(data instanceof WallSign wallSign)) {
return;
}
facing = wallSign.getFacing();
Block bRelative = b.getRelative(facing.getOppositeFace());

View File

@ -122,11 +122,10 @@ public class ShopListener extends EventListener {
BlockFace facing;
BlockData data = block.getState().getBlockData();
if (data instanceof WallSign) {
facing = ((Directional) data).getFacing();
} else {
facing = ((Rotatable) data).getRotation();
if (!(data instanceof WallSign wallSign)) {
return;
}
facing = wallSign.getFacing();
Block relativeBlock = block.getRelative(facing.getOppositeFace());
PlayerShop shop = shopHandler.getShop(relativeBlock.getLocation());