Skip to content

Commit

Permalink
Fix hideTags on 1.20.6+
Browse files Browse the repository at this point in the history
  • Loading branch information
kangarko committed Oct 14, 2024
1 parent 6f973c2 commit ce522cb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/org/mineacademy/fo/menu/model/ItemCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import org.mineacademy.fo.remain.Remain;
import org.mineacademy.fo.remain.nbt.NBTItem;

import com.google.common.collect.MultimapBuilder;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand Down Expand Up @@ -770,6 +772,14 @@ else if ("ZOMBIE_PIGMAN".equals(entityRaw))
if (!this.flags.contains(f))
this.flags.add(f);

if (this.hideTags || this.flags.contains(CompItemFlag.HIDE_ATTRIBUTES))
try {
((ItemMeta) compiledMeta).setAttributeModifiers(MultimapBuilder.hashKeys().hashSetValues().build());

} catch (final Throwable t) {
// ignore
}

for (final CompItemFlag flag : this.flags)
try {
((ItemMeta) compiledMeta).addItemFlags(ItemFlag.valueOf(flag.toString()));
Expand All @@ -795,7 +805,6 @@ else if ("ZOMBIE_PIGMAN".equals(entityRaw))
// From now on we have to re-set the item
//


// 1.7.10 hack to add glow, requires no enchants
if (this.glow && MinecraftVersion.equals(V.v1_7) && (this.enchants == null || this.enchants.isEmpty())) {
final NBTItem nbtItem = new NBTItem(compiledItem);
Expand Down

0 comments on commit ce522cb

Please sign in to comment.