Skip to content

Commit

Permalink
Ensure target chunk is loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Oct 17, 2024
1 parent 49bdc4a commit e00f49e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@ public boolean canCollideWithBukkit(Entity entity) {
Bukkit.getPluginManager().callEvent(event);
}

@Inject(method = "setPosRaw", at = @At("RETURN"))
private void banner$setPosRaw(double x, double y, double z, CallbackInfo ci) {
if (!this.level.isClientSide && !this.isRemoved()) this.level.getChunk((int) Math.floor(x) >> 4, (int) Math.floor(z) >> 4); // Banner - ensure target chunk is loaded.
}

@Inject(method = "setRot", at = @At(value = "HEAD"))
public void banner$infCheck(float yaw, float pitch, CallbackInfo ci) {
// CraftBukkit start - yaw was sometimes set to NaN, so we need to set it back to 0
Expand Down

0 comments on commit e00f49e

Please sign in to comment.