当前位置: 首页>>代码示例>>Java>>正文


Java PropertyInteger.create方法代码示例

本文整理汇总了Java中net.minecraft.block.properties.PropertyInteger.create方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyInteger.create方法的具体用法?Java PropertyInteger.create怎么用?Java PropertyInteger.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.properties.PropertyInteger的用法示例。


在下文中一共展示了PropertyInteger.create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MaterialSlab

import net.minecraft.block.properties.PropertyInteger; //导入方法依赖的package包/类
public MaterialSlab(TMResource... resources) {
	VARIANT = PropertyInteger.create("type", 0, Math.max(Math.min(resources.length - 1, 7), 1));
	half = new BlockMaterialSlab();
	full = new BlockMaterialSlab() {
		@Override
		public boolean isDouble() {
			return true;
		}
	};
	this.resources = new TMResource[Math.min(resources.length, 8)];
	for (int i = 0;i < resources.length && i < 8;i++) {
		this.resources[i] = resources[i];
		resources[i].setSlab(this);
	}
	itemBlock = new ItemSlab(half, half, full);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:17,代码来源:MaterialSlab.java

示例2: createBlockState

import net.minecraft.block.properties.PropertyInteger; //导入方法依赖的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

示例3: createBlockState

import net.minecraft.block.properties.PropertyInteger; //导入方法依赖的package包/类
@Override
protected BlockStateContainer createBlockState() {
	if (TYPE == null) {
		Integer i = threadLocal.get();
		if (i == null)
			i = 1;
		TYPE = PropertyInteger.create("type", 0, i == 1 ? i : i - 1);
		maxStates = i;
	}
	return maxStates > 1 ? new BlockStateContainer(this, TYPE) : new BlockStateContainer(this, new IProperty[0]);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:12,代码来源:BlockOre.java

示例4: ReduxBlock

import net.minecraft.block.properties.PropertyInteger; //导入方法依赖的package包/类
public ReduxBlock(Pack parentPack, Block reduxBlock) {
    super(reduxBlock.getMaterial());
    this.pack = parentPack;
    this.reduxBlock = reduxBlock;

    setUnlocalizedName(reduxBlock.getName());
    setCreativeTab(reduxBlock.getCreativeTab());

    IBlockState defaultBlockState = this.blockState.getBaseState().withProperty(SUCCESS_COUNT_META, 0);
    if (reduxBlock.shouldAddFacingProperty())
        defaultBlockState = defaultBlockState.withProperty(FACING, null);
    if (reduxBlock.getCustomProperties() != null) {
        for (Flags<String, Integer> customProperty : reduxBlock.getCustomProperties()) {
            PropertyInteger customIntegerProperty = PropertyInteger.create(customProperty.getKey(), Integer.MIN_VALUE, Integer.MAX_VALUE);
            customBlockProperties.put(customProperty.getKey(), customIntegerProperty);
            defaultBlockState = defaultBlockState.withProperty(customIntegerProperty, customProperty.getValue());
        }
    }
    this.setDefaultState(defaultBlockState);

    if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
        StateMap.Builder stateMapBuilder = (new StateMap.Builder()).addPropertiesToIgnore(SUCCESS_COUNT_META);
        if (reduxBlock.getIgnoredProperties() != null) {
            for (String s : reduxBlock.getIgnoredProperties()) {
                PropertyInteger propertyInteger = customBlockProperties.get(s);
                if (propertyInteger != null) {
                    stateMapBuilder.addPropertiesToIgnore(propertyInteger);
                }
            }
        }
        FMLClientHandler.instance().getClient().getBlockRendererDispatcher().getBlockModelShapes().registerBlockWithStateMapper(this, stateMapBuilder.build());
    }
}
 
开发者ID:Quiddity-Modding,项目名称:Redux,代码行数:34,代码来源:ReduxBlock.java

示例5: createBlockState

import net.minecraft.block.properties.PropertyInteger; //导入方法依赖的package包/类
@Override
protected BlockStateContainer createBlockState() {
	STATE = PropertyInteger.create("state", 0, maxStates.get());
	return new BlockStateContainer(this, FACING, STATE);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:6,代码来源:BlockModuleBase.java

示例6: createBlockState

import net.minecraft.block.properties.PropertyInteger; //导入方法依赖的package包/类
@Override
protected BlockStateContainer createBlockState() {
	STATE = PropertyInteger.create("state", 0, 2);
	return new ExtendedBlockState(this, new IProperty[]{BlockTerminalBase.FACING, STATE}, new IUnlistedProperty[]{BlockTerminalBase.COLOR, BlockTerminalBase.STATE});
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:6,代码来源:ItemPartTerminal.java

示例7: createBlockState

import net.minecraft.block.properties.PropertyInteger; //导入方法依赖的package包/类
@Override
protected BlockStateContainer createBlockState() {
	STATE = PropertyInteger.create("state", 0, 2);
	return new ExtendedBlockState(this, new IProperty[]{BlockTerminalBase.FACING, STATE, BlockPatternTerminal.HAS_PATTERN}, new IUnlistedProperty[]{BlockTerminalBase.COLOR, BlockTerminalBase.STATE});
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:6,代码来源:ItemPartPatternTerminal.java


注:本文中的net.minecraft.block.properties.PropertyInteger.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。