public final class BlockOptionalMeta extends java.lang.Object
Constructor and Description |
---|
BlockOptionalMeta(net.minecraft.block.Block block) |
BlockOptionalMeta(net.minecraft.block.Block block,
java.lang.Integer meta) |
BlockOptionalMeta(java.lang.String selector) |
Modifier and Type | Method and Description |
---|---|
static net.minecraft.block.state.IBlockState |
blockStateFromStack(net.minecraft.item.ItemStack stack) |
static <C extends java.lang.Comparable<C>,P extends net.minecraft.block.properties.IProperty<C>> |
castToIProperty(java.lang.Object value) |
static <C extends java.lang.Comparable<C>,P extends net.minecraft.block.properties.IProperty<C>> |
castToIPropertyValue(P iproperty,
java.lang.Object value) |
net.minecraft.block.state.IBlockState |
getAnyBlockState() |
net.minecraft.block.Block |
getBlock() |
java.lang.Integer |
getMeta() |
boolean |
matches(net.minecraft.block.Block block) |
boolean |
matches(net.minecraft.block.state.IBlockState blockstate) |
boolean |
matches(net.minecraft.item.ItemStack stack) |
static net.minecraft.block.state.IBlockState |
normalize(net.minecraft.block.state.IBlockState state)
Normalizes the specified blockstate by setting meta-affecting properties which
are not being targeted by the meta parameter to their default values.
|
static int |
stateMeta(net.minecraft.block.state.IBlockState state)
Evaluate the target meta value for the specified state.
|
java.lang.String |
toString() |
public BlockOptionalMeta(@Nonnull net.minecraft.block.Block block, @Nullable java.lang.Integer meta)
public BlockOptionalMeta(@Nonnull net.minecraft.block.Block block)
public BlockOptionalMeta(@Nonnull java.lang.String selector)
public static <C extends java.lang.Comparable<C>,P extends net.minecraft.block.properties.IProperty<C>> P castToIProperty(java.lang.Object value)
public static <C extends java.lang.Comparable<C>,P extends net.minecraft.block.properties.IProperty<C>> C castToIPropertyValue(P iproperty, java.lang.Object value)
public static net.minecraft.block.state.IBlockState normalize(net.minecraft.block.state.IBlockState state)
For example, block variant/color is the primary target for the meta value, so properties such as rotation/facing direction will be set to default values in order to nullify the effect that they have on the state's meta value.
state
- The state to normalizepublic static int stateMeta(net.minecraft.block.state.IBlockState state)
state
- The state to checknormalize(IBlockState)
public net.minecraft.block.Block getBlock()
public java.lang.Integer getMeta()
public boolean matches(@Nonnull net.minecraft.block.Block block)
public boolean matches(@Nonnull net.minecraft.block.state.IBlockState blockstate)
public boolean matches(net.minecraft.item.ItemStack stack)
public java.lang.String toString()
toString
in class java.lang.Object
public static net.minecraft.block.state.IBlockState blockStateFromStack(net.minecraft.item.ItemStack stack)
public net.minecraft.block.state.IBlockState getAnyBlockState()