forked from Upstream/CommandPanels
v3.14.4.0
This commit is contained in:
parent
f6aec68a1b
commit
b003353e3a
9
.idea/libraries/MMOLib.xml
Normal file
9
.idea/libraries/MMOLib.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<component name="libraryTable">
|
||||
<library name="MMOLib">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../Tools/Build Tools/Jar Libraries/MMOLib.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
@ -16,5 +16,6 @@
|
||||
<orderEntry type="library" name="PlaceholderAPI-2.10.8" level="project" />
|
||||
<orderEntry type="library" name="VotingPlugin" level="project" />
|
||||
<orderEntry type="library" name="MMOItems-6.5.1" level="project" />
|
||||
<orderEntry type="library" name="MMOLib" level="project" />
|
||||
</component>
|
||||
</module>
|
@ -1,6 +1,6 @@
|
||||
# |------------------------------------------------------------------------
|
||||
# | CommandPanels Example File
|
||||
# | By RockyHawk v2.1
|
||||
# | By RockyHawk v2.2
|
||||
# | https://www.spigotmc.org/resources/command-panels-custom-guis.67788/
|
||||
# |------------------------------------------------------------------------
|
||||
panels:
|
||||
@ -26,6 +26,21 @@ panels:
|
||||
name: '&d&lPURPLE'
|
||||
leatherarmor: PURPLE
|
||||
damage: 30
|
||||
'1':
|
||||
material: DIAMOND
|
||||
name: '&fThis is a diamond'
|
||||
lore: "&7Feel free to take me!"
|
||||
itemType:
|
||||
- placeable
|
||||
'10':
|
||||
material: RED_WOOL
|
||||
name: '&fTake the diamond'
|
||||
hasvalue:
|
||||
value: DIAMOND
|
||||
output: false
|
||||
compare: '%cp-material-1%'
|
||||
name: '&fNice One!'
|
||||
material: GREEN_WOOL
|
||||
'9':
|
||||
material: LEATHER_CHESTPLATE
|
||||
name: '&9&lBLUE'
|
||||
|
@ -1,6 +1,6 @@
|
||||
# |------------------------------------------------------------------------
|
||||
# | CommandPanels Legacy Example File
|
||||
# | By RockyHawk v2.1
|
||||
# | By RockyHawk v2.2
|
||||
# | https://www.spigotmc.org/resources/command-panels-custom-guis.67788/
|
||||
# |------------------------------------------------------------------------
|
||||
panels:
|
||||
@ -26,6 +26,21 @@ panels:
|
||||
name: '&d&lPURPLE'
|
||||
leatherarmor: PURPLE
|
||||
damage: 30
|
||||
'1':
|
||||
material: DIAMOND
|
||||
name: '&fThis is a diamond'
|
||||
lore: "&7Feel free to take me!"
|
||||
itemType:
|
||||
- placeable
|
||||
'10':
|
||||
material: REDSTONE_BLOCK
|
||||
name: '&fTake the diamond'
|
||||
hasvalue:
|
||||
value: DIAMOND
|
||||
output: false
|
||||
compare: '%cp-material-1%'
|
||||
name: '&fNice One!'
|
||||
material: EMERALD_BLOCK
|
||||
'9':
|
||||
material: LEATHER_CHESTPLATE
|
||||
name: '&9&lBLUE'
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: 3.14.3.0
|
||||
version: 3.14.4.0
|
||||
main: me.rockyhawk.commandpanels.CommandPanels
|
||||
name: CommandPanels
|
||||
author: RockyHawk
|
||||
|
@ -42,6 +42,7 @@ import me.rockyhawk.commandpanels.interactives.CommandpanelUserInput;
|
||||
import me.rockyhawk.commandpanels.interactives.Commandpanelrefresher;
|
||||
import me.rockyhawk.commandpanels.updater.Updater;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
@ -216,7 +217,7 @@ public class CommandPanels extends JavaPlugin {
|
||||
Bukkit.getLogger().info("RockyHawk's CommandPanels Plugin Disabled, aww man.");
|
||||
}
|
||||
|
||||
public void setName(ItemStack renamed, String customName, List<String> lore, Player p, Boolean usePlaceholders, Boolean useColours) {
|
||||
public void setName(ItemStack renamed, String customName, List<String> lore, Player p, Boolean usePlaceholders, Boolean useColours, Boolean hideAttributes) {
|
||||
try {
|
||||
ItemMeta renamedMeta = renamed.getItemMeta();
|
||||
//set cp placeholders
|
||||
@ -228,7 +229,10 @@ public class CommandPanels extends JavaPlugin {
|
||||
}
|
||||
|
||||
assert renamedMeta != null;
|
||||
renamedMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
|
||||
//hiding attributes will add an NBT tag
|
||||
if(hideAttributes) {
|
||||
renamedMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
|
||||
}
|
||||
if (customName != null) {
|
||||
renamedMeta.setDisplayName(customName);
|
||||
}
|
||||
@ -414,6 +418,7 @@ public class CommandPanels extends JavaPlugin {
|
||||
str = str.replace(str.substring(start, end) + "%", material);
|
||||
}catch(Exception ex){
|
||||
debug(ex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//get stack amount from slot in current open inventory (panel)
|
||||
@ -431,6 +436,7 @@ public class CommandPanels extends JavaPlugin {
|
||||
str = str.replace(str.substring(start, end) + "%", String.valueOf(amount));
|
||||
}catch(Exception ex){
|
||||
debug(ex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//is an item damaged
|
||||
@ -456,6 +462,45 @@ public class CommandPanels extends JavaPlugin {
|
||||
str = str.replace(str.substring(start, end) + "%", String.valueOf(damaged));
|
||||
}catch(Exception ex){
|
||||
debug(ex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//is an item identical, uses custom-items (custom item, slot)
|
||||
while (str.contains("%cp-identical-")) {
|
||||
try {
|
||||
int start = str.indexOf("%cp-identical-");
|
||||
int end = str.indexOf("%", str.indexOf("%cp-identical-") + 1);
|
||||
String matLocSlot = str.substring(start, end).replace("%cp-identical-", "").replace("%", "");
|
||||
String matLoc = matLocSlot.split(",")[0];
|
||||
int matSlot = Integer.parseInt(matLocSlot.split(",")[1]);
|
||||
boolean isIdentical = false;
|
||||
ItemStack itm = p.getOpenInventory().getTopInventory().getItem(matSlot);
|
||||
|
||||
try {
|
||||
//if it is a regular custom item
|
||||
ItemStack confItm = itemCreate.makeItemFromConfig(openPanels.getOpenPanel(p.getName()).getConfigurationSection("custom-item." + matLoc),p,true,true, true);
|
||||
if(itm.isSimilar(confItm) && itm.getAmount() == confItm.getAmount()){
|
||||
isIdentical = true;
|
||||
}
|
||||
|
||||
//if custom item is an mmo item (1.14+ for the API)
|
||||
String customItemMaterial = openPanels.getOpenPanel(p.getName()).getString("custom-item." + matLoc + ".material");
|
||||
if (getServer().getPluginManager().isPluginEnabled("MMOItems") && customItemMaterial.startsWith("mmo=")) {
|
||||
String mmoType = customItemMaterial.split("\\s")[1];
|
||||
String mmoID = customItemMaterial.split("\\s")[2];
|
||||
|
||||
if (isMMOItem(itm,mmoType,mmoID) && itm.getAmount() <= confItm.getAmount()) {
|
||||
isIdentical = true;
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException er) {
|
||||
isIdentical = false;
|
||||
}
|
||||
|
||||
str = str.replace(str.substring(start, end) + "%", String.valueOf(isIdentical));
|
||||
}catch(Exception ex){
|
||||
debug(ex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -672,4 +717,20 @@ public class CommandPanels extends JavaPlugin {
|
||||
}
|
||||
return matcher.appendTail(buffer).toString();
|
||||
}
|
||||
|
||||
//returns true if the item is the MMO Item
|
||||
public boolean isMMOItem(ItemStack itm, String type, String id){
|
||||
try {
|
||||
if (getServer().getPluginManager().isPluginEnabled("MMOItems")) {
|
||||
NBTItem nbt = NBTItem.get(itm);
|
||||
if (nbt.getType().equalsIgnoreCase(type) && nbt.getString("MMOITEMS_ITEM_ID").equalsIgnoreCase(id)){
|
||||
return true;
|
||||
}
|
||||
itm.getType();
|
||||
}
|
||||
}catch (Exception ex){
|
||||
debug(ex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.google.common.io.ByteArrayDataOutput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import me.realized.tokenmanager.api.TokenManager;
|
||||
import me.rockyhawk.commandpanels.CommandPanels;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@ -97,6 +98,19 @@ public class CommandTags {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "setitem=":{
|
||||
//if player uses setitem= [custom item] [slot] it will change the item slot to something, used for placeable items
|
||||
//make a section in the panel called "custom-item" then whatever the title of the item is, put that here
|
||||
ConfigurationSection panelCF = plugin.openPanels.getOpenPanel(p.getName());
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(panelCF.getConfigurationSection("custom-item." + command.split("\\s")[1]), p, true, true, true);
|
||||
p.getOpenInventory().getTopInventory().setItem(Integer.parseInt(command.split("\\s")[2]), s);
|
||||
break;
|
||||
}
|
||||
case "refresh":{
|
||||
//this will just do a standard panel refresh, animate is set to 0
|
||||
plugin.createGUI.openGui(null, p, plugin.openPanels.getOpenPanel(p.getName()), 0,0);
|
||||
break;
|
||||
}
|
||||
case "op=":{
|
||||
//if player uses op= it will perform command as op
|
||||
boolean isop = p.isOp();
|
||||
@ -537,34 +551,72 @@ public class CommandTags {
|
||||
}
|
||||
case "item-paywall=": {
|
||||
//if player uses item-paywall= [Material] [Amount] [Id]
|
||||
//or player can use item-paywall= [custom-item]
|
||||
try {
|
||||
short id = 0;
|
||||
if(command.split("\\s").length == 4){
|
||||
id = Short.parseShort(command.split("\\s")[3]);
|
||||
}
|
||||
ItemStack sellItem = new ItemStack(Objects.requireNonNull(Material.matchMaterial(command.split("\\s")[1])),Integer.parseInt(command.split("\\s")[2]), id);
|
||||
int sellItemAmount = sellItem.getAmount();
|
||||
sellItem.setAmount(1);
|
||||
|
||||
//create the item to be removed
|
||||
ItemStack sellItem;
|
||||
if(command.split("\\s").length == 2) {
|
||||
sellItem = plugin.itemCreate.makeItemFromConfig(plugin.openPanels.getOpenPanel(p.getName()).getConfigurationSection("custom-item." + command.split("\\s")[1]), p, true, true, true);
|
||||
}else{
|
||||
sellItem = new ItemStack(Objects.requireNonNull(Material.matchMaterial(command.split("\\s")[1])), Integer.parseInt(command.split("\\s")[2]), id);
|
||||
}
|
||||
//this is not a boolean because it needs to return an int
|
||||
int removedItem = 0;
|
||||
|
||||
//loop through items in the inventory
|
||||
for(ItemStack content : p.getInventory().getContents()){
|
||||
int contentAmount;
|
||||
try {
|
||||
contentAmount = content.getAmount();
|
||||
}catch(NullPointerException skip){
|
||||
//item is air
|
||||
|
||||
if(content == null){
|
||||
//skip slot if empty
|
||||
continue;
|
||||
}
|
||||
content.setAmount(1);
|
||||
if(content.isSimilar(sellItem)){
|
||||
if(sellItemAmount <= contentAmount){
|
||||
content.setAmount(contentAmount-sellItemAmount);
|
||||
|
||||
if(command.split("\\s").length == 2){
|
||||
//if item paywall is custom item
|
||||
if(content.isSimilar(sellItem)){
|
||||
content.setAmount(content.getAmount() - sellItem.getAmount());
|
||||
p.updateInventory();
|
||||
removedItem = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
//if custom item is an mmo item (1.14+ for the API)
|
||||
try {
|
||||
if (plugin.getServer().getPluginManager().isPluginEnabled("MMOItems")) {
|
||||
String customItemMaterial = plugin.openPanels.getOpenPanel(p.getName()).getString("custom-item." + command.split("\\s")[1] + ".material");
|
||||
String mmoType = customItemMaterial.split("\\s")[1];
|
||||
String mmoID = customItemMaterial.split("\\s")[2];
|
||||
|
||||
if (plugin.isMMOItem(sellItem,mmoType,mmoID) && sellItem.getAmount() <= content.getAmount()) {
|
||||
content.setAmount(content.getAmount() - sellItem.getAmount());
|
||||
p.updateInventory();
|
||||
removedItem = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}catch (Exception ex){
|
||||
plugin.debug(ex);
|
||||
}
|
||||
|
||||
}else {
|
||||
//if the item is a standard material
|
||||
if (content.getType() == sellItem.getType()) {
|
||||
if (sellItem.getAmount() <= content.getAmount()) {
|
||||
content.setAmount(content.getAmount() - sellItem.getAmount());
|
||||
p.updateInventory();
|
||||
removedItem = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
content.setAmount(contentAmount);
|
||||
}
|
||||
|
||||
//send message and return
|
||||
if(removedItem == 0){
|
||||
p.sendMessage(plugin.papi( tag + plugin.config.getString("config.format.needmoney")));
|
||||
}else{
|
||||
|
@ -115,12 +115,12 @@ public class ExecuteOpenVoids {
|
||||
}
|
||||
ItemStack s;
|
||||
try {
|
||||
s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(cf.getConfigurationSection("open-with-item")), p, false, true);
|
||||
s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(cf.getConfigurationSection("open-with-item")), p, false, true, true);
|
||||
}catch(Exception n){
|
||||
sender.sendMessage(plugin.papi(plugin.tag + plugin.config.getString("config.format.error") + " open-with-item: material"));
|
||||
return;
|
||||
}
|
||||
plugin.setName(s, cf.getString("open-with-item.name"), cf.getStringList("open-with-item.lore"),p,false, true);
|
||||
plugin.setName(s, cf.getString("open-with-item.name"), cf.getStringList("open-with-item.lore"),p,false, true, true);
|
||||
//if the sender has OTHER perms, or if sendGiveMessage is false, implying it is not for another person
|
||||
if(sender.hasPermission("commandpanel.other") || !sendGiveMessage) {
|
||||
try {
|
||||
|
@ -36,7 +36,7 @@ public class ItemCreation {
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public ItemStack makeItemFromConfig(ConfigurationSection itemSection, Player p, boolean placeholders, boolean colours){
|
||||
public ItemStack makeItemFromConfig(ConfigurationSection itemSection, Player p, boolean placeholders, boolean colours, boolean hideAttributes){
|
||||
String material = plugin.papiNoColour(p,itemSection.getString("material"));
|
||||
try {
|
||||
if (Objects.requireNonNull(material).equalsIgnoreCase("AIR")) {
|
||||
@ -159,6 +159,14 @@ public class ItemCreation {
|
||||
}
|
||||
}
|
||||
|
||||
//itemType values
|
||||
if(itemSection.contains("itemType")){
|
||||
//if hidden, reverse
|
||||
if(itemSection.getStringList("itemType").contains("attributes")){
|
||||
hideAttributes = !hideAttributes;
|
||||
}
|
||||
}
|
||||
|
||||
if (itemSection.contains("map")) {
|
||||
/*
|
||||
This will do maps from custom images
|
||||
@ -309,7 +317,7 @@ public class ItemCreation {
|
||||
p.sendMessage(plugin.papi(plugin.tag + plugin.config.getString("config.format.error") + " material: " + itemSection.getString("material")));
|
||||
return null;
|
||||
}
|
||||
plugin.setName(s, itemSection.getString("name"), itemSection.getStringList("lore"), p, placeholders, colours);
|
||||
plugin.setName(s, itemSection.getString("name"), itemSection.getStringList("lore"), p, placeholders, colours, hideAttributes);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class OpenEditorGuis {
|
||||
panelNames.add(plugin.papi( key));
|
||||
panelTitles.add(plugin.papi( Objects.requireNonNull(temp.getString("panels." + key + ".title"))));
|
||||
if (temp.contains("panels." + key + ".open-with-item.material")) {
|
||||
panelItems.add(plugin.itemCreate.makeItemFromConfig(temp.getConfigurationSection("panels." + key + ".open-with-item"), p, false, true));
|
||||
panelItems.add(plugin.itemCreate.makeItemFromConfig(temp.getConfigurationSection("panels." + key + ".open-with-item"), p, false, true, true));
|
||||
} else {
|
||||
panelItems.add(new ItemStack(Material.PAPER));
|
||||
}
|
||||
@ -65,10 +65,10 @@ public class OpenEditorGuis {
|
||||
//make all the bottom bar items
|
||||
ItemStack temp;
|
||||
temp = new ItemStack(Material.SLIME_BALL, 1);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Page " + pageNumber, null, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Page " + pageNumber, null, p, true, true, true);
|
||||
i.setItem(49, temp);
|
||||
temp = new ItemStack(Material.BARRIER, 1);
|
||||
plugin.setName(temp, ChatColor.RED + "Exit Menu", null, p, true, true);
|
||||
plugin.setName(temp, ChatColor.RED + "Exit Menu", null, p, true, true, true);
|
||||
i.setItem(45, temp);
|
||||
temp = new ItemStack(Material.BOOK, 1);
|
||||
List<String> lore = new ArrayList();
|
||||
@ -80,18 +80,18 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.GRAY + " type 'remove' to set a");
|
||||
lore.add(ChatColor.GRAY + " value to default, and use");
|
||||
lore.add(ChatColor.GRAY + " '" + plugin.config.getString("config.input-cancel") + "' to cancel.");
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Editor Tips", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Editor Tips", lore, p, true, true, true);
|
||||
i.setItem(53, temp);
|
||||
if (pageNumber != 1) {
|
||||
//only show previous page button if number is not one
|
||||
temp = new ItemStack(Material.PAPER, 1);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Previous Page", null, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Previous Page", null, p, true, true, true);
|
||||
i.setItem(48, temp);
|
||||
}
|
||||
if (pageNumber < pagesAmount) {
|
||||
//if page number is under pages amount
|
||||
temp = new ItemStack(Material.PAPER, 1);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Next Page", null, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Next Page", null, p, true, true, true);
|
||||
i.setItem(50, temp);
|
||||
}
|
||||
int count = 0;
|
||||
@ -101,7 +101,7 @@ public class OpenEditorGuis {
|
||||
//count is +1 because count starts at 0 not 1
|
||||
if ((pageNumber * 45 - 45) < (count + 1) && (pageNumber * 45) > (count)) {
|
||||
temp = panelItems.get(count);
|
||||
plugin.setName(temp, ChatColor.WHITE + panelName, lore, p, false, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + panelName, lore, p, false, true, true);
|
||||
i.setItem(slot, temp);
|
||||
slot += 1;
|
||||
}
|
||||
@ -130,7 +130,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + "--------------------------------");
|
||||
lore.add(ChatColor.WHITE + "commandpanel.panel." + cf.getString("perm"));
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Permission", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Permission", lore, p, true, true, true);
|
||||
i.setItem(1, temp);
|
||||
|
||||
temp = new ItemStack(Material.NAME_TAG, 1);
|
||||
@ -140,7 +140,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + "------------------");
|
||||
lore.add(ChatColor.WHITE + cf.getString("title"));
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Title", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Title", lore, p, true, true, true);
|
||||
i.setItem(3, temp);
|
||||
|
||||
temp = new ItemStack(Material.JUKEBOX, 1);
|
||||
@ -150,7 +150,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + "------------------------");
|
||||
lore.add(ChatColor.WHITE + Objects.requireNonNull(cf.getString("sound-on-open")).toUpperCase());
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Sound", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Sound", lore, p, true, true, true);
|
||||
i.setItem(5, temp);
|
||||
|
||||
temp = new ItemStack(Material.IRON_DOOR, 1);
|
||||
@ -166,20 +166,20 @@ public class OpenEditorGuis {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Command", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Command", lore, p, true, true, true);
|
||||
i.setItem(7, temp);
|
||||
|
||||
temp = new ItemStack(Material.LAVA_BUCKET, 1);
|
||||
lore.clear();
|
||||
lore.add(ChatColor.DARK_RED + "Permanently delete Panel");
|
||||
plugin.setName(temp, ChatColor.RED + "Delete Panel", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.RED + "Delete Panel", lore, p, true, true, true);
|
||||
i.setItem(21, temp);
|
||||
|
||||
temp = new ItemStack(Material.LADDER, 1);
|
||||
lore.clear();
|
||||
lore.add(ChatColor.GRAY + "How many rows the panel will be");
|
||||
lore.add(ChatColor.GRAY + "choose an integer from 1 to 6");
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Rows", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Rows", lore, p, true, true, true);
|
||||
i.setItem(23, temp);
|
||||
|
||||
temp = new ItemStack(Material.STONE, 1);
|
||||
@ -195,7 +195,7 @@ public class OpenEditorGuis {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Disabled Worlds", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Disabled Worlds", lore, p, true, true, true);
|
||||
i.setItem(25, temp);
|
||||
|
||||
temp = new ItemStack(Material.GLASS, 1);
|
||||
@ -205,7 +205,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + "-----------------------");
|
||||
lore.add(ChatColor.WHITE + Objects.requireNonNull(cf.getString("empty")).toUpperCase());
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Empty Item", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Empty Item", lore, p, true, true, true);
|
||||
i.setItem(13, temp);
|
||||
|
||||
temp = new ItemStack(Material.ANVIL, 1);
|
||||
@ -221,7 +221,7 @@ public class OpenEditorGuis {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Commands", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Commands", lore, p, true, true, true);
|
||||
i.setItem(15, temp);
|
||||
|
||||
temp = new ItemStack(Material.STRING, 1);
|
||||
@ -237,7 +237,7 @@ public class OpenEditorGuis {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Types", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Types", lore, p, true, true, true);
|
||||
i.setItem(17, temp);
|
||||
|
||||
temp = new ItemStack(Material.ITEM_FRAME, 1);
|
||||
@ -246,11 +246,11 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.GRAY + "/cp [name]");
|
||||
lore.add(ChatColor.WHITE + "-----------------------");
|
||||
lore.add(ChatColor.WHITE + panelName);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Name", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Name", lore, p, true, true, true);
|
||||
i.setItem(11, temp);
|
||||
|
||||
temp = new ItemStack(Material.BARRIER, 1);
|
||||
plugin.setName(temp, ChatColor.RED + "Back", null, p,true, true);
|
||||
plugin.setName(temp, ChatColor.RED + "Back", null, p, true, true, true);
|
||||
i.setItem(18, temp);
|
||||
|
||||
//This will create a wall of glass panes, separating panel settings with hotbar settings
|
||||
@ -259,7 +259,7 @@ public class OpenEditorGuis {
|
||||
}else{
|
||||
temp = new ItemStack(Material.matchMaterial("BLACK_STAINED_GLASS_PANE"), 1);
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "", null, p,false, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "", null, p,false, true, true);
|
||||
for(int d = 27; d < 36; d++){
|
||||
i.setItem(d, temp);
|
||||
}
|
||||
@ -268,7 +268,7 @@ public class OpenEditorGuis {
|
||||
|
||||
if(cf.contains("open-with-item.material")){
|
||||
hotbarItems = true;
|
||||
temp = plugin.itemCreate.makeItemFromConfig(cf.getConfigurationSection("open-with-item"), p, false, true);
|
||||
temp = plugin.itemCreate.makeItemFromConfig(cf.getConfigurationSection("open-with-item"), p, false, true, true);
|
||||
}else{
|
||||
temp = new ItemStack(Material.REDSTONE_BLOCK, 1);
|
||||
}
|
||||
@ -281,7 +281,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + "-----------------------");
|
||||
lore.add(ChatColor.RED + "DISABLED");
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Hotbar Item", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Panel Hotbar Item", lore, p, true, true, true);
|
||||
i.setItem(40, temp);
|
||||
|
||||
if(hotbarItems) {
|
||||
@ -292,7 +292,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + "----------");
|
||||
lore.add(ChatColor.WHITE + Objects.requireNonNull(cf.getString("open-with-item.name")));
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Hotbar Item Name", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Hotbar Item Name", lore, p, true, true, true);
|
||||
i.setItem(38, temp);
|
||||
|
||||
temp = new ItemStack(Material.FEATHER, 1);
|
||||
@ -308,7 +308,7 @@ public class OpenEditorGuis {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Hotbar Lore", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Hotbar Lore", lore, p, true, true, true);
|
||||
i.setItem(36, temp);
|
||||
|
||||
temp = new ItemStack(Material.BEDROCK, 1);
|
||||
@ -320,7 +320,7 @@ public class OpenEditorGuis {
|
||||
int location = cf.getInt("open-with-item.stationary") + 1;
|
||||
lore.add(ChatColor.WHITE + String.valueOf(location));
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Hotbar Item Location", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Hotbar Item Location", lore, p, true, true, true);
|
||||
i.setItem(42, temp);
|
||||
|
||||
temp = new ItemStack(Material.BOOK, 1);
|
||||
@ -338,7 +338,7 @@ public class OpenEditorGuis {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Hotbar Item Commands", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Hotbar Item Commands", lore, p, true, true,true);
|
||||
i.setItem(44, temp);
|
||||
}
|
||||
|
||||
@ -366,7 +366,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + cf.getString("name"));
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Name", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Name", lore, p, true, true, true);
|
||||
i.setItem(1, temp);
|
||||
|
||||
temp = new ItemStack(Material.ANVIL, 1);
|
||||
@ -382,7 +382,7 @@ public class OpenEditorGuis {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Commands", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Commands", lore, p, true, true, true);
|
||||
i.setItem(3, temp);
|
||||
|
||||
temp = new ItemStack(Material.ENCHANTED_BOOK, 1);
|
||||
@ -397,7 +397,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + "--------------------------------");
|
||||
lore.add(ChatColor.WHITE + "false");
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Enchantment", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Enchantment", lore, p, true, true, true);
|
||||
i.setItem(5, temp);
|
||||
|
||||
temp = new ItemStack(Material.POTION, 1);
|
||||
@ -409,7 +409,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + cf.getString("potion"));
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Potion Effect", lore, p,true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Potion Effect", lore, p, true, true, true);
|
||||
i.setItem(7, temp);
|
||||
|
||||
temp = new ItemStack(Material.PAPER, 1);
|
||||
@ -425,7 +425,7 @@ public class OpenEditorGuis {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Duplicates", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Duplicates", lore, p, true, true, true);
|
||||
i.setItem(13, temp);
|
||||
|
||||
temp = new ItemStack(Material.FEATHER, 1);
|
||||
@ -441,7 +441,7 @@ public class OpenEditorGuis {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Lores", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Lores", lore, p, true, true, true);
|
||||
i.setItem(19, temp);
|
||||
|
||||
temp = new ItemStack(Material.ITEM_FRAME, 2);
|
||||
@ -457,7 +457,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + cf.getString("stack"));
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Stack Size", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Stack Size", lore, p, true, true, true);
|
||||
i.setItem(21, temp);
|
||||
|
||||
if(!plugin.legacy.isLegacy()) {
|
||||
@ -470,7 +470,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + cf.getString("customdata"));
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Custom Model Data", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Custom Model Data", lore, p, true, true, true);
|
||||
i.setItem(23, temp);
|
||||
}
|
||||
|
||||
@ -485,7 +485,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.GRAY + "Sections and add complex values.");
|
||||
lore.add(ChatColor.WHITE + "--------------------------------");
|
||||
lore.add(ChatColor.WHITE + section);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Sections", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Sections", lore, p, true, true, true);
|
||||
i.setItem(31, temp);
|
||||
|
||||
temp = new ItemStack(Material.LEATHER_HELMET, 1);
|
||||
@ -498,18 +498,18 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + cf.getString("leatherarmor"));
|
||||
}
|
||||
}
|
||||
plugin.setName(temp, ChatColor.WHITE + "Leather Armor Colour", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Leather Armor Colour", lore, p, true, true, true);
|
||||
i.setItem(25, temp);
|
||||
|
||||
temp = new ItemStack(Material.BARRIER, 1);
|
||||
plugin.setName(temp, ChatColor.RED + "Back", null, p, true, true);
|
||||
plugin.setName(temp, ChatColor.RED + "Back", null, p, true, true, true);
|
||||
i.setItem(27, temp);
|
||||
|
||||
temp = plugin.itemCreate.makeItemFromConfig(cf,p,false,false);
|
||||
temp = plugin.itemCreate.makeItemFromConfig(cf,p,false,false, true);
|
||||
lore.clear();
|
||||
lore.add(ChatColor.GRAY + "Click to set custom material");
|
||||
lore.add(ChatColor.GRAY + "typically for custom heads");
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Section " + section + " Preview", lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Section " + section + " Preview", lore, p, true, true, true);
|
||||
i.setItem(35, temp);
|
||||
|
||||
p.openInventory(i);
|
||||
@ -544,23 +544,23 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.WHITE + "Compare: " + ChatColor.GRAY + cf.getString(section + ".compare"));
|
||||
}
|
||||
|
||||
temp = plugin.itemCreate.makeItemFromConfig(cf.getConfigurationSection(section),p,false,false);
|
||||
plugin.setName(temp, ChatColor.AQUA + section, lore, p,false, true);
|
||||
temp = plugin.itemCreate.makeItemFromConfig(cf.getConfigurationSection(section),p,false,false, true);
|
||||
plugin.setName(temp, ChatColor.AQUA + section, lore, p,false, true, true);
|
||||
i.setItem(slot, temp);
|
||||
slot++;
|
||||
}
|
||||
}
|
||||
|
||||
temp = new ItemStack(Material.REDSTONE, 1);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Remove Section", null, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Remove Section", null, p, true, true, true);
|
||||
i.setItem(38, temp);
|
||||
|
||||
temp = new ItemStack(Material.SLIME_BALL, 1);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Add Section", null, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Add Section", null, p, true, true, true);
|
||||
i.setItem(42, temp);
|
||||
|
||||
temp = new ItemStack(Material.BARRIER, 1);
|
||||
plugin.setName(temp, ChatColor.RED + "Back", null, p, true, true);
|
||||
plugin.setName(temp, ChatColor.RED + "Back", null, p, true, true, true);
|
||||
i.setItem(36, temp);
|
||||
|
||||
temp = new ItemStack(Material.BOOK, 1);
|
||||
@ -569,7 +569,7 @@ public class OpenEditorGuis {
|
||||
lore.add(ChatColor.GRAY + "- hasperm");
|
||||
lore.add(ChatColor.GRAY + "- hasvalue");
|
||||
lore.add(ChatColor.GRAY + "- hasgreater");
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Section " + itemSection, lore, p, true, true);
|
||||
plugin.setName(temp, ChatColor.WHITE + "Item Section " + itemSection, lore, p, true, true, true);
|
||||
i.setItem(44, temp);
|
||||
|
||||
p.openInventory(i);
|
||||
|
@ -57,7 +57,7 @@ public class OpenGUI {
|
||||
}
|
||||
}
|
||||
}
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(pconfig.getConfigurationSection("item." + item.split("\\s")[c] + section)), p, onOpen != 3, onOpen != 3);
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(pconfig.getConfigurationSection("item." + item.split("\\s")[c] + section)), p, onOpen != 3, onOpen != 3, true);
|
||||
|
||||
//This is for CUSTOM ITEMS
|
||||
if(pconfig.contains("item." + item.split("\\s")[c] + section + ".itemType")) {
|
||||
|
@ -73,7 +73,7 @@ public class HotbarItemLoader {
|
||||
}
|
||||
}
|
||||
if(tempFile.contains("open-with-item")){
|
||||
ItemStack panelItem = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(tempFile.getConfigurationSection("open-with-item")), p, false, true);
|
||||
ItemStack panelItem = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(tempFile.getConfigurationSection("open-with-item")), p, false, true, true);
|
||||
if(invItem != null && panelItem != null) {
|
||||
panelItem.setAmount(invItem.getAmount());
|
||||
}else{
|
||||
|
@ -111,7 +111,7 @@ public class UtilsOpenWithItem implements Listener {
|
||||
}
|
||||
}
|
||||
if (p.hasPermission("commandpanel.panel." + temp.getString("panels." + key + ".perm")) && temp.contains("panels." + key + ".open-with-item")) {
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(temp.getConfigurationSection("panels." + key + ".open-with-item")), p, false, true);
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(temp.getConfigurationSection("panels." + key + ".open-with-item")), p, false, true, true);
|
||||
if(temp.contains("panels." + key + ".open-with-item.stationary")) {
|
||||
if (0 <= Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary"))) && 33 >= Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary")))) {
|
||||
p.getInventory().setItem(Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary"))), s);
|
||||
@ -153,7 +153,7 @@ public class UtilsOpenWithItem implements Listener {
|
||||
}
|
||||
}
|
||||
if (p.hasPermission("commandpanel.panel." + temp.getString("panels." + key + ".perm")) && temp.contains("panels." + key + ".open-with-item")) {
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(temp.getConfigurationSection("panels." + key + ".open-with-item")), p, false, true);
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(temp.getConfigurationSection("panels." + key + ".open-with-item")), p, false, true, true);
|
||||
if(temp.contains("panels." + key + ".open-with-item.stationary") && 0 <= Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary"))) && 33 >= Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary")))){
|
||||
p.getInventory().setItem(Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary"))), s);
|
||||
}
|
||||
@ -187,7 +187,7 @@ public class UtilsOpenWithItem implements Listener {
|
||||
key = (String) var10.next();
|
||||
if (p.hasPermission("commandpanel.panel." + temp.getString("panels." + key + ".perm")) && temp.contains("panels." + key + ".open-with-item")) {
|
||||
if(temp.contains("panels." + key + ".open-with-item.stationary")){
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(temp.getConfigurationSection("panels." + key + ".open-with-item")), p, false, true);
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(temp.getConfigurationSection("panels." + key + ".open-with-item")), p, false, true, true);
|
||||
e.getDrops().remove(s);
|
||||
}
|
||||
}
|
||||
@ -225,7 +225,7 @@ public class UtilsOpenWithItem implements Listener {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(temp.getConfigurationSection("panels." + key + ".open-with-item")), p, false, true);
|
||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(Objects.requireNonNull(temp.getConfigurationSection("panels." + key + ".open-with-item")), p, false, true, true);
|
||||
if(temp.contains("panels." + key + ".open-with-item.stationary") && 0 <= Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary"))) && 33 >= Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary")))){
|
||||
p.getInventory().setItem(Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary"))), s);
|
||||
}
|
||||
@ -237,7 +237,7 @@ public class UtilsOpenWithItem implements Listener {
|
||||
}catch(Exception n){
|
||||
continue;
|
||||
}
|
||||
plugin.setName(s, temp.getString("panels." + key + ".open-with-item.name"), temp.getStringList("panels." + key + ".open-with-item.lore"),p,true, true);
|
||||
plugin.setName(s, temp.getString("panels." + key + ".open-with-item.name"), temp.getStringList("panels." + key + ".open-with-item.lore"),p,true, true,true);
|
||||
if(temp.contains("panels." + key + ".open-with-item.stationary") && 0 <= Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary"))) && 33 >= Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary")))){
|
||||
try {
|
||||
if (Objects.requireNonNull(p.getInventory().getItem(Integer.parseInt(Objects.requireNonNull(temp.getString("panels." + key + ".open-with-item.stationary"))))).isSimilar(s)) {
|
||||
|
Loading…
Reference in New Issue
Block a user