mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-03 22:15:24 +00:00
blockbreak raids
This commit is contained in:
1 parent
f01ea0ceb1
commit
c281d5dd91
1 file changed
+11
@@ -1,5 +1,7 @@
|
|||||||
package me.ShermansWorld.AlathraWar.listeners;
|
package me.ShermansWorld.AlathraWar.listeners;
|
||||||
|
|
||||||
|
import me.ShermansWorld.AlathraWar.Raid;
|
||||||
|
import me.ShermansWorld.AlathraWar.data.RaidData;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -68,6 +70,15 @@ public class BlockBreakListener implements Listener {
|
|||||||
if (siege.getTown() == WorldCoord.parseWorldCoord(block).getTownOrNull()) {
|
if (siege.getTown() == WorldCoord.parseWorldCoord(block).getTownOrNull()) {
|
||||||
p.sendMessage(Helper.color("&cYou can not place blocks during sieges"));
|
p.sendMessage(Helper.color("&cYou can not place blocks during sieges"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (final Raid raid : RaidData.getRaids()) {
|
||||||
|
if (raid.getRaidedTown() == WorldCoord.parseWorldCoord(block).getTownOrNull()) {
|
||||||
|
p.sendMessage(Helper.color("&cYou can not place blocks during raids"));
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user