Posted September 3, 201411 yr Hey there, I was curious how you removed foliage color. I have been playing around with it, but the only thing I managed to do was turn it into a completely black block. Anyone know how to do this? CustomLeafBlock (Up to my attempts to change the color) package com.crystal.block; import java.util.List; import net.minecraft.block.BlockLeaves; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.ColorizerFoliage; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import com.crystal.creativetab.CreativeTabsManager; import com.crystal.lib.StringLibrary; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class MagicalTreeLeaf extends BlockLeaves { { this.setCreativeTab(CreativeTabsManager.tabC); this.setBlockName("MagicalLeaf"); } public static final String[][] leaftypes = new String[][] {{"LeafMagical"}, {"LeafMagicalOpaque"}}; public static final String[] leaves = new String[] {"Magical"}; public MagicalTreeLeaf(Material leaves2) { // TODO Auto-generated constructor stub } @SideOnly(Side.CLIENT) public int getBlockColor() { double d0 = 0.5D; double d1 = 1.0D; //return ColorizerFoliage.getFoliageColor(d0, d1); return 0; } @SideOnly(Side.CLIENT) public int getRenderColor(int p_149741_1_) { //return ColorizerFoliage.getFoliageColorBasic(); return 0; }
September 3, 201411 yr You might have to write your own block renderer. Could be wrong though. I like to make mods, just like you. Here's one worth checking out
September 4, 201411 yr What happens if you return 0xFFFFFF (i.e. white instead of black)? Check out my tutorials here: http://jabelarminecraft.blogspot.com/
September 4, 201411 yr Author Ok, I found what actually changes the color of the block /** * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called * when first determining what to render. */ @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { int l = 0; int i1 = 0; int j1 = 0; for (int k1 = -1; k1 <= 1; ++k1) { for (int l1 = -1; l1 <= 1; ++l1) { int i2 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1).getBiomeFoliageColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1); l += (i2 & 16711680) >> 16; i1 += (i2 & 65280) >> 8; j1 += i2 & 255; } } return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255; }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.