Skip to content

Commit

Permalink
Restore EnchantmentsBegoneModule hiding from creative mode
Browse files Browse the repository at this point in the history
  • Loading branch information
quat1024 committed Jan 2, 2024
1 parent d4795dd commit b29c8d0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.violetmoon.quark.mixin.mixins;

import java.util.stream.Stream;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.enchantment.Enchantment;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.violetmoon.quark.content.experimental.module.EnchantmentsBegoneModule;

@Mixin(CreativeModeTabs.class)
public class CreativeModeTabsMixin {

@ModifyExpressionValue(method = "generateEnchantmentBookTypesOnlyMaxLevel", at = @At(value = "INVOKE", target = "Ljava/util/stream/Stream;filter(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;", ordinal = 0))
private static Stream<Enchantment> quark$filterEnchantments(Stream<Enchantment> in) {
return in.filter(ench -> !EnchantmentsBegoneModule.shouldBegone(ench));
}

@ModifyExpressionValue(method = "generateEnchantmentBookTypesAllLevels", at = @At(value = "INVOKE", target = "Ljava/util/stream/Stream;filter(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;", ordinal = 0))
private static Stream<Enchantment> quark$filterEnchantments2(Stream<Enchantment> in) {
return in.filter(ench -> !EnchantmentsBegoneModule.shouldBegone(ench));
}

}

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/quark.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"BoatMixin",
"CeilingHangingSignBlockMixin",
"ClimateParameterPointMixin",
"CreativeModeTabsMixin",
"CrossbowMultishotMixin",
"DamageEnchantmentMixin",
"DamageSourcesMixin",
"DiggerItemMixin",
"ElytraItemMixin",
"EnchantBookForEmeraldsMixin",
"EnchantedBookItemMixin",
"EnchantmentHelperMixin",
"EnchantmentMixin",
"EnchantRandomlyFunctionMixin",
Expand Down

0 comments on commit b29c8d0

Please sign in to comment.