Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ public static DimensionType fromRegistry(Registries registries, String name) {
if (registries == null) {
return new DimensionType(name);
}
Registries.Entry entry = registries.getEntry("minecraft:dimension_type", name);
Registries.Entry entry = registries.getEntry("dimension_type", name);
if (entry == null) {
return new DimensionType(name);
}
return DimensionType.fromRegistry(entry);
}

public static DimensionType fromRegistry(Registries registries, int id) {
Registries.Entry entry = registries.getEntry("minecraft:dimension_type", id);
Registries.Entry entry = registries.getEntry("dimension_type", id);
if (entry == null) {
return new DimensionType(new CompoundTag(), "", id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ public Registries copy() {
public Entry getEntry(String registryName, String entryName) {
if (registriesTag != null) {
CompoundTag registry = registriesTag.get(registryName);
if (registry == null) {
registry = registriesTag.get("minecraft:" + registryName);
}
if (registry == null) return null;
ListTag entries = registry.get("value");
if (entries == null) return null;
for (Tag entry : entries) {
StringTag name = ((CompoundTag) entry).get("name");
if (name != null && name.getValue().equals(entryName)) {
if (name != null && (name.getValue().equals(entryName) || name.getValue().equals("minecraft:" + entryName))) {
NumberTag id = ((CompoundTag) entry).get("id");
Tag value = ((CompoundTag) entry).get("element");
return new Entry(id == null ? 0 : id.asInt(), name.getValue(), value);
Expand All @@ -85,6 +88,9 @@ public Entry getEntry(String registryName, String entryName) {
public Entry getEntry(String registryName, int entryId) {
if (registriesTag != null) {
CompoundTag registry = registriesTag.get(registryName);
if (registry == null) {
registry = registriesTag.get("minecraft:" + registryName);
}
if (registry == null) return null;
ListTag entries = registry.get("value");
if (entries == null) return null;
Expand Down