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
+10 -17

No files matched your search

@@ -89,19 +89,7 @@ public class AdminCommands implements CommandExecutor {
* -force join raid [player] [war] [town] (side)
* <p>
* //done
* -force leave raid [war] [player] (timeout) //kicks from raid party
* <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)
* -force leave raid [war] [player] (timeout) //kicks from raid party
* <p>
* // Ultra low priority idea
* -rule raidersRespawnAtGatherTown [true/false]
@@ -32,7 +32,7 @@ public class BlockBreakListener implements Listener {
@EventHandler
public void onBlockBreak(final BlockBreakEvent event) {
final Block block = event.getBlock();
if (SiegeData.getSieges().isEmpty()) {
if (SiegeData.getSieges().isEmpty() && RaidData.getRaids().isEmpty()) {
return;
}
for (final Siege siege : SiegeData.getSieges()) {
@@ -65,9 +65,9 @@ public class BlockBreakListener implements Listener {
}
@EventHandler
public void onBlockBreak(final BlockPlaceEvent event) {
public void onBlockPlace(final BlockPlaceEvent event) {
final Block block = event.getBlock();
if (SiegeData.getSieges().isEmpty()) {
if (SiegeData.getSieges().isEmpty() && RaidData.getRaids().isEmpty()) {
return;
}
if (allowedBlocks.contains(block.getType())) {
@@ -72,8 +72,13 @@ public final class KillsListener implements Listener
raid.raiderKilledInCombat(event);
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.oocKill(killed, event);
raid.raiderKilledOutofCombat(event);