use of micdoodle8.mods.galacticraft.planets.venus.tile.TileEntitySolarTransmitter in project Galacticraft by micdoodle8.
the class VenusTickHandlerServer method onServerTick.
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
// Prevent issues when clients switch to LAN servers
if (server == null) {
return;
}
if (event.phase == Phase.END) {
for (SolarModuleNetwork network : new ArrayList<>(solarModuleNetworks)) {
if (!network.getTransmitters().isEmpty()) {
// network.tickEnd();
} else {
solarModuleNetworks.remove(network);
}
}
int maxPasses = 10;
while (!solarTransmitterUpdates.isEmpty()) {
LinkedList<TileEntitySolarTransmitter> pass = new LinkedList<>();
pass.addAll(solarTransmitterUpdates);
solarTransmitterUpdates.clear();
for (TileEntitySolarTransmitter newTile : pass) {
if (!newTile.isInvalid()) {
newTile.refresh();
}
}
if (--maxPasses <= 0) {
break;
}
}
}
}
Aggregations