Skip to content

Commit

Permalink
Fix trim registries
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Feb 11, 2024
1 parent aebc8b0 commit 0b1e619
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -11,10 +11,13 @@
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.trim.TrimMaterial;
import org.bukkit.inventory.meta.trim.TrimPattern;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -284,7 +287,7 @@ private ItemBuilder display() {
String trimPattern = this.section.getString("DisplayTrim.Pattern");

if (trimPattern != null) {
key = NamespacedKey.fromString(trimPattern);
key = NamespacedKey.minecraft(trimPattern.toLowerCase());
}

if (key != null) {
Expand All @@ -299,12 +302,12 @@ private ItemBuilder display() {
String trimMaterial = this.section.getString("DisplayTrim.Material");

if (trimMaterial != null) {
key = NamespacedKey.fromString(trimMaterial);
key = NamespacedKey.minecraft(trimMaterial.toLowerCase());
}

if (key != null) {
TrimPattern registry = Registry.TRIM_PATTERN.get(key);
builder.setTrimPattern(registry);
TrimMaterial registry = Registry.TRIM_MATERIAL.get(key);
builder.setTrimMaterial(registry);
}
}

Expand Down

0 comments on commit 0b1e619

Please sign in to comment.