forked from Upstream/CommandPanels
v3.14.5.3
This commit is contained in:
parent
3349b2aed9
commit
4682cfec08
@ -1,4 +1,4 @@
|
||||
version: 3.14.5.2
|
||||
version: 3.14.5.3
|
||||
main: me.rockyhawk.commandpanels.CommandPanels
|
||||
name: CommandPanels
|
||||
author: RockyHawk
|
||||
|
@ -644,7 +644,7 @@ public class CommandTags {
|
||||
|
||||
if(command.split("\\s").length == 2){
|
||||
//if item paywall is custom item
|
||||
if(content.isSimilar(sellItem)){
|
||||
if(plugin.itemCreate.isIdentical(sellItem,content)){
|
||||
content.setAmount(content.getAmount() - sellItem.getAmount());
|
||||
p.updateInventory();
|
||||
removedItem = 1;
|
||||
@ -653,7 +653,7 @@ public class CommandTags {
|
||||
|
||||
//if custom item is an mmo item (1.14+ for the API)
|
||||
try {
|
||||
if (plugin.getServer().getPluginManager().isPluginEnabled("MMOItems")) {
|
||||
if (plugin.getServer().getPluginManager().isPluginEnabled("MMOItems") && plugin.openPanels.getOpenPanel(p.getName()).getString("custom-item." + command.split("\\s")[1] + ".material").startsWith("mmo=")) {
|
||||
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];
|
||||
|
@ -517,6 +517,7 @@ public class ItemCreation {
|
||||
The isIdentical() function will check for the following
|
||||
Material, Name, Lore, Enchanted
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isIdentical(ItemStack one, ItemStack two){
|
||||
//check material
|
||||
if(one.getType() != two.getType()){
|
||||
@ -538,6 +539,20 @@ public class ItemCreation {
|
||||
}
|
||||
}
|
||||
}catch(Exception ignore){}
|
||||
//check for damage
|
||||
try {
|
||||
if(plugin.legacy.isLegacy()){
|
||||
if(one.getDurability() != two.getDurability()) {
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
Damageable tempOne = (Damageable) one.getItemMeta();
|
||||
Damageable tempTwo = (Damageable) two.getItemMeta();
|
||||
if(tempOne.getDamage() != tempTwo.getDamage()){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (Exception ignore) {}
|
||||
//check for enchantments
|
||||
if(one.getEnchantments().equals(two.getEnchantments())){
|
||||
if(!one.getEnchantments().isEmpty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user