mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-29 13:46:50 +01:00
Added further "offline" options for preventing the 3 explosion types in faction territory; also fix for safe zone and war zone autoclaim bug
This commit is contained in:
parent
e023e9de91
commit
4cc13707cc
@ -68,8 +68,11 @@ public class Conf {
|
|||||||
public static boolean territoryDenyBuildWhenOffline = true;
|
public static boolean territoryDenyBuildWhenOffline = true;
|
||||||
public static boolean territoryDenyUseage = true;
|
public static boolean territoryDenyUseage = true;
|
||||||
public static boolean territoryBlockCreepers = false;
|
public static boolean territoryBlockCreepers = false;
|
||||||
|
public static boolean territoryBlockCreepersWhenOffline = false;
|
||||||
public static boolean territoryBlockFireballs = false;
|
public static boolean territoryBlockFireballs = false;
|
||||||
|
public static boolean territoryBlockFireballsWhenOffline = false;
|
||||||
public static boolean territoryBlockTNT = false;
|
public static boolean territoryBlockTNT = false;
|
||||||
|
public static boolean territoryBlockTNTWhenOffline = false;
|
||||||
|
|
||||||
public static boolean safeZoneDenyBuild = true;
|
public static boolean safeZoneDenyBuild = true;
|
||||||
public static boolean safeZoneDenyUseage = true;
|
public static boolean safeZoneDenyUseage = true;
|
||||||
|
@ -93,10 +93,12 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Faction faction = Board.getFactionAt(new FLocation(event.getLocation()));
|
Faction faction = Board.getFactionAt(new FLocation(event.getLocation()));
|
||||||
|
boolean online = faction.HasPlayersOnline();
|
||||||
|
|
||||||
if (event.getEntity() instanceof Creeper && (
|
if (event.getEntity() instanceof Creeper && (
|
||||||
(faction.isNone() && Conf.wildernessBlockCreepers) ||
|
(faction.isNone() && Conf.wildernessBlockCreepers) ||
|
||||||
(faction.isNormal() && Conf.territoryBlockCreepers) ||
|
(faction.isNormal() && online && Conf.territoryBlockCreepers) ||
|
||||||
|
(faction.isNormal() && !online && Conf.territoryBlockCreepersWhenOffline) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockCreepers) ||
|
(faction.isWarZone() && Conf.warZoneBlockCreepers) ||
|
||||||
faction.isSafeZone()
|
faction.isSafeZone()
|
||||||
)) {
|
)) {
|
||||||
@ -104,7 +106,8 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (event.getEntity() instanceof Fireball && (
|
} else if (event.getEntity() instanceof Fireball && (
|
||||||
(faction.isNone() && Conf.wildernessBlockFireballs) ||
|
(faction.isNone() && Conf.wildernessBlockFireballs) ||
|
||||||
(faction.isNormal() && Conf.territoryBlockFireballs) ||
|
(faction.isNormal() && online && Conf.territoryBlockFireballs) ||
|
||||||
|
(faction.isNormal() && !online && Conf.territoryBlockFireballsWhenOffline) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
|
(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
|
||||||
faction.isSafeZone()
|
faction.isSafeZone()
|
||||||
)) {
|
)) {
|
||||||
@ -112,7 +115,8 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (
|
} else if (
|
||||||
(faction.isNone() && Conf.wildernessBlockTNT) ||
|
(faction.isNone() && Conf.wildernessBlockTNT) ||
|
||||||
(faction.isNormal() && Conf.territoryBlockTNT) ||
|
(faction.isNormal() && online && Conf.territoryBlockTNT) ||
|
||||||
|
(faction.isNormal() && !online && Conf.territoryBlockTNTWhenOffline) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockTNT) ||
|
(faction.isWarZone() && Conf.warZoneBlockTNT) ||
|
||||||
(faction.isSafeZone() && Conf.safeZoneBlockTNT)
|
(faction.isSafeZone() && Conf.safeZoneBlockTNT)
|
||||||
) {
|
) {
|
||||||
|
@ -186,7 +186,7 @@ public class FactionsPlayerListener extends PlayerListener{
|
|||||||
me.attemptClaim(false);
|
me.attemptClaim(false);
|
||||||
}
|
}
|
||||||
else if (me.autoSafeZoneEnabled()) {
|
else if (me.autoSafeZoneEnabled()) {
|
||||||
if (!Factions.hasPermManageSafeZone((CommandSender)me)) {
|
if (!Factions.hasPermManageSafeZone((CommandSender)event.getPlayer())) {
|
||||||
me.enableAutoSafeZone(false);
|
me.enableAutoSafeZone(false);
|
||||||
} else {
|
} else {
|
||||||
FLocation playerFlocation = new FLocation(me);
|
FLocation playerFlocation = new FLocation(me);
|
||||||
@ -198,7 +198,7 @@ public class FactionsPlayerListener extends PlayerListener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (me.autoWarZoneEnabled()) {
|
else if (me.autoWarZoneEnabled()) {
|
||||||
if (!Factions.hasPermManageWarZone((CommandSender)me)) {
|
if (!Factions.hasPermManageWarZone((CommandSender)event.getPlayer())) {
|
||||||
me.enableAutoWarZone(false);
|
me.enableAutoWarZone(false);
|
||||||
} else {
|
} else {
|
||||||
FLocation playerFlocation = new FLocation(me);
|
FLocation playerFlocation = new FLocation(me);
|
||||||
|
Loading…
Reference in New Issue
Block a user