Skip to content

Commit 0306f49

Browse files
Fix not being able to claim an abandoned TARDIS when allow.power_down is false
1 parent 2ad6e31 commit 0306f49

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/main/java/me/eccentric_nz/TARDIS/console/interaction/ArtronRightClick.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,13 @@ public void process(int id, Player player, Location location) {
7878
// has the TARDIS been initialised?
7979
if (!init) {
8080
new ArtronInitAction(plugin).powerUp(location, tardis, player, id);
81-
} else { // toggle power
82-
if (plugin.getConfig().getBoolean("allow.power_down")) {
83-
boolean pu = true;
84-
if (abandoned) {
85-
// transfer ownership to the player who clicked
86-
pu = new ArtronAbandoned(plugin).claim(player, id, location, tardis);
87-
}
88-
if (pu) {
89-
new TARDISPowerButton(plugin, id, player, tardis.getPreset(), tardis.isPoweredOn(), tardis.isHidden(), lights, player.getLocation(), current_level, tardis.getSchematic().getLights()).clickButton();
90-
}
81+
} else {
82+
if (abandoned) {
83+
// transfer ownership to the player who clicked
84+
new ArtronAbandoned(plugin).claim(player, id, location, tardis);
85+
} else if (plugin.getConfig().getBoolean("allow.power_down")) {
86+
// toggle power
87+
new TARDISPowerButton(plugin, id, player, tardis.getPreset(), tardis.isPoweredOn(), tardis.isHidden(), lights, player.getLocation(), current_level, tardis.getSchematic().getLights()).clickButton();
9188
}
9289
}
9390
} else if (player.isSneaking()) {

0 commit comments

Comments
 (0)