geforkt von Mirrors/Paper
SPIGOT-6952: Tag#isTagged throws NullPointerException in 1.18.2
By: DerFrZocker <derrieple@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
9ee989ea81
Commit
59e5f5af8f
@ -17,7 +17,14 @@ public class CraftBlockTag extends CraftTag<Block, Material> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTagged(Material item) {
|
public boolean isTagged(Material item) {
|
||||||
return CraftMagicNumbers.getBlock(item).builtInRegistryHolder().is(tag);
|
Block block = CraftMagicNumbers.getBlock(item);
|
||||||
|
|
||||||
|
// SPIGOT-6952: A Material is not necessary a block, in this case return false
|
||||||
|
if (block == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return block.builtInRegistryHolder().is(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -17,7 +17,14 @@ public class CraftItemTag extends CraftTag<Item, Material> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTagged(Material item) {
|
public boolean isTagged(Material item) {
|
||||||
return CraftMagicNumbers.getItem(item).builtInRegistryHolder().is(tag);
|
Item minecraft = CraftMagicNumbers.getItem(item);
|
||||||
|
|
||||||
|
// SPIGOT-6952: A Material is not necessary an item, in this case return false
|
||||||
|
if (minecraft == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return minecraft.builtInRegistryHolder().is(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren