Add tostring handling for components

This commit is contained in:
booky10 committed 2024-04-23 19:14:56 +02:00
1 parent 1b071e6564
commit fffb4e08b8
3 files changed
+12 -1

No files matched your search

@@ -360,7 +360,8 @@ public class ItemStack {
String identifier = type == null ? "null" : type.getName().toString();
int maxAmount = getType().getMaxAmount();
return "ItemStack[type=" + identifier + ", amount=" + amount + "/" + maxAmount
+ ", nbt tag names: " + (nbt != null ? nbt.getTagNames() : "[null]") + ", legacyData=" + legacyData + "]";
+ ", nbt tag names: " + (nbt != null ? nbt.getTagNames() : "[null]")
+ ", legacyData=" + legacyData + ", components=" + components + "]";
}
}
@@ -102,6 +102,11 @@ public class ComponentTypes {
}
return false;
}
@Override
public String toString() {
return "Component[" + this.getName() + "]";
}
};
TYPES_BUILDER.register(COMPONENT_TYPE_MAP, COMPONENT_TYPE_ID_MAP, type);
return type;
@@ -95,4 +95,9 @@ public class PatchableComponentMap implements IComponentMap {
public Map<ComponentType<?>, Optional<?>> getPatches() {
return this.patches;
}
@Override
public String toString() {
return "PatchableComponentMap{base=" + this.base + ", patches=" + this.patches + '}';
}
}