use of com.almuradev.almura.feature.biome.network.ClientboundBiomeChunkDataPacket in project Almura by AlmuraDev.
the class MixinPlayerChunkMapEntry method redirectSendPacketRemove.
@Redirect(method = "removePlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/NetHandlerPlayServer;sendPacket(Lnet/minecraft/network/Packet;)V"))
private void redirectSendPacketRemove(NetHandlerPlayServer netHandlerPlayServer, Packet<?> packetIn) {
netHandlerPlayServer.sendPacket(packetIn);
network.sendTo((Player) netHandlerPlayServer.player, new ClientboundBiomeChunkDataPacket(ChunkPos.asLong(this.pos.x, this.pos.z)));
}
use of com.almuradev.almura.feature.biome.network.ClientboundBiomeChunkDataPacket 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.network.ClientboundBiomeChunkDataPacket 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