@SubscribeEvent public void onBlockPlaceEvent(BlockEvent.PlaceEvent event) { float blocker = RadiationShieldRegistry.getBlocker(event.block); if (blocker >= 0.99f) { return; } World world = event.blockSnapshot.world; DRRadiationManager radiationManager = DRRadiationManager.getManager(world); Map<GlobalCoordinate, DRRadiationManager.RadiationSource> radiationSources = radiationManager.getRadiationSources(); if (radiationSources.isEmpty()) { return; } int x = event.blockSnapshot.x; int y = event.blockSnapshot.y; int z = event.blockSnapshot.z; for (Map.Entry<GlobalCoordinate, DRRadiationManager.RadiationSource> entry : radiationSources.entrySet()) { DRRadiationManager.RadiationSource source = entry.getValue(); float radius = source.getRadius(); GlobalCoordinate gc = entry.getKey(); Coordinate c = gc.getCoordinate(); if (Math.abs(c.getX() - x) < radius && Math.abs(c.getY() - y) < radius && Math.abs(c.getZ() - z) < radius) { Logging.logDebug("Add blocker at: " + x + "," + y + "," + z); QuadTree radiationTree = source.getRadiationTree(world, c.getX(), c.getY(), c.getZ()); radiationTree.addBlocker(x, y, z, blocker); } } }