Configurable goal selector update interval
Correspond to new vanilla optimization mechanic
This commit is contained in:
parent
baf681d166
commit
93e54f8d26
|
@ -0,0 +1,16 @@
|
||||||
|
package io.izzel.arclight.common.mixin.optimization.general;
|
||||||
|
|
||||||
|
import io.izzel.arclight.i18n.ArclightConfig;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Constant;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||||
|
|
||||||
|
@Mixin(Mob.class)
|
||||||
|
public class MobMixin_Optimization {
|
||||||
|
|
||||||
|
@ModifyConstant(method = "serverAiStep", constant = @Constant(intValue = 2))
|
||||||
|
private int arclight$goalUpdateInterval(int orig) {
|
||||||
|
return ArclightConfig.spec().getOptimization().getGoalSelectorInterval();
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,6 +7,7 @@
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"ClassInheritanceMultiMapMixin",
|
"ClassInheritanceMultiMapMixin",
|
||||||
"EntityDataManagerMixin_Optimize",
|
"EntityDataManagerMixin_Optimize",
|
||||||
|
"MobMixin_Optimization",
|
||||||
"VoxelShapesMixin",
|
"VoxelShapesMixin",
|
||||||
"activationrange.ActivationRangeMixin",
|
"activationrange.ActivationRangeMixin",
|
||||||
"activationrange.EntityMixin_ActivationRange",
|
"activationrange.EntityMixin_ActivationRange",
|
||||||
|
|
|
@ -12,6 +12,9 @@ public class OptimizationSpec {
|
||||||
@Setting("disable-data-fixer")
|
@Setting("disable-data-fixer")
|
||||||
private boolean disableDFU;
|
private boolean disableDFU;
|
||||||
|
|
||||||
|
@Setting("goal-selector-update-interval")
|
||||||
|
private int goalSelectorInterval;
|
||||||
|
|
||||||
public boolean isCachePluginClass() {
|
public boolean isCachePluginClass() {
|
||||||
return cachePluginClass;
|
return cachePluginClass;
|
||||||
}
|
}
|
||||||
|
@ -19,4 +22,8 @@ public class OptimizationSpec {
|
||||||
public boolean isDisableDFU() {
|
public boolean isDisableDFU() {
|
||||||
return disableDFU;
|
return disableDFU;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getGoalSelectorInterval() {
|
||||||
|
return goalSelectorInterval;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@ locale {
|
||||||
fallback = "zh_cn"
|
fallback = "zh_cn"
|
||||||
}
|
}
|
||||||
optimization {
|
optimization {
|
||||||
remove-stream = true
|
|
||||||
cache-plugin-class = true
|
cache-plugin-class = true
|
||||||
disable-data-fixer = false
|
disable-data-fixer = false
|
||||||
|
goal-selector-update-interval = 2
|
||||||
}
|
}
|
||||||
compatibility {
|
compatibility {
|
||||||
material-property-overrides {
|
material-property-overrides {
|
||||||
|
|
|
@ -88,6 +88,11 @@ comments {
|
||||||
"Arclight and its developers are not reponsible for any data loss or corruption"
|
"Arclight and its developers are not reponsible for any data loss or corruption"
|
||||||
"DO NOT USE IN PRODUCTION!"
|
"DO NOT USE IN PRODUCTION!"
|
||||||
]
|
]
|
||||||
|
goal-selector-update-interval.comment = [
|
||||||
|
"Interval in ticks to update the goal selector"
|
||||||
|
"Higher values costs less resources"
|
||||||
|
"Cause mobs changing their goals less often"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
async-catcher.comment = [
|
async-catcher.comment = [
|
||||||
"Async Catcher related settings"
|
"Async Catcher related settings"
|
||||||
|
|
|
@ -89,6 +89,11 @@ comments {
|
||||||
"Arclight 及其开发者不对任何数据丢失或损害负责"
|
"Arclight 及其开发者不对任何数据丢失或损害负责"
|
||||||
"请不要在生产环境中使用"
|
"请不要在生产环境中使用"
|
||||||
]
|
]
|
||||||
|
goal-selector-update-interval.comment = [
|
||||||
|
"实体目标选择器的更新间隔"
|
||||||
|
"数值越高消耗资源越少"
|
||||||
|
"导致实体更改目标速度变慢"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
async-catcher.comment = [
|
async-catcher.comment = [
|
||||||
"异步捕获相关设置"
|
"异步捕获相关设置"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user