Added PvP rules options for lava and flint/steel.

This commit is contained in:
ryanhamshire 2015-10-12 16:10:24 -07:00
parent 875303faf7
commit a3a916f7d0
2 changed files with 8 additions and 2 deletions

View File

@ -136,6 +136,8 @@ public class GriefPrevention extends JavaPlugin
public boolean config_pvp_noCombatInPlayerLandClaims; //whether players may fight in player-owned land claims
public boolean config_pvp_noCombatInAdminLandClaims; //whether players may fight in admin-owned land claims
public boolean config_pvp_noCombatInAdminSubdivisions; //whether players may fight in subdivisions of admin-owned land claims
public boolean config_pvp_allowLavaNearPlayers; //whether players may dump lava near other players in pvp worlds
public boolean config_pvp_allowFireNearPlayers; //whether players may start flint/steel fires near other players in pvp worlds
public boolean config_lockDeathDropsInPvpWorlds; //whether players' dropped on death items are protected in pvp worlds
public boolean config_lockDeathDropsInNonPvpWorlds; //whether players' dropped on death items are protected in non-pvp worlds
@ -692,6 +694,8 @@ public class GriefPrevention extends JavaPlugin
this.config_pvp_noCombatInPlayerLandClaims = config.getBoolean("GriefPrevention.PvP.ProtectPlayersInLandClaims.PlayerOwnedClaims", this.config_siege_enabledWorlds.size() == 0);
this.config_pvp_noCombatInAdminLandClaims = config.getBoolean("GriefPrevention.PvP.ProtectPlayersInLandClaims.AdministrativeClaims", this.config_siege_enabledWorlds.size() == 0);
this.config_pvp_noCombatInAdminSubdivisions = config.getBoolean("GriefPrevention.PvP.ProtectPlayersInLandClaims.AdministrativeSubdivisions", this.config_siege_enabledWorlds.size() == 0);
this.config_pvp_allowLavaNearPlayers = config.getBoolean("GriefPrevention.PvP.AllowLavaDumpingNearOtherPlayers", true);
this.config_pvp_allowFireNearPlayers = config.getBoolean("GriefPrevention.PvP.AllowFlintAndSteelNearOtherPlayers", true);
//optional database settings
this.databaseUrl = config.getString("GriefPrevention.Database.URL", "");
@ -765,6 +769,8 @@ public class GriefPrevention extends JavaPlugin
outConfig.set("GriefPrevention.PvP.ProtectPlayersInLandClaims.PlayerOwnedClaims", this.config_pvp_noCombatInPlayerLandClaims);
outConfig.set("GriefPrevention.PvP.ProtectPlayersInLandClaims.AdministrativeClaims", this.config_pvp_noCombatInAdminLandClaims);
outConfig.set("GriefPrevention.PvP.ProtectPlayersInLandClaims.AdministrativeSubdivisions", this.config_pvp_noCombatInAdminSubdivisions);
outConfig.set("GriefPrevention.PvP.AllowLavaDumpingNearOtherPlayers", this.config_pvp_allowLavaNearPlayers);
outConfig.set("GriefPrevention.PvP.AllowFlintAndSteelNearOtherPlayers", this.config_pvp_allowFireNearPlayers);
outConfig.set("GriefPrevention.Economy.ClaimBlocksPurchaseCost", this.config_economy_claimBlocksPurchaseCost);
outConfig.set("GriefPrevention.Economy.ClaimBlocksSellValue", this.config_economy_claimBlocksSellValue);
@ -2545,7 +2551,7 @@ public class GriefPrevention extends JavaPlugin
//helper method to resolve a player by name
ConcurrentHashMap<String, UUID> playerNameToIDMap = new ConcurrentHashMap<String, UUID>();
//thread to build the above cache
//thread to build the above cache
private class CacheOfflinePlayerNamesThread extends Thread
{
private OfflinePlayer [] offlinePlayers;

View File

@ -1391,7 +1391,7 @@ class PlayerEventHandler implements Listener
}
//lava buckets can't be dumped near other players unless pvp is on
if(!GriefPrevention.instance.pvpRulesApply(block.getWorld()) && !player.hasPermission("griefprevention.lava"))
if((!GriefPrevention.instance.pvpRulesApply(block.getWorld()) || !GriefPrevention.instance.config_pvp_allowLavaNearPlayers) && !player.hasPermission("griefprevention.lava"))
{
if(bucketEvent.getBucket() == Material.LAVA_BUCKET)
{