mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-28 02:01:35 +01:00
Entities don't spawn instantly
This commit is contained in:
parent
ad6b47348c
commit
92cb74b7eb
@ -750,6 +750,7 @@ public class HologramTrait extends Trait {
|
||||
public abstract static class SingleEntityHologramRenderer implements HologramRenderer {
|
||||
protected NPC hologram;
|
||||
private NPCRegistry registry;
|
||||
private int spawnWaitTicks;
|
||||
protected String text;
|
||||
protected int viewRange = -1;
|
||||
|
||||
@ -780,10 +781,13 @@ public class HologramTrait extends Trait {
|
||||
|
||||
@Override
|
||||
public void render(NPC npc, Vector3d offset) {
|
||||
if (getEntities().isEmpty()) {
|
||||
if (getEntities().isEmpty() && spawnWaitTicks-- <= 0) {
|
||||
destroy();
|
||||
spawnHologram(npc, offset);
|
||||
spawnWaitTicks = 5;
|
||||
}
|
||||
if (!hologram.isSpawned())
|
||||
return;
|
||||
render0(npc, offset);
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,8 @@ public class HomeTrait extends Trait {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!npc.isSpawned() || location == null || npc.getStoredLocation().distance(location) < 0.1
|
||||
|| npc.getNavigator().isNavigating()) {
|
||||
if (!npc.isSpawned() || location == null || npc.getNavigator().isNavigating()
|
||||
|| npc.getStoredLocation().distance(location) < 0.1) {
|
||||
t = 0;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user