當前位置: 首頁>>代碼示例>>Java>>正文


Java IUnlistedProperty類代碼示例

本文整理匯總了Java中net.minecraftforge.common.property.IUnlistedProperty的典型用法代碼示例。如果您正苦於以下問題:Java IUnlistedProperty類的具體用法?Java IUnlistedProperty怎麽用?Java IUnlistedProperty使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IUnlistedProperty類屬於net.minecraftforge.common.property包,在下文中一共展示了IUnlistedProperty類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: build

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
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});
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:17,代碼來源:BlockStateContainer.java

示例2: getQuads

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@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);

}
 
開發者ID:OpenMods,項目名稱:OpenBlocks,代碼行數:22,代碼來源:BakedModelCanvas.java

示例3: BlockStateContainer

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
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);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:31,代碼來源:BlockStateContainer.java

示例4: add

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
public BlockStateContainer.Builder add(IUnlistedProperty<?>... p_add_1_)
{
    for (IUnlistedProperty<?> iunlistedproperty : p_add_1_)
    {
        this.unlisted.add(iunlistedproperty);
    }

    return this;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:10,代碼來源:BlockStateContainer.java

示例5: createBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@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);
        }
    };
}
 
開發者ID:InfinityStudio,項目名稱:InspiringWorld,代碼行數:16,代碼來源:BlockLit.java

示例6: createBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@Override
public BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this,
            new IProperty[]{BlockMultiblockBase.MULTIBLOCK_GAG, BlockMultiblockBase.FACING},
            new IUnlistedProperty[]{Properties.AnimationProperty});
}
 
開發者ID:OPMCorp,項目名稱:Qbar,代碼行數:8,代碼來源:BlockMultiblockBase.java

示例7: hashBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@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());
}
 
開發者ID:TheCBProject,項目名稱:CodeChickenLib,代碼行數:12,代碼來源:BlockStateUtils.java

示例8: createBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@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);
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:29,代碼來源:BlockDuctBase.java

示例9: createBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@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});
}
 
開發者ID:JayAvery,項目名稱:geomastery,代碼行數:8,代碼來源:BlockBeam.java

示例10: createBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@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});
}
 
開發者ID:JayAvery,項目名稱:geomastery,代碼行數:10,代碼來源:BlockWall.java

示例11: getQuads

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@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;
}
 
開發者ID:JayAvery,項目名稱:geomastery,代碼行數:28,代碼來源:RenderDelayedBakingAbstract.java

示例12: createBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@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);
    }
}
 
開發者ID:InfinityRaider,項目名稱:InfinityLib,代碼行數:15,代碼來源:BlockBase.java

示例13: createBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/

@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{META_PROPERTY, BlockLeaves.FANCY}, new IUnlistedProperty[]{ B3DLoader.B3DFrameProperty.INSTANCE });
}
 
開發者ID:Deadrik,項目名稱:TFC2,代碼行數:10,代碼來源:BlockLeaves2.java

示例14: createBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
/*******************************************************************************
 * 3. Blockstate 
 *******************************************************************************/


@Override
protected BlockStateContainer createBlockState()
{
	return new ExtendedBlockState(this, new IProperty[]{LIT, TOOL}, new IUnlistedProperty[]{});
}
 
開發者ID:Deadrik,項目名稱:TFC2,代碼行數:11,代碼來源:BlockFirepit.java

示例15: createBlockState

import net.minecraftforge.common.property.IUnlistedProperty; //導入依賴的package包/類
@Override
protected BlockStateContainer createBlockState() {
    IUnlistedProperty[] unlistedProperties = new IUnlistedProperty[]{
            NORTH, SOUTH, EAST, WEST, UP, DOWN, FACING
    };
    return new ExtendedBlockState(this, new IProperty[0], unlistedProperties);
}
 
開發者ID:Ipsis,項目名稱:BuildersGuides,代碼行數:8,代碼來源:BlockMarker.java


注:本文中的net.minecraftforge.common.property.IUnlistedProperty類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。