Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Set<Block> createPortal(Location location){
- Set<Block> result = new HashSet<>();
- int[] offsetX = {-1,0,1};
- int[] offsetY = {0,1,2};
- for(int x : offsetX){
- for(int y : offsetY){
- Location loc = new Location(location.getWorld(), location.getX() + x, location.getY() + y, location.getZ());
- if(loc == null || loc.getBlock() == null) continue;
- loc.getBlock().setType(Material.WEB);
- result.add(loc.getBlock());
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement