类net.minecraftforge.common.property.Properties源码实例Demo

下面列出了怎么用net.minecraftforge.common.property.Properties的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Logistics-Pipes-2   文件: PipeRouted.java
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
	if(world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileRoutedPipe) {
		TileRoutedPipe te = (TileRoutedPipe)world.getTileEntity(pos);
		te.checkConnections(world, pos);
		ArrayList<String> check = te.checkConnections(world, pos);
		if(!hidden.equals(check)) {
			hidden.clear();
			hidden.addAll(check);
		}
		return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, this.state);
	}
	return state;
}
 
源代码2 项目: Logistics-Pipes-2   文件: PipeChassisMkI.java
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
	if(world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileChassisMkI) {
		TileChassisMkI te = (TileChassisMkI)world.getTileEntity(pos);
		ArrayList<String> check = te.checkConnections(world, pos);
		if(!hidden.equals(check)) {
			hidden.clear();
			hidden.addAll(check);
		}
		return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, this.state);
	}
	return state;
}
 
源代码3 项目: Logistics-Pipes-2   文件: PipeBlocking.java
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
	if(world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileBlockingPipe) {
		TileBlockingPipe te = (TileBlockingPipe)world.getTileEntity(pos);
		ArrayList<String> check = te.checkConnections(world, pos);
		if(!hidden.equals(check)) {
			hidden.clear();
			hidden.addAll(check);
		}
		return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, this.state);
	}
	return state;
}
 
源代码4 项目: Logistics-Pipes-2   文件: PipeBasic.java
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
	if(world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileBasicPipe) {
		TileBasicPipe te = (TileBasicPipe)world.getTileEntity(pos);
		ArrayList<String> check = te.checkConnections(world, pos);
		if(!hidden.equals(check)) {
			hidden.clear();
			hidden.addAll(check);
		}
		return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, this.state);
	}
	return state;
}
 
源代码5 项目: EmergingTechnology   文件: TidalGenerator.java
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty },
            new IUnlistedProperty[] { Properties.AnimationProperty });
}
 
源代码6 项目: EmergingTechnology   文件: TidalGenerator.java
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
    return state.withProperty(Properties.StaticProperty, true);
}
 
源代码7 项目: EmergingTechnology   文件: Scrubber.java
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty }, new IUnlistedProperty[]{ Properties.AnimationProperty });
}
 
源代码8 项目: EmergingTechnology   文件: Scrubber.java
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
	return state.withProperty(Properties.StaticProperty, true);
}
 
源代码9 项目: EmergingTechnology   文件: Harvester.java
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty },
            new IUnlistedProperty[] { Properties.AnimationProperty });
}
 
源代码10 项目: EmergingTechnology   文件: Harvester.java
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
    return state.withProperty(Properties.StaticProperty, true);
}
 
源代码11 项目: EmergingTechnology   文件: Wind.java
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty }, new IUnlistedProperty[]{ Properties.AnimationProperty });
}
 
源代码12 项目: EmergingTechnology   文件: Wind.java
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
	return state.withProperty(Properties.StaticProperty, true);
}
 
源代码13 项目: YouTubeModdingTutorial   文件: BlockGenerator.java
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
    return state.withProperty(Properties.StaticProperty, false);
}
 
源代码14 项目: YouTubeModdingTutorial   文件: BlockGenerator.java
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this,
            new IProperty[] {Properties.StaticProperty, FACING_HORIZ },
            new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
源代码15 项目: VanillaFix   文件: VanillaModelWrapper.java
private IBakedModel bakeNormal(ModelBlock model, IModelState perState, final IModelState modelState, List<TRSRTransformation> newTransforms, final VertexFormat format, final Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter, boolean uvLocked) {
    final TRSRTransformation baseState = modelState.apply(Optional.empty()).orElse(TRSRTransformation.identity());
    TextureAtlasSprite particle = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName("particle")));
    SimpleBakedModel.Builder builder = new SimpleBakedModel.Builder(model, model.createOverrides()).setTexture(particle);
    for (int i = 0; i < model.getElements().size(); i++) {
        if (modelState.apply(Optional.of(Models.getHiddenModelPart(ImmutableList.of(Integer.toString(i))))).isPresent()) {
            continue;
        }
        BlockPart part = model.getElements().get(i);
        TRSRTransformation transformation = baseState;
        if (newTransforms.get(i) != null) {
            transformation = transformation.compose(newTransforms.get(i));
            BlockPartRotation rot = part.partRotation;
            if (rot == null) rot = new BlockPartRotation(new org.lwjgl.util.vector.Vector3f(), EnumFacing.Axis.Y, 0, false);
            part = new BlockPart(part.positionFrom, part.positionTo, part.mapFaces, rot, part.shade);
        }
        for (Map.Entry<EnumFacing, BlockPartFace> e : part.mapFaces.entrySet()) {
            TextureAtlasSprite textureatlassprite1 = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName(e.getValue().texture)));

            if (e.getValue().cullFace == null || !TRSRTransformation.isInteger(transformation.getMatrix())) {
                builder.addGeneralQuad(makeBakedQuad(part, e.getValue(), textureatlassprite1, e.getKey(), transformation, uvLocked));
            } else {
                builder.addFaceQuad(baseState.rotate(e.getValue().cullFace), makeBakedQuad(part, e.getValue(), textureatlassprite1, e.getKey(), transformation, uvLocked));
            }
        }
    }

    return new PerspectiveMapWrapper(builder.makeBakedModel(), perState) {
        private final ItemOverrideList overrides = new AnimationItemOverrideList(VanillaModelWrapper.this, modelState, format, bakedTextureGetter, super.getOverrides());

        @Override
        public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
            List<BakedQuad> quads = null;

            if (state instanceof IExtendedBlockState) {
                IExtendedBlockState exState = (IExtendedBlockState) state;
                if (exState.getUnlistedNames().contains(Properties.AnimationProperty)) {
                    IModelState newState = exState.getValue(Properties.AnimationProperty);
                    IExtendedBlockState newExState = exState.withProperty(Properties.AnimationProperty, null);
                    if (newState != null) {
                        quads = bake(new ModelStateComposition(modelState, newState), format, bakedTextureGetter).getQuads(newExState, side, rand);
                    }
                }
            }

            if (quads == null) {
                quads = super.getQuads(state, side, rand);
            }

            return quads;
        }

        @Override
        public ItemOverrideList getOverrides() {
            return overrides;
        }
    };
}
 
源代码16 项目: Logistics-Pipes-2   文件: PipeRouted.java
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
源代码17 项目: Logistics-Pipes-2   文件: PipeChassisMkI.java
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
源代码18 项目: Logistics-Pipes-2   文件: PipeBlocking.java
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
源代码19 项目: Logistics-Pipes-2   文件: PipeBasic.java
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
 类方法
 同包方法