mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 20:12:19 +00:00
Fix ItemBlockWood getIcon(ItemStack stack, int pass) to work correctly
This commit is contained in:
1 parent
cf69299087
commit
df02bf1d26
3 files changed
+39
-1
No files matched your search
@@ -178,12 +178,18 @@ public class ItemBeeGE extends ItemGE {
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack itemstack, int renderPass) {
|
||||
return getIconFromSpecies(BeeGenome.getSpecies(itemstack), renderPass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconIndex(ItemStack stack) {
|
||||
return getIcon(stack, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromSpecies(IAlleleBeeSpecies species, int renderPass) {
|
||||
if (species == null) {
|
||||
|
||||
@@ -16,10 +16,16 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.blocks.BlockLog;
|
||||
import forestry.arboriculture.render.IconProviderWood;
|
||||
import forestry.arboriculture.tiles.TileWood;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.items.ItemBlockForestry;
|
||||
@@ -98,4 +104,24 @@ public class ItemBlockWood extends ItemBlockForestry {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
EnumWoodType woodType = EnumWoodType.getFromCompound(stack.getTagCompound());
|
||||
if (woodType == null) {
|
||||
return super.getIcon(stack, pass);
|
||||
}
|
||||
|
||||
if (getBlock() instanceof BlockLog) {
|
||||
return IconProviderWood.getBarkIcon(woodType);
|
||||
} else {
|
||||
return IconProviderWood.getPlankIcon(woodType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconIndex(ItemStack stack) {
|
||||
return getIcon(stack, 0);
|
||||
}
|
||||
}
|
||||
@@ -143,6 +143,12 @@ public class ItemGermlingGE extends ItemGE implements IVariableFermentable {
|
||||
return species.getGermlingIcon(type, renderPass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconIndex(ItemStack stack) {
|
||||
return getIcon(stack, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float facingX, float facingY, float facingZ) {
|
||||
ITree tree = TreeManager.treeRoot.getMember(itemstack);
|
||||
|
||||
Reference in new issue
Block a user