优化代码

This commit is contained in:
Armamem0t 2025-07-14 12:46:41 +08:00
parent 7dcdd78660
commit 3374153bc7
Signed by: minglipro
GPG Key ID: 5F355A77B22AA93B
3 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,7 @@
minecraft_version=1.20.1 minecraft_version=1.20.1
yarn_mappings=build.1 yarn_mappings=build.1
loader_version=0.16.10 loader_version=0.16.10
mod_version=1.0 mod_version=1.1
maven_group=com.mingliqiye.minecraft.enchantment.conflict maven_group=com.mingliqiye.minecraft.enchantment.conflict
archives_base_name=enchantmentdoesnotconflict archives_base_name=enchantmentdoesnotconflict
fabric_version=0.92.6 fabric_version=0.92.6

View File

@ -23,7 +23,7 @@ public class ModConfig {
private boolean allowDamageEnchantment = true; private boolean allowDamageEnchantment = true;
private boolean allowInfinityEnchantment = true; private boolean allowInfinityEnchantment = true;
private boolean allowPiercingEnchantment = true; private boolean allowPiercingEnchantment = true;
private boolean allowProtectionEnchantmentMixin = true; private boolean allowProtectionEnchantment = true;
public ModConfig() { public ModConfig() {
} }
@ -87,14 +87,14 @@ public class ModConfig {
this.allowPiercingEnchantment = allowPiercingEnchantment; this.allowPiercingEnchantment = allowPiercingEnchantment;
} }
public boolean isAllowProtectionEnchantmentMixin() { public boolean isAllowProtectionEnchantment() {
return allowProtectionEnchantmentMixin; return allowProtectionEnchantment;
} }
public void setAllowProtectionEnchantmentMixin( public void setAllowProtectionEnchantmentMixin(
boolean allowProtectionEnchantmentMixin boolean allowProtectionEnchantmentMixin
) { ) {
this.allowProtectionEnchantmentMixin = allowProtectionEnchantmentMixin; this.allowProtectionEnchantment = allowProtectionEnchantmentMixin;
} }
public String toString() { public String toString() {
@ -103,7 +103,7 @@ public class ModConfig {
"allowInfinityEnchantment" + "=" + allowInfinityEnchantment + "allowInfinityEnchantment" + "=" + allowInfinityEnchantment +
"," + "allowPiercingEnchantment" + "=" + "," + "allowPiercingEnchantment" + "=" +
allowPiercingEnchantment + "," + allowPiercingEnchantment + "," +
"allowProtectionEnchantmentMixin" + "=" + "allowProtectionEnchantment" + "=" +
allowProtectionEnchantmentMixin + ")"; allowProtectionEnchantment + ")";
} }
} }

View File

@ -20,7 +20,7 @@ public abstract class ProtectionEnchantmentMixin {
@NotNull CallbackInfoReturnable<Boolean> cir @NotNull CallbackInfoReturnable<Boolean> cir
) { ) {
if (enchantment instanceof ProtectionEnchantment) { if (enchantment instanceof ProtectionEnchantment) {
cir.setReturnValue(ModConfig.getInstance().isAllowProtectionEnchantmentMixin()); cir.setReturnValue(ModConfig.getInstance().isAllowProtectionEnchantment());
} }
} }
} }