优化代码

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
yarn_mappings=build.1
loader_version=0.16.10
mod_version=1.0
mod_version=1.1
maven_group=com.mingliqiye.minecraft.enchantment.conflict
archives_base_name=enchantmentdoesnotconflict
fabric_version=0.92.6

View File

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

View File

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