public interface SidedBlock
TileEntity
implement one of the interfaces
for environments (Environment
or
SidedEnvironment
).
A block driver is used by Adapter blocks to check its neighbors and
whether those neighbors should be treated as components or not. If a driver
is present, it will be used to create a ManagedEnvironment
that is
managed by the adapter.
Note that it is possible to write one driver that supports as many different
blocks as you wish. I'd recommend writing one per device (type), though, to
keep things modular.
Note that side-aware block drivers are queried before regular block drivers,
because they are more specific.Modifier and Type | Method and Description |
---|---|
ManagedEnvironment |
createEnvironment(net.minecraft.world.World world,
int x,
int y,
int z,
net.minecraftforge.common.util.ForgeDirection side)
Create a new managed environment interfacing the specified block.
|
boolean |
worksWith(net.minecraft.world.World world,
int x,
int y,
int z,
net.minecraftforge.common.util.ForgeDirection side)
Used to determine the block types this driver handles.
|
boolean worksWith(net.minecraft.world.World world, int x, int y, int z, net.minecraftforge.common.util.ForgeDirection side)
world
- the world in which the block to check lives.x
- the X coordinate of the block to check.y
- the Y coordinate of the block to check.z
- the Z coordinate of the block to check.side
- the side of the block to check.ManagedEnvironment createEnvironment(net.minecraft.world.World world, int x, int y, int z, net.minecraftforge.common.util.ForgeDirection side)
world
- the world containing the block to get the environment for.x
- the X coordinate of the block to get the environment for.y
- the Y coordinate of the block to get the environment for.z
- the Z coordinate of the block to get the environment for.side
- the side of the block to check.