mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
tinted vegetation
This commit is contained in:
parent
30f41fe1b0
commit
108b581df2
@ -9,6 +9,8 @@ import com.hbm.blocks.ModBlocks;
|
|||||||
import com.hbm.blocks.generic.BlockDeadPlant.EnumDeadPlantType;
|
import com.hbm.blocks.generic.BlockDeadPlant.EnumDeadPlantType;
|
||||||
import com.hbm.blocks.generic.BlockTallPlant.EnumTallFlower;
|
import com.hbm.blocks.generic.BlockTallPlant.EnumTallFlower;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.IGrowable;
|
import net.minecraft.block.IGrowable;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
@ -16,6 +18,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.world.ColorizerGrass;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.EnumPlantType;
|
import net.minecraftforge.common.EnumPlantType;
|
||||||
@ -199,6 +202,48 @@ public class BlockNTMFlower extends BlockEnumMulti implements IPlantable, IGrowa
|
|||||||
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBlockColor()
|
||||||
|
{
|
||||||
|
double d0 = 0.5D;
|
||||||
|
double d1 = 1.0D;
|
||||||
|
return ColorizerGrass.getGrassColor(d0, d1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the color this block should be rendered. Used by leaves.
|
||||||
|
*/
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getRenderColor(int meta)
|
||||||
|
{
|
||||||
|
return meta == 0 ? 16777215 : ColorizerGrass.getGrassColor(0.5F, 1F);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
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 = world.getBiomeGenForCoords(x + l1, z + k1).getBiomeFoliageColor(x + l1, y, z + k1);
|
||||||
|
l += (i2 & 16711680) >> 16;
|
||||||
|
i1 += (i2 & 65280) >> 8;
|
||||||
|
j1 += i2 & 255;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
return meta == 0 ? 16777215 : ((l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { }
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { }
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 248 B |
Loading…
x
Reference in New Issue
Block a user