本文整理汇总了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);
}
示例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);
}
示例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]);
}
示例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());
}
}
示例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);
}
示例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});
}
示例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});
}