Skip to content

Commit f117b70

Browse files
[update] Unenchanted Enchanting Template now doesn't have glint anymore. Help player to visually distinguish them more easily.
1 parent 5b5a7ab commit f117b70

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/main/java/plus/dragons/createenchantmentindustry/common/processing/enchanter/EnchantingTemplateItem.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
package plus.dragons.createenchantmentindustry.common.processing.enchanter;
2020

2121
import net.minecraft.core.Holder;
22+
import net.minecraft.core.component.DataComponents;
2223
import net.minecraft.world.item.Item;
2324
import net.minecraft.world.item.ItemStack;
2425
import net.minecraft.world.item.enchantment.Enchantment;
26+
import net.minecraft.world.item.enchantment.ItemEnchantments;
2527

2628
public class EnchantingTemplateItem extends Item {
2729
private final boolean special;
@@ -48,6 +50,11 @@ public boolean supportsEnchantment(ItemStack stack, Holder<Enchantment> enchantm
4850
return true;
4951
}
5052

53+
@Override
54+
public boolean isFoil(ItemStack stack) {
55+
return !stack.getOrDefault(DataComponents.STORED_ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty();
56+
}
57+
5158
@Override
5259
public boolean isEnchantable(ItemStack stack) {
5360
return false;

src/main/java/plus/dragons/createenchantmentindustry/common/registry/CEIItems.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@ public class CEIItems {
4545
.item("enchanting_template", EnchantingTemplateItem::normal)
4646
.properties(prop -> prop
4747
.rarity(Rarity.UNCOMMON)
48-
.component(DataComponents.STORED_ENCHANTMENTS, ItemEnchantments.EMPTY)
49-
.component(DataComponents.ENCHANTMENT_GLINT_OVERRIDE, true))
48+
.component(DataComponents.STORED_ENCHANTMENTS, ItemEnchantments.EMPTY))
5049
.register();
5150
public static final ItemEntry<EnchantingTemplateItem> SUPER_ENCHANTING_TEMPLATE = REGISTRATE
5251
.item("super_enchanting_template", EnchantingTemplateItem::special)
5352
.properties(prop -> prop
5453
.rarity(Rarity.RARE)
55-
.component(DataComponents.STORED_ENCHANTMENTS, ItemEnchantments.EMPTY)
56-
.component(DataComponents.ENCHANTMENT_GLINT_OVERRIDE, true))
54+
.component(DataComponents.STORED_ENCHANTMENTS, ItemEnchantments.EMPTY))
5755
.register();
5856
public static final ItemEntry<Item> EXPERIENCE_CAKE_BASE = REGISTRATE
5957
.item("experience_cake_base", Item::new)

0 commit comments

Comments
 (0)