优化代码
This commit is contained in:
parent
7dcdd78660
commit
3374153bc7
@ -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
|
||||
|
@ -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 + ")";
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user