net.minecraftforge.common.property.ExtendedBlockState Java Examples

The following examples show how to use net.minecraftforge.common.property.ExtendedBlockState. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlockMixin.java    From customstuff4 with GNU General Public License v3.0 6 votes vote down vote up
@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));
    }
}
 
Example #2
Source File: BlockBarrel.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
@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 });
}
 
Example #3
Source File: BlockFluidTest.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@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());
}
 
Example #4
Source File: BlockFirepit.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/


@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{LIT, TOOL}, new IUnlistedProperty[]{});
}
 
Example #5
Source File: BlockLeaves2.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/

@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{META_PROPERTY, BlockLeaves.FANCY}, new IUnlistedProperty[]{ B3DLoader.B3DFrameProperty.INSTANCE });
}
 
Example #6
Source File: PipeBasic.java    From Logistics-Pipes-2 with MIT License 4 votes vote down vote up
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #7
Source File: BlockElevatorSlab.java    From enderutilities with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] { COLOR, HALF }, new IUnlistedProperty<?>[] { CAMOBLOCKSTATE, CAMOBLOCKSTATEEXTENDED });
}
 
Example #8
Source File: BlockDrawbridge.java    From enderutilities with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] { ADVANCED, FACING }, new IUnlistedProperty<?>[] { CAMOBLOCKSTATE, CAMOBLOCKSTATEEXTENDED });
}
 
Example #9
Source File: BlockElevator.java    From enderutilities with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] { COLOR }, new IUnlistedProperty<?>[] { CAMOBLOCKSTATE, CAMOBLOCKSTATEEXTENDED });
}
 
Example #10
Source File: BlockPortalFrame.java    From enderutilities with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty<?>[] { CAMOBLOCKSTATE, CAMOBLOCKSTATEEXTENDED });
}
 
Example #11
Source File: BlockAnvil.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{INVENTORY});
}
 
Example #12
Source File: BlockPitKiln.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{FILL, FILLTYPE}, new IUnlistedProperty[]{INVENTORY});
}
 
Example #13
Source File: BlockSmallVessel.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{}, new IUnlistedProperty[]{INVENTORY});
}
 
Example #14
Source File: TidalGenerator.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty },
            new IUnlistedProperty[] { Properties.AnimationProperty });
}
 
Example #15
Source File: PipeBlocking.java    From Logistics-Pipes-2 with MIT License 4 votes vote down vote up
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #16
Source File: PipeChassisMkI.java    From Logistics-Pipes-2 with MIT License 4 votes vote down vote up
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #17
Source File: PipeRouted.java    From Logistics-Pipes-2 with MIT License 4 votes vote down vote up
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #18
Source File: BlockGenerator.java    From YouTubeModdingTutorial with MIT License 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this,
            new IProperty[] {Properties.StaticProperty, FACING_HORIZ },
            new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #19
Source File: BlockMachine.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[]{OPAQUE}, new IUnlistedProperty[]{HARVEST_TOOL, HARVEST_LEVEL});
}
 
Example #20
Source File: Wind.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty }, new IUnlistedProperty[]{ Properties.AnimationProperty });
}
 
Example #21
Source File: Harvester.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty },
            new IUnlistedProperty[] { Properties.AnimationProperty });
}
 
Example #22
Source File: Scrubber.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty }, new IUnlistedProperty[]{ Properties.AnimationProperty });
}