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