Search in sources :

Example 1 with BlockStateContainer

use of net.minecraft.block.state.BlockStateContainer in project ImmersiveEngineering by BluSunrize.

the class BlockMetalDevice1 method createBlockState.

@Override
protected BlockStateContainer createBlockState() {
    BlockStateContainer base = super.createBlockState();
    IUnlistedProperty[] unlisted = (base instanceof ExtendedBlockState) ? ((ExtendedBlockState) base).getUnlistedProperties().toArray(new IUnlistedProperty[0]) : new IUnlistedProperty[0];
    unlisted = Arrays.copyOf(unlisted, unlisted.length + 1);
    unlisted[unlisted.length - 1] = IEProperties.CONNECTIONS;
    return new ExtendedBlockState(this, base.getProperties().toArray(new IProperty[0]), unlisted);
}
Also used : IUnlistedProperty(net.minecraftforge.common.property.IUnlistedProperty) IProperty(net.minecraft.block.properties.IProperty) IExtendedBlockState(net.minecraftforge.common.property.IExtendedBlockState) ExtendedBlockState(net.minecraftforge.common.property.ExtendedBlockState) BlockStateContainer(net.minecraft.block.state.BlockStateContainer)

Example 2 with BlockStateContainer

use of net.minecraft.block.state.BlockStateContainer in project ImmersiveEngineering by BluSunrize.

the class BlockConnector method createBlockState.

@Override
protected BlockStateContainer createBlockState() {
    BlockStateContainer base = super.createBlockState();
    IUnlistedProperty[] unlisted = (base instanceof ExtendedBlockState) ? ((ExtendedBlockState) base).getUnlistedProperties().toArray(new IUnlistedProperty[0]) : new IUnlistedProperty[0];
    unlisted = Arrays.copyOf(unlisted, unlisted.length + 1);
    unlisted[unlisted.length - 1] = IEProperties.CONNECTIONS;
    return new ExtendedBlockState(this, base.getProperties().toArray(new IProperty[0]), unlisted);
}
Also used : IUnlistedProperty(net.minecraftforge.common.property.IUnlistedProperty) IProperty(net.minecraft.block.properties.IProperty) IExtendedBlockState(net.minecraftforge.common.property.IExtendedBlockState) ExtendedBlockState(net.minecraftforge.common.property.ExtendedBlockState) BlockStateContainer(net.minecraft.block.state.BlockStateContainer)

Example 3 with BlockStateContainer

use of net.minecraft.block.state.BlockStateContainer in project ImmersiveEngineering by BluSunrize.

the class BlockIEBase method createNotTempBlockState.

protected BlockStateContainer createNotTempBlockState() {
    IProperty[] array = new IProperty[1 + this.additionalProperties.length];
    array[0] = this.property;
    for (int i = 0; i < this.additionalProperties.length; i++) array[1 + i] = this.additionalProperties[i];
    if (this.additionalUnlistedProperties.length > 0)
        return new ExtendedBlockState(this, array, additionalUnlistedProperties);
    return new BlockStateContainer(this, array);
}
Also used : IProperty(net.minecraft.block.properties.IProperty) ExtendedBlockState(net.minecraftforge.common.property.ExtendedBlockState) BlockStateContainer(net.minecraft.block.state.BlockStateContainer)

Aggregations

IProperty (net.minecraft.block.properties.IProperty)3 BlockStateContainer (net.minecraft.block.state.BlockStateContainer)3 ExtendedBlockState (net.minecraftforge.common.property.ExtendedBlockState)3 IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)2 IUnlistedProperty (net.minecraftforge.common.property.IUnlistedProperty)2