Java源码示例:net.minecraftforge.common.property.ExtendedBlockState

示例1
@Override
protected BlockStateContainer createBlockState()
{
    BlockStateContainer superState = super.createBlockState();
    List<IProperty<?>> superProperties = Lists.newArrayList(superState.getProperties());
    superProperties.addAll(Arrays.asList(getProperties()));

    if (superState instanceof ExtendedBlockState)
    {
        IUnlistedProperty<?>[] unlistedProperties = ((ExtendedBlockState) superState).getUnlistedProperties().toArray(new IUnlistedProperty<?>[0]);

        return new ExtendedBlockState(this, ContentBlockBaseWithSubtypes.insertSubtype(superProperties), unlistedProperties);
    } else
    {
        return new BlockStateContainer(this, ContentBlockBaseWithSubtypes.insertSubtype(superProperties));
    }
}
 
示例2
@Test
@SuppressWarnings("unchecked")
public void testProperties()
{
    ContentBlockFluid content = new ContentBlockFluid();
    content.id = "test_getSubtype";

    Block block = content.createBlock();
    ExtendedBlockState state = (ExtendedBlockState) block.getBlockState();
    Collection<IProperty<?>> properties = state.getProperties();
    assertEquals(1, properties.size());
    assertEquals(5, state.getUnlistedProperties().size());
}
 
示例3
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/

@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{META_PROPERTY, BlockLeaves.FANCY}, new IUnlistedProperty[]{ B3DLoader.B3DFrameProperty.INSTANCE });
}
 
示例4
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/


@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{LIT, TOOL}, new IUnlistedProperty[]{});
}
 
示例5
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] { FACING_H, CREATIVE,
            LABEL_UP, LABEL_DOWN, LABEL_FRONT, LABEL_BACK, LABEL_LEFT, LABEL_RIGHT },
            new IUnlistedProperty<?>[] { CAMOBLOCKSTATE, CAMOBLOCKSTATEEXTENDED });
}
 
示例6
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty },
            new IUnlistedProperty[] { Properties.AnimationProperty });
}
 
示例7
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty }, new IUnlistedProperty[]{ Properties.AnimationProperty });
}
 
示例8
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty },
            new IUnlistedProperty[] { Properties.AnimationProperty });
}
 
示例9
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty }, new IUnlistedProperty[]{ Properties.AnimationProperty });
}
 
示例10
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[]{OPAQUE}, new IUnlistedProperty[]{HARVEST_TOOL, HARVEST_LEVEL});
}
 
示例11
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this,
            new IProperty[] {Properties.StaticProperty, FACING_HORIZ },
            new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
示例12
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
示例13
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
示例14
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
示例15
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
示例16
@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{}, new IUnlistedProperty[]{INVENTORY});
}
 
示例17
@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{FILL, FILLTYPE}, new IUnlistedProperty[]{INVENTORY});
}
 
示例18
@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{INVENTORY});
}
 
示例19
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty<?>[] { CAMOBLOCKSTATE, CAMOBLOCKSTATEEXTENDED });
}
 
示例20
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] { COLOR }, new IUnlistedProperty<?>[] { CAMOBLOCKSTATE, CAMOBLOCKSTATEEXTENDED });
}
 
示例21
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] { ADVANCED, FACING }, new IUnlistedProperty<?>[] { CAMOBLOCKSTATE, CAMOBLOCKSTATEEXTENDED });
}
 
示例22
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] { COLOR, HALF }, new IUnlistedProperty<?>[] { CAMOBLOCKSTATE, CAMOBLOCKSTATEEXTENDED });
}