fix explosions
This commit is contained in:
parent
9dc0275e61
commit
3a77bb8551
9 changed files with 106 additions and 136 deletions
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue