    001package net.minecraft.block;
    002
    003import net.minecraft.dispenser.IBlockSource;
    004import net.minecraft.tileentity.TileEntity;
    005import net.minecraft.world.World;
    006
    007public class BlockSourceImpl implements IBlockSource
    008{
    009    private final World worldObj;
    010    private final int xPos;
    011    private final int yPos;
    012    private final int zPos;
    013
    014    public BlockSourceImpl(World par1World, int par2, int par3, int par4)
    015    {
    016        this.worldObj = par1World;
    017        this.xPos = par2;
    018        this.yPos = par3;
    019        this.zPos = par4;
    020    }
    021
    022    public World getWorld()
    023    {
    024        return this.worldObj;
    025    }
    026
    027    public double getX()
    028    {
    029        return (double)this.xPos + 0.5D;
    030    }
    031
    032    public double getY()
    033    {
    034        return (double)this.yPos + 0.5D;
    035    }
    036
    037    public double getZ()
    038    {
    039        return (double)this.zPos + 0.5D;
    040    }
    041
    042    public int getXInt()
    043    {
    044        return this.xPos;
    045    }
    046
    047    public int getYInt()
    048    {
    049        return this.yPos;
    050    }
    051
    052    public int getZInt()
    053    {
    054        return this.zPos;
    055    }
    056
    057    public int getBlockMetadata()
    058    {
    059        return this.worldObj.getBlockMetadata(this.xPos, this.yPos, this.zPos);
    060    }
    061
    062    public TileEntity getBlockTileEntity()
    063    {
    064        return this.worldObj.getBlockTileEntity(this.xPos, this.yPos, this.zPos);
    065    }
    066}