| 7 | import net.minecraft.world.World; |
| 8 | |
| 9 | public class BlockSourceImpl implements IBlockSource |
| 10 | { |
| 11 | private final World worldObj; |
| 12 | private final BlockPos pos; |
| 13 | |
| 14 | public BlockSourceImpl(World worldIn, BlockPos posIn) |
| 15 | { |
| 16 | this.worldObj = worldIn; |
| 17 | this.pos = posIn; |
| 18 | } |
| 19 | |
| 20 | public World getWorld() |
| 21 | { |
| 22 | return this.worldObj; |
| 23 | } |
| 24 | |
| 25 | public double getX() |
| 26 | { |
| 27 | return (double)this.pos.getX() + 0.5D; |
| 28 | } |
| 29 | |
| 30 | public double getY() |
| 31 | { |
| 32 | return (double)this.pos.getY() + 0.5D; |
| 33 | } |
| 34 | |
| 35 | public double getZ() |
| 36 | { |
| 37 | return (double)this.pos.getZ() + 0.5D; |
| 38 | } |
| 39 | |
| 40 | public BlockPos getBlockPos() |
| 41 | { |
| 42 | return this.pos; |
| 43 | } |
| 44 | |
| 45 | public int getBlockMetadata() |
| 46 | { |
| 47 | IBlockState iblockstate = this.worldObj.getBlockState(this.pos); |
| 48 | return iblockstate.getBlock().getMetaFromState(iblockstate); |
| 49 | } |
| 50 | |
| 51 | public <T extends TileEntity> T getBlockTileEntity() |
| 52 | { |
| 53 | return (T)this.worldObj.getTileEntity(this.pos); |
| 54 | } |
| 55 | } |
nothing calls this directly
no outgoing calls
no test coverage detected