mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-09 23:42:35 -04:00
check if slot has custom name and nbt data
This commit is contained in:
parent
44bcaf43ee
commit
9e23b13a31
@ -45,7 +45,7 @@ public class Slot {
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
if (nbt.containsKey("display") && nbt.getCompoundTag("display").containsKey("Name")) {
|
||||
if (nbt != null && nbt.containsKey("display") && nbt.getCompoundTag("display").containsKey("Name")) { // check if object has nbt data, and a custom display name
|
||||
return new ChatComponent(nbt.getCompoundTag("display").getStringTag("Name").getValue()).getColoredMessage();
|
||||
}
|
||||
return "<ToDo>"; //ToDo display name per Item
|
||||
|
Loading…
x
Reference in New Issue
Block a user