mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-20 04:09:41 +00:00
TileEnt & Ent amounts are now real time
This commit is contained in:
1 parent
b4ca0fedd0
commit
2da495d0a8
4 files changed
+21
-4
No files matched your search
@@ -327,4 +327,12 @@ public class EntityManager {
|
||||
return outList;
|
||||
}
|
||||
|
||||
public static int getAmountEntities(){
|
||||
int amountEntities = 0;
|
||||
for (WorldServer world : DimensionManager.getWorlds()){
|
||||
amountEntities += world.loadedEntityList.size();
|
||||
}
|
||||
return amountEntities;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
public class TileEntityManager {
|
||||
@@ -174,4 +175,12 @@ public class TileEntityManager {
|
||||
|
||||
return outModStats;
|
||||
}
|
||||
|
||||
public static int getAmountTileEntities(){
|
||||
int amountTileEntities = 0;
|
||||
for (WorldServer world : DimensionManager.getWorlds()){
|
||||
amountTileEntities += world.loadedTileEntityList.size();
|
||||
}
|
||||
return amountTileEntities;
|
||||
}
|
||||
}
|
||||
@@ -77,9 +77,11 @@ public class OpisServerTickHandler implements ITickHandler {
|
||||
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataValue.create(Message.VALUE_AMOUNT_UPLOAD, new SerialLong(PacketProfiler.instance().dataSizeOut)));
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataValue.create(Message.VALUE_AMOUNT_DOWNLOAD, new SerialLong(PacketProfiler.instance().dataSizeIn)));
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataValue.create(Message.VALUE_CHUNK_FORCED, new SerialInt(ChunkManager.getForcedChunkAmount())));
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataValue.create(Message.VALUE_CHUNK_LOADED, new SerialInt(ChunkManager.getLoadedChunkAmount())));
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataValue.create(Message.VALUE_CHUNK_FORCED, new SerialInt(ChunkManager.getForcedChunkAmount())));
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataValue.create(Message.VALUE_CHUNK_LOADED, new SerialInt(ChunkManager.getLoadedChunkAmount())));
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataValue.create(Message.VALUE_TIMING_TICK, TickProfiler.instance().stats));
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataValue.create(Message.VALUE_AMOUNT_TILEENTS, new SerialInt(TileEntityManager.getAmountTileEntities())));
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataValue.create(Message.VALUE_AMOUNT_ENTITIES, new SerialInt(EntityManager.getAmountEntities())));
|
||||
|
||||
OpisPacketHandler.sendPacketToAllSwing(Packet_DataList.create(Message.LIST_PLAYERS, EntityManager.getAllPlayers()));
|
||||
|
||||
|
||||
@@ -358,8 +358,6 @@ public class OpisPacketHandler implements IPacketHandler {
|
||||
OpisPacketHandler.validateAndSend(Packet_DataValue.create(Message.VALUE_TIMING_WORLDTICK, totalWorldTick), player);
|
||||
OpisPacketHandler.validateAndSend(Packet_DataValue.create(Message.VALUE_TIMING_ENTUPDATE, totalEntUpdate), player);
|
||||
|
||||
OpisPacketHandler.validateAndSend(Packet_DataValue.create(Message.VALUE_AMOUNT_TILEENTS, new SerialInt(TileEntityManager.stats.size())), player);
|
||||
OpisPacketHandler.validateAndSend(Packet_DataValue.create(Message.VALUE_AMOUNT_ENTITIES, new SerialInt(EntityManager.stats.size())), player);
|
||||
OpisPacketHandler.validateAndSend(Packet_DataValue.create(Message.VALUE_AMOUNT_HANDLERS, new SerialInt(TickHandlerManager.startStats.size())), player);
|
||||
|
||||
OpisPacketHandler.validateAndSend(Packet_DataValue.create(Message.STATUS_TIME_LAST_RUN, new SerialLong(ProfilerRegistrar.timeStampLastRun)), player);
|
||||
|
||||
Reference in new issue
Block a user