Slight adjustment to Sataniel's fixes to preserve tab-based indentation for easy merge compare.

This commit is contained in:
ProgrammerDan
2016-04-18 18:15:30 -04:00
parent ddaa2bdbfc
commit 2d0d059008
5 changed files with 779 additions and 763 deletions
@@ -9,39 +9,39 @@ import org.bukkit.entity.Player;
public class GriefPreventionBarrel {
static P brewery = P.p;
static GriefPrevention griefPrevention = GriefPrevention.instance;
static P brewery = P.p;
static GriefPrevention griefPrevention = GriefPrevention.instance;
public static boolean checkAccess(Player player, Block sign) {
PlayerData playerData = griefPrevention.dataStore.getPlayerData(player.getUniqueId());
public static boolean checkAccess(Player player, Block sign) {
PlayerData playerData = griefPrevention.dataStore.getPlayerData(player.getUniqueId());
if (!griefPrevention.claimsEnabledForWorld(player.getWorld()) || playerData.ignoreClaims || !griefPrevention.config_claims_preventTheft) {
return true;
}
if (!griefPrevention.claimsEnabledForWorld(player.getWorld()) || playerData.ignoreClaims || !griefPrevention.config_claims_preventTheft) {
return true;
}
// block container use during pvp combat
if (playerData.inPvpCombat()) {
brewery.msg(player, brewery.languageReader.get("Error_NoBarrelAccess"));
return false;
}
// block container use during pvp combat
if (playerData.inPvpCombat()) {
brewery.msg(player, brewery.languageReader.get("Error_NoBarrelAccess"));
return false;
}
// check permissions for the claim the Barrel is in
Claim claim = griefPrevention.dataStore.getClaimAt(sign.getLocation(), false, playerData.lastClaim);
if (claim != null) {
playerData.lastClaim = claim;
String noContainersReason = claim.allowContainers(player);
if (noContainersReason != null) {
brewery.msg(player, brewery.languageReader.get("Error_NoBarrelAccess"));
return false;
}
}
// check permissions for the claim the Barrel is in
Claim claim = griefPrevention.dataStore.getClaimAt(sign.getLocation(), false, playerData.lastClaim);
if (claim != null) {
playerData.lastClaim = claim;
String noContainersReason = claim.allowContainers(player);
if (noContainersReason != null) {
brewery.msg(player, brewery.languageReader.get("Error_NoBarrelAccess"));
return false;
}
}
// drop any pvp protection, as the player opens a barrel
if (playerData.pvpImmune) {
playerData.pvpImmune = false;
}
// drop any pvp protection, as the player opens a barrel
if (playerData.pvpImmune) {
playerData.pvpImmune = false;
}
return true;
}
return true;
}
}