Jk that's not nullable

This commit is contained in:
Draycia committed 2020-06-30 09:53:34 -07:00
1 parent b70b51cb5c
commit 4f648d4afe
1 file changed
+1 -5
@@ -54,7 +54,7 @@ public final class ItemStackUtils {
if (player instanceof Player) {
final ItemStack itemStack = ((Player)player).getInventory().getItemInMainHand();
if (itemStack.getType() == Material.AIR) {
if (itemStack == null || itemStack.getType() == Material.AIR) {
return TextComponent.empty();
}
@@ -62,10 +62,6 @@ public final class ItemStackUtils {
final Object cbItemStack = this.asNMSCopyMethod.invoke(null, itemStack);
final Object mojangComponent = this.cMethod.invoke(cbItemStack);
if (mojangComponent == null) {
return TextComponent.empty();
}
return MinecraftComponentSerializer.INSTANCE.deserialize(mojangComponent);
} catch (final IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();