refactor: check for core run command length if more than 32767 ignore & use ChipmunkMod.LOGGER for the core command log

This commit is contained in:
Chayapak Supasakul 2025-01-05 14:41:50 +07:00
parent 72260f23ad
commit 3be587d815
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA

View file

@ -17,6 +17,7 @@ import net.minecraft.util.math.BlockBox;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.dimension.DimensionType;
import org.slf4j.Logger;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
@ -214,11 +215,13 @@ public class CommandCore {
} }
public void run (String command) { public void run (String command) {
if (command.length() > 32767) return;
final ClientConnection connection = client.getNetworkHandler().getConnection(); final ClientConnection connection = client.getNetworkHandler().getConnection();
if (block == null) return; if (block == null) return;
System.out.println(command); ChipmunkMod.LOGGER.info("Executing core command: {}", command);
if (KaboomCheck.INSTANCE.isKaboom) { if (KaboomCheck.INSTANCE.isKaboom) {
connection.send( connection.send(