SpawnLoc changes
+NoFall check
This commit is contained in:
@@ -112,6 +112,8 @@ public interface Terminator {
|
||||
void addVelocity(Vector velocity);
|
||||
|
||||
int getAliveTicks();
|
||||
|
||||
int getNoFallTicks();
|
||||
|
||||
boolean tickDelay(int ticks);
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ public class LegacyBlockCheck {
|
||||
}
|
||||
|
||||
public boolean tryPreMLG(Terminator bot, Location botLoc) {
|
||||
if(bot.isBotOnGround() || bot.getVelocity().getY() >= -0.8D)
|
||||
if(bot.isBotOnGround() || bot.getVelocity().getY() >= -0.8D || bot.getNoFallTicks() > 7)
|
||||
return false;
|
||||
if (tryPreMLG(bot, botLoc, 3))
|
||||
return true;
|
||||
|
||||
@@ -254,6 +254,11 @@ public class Bot extends ServerPlayer implements Terminator {
|
||||
public int getAliveTicks() {
|
||||
return aliveTicks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNoFallTicks() {
|
||||
return noFallTicks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean tickDelay(int i) {
|
||||
|
||||
@@ -315,8 +315,19 @@ public class BotCommand extends CommandInstance {
|
||||
sender.sendMessage("The spawn location has been reset to the player location.");
|
||||
return;
|
||||
}
|
||||
if (arg2.equalsIgnoreCase("playerloc")) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("You must be a player to do this!");
|
||||
return;
|
||||
}
|
||||
Location loc = ((Player)sender).getLocation();
|
||||
manager.setSpawnLoc(loc.clone());
|
||||
sender.sendMessage("The spawn location has been set to " + ChatColor.BLUE + formatter.format(loc.getX()) + ", " + formatter.format(loc.getY()) + ", " + formatter.format(loc.getZ()) + ChatColor.RESET + ".");
|
||||
return;
|
||||
}
|
||||
if (args.size() != 4) {
|
||||
sender.sendMessage("Incorrect argument size. Correct syntax: " + ChatColor.YELLOW + "/bot settings spawnloc <x> <y> <z>" + ChatColor.RESET);
|
||||
sender.sendMessage("Additionally, to specify a spawnloc at the current player position: " + ChatColor.YELLOW + "/bot settings spawnloc playerloc" + ChatColor.RESET);
|
||||
return;
|
||||
}
|
||||
double x, y, z;
|
||||
|
||||
Reference in New Issue
Block a user