v3.14.5.3

This commit is contained in:
rockyhawk64 2021-01-07 09:50:21 +11:00
parent 3349b2aed9
commit 4682cfec08
3 changed files with 18 additions and 3 deletions

View File

@ -1,4 +1,4 @@
version: 3.14.5.2
version: 3.14.5.3
main: me.rockyhawk.commandpanels.CommandPanels
name: CommandPanels
author: RockyHawk

View File

@ -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];

View File

@ -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()) {