mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +00:00
Address nullability of C()
This commit is contained in:
1 parent
7150b4c755
commit
b70b51cb5c
1 file changed
+6
-2
@@ -60,9 +60,13 @@ public final class ItemStackUtils {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
final Object cbItemStack = this.asNMSCopyMethod.invoke(null, itemStack);
|
final Object cbItemStack = this.asNMSCopyMethod.invoke(null, itemStack);
|
||||||
final Object nbtTag = this.cMethod.invoke(cbItemStack);
|
final Object mojangComponent = this.cMethod.invoke(cbItemStack);
|
||||||
|
|
||||||
return MinecraftComponentSerializer.INSTANCE.deserialize(nbtTag);
|
if (mojangComponent == null) {
|
||||||
|
return TextComponent.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
return MinecraftComponentSerializer.INSTANCE.deserialize(mojangComponent);
|
||||||
} catch (final IllegalAccessException | InvocationTargetException e) {
|
} catch (final IllegalAccessException | InvocationTargetException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return TextComponent.empty();
|
return TextComponent.empty();
|
||||||
|
|||||||
Reference in new issue
Block a user