use of micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityAstroMiner in project Galacticraft by micdoodle8.
the class AsteroidsTickHandlerServer method onWorldTick.
@SubscribeEvent
public void onWorldTick(WorldTickEvent event) {
if (event.phase == Phase.END) {
int index = -1;
for (EntityAstroMiner miner : activeMiners) {
index++;
if (miner.isDead) {
// minerIt.remove(); Don't remove it, we want the index number to be static for the others
continue;
}
if (miner.playerMP != null && miner.worldObj == event.world) {
try {
if (droppedChunks == null) {
Class clazz = ((WorldServer) miner.worldObj).theChunkProviderServer.getClass();
droppedChunks = clazz.getDeclaredField(GCCoreUtil.isDeobfuscated() ? "droppedChunksSet" : "field_73248_b");
}
Set<Long> undrop = (Set<Long>) droppedChunks.get(((WorldServer) miner.worldObj).theChunkProviderServer);
undrop.remove(ChunkCoordIntPair.chunkXZ2Int(miner.chunkCoordX, miner.chunkCoordZ));
} catch (Exception ignore) {
}
}
}
}
}
Aggregations