版本号
支持使用锄头作为树叶的工具
This commit is contained in:
@@ -42,7 +42,7 @@ mod_name=maid useful task
|
||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=MIT
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=1.0.1
|
||||
mod_version=1.1.0
|
||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||
# This should match the base package used for the mod sources.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package studio.fantasyit.maid_useful_task.behavior;
|
||||
|
||||
import com.github.tartaricacid.touhoulittlemaid.entity.passive.EntityMaid;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.ai.behavior.Behavior;
|
||||
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
||||
import net.minecraft.world.entity.ai.memory.MemoryStatus;
|
||||
import studio.fantasyit.maid_useful_task.util.MemoryUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class LoopWithTokenBehavior extends Behavior<EntityMaid> {
|
||||
public LoopWithTokenBehavior() {
|
||||
super(Map.of());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void start(ServerLevel p_22540_, EntityMaid p_22541_, long p_22542_) {
|
||||
MemoryUtil.getRateLimitToken(p_22541_).tick(p_22541_);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package studio.fantasyit.maid_useful_task.memory;
|
||||
|
||||
import com.github.tartaricacid.touhoulittlemaid.entity.passive.EntityMaid;
|
||||
import studio.fantasyit.maid_useful_task.util.MemoryUtil;
|
||||
|
||||
public class TaskRateLimitToken {
|
||||
public enum Level {
|
||||
|
||||
IDLE(0),
|
||||
L1(1),
|
||||
L2(2),
|
||||
L3(3),
|
||||
L4(4),
|
||||
L5(5);
|
||||
private final int level;
|
||||
|
||||
Level(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
||||
int currentLevel = 0;
|
||||
int cooldown = 100;
|
||||
|
||||
public void tick(EntityMaid maid) {
|
||||
if (MemoryUtil.getTargetPos(maid) != null) {
|
||||
currentLevel = 0;
|
||||
cooldown = 20;
|
||||
return;
|
||||
}
|
||||
if (cooldown > 0) {
|
||||
cooldown--;
|
||||
return;
|
||||
}
|
||||
|
||||
currentLevel++;
|
||||
if (currentLevel > 5) {
|
||||
currentLevel = 0;
|
||||
cooldown = 100;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFor(Level level) {
|
||||
return currentLevel == level.getLevel();
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class MaidTreeTask implements IMaidTask, IMaidBlockPlaceTask, IMaidBlockD
|
||||
CombinedInvWrapper inv = maid.getAvailableInv(true);
|
||||
int target = -1;
|
||||
for (int i = 0; i < inv.getSlots(); i++) {
|
||||
if (inv.getStackInSlot(i).is(Items.SHEARS)) {
|
||||
if (inv.getStackInSlot(i).is(Items.SHEARS) || inv.getStackInSlot(i).is(ItemTags.HOES)) {
|
||||
target = i;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -64,3 +64,10 @@ description='''${mod_description}'''
|
||||
versionRange="${minecraft_version_range}"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
[[dependencies."${mod_id}"]]
|
||||
modId="touhou_little_maid"
|
||||
mandatory=true
|
||||
versionRange="[1.2.2,)"
|
||||
ordering="AFTER"
|
||||
side="BOTH"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user