MCPcopy Index your code
hub / github.com/GregTech6/gregtech6 / onChunkWatchEvent

Method onChunkWatchEvent

src/main/java/gregapi/GT_API_Proxy.java:918–931  ·  view source on GitHub ↗
(ChunkWatchEvent.Watch aEvent)

Source from the content-addressed store, hash-verified

916 }
917
918 @SubscribeEvent(priority = EventPriority.LOWEST)
919 public void onChunkWatchEvent(ChunkWatchEvent.Watch aEvent) {
920 Chunk tChunk = aEvent.player.worldObj.getChunkFromChunkCoords(aEvent.chunk.chunkXPos, aEvent.chunk.chunkZPos);
921 if (tChunk != null && tChunk.isTerrainPopulated) {
922 byte tIterations = 8;
923 HashSetNoNulls<Object> tSet = new HashSetNoNulls<>();
924 while (tIterations-->0) try {
925 for (Object tTileEntity : tChunk.chunkTileEntityMap.values()) if (tTileEntity instanceof ITileEntitySynchronising) if (tSet.add(tTileEntity)) ((ITileEntitySynchronising)tTileEntity).sendUpdateToPlayer(aEvent.player);
926 tIterations = 0;
927 } catch(ConcurrentModificationException e) {
928 if (tIterations <= 0) ERR.println("Failed to Iterate 8 times. Giving up on sending Data to Client!");
929 }
930 }
931 }
932
933 @SubscribeEvent(priority = EventPriority.LOWEST)
934 public void onPlayerDestroyItem(PlayerDestroyItemEvent aEvent) {

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
printlnMethod · 0.80
sendUpdateToPlayerMethod · 0.65

Tested by

no test coverage detected