use of net.minecraft.client.multiplayer.ChunkProviderClient in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class PhysicsObject method unload.
void unload() {
watchingPlayers.clear();
if (!getWorld().isRemote) {
ChunkProviderServer provider = (ChunkProviderServer) getWorld().getChunkProvider();
for (ChunkPos chunkPos : getChunkClaim()) {
provider.queueUnload(claimedChunkCache.getChunkAt(chunkPos.x, chunkPos.z));
}
} else {
ChunkProviderClient provider = (ChunkProviderClient) getWorld().getChunkProvider();
for (ChunkPos chunkPos : getChunkClaim()) {
provider.unloadChunk(chunkPos.x, chunkPos.z);
}
getShipRenderer().killRenderers();
}
}
use of net.minecraft.client.multiplayer.ChunkProviderClient in project blockbuster by mchorse.
the class ClientHandlerStructure method createListFromTemplate.
/**
* This method creates a renderable display list which allows
* rendering fully baked into a display list.
*
* This was harder than I thought...
*/
@SideOnly(Side.CLIENT)
private StructureRenderer createListFromTemplate(PacketStructure message) {
Profiler profiler = new Profiler();
Template template = new Template();
PlacementSettings placement = new PlacementSettings();
WorldSettings settings = new WorldSettings(0, GameType.CREATIVE, true, false, WorldType.DEFAULT);
WorldInfo info = new WorldInfo(settings, message.name);
WorldProvider provider = new WorldProviderSurface();
FakeWorld world = new FakeWorld(null, info, provider, profiler, true);
provider.setWorld(world);
template.read(message.tag);
BlockPos origin = new BlockPos(1, 1, 1);
int w = template.getSize().getX();
int d = template.getSize().getZ();
for (int x = 0, cx = (w + 2) / 16 + 1; x < cx; x++) {
for (int z = 0, cz = (d + 2) / 16 + 1; z < cz; z++) {
((ChunkProviderClient) world.getChunkProvider()).loadChunk(x, z);
}
}
template.addBlocksToWorld(world, origin, placement);
return new StructureRenderer(template.getSize(), world);
}
Aggregations