mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 10:08:54 +00:00
Slight adjustment to Sataniel's fixes to preserve tab-based indentation for easy merge compare.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user