use of com.almuradev.almura.feature.biome.asm.mixin.iface.IMixinChunk in project Almura by AlmuraDev.
the class MixinPlayerChunkMapEntry method sendBiomeChunkThenRealChunkTo.
private void sendBiomeChunkThenRealChunkTo(NetHandlerPlayServer netHandlerPlayServer, Packet<?> packetIn) {
final SPacketChunkData chunkDataPacket = (SPacketChunkData) packetIn;
if (chunkDataPacket.isFullChunk()) {
final IMixinChunk mixinChunk = (IMixinChunk) this.chunk;
int[] extendedBiomeArray = mixinChunk.getExtendedBiomeArray();
if (extendedBiomeArray == null) {
extendedBiomeArray = mixinChunk.cacheRealBiomeIds();
}
final Player spongePlayer = (Player) netHandlerPlayServer.player;
network.sendTo(spongePlayer, new ClientboundBiomeChunkDataPacket(ChunkPos.asLong(this.chunk.x, this.chunk.z), extendedBiomeArray));
}
netHandlerPlayServer.sendPacket(packetIn);
}
use of com.almuradev.almura.feature.biome.asm.mixin.iface.IMixinChunk in project Almura by AlmuraDev.
the class MixinPlayerChunkMapEntry method sendBiomeChunkThenRealChunkToAll.
private void sendBiomeChunkThenRealChunkToAll(PlayerChunkMapEntry playerChunkMapEntry, Packet<?> packetIn) {
final SPacketChunkData chunkDataPacket = (SPacketChunkData) packetIn;
if (chunkDataPacket.isFullChunk()) {
final IMixinChunk mixinChunk = (IMixinChunk) this.chunk;
int[] extendedBiomeArray = mixinChunk.getExtendedBiomeArray();
if (extendedBiomeArray == null) {
extendedBiomeArray = mixinChunk.cacheRealBiomeIds();
}
final ClientboundBiomeChunkDataPacket biomePacket = new ClientboundBiomeChunkDataPacket(ChunkPos.asLong(this.chunk.x, this.chunk.z), extendedBiomeArray);
if (this.sentToPlayers) {
for (EntityPlayerMP player : this.players) {
network.sendTo((Player) player, biomePacket);
}
}
}
playerChunkMapEntry.sendPacket(packetIn);
}
Aggregations