Code Overhaul and Added ALOT
This commit is contained in:
@@ -21,6 +21,8 @@ import com.massivecraft.factions.zcore.fperms.Permissable;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.fupgrades.*;
|
||||
import com.massivecraft.factions.zcore.util.TextUtil;
|
||||
import me.driftay.addons.bankxp.Deposit;
|
||||
import me.driftay.addons.bankxp.Withdraw;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
import org.bukkit.*;
|
||||
@@ -82,6 +84,7 @@ public class SavageFactions extends MPlugin {
|
||||
private ClipPlaceholderAPIManager clipPlaceholderAPIManager;
|
||||
private boolean mvdwPlaceholderAPIManager = false;
|
||||
private Listener[] eventsListener;
|
||||
public static Economy econ = null;
|
||||
|
||||
public SavageFactions() {
|
||||
plugin = this;
|
||||
@@ -239,7 +242,7 @@ public class SavageFactions extends MPlugin {
|
||||
new EXPUpgrade(),
|
||||
new CropUpgrades(),
|
||||
new RedstoneUpgrade(),
|
||||
new SpawnerUpgrades(),
|
||||
new SpawnerUpgrades()
|
||||
};
|
||||
|
||||
for (Listener eventListener : eventsListener)
|
||||
@@ -249,6 +252,15 @@ public class SavageFactions extends MPlugin {
|
||||
getCommand(this.refCommand).setExecutor(this);
|
||||
getCommand(this.refCommand).setTabCompleter(this);
|
||||
|
||||
if(getConfig().getBoolean("XP-BankNote-Enabled")) {
|
||||
getCommand("withdraw").setExecutor(new Withdraw());
|
||||
getCommand("bottle").setExecutor(new Withdraw());
|
||||
getServer().getPluginManager().registerEvents(new Deposit(), this);
|
||||
}
|
||||
|
||||
RegisteredServiceProvider<Economy> rsp = SavageFactions.this.getServer().getServicesManager().getRegistration(Economy.class);
|
||||
SavageFactions.econ = rsp.getProvider();
|
||||
|
||||
if (getDescription().getFullName().contains("BETA")) {
|
||||
divider();
|
||||
System.out.println("You are using a BETA version of the plugin!");
|
||||
|
||||
@@ -14,11 +14,11 @@ public class CmdPaypalSee extends FCommand {
|
||||
permission = Permission.ADMIN.node;
|
||||
|
||||
disableOnLock = false;
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
senderMustBeAdmin = true;
|
||||
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -9,10 +9,12 @@ public class CmdPaypalSet extends FCommand {
|
||||
public CmdPaypalSet() {
|
||||
this.aliases.add("setpaypal");
|
||||
this.requiredArgs.add("email");
|
||||
|
||||
this.permission = Permission.PAYPALSET.node;
|
||||
|
||||
this.disableOnLock = false;
|
||||
this.senderMustBePlayer = true;
|
||||
this.senderMustBeMember = false;
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeModerator = false;
|
||||
this.senderMustBeColeader = false;
|
||||
this.senderMustBeAdmin = true;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdStrike extends FCommand {
|
||||
|
||||
|
||||
public CmdStrike() {
|
||||
super();
|
||||
|
||||
@@ -50,3 +49,4 @@ public class CmdStrike extends FCommand {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdSetStrikes extends FCommand {
|
||||
public class CmdStrikeSet extends FCommand {
|
||||
|
||||
|
||||
public CmdSetStrikes() {
|
||||
public CmdStrikeSet() {
|
||||
super();
|
||||
this.aliases.add("setstrikes");
|
||||
this.aliases.add("setstrike");
|
||||
@@ -106,7 +106,7 @@ public class FCmdRoot extends FCommand {
|
||||
public CmdChest cmdChest = new CmdChest();
|
||||
public CmdSetBanner cmdSetBanner = new CmdSetBanner();
|
||||
public CmdStrike cmdStrike = new CmdStrike();
|
||||
public CmdSetStrikes cmdSetStrikes = new CmdSetStrikes();
|
||||
public CmdStrikeSet cmdStrikeSet = new CmdStrikeSet();
|
||||
public CmdAlts cmdAlts = new CmdAlts();
|
||||
|
||||
|
||||
@@ -146,7 +146,6 @@ public class FCmdRoot extends FCommand {
|
||||
this.addSubCommand(this.cmdDescription);
|
||||
this.addSubCommand(this.cmdDisband);
|
||||
this.addSubCommand(this.cmdStrike);
|
||||
this.addSubCommand(this.cmdSetStrikes);
|
||||
this.addSubCommand(this.cmdHelp);
|
||||
this.addSubCommand(this.cmdHome);
|
||||
this.addSubCommand(this.cmdInvite);
|
||||
@@ -222,6 +221,7 @@ public class FCmdRoot extends FCommand {
|
||||
this.addSubCommand(this.cmdTntFill);
|
||||
this.addSubCommand(this.cmdChest);
|
||||
this.addSubCommand(this.cmdSetBanner);
|
||||
this.addSubCommand(this.cmdStrikeSet);
|
||||
|
||||
|
||||
if(SavageFactions.plugin.getConfig().getBoolean("f-alts.Enabled")){
|
||||
@@ -246,7 +246,7 @@ public class FCmdRoot extends FCommand {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
this.addSubCommand(this.cmdFly);
|
||||
}
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("FactionsTop") != null) {
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("FactionsTop") != null || Bukkit.getServer().getPluginManager().getPlugin("SavageFTOP") != null) {
|
||||
SavageFactions.plugin.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
|
||||
} else {
|
||||
SavageFactions.plugin.log(Level.INFO, "Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc.");
|
||||
|
||||
@@ -4,7 +4,6 @@ public enum UpgradeType {
|
||||
|
||||
CHEST("Chest"), SPAWNER("Spawner"), EXP("Exp"), CROP("Crop"), POWER("Power"), REDSTONE("Redstone");
|
||||
|
||||
|
||||
private String id;
|
||||
|
||||
UpgradeType(String id) {
|
||||
|
||||
@@ -134,6 +134,7 @@ public enum TL {
|
||||
COMMAND_ANNOUNCE_DESCRIPTION("Announce a message to players in faction."),
|
||||
|
||||
COMMAND_ALTS_DESCRIPTION("Faction Alts Commands"),
|
||||
COMMAND_STRIKE_DESCRIPTION("Faction Strike Commands"),
|
||||
|
||||
COMMAND_ALTS_LIST_DESCRIPTION("List all alts in your faction"),
|
||||
|
||||
@@ -366,6 +367,11 @@ public enum TL {
|
||||
COMMAND_INVITE_DESCRIPTION("Invite a player to your faction"),
|
||||
COMMAND_INVITE_BANNED("&c&l[!]&7 &7%1$s &cis banned &7from your Faction. &cNot &7sending an invite."),
|
||||
|
||||
BANKNOTE_WITHDRAW_NOT_ENOUGH("&c&l[!] &7You do not have enough money!"),
|
||||
BANKNOTE_WITHDRAW_NO_ARGS("&c&l[!] &7Try /withdraw <amount>"),
|
||||
XPBOTTLE_NOT_ENOUGH("&c&l[!] &7You do not have enough experience!"),
|
||||
XPBOTTLE_WITHDRAW_NO_ARGS("&c&l[!] &7Try /bottle <amount>"),
|
||||
|
||||
COMMAND_JOIN_CANNOTFORCE("&c&l[!]&7 You&c do not&7 have permission to &cmove other players&7 into a faction."),
|
||||
COMMAND_JOIN_SYSTEMFACTION("&c&l[!]&7 Players may only join &cnormal factions&7. This is a &c&lsystem faction&7."),
|
||||
COMMAND_JOIN_ALREADYMEMBER("&c&l[!]&7 &c%1$s %2$s already a member of&c %3$s"),
|
||||
@@ -617,6 +623,7 @@ public enum TL {
|
||||
COMMAND_SETHOME_SET("&c&l[!]&c %1$s&7 set the home for your faction. You can now use:"),
|
||||
COMMAND_SETHOME_SETOTHER("&c&l[!]&7 You have set the home for the &c%1$s&7 faction."),
|
||||
COMMAND_SETHOME_DESCRIPTION("Set the faction home"),
|
||||
COMMAND_STRIKE_FACTION("View Factions Strikes"),
|
||||
|
||||
COMMAND_SETMAXVAULTS_DESCRIPTION("Set max vaults for a Faction."),
|
||||
COMMAND_SETMAXVAULTS_SUCCESS("&aSet max vaults for &e%s &ato &b%d"),
|
||||
@@ -624,12 +631,14 @@ public enum TL {
|
||||
COMMAND_SETSTRIKES_FAILURE("&c&l[!]&7 &c{faction} does not exist."),
|
||||
COMMAND_SETSTRIKES_BROADCAST("&c&l[!]&7 &c{faction} has received a strike for {reason}"),
|
||||
COMMAND_SETSTRIKES_SUCCESS("&c&l[!]&7 &c{faction}'s&7 new strikes are &c{strikes}"),
|
||||
COMMAND_SETSTRIKES_DESCRIPTION("Set a faction's points"),
|
||||
COMMAND_SETSTRIKES_DESCRIPTION("Set a faction's strikes"),
|
||||
COMMAND_STRIKEREMOVE_DESCRIPTION("Remove a faction's strikes"),
|
||||
|
||||
COMMAND_STRIKE_MESSAGE("&c&l[!] &7{faction} has {strikes} strikes."),
|
||||
COMMAND_STRIKE_NOTFOUND("&c&l[!] &7{faction} does not exist."),
|
||||
COMMAND_STRIKE_NEEDFACTION("&c&l[!] &7&cYou need to join a faction to view your own!"),
|
||||
COMMAND_STRIKE_DESCRIPTION("Give a faction strikes."),
|
||||
|
||||
COMMAND_STRIKEGIVE_DESCRIPTION("Give a faction strikes"),
|
||||
|
||||
COMMAND_VAULT_DESCRIPTION("Open your placed faction vault!"),
|
||||
COMMAND_VAULT_INVALID("&c&l[!]&7 Your vault was either&c claimed&7, &cbroken&7, or has&c not been&7 placed yet."),
|
||||
|
||||
Reference in New Issue
Block a user