use of net.minecraft.client.multiplayer.ClientChunkProvider in project endergetic by team-abnormals.
the class ClientWorldMixin method updateEntityRiddenBalloons.
@SuppressWarnings("deprecation")
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;rideTick()V", shift = At.Shift.AFTER), method = "tickPassenger")
private void updateEntityRiddenBalloons(Entity ridingEntity, Entity passenger, CallbackInfo info) {
BalloonHolder balloonHolder = (BalloonHolder) passenger;
ClientChunkProvider chunkProvider = ((ClientWorld) (Object) this).getChunkSource();
for (BolloomBalloonEntity balloon : balloonHolder.getBalloons()) {
if (!balloon.removed && balloon.getAttachedEntity() == passenger) {
if (chunkProvider.isEntityTickingChunk(balloon)) {
balloon.setPosAndOldPos(balloon.getX(), balloon.getY(), balloon.getZ());
balloon.yRotO = balloon.yRot;
balloon.xRotO = balloon.xRot;
if (balloon.inChunk) {
balloon.tickCount++;
balloon.updateAttachedPosition();
}
this.callUpdateChunkPos(balloon);
}
} else {
balloon.detachFromEntity();
}
}
}
use of net.minecraft.client.multiplayer.ClientChunkProvider in project endergetic by team-abnormals.
the class ClientWorldMixin method updateBalloons.
@SuppressWarnings("deprecation")
@Inject(at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;inChunk:Z", ordinal = 1, shift = At.Shift.AFTER), method = "tickNonPassenger")
private void updateBalloons(Entity entity, CallbackInfo info) {
BalloonHolder balloonHolder = (BalloonHolder) entity;
ClientChunkProvider chunkProvider = ((ClientWorld) (Object) this).getChunkSource();
for (BolloomBalloonEntity balloon : balloonHolder.getBalloons()) {
if (!balloon.removed && balloon.getAttachedEntity() == entity) {
if (chunkProvider.isEntityTickingChunk(balloon)) {
balloon.setPosAndOldPos(balloon.getX(), balloon.getY(), balloon.getZ());
balloon.yRotO = balloon.yRot;
balloon.xRotO = balloon.xRot;
if (balloon.inChunk) {
balloon.tickCount++;
balloon.updateAttachedPosition();
}
this.callUpdateChunkPos(balloon);
}
} else {
balloon.detachFromEntity();
}
}
}
Aggregations