Source:
private static void activateChunkTileEntities(final List<EntityPlayerMP> players, final Chunk chunk) { final long currentTick = SpongeImpl.getServer().getTickCounter(); for (final Map.Entry<BlockPos, TileEntity> mapEntry : chunk.getTileEntityMap().entrySet()) { final TileEntity tileEntity = mapEntry.getValue(); final ActivationCapability spongeTileEntity = (ActivationCapability) tileEntity; if (spongeTileEntity.activation$getSpongeTickRate() <= 0 || !((TileEntityBridge) tileEntity).bridge$shouldTick()) { continue; } if (!(tileEntity instanceof ITickable) || spongeTileEntity.activation$getActivatedTick() == currentTick) { continue; } final Vector3i tilePos = VecHelper.toVector3i(tileEntity.getPos()); if (currentTick > ((ActivationCapability) tileEntity).activation$getActivatedTick()) { if (spongeTileEntity.activation$getDefaultActivationState()) { ((ActivationCapability) tileEntity).activation$setActivatedTick(currentTick); continue; } if (spongeTileEntity.activation$requiresActivationCacheRefresh()) { TileEntityActivation.initializeTileEntityActivationState(tileEntity); spongeTileEntity.activation$requiresActivationCacheRefresh(false); } final int bbActivationRange = ((ActivationCapability) tileEntity).activation$getActivationRange(); for (EntityPlayerMP player : players) { final Vector3i playerPos = VecHelper.toVector3i(player.getPosition()); final int blockDistance = Math.round(tilePos.distance(playerPos)); if (blockDistance <= bbActivationRange) { ((ActivationCapability) tileEntity).activation$setActivatedTick(currentTick); break; } } } } }

Target:
private static void activateChunkTileEntities(final List<EntityPlayerMP> players, final Chunk chunk) { final long currentTick = SpongeImpl.getServer().getTickCounter(); for (final Map.Entry<BlockPos, TileEntity> mapEntry : chunk.getTileEntityMap().entrySet()) { final TileEntity tileEntity = mapEntry.getValue(); final ActivationCapability spongeTileEntity = (ActivationCapability) tileEntity; if (spongeTileEntity.activation$getSpongeTickRate() <= 0 || !((TileEntityBridge) tileEntity).bridge$shouldTick()) { continue; } if (!(tileEntity instanceof ITickable) || spongeTileEntity.activation$getActivatedTick() == currentTick) { continue; } final Vector3i tilePos = VecHelper.toVector3i(tileEntity.getPos()); if (currentTick > ((ActivationCapability) tileEntity).activation$getActivatedTick()) { if (spongeTileEntity.activation$getDefaultActivationState()) { ((ActivationCapability) tileEntity).activation$setActivatedTick(currentTick); continue; } if (spongeTileEntity.activation$requiresActivationCacheRefresh()) { TileEntityActivation.initializeTileEntityActivationState(tileEntity); spongeTileEntity.activation$requiresActivationCacheRefresh(false); } final int activationRange = ((ActivationCapability) tileEntity).activation$getActivationRange(); final int bbActivationRange = activationRange * activationRange; for (EntityPlayerMP player : players) { final Vector3i playerPos = VecHelper.toVector3i(player.getPosition()); final int blockDistance = tilePos.distanceSquared(playerPos); if (blockDistance <= bbActivationRange) { ((ActivationCapability) tileEntity).activation$setActivatedTick(currentTick); break; } } } } }