Catch UnsupportedOperationException for cb.spigot().setUnbreakable
This commit is contained in:
parent
c0e5746e3c
commit
2bdabf9619
@ -35,13 +35,21 @@ public class WriterItemStackMetaUnbreakable extends WriterAbstractItemStackMetaF
|
|||||||
@Override
|
@Override
|
||||||
public Boolean getB(ItemMeta cb, ItemStack d)
|
public Boolean getB(ItemMeta cb, ItemStack d)
|
||||||
{
|
{
|
||||||
return cb.spigot().isUnbreakable();
|
try {
|
||||||
|
return cb.spigot().isUnbreakable();
|
||||||
|
} catch (UnsupportedOperationException ignored) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setB(ItemMeta cb, Boolean fb, ItemStack d)
|
public void setB(ItemMeta cb, Boolean fb, ItemStack d)
|
||||||
{
|
{
|
||||||
cb.spigot().setUnbreakable(fb);
|
try {
|
||||||
|
cb.spigot().setUnbreakable(fb);
|
||||||
|
} catch (UnsupportedOperationException ignored) {
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user