Hotfix for forbidden item contents
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
a2fa01db7a
Commit
48ee7819c6
@ -22,9 +22,12 @@ package de.steamwar.fightsystem.listener;
|
|||||||
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
class PersonalKitCreator_10 {
|
class PersonalKitCreator_10 {
|
||||||
|
|
||||||
static boolean hasItems(ItemStack stack){
|
static boolean hasItems(ItemStack stack){
|
||||||
return CraftItemStack.asNMSCopy(stack).getTag().hasKey("Items");
|
Set<String> keys = CraftItemStack.asNMSCopy(stack).getTag().c();
|
||||||
|
return keys.size() > 1 || !keys.contains("Enchantments");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,12 @@ package de.steamwar.fightsystem.listener;
|
|||||||
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
class PersonalKitCreator_12 {
|
class PersonalKitCreator_12 {
|
||||||
|
|
||||||
static boolean hasItems(ItemStack stack){
|
static boolean hasItems(ItemStack stack){
|
||||||
return CraftItemStack.asNMSCopy(stack).getTag().hasKey("Items");
|
Set<String> keys = CraftItemStack.asNMSCopy(stack).getTag().c();
|
||||||
|
return keys.size() > 1 || !keys.contains("Enchantments");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -23,6 +23,7 @@ import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
class PersonalKitCreator_14 {
|
class PersonalKitCreator_14 {
|
||||||
private PersonalKitCreator_14(){}
|
private PersonalKitCreator_14(){}
|
||||||
@ -32,6 +33,7 @@ class PersonalKitCreator_14 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static boolean hasItems(ItemStack stack){
|
static boolean hasItems(ItemStack stack){
|
||||||
return CraftItemStack.asNMSCopy(stack).getTag().hasKey("Items");
|
Set<String> keys = CraftItemStack.asNMSCopy(stack).getTag().getKeys();
|
||||||
|
return keys.size() > 1 || !keys.contains("Enchantments");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,12 @@ package de.steamwar.fightsystem.listener;
|
|||||||
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
class PersonalKitCreator_15 {
|
class PersonalKitCreator_15 {
|
||||||
|
|
||||||
static boolean hasItems(ItemStack stack){
|
static boolean hasItems(ItemStack stack){
|
||||||
return CraftItemStack.asNMSCopy(stack).getTag().hasKey("Items");
|
Set<String> keys = CraftItemStack.asNMSCopy(stack).getTag().getKeys();
|
||||||
|
return keys.size() > 1 || !keys.contains("Enchantments");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,12 @@ package de.steamwar.fightsystem.listener;
|
|||||||
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
class PersonalKitCreator_8 {
|
class PersonalKitCreator_8 {
|
||||||
|
|
||||||
static boolean hasItems(ItemStack stack){
|
static boolean hasItems(ItemStack stack){
|
||||||
return CraftItemStack.asNMSCopy(stack).getTag().hasKey("Items");
|
Set<String> keys = CraftItemStack.asNMSCopy(stack).getTag().c();
|
||||||
|
return keys.size() > 1 || !keys.contains("Enchantments");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,12 @@ package de.steamwar.fightsystem.listener;
|
|||||||
import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftItemStack;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
class PersonalKitCreator_9 {
|
class PersonalKitCreator_9 {
|
||||||
|
|
||||||
static boolean hasItems(ItemStack stack){
|
static boolean hasItems(ItemStack stack){
|
||||||
return CraftItemStack.asNMSCopy(stack).getTag().hasKey("Items");
|
Set<String> keys = CraftItemStack.asNMSCopy(stack).getTag().c();
|
||||||
|
return keys.size() > 1 || !keys.contains("Enchantments");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren