Check System Added and Massive Reformat
This commit is contained in:
@@ -2,28 +2,26 @@ package com.massivecraft.factions.shop;
|
||||
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.cmd.logout.CmdLogout;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdShop extends FCommand {
|
||||
|
||||
public CmdShop(){
|
||||
super();
|
||||
this.aliases.add("shop");
|
||||
this.disableOnLock = false;
|
||||
public CmdShop() {
|
||||
super();
|
||||
this.aliases.add("shop");
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if(!P.p.getConfig().getBoolean("F-Shop.Enabled")){
|
||||
if (!P.p.getConfig().getBoolean("F-Shop.Enabled")) {
|
||||
return;
|
||||
}
|
||||
ShopGUI.openShop(fme);
|
||||
|
||||
@@ -18,13 +18,6 @@ import java.util.List;
|
||||
|
||||
public class ShopClickPersistence implements Listener {
|
||||
|
||||
public void runCommands(List<String> list, Player p) {
|
||||
for (String cmd : list) {
|
||||
cmd = cmd.replace("%player%", p.getName());
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public static String color(String line) {
|
||||
line = ChatColor.translateAlternateColorCodes('&', line);
|
||||
return line;
|
||||
@@ -37,6 +30,13 @@ public class ShopClickPersistence implements Listener {
|
||||
return lore;
|
||||
}
|
||||
|
||||
public void runCommands(List<String> list, Player p) {
|
||||
for (String cmd : list) {
|
||||
cmd = cmd.replace("%player%", p.getName());
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void click(InventoryClickEvent e) {
|
||||
Inventory i = e.getClickedInventory();
|
||||
@@ -46,7 +46,7 @@ public class ShopClickPersistence implements Listener {
|
||||
|
||||
if (e.getView().getTitle().equalsIgnoreCase(color(config.getString("F-Shop.GUI.Name")))) {
|
||||
ItemStack item = e.getCurrentItem();
|
||||
if(item == null) return;
|
||||
if (item == null) return;
|
||||
String name = color(item.getItemMeta().getDisplayName());
|
||||
e.setCancelled(true);
|
||||
int t = e.getSlot();
|
||||
|
||||
@@ -13,9 +13,11 @@ public class ShopConfig {
|
||||
|
||||
public static File shop = new File("plugins/Factions/shop.yml");
|
||||
public static FileConfiguration s = YamlConfiguration.loadConfiguration(shop);
|
||||
|
||||
public static FileConfiguration getShop() {
|
||||
return s;
|
||||
}
|
||||
|
||||
public static void loadShop() {
|
||||
s = YamlConfiguration.loadConfiguration(shop);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.util.XMaterial;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
@@ -42,7 +41,7 @@ public class ShopGUI {
|
||||
String s = shopitems + "";
|
||||
int slot = ShopConfig.getShop().getInt("items." + s + ".slot");
|
||||
ItemStack material = XMaterial.matchXMaterial(ShopConfig.getShop().getString("items." + s + ".block")).parseItem();
|
||||
// int size = ShopConfig.getShop().getInt("items." + s + ".size");
|
||||
// int size = ShopConfig.getShop().getInt("items." + s + ".size");
|
||||
int cost = ShopConfig.getShop().getInt("items." + s + ".cost");
|
||||
String name = ShopConfig.getShop().getString("items." + s + ".name") + " &f(" + cost + " Points)";
|
||||
List<String> lore = ShopConfig.getShop().getStringList("items." + s + ".lore");
|
||||
|
||||
Reference in New Issue
Block a user