block break/place fix

This commit is contained in:
Aubri Seebauer committed 2023-04-25 01:12:32 -04:00
1 parent 43c82661ac
commit a6a65d8476
3 files changed
+8 -15

No files matched your search

@@ -91,18 +91,6 @@ public class AdminCommands implements CommandExecutor {
* //done * //done
* -force leave raid [war] [player] (timeout) //kicks from raid party * -force leave raid [war] [player] (timeout) //kicks from raid party
* <p> * <p>
* //ultra low priority
* //exclude players from join a raid or war for a time
* //raid subcommand prevents joining or being raided
* -exclude player war [war] (side) (timeout)
* -exclude town war [war] (side) (timeout)
* -exclude nation war [war] (side) (timeout)
* <p>
* //ultra low priority
* -exclude player raid [join/target] [war] (timeout)
* -exclude town raid [join/target] [war] (timeout)
* -exclude nation raid [join/target] [war] (timeout)
* <p>
* // Ultra low priority idea * // Ultra low priority idea
* -rule raidersRespawnAtGatherTown [true/false] * -rule raidersRespawnAtGatherTown [true/false]
* -rule siegersRespawnAtTown [true/false] * -rule siegersRespawnAtTown [true/false]
@@ -32,7 +32,7 @@ public class BlockBreakListener implements Listener {
@EventHandler @EventHandler
public void onBlockBreak(final BlockBreakEvent event) { public void onBlockBreak(final BlockBreakEvent event) {
final Block block = event.getBlock(); final Block block = event.getBlock();
if (SiegeData.getSieges().isEmpty()) { if (SiegeData.getSieges().isEmpty() && RaidData.getRaids().isEmpty()) {
return; return;
} }
for (final Siege siege : SiegeData.getSieges()) { for (final Siege siege : SiegeData.getSieges()) {
@@ -65,9 +65,9 @@ public class BlockBreakListener implements Listener {
} }
@EventHandler @EventHandler
public void onBlockBreak(final BlockPlaceEvent event) { public void onBlockPlace(final BlockPlaceEvent event) {
final Block block = event.getBlock(); final Block block = event.getBlock();
if (SiegeData.getSieges().isEmpty()) { if (SiegeData.getSieges().isEmpty() && RaidData.getRaids().isEmpty()) {
return; return;
} }
if (allowedBlocks.contains(block.getType())) { if (allowedBlocks.contains(block.getType())) {
@@ -72,6 +72,11 @@ public final class KillsListener implements Listener
raid.raiderKilledInCombat(event); raid.raiderKilledInCombat(event);
respawnqueue.put(killed.getUniqueId(), raid); respawnqueue.put(killed.getUniqueId(), raid);
} }
} else if (raid.getPhase() != RaidPhase.COMBAT && killer != null) {
this.oocKill(killed, event);
raid.raiderKilledOutofCombat(event);
respawnqueue.put(killed.getUniqueId(), raid);
return;
} }
//teleport back to gather town spawn, without damaged gear //teleport back to gather town spawn, without damaged gear
//this is to disincentive people prekilling //this is to disincentive people prekilling