Skip to content

Commit

Permalink
Try fixing sign editing
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Sep 14, 2024
1 parent a3e76e2 commit 621ff28
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/net/tylers1066/beaming/sign/CrewSign.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,17 @@ public final void onSignRightClick(@NotNull PlayerInteractEvent event) {
if (!Config.EnableCrewSigns || !event.getAction().equals(Action.RIGHT_CLICK_BLOCK))
return;


Player player = event.getPlayer();
if (!player.isSneaking())
return;

if (event.getClickedBlock() == null || !(event.getClickedBlock().getState() instanceof Sign))
if (event.getClickedBlock() == null || !(event.getClickedBlock().getState() instanceof Sign sign))
return;

Sign sign = (Sign) event.getClickedBlock().getState();
if (!sign.getLine(0).equalsIgnoreCase("Crew:"))
return;

event.setCancelled(true);
if (!Tag.BEDS.getValues().contains(sign.getBlock().getRelative(0, -1, 0).getType())) {
player.sendMessage(I18nSupport.getInternationalisedString("CrewSign - Need Bed Below"));
return;
Expand Down

0 comments on commit 621ff28

Please sign in to comment.