Added Upgrade DummyItem Properly, Made config look NOICE & Removed useless thingzz

This commit is contained in:
Driftay
2019-09-11 06:52:08 -04:00
parent e247d01feb
commit 0b4c91af4a
19 changed files with 125 additions and 713 deletions

View File

@@ -83,7 +83,6 @@ public class Conf {
public static String modChatFormat = ChatColor.RED + "%s:" + ChatColor.WHITE + " %s";
public static int stealthFlyCheckRadius = 32;
public static int factionBufferSize = 20;
public static boolean removeHomesOnLeave = false;
public static boolean useCheckSystem = true;
public static boolean gracePeriod = false;
public static boolean noEnderpearlsInFly = false;

View File

@@ -463,8 +463,7 @@ public class P extends MPlugin {
public Economy getEcon() {
RegisteredServiceProvider<Economy> rsp = P.p.getServer().getServicesManager().getRegistration(Economy.class);
Economy econ = rsp.getProvider();
return econ;
return rsp.getProvider();
}

View File

@@ -302,7 +302,7 @@ public class FCmdRoot extends FCommand {
if (P.p.getConfig().getBoolean("enable-faction-flight", false)) {
this.addSubCommand(this.cmdFly);
}
if (Bukkit.getServer().getPluginManager().getPlugin("FactionsTop") != null || Bukkit.getServer().getPluginManager().getPlugin("SavageFTOP") != null) {
if (Bukkit.getServer().getPluginManager().getPlugin("FactionsTop") != null || Bukkit.getServer().getPluginManager().getPlugin("SavageFTOP") != null || Bukkit.getServer().getPluginManager().getPlugin("SaberFTOP") != null) {
P.p.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
} else {
P.p.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.");

View File

@@ -4,6 +4,7 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.util.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
@@ -22,18 +23,14 @@ import java.util.List;
public class FUpgradesGUI implements Listener {
public void openMainMenu(FPlayer fme) {
Inventory inventory = Bukkit.createInventory(null, P.p.getConfig().getInt("fupgrades.MainMenu.DummyItem.rows") * 9, P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", fme.getFaction().getTag())));
List<Integer> dummySlots = P.p.getConfig().getIntegerList("fupgrades.MainMenu.DummyItem.slots");
Material dummyMaterial = Material.getMaterial(P.p.getConfig().getString("fupgrades.MainMenu.DummyItem.Type"));
int dummyAmount = P.p.getConfig().getInt("fupgrades.MainMenu.DummyItem.Amount");
short dummyData = Short.parseShort(P.p.getConfig().getInt("fupgrades.MainMenu.DummyItem.Damage") + "");
ItemStack dummyItem = P.p.createItem(dummyMaterial,
dummyAmount,
dummyData,
P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.DummyItem.Name")),
P.p.colorList(P.p.getConfig().getStringList("fupgrades.MainMenu.DummyItem.Lore")));
ItemStack dummyItem = XMaterial.matchXMaterial(P.p.getConfig().getString("fupgrades.MainMenu.DummyItem.Type")).parseItem();
ItemMeta meta = dummyItem.getItemMeta();
meta.setLore(P.p.colorList(P.p.getConfig().getStringList("fupgrades.MainMenu.DummyItem.Lore")));
meta.setDisplayName(P.p.color(P.p.getConfig().getString("fupgrades.MainMenu.DummyItem.Name")));
dummyItem.setItemMeta(meta);
for (int i = 0; i <= dummySlots.size() - 1; i++) {
inventory.setItem(dummySlots.get(i), dummyItem);
for (int fill = 0; fill < P.p.getConfig().getInt("fupgrades.MainMenu.DummyItem.rows") * 9; ++fill) {
inventory.setItem(fill, dummyItem);
}
ItemStack[] items = buildItems(fme);

View File

@@ -159,28 +159,27 @@ scoreboard:
default:
- "&7&m--------------------------"
- "&4&lFaction Info &8»"
- " &8> &cLeader&7: &f{leader}"
- " &8> &cMembers&7: &f{online}&7/&f{members}"
- " &8> &cPower&7: &f{power}&7/&f{maxPower}"
- " &8» &cLeader&7: &f{leader}"
- " &8» &cMembers&7: &f{online}&7/&f{members}"
- " &8» &cPower&7: &f{power}&7/&f{maxPower}"
- "&m"
- "&4&lFaction Stats &8»"
- " &8> &cKills&7: &f{faction-kills}"
- " &8> &cDeaths&7: &f{faction-deaths}"
- " &8> &cBalance&7: &f{faction-balance}"
- " &8» &cDeaths&7: &f{faction-deaths}"
- " &8» &cBalance&7: &f{faction-balance}"
- ""
- " &8> &cYour Balance&7: &f{balance}"
- " &8» &cYour Balance&7: &f{balance}"
- "&7&m---------------------------"
factionless-enabled: true
factionless:
- "&7&m--------------------------"
- "&4&lInformation &8»"
- " &8> &cPlayer&7: &f{name}"
- " &8> &cRank&7: &f{group}"
- " &8> &cBalance&7: &f${balance}"
- " &8» &cPlayer&7: &f{name}"
- " &8» &cRank&7: &f{group}"
- " &8» &cBalance&7: &f${balance}"
- "&m"
- "&4&lServer Info &8» "
- " &8» &cIFaction: &fN/A"
- " &8» &cFaction: &fN/A"
- " &8» &cOnline Players&7: &f{total-online}"
- "&7&m---------------------------"
@@ -275,19 +274,19 @@ hcf:
show:
# First line can be {header} for default header, or any string (we recommend &m for smooth lines ;plugin)
- '&8&m--------------&7 &8<&e{faction}&8> &8&m--------------'
- '&6 * &eOwner: &7{leader}'
- '&6 * &eDescription: &7{description}'
- '&6 * &eLand / Power / Max Power: &7{chunks} &8/ &7{power} &8/ &7{maxPower}'
- '&6 * &eFaction Strikes: &7{strikes}'
- '&6 * &eFaction Points: &7{faction-points}'
- '&6 * &eFounded: &7{create-date}'
- '&6 * &eBalance: &f{faction-balance}'
- '&6 * &eAllies: &c{allies-list}'
- '&6 * &eEnemies: &c{enemies-list}'
- '&6 * &eOnline Members: &8(&7{online}/{members}&8) &7{online-list}'
- '&6 * &eOffline Members: &8(&7{offline}/{members}&8) &7{offline-list}'
- '&6 * &eAlts: &8{alts}'
- '&6 * &eBans: &7{faction-bancount}'
- '&6 * &cOwner: &7{leader}'
- '&6 * &cDescription: &7{description}'
- '&6 * &cLand / Power / Max Power: &7{chunks} &8/ &7{power} &8/ &7{maxPower}'
- '&6 * &cFaction Strikes: &7{strikes}'
- '&6 * &cFaction Points: &7{faction-points}'
- '&6 * &cFounded: &7{create-date}'
- '&6 * &cBalance: &f{faction-balance}'
- '&6 * &cAllies: &5{allies-list}'
- '&6 * &cEnemies: &c{enemies-list}'
- '&6 * &cOnline Members: &8(&7{online}/{members}&8) &7{online-list}'
- '&6 * &cOffline Members: &8(&7{offline}/{members}&8) &7{offline-list}'
- '&6 * &cAlts: &8{alts}'
- '&6 * &cBans: &7{faction-bancount}'
- '&8&m----------------------------------------'
# For a /f show that does not display fancy messages that are essentially empty, use minimal-show
minimal-show: false
@@ -304,13 +303,13 @@ show-exempt:
# Lines that arent defined wont be sent (home not set, faction not peaceful / permanent, dtr freeze)
map:
# First line can be {header} for default header, or any string (we recommend &m for smooth lines ;plugin)
- '&6* &eFaction &7{faction}'
- '&6* &eOwner &7{leader}'
- '&6* &eLand / Power / Max Power: &7{chunks} &8/ &7{power} &8/ &7{maxPower}'
- '&6* &eAllies &c{allies-list}'
- '&6* &eEnemies &c{enemies-list}'
- '&6* &eOnline Members &8(&7{online}/{members}&8) {online-list}'
- '&6* &eOffline Members &7{offline-list}'
- '&6* &cFaction: &7{faction}'
- '&6* &cOwner: &7{leader}'
- '&6* &cLand / Power / Max Power: &7{chunks} &8/ &7{power} &8/ &7{maxPower}'
- '&6* &cAllies: &5{allies-list}'
- '&6* &cEnemies: &c{enemies-list}'
- '&6* &cOnline Members: &8(&7{online}/{members}&8) {online-list}'
- '&6* &cOffline Members: &7{offline-list}'
############################################################
# +------------------------------------------------------+ #
@@ -344,47 +343,62 @@ help:
- '&7&m----------------------------------------------------'
- '&6&lFactions Help &8- &f(1/2) '
- '&7&m----------------------------------------------------'
- '&e/f create &f<name> &8- &7Create your own faction.'
- '&e/f who &f<name> &8- &7Show faction information.'
- '&e/f tag &f<name> &8- &7Change your faction name.'
- '&e/f join &f<name> &8- &7Join to the faction.'
- '&e/f list &8- &7List all factions.'
- '&e/f top &8- &7View the richest factions.'
- '&e/f map &8- &7Map of the surrounding area, click chunks to claim.'
- '&e/f sethome &8- &7Set your faction home.'
- '&e/f home &8- &7Go to your faction home.'
- '&e/f title &f<playername> <title> &8- &7Set a player''s title, color codes supported.'
- '&e/f ban &8- &7Ban a member from your faction.'
- '&e/f unban &8- &7Unban a member from your faction.'
- '&e/f banlist &8- &7List banned players from your faction.'
- '&e/f lowpower &8- &7List player with power under max from your faction.'
- '&e/f coords &8- &7Broadcast your location to your faction.'
- '&e/f showclaims &8- &7List all claims from your faction.'
- '&c/f create &f<name> &8- &7Create your own faction.'
- '&c/f who &f<name> &8- &7Show faction information.'
- '&c/f tag &f<name> &8- &7Change your faction name.'
- '&c/f join &f<name> &8- &7Join to the faction.'
- '&c/f list &8- &7List all factions.'
- '&c/f top &8- &7View the richest factions.'
- '&c/f map &8- &7Map of the surrounding area, click chunks to claim.'
- '&c/f sethome &8- &7Set your faction home.'
- '&c/f home &8- &7Go to your faction home.'
- '&c/f title &f<playername> <title> &8- &7Set a player''s title, color codes supported.'
- '&c/f ban &8- &7Ban a member from your faction.'
- '&c/f unban &8- &7Unban a member from your faction.'
- '&c/f banlist &8- &7List banned players from your faction.'
- '&c/f lowpower &8- &7List player with power under max from your faction.'
- '&c/f coords &8- &7Broadcast your location to your faction.'
- '&c/f showclaims &8- &7List all claims from your faction.'
- '&7&m--------------------&r &e/f help 2 &7&m-----------------------'
'2':
- '&7&m----------------------------------------------------'
- '&6&lFactions Help &8- &f(2/2) '
- '&6&lFactions Help &8- &f(2/3) '
- '&7&m----------------------------------------------------'
- '&e/f leave &8- &7Leave your faction.'
- '&e/f invite &f<playerName> &8- &7Invite a player to your faction.'
- '&e/f deinvite &f<playerName> &8- &7Revoke invitation to player.'
- '&e/f claim &8- &7Claim a land for your faction.'
- '&e/f unclaim &8- &7Unclaim land from your faction.'
- '&e/f kick &f<playerName> &8- &7Kick player from your faction.'
- '&e/f mod &f<playerName> &8- &7Set player to mod role in faction.'
- '&e/f coleader &f<playerName> &8- &7Set player to coleader role in faction.'
- '&e/f leader &f<playerName> &8- &7Set player role to leader in faction.'
- '&e/f chat &f<Faction | Ally | Public> &8- &7Switch to Faction/Ally/Public chat.'
- '&e/f warp &8- &7Opens the warp menu.'
- '&e/f setwarp &8- &7Set a warp.'
- '&e/f perms &8- &7Change what players can do in your claims.'
- '&e/f upgrades &8- &7Upgrade various perks in your faction.'
- '&e/f checkpoint &8- &7Set a faction checkpoint.'
- '&e/f tnt add/take &f<amount> &8- &7Faction Based TNT Bank.'
- '&e/f tntfill &f<radius> <amount> &8- &7Tnt fill integrated into the tntbank!'
- '&e/f chest &8- &7Open a virtual faction chest! '
- '&e/f version &8- &7Display current faction version.'
- '&c/f leave &8- &7Leave your faction.'
- '&c/f invite &f<playerName> &8- &7Invite a player to your faction.'
- '&c/f deinvite &f<playerName> &8- &7Revoke invitation to player.'
- '&c/f claim &8- &7Claim a land for your faction.'
- '&c/f unclaim &8- &7Unclaim land from your faction.'
- '&c/f kick &f<playerName> &8- &7Kick player from your faction.'
- '&c/f mod &f<playerName> &8- &7Set player to mod role in faction.'
- '&c/f coleader &f<playerName> &8- &7Set player to coleader role in faction.'
- '&c/f leader &f<playerName> &8- &7Set player role to leader in faction.'
- '&c/f chat &f<Faction | Ally | Public> &8- &7Switch to Faction/Ally/Public chat.'
- '&c/f warp &8- &7Opens the warp menu.'
- '&c/f setwarp &8- &7Set a warp.'
- '&c/f perms &8- &7Change what players can do in your claims.'
- '&c/f upgrades &8- &7Upgrade various perks in your faction.'
- '&c/f checkpoint &8- &7Set a faction checkpoint.'
- '&c/f tnt add/take &f<amount> &8- &7Faction Based TNT Bank.'
- '&c/f tntfill &f<radius> <amount> &8- &7Tnt fill integrated into the tntbank!'
- '&c/f chest &8- &7Open a virtual faction chest! '
- '&c/f version &8- &7Display current faction version.'
- '&7&m--------------------&r &e/f help 3 &7&m-----------------------'
'3':
- '&7&m----------------------------------------------------'
- '&6&lFactions Help &8- &f(3/3) '
- '&7&m----------------------------------------------------'
- '&c/f shop &8- &7Open Shop GUI.'
- '&c/f check &8- &7Manage All Check Settings.'
- '&c/f weewoo &8- &7Alert all faction members you are being raided.'
- '&c/f missions &8- &7Open/Manage all mission/objectives to complete!'
- '&c/f alts &8- &7Manage All Alts via commands.'
- '&c/f corner &8- &7Use this command in a corner chunk, to claim your entire buffer.'
- '&c/f logout &8- &7Safetly logout, hcf style.'
- '&c/f global &8- &7toggle public chat off and only allow faction based chats.'
- '&c/f points &8- &7Check your factions points.'
- '&c/f invsee &8- &7Check a faction members inventory.'
- '&c/f stealth &8- &7Go into stealth mode to not disable enemies flight.'
############################################################
# +------------------------------------------------------+ #
# | F Permission GUI | #
@@ -513,10 +527,10 @@ fperm-gui:
# {action-access} Access name eg: Allow, Deny
# {action-access-color} Access color eg: Allow;GREEN
placeholder-item:
name: '&e&l(!) &ePermission: &6&n{action}'
name: '&c&l(!) &ePermission: &6&n{action}'
lore:
- ''
- '&6&l * &eStatus: &8[{action-access-color}{action-access}&8]'
- '&6&l * &cStatus: &8[{action-access-color}{action-access}&8]'
- ''
- '&7Left click to &a&nAllow&7.'
- '&7Right click to &c&nDeny&7.'
@@ -552,13 +566,13 @@ fwarp-gui:
- 15
warp-item:
Type: EYE_OF_ENDER
Name: '&e&l(!) &eFaction Warp: &6&n{warp}'
Name: '&c&l(!) &eFaction Warp: &6&n{warp}'
# {warp-protected} Warp protection by password, Enabled & Disabled
# {warp-cost} Warp cost
Lore:
- ''
- '&6&l * &ePassword: &7{warp-protected}'
- '&6&l * &eCost: &7{warp-cost}'
- '&6&l * &cPassword: &7{warp-protected}'
- '&6&l * &cCost: &7{warp-cost}'
- ''
- '&c&lNote: &7You need pay to teleport to'
- '&7a faction warp. Unless it''s &nDisabled&7.'
@@ -785,7 +799,7 @@ fvault:
No-Hoppers-near-vault: true
Price: 5000
Item:
Name: '&e&l*&f&l*&e&l* &e&lFaction Vault &7(Place) &e&l*&f&l*&e&l*'
Name: '&e&l*&f&l*&e&l* &c&lFaction Vault &7(Place) &e&l*&f&l*&e&l*'
Lore:
- '&7Place this vault in your Faction claim, You will'
- '&7then be able to access it.'
@@ -813,59 +827,11 @@ fupgrades:
MainMenu:
Title: '{faction}''s Upgrade Menu'
DummyItem:
Name: '&f'
Type: STAINED_GLASS_PANE
Amount: 1
Damage: 7
Lore:
- ''
rows: 5
slots:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
Name: '&f'
Type: BLACK_STAINED_GLASS_PANE
Lore:
- ' '
Crops:
Crop-Boost:
level-1: 10
@@ -876,7 +842,7 @@ fupgrades:
level-2: 500000
level-3: 750000
CropItem:
Name: '&e&lUpgrade Growth Speed'
Name: '&c&lUpgrade Growth Speed'
Type: WHEAT
Amount: 1
Damage: 0
@@ -884,10 +850,10 @@ fupgrades:
- '&7Increase growth speed of crops in claims.'
- '&7&o(Chance to Grow Two Levels)'
- ''
- '&e&lTier'
- '&c&lTier'
- '&f&l* &7Current Level: &3{level}/3'
- ''
- '&e&lPerks'
- '&c&lPerks'
- '&f&l* &7Level 1 - &f10% Chance'
- '&7 - Cost: $250,000'
- '&f&l* &7Level 2 - &f20% Chance'
@@ -908,17 +874,17 @@ fupgrades:
level-2: 4000000
level-3: 6000000
EXPItem:
Name: '&e&lUpgrade EXP Drop Rate'
Name: '&c&lUpgrade EXP Drop Rate'
Type: EXP_BOTTLE
Amount: 1
Damage: 0
Lore:
- '&7Increased Vanilla XP gained from monsters.'
- ''
- '&e&lTier'
- '&c&lTier'
- '&f&l* &7Current Level: &3{level}/3'
- ''
- '&e&lPerks'
- '&c&lPerks'
- '&f&l* &7Level 1 - &f1.5x Multiplier'
- '&7 - Cost: $2,000,000'
- '&f&l* &7Level 2 - &f2.0x Multiplier'
@@ -939,7 +905,7 @@ fupgrades:
level-2: 2000000
level-3: 3000000
PowerItem:
Name: '&e&lFaction Power'
Name: '&c&lFaction Power'
Type: DIAMOND_SWORD
Amount: 1
Damage: 0
@@ -947,10 +913,10 @@ fupgrades:
- '&7&o(Increase the amount of power'
- '&7&oyour faction has)'
- ''
- '&e&lTier'
- '&c&lTier'
- '&f&l* &7Current Level: &3{level}/3'
- ''
- '&e&lPerks'
- '&c&lPerks'
- '&f&l* &7Level 1 - &f100 Increased Faction Power'
- '&7 - Cost: $1,000,000'
- '&f&l* &7Level 2 - &f200 Increased Faction Power'
@@ -964,7 +930,7 @@ fupgrades:
Redstone:
Cost: 1000000
RedstoneItem:
Name: '&e&lUnbreakable Redstone'
Name: '&c&lUnbreakable Redstone'
Type: REDSTONE
Amount: 1
Damage: 0
@@ -989,17 +955,17 @@ fupgrades:
level-2: 2000000
level-3: 3000000
SpawnerItem:
Name: '&e&lUpgrade Spawn Rate'
Name: '&c&lUpgrade Spawn Rate'
Type: MOB_SPAWNER
Amount: 1
Damage: 0
Lore:
- '&7Decreased mob spawner delay in claims.'
- ''
- '&e&lTier'
- '&c&lTier'
- '&f&l* &7Current Level: &3{level}/3'
- ''
- '&e&lPerks'
- '&c&lPerks'
- '&f&l* &7Level 1 - &f10% Lower Delay'
- '&7 - Cost: $1,000,000'
- '&f&l* &7Level 2 - &f20% Lower Delay'
@@ -1021,17 +987,17 @@ fupgrades:
level-2: 2000000
level-3: 3000000
ChestItem:
Name: '&e&lUpgrade Faction Chest Size'
Name: '&c&lUpgrade Faction Chest Size'
Type: CHEST
Amount: 1
Damage: 0
Lore:
- '&7Increased Faction Chest Size.'
- ''
- '&e&lTier'
- '&c&lTier'
- '&f&l* &7Current Level: &3{level}/3'
- ''
- '&e&lPerks'
- '&c&lPerks'
- '&f&l* &7Level 1 - &f2 Rows'
- '&7 - Cost: $1,000,000'
- '&f&l* &7Level 2 - &f3 Rows'
@@ -1052,17 +1018,17 @@ fupgrades:
level-2: 2000000
level-3: 3000000
MembersItem:
Name: '&e&lUpgrade Faction Members'
Name: '&c&lUpgrade Faction Members'
Type: PAPER
Amount: 1
Damage: 0
Lore:
- '&7Increase faction member limit.'
- ''
- '&e&lTier'
- '&c&lTier'
- '&f&l* &7Current Level: &3{level}/3'
- ''
- '&e&lPerks'
- '&c&lPerks'
- '&f&l* &7Level 1 - &f30 Members'
- '&7 - Cost: $1,000,000'
- '&f&l* &7Level 2 - &f35 Members'
@@ -1075,16 +1041,16 @@ fupgrades:
- 22
fbanners:
Enabled: true
Enabled: false
Item:
Name: '&e&l*&f&l*&e&l* &e&lWar Banner &7(Place) &e&l*&f&l*&e&l*'
Name: '&e&l*&f&l*&e&l* &c&lWar Banner &7(Place) &e&l*&f&l*&e&l*'
Lore:
- '&7Place this banner in the &nWarzone.&7 This'
- '&7will create a &nWarp Point&7 for your faction members.'
- ''
- '&e&lEffects'
- '&e&l* &fStrength II'
- '&e&l* &fSpeed II'
- '&c&lEffects'
- '&c&l* &fStrength II'
- '&c&l* &fSpeed II'
Banner-Cost: 5000 #The amount charged to change a banner into a War Banner
Banner-Time: 60 #IN SECONDS - This is how long the banner will last.
Banner-Place-Cooldown: 300