Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Removing that Pesky Foliage Color
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
gosaints70

Removing that Pesky Foliage Color

By gosaints70, September 3, 2014 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

gosaints70    1

gosaints70

gosaints70    1

  • Tree Puncher
  • gosaints70
  • Members
  • 1
  • 29 posts
Posted September 3, 2014

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;

    }

 

  • Quote

Share this post


Link to post
Share on other sites

Jwosty    9

Jwosty

Jwosty    9

  • Creeper Killer
  • Jwosty
  • Forge Modder
  • 9
  • 128 posts
Posted September 3, 2014

You might have to write your own block renderer. Could be wrong though.

  • Quote

I like to make mods, just like you. Here's one worth checking out

Share this post


Link to post
Share on other sites

jabelar    593

jabelar

jabelar    593

  • Reality Controller
  • jabelar
  • Members
  • 593
  • 3266 posts
Posted September 4, 2014

What happens if you return 0xFFFFFF (i.e. white instead of black)?

  • Quote

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Share this post


Link to post
Share on other sites

gosaints70    1

gosaints70

gosaints70    1

  • Tree Puncher
  • gosaints70
  • Members
  • 1
  • 29 posts
Posted September 4, 2014

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;

    }

 

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Do stuff right after login

      By diesieben07 · Posted 9 minutes ago

      Yes, it is server side only. For client-side you can use ClientPlayerNetworkEvent.LoggedInEvent.
    • dotifo7120
      Do stuff right after login

      By dotifo7120 · Posted 14 minutes ago

      Is it only server-side? I tried to use in client and the event wasn't firing. 🙁
    • diesieben07
      Do stuff right after login

      By diesieben07 · Posted 54 minutes ago

      PlayerLoggedInEvent
    • dotifo7120
      Do stuff right after login

      By dotifo7120 · Posted 1 hour ago

      Is there an event called when a player enters into the world (fully logged)?
    • diesieben07
      Windows installer

      By diesieben07 · Posted 1 hour ago

      Just use the installer, it is cross-platform.
  • Topics

    • dotifo7120
      3
      Do stuff right after login

      By dotifo7120
      Started 1 hour ago

    • T_Jam1
      1
      Windows installer

      By T_Jam1
      Started 1 hour ago

    • Mounty
      3
      Meine Inkompetenz kennt mal wieder keine Grenzen.(Forge 1.16.1)

      By Mounty
      Started 3 hours ago

    • Amperka_pro
      5
      Как применить нбт к предмету.

      By Amperka_pro
      Started 5 hours ago

    • MistyMarshes
      9
      [1.16.4] Get IChunk World / get current World for the overworld.

      By MistyMarshes
      Started 16 hours ago

  • Who's Online (See full list)

    • jbredwards
    • Alexalien
    • magn919
    • Forix
    • Umpaz
    • dotifo7120
    • jbko6
    • diesieben07
    • ThatBearQuen
    • st4s1k
    • Orbital_Gaming
    • forresttrump
    • Mr. Crafty
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Removing that Pesky Foliage Color
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community