Skip to content

Commit

Permalink
fix showfake on out-of-range players
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 29, 2020
1 parent fc34a6c commit 4cef270
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Expand Up @@ -57,7 +57,7 @@ public void onDespawn() {
return;
}
if (npc.getEntity().getVehicle() != null) {
npc.getEntity().getVehicle().setPassenger(null);
npc.getEntity().getVehicle().eject();
}
}

Expand Down Expand Up @@ -106,7 +106,7 @@ private void standInternal() {
npc.despawn();
npc.spawn(npc.getStoredLocation().clone().add(0, 0.5, 0));
if (vehicle != null && vehicle.isValid()) {
vehicle.setPassenger(null);
vehicle.eject();
vehicle.remove();
}
}
Expand Down
Expand Up @@ -131,12 +131,11 @@ private void updateBlock(MaterialTag material, DurationTag duration) {
currentTask.cancel();
}
this.material = material;
if (!player.hasChunkLoaded(location.getChunk())) {
return;
}
material.getModernData().sendFakeChangeTo(player.getPlayerEntity(), location);
if (material.getMaterial().name().endsWith("_BANNER")) { // Banners are weird
location.getWorld().refreshChunk(chunkCoord.x, chunkCoord.z);
if (player.hasChunkLoaded(location.getChunk())) {
material.getModernData().sendFakeChangeTo(player.getPlayerEntity(), location);
if (material.getMaterial().name().endsWith("_BANNER")) { // Banners are weird
location.getWorld().refreshChunk(chunkCoord.x, chunkCoord.z);
}
}
if (duration != null && duration.getTicks() > 0) {
currentTask = new BukkitRunnable() {
Expand Down

0 comments on commit 4cef270

Please sign in to comment.