mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Jk that's not nullable
This commit is contained in:
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();
|
||||
|
||||
Reference in new issue
Block a user