Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public Set<Block> createPortal(Location location){
  2. Set<Block> result = new HashSet<>();
  3.  
  4. int[] offsetX = {-1,0,1};
  5. int[] offsetY = {0,1,2};
  6.  
  7. for(int x : offsetX){
  8. for(int y : offsetY){
  9. Location loc = new Location(location.getWorld(), location.getX() + x, location.getY() + y, location.getZ());
  10. if(loc == null || loc.getBlock() == null) continue;
  11. loc.getBlock().setType(Material.WEB);
  12. result.add(loc.getBlock());
  13. }
  14. }
  15. return result;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement