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.util.Kleenean;
import com.massivecraft.factions.*;
import org.bukkit.Chunk;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;

View File

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

View File

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

View File

@ -64,8 +64,6 @@ public enum PermissableAction {
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) {
Map<PermissableAction, Access> defaultMap = new HashMap<>();
for (PermissableAction permissableAction : PermissableAction.values()) {
@ -74,6 +72,17 @@ public enum PermissableAction {
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.
*
@ -105,11 +114,4 @@ public enum PermissableAction {
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"));
int cropAmt = P.p.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Amount");
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 {
protected HashMap<String, Long> commandCooldown = new HashMap<>();
public boolean inVault = false;
protected HashMap<String, Long> commandCooldown = new HashMap<>();
protected String factionId;
protected Role role;
protected String title;
@ -76,16 +76,8 @@ public abstract class MemoryFPlayer implements FPlayer {
protected transient boolean shouldTakeFallDamage = true;
protected boolean isStealthEnabled = false;
protected boolean notificationsEnabled = true;
boolean inspectMode = false;
protected boolean isAlt = false;
public void setAlt(boolean alt){
this.isAlt = alt;
}
public boolean isAlt() {
return isAlt;
}
boolean inspectMode = false;
public MemoryFPlayer() {
}
@ -139,7 +131,13 @@ public abstract class MemoryFPlayer implements FPlayer {
this.mapHeight = Conf.mapHeight;
}
public boolean isAlt() {
return isAlt;
}
public void setAlt(boolean alt) {
this.isAlt = alt;
}
public boolean isStealthEnabled() {
return this.isStealthEnabled;
@ -1253,7 +1251,6 @@ public abstract class MemoryFPlayer implements FPlayer {
}
@Override
public String getRolePrefix() {

View File

@ -1276,7 +1276,8 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
public boolean playerHasOwnershipRights(FPlayer fplayer, FLocation loc) {
// in own faction, with sufficient role or permission to bypass
// 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
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);
}
}