mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 18:45:29 +01:00
Compare center
This commit is contained in:
parent
6b2440d8c3
commit
479e350f12
@ -40,7 +40,6 @@ import org.bukkit.entity.Villager.Profession;
|
||||
import org.bukkit.entity.Zombie;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
|
||||
@ -664,12 +663,12 @@ public class NPCCommands {
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "debug -p(aths) -n(avigation) -r(epathing)",
|
||||
usage = "debug -p(aths) -n(avigation)",
|
||||
desc = "Display debugging information",
|
||||
modifiers = { "debug" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
flags = "pnr",
|
||||
flags = "pn",
|
||||
permission = "citizens.npc.debug")
|
||||
@Requirements(ownership = true, selected = true)
|
||||
public void debug(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
@ -686,13 +685,6 @@ public class NPCCommands {
|
||||
+ npc.getNavigator().getDefaultParameters().speed() + "]]<br>";
|
||||
output += "Stuck action [[" + npc.getNavigator().getDefaultParameters().stuckAction() + "]]<br>";
|
||||
Messaging.send(sender, output);
|
||||
} else if (args.hasFlag('r')) {
|
||||
if (!npc.getEntity().hasMetadata("CitizensPrintMovements")) {
|
||||
npc.getEntity().setMetadata("CitizensPrintMovements",
|
||||
new FixedMetadataValue(CitizensAPI.getPlugin(), true));
|
||||
} else {
|
||||
npc.getEntity().removeMetadata("CitizensPrintMovements", CitizensAPI.getPlugin());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -720,10 +720,6 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
lastSpeed = params.speed();
|
||||
}
|
||||
if (entity.hasMetadata("CitizensPrintMovements")) {
|
||||
Path path = getPathEntity(navigation);
|
||||
Messaging.log("Next path node " + path.getNextNode().asVec3(), "wanted", getDestination(entity));
|
||||
}
|
||||
if (params.debug() && !navigation.isDone()) {
|
||||
BlockData data = Material.DANDELION.createBlockData();
|
||||
Path path = getPathEntity(navigation);
|
||||
|
@ -147,7 +147,7 @@ public class PlayerNavigation extends PathNavigation {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private boolean canWalkOn(int var0, int var1, int var2, int var3, int var4, int var5, Vec3 var6, double var7,
|
||||
double var9) {
|
||||
int var11 = var0 - var3 / 2;
|
||||
@ -283,9 +283,9 @@ public class PlayerNavigation extends PathNavigation {
|
||||
this.maxDistanceToWaypoint = (this.mob.getBbWidth() > 0.75F) ? (this.mob.getBbWidth() / 2.0F)
|
||||
: (0.75F - this.mob.getBbWidth() / 2.0F);
|
||||
BlockPos blockPos = this.path.getNextNodePos();
|
||||
double var2 = Math.abs(this.mob.getX() - blockPos.getX() + 0.5D);
|
||||
double var2 = Math.abs(this.mob.getX() - (blockPos.getX() + 0.5D));
|
||||
double var4 = Math.abs(this.mob.getY() - blockPos.getY());
|
||||
double var6 = Math.abs(this.mob.getZ() - blockPos.getZ() + 0.5D);
|
||||
double var6 = Math.abs(this.mob.getZ() - (blockPos.getZ() + 0.5D));
|
||||
boolean var8 = (var2 < this.maxDistanceToWaypoint && var6 < this.maxDistanceToWaypoint && var4 < 1.0D);
|
||||
if (var8 || (this.mob.canCutCorner((this.path.getNextNode()).type) && shouldTargetNextNodeInDirection(var0)))
|
||||
this.path.advance();
|
||||
|
Loading…
Reference in New Issue
Block a user