Skip to content

Commit 240cbd4

Browse files
committed
move event.getPlayer() to just before it's used
1 parent 6bc022b commit 240cbd4

File tree

1 file changed

+1
-1
lines changed
  • src/main/java/pro/cloudnode/smp/bankaccounts/events

1 file changed

+1
-1
lines changed

src/main/java/pro/cloudnode/smp/bankaccounts/events/POSOpen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
public final class POSOpen implements Listener {
2222
@EventHandler
2323
public void openPOS(final @NotNull PlayerInteractEvent event) {
24-
final @NotNull Player player = event.getPlayer();
2524
if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
2625
final @NotNull Optional<Block> block = Optional.ofNullable(event.getClickedBlock());
2726
if (block.isEmpty()) return;
@@ -34,6 +33,7 @@ public void openPOS(final @NotNull PlayerInteractEvent event) {
3433

3534
event.setUseInteractedBlock(Event.Result.DENY);
3635

36+
final @NotNull Player player = event.getPlayer();
3737
if (player.getUniqueId().equals(pos.get().seller.owner.getUniqueId())) {
3838
POS.openOwnerGui(player, chest, pos.get());
3939
return;

0 commit comments

Comments
 (0)