fix: core command block ids and states & bossbar manager text display broken

This commit is contained in:
ChomeNS
2025-04-20 19:21:29 +07:00
parent db56afd319
commit 181b907ac7
2 changed files with 12 additions and 19 deletions

View File

@@ -70,7 +70,14 @@ public class BotBossBar extends BossBar {
bot.core.run("minecraft:bossbar set " + id + " name " + serialized);
if (!bot.core.hasRateLimit())
bot.core.run("minecraft:execute as @e[type=minecraft:text_display,tag=" + bot.config.namespace + "_" + onlyName + "] run data modify entity @s text set value '" + serialized.replace("\\", "\\\\").replace("'", "\\'") + "'");
bot.core.run(
String.format(
"minecraft:execute as @e[type=minecraft:text_display,tag=%s_%s] run data modify entity @s text set value %s",
bot.config.namespace,
onlyName,
serialized
)
);
}
public BossBarColor color (final BossBarColor color) {

View File

@@ -37,7 +37,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
public class CorePlugin implements Listener {
public static final int COMMAND_BLOCK_ID = 418;
public static final int COMMAND_BLOCK_ID = 425;
private final Bot bot;
@@ -391,23 +391,9 @@ public class CorePlugin implements Listener {
private boolean isCommandBlockState (final int blockState) {
return
// command block
(
blockState >= 8680 &&
blockState <= 8686
) ||
// chain command block
(
blockState >= 13540 &&
blockState <= 13546
) ||
// repeating command block
(
blockState >= 13534 &&
blockState <= 13540
);
(blockState >= 8690 && blockState <= 8701) // command block
|| (blockState >= 13550 && blockState <= 13561) // chain command block
|| (blockState >= 13538 && blockState <= 13549); // repeating command block
}
// ported from chomens bot js, which is originally from smp