Skip to content

Commit

Permalink
Do not override enchantments of the stored_enchantments component (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt authored May 25, 2024
1 parent 7c6475b commit 36c0cb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion patches/net/minecraft/FileUtil.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@@ -74,7 +_,7 @@

public static boolean isPathPortable(Path p_133735_) {
for(Path path : p_133735_) {
for (Path path : p_133735_) {
- if (RESERVED_WINDOWS_FILENAMES.matcher(path.toString()).matches()) {
+ if ((net.neoforged.neoforge.common.NeoForgeMod.getProperFilenameValidation() ? RESERVED_WINDOWS_FILENAMES_NEOFORGE : RESERVED_WINDOWS_FILENAMES).matcher(path.toString()).matches()) {
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- a/net/minecraft/advancements/critereon/ItemEnchantmentsPredicate.java
+++ b/net/minecraft/advancements/critereon/ItemEnchantmentsPredicate.java
@@ -23,6 +_,11 @@
return this.enchantments;
}
@@ -48,6 +_,11 @@
super(p_333967_);
}

+ @Override // NEO: use getAllEnchantments for enchantments
+ public boolean matches(ItemStack p_333958_) {
+ return matches(p_333958_, p_333958_.getAllEnchantments());
+ }
+ @Override // Neo: use getAllEnchantments for enchantments
+ public boolean matches(ItemStack p_333958_) {
+ return matches(p_333958_, p_333958_.getAllEnchantments());
+ }
+
public boolean matches(ItemStack p_333811_, ItemEnchantments p_334059_) {
for (EnchantmentPredicate enchantmentpredicate : this.enchantments) {
if (!enchantmentpredicate.containedIn(p_334059_)) {
@Override
public DataComponentType<ItemEnchantments> componentType() {
return DataComponents.ENCHANTMENTS;

0 comments on commit 36c0cb2

Please sign in to comment.