1
0
Fork 0

fix explosions

This commit is contained in:
Sen 2025-08-27 12:30:45 +02:00
parent 9dc0275e61
commit 3a77bb8551
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
9 changed files with 106 additions and 136 deletions

View file

@ -285,6 +285,7 @@ public class CommandEnvironment {
this.registerExecutable(new CommandSeason());
this.registerExecutable(new CommandCamera());
this.registerExecutable(new CommandNocam());
this.registerExecutable(new CommandExplode());
this.registerExecutable(new CommandSet());
}

View file

@ -0,0 +1,32 @@
package server.command.commands;
import common.util.ExtMath;
import common.util.Vec3;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
import server.world.WorldServer;
public class CommandExplode extends Command {
public CommandExplode() {
super("explode");
this.addVector("position", true, false);
this.addWorld("dim", true);
this.setParamsOptional();
this.addInt("radius", 'r', 1, 1024, 4);
this.addFlag("ticked", 't');
this.addFlag("fire", 'f');
this.addFlag("noblocks", 'n');
this.addFlag("altsound", 'a');
}
public void exec(CommandEnvironment env, Executor exec, Vec3 pos, WorldServer world, int radius, boolean ticked, boolean fire, boolean noblocks, boolean altsound) {
if(ticked)
world.newExplosion(pos.xCoord, pos.yCoord, pos.zCoord, radius);
else
world.newExplosion(null, pos.xCoord, pos.yCoord, pos.zCoord, radius, fire, !noblocks, altsound);
exec.log("Explosion bei %d, %d, %d in %s erzeugt", ExtMath.floord(pos.xCoord), ExtMath.floord(pos.yCoord), ExtMath.floord(pos.zCoord), world.dimension.getDisplay());
}
}