本文整理匯總了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});
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
};
}
示例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});
}
示例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());
}
示例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);
}
示例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});
}
示例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});
}
示例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;
}
示例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);
}
}
示例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 });
}
示例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[]{});
}
示例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);
}