fix: RefillCoreCommand not working correctly

This commit is contained in:
Chayapak 2025-03-21 17:13:38 +07:00
parent 185b835f7e
commit 4a752ef0a2
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA
2 changed files with 9 additions and 5 deletions
build-number.txt
src/main/java/me/chayapak1/chomens_bot/plugins

View file

@ -1 +1 @@
2050
2053

View file

@ -93,7 +93,7 @@ public class CorePlugin extends PositionPlugin.Listener {
if (!shouldRefill) return;
refill();
refill(false);
shouldRefill = false;
}, 0, 1, TimeUnit.SECONDS);
@ -432,7 +432,7 @@ public class CorePlugin extends PositionPlugin.Listener {
Math.abs(botChunkPosZ - coreChunkPosZ) > bot.world.simulationDistance
) {
reset();
refill();
refill(false);
}
if (!ready) {
@ -471,7 +471,8 @@ public class CorePlugin extends PositionPlugin.Listener {
block = Vector3i.from(from);
}
public void refill () {
public void refill () { refill(true); }
public void refill (boolean force) {
if (!ready) return;
final Map<Integer, Boolean> refilledMap = new HashMap<>();
@ -483,7 +484,10 @@ public class CorePlugin extends PositionPlugin.Listener {
final Boolean refilled = refilledMap.get(y);
if (isCommandBlockState(block) || (refilled != null && refilled)) continue;
if (
(!force && isCommandBlockState(block)) ||
(refilled != null && refilled)
) continue;
final String command = String.format(
"minecraft:fill %s %s %s %s %s %s minecraft:command_block{CustomName:'%s'}",