mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-27 02:21:20 +01:00
Fix shulker bullets with lookclose on
This commit is contained in:
parent
b20113e1f1
commit
b2f841a40e
@ -190,7 +190,7 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||
t--;
|
||||
if (lookingAt != null && canSeeTarget()) {
|
||||
Util.faceEntity(npc.getEntity(), lookingAt);
|
||||
if (npc.getEntity().getType().name().toLowerCase().contains("shulker")) {
|
||||
if (npc.getEntity().getType().name().equals("SHULKER")) {
|
||||
NMS.setPeekShulker(npc.getEntity(), 100 - (int) Math
|
||||
.floor(npc.getStoredLocation().distanceSquared(lookingAt.getLocation(PLAYER_LOCATION))));
|
||||
}
|
||||
|
@ -505,13 +505,13 @@ public class LinearWaypointProvider implements EnumerableWaypointProvider {
|
||||
}
|
||||
|
||||
public void setPaused(boolean pause) {
|
||||
paused = pause;
|
||||
if (pause && currentDestination != null) {
|
||||
selector.finish();
|
||||
if (npc != null && npc.getNavigator().isNavigating()) {
|
||||
npc.getNavigator().cancelNavigation();
|
||||
}
|
||||
}
|
||||
paused = pause;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,11 +32,11 @@ public class DelayTrigger implements WaypointTrigger {
|
||||
@Override
|
||||
public void onWaypointReached(NPC npc, Location waypoint) {
|
||||
if (delay > 0) {
|
||||
scheduleTask(npc.getOrAddTrait(Waypoints.class).getCurrentProvider());
|
||||
delay(npc.getOrAddTrait(Waypoints.class).getCurrentProvider());
|
||||
}
|
||||
}
|
||||
|
||||
private void scheduleTask(final WaypointProvider provider) {
|
||||
private void delay(final WaypointProvider provider) {
|
||||
provider.setPaused(true);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user