mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-22 05:02:17 +00:00
Upon clicking on a chunk in MeanTime overlay, the client receive a list of entities for this chunk.
Added a ISerializable interface to make it easier to send/receive complex packets.
This commit is contained in:
1 parent
f9fb81aa26
commit
f49abc3ecb
10 files changed
+186
-22
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package mcp.mobius.opis.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -17,14 +18,13 @@ public class TileEntitiesData {
|
||||
|
||||
if (!(references.containsKey(coord))){
|
||||
references.put(coord, te.getClass());
|
||||
stats.put(coord, new TileEntityStatsData());
|
||||
stats.put(coord, new TileEntityStatsData(coord, te.getClass().getName()));
|
||||
}
|
||||
|
||||
stats.get(coord).addMeasure(timing);
|
||||
}
|
||||
|
||||
public static HashMap<CoordinatesChunk, ChunkStatsData> getTimes(int dim){
|
||||
|
||||
HashMap<CoordinatesChunk, ChunkStatsData> chunks = new HashMap<CoordinatesChunk, ChunkStatsData>();
|
||||
|
||||
for (CoordinatesBlock coord : TileEntitiesData.stats.keySet()){
|
||||
@@ -36,12 +36,19 @@ public class TileEntitiesData {
|
||||
|
||||
chunks.get(coordC).nentities += 1;
|
||||
chunks.get(coordC).updateTime += stats.get(coord).getGeometricMean();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return chunks;
|
||||
}
|
||||
|
||||
|
||||
public static ArrayList<TileEntityStatsData> getInChunk(CoordinatesChunk coord){
|
||||
ArrayList<TileEntityStatsData> returnList = new ArrayList<TileEntityStatsData>();
|
||||
|
||||
for (CoordinatesBlock tecoord : TileEntitiesData.stats.keySet()){
|
||||
if (coord.equals(new CoordinatesChunk(tecoord)))
|
||||
returnList.add(TileEntitiesData.stats.get(tecoord));
|
||||
}
|
||||
|
||||
return returnList;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user