Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int radius = BlocksRadius.get(key);
- Location location = event.getEntity().getLocation();
- World world = location.getWorld();
- HashSet<Block> blocklist = new HashSet<Block>();
- for (int x = -(radius); x <= radius; x ++) {
- for (int y = -(radius); y <= radius; y ++) {
- for (int z = -(radius); z <= radius; z ++) {
- Block b = location.getWorld().getBlockAt(x + location.getBlockX(), y + location.getBlockY(), z + location.getBlockZ());
- blocklist.add(b);
- }
- }
- }
- for(Block b: blocklist) {
- Integer[] pairs = BlockPairs.get(key);
- if(b.getTypeId() == pairs[0]) {
- world.getBlockAt(b.getLocation()).setTypeId(pairs[1]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement