Skip to content

Commit 4c29be0

Browse files
author
Lee Zheng Han
committed
Fix bundles original name not changing
1 parent 96d59f6 commit 4c29be0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/com/solarrabbit/colorbundles/listener/CraftingListener.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package com.solarrabbit.colorbundles.listener;
1919

20-
import java.util.Optional;
2120
import java.util.stream.Stream;
2221

2322
import com.solarrabbit.colorbundles.ColorBundles;
@@ -80,14 +79,14 @@ private ItemStack getResult(Recipe recipe, CraftingInventory inventory) {
8079
private boolean hasOriginalName(ItemMeta meta) {
8180
if (!meta.hasDisplayName())
8281
return true;
83-
return meta.getDisplayName() == getOriginalName(meta);
82+
return meta.getDisplayName().equals(getOriginalName(meta));
8483
}
8584

8685
private String getOriginalName(ItemMeta meta) {
8786
if (plugin.getUserConfig().hasCustomLoader()) {
8887
ItemStack item = new ItemStack(Material.BUNDLE);
8988
item.setItemMeta(meta);
90-
return Optional.ofNullable(CustomStack.byItemStack(item)).map(CustomStack::getDisplayName).orElse(null);
89+
return CustomStack.getInstance(CustomStack.byItemStack(item).getNamespacedID()).getDisplayName();
9190
}
9291
PersistentDataContainer prc = meta.getPersistentDataContainer();
9392
NamespacedKey nsk = new NamespacedKey(JavaPlugin.getPlugin(ColorBundles.class),

0 commit comments

Comments
 (0)