mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-12-11 19:36:46 +01:00
Format. Haven't done this in awhile. Just sneak it in.
This commit is contained in:
parent
f019c4f833
commit
5c2abb34de
@ -287,19 +287,19 @@ public class Conf {
|
|||||||
|
|
||||||
// Format for popup - substitute values for macros
|
// Format for popup - substitute values for macros
|
||||||
public static String dynmapDescription =
|
public static String dynmapDescription =
|
||||||
"<div class=\"infowindow\">\n"
|
"<div class=\"infowindow\">\n"
|
||||||
+ "<span style=\"font-weight: bold; font-size: 150%;\">%name%</span><br>\n"
|
+ "<span style=\"font-weight: bold; font-size: 150%;\">%name%</span><br>\n"
|
||||||
+ "<span style=\"font-style: italic; font-size: 110%;\">%description%</span><br>"
|
+ "<span style=\"font-style: italic; font-size: 110%;\">%description%</span><br>"
|
||||||
+ "<br>\n"
|
+ "<br>\n"
|
||||||
+ "<span style=\"font-weight: bold;\">Leader:</span> %players.leader%<br>\n"
|
+ "<span style=\"font-weight: bold;\">Leader:</span> %players.leader%<br>\n"
|
||||||
+ "<span style=\"font-weight: bold;\">Admins:</span> %players.admins.count%<br>\n"
|
+ "<span style=\"font-weight: bold;\">Admins:</span> %players.admins.count%<br>\n"
|
||||||
+ "<span style=\"font-weight: bold;\">Moderators:</span> %players.moderators.count%<br>\n"
|
+ "<span style=\"font-weight: bold;\">Moderators:</span> %players.moderators.count%<br>\n"
|
||||||
+ "<span style=\"font-weight: bold;\">Members:</span> %players.normals.count%<br>\n"
|
+ "<span style=\"font-weight: bold;\">Members:</span> %players.normals.count%<br>\n"
|
||||||
+ "<span style=\"font-weight: bold;\">TOTAL:</span> %players.count%<br>\n"
|
+ "<span style=\"font-weight: bold;\">TOTAL:</span> %players.count%<br>\n"
|
||||||
+ "</br>\n"
|
+ "</br>\n"
|
||||||
+ "<span style=\"font-weight: bold;\">Bank:</span> %money%<br>\n"
|
+ "<span style=\"font-weight: bold;\">Bank:</span> %money%<br>\n"
|
||||||
+ "<br>\n"
|
+ "<br>\n"
|
||||||
+ "</div>";
|
+ "</div>";
|
||||||
|
|
||||||
// Enable the %money% macro. Only do this if you know your economy manager is thread-safe.
|
// Enable the %money% macro. Only do this if you know your economy manager is thread-safe.
|
||||||
public static boolean dynmapDescriptionMoney = false;
|
public static boolean dynmapDescriptionMoney = false;
|
||||||
|
@ -22,7 +22,8 @@ public class FLocation implements Serializable {
|
|||||||
try {
|
try {
|
||||||
Class.forName("org.bukkit.WorldBorder");
|
Class.forName("org.bukkit.WorldBorder");
|
||||||
worldBorderClassPresent = true;
|
worldBorderClassPresent = true;
|
||||||
} catch (ClassNotFoundException ignored) {}
|
} catch (ClassNotFoundException ignored) {
|
||||||
|
}
|
||||||
|
|
||||||
worldBorderSupport = worldBorderClassPresent;
|
worldBorderSupport = worldBorderClassPresent;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ public class P extends MPlugin {
|
|||||||
try {
|
try {
|
||||||
RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
|
RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
|
||||||
if (rsp != null) {
|
if (rsp != null) {
|
||||||
perms = rsp.getProvider();
|
perms = rsp.getProvider();
|
||||||
}
|
}
|
||||||
} catch (NoClassDefFoundError ex) {
|
} catch (NoClassDefFoundError ex) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -18,7 +18,6 @@ public class FactionRenameEvent extends FactionPlayerEvent implements Cancellabl
|
|||||||
* Get the player involved in the event.
|
* Get the player involved in the event.
|
||||||
*
|
*
|
||||||
* @return Player involved in the event.
|
* @return Player involved in the event.
|
||||||
*
|
|
||||||
* @deprecated use getfPlayer().getPlayer() instead.
|
* @deprecated use getfPlayer().getPlayer() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -30,7 +29,6 @@ public class FactionRenameEvent extends FactionPlayerEvent implements Cancellabl
|
|||||||
* Get the faction tag before it was renamed.
|
* Get the faction tag before it was renamed.
|
||||||
*
|
*
|
||||||
* @return old faction tag.
|
* @return old faction tag.
|
||||||
*
|
|
||||||
* @deprecated use getFaction().getTag() instead.
|
* @deprecated use getFaction().getTag() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -33,7 +33,6 @@ public class LandClaimEvent extends FactionPlayerEvent implements Cancellable {
|
|||||||
* Get the id of the faction.
|
* Get the id of the faction.
|
||||||
*
|
*
|
||||||
* @return id of faction as String
|
* @return id of faction as String
|
||||||
*
|
|
||||||
* @deprecated use getFaction().getId() instead.
|
* @deprecated use getFaction().getId() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -45,7 +44,6 @@ public class LandClaimEvent extends FactionPlayerEvent implements Cancellable {
|
|||||||
* Get the tag of the faction.
|
* Get the tag of the faction.
|
||||||
*
|
*
|
||||||
* @return tag of faction as String
|
* @return tag of faction as String
|
||||||
*
|
|
||||||
* @deprecated use getFaction().getTag() instead.
|
* @deprecated use getFaction().getTag() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -57,7 +55,6 @@ public class LandClaimEvent extends FactionPlayerEvent implements Cancellable {
|
|||||||
* Get the Player involved in this event.
|
* Get the Player involved in this event.
|
||||||
*
|
*
|
||||||
* @return player from FPlayer.
|
* @return player from FPlayer.
|
||||||
*
|
|
||||||
* @deprecated use getfPlayer().getPlayer() instead.
|
* @deprecated use getfPlayer().getPlayer() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -16,7 +16,6 @@ public class LandUnclaimAllEvent extends FactionPlayerEvent implements Cancellab
|
|||||||
* Get the id of the faction.
|
* Get the id of the faction.
|
||||||
*
|
*
|
||||||
* @return id of faction as String
|
* @return id of faction as String
|
||||||
*
|
|
||||||
* @deprecated use getFaction().getId() instead.
|
* @deprecated use getFaction().getId() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -28,7 +27,6 @@ public class LandUnclaimAllEvent extends FactionPlayerEvent implements Cancellab
|
|||||||
* Get the tag of the faction.
|
* Get the tag of the faction.
|
||||||
*
|
*
|
||||||
* @return tag of faction as String
|
* @return tag of faction as String
|
||||||
*
|
|
||||||
* @deprecated use getFaction().getTag() instead.
|
* @deprecated use getFaction().getTag() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -40,7 +38,6 @@ public class LandUnclaimAllEvent extends FactionPlayerEvent implements Cancellab
|
|||||||
* Get the Player involved in the event.
|
* Get the Player involved in the event.
|
||||||
*
|
*
|
||||||
* @return Player from FPlayer.
|
* @return Player from FPlayer.
|
||||||
*
|
|
||||||
* @deprecated use getfPlayer().getPlayer() instead.
|
* @deprecated use getfPlayer().getPlayer() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -28,7 +28,6 @@ public class LandUnclaimEvent extends FactionPlayerEvent implements Cancellable
|
|||||||
* Get the id of the faction.
|
* Get the id of the faction.
|
||||||
*
|
*
|
||||||
* @return id of faction as String
|
* @return id of faction as String
|
||||||
*
|
|
||||||
* @deprecated use getFaction().getId() instead.
|
* @deprecated use getFaction().getId() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -40,7 +39,6 @@ public class LandUnclaimEvent extends FactionPlayerEvent implements Cancellable
|
|||||||
* Get the tag of the faction.
|
* Get the tag of the faction.
|
||||||
*
|
*
|
||||||
* @return tag of faction as String
|
* @return tag of faction as String
|
||||||
*
|
|
||||||
* @deprecated use getFaction().getTag() instead.
|
* @deprecated use getFaction().getTag() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -52,7 +50,6 @@ public class LandUnclaimEvent extends FactionPlayerEvent implements Cancellable
|
|||||||
* Get the Player involved in the event.
|
* Get the Player involved in the event.
|
||||||
*
|
*
|
||||||
* @return Player from FPlayer.
|
* @return Player from FPlayer.
|
||||||
*
|
|
||||||
* @deprecated use getfPlayer().getPlayer() instead.
|
* @deprecated use getfPlayer().getPlayer() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -21,7 +21,6 @@ public class PowerLossEvent extends FactionPlayerEvent implements Cancellable {
|
|||||||
* Get the id of the faction.
|
* Get the id of the faction.
|
||||||
*
|
*
|
||||||
* @return id of faction as String
|
* @return id of faction as String
|
||||||
*
|
|
||||||
* @deprecated use getFaction().getId() instead.
|
* @deprecated use getFaction().getId() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -33,7 +32,6 @@ public class PowerLossEvent extends FactionPlayerEvent implements Cancellable {
|
|||||||
* Get the tag of the faction.
|
* Get the tag of the faction.
|
||||||
*
|
*
|
||||||
* @return tag of faction as String
|
* @return tag of faction as String
|
||||||
*
|
|
||||||
* @deprecated use getFaction().getTag() instead.
|
* @deprecated use getFaction().getTag() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -45,7 +43,6 @@ public class PowerLossEvent extends FactionPlayerEvent implements Cancellable {
|
|||||||
* Get the Player involved in the event.
|
* Get the Player involved in the event.
|
||||||
*
|
*
|
||||||
* @return Player from FPlayer.
|
* @return Player from FPlayer.
|
||||||
*
|
|
||||||
* @deprecated use getfPlayer().getPlayer() instead.
|
* @deprecated use getfPlayer().getPlayer() instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -89,19 +89,19 @@ public class Worldguard {
|
|||||||
// Returns:
|
// Returns:
|
||||||
// True: Regions found within chunk
|
// True: Regions found within chunk
|
||||||
// False: No regions found within chunk
|
// False: No regions found within chunk
|
||||||
|
|
||||||
public static boolean checkForRegionsInChunk(FLocation floc) {
|
public static boolean checkForRegionsInChunk(FLocation floc) {
|
||||||
Chunk chunk = floc.getWorld().getChunkAt((int) floc.getX(), (int) floc.getZ());
|
Chunk chunk = floc.getWorld().getChunkAt((int) floc.getX(), (int) floc.getZ());
|
||||||
|
|
||||||
return checkForRegionsInChunk(chunk);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean checkForRegionsInChunk(Location loc) {
|
|
||||||
Chunk chunk = loc.getWorld().getChunkAt(loc);
|
|
||||||
|
|
||||||
return checkForRegionsInChunk(chunk);
|
return checkForRegionsInChunk(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean checkForRegionsInChunk(Location loc) {
|
||||||
|
Chunk chunk = loc.getWorld().getChunkAt(loc);
|
||||||
|
|
||||||
|
return checkForRegionsInChunk(chunk);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean checkForRegionsInChunk(Chunk chunk) {
|
public static boolean checkForRegionsInChunk(Chunk chunk) {
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
// No WG hooks so we'll always bypass this check.
|
// No WG hooks so we'll always bypass this check.
|
||||||
|
@ -574,9 +574,9 @@ public class EngineDynmap {
|
|||||||
PlayerSet set = this.markerApi.getPlayerSet(setId);
|
PlayerSet set = this.markerApi.getPlayerSet(setId);
|
||||||
if (set == null) {
|
if (set == null) {
|
||||||
set = this.markerApi.createPlayerSet(setId, // id
|
set = this.markerApi.createPlayerSet(setId, // id
|
||||||
true, // symmetric
|
true, // symmetric
|
||||||
playerIds, // players
|
playerIds, // players
|
||||||
false // persistent
|
false // persistent
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (set == null) {
|
if (set == null) {
|
||||||
|
@ -72,8 +72,8 @@ public class TempAreaMarker {
|
|||||||
|
|
||||||
// Line Style
|
// Line Style
|
||||||
if (marker.getLineWeight() != this.lineWeight ||
|
if (marker.getLineWeight() != this.lineWeight ||
|
||||||
marker.getLineOpacity() != this.lineOpacity ||
|
marker.getLineOpacity() != this.lineOpacity ||
|
||||||
marker.getLineColor() != this.lineColor) {
|
marker.getLineColor() != this.lineColor) {
|
||||||
marker.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
|
marker.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,11 +95,11 @@ public class FactionsBlockListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* note that I originally was testing the territory of each affected block, but since I found that pistons can only push
|
* note that I originally was testing the territory of each affected block, but since I found that pistons can only push
|
||||||
* up to 12 blocks and the width of any territory is 16 blocks, it should be safe (and much more lightweight) to test
|
* up to 12 blocks and the width of any territory is 16 blocks, it should be safe (and much more lightweight) to test
|
||||||
* only the final target block as done above
|
* only the final target block as done above
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
|
@ -151,23 +151,23 @@ public class FactionsEntityListener implements Listener {
|
|||||||
|
|
||||||
//TODO: :(
|
//TODO: :(
|
||||||
if (boomer instanceof Creeper && ((faction.isWilderness() && Conf.wildernessBlockCreepers && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) ||
|
if (boomer instanceof Creeper && ((faction.isWilderness() && Conf.wildernessBlockCreepers && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) ||
|
||||||
(faction.isNormal() && (online ? Conf.territoryBlockCreepers : Conf.territoryBlockCreepersWhenOffline)) ||
|
(faction.isNormal() && (online ? Conf.territoryBlockCreepers : Conf.territoryBlockCreepersWhenOffline)) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockCreepers) ||
|
(faction.isWarZone() && Conf.warZoneBlockCreepers) ||
|
||||||
faction.isSafeZone())) {
|
faction.isSafeZone())) {
|
||||||
// creeper which needs prevention
|
// creeper which needs prevention
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (
|
} else if (
|
||||||
// it's a bit crude just using fireball protection for Wither boss too, but I'd rather not add in a whole new set of xxxBlockWitherExplosion or whatever
|
// it's a bit crude just using fireball protection for Wither boss too, but I'd rather not add in a whole new set of xxxBlockWitherExplosion or whatever
|
||||||
(boomer instanceof Fireball || boomer instanceof WitherSkull || boomer instanceof Wither) && ((faction.isWilderness() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) ||
|
(boomer instanceof Fireball || boomer instanceof WitherSkull || boomer instanceof Wither) && ((faction.isWilderness() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) ||
|
||||||
(faction.isNormal() && (online ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) ||
|
(faction.isNormal() && (online ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
|
(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
|
||||||
faction.isSafeZone())) {
|
faction.isSafeZone())) {
|
||||||
// ghast fireball which needs prevention
|
// ghast fireball which needs prevention
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if ((boomer instanceof TNTPrimed || boomer instanceof ExplosiveMinecart) && ((faction.isWilderness() && Conf.wildernessBlockTNT && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) ||
|
} else if ((boomer instanceof TNTPrimed || boomer instanceof ExplosiveMinecart) && ((faction.isWilderness() && Conf.wildernessBlockTNT && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) ||
|
||||||
(faction.isNormal() && (online ? Conf.territoryBlockTNT : Conf.territoryBlockTNTWhenOffline)) ||
|
(faction.isNormal() && (online ? Conf.territoryBlockTNT : Conf.territoryBlockTNTWhenOffline)) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockTNT) ||
|
(faction.isWarZone() && Conf.warZoneBlockTNT) ||
|
||||||
(faction.isSafeZone() && Conf.safeZoneBlockTNT))) {
|
(faction.isSafeZone() && Conf.safeZoneBlockTNT))) {
|
||||||
// TNT which needs prevention
|
// TNT which needs prevention
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if ((boomer instanceof TNTPrimed || boomer instanceof ExplosiveMinecart) && Conf.handleExploitTNTWaterlog) {
|
} else if ((boomer instanceof TNTPrimed || boomer instanceof ExplosiveMinecart) && Conf.handleExploitTNTWaterlog) {
|
||||||
@ -464,9 +464,9 @@ public class FactionsEntityListener implements Listener {
|
|||||||
boolean online = faction.hasPlayersOnline();
|
boolean online = faction.hasPlayersOnline();
|
||||||
|
|
||||||
if ((faction.isWilderness() && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName()) && (Conf.wildernessBlockCreepers || Conf.wildernessBlockFireballs || Conf.wildernessBlockTNT)) ||
|
if ((faction.isWilderness() && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName()) && (Conf.wildernessBlockCreepers || Conf.wildernessBlockFireballs || Conf.wildernessBlockTNT)) ||
|
||||||
(faction.isNormal() && (online ? (Conf.territoryBlockCreepers || Conf.territoryBlockFireballs || Conf.territoryBlockTNT) : (Conf.territoryBlockCreepersWhenOffline || Conf.territoryBlockFireballsWhenOffline || Conf.territoryBlockTNTWhenOffline))) ||
|
(faction.isNormal() && (online ? (Conf.territoryBlockCreepers || Conf.territoryBlockFireballs || Conf.territoryBlockTNT) : (Conf.territoryBlockCreepersWhenOffline || Conf.territoryBlockFireballsWhenOffline || Conf.territoryBlockTNTWhenOffline))) ||
|
||||||
(faction.isWarZone() && (Conf.warZoneBlockCreepers || Conf.warZoneBlockFireballs || Conf.warZoneBlockTNT)) ||
|
(faction.isWarZone() && (Conf.warZoneBlockCreepers || Conf.warZoneBlockFireballs || Conf.warZoneBlockTNT)) ||
|
||||||
faction.isSafeZone()) {
|
faction.isSafeZone()) {
|
||||||
// explosion which needs prevention
|
// explosion which needs prevention
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -512,9 +512,9 @@ public class FactionsEntityListener implements Listener {
|
|||||||
Faction faction = Board.getInstance().getFactionAt(new FLocation(loc));
|
Faction faction = Board.getInstance().getFactionAt(new FLocation(loc));
|
||||||
// it's a bit crude just using fireball protection, but I'd rather not add in a whole new set of xxxBlockWitherExplosion or whatever
|
// it's a bit crude just using fireball protection, but I'd rather not add in a whole new set of xxxBlockWitherExplosion or whatever
|
||||||
if ((faction.isWilderness() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) ||
|
if ((faction.isWilderness() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) ||
|
||||||
(faction.isNormal() && (faction.hasPlayersOnline() ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) ||
|
(faction.isNormal() && (faction.hasPlayersOnline() ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
|
(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
|
||||||
faction.isSafeZone()) {
|
faction.isSafeZone()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -554,10 +554,10 @@ public class FactionsEntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
// quick check to see if all Enderman deny options are enabled; if so, no need to check location
|
// quick check to see if all Enderman deny options are enabled; if so, no need to check location
|
||||||
if (Conf.wildernessDenyEndermanBlocks &&
|
if (Conf.wildernessDenyEndermanBlocks &&
|
||||||
Conf.territoryDenyEndermanBlocks &&
|
Conf.territoryDenyEndermanBlocks &&
|
||||||
Conf.territoryDenyEndermanBlocksWhenOffline &&
|
Conf.territoryDenyEndermanBlocksWhenOffline &&
|
||||||
Conf.safeZoneDenyEndermanBlocks &&
|
Conf.safeZoneDenyEndermanBlocks &&
|
||||||
Conf.warZoneDenyEndermanBlocks) {
|
Conf.warZoneDenyEndermanBlocks) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,9 +468,9 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
|
|
||||||
Location home = me.getFaction().getHome();
|
Location home = me.getFaction().getHome();
|
||||||
if (Conf.homesEnabled &&
|
if (Conf.homesEnabled &&
|
||||||
Conf.homesTeleportToOnDeath &&
|
Conf.homesTeleportToOnDeath &&
|
||||||
home != null &&
|
home != null &&
|
||||||
(Conf.homesRespawnFromNoPowerLossWorlds || !Conf.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName()))) {
|
(Conf.homesRespawnFromNoPowerLossWorlds || !Conf.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName()))) {
|
||||||
event.setRespawnLocation(home);
|
event.setRespawnLocation(home);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -515,10 +515,10 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (me.hasFaction() &&
|
if (me.hasFaction() &&
|
||||||
!me.isAdminBypassing() &&
|
!me.isAdminBypassing() &&
|
||||||
!Conf.permanentFactionMemberDenyCommands.isEmpty() &&
|
!Conf.permanentFactionMemberDenyCommands.isEmpty() &&
|
||||||
me.getFaction().isPermanent() &&
|
me.getFaction().isPermanent() &&
|
||||||
isCommandInList(fullCmd, shortCmd, Conf.permanentFactionMemberDenyCommands.iterator())) {
|
isCommandInList(fullCmd, shortCmd, Conf.permanentFactionMemberDenyCommands.iterator())) {
|
||||||
me.msg(TL.PLAYER_COMMAND_PERMANENT, fullCmd);
|
me.msg(TL.PLAYER_COMMAND_PERMANENT, fullCmd);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,8 @@ public enum Role {
|
|||||||
return NORMAL;
|
return NORMAL;
|
||||||
case 2:
|
case 2:
|
||||||
return MODERATOR;
|
return MODERATOR;
|
||||||
case 3: return ADMIN;
|
case 3:
|
||||||
|
return ADMIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -68,7 +69,7 @@ public enum Role {
|
|||||||
return this.nicename;
|
return this.nicename;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TL getTranslation(){
|
public TL getTranslation() {
|
||||||
return translation;
|
return translation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import com.massivecraft.factions.*;
|
|||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.struct.Relation;
|
import com.massivecraft.factions.struct.Relation;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import com.massivecraft.factions.zcore.util.TagUtil;
|
|
||||||
import me.clip.placeholderapi.external.EZPlaceholderHook;
|
import me.clip.placeholderapi.external.EZPlaceholderHook;
|
||||||
import org.apache.commons.lang.time.DurationFormatUtils;
|
import org.apache.commons.lang.time.DurationFormatUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -21,7 +20,7 @@ public class PlaceholderAPIManager extends EZPlaceholderHook {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String onPlaceholderRequest(Player player, String placeholder) {
|
public String onPlaceholderRequest(Player player, String placeholder) {
|
||||||
if(player == null || placeholder == null) {
|
if (player == null || placeholder == null) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ public class PlaceholderAPIManager extends EZPlaceholderHook {
|
|||||||
return String.valueOf(fPlayer.getKills());
|
return String.valueOf(fPlayer.getKills());
|
||||||
case "player_deaths":
|
case "player_deaths":
|
||||||
return String.valueOf(fPlayer.getDeaths());
|
return String.valueOf(fPlayer.getDeaths());
|
||||||
// Then Faction stuff
|
// Then Faction stuff
|
||||||
case "faction_name":
|
case "faction_name":
|
||||||
return faction.getTag();
|
return faction.getTag();
|
||||||
case "faction_power":
|
case "faction_power":
|
||||||
|
@ -94,9 +94,9 @@ public abstract class SpiralTask implements Runnable {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Below are the guts of the class, which you normally wouldn't need to mess with.
|
* Below are the guts of the class, which you normally wouldn't need to mess with.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public final void setTaskID(int ID) {
|
public final void setTaskID(int ID) {
|
||||||
if (ID == -1) {
|
if (ID == -1) {
|
||||||
|
@ -7,6 +7,7 @@ public enum Access {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Case insensitive check for access.
|
* Case insensitive check for access.
|
||||||
|
*
|
||||||
* @param check
|
* @param check
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -37,6 +37,7 @@ public enum Action {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Case insensitive check for action.
|
* Case insensitive check for action.
|
||||||
|
*
|
||||||
* @param check
|
* @param check
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -14,54 +14,54 @@ import java.util.Map.Entry;
|
|||||||
|
|
||||||
|
|
||||||
public abstract class MemoryBoard extends Board {
|
public abstract class MemoryBoard extends Board {
|
||||||
|
|
||||||
public class MemoryBoardMap extends HashMap<FLocation, String> {
|
public class MemoryBoardMap extends HashMap<FLocation, String> {
|
||||||
private static final long serialVersionUID = -6689617828610585368L;
|
private static final long serialVersionUID = -6689617828610585368L;
|
||||||
|
|
||||||
Multimap<String, FLocation> factionToLandMap = HashMultimap.create();
|
Multimap<String, FLocation> factionToLandMap = HashMultimap.create();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String put(FLocation floc, String factionId) {
|
public String put(FLocation floc, String factionId) {
|
||||||
String previousValue = super.put(floc, factionId);
|
String previousValue = super.put(floc, factionId);
|
||||||
if (previousValue != null) {
|
if (previousValue != null) {
|
||||||
factionToLandMap.remove(previousValue, floc);
|
factionToLandMap.remove(previousValue, floc);
|
||||||
}
|
}
|
||||||
|
|
||||||
factionToLandMap.put(factionId, floc);
|
factionToLandMap.put(factionId, floc);
|
||||||
return previousValue;
|
return previousValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String remove(Object key) {
|
public String remove(Object key) {
|
||||||
String result = super.remove(key);
|
String result = super.remove(key);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
FLocation floc = (FLocation) key;
|
FLocation floc = (FLocation) key;
|
||||||
factionToLandMap.remove(result, floc);
|
factionToLandMap.remove(result, floc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
super.clear();
|
super.clear();
|
||||||
factionToLandMap.clear();
|
factionToLandMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getOwnedLandCount(String factionId) {
|
public int getOwnedLandCount(String factionId) {
|
||||||
return factionToLandMap.get(factionId).size();
|
return factionToLandMap.get(factionId).size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeFaction(String factionId) {
|
public void removeFaction(String factionId) {
|
||||||
Collection<FLocation> flocations = factionToLandMap.removeAll(factionId);
|
Collection<FLocation> flocations = factionToLandMap.removeAll(factionId);
|
||||||
for (FLocation floc : flocations) {
|
for (FLocation floc : flocations) {
|
||||||
super.remove(floc);
|
super.remove(floc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MemoryBoardMap flocationIds = new MemoryBoardMap();
|
public MemoryBoardMap flocationIds = new MemoryBoardMap();
|
||||||
|
|
||||||
//----------------------------------------------//
|
//----------------------------------------------//
|
||||||
// Get and Set
|
// Get and Set
|
||||||
//----------------------------------------------//
|
//----------------------------------------------//
|
||||||
@ -173,7 +173,6 @@ public abstract class MemoryBoard extends Board {
|
|||||||
* @param flocation - center location.
|
* @param flocation - center location.
|
||||||
* @param faction - faction checking for.
|
* @param faction - faction checking for.
|
||||||
* @param radius - chunk radius to check.
|
* @param radius - chunk radius to check.
|
||||||
*
|
|
||||||
* @return true if another Faction is within the radius, otherwise false.
|
* @return true if another Faction is within the radius, otherwise false.
|
||||||
*/
|
*/
|
||||||
public boolean hasFactionWithin(FLocation flocation, Faction faction, int radius) {
|
public boolean hasFactionWithin(FLocation flocation, Faction faction, int radius) {
|
||||||
@ -277,10 +276,10 @@ public abstract class MemoryBoard extends Board {
|
|||||||
} else if (factionHere.isWarZone()) {
|
} else if (factionHere.isWarZone()) {
|
||||||
row.append(ChatColor.DARK_RED + "+");
|
row.append(ChatColor.DARK_RED + "+");
|
||||||
} else if (factionHere == faction ||
|
} else if (factionHere == faction ||
|
||||||
factionHere == factionLoc ||
|
factionHere == factionLoc ||
|
||||||
relation.isAtLeast(Relation.ALLY) ||
|
relation.isAtLeast(Relation.ALLY) ||
|
||||||
(Conf.showNeutralFactionsOnMap && relation.equals(Relation.NEUTRAL)) ||
|
(Conf.showNeutralFactionsOnMap && relation.equals(Relation.NEUTRAL)) ||
|
||||||
(Conf.showEnemyFactionsOnMap && relation.equals(Relation.ENEMY))) {
|
(Conf.showEnemyFactionsOnMap && relation.equals(Relation.ENEMY))) {
|
||||||
if (!fList.containsKey(factionHere.getTag())) {
|
if (!fList.containsKey(factionHere.getTag())) {
|
||||||
fList.put(factionHere.getTag(), Conf.mapKeyChrs[Math.min(chrIdx++, Conf.mapKeyChrs.length - 1)]);
|
fList.put(factionHere.getTag(), Conf.mapKeyChrs[Math.min(chrIdx++, Conf.mapKeyChrs.length - 1)]);
|
||||||
}
|
}
|
||||||
|
@ -591,7 +591,6 @@ public abstract class MemoryFPlayer implements FPlayer {
|
|||||||
* Check if the scoreboard should be shown. Simple method to be used by above method.
|
* Check if the scoreboard should be shown. Simple method to be used by above method.
|
||||||
*
|
*
|
||||||
* @param toShow Faction to be shown.
|
* @param toShow Faction to be shown.
|
||||||
*
|
|
||||||
* @return true if should show, otherwise false.
|
* @return true if should show, otherwise false.
|
||||||
*/
|
*/
|
||||||
public boolean showInfoBoard(Faction toShow) {
|
public boolean showInfoBoard(Faction toShow) {
|
||||||
@ -686,9 +685,10 @@ public abstract class MemoryFPlayer implements FPlayer {
|
|||||||
public boolean canClaimForFaction(Faction forFaction) {
|
public boolean canClaimForFaction(Faction forFaction) {
|
||||||
return this.isAdminBypassing() || !forFaction.isWilderness() && (forFaction == this.getFaction() && this.getRole().isAtLeast(Role.MODERATOR)) || (forFaction.isSafeZone() && Permission.MANAGE_SAFE_ZONE.has(getPlayer())) || (forFaction.isWarZone() && Permission.MANAGE_WAR_ZONE.has(getPlayer()));
|
return this.isAdminBypassing() || !forFaction.isWilderness() && (forFaction == this.getFaction() && this.getRole().isAtLeast(Role.MODERATOR)) || (forFaction.isSafeZone() && Permission.MANAGE_SAFE_ZONE.has(getPlayer())) || (forFaction.isWarZone() && Permission.MANAGE_WAR_ZONE.has(getPlayer()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canClaimForFactionAtLocation(Faction forFaction, Location location, boolean notifyFailure) {
|
public boolean canClaimForFactionAtLocation(Faction forFaction, Location location, boolean notifyFailure) {
|
||||||
FLocation flocation = new FLocation(location);
|
FLocation flocation = new FLocation(location);
|
||||||
|
|
||||||
return canClaimForFactionAtLocation(forFaction, flocation, notifyFailure);
|
return canClaimForFactionAtLocation(forFaction, flocation, notifyFailure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 drtshock
|
* Copyright (C) 2013 drtshock
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -128,7 +128,6 @@ public enum TagReplacer {
|
|||||||
*
|
*
|
||||||
* @param fac Target faction
|
* @param fac Target faction
|
||||||
* @param fp Target player (can be null)
|
* @param fp Target player (can be null)
|
||||||
*
|
|
||||||
* @return the value for this enum!
|
* @return the value for this enum!
|
||||||
*/
|
*/
|
||||||
protected String getValue(Faction fac, FPlayer fp) {
|
protected String getValue(Faction fac, FPlayer fp) {
|
||||||
@ -232,7 +231,6 @@ public enum TagReplacer {
|
|||||||
* Returns a list of all the variables we can use for this type<br>
|
* Returns a list of all the variables we can use for this type<br>
|
||||||
*
|
*
|
||||||
* @param type the type we want
|
* @param type the type we want
|
||||||
*
|
|
||||||
* @return a list of all the variables with this type
|
* @return a list of all the variables with this type
|
||||||
*/
|
*/
|
||||||
protected static List<TagReplacer> getByType(TagType type) {
|
protected static List<TagReplacer> getByType(TagType type) {
|
||||||
@ -252,7 +250,6 @@ public enum TagReplacer {
|
|||||||
/**
|
/**
|
||||||
* @param original raw line with variables
|
* @param original raw line with variables
|
||||||
* @param value what to replace var in raw line with
|
* @param value what to replace var in raw line with
|
||||||
*
|
|
||||||
* @return the string with the new value
|
* @return the string with the new value
|
||||||
*/
|
*/
|
||||||
public String replace(String original, String value) {
|
public String replace(String original, String value) {
|
||||||
@ -261,7 +258,6 @@ public enum TagReplacer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param toSearch raw line with variables
|
* @param toSearch raw line with variables
|
||||||
*
|
|
||||||
* @return if the raw line contains this enums variable
|
* @return if the raw line contains this enums variable
|
||||||
*/
|
*/
|
||||||
public boolean contains(String toSearch) {
|
public boolean contains(String toSearch) {
|
||||||
|
@ -23,7 +23,6 @@ public class TagUtil {
|
|||||||
*
|
*
|
||||||
* @param faction for faction
|
* @param faction for faction
|
||||||
* @param line raw line from config with variables to replace for
|
* @param line raw line from config with variables to replace for
|
||||||
*
|
|
||||||
* @return clean line
|
* @return clean line
|
||||||
*/
|
*/
|
||||||
public static String parsePlain(Faction faction, String line) {
|
public static String parsePlain(Faction faction, String line) {
|
||||||
@ -40,7 +39,6 @@ public class TagUtil {
|
|||||||
*
|
*
|
||||||
* @param fplayer for player
|
* @param fplayer for player
|
||||||
* @param line raw line from config with variables to replace for
|
* @param line raw line from config with variables to replace for
|
||||||
*
|
|
||||||
* @return clean line
|
* @return clean line
|
||||||
*/
|
*/
|
||||||
public static String parsePlain(FPlayer fplayer, String line) {
|
public static String parsePlain(FPlayer fplayer, String line) {
|
||||||
@ -62,7 +60,6 @@ public class TagUtil {
|
|||||||
* @param faction for faction
|
* @param faction for faction
|
||||||
* @param fplayer from player
|
* @param fplayer from player
|
||||||
* @param line raw line from config with variables to replace for
|
* @param line raw line from config with variables to replace for
|
||||||
*
|
|
||||||
* @return clean line
|
* @return clean line
|
||||||
*/
|
*/
|
||||||
public static String parsePlain(Faction faction, FPlayer fplayer, String line) {
|
public static String parsePlain(Faction faction, FPlayer fplayer, String line) {
|
||||||
@ -85,7 +82,6 @@ public class TagUtil {
|
|||||||
* @param faction for faction (viewers faction)
|
* @param faction for faction (viewers faction)
|
||||||
* @param fme for player (viewer)
|
* @param fme for player (viewer)
|
||||||
* @param line fancy message prefix
|
* @param line fancy message prefix
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static List<FancyMessage> parseFancy(Faction faction, FPlayer fme, String line) {
|
public static List<FancyMessage> parseFancy(Faction faction, FPlayer fme, String line) {
|
||||||
@ -102,7 +98,6 @@ public class TagUtil {
|
|||||||
* Checks if a line has fancy variables
|
* Checks if a line has fancy variables
|
||||||
*
|
*
|
||||||
* @param line raw line from config with variables
|
* @param line raw line from config with variables
|
||||||
*
|
|
||||||
* @return if the line has fancy variables
|
* @return if the line has fancy variables
|
||||||
*/
|
*/
|
||||||
public static boolean hasFancy(String line) {
|
public static boolean hasFancy(String line) {
|
||||||
@ -120,7 +115,6 @@ public class TagUtil {
|
|||||||
* @param target Faction to get relate from
|
* @param target Faction to get relate from
|
||||||
* @param fme Player to relate to
|
* @param fme Player to relate to
|
||||||
* @param prefix First part of the fancy message
|
* @param prefix First part of the fancy message
|
||||||
*
|
|
||||||
* @return list of fancy messages to send
|
* @return list of fancy messages to send
|
||||||
*/
|
*/
|
||||||
protected static List<FancyMessage> getFancy(Faction target, FPlayer fme, TagReplacer type, String prefix) {
|
protected static List<FancyMessage> getFancy(Faction target, FPlayer fme, TagReplacer type, String prefix) {
|
||||||
@ -208,7 +202,6 @@ public class TagUtil {
|
|||||||
* Parses tooltip variables from config <br> Supports variables for factions only (type 2)
|
* Parses tooltip variables from config <br> Supports variables for factions only (type 2)
|
||||||
*
|
*
|
||||||
* @param faction faction to tooltip for
|
* @param faction faction to tooltip for
|
||||||
*
|
|
||||||
* @return list of tooltips for a fancy message
|
* @return list of tooltips for a fancy message
|
||||||
*/
|
*/
|
||||||
private static List<String> tipFaction(Faction faction) {
|
private static List<String> tipFaction(Faction faction) {
|
||||||
@ -223,7 +216,6 @@ public class TagUtil {
|
|||||||
* Parses tooltip variables from config <br> Supports variables for players and factions (types 1 and 2)
|
* Parses tooltip variables from config <br> Supports variables for players and factions (types 1 and 2)
|
||||||
*
|
*
|
||||||
* @param fplayer player to tooltip for
|
* @param fplayer player to tooltip for
|
||||||
*
|
|
||||||
* @return list of tooltips for a fancy message
|
* @return list of tooltips for a fancy message
|
||||||
*/
|
*/
|
||||||
private static List<String> tipPlayer(FPlayer fplayer) {
|
private static List<String> tipPlayer(FPlayer fplayer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user