2015-07-07 11:51:05 +02:00
|
|
|
package ellpeck.actuallyadditions.util;
|
|
|
|
|
2015-07-07 12:49:34 +02:00
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2015-07-07 11:51:05 +02:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
|
|
public class WorldPos{
|
|
|
|
|
|
|
|
private int x;
|
|
|
|
private int y;
|
|
|
|
private int z;
|
|
|
|
private World world;
|
|
|
|
|
|
|
|
public WorldPos(World world, int x, int y, int z){
|
|
|
|
this.world = world;
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
this.z = z;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getX(){
|
|
|
|
return this.x;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getY(){
|
|
|
|
return this.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getZ(){
|
|
|
|
return this.z;
|
|
|
|
}
|
|
|
|
|
|
|
|
public World getWorld(){
|
|
|
|
return this.world;
|
|
|
|
}
|
2015-07-07 12:49:34 +02:00
|
|
|
|
|
|
|
public Block getBlock(){
|
|
|
|
return this.world != null ? this.world.getBlock(this.x, this.y, this.z) : null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public TileEntity getTileEntity(){
|
|
|
|
return this.world != null ? this.world.getTileEntity(this.x, this.y, this.z) : null;
|
|
|
|
}
|
2015-07-07 14:32:10 +02:00
|
|
|
|
|
|
|
public boolean isEqual(WorldPos pos){
|
|
|
|
return pos != null && this.x == pos.getX() && this.y == pos.getY() && this.z == pos.getZ() && this.world == pos.getWorld();
|
|
|
|
}
|
|
|
|
|
|
|
|
public WorldPos copy(){
|
|
|
|
return new WorldPos(this.world, this.x, this.y, this.z);
|
|
|
|
}
|
2015-07-07 11:51:05 +02:00
|
|
|
}
|