mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 04:35:50 +01:00
Trial a new method for fixing spawn body yaw, fix /npc rename not applying hologram name immediately
This commit is contained in:
parent
79f048fe0c
commit
284565598e
@ -48,6 +48,7 @@ import net.citizensnpcs.trait.ScoreboardTrait;
|
||||
import net.citizensnpcs.util.ChunkCoord;
|
||||
import net.citizensnpcs.util.Messages;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.PlayerAnimation;
|
||||
import net.citizensnpcs.util.PlayerUpdateTask;
|
||||
import net.citizensnpcs.util.Util;
|
||||
|
||||
@ -221,6 +222,15 @@ public class CitizensNPC extends AbstractNPC {
|
||||
updateFlyableState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
super.setName(name);
|
||||
|
||||
if (requiresNameHologram() && !hasTrait(HologramTrait.class)) {
|
||||
addTrait(HologramTrait.class);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean spawn(Location at) {
|
||||
return spawn(at, SpawnReason.PLUGIN);
|
||||
@ -261,6 +271,7 @@ public class CitizensNPC extends AbstractNPC {
|
||||
Bukkit.getPluginManager().callEvent(new NPCNeedsRespawnEvent(this, at));
|
||||
return false;
|
||||
}
|
||||
|
||||
// send skin packets, if applicable, before other NMS packets are sent
|
||||
SkinnableEntity skinnable = getEntity() instanceof SkinnableEntity ? ((SkinnableEntity) getEntity()) : null;
|
||||
if (skinnable != null) {
|
||||
@ -309,6 +320,12 @@ public class CitizensNPC extends AbstractNPC {
|
||||
if (getEntity() instanceof Player) {
|
||||
NMS.replaceTrackerEntry((Player) getEntity());
|
||||
PlayerUpdateTask.registerPlayer(getEntity());
|
||||
Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PlayerAnimation.ARM_SWING.play((Player) getEntity());
|
||||
}
|
||||
}, Setting.TABLIST_REMOVE_PACKET_DELAY.asLong());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176,6 +176,7 @@ public class WanderWaypointProvider
|
||||
Messaging.sendTr(sender, Messages.WANDER_WAYPOINTS_REGION_EDITING_START);
|
||||
} else {
|
||||
markers.destroyMarkers();
|
||||
Messaging.sendTr(sender, Messages.WANDER_WAYPOINTS_REGION_EDITING_STOP);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -187,7 +188,6 @@ public class WanderWaypointProvider
|
||||
currentGoal.setDelay(delay);
|
||||
}
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Messaging.sendTr(sender, Messages.WANDER_WAYPOINTS_DELAY_SET, delay);
|
||||
|
@ -383,6 +383,7 @@ public class Messages {
|
||||
public static final String WANDER_WAYPOINTS_INVALID_DELAY = "citizens.editors.waypoints.wander.invalid-delay";
|
||||
public static final String WANDER_WAYPOINTS_RANGE_SET = "citizens.editors.waypoints.wander.range-set";
|
||||
public static final String WANDER_WAYPOINTS_REGION_EDITING_START = "citizens.editors.waypoints.wander.editing-regions";
|
||||
public static final String WANDER_WAYPOINTS_REGION_EDITING_STOP = "citizens.editors.waypoints.wander.editing-regions-stop";
|
||||
public static final String WANDER_WAYPOINTS_REMOVED_REGION = "citizens.editors.waypoints.wander.removed-region";
|
||||
public static final String WANDER_WAYPOINTS_WORLDGUARD_REGION_NOT_FOUND = "citizens.editors.waypoints.wander.worldguard-region-not-found";
|
||||
public static final String WANDER_WAYPOINTS_WORLDGUARD_REGION_SET = "citizens.editors.waypoints.wander.worldguard-region-set";
|
||||
|
@ -320,6 +320,7 @@ citizens.editors.text.remove-prompt=Enter the index of the entry you wish to rem
|
||||
citizens.editors.text.removed-entry=[[Removed]] entry at index [[{0}]].
|
||||
citizens.editors.text.start-prompt=Type [[add]] to add an entry, [[edit]] to edit entries, [[remove]] to remove entries, [[close]] to toggle the NPC to send messages when players get close, [[item]] to set the talk item in hand pattern (set to [[default]] to clear), [[range]] to set the talking range, [[delay]] to set the talking delay in seconds and [[random]] to toggle the NPC as a random talker. Type [[help]] to show this again.
|
||||
citizens.editors.text.talk-item-set=[[Talk item pattern]] set to [[{0}]].
|
||||
citizens.editors.waypoints.wander.editing-regions-stop=Exited the region editor.
|
||||
citizens.editors.waypoints.wander.worldguard-region-not-found=WorldGuard region not found.
|
||||
citizens.editors.waypoints.wander.worldguard-region-set=WorldGuard region set to [[{0}]].
|
||||
citizens.editors.waypoints.wander.range-set=Wander range set to xrange [[{0}]] and yrange [[{1}]].
|
||||
|
@ -29,7 +29,7 @@ public class PlayerControllerLook {
|
||||
this.d = false;
|
||||
this.a.pitch = this.a(this.a.pitch, this.g(), this.c);
|
||||
this.a.aC = this.a(this.a.aC, this.h(), this.b);
|
||||
this.a.yaw = this.a.aC;
|
||||
this.a.yaw = this.a(this.a.aC, this.h(), this.b);
|
||||
while (this.a.aC >= 180F) {
|
||||
this.a.aC -= 360F;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user