BlockSourceImpl .java

net.minecraft.block.BlockSourceImpl (class): members: getBlockTileEntity, getBlockPos, getBlockMetadata, pos, getWorld, getX, getY, getZ, worldObj.

net.minecraft.blockclass56 linescommon1.2 KB

Implements

API Surface (7)

World getWorld()
double getX()
double getY()
double getZ()
BlockPos getBlockPos()
int getBlockMetadata()
<T extends TileEntity> T getBlockTileEntity()

Fields & Constants (2)

worldObj
pos

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

BlockSourceImpl.java56 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.block;
2
3
import net.minecraft.block.state.IBlockState;
4
import net.minecraft.dispenser.IBlockSource;
5
import net.minecraft.tileentity.TileEntity;
6
import net.minecraft.util.BlockPos;
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
}
56

Deobfuscated MCP 1.8.9 source of BlockSourceImpl from Marcelektro/MavenMCP-1.8.9 (net/minecraft/block/BlockSourceImpl.java), stored verbatim.