One Final Reformat

This commit is contained in:
Driftay 2019-08-24 13:21:39 -04:00
parent 72f76aeb71
commit 6a7258b692
53 changed files with 6311 additions and 6312 deletions

View File

@ -7,7 +7,6 @@ import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean; import ch.njol.util.Kleenean;
import com.massivecraft.factions.*; import com.massivecraft.factions.*;
import org.bukkit.Chunk;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Event; import org.bukkit.event.Event;

View File

@ -26,6 +26,11 @@ public enum Access {
return null; return null;
} }
public static Access booleanToAccess(boolean access) {
if (access) return Access.ALLOW;
else return Access.DENY;
}
public String getName() { public String getName() {
return this.name.toLowerCase(); return this.name.toLowerCase();
} }
@ -35,10 +40,7 @@ public enum Access {
return name(); return name();
} }
public String getColor() { return P.p.getConfig().getString("fperm-gui.action.Access-Colors." + this.name); } public String getColor() {
return P.p.getConfig().getString("fperm-gui.action.Access-Colors." + this.name);
public static Access booleanToAccess(boolean access) {
if (access) return Access.ALLOW;
else return Access.DENY;
} }
} }

View File

@ -1,8 +1,5 @@
package com.massivecraft.factions.zcore.fperms; package com.massivecraft.factions.zcore.fperms;
import com.massivecraft.factions.util.XMaterial;
import javafx.scene.paint.Material;
public class DefaultPermissions { public class DefaultPermissions {
public boolean ban; public boolean ban;
public boolean build; public boolean build;

View File

@ -64,8 +64,6 @@ public enum PermissableAction {
return null; return null;
} }
public int getSlot() { return P.p.getConfig().getInt("fperm-gui.action.slots." + this.name.toLowerCase()); }
public static Map<PermissableAction, Access> fromDefaults(DefaultPermissions defaultPermissions) { public static Map<PermissableAction, Access> fromDefaults(DefaultPermissions defaultPermissions) {
Map<PermissableAction, Access> defaultMap = new HashMap<>(); Map<PermissableAction, Access> defaultMap = new HashMap<>();
for (PermissableAction permissableAction : PermissableAction.values()) { for (PermissableAction permissableAction : PermissableAction.values()) {
@ -74,6 +72,17 @@ public enum PermissableAction {
return defaultMap; return defaultMap;
} }
public static PermissableAction fromSlot(int slot) {
for (PermissableAction action : PermissableAction.values()) {
if (action.getSlot() == slot) return action;
}
return null;
}
public int getSlot() {
return P.p.getConfig().getInt("fperm-gui.action.slots." + this.name.toLowerCase());
}
/** /**
* Get the friendly name of this action. Used for editing in commands. * Get the friendly name of this action. Used for editing in commands.
* *
@ -105,11 +114,4 @@ public enum PermissableAction {
return item; return item;
} }
public static PermissableAction fromSlot(int slot) {
for (PermissableAction action : PermissableAction.values()) {
if (action.getSlot() == slot) return action;
}
return null;
}
} }

View File

@ -268,7 +268,6 @@ public class FUpgradesGUI implements Listener {
} }
Material cropMaterial = Material.getMaterial(P.p.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Type")); Material cropMaterial = Material.getMaterial(P.p.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Type"));
int cropAmt = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Amount"); int cropAmt = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Amount");
short cropData = Short.parseShort(P.p.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Damage") + ""); short cropData = Short.parseShort(P.p.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Damage") + "");

View File

@ -41,8 +41,8 @@ import java.util.*;
*/ */
public abstract class MemoryFPlayer implements FPlayer { public abstract class MemoryFPlayer implements FPlayer {
protected HashMap<String, Long> commandCooldown = new HashMap<>();
public boolean inVault = false; public boolean inVault = false;
protected HashMap<String, Long> commandCooldown = new HashMap<>();
protected String factionId; protected String factionId;
protected Role role; protected Role role;
protected String title; protected String title;
@ -76,16 +76,8 @@ public abstract class MemoryFPlayer implements FPlayer {
protected transient boolean shouldTakeFallDamage = true; protected transient boolean shouldTakeFallDamage = true;
protected boolean isStealthEnabled = false; protected boolean isStealthEnabled = false;
protected boolean notificationsEnabled = true; protected boolean notificationsEnabled = true;
boolean inspectMode = false;
protected boolean isAlt = false; protected boolean isAlt = false;
boolean inspectMode = false;
public void setAlt(boolean alt){
this.isAlt = alt;
}
public boolean isAlt() {
return isAlt;
}
public MemoryFPlayer() { public MemoryFPlayer() {
} }
@ -139,7 +131,13 @@ public abstract class MemoryFPlayer implements FPlayer {
this.mapHeight = Conf.mapHeight; this.mapHeight = Conf.mapHeight;
} }
public boolean isAlt() {
return isAlt;
}
public void setAlt(boolean alt) {
this.isAlt = alt;
}
public boolean isStealthEnabled() { public boolean isStealthEnabled() {
return this.isStealthEnabled; return this.isStealthEnabled;
@ -1253,7 +1251,6 @@ public abstract class MemoryFPlayer implements FPlayer {
} }
@Override @Override
public String getRolePrefix() { public String getRolePrefix() {

View File

@ -1276,7 +1276,8 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
public boolean playerHasOwnershipRights(FPlayer fplayer, FLocation loc) { public boolean playerHasOwnershipRights(FPlayer fplayer, FLocation loc) {
// in own faction, with sufficient role or permission to bypass // in own faction, with sufficient role or permission to bypass
// ownership? // ownership?
if (fplayer.getFaction() == this && (fplayer.getRole().isAtLeast(Conf.ownedAreaModeratorsBypass ? Role.MODERATOR : Role.LEADER) || Permission.OWNERSHIP_BYPASS.has(fplayer.getPlayer()))) return true; if (fplayer.getFaction() == this && (fplayer.getRole().isAtLeast(Conf.ownedAreaModeratorsBypass ? Role.MODERATOR : Role.LEADER) || Permission.OWNERSHIP_BYPASS.has(fplayer.getPlayer())))
return true;
// make sure claimOwnership is initialized // make sure claimOwnership is initialized
if (claimOwnership.isEmpty()) return true; if (claimOwnership.isEmpty()) return true;
@ -1309,5 +1310,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
} }
} }
public Set<FLocation> getAllClaims() { return Board.getInstance().getAllClaims(this); } public Set<FLocation> getAllClaims() {
return Board.getInstance().getAllClaims(this);
}
} }