Java 类net.minecraftforge.common.property.IUnlistedProperty 实例源码

项目:Backmemed    文件:BlockStateContainer.java   
public BlockStateContainer build()
{
    IProperty<?>[] iproperty = new IProperty[this.listed.size()];
    iproperty = (IProperty[])this.listed.toArray(iproperty);

    if (this.unlisted.size() == 0)
    {
        return new BlockStateContainer(this.block, iproperty);
    }
    else
    {
        IUnlistedProperty<?>[] iunlistedproperty = new IUnlistedProperty[this.unlisted.size()];
        iunlistedproperty = (IUnlistedProperty[])this.unlisted.toArray(iunlistedproperty);
        return (BlockStateContainer)Reflector.newInstance(Reflector.ExtendedBlockState_Constructor, new Object[] {this.block, iproperty, iunlistedproperty});
    }
}
项目:OpenBlocks    文件:BakedModelCanvas.java   
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
    final Optional<IBlockState> maybeInnerBlock;
    final Optional<CanvasState> maybeCanvasState;
    if (state instanceof IExtendedBlockState) {
        final IExtendedBlockState extendedState = (IExtendedBlockState)state;
        final ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties = extendedState.getUnlistedProperties();
        maybeInnerBlock = getProperty(unlistedProperties, InnerBlockState.PROPERTY);
        maybeCanvasState = getProperty(unlistedProperties, CanvasState.PROPERTY);

        if (maybeCanvasState.isPresent()) maybeCanvasState.get().onRender();
    } else {
        maybeInnerBlock = Optional.empty();
        maybeCanvasState = Optional.empty();
    }

    final BlockRenderLayer renderLayer = MoreObjects.firstNonNull(MinecraftForgeClient.getRenderLayer(), BlockRenderLayer.CUTOUT);

    return modelTransformer.getQuads(maybeInnerBlock, maybeCanvasState, renderLayer).get(side);

}
项目:Backmemed    文件:BlockStateContainer.java   
protected BlockStateContainer(Block p_i9_1_, IProperty<?>[] p_i9_2_, ImmutableMap < IUnlistedProperty<?>, Optional<? >> p_i9_3_)
{
    this.block = p_i9_1_;
    Map < String, IProperty<? >> map = Maps. < String, IProperty<? >> newHashMap();

    for (IProperty<?> iproperty : p_i9_2_)
    {
        validateProperty(p_i9_1_, iproperty);
        map.put(iproperty.getName(), iproperty);
    }

    this.properties = ImmutableSortedMap. < String, IProperty<? >> copyOf(map);
    Map < Map < IProperty<?>, Comparable<? >> , BlockStateContainer.StateImplementation > map2 = Maps. < Map < IProperty<?>, Comparable<? >> , BlockStateContainer.StateImplementation > newLinkedHashMap();
    List<BlockStateContainer.StateImplementation> list = Lists.<BlockStateContainer.StateImplementation>newArrayList();

    for (List < Comparable<? >> list1 : Cartesian.cartesianProduct(this.getAllowedValues()))
    {
        Map < IProperty<?>, Comparable<? >> map1 = MapPopulator. < IProperty<?>, Comparable<? >> createMap(this.properties.values(), list1);
        BlockStateContainer.StateImplementation blockstatecontainer$stateimplementation = this.createState(p_i9_1_, ImmutableMap. < IProperty<?>, Comparable<? >> copyOf(map1), p_i9_3_);
        map2.put(map1, blockstatecontainer$stateimplementation);
        list.add(blockstatecontainer$stateimplementation);
    }

    for (BlockStateContainer.StateImplementation blockstatecontainer$stateimplementation1 : list)
    {
        blockstatecontainer$stateimplementation1.buildPropertyValueTable(map2);
    }

    this.validStates = ImmutableList.copyOf(list);
}
项目:Backmemed    文件:BlockStateContainer.java   
public BlockStateContainer.Builder add(IUnlistedProperty<?>... p_add_1_)
{
    for (IUnlistedProperty<?> iunlistedproperty : p_add_1_)
    {
        this.unlisted.add(iunlistedproperty);
    }

    return this;
}
项目:InspiringWorld    文件:BlockLit.java   
@Override
@Nonnull
protected BlockStateContainer createBlockState()
{
    return new BlockStateContainer(this, BlockHorizontal.FACING, IS_LIT)
    {
        @Override
        @Nonnull
        protected StateImplementation createState(@Nonnull Block block, ImmutableMap<IProperty<?>, Comparable<?>>
            properties, ImmutableMap<IUnlistedProperty<?>, Optional<?>> unlistedProperties)
        {
            return new State(block, properties);
        }
    };
}
项目:Qbar    文件:BlockMultiblockBase.java   
@Override
public BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this,
            new IProperty[]{BlockMultiblockBase.MULTIBLOCK_GAG, BlockMultiblockBase.FACING},
            new IUnlistedProperty[]{Properties.AnimationProperty});
}
项目:CodeChickenLib    文件:BlockStateUtils.java   
@SuppressWarnings ("unchecked")
private static int hashBlockState(IExtendedBlockState state) {
    List<String> toHash = new LinkedList<>();
    toHash.add(state.toString());
    toHash.add("meta=" + state.getBlock().getMetaFromState(state));
    for (Entry<IUnlistedProperty<?>, Optional<?>> entry : state.getUnlistedProperties().entrySet()) {
        IUnlistedProperty property = entry.getKey();
        toHash.add(property.getName() + "=" + property.valueToString(state.getValue(property)));
    }
    return Objects.hashCode(toHash.toArray());
}
项目:Toms-Mod    文件:BlockDuctBase.java   
@Override
public BlockStateContainer createBlockState() {
    if (maxStates.get() == -1) {
        maxIntValueInProperties = -1;
        propertyList = null;
    } else {
        maxIntValueInProperties = Math.min(maxStates.get(), 3);
        if (!propertyListMap.containsKey(maxIntValueInProperties)) {
            PropertyInteger UP = PropertyInteger.create("up", 0, maxIntValueInProperties);
            PropertyInteger DOWN = PropertyInteger.create("down", 0, maxIntValueInProperties);
            PropertyInteger NORTH = PropertyInteger.create("north", 0, maxIntValueInProperties);
            PropertyInteger EAST = PropertyInteger.create("east", 0, maxIntValueInProperties);
            PropertyInteger SOUTH = PropertyInteger.create("south", 0, maxIntValueInProperties);
            PropertyInteger WEST = PropertyInteger.create("west", 0, maxIntValueInProperties);
            propertyListMap.put(maxIntValueInProperties, new PropertyList(UP, DOWN, NORTH, EAST, SOUTH, WEST));
        }
        propertyList = propertyListMap.get(maxIntValueInProperties);
    }
    IProperty<?>[] properties = getProperties();
    IUnlistedProperty<?>[] unlistedProperties = getUnlistedProperties();
    if (properties == null) {
        properties = new IProperty[]{propertyList.DOWN, propertyList.UP, propertyList.NORTH, propertyList.SOUTH, propertyList.WEST, propertyList.EAST};
    }
    if (unlistedProperties != null && unlistedProperties.length > 0)
        return new ExtendedBlockState(this, properties, unlistedProperties);
    else
        return new BlockStateContainer(this, properties);
}
项目:geomastery    文件:BlockBeam.java   
@Override
public BlockStateContainer createBlockState() {

    return new ExtendedBlockState(this, new IProperty[0],
            new IUnlistedProperty[] {AXIS, FRONTBEAM, BACKBEAM,
            FLOOR, FRONT, RIGHT, BACK, LEFT, FL, FR, BL, BR});
}
项目:geomastery    文件:BlockWall.java   
@Override
public BlockStateContainer createBlockState() {

    return new ExtendedBlockState(this,
            new IProperty[] {TOP, BOTTOM, DOUBLE},
            new IUnlistedProperty[] {NORTH, EAST, SOUTH, WEST,
            N_TOP, E_TOP, S_TOP, W_TOP, N_BOTTOM, E_BOTTOM, S_BOTTOM,
            W_BOTTOM, N_DOUBLE, E_DOUBLE, S_DOUBLE, W_DOUBLE});
}
项目:geomastery    文件:RenderDelayedBakingAbstract.java   
@Override
public List<BakedQuad> getQuads(IBlockState state,
        EnumFacing side, long rand) {

    if (!(state instanceof IExtendedBlockState)) {

        return Collections.emptyList();
    }

    IExtendedBlockState extState = (IExtendedBlockState) state;
    ImmutableMap<IUnlistedProperty<?>,Optional<?>> extProps =
            extState.getUnlistedProperties();
    ImmutableMap<IProperty<?>,Comparable<?>> props =
            extState.getProperties();
    Pair<ImmutableMap<IProperty<?>,Comparable<?>>,
            ImmutableMap<IUnlistedProperty<?>,Optional<?>>>
            pair = Pair.of(props, extProps);

    if (this.cache.containsKey(pair)) {

        return this.cache.get(pair);
    }

    List<BakedQuad> result = this.getAllQuads(state, side, rand);
    this.cache.put(pair, result);
    return result;
}
项目:InfinityLib    文件:BlockBase.java   
@Override
protected final BlockStateContainer createBlockState() {
    InfinityProperty[] propertyArray = this.getPropertyArray();
    IProperty[] properties = new IProperty[propertyArray.length];
    for(int i = 0; i < properties.length; i++) {
        properties[i] = propertyArray[i].getProperty();
    }
    IUnlistedProperty[] uprops = getUnlistedPropertyArray();
    if (uprops.length < 1) {
        return new BlockStateContainer(this, properties);
    } else {
        return new ExtendedBlockState(this, properties, uprops);
    }
}
项目:TFC2    文件:BlockLeaves2.java   
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/

@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[]{META_PROPERTY, BlockLeaves.FANCY}, new IUnlistedProperty[]{ B3DLoader.B3DFrameProperty.INSTANCE });
}
项目:TFC2    文件:BlockFirepit.java   
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/


@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[]{LIT, TOOL}, new IUnlistedProperty[]{});
}
项目:BuildersGuides    文件:BlockMarker.java   
@Override
protected BlockStateContainer createBlockState() {
    IUnlistedProperty[] unlistedProperties = new IUnlistedProperty[]{
            NORTH, SOUTH, EAST, WEST, UP, DOWN, FACING
    };
    return new ExtendedBlockState(this, new IProperty[0], unlistedProperties);
}
项目:taam    文件:MachineMultipart.java   
@Override
public BlockStateContainer createBlockState() {
    return new ExtendedBlockState(MCMultiPartMod.multipart,
            new IProperty[] { DIRECTION, VARIANT },
            new IUnlistedProperty[] { BlockMultipartContainer.PROPERTY_MULTIPART_CONTAINER, OBJModel.OBJProperty.instance }
            );
}
项目:TFC2    文件:BlockLeaves2.java   
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/

@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[]{META_PROPERTY, BlockLeaves.FANCY}, new IUnlistedProperty[]{ B3DLoader.B3DFrameProperty.INSTANCE });
}
项目:TFC2    文件:BlockFirepit.java   
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/


@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[]{LIT, TOOL}, new IUnlistedProperty[]{});
}
项目:AgriCraft    文件:BlockCrop.java   
@Override
public IUnlistedProperty[] getUnlistedPropertyArray() {
    return new IUnlistedProperty[]{
        AgriProperties.CROP_PLANT,
        AgriProperties.GROWTH_STAGE,
        AgriProperties.CROSS_CROP
    };
}
项目:AgriCraft    文件:BlockCustomWood.java   
@Override
public final IUnlistedProperty[] getUnlistedPropertyArray() {
    List<IUnlistedProperty> list = getUnlistedProperties();
    IUnlistedProperty[] props = list.toArray(new IUnlistedProperty[list.size() + 1]);
    props[props.length - 1] = AgriProperties.CUSTOM_WOOD_TYPE;
    return props;
}
项目:OpenBlocks    文件:BlockSprinkler.java   
@Override
protected BlockStateContainer createBlockState() {
    // 1.8.9 Hack, crashes otherwise
    return new ExtendedBlockState(this,
            new IProperty[] { getPropertyOrientation(), BlockLiquid.LEVEL, Properties.StaticProperty },
            new IUnlistedProperty[] { EvalModelState.PROPERTY });
}
项目:pnc-repressurized    文件:BlockVortexTube.java   
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this,
            new IProperty[]{ROTATION, BlockPneumaticCraft.DOWN, BlockPneumaticCraft.UP, BlockPneumaticCraft.NORTH, BlockPneumaticCraft.SOUTH, BlockPneumaticCraft.WEST, BlockPneumaticCraft.EAST},
            new IUnlistedProperty[]{OBJProperty.INSTANCE});
}
项目:pnc-repressurized    文件:BlockElevatorBase.java   
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this,
            new IProperty[] { BlockPneumaticCraft.NORTH, BlockPneumaticCraft.SOUTH, BlockPneumaticCraft.WEST, BlockPneumaticCraft.EAST },
            new IUnlistedProperty[] { CAMO_STATE });
}
项目:pnc-repressurized    文件:BlockPressureChamberGlass.java   
@Override
protected BlockStateContainer createBlockState() {
    IProperty[] listedProperties = new IProperty[0]; // no listed properties
    IUnlistedProperty[] unlistedProperties = new IUnlistedProperty[] { DOWN, UP, NORTH, SOUTH, WEST, EAST };
    return new ExtendedBlockState(this, listedProperties, unlistedProperties);
}
项目:pnc-repressurized    文件:BlockPneumaticCraftCamo.java   
@Override
protected BlockStateContainer createBlockState() {
    return isRotatable() ?
            new ExtendedBlockState(this, new IProperty[] { ROTATION } , new IUnlistedProperty[] { CAMO_STATE }) :
            new ExtendedBlockState(this, new IProperty[] { } , new IUnlistedProperty[] { CAMO_STATE });
}
项目:pnc-repressurized    文件:BlockPressureTube.java   
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this,
            Arrays.copyOf(BlockPressureTube.CONNECTION_PROPERTIES_3, BlockPressureTube.CONNECTION_PROPERTIES_3.length),
            new IUnlistedProperty[] { CAMO_STATE });
}
项目:HardVox    文件:BlockStateDelegate.java   
@Override
public Collection<IUnlistedProperty<?>> getUnlistedNames() {
    return iebsValue(IExtendedBlockState::getUnlistedNames, Collections.emptyList());
}
项目:HardVox    文件:BlockStateDelegate.java   
@Override
public <V> V getValue(IUnlistedProperty<V> property) {
    return iebsThrow(iebs -> iebs.getValue(property),
            () -> new IllegalArgumentException("Cannot get unlisted property " + property + " as it does not exist in " + getBlock().getBlockState()));
}
项目:HardVox    文件:BlockStateDelegate.java   
@Override
public <V> IExtendedBlockState withProperty(IUnlistedProperty<V> property, V value) {
    return iebsThrow(iebs -> iebs.withProperty(property, value),
            () -> new IllegalArgumentException("Cannot set unlisted property " + property + " as it does not exist in " + getBlock().getBlockState()));
}
项目:HardVox    文件:BlockStateDelegate.java   
@Override
public ImmutableMap<IUnlistedProperty<?>, Optional<?>> getUnlistedProperties() {
    return iebsValue(IExtendedBlockState::getUnlistedProperties, ImmutableMap.of());
}
项目:HeroUtils    文件:BuildCraftExtendedProperty.java   
public IUnlistedProperty<T> asUnlistedProperty() {
    return this;
}
项目:Etheric    文件:BlockPipe.java   
@Override
protected BlockStateContainer createBlockState() {
    IUnlistedProperty[] unlisted = new IUnlistedProperty[] { CONNECTIONS[0], CONNECTIONS[1], CONNECTIONS[2],
            CONNECTIONS[3], CONNECTIONS[4], CONNECTIONS[5] };
    return new ExtendedBlockState(this, new IProperty[] {}, unlisted);
}
项目:PurificatiMagicae    文件:BlockAbstractCrystalGlass.java   
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[]{}, ConnectionsController.PROPS.values().toArray(new IUnlistedProperty[0]));
}
项目:PurificatiMagicae    文件:BlockAbstractWallIfTablet.java   
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[]{HorizontalFacingController.FACING_H}, new IUnlistedProperty[]{IF_TIER});
}
项目:PurificatiMagicae    文件:BlockCodeStorage.java   
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] {HorizontalFacingController.FACING_H}, new IUnlistedProperty[] {UNLOCKED_PROPERTY});
}
项目:Solar    文件:BlockPhenomena.java   
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[]{State.ACTIVE}, new IUnlistedProperty[]{Properties.AnimationProperty});
}
项目:SimpleTubes    文件:BlockTube.java   
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] { UP, DOWN, NORTH, SOUTH, EAST, WEST, COLOR });
}
项目:Backmemed    文件:BlockStateContainer.java   
public BlockStateContainer(Block blockIn, IProperty<?>... properties)
{
    this(blockIn, properties, (ImmutableMap < IUnlistedProperty<?>, Optional<? >>)null);
}
项目:Backmemed    文件:BlockStateContainer.java   
protected BlockStateContainer.StateImplementation createState(Block p_createState_1_, ImmutableMap < IProperty<?>, Comparable<? >> p_createState_2_, ImmutableMap < IUnlistedProperty<?>, Optional<? >> p_createState_3_)
{
    return new BlockStateContainer.StateImplementation(p_createState_1_, p_createState_2_);
}
项目:CustomWorldGen    文件:BlockFluidBase.java   
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] { LEVEL }, FLUID_RENDER_PROPS.toArray(new IUnlistedProperty<?>[0]));
}