Mace enchants unnerf

This commit is contained in:
2025-09-18 16:17:34 +02:00
parent 5090dcca36
commit cee969ebf6
3 changed files with 15 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ minecraft_version=1.21.8
yarn_mappings=1.21.8+build.1
loader_version=0.17.2
# Mod Properties
mod_version=1.1
mod_version=1.2
maven_group=com.kasetoatz
archives_base_name=SuperEnchants
# Dependencies

View File

@@ -19,7 +19,8 @@ public class Config
public static boolean BOW_ENCHANTS_UNNERF = true;
public static boolean CROSSBOW_ENCHANTS_UNNERF = true;
public static boolean ARMOR_ENCHANTS_UNNERF = true;
public static boolean TOOL_ENCHANTS_UNNERF = true;
public static boolean WEAPON_ENCHANTS_UNNERF = true;
public static boolean MACE_ENCHANTS_UNNERF = true;
public static boolean ENABLE_CHANNELING_2 = true;
public static boolean LOYALTY_VOID_PROTECTION = true;
public static boolean DISABLE_SOUL_SPEED_DAMAGE = true;
@@ -90,9 +91,13 @@ public class Config
{
ARMOR_ENCHANTS_UNNERF = data.get("armor-enchants-unnerf").getAsBoolean();
}
if (data.has("tool-enchants-unnerf"))
if (data.has("weapon-enchants-unnerf"))
{
TOOL_ENCHANTS_UNNERF = data.get("tool-enchants-unnerf").getAsBoolean();
WEAPON_ENCHANTS_UNNERF = data.get("weapon-enchants-unnerf").getAsBoolean();
}
if (data.has("mace-enchants-unnerf"))
{
MACE_ENCHANTS_UNNERF = data.get("mace-enchants-unnerf").getAsBoolean();
}
if (data.has("enable-channeling-2"))
{
@@ -147,7 +152,8 @@ public class Config
data.addProperty("bow-enchants-unnerf", BOW_ENCHANTS_UNNERF);
data.addProperty("crossbow-enchants-unnerf", CROSSBOW_ENCHANTS_UNNERF);
data.addProperty("armor-enchants-unnerf", ARMOR_ENCHANTS_UNNERF);
data.addProperty("tool-enchants-unnerf", TOOL_ENCHANTS_UNNERF);
data.addProperty("weapon-enchants-unnerf", WEAPON_ENCHANTS_UNNERF);
data.addProperty("mace-enchants-unnerf", MACE_ENCHANTS_UNNERF);
data.addProperty("enable-channeling-2", ENABLE_CHANNELING_2);
data.addProperty("loyalty-void-protection", LOYALTY_VOID_PROTECTION);
data.addProperty("disable-soul-speed-damage", DISABLE_SOUL_SPEED_DAMAGE);

View File

@@ -3,7 +3,6 @@ package com.kasetoatz.superenchants.mixin;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
@@ -30,8 +29,9 @@ public class EnchantmentMixin
@Shadow @Final private Enchantment.Definition definition;
@Unique private static final List<RegistryKey<Enchantment>> BOW_ENCHANTS = List.of(Enchantments.INFINITY, Enchantments.MENDING);
@Unique private static final List<RegistryKey<Enchantment>> CROSSBOW_ENCHANTS = List.of(Enchantments.PIERCING, Enchantments.MULTISHOT);
@Unique private static final List<RegistryKey<Enchantment>> TOOL_ENCHANTS = List.of(Enchantments.SHARPNESS, Enchantments.SMITE, Enchantments.BANE_OF_ARTHROPODS);
@Unique private static final List<RegistryKey<Enchantment>> ARMOR_ENCHANTS = List.of(Enchantments.PROTECTION, Enchantments.BLAST_PROTECTION, Enchantments.FIRE_PROTECTION, Enchantments.PROJECTILE_PROTECTION);
@Unique private static final List<RegistryKey<Enchantment>> WEAPON_ENCHANTS = List.of(Enchantments.SHARPNESS, Enchantments.SMITE, Enchantments.BANE_OF_ARTHROPODS);
@Unique private static final List<RegistryKey<Enchantment>> MACE_ENCHANTS = List.of(Enchantments.DENSITY, Enchantments.BREACH, Enchantments.BANE_OF_ARTHROPODS, Enchantments.SMITE);
@Inject(method="canBeCombined", at=@At("HEAD"), cancellable = true)
private static void canBeCombined(RegistryEntry<Enchantment> first, RegistryEntry<Enchantment> second, CallbackInfoReturnable<Boolean> cir)
@@ -40,7 +40,8 @@ public class EnchantmentMixin
(BOW_ENCHANTS_UNNERF && BOW_ENCHANTS.stream().anyMatch(first::matchesKey) && BOW_ENCHANTS.stream().anyMatch(second::matchesKey)) ||
(CROSSBOW_ENCHANTS_UNNERF && CROSSBOW_ENCHANTS.stream().anyMatch(first::matchesKey) && CROSSBOW_ENCHANTS.stream().anyMatch(second::matchesKey)) ||
(ARMOR_ENCHANTS_UNNERF && ARMOR_ENCHANTS.stream().anyMatch(first::matchesKey) && ARMOR_ENCHANTS.stream().anyMatch(second::matchesKey)) ||
(TOOL_ENCHANTS_UNNERF && TOOL_ENCHANTS.stream().anyMatch(first::matchesKey) && TOOL_ENCHANTS.stream().anyMatch(second::matchesKey))
(WEAPON_ENCHANTS_UNNERF && WEAPON_ENCHANTS.stream().anyMatch(first::matchesKey) && WEAPON_ENCHANTS.stream().anyMatch(second::matchesKey)) ||
(MACE_ENCHANTS_UNNERF && MACE_ENCHANTS.stream().anyMatch(first::matchesKey) && MACE_ENCHANTS.stream().anyMatch(second::matchesKey))
)
{
cir.setReturnValue(true);