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,14 +7,13 @@ 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;
public class PlayerChunkLocationExpression extends SimpleExpression<String> {
static{
Skript.registerExpression(PlayerChunkLocationExpression.class, String.class, ExpressionType.SIMPLE,"[the] faction chunk at %player%", "[the] %player%['s] chunk");
static {
Skript.registerExpression(PlayerChunkLocationExpression.class, String.class, ExpressionType.SIMPLE, "[the] faction chunk at %player%", "[the] %player%['s] chunk");
}
Expression<Player> playerExpression;

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;
@ -153,7 +150,7 @@ public class DefaultPermissions {
else if (name == "tntfill") return this.tntfill;
else if (name == "withdraw") return this.withdraw;
else if (name == "chest") return this.chest;
else if(name == "check") return this.check;
else if (name == "check") return this.check;
else if (name == "spawner") return this.spawner;
else return false;
}

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

@ -173,13 +173,13 @@ public class FUpgradesGUI implements Listener {
break;
}
}
} else if(e.getCurrentItem().equals(memberItem)){
} else if (e.getCurrentItem().equals(memberItem)) {
int memberLevel = fme.getFaction().getUpgrade(UpgradeType.MEMBERS) + 1;
if(!P.p.getConfig().isSet("fupgrades.MainMenu.Members.Cost.level-" + memberLevel)){
if (!P.p.getConfig().isSet("fupgrades.MainMenu.Members.Cost.level-" + memberLevel)) {
return;
}
int cost = P.p.getConfig().getInt("fupgrades.MainMenu.Members.Cost.level-" + memberLevel);
if(hasMoney(fme, cost)){
if (hasMoney(fme, cost)) {
fme.getFaction().setUpgrade(UpgradeType.MEMBERS, memberLevel);
fme.getPlayer().closeInventory();
takeMoney(fme, cost);
@ -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;
@ -758,7 +756,7 @@ public abstract class MemoryFPlayer implements FPlayer {
myFaction.removeAnnouncements(this);
if(this.isAlt()){
if (this.isAlt()) {
myFaction.removeAltPlayer(this);
this.msg(TL.LEAVE_LEFT, this.describeTo(this, true), myFaction.describeTo(this));
}
@ -913,7 +911,7 @@ public abstract class MemoryFPlayer implements FPlayer {
public void setFFlying(boolean fly, boolean damage) {
Player player = getPlayer();
if(player == null) return;
if (player == null) return;
player.setAllowFlight(fly);
player.setFlying(fly);
@ -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);
}
}