mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-30 23:05:03 +01:00
fix: enchantments getting trimmed from non-filter items (#7216)
This commit is contained in:
parent
507829443f
commit
fc94c75866
1 changed files with 17 additions and 10 deletions
|
@ -23,14 +23,15 @@ public class FilterItemStack {
|
|||
|
||||
public static FilterItemStack of(ItemStack filter) {
|
||||
if (filter.hasTag()) {
|
||||
CompoundTag stackTag = filter.getTag();
|
||||
stackTag.remove("Enchantments");
|
||||
stackTag.remove("AttributeModifiers");
|
||||
|
||||
if (AllItems.FILTER.isIn(filter))
|
||||
if (AllItems.FILTER.isIn(filter)){
|
||||
trimFilterTag(filter);
|
||||
return new ListFilterItemStack(filter);
|
||||
if (AllItems.ATTRIBUTE_FILTER.isIn(filter))
|
||||
}
|
||||
if (AllItems.ATTRIBUTE_FILTER.isIn(filter)){
|
||||
trimFilterTag(filter);
|
||||
return new AttributeFilterItemStack(filter);
|
||||
}
|
||||
}
|
||||
|
||||
return new FilterItemStack(filter);
|
||||
|
@ -44,6 +45,12 @@ public class FilterItemStack {
|
|||
return of(ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
private static void trimFilterTag(ItemStack filter){
|
||||
CompoundTag stackTag = filter.getTag();
|
||||
stackTag.remove("Enchantments");
|
||||
stackTag.remove("AttributeModifiers");
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return filterItemStack.isEmpty();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue