AutoStore 模组完整源码
这个提交包含在:
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* 本文件由 autostore-1.0-SNAPSHOT.jar 反编译并整理而来(CFR 0.152),
|
||||
* 混淆名已替换为 Minecraft 1.21.4 Yarn 可读映射,并补充中文注释。
|
||||
*/
|
||||
package autostore.client.config;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
/**
|
||||
* 自动扩地配置数据类。
|
||||
*
|
||||
* <p>保存了扩地策略、目标数量、超时重试、区域限制以及 Baritone 寻路行为等全部可配置项,
|
||||
* 通过 {@link ConfigStore} 持久化为 JSON 文件。</p>
|
||||
*/
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ExpansionConfig {
|
||||
|
||||
/** 扩地策略:1=方形外扩,2=区域扩地,3=玩家周围,4=绕国一圈 */
|
||||
public int strategy = 1;
|
||||
|
||||
/** 目标邦国名称;为空时表示自动识别玩家当前所在邦国 */
|
||||
public String stateName = "";
|
||||
|
||||
/** 目标扩地数量;-1 表示持续扩地直到无可用区块 */
|
||||
public int targetCount = -1;
|
||||
|
||||
/** 等待/寻路超时时间(秒) */
|
||||
public int waitTimeoutSeconds = 60;
|
||||
|
||||
/** 超时后的最大重试次数 */
|
||||
public int retries = 2;
|
||||
|
||||
/** 区域扩地策略的中心 X 坐标(区块) */
|
||||
public int regionCenterX;
|
||||
|
||||
/** 区域扩地策略的中心 Z 坐标(区块) */
|
||||
public int regionCenterZ;
|
||||
|
||||
/** 区域扩地策略的半径(区块) */
|
||||
public int regionRadius = 5;
|
||||
|
||||
/** 区域扩地策略的矩形边界(区块坐标);minX > maxX 表示未圈选,使用中心+半径 */
|
||||
public int regionMinX = 0;
|
||||
|
||||
/** 区域扩地策略的矩形边界(区块坐标);未圈选时为 -1 */
|
||||
public int regionMaxX = -1;
|
||||
|
||||
/** 区域扩地策略的矩形边界(区块坐标);minZ > maxZ 表示未圈选,使用中心+半径 */
|
||||
public int regionMinZ = 0;
|
||||
|
||||
/** 区域扩地策略的矩形边界(区块坐标);未圈选时为 -1 */
|
||||
public int regionMaxZ = -1;
|
||||
|
||||
/** 是否允许 Baritone 疾跑 */
|
||||
public boolean allowSprint = true;
|
||||
|
||||
/** 是否允许 Baritone 游泳 */
|
||||
public boolean allowSwim = true;
|
||||
|
||||
/** 是否允许 Baritone 跳跃 */
|
||||
public boolean allowJump = true;
|
||||
|
||||
/** 是否允许 Baritone 破坏方块 */
|
||||
public boolean allowBreak;
|
||||
|
||||
/** 是否允许 Baritone 放置方块 */
|
||||
public boolean allowPlace;
|
||||
|
||||
/** 是否启用避开怪物 */
|
||||
public boolean avoidMobs = true;
|
||||
|
||||
/** 是否启用自动进食(饥饿时自动吃背包食物) */
|
||||
public boolean autoEat = true;
|
||||
|
||||
/** 触发自动进食的饥饿值阈值(0-20) */
|
||||
public int eatThreshold = 14;
|
||||
|
||||
/** 扩圈上限(0 表示不限制) */
|
||||
public int maxRings;
|
||||
|
||||
/** 地图自动刷新间隔(秒),最小 10 秒 */
|
||||
public int refreshIntervalSeconds = 30;
|
||||
|
||||
/**
|
||||
* 深拷贝当前配置,返回一个独立的副本。
|
||||
*
|
||||
* @return 与当前配置完全相同的副本
|
||||
*/
|
||||
public ExpansionConfig copy() {
|
||||
ExpansionConfig c = new ExpansionConfig();
|
||||
c.strategy = this.strategy;
|
||||
c.stateName = this.stateName;
|
||||
c.targetCount = this.targetCount;
|
||||
c.waitTimeoutSeconds = this.waitTimeoutSeconds;
|
||||
c.retries = this.retries;
|
||||
c.regionCenterX = this.regionCenterX;
|
||||
c.regionCenterZ = this.regionCenterZ;
|
||||
c.regionRadius = this.regionRadius;
|
||||
c.regionMinX = this.regionMinX;
|
||||
c.regionMaxX = this.regionMaxX;
|
||||
c.regionMinZ = this.regionMinZ;
|
||||
c.regionMaxZ = this.regionMaxZ;
|
||||
c.allowSprint = this.allowSprint;
|
||||
c.allowSwim = this.allowSwim;
|
||||
c.allowJump = this.allowJump;
|
||||
c.allowBreak = this.allowBreak;
|
||||
c.allowPlace = this.allowPlace;
|
||||
c.avoidMobs = this.avoidMobs;
|
||||
c.autoEat = this.autoEat;
|
||||
c.eatThreshold = this.eatThreshold;
|
||||
c.maxRings = this.maxRings;
|
||||
c.refreshIntervalSeconds = this.refreshIntervalSeconds;
|
||||
return c;
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户