net.minecraftforge.common.property.Properties Java Examples

The following examples show how to use net.minecraftforge.common.property.Properties. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PipeBasic.java    From Logistics-Pipes-2 with MIT License 5 votes vote down vote up
@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;
}
 
Example #2
Source File: PipeBlocking.java    From Logistics-Pipes-2 with MIT License 5 votes vote down vote up
@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;
}
 
Example #3
Source File: PipeChassisMkI.java    From Logistics-Pipes-2 with MIT License 5 votes vote down vote up
@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;
}
 
Example #4
Source File: PipeRouted.java    From Logistics-Pipes-2 with MIT License 5 votes vote down vote up
@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;
}
 
Example #5
Source File: BlockGenerator.java    From YouTubeModdingTutorial with MIT License 4 votes vote down vote up
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this,
            new IProperty[] {Properties.StaticProperty, FACING_HORIZ },
            new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #6
Source File: PipeBasic.java    From Logistics-Pipes-2 with MIT License 4 votes vote down vote up
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #7
Source File: PipeBlocking.java    From Logistics-Pipes-2 with MIT License 4 votes vote down vote up
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #8
Source File: PipeChassisMkI.java    From Logistics-Pipes-2 with MIT License 4 votes vote down vote up
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #9
Source File: PipeRouted.java    From Logistics-Pipes-2 with MIT License 4 votes vote down vote up
@Override
public BlockStateContainer createBlockState() {
	return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
 
Example #10
Source File: VanillaModelWrapper.java    From VanillaFix with MIT License 4 votes vote down vote up
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;
        }
    };
}
 
Example #11
Source File: TidalGenerator.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty },
            new IUnlistedProperty[] { Properties.AnimationProperty });
}
 
Example #12
Source File: BlockGenerator.java    From YouTubeModdingTutorial with MIT License 4 votes vote down vote up
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
    return state.withProperty(Properties.StaticProperty, false);
}
 
Example #13
Source File: Wind.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
	return state.withProperty(Properties.StaticProperty, true);
}
 
Example #14
Source File: Wind.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty }, new IUnlistedProperty[]{ Properties.AnimationProperty });
}
 
Example #15
Source File: Harvester.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
    return state.withProperty(Properties.StaticProperty, true);
}
 
Example #16
Source File: Harvester.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty },
            new IUnlistedProperty[] { Properties.AnimationProperty });
}
 
Example #17
Source File: Scrubber.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
	return state.withProperty(Properties.StaticProperty, true);
}
 
Example #18
Source File: Scrubber.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public ExtendedBlockState createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty }, new IUnlistedProperty[]{ Properties.AnimationProperty });
}
 
Example #19
Source File: TidalGenerator.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
    return state.withProperty(Properties.StaticProperty, true);
}