Addressed Issue: #81
This commit is contained in:
parent
f088b42bbe
commit
cf075c270e
@ -180,12 +180,18 @@ public class FactionsBlockListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void onBlockFromTo(BlockFromToEvent event) {
|
public void onBlockFromTo(BlockFromToEvent event) {
|
||||||
if (!Conf.handleExploitLiquidFlow) return;
|
if (!Conf.handleExploitLiquidFlow) return;
|
||||||
|
|
||||||
if (event.getBlock().isLiquid()) {
|
if (event.getBlock().isLiquid()) {
|
||||||
if (event.getToBlock().isEmpty()) {
|
if (event.getToBlock().isEmpty()) {
|
||||||
Faction from = Board.getInstance().getFactionAt(new FLocation(event.getBlock()));
|
Faction from = Board.getInstance().getFactionAt(new FLocation(event.getBlock()));
|
||||||
Faction to = Board.getInstance().getFactionAt(new FLocation(event.getToBlock()));
|
Faction to = Board.getInstance().getFactionAt(new FLocation(event.getToBlock()));
|
||||||
if (from == to) return;
|
if (from == to) return;
|
||||||
// from faction != to faction
|
// from faction != to faction
|
||||||
|
if(to.isSystemFaction()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (to.isNormal()) {
|
if (to.isNormal()) {
|
||||||
if (from.isNormal() && from.getRelationTo(to).isAlly()) {
|
if (from.isNormal() && from.getRelationTo(to).isAlly()) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user