use of ivorius.reccomplex.block.TileEntityBlockScript in project RecurrentComplex by Ivorforce.
the class PacketWorldDataHandler method processServer.
@Override
public void processServer(PacketWorldData message, MessageContext ctx, WorldServer world) {
BlockPos origin = message.source;
BlockArea area = new BlockArea(message.capturePoint1.add(origin), message.capturePoint2.add(origin));
// Send captured back
IvWorldData worldData = IvWorldData.capture(world, area, true);
// Unsupported because of recursion and TE scripts not working anyway
worldData.tileEntities.removeIf(te -> TileEntity.create(world, te) instanceof TileEntityBlockScript);
PacketWorldData packet = new PacketWorldData(worldData.createTagCompound(), origin, message.capturePoint1, message.capturePoint2);
RecurrentComplex.network.sendTo(packet, ctx.getServerHandler().player);
if (message.worldData != null) {
GenericStructure structure = new GenericStructure();
structure.worldDataCompound = message.worldData;
new StructureGenerator<>(structure).world(world).lowerCoord(message.capturePoint1.add(origin)).generationPredicate(p -> !p.equals(origin)).generate();
}
}
Aggregations