diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPVine.java b/src/main/java/biomesoplenty/common/block/BlockBOPVine.java index 715c1d689..fd1779047 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPVine.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPVine.java @@ -16,6 +16,10 @@ import biomesoplenty.common.item.ItemBOPBlock; import net.minecraft.block.BlockVine; import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemBlock; +import net.minecraft.util.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPVine extends BlockVine implements IBOPBlock { @@ -24,12 +28,44 @@ public class BlockBOPVine extends BlockVine implements IBOPBlock public Map getNamedStates() {return this.namedStates;} public IBlockState getNamedState(String name) {return this.namedStates.get(name);} public Class getItemClass() {return ItemBOPBlock.class;} - - public BlockBOPVine() + + // if set to true, (the default), use BlockVine getBlockColor(), getRenderColor() and colorMultiplier() functions to color the texture based on biome + // if set to false, use 0xFFFFFF for all the color functions so that the texture is used as it is + protected boolean useGreyScaleTextures; + + public BlockBOPVine(boolean useGreyScaleTextures) { super(); this.setHardness(0.2F); + this.useGreyScaleTextures = useGreyScaleTextures; } + public BlockBOPVine() + { + this(true); + } + + @Override + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + return (this.useGreyScaleTextures ? super.getBlockColor() : 0xFFFFFF); + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderColor(IBlockState state) + { + return (this.useGreyScaleTextures ? super.getRenderColor(state) : 0xFFFFFF); + } + + @Override + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return (this.useGreyScaleTextures ? super.colorMultiplier(worldIn, pos, renderPass) : 0xFFFFFF); + } + + } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/init/ModBlocks.java b/src/main/java/biomesoplenty/common/init/ModBlocks.java index 2ff49daf8..ab778a7cb 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/common/init/ModBlocks.java @@ -156,12 +156,12 @@ public class ModBlocks dead_log = registerBlock( new BlockBOPLog(), "dead_log" ); // no planks, stairs, etc //vines - // TODO: colors? rendering modes? special placement rules? - flower_vine = registerBlock( new BlockBOPVine(), "flower_vine" ); - ivy = registerBlock( new BlockBOPVine(), "ivy" ); - moss = registerBlock( new BlockBOPVine(), "moss" ); - tree_moss = registerBlock( new BlockBOPVine(), "tree_moss" ); - wisteria = registerBlock( new BlockBOPVine(), "wisteria" ); + // TODO: special placement rules? + flower_vine = registerBlock( new BlockBOPVine(false), "flower_vine" ); + ivy = registerBlock( new BlockBOPVine(true), "ivy" ); + moss = registerBlock( new BlockBOPVine(true), "moss" ); + tree_moss = registerBlock( new BlockBOPVine(false), "tree_moss" ); + wisteria = registerBlock( new BlockBOPVine(false), "wisteria" ); }