mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Use teleportcause
This commit is contained in:
parent
22e1821f24
commit
a09a54d4da
@ -326,7 +326,7 @@ public class CitizensNPC extends AbstractNPC {
|
||||
skinnable.getSkinTracker().onSpawnNPC();
|
||||
}
|
||||
|
||||
getEntity().teleport(at);
|
||||
teleport(at, TeleportCause.PLUGIN);
|
||||
|
||||
NMS.setHeadYaw(getEntity(), at.getYaw());
|
||||
NMS.setBodyYaw(getEntity(), at.getYaw());
|
||||
@ -468,8 +468,8 @@ public class CitizensNPC extends AbstractNPC {
|
||||
|
||||
if (navigator.isNavigating()) {
|
||||
if (data().get(NPC.Metadata.SWIMMING, true)) {
|
||||
getEntity().setVelocity(getEntity().getVelocity().multiply(data()
|
||||
.get(NPC.Metadata.WATER_SPEED_MODIFIER, Setting.NPC_WATER_SPEED_MODIFIER.asFloat())));
|
||||
getEntity().setVelocity(getEntity().getVelocity().multiply(
|
||||
data().get(NPC.Metadata.WATER_SPEED_MODIFIER, Setting.NPC_WATER_SPEED_MODIFIER.asFloat())));
|
||||
Location currentDest = navigator.getPathStrategy().getCurrentDestination();
|
||||
if (currentDest == null || currentDest.getY() > getStoredLocation().getY()) {
|
||||
NMS.trySwim(getEntity());
|
||||
|
@ -154,23 +154,11 @@ public class CitizensNPCRegistry implements NPCRegistry {
|
||||
|
||||
@Override
|
||||
public NPC getByUniqueId(UUID uuid) {
|
||||
if (uuid.version() == 2) {
|
||||
long msb = uuid.getMostSignificantBits();
|
||||
msb &= ~0x0000000000002000L;
|
||||
msb |= 0x0000000000004000L;
|
||||
uuid = new UUID(msb, uuid.getLeastSignificantBits());
|
||||
}
|
||||
return uniqueNPCs.get(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NPC getByUniqueIdGlobal(UUID uuid) {
|
||||
if (uuid.version() == 2) {
|
||||
long msb = uuid.getMostSignificantBits();
|
||||
msb &= ~0x0000000000002000L;
|
||||
msb |= 0x0000000000004000L;
|
||||
uuid = new UUID(msb, uuid.getLeastSignificantBits());
|
||||
}
|
||||
NPC npc = getByUniqueId(uuid);
|
||||
if (npc != null)
|
||||
return npc;
|
||||
|
@ -54,9 +54,9 @@ public class PacketNPC extends Trait {
|
||||
public static interface EntityPacketTracker extends Runnable {
|
||||
public void link(Player player);
|
||||
|
||||
public void unlinkAll(Consumer<Player> callback);
|
||||
|
||||
public void unlink(Player player);
|
||||
|
||||
public void unlinkAll(Consumer<Player> callback);
|
||||
}
|
||||
|
||||
private class PacketController implements EntityController {
|
||||
|
Loading…
Reference in New Issue
Block a user