Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Region{
- public int minX;
- public int minY;
- public int minZ;
- public int maxX;
- public int maxY;
- public int maxZ;
- public World world;
- public Region(Location loc1,Location loc2){
- this.minX = Math.min(loc1.getBlockX(), loc2.getBlockX());
- this.minY = Math.min(loc1.getBlockY(), loc2.getBlockY());
- this.minZ = Math.min(loc1.getBlockZ(), loc2.getBlockZ());
- this.maxX = Math.max(loc1.getBlockX(), loc2.getBlockX());
- this.maxY = Math.max(loc1.getBlockY(), loc2.getBlockY());
- this.maxZ = Math.max(loc1.getBlockZ(), loc2.getBlockZ());
- this.world = loc1.getWorld();
- }
- public void setMap() {
- Map<String,Object> o = new HashMap<String,Object>();
- o.put("minX", this.minX);
- o.put("minY", this.minY);
- o.put("minZ", this.minZ);
- o.put("maxX", this.maxX);
- o.put("maxY", this.maxY);
- o.put("maxZ", this.maxZ);
- o.put("welt", this.world);
- }
- public boolean isInside(Location loc){
- if(loc.getWorld() != this.world){
- return false;
- }
- if ((loc.getBlockX() <= this.minX) || (loc.getBlockX() >= this.maxX) || (loc.getBlockY() <= this.minY) || (loc.getBlockY() >= this.maxY) || (loc.getBlockZ() <= this.minZ) || (loc.getBlockZ() >= this.maxZ)){
- return true;
- }
- return false;
- }
- public void setBlocks(Location loc){
- for(int x = this.minX; x < loc.getBlockX(); x++){
- for(int y = 1; y <= 256; y++){
- for(int z = this.minZ; z < loc.getBlockZ(); z++){
- this.world.getBlockAt(x,y,z).setType(Material.GLASS);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment