Jump to content

GhostSnyperRecon

Members
  • Posts

    50
  • Joined

  • Last visited

Posts posted by GhostSnyperRecon

  1. hi guys, i was working on some code earlier, and i have come across an issue that revolves around automation. when creating a new furnace for example, what is recommended: use the basic way that minecraft deals with automation, fuel top, input sides, and out put bottom, OR do i go the way of most mods and have fuel in bottom, input in top and output on the side. feed back much appreciated

  2. right, ive got my mod upto date on the latest forge, but when i run it, the console spams errors such as

     

    2013-07-05 16:52:38 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: nature:textures/items/ingotTitanium.png
    2013-07-05 16:52:38 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: nature:textures/items/strangeDust.png
    2013-07-05 16:52:38 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: nature:textures/items/fibre.png
    2013-07-05 16:52:38 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: nature:textures/items/oilDrop.png
    

     

    yet they still all appear in game as what they are meant to look like, any suggestions? or is it just a bug with the latest version?

  3. Have you ever programmed before? Modding != programming. Learning programming by modding is a very bad idea.

     

    i beg to differ with that, i learned programming via modding, and i can now program quite well...

  4. hey guys, im trying to get my custom sounds to play when i right click an item. when i right click it, i get no errors, but also no audio, can anyone help me out here?

     

    my sound reg code

     

     

    package naturemod.common.handlers;

     

    import net.minecraft.client.audio.SoundManager;

    import net.minecraftforge.client.event.sound.SoundLoadEvent;

    import net.minecraftforge.event.ForgeSubscribe;

    import cpw.mods.fml.relauncher.Side;

    import cpw.mods.fml.relauncher.SideOnly;

     

    public class EventSounds

     

    {

    @SideOnly(Side.CLIENT)

        @ForgeSubscribe

    public void onSoundsLoaded(SoundLoadEvent event)

    {

        SoundManager manager = event.manager;

            String [] soundFiles = {

                    "rasta.wav"};

            for (int i = 0; i < soundFiles.length; i++){

              manager.soundPoolSounds.addSound("/assets/nature/resource/sound/" + soundFiles);

            }

    }

    }

     

     

     

     

    my item code

     

     

    package naturemod.common.items;

     

    import java.util.List;

     

    import cpw.mods.fml.relauncher.Side;

    import cpw.mods.fml.relauncher.SideOnly;

    import naturemod.common.Nature;

    import net.minecraft.block.Block;

    import net.minecraft.block.material.Material;

    import net.minecraft.client.renderer.texture.IconRegister;

    import net.minecraft.creativetab.CreativeTabs;

    import net.minecraft.enchantment.Enchantment;

    import net.minecraft.entity.Entity;

    import net.minecraft.entity.player.EntityPlayer;

    import net.minecraft.item.EnumRarity;

    import net.minecraft.item.EnumToolMaterial;

    import net.minecraft.item.Item;

    import net.minecraft.item.ItemStack;

    import net.minecraft.item.ItemTool;

    import net.minecraft.potion.Potion;

    import net.minecraft.potion.PotionEffect;

    import net.minecraft.world.World;

     

    public class ItemSpliff extends Item

    {

        public ItemSpliff(int id)

        {

            super(id);

            maxStackSize = 1;

            this.setCreativeTab(Nature.natureTabItem);

        }

       

        @SideOnly(Side.CLIENT)

     

        /**

        * Returns True is the item is renderer in full 3D when hold.

        */

        public boolean isFull3D()

        {

            return true;

        }

     

        @SideOnly(Side.CLIENT)

     

        /**

        * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities

        * hands.

        */

        public boolean shouldRotateAroundWhenRendering()

        {

            return true;

        }

       

        public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)

        {

        if (!par3EntityPlayer.capabilities.isCreativeMode)

            {

                --par1ItemStack.stackSize;

            }

        par2World.playSoundAtEntity(par3EntityPlayer, "rasta", 1F, 1F);

       

            if (!par2World.isRemote)

            {

            if(!this.isDamaged(par1ItemStack))

            {

            //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.blindness.id, 600, 9));

            par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.confusion.id, 600, 9));

            //par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() + 1);

            }

        }

        return par1ItemStack;

        }

     

       

     

        public EnumRarity getRarity(ItemStack stack)

        {

                        return EnumRarity.epic;

        }

       

        public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)

        {

            par3List.add("\u00a77Good Times Guaranteed");

        }

     

       

    @Override

    @SideOnly(Side.CLIENT)

    public void registerIcons(IconRegister par1IconRegister) {

            this.itemIcon = par1IconRegister.registerIcon("Nature:spliff");

    }

    }

     

     

  5. so yeah as the title says i need some help with how to get textures to work on meta data blocks.

     

    this is my code for the block

     

     

    package naturemod.common.blocks;

     

    import static net.minecraftforge.common.EnumPlantType.Cave;

    import static net.minecraftforge.common.EnumPlantType.Crop;

    import static net.minecraftforge.common.EnumPlantType.Desert;

    import static net.minecraftforge.common.EnumPlantType.Nether;

    import static net.minecraftforge.common.EnumPlantType.Plains;

    import static net.minecraftforge.common.EnumPlantType.Water;

     

    import java.util.List;

     

    import cpw.mods.fml.relauncher.Side;

    import cpw.mods.fml.relauncher.SideOnly;

    import net.minecraft.block.Block;

    import net.minecraft.block.BlockFlower;

    import net.minecraft.block.material.Material;

    import net.minecraft.client.renderer.texture.IconRegister;

    import net.minecraft.creativetab.CreativeTabs;

    import net.minecraft.item.ItemStack;

    import net.minecraft.util.Icon;

    import net.minecraft.world.IBlockAccess;

    import net.minecraft.world.World;

    import net.minecraftforge.common.EnumPlantType;

    import net.minecraftforge.common.IPlantable;

     

    public class BlockMoreFlowers extends BlockFlower implements IPlantable

    {

    private Icon[] icon;

     

        public static final String[] flowerType = new String[] {"flowerOrange", "flowerMagenta", "flowerLBlue", "flowerPink", "flowerCyan", "flowerPurple"};

        private static final String[] field_94370_b = new String[] {"Nature:flower_0", "Nature:flower_1", "Nature:flower_2", "Nature:flower_3", "Nature:flower_4", "Nature:flower_5"};

        @SideOnly(Side.CLIENT)

        private Icon[] flowerIcon;

     

    public BlockMoreFlowers(int id)

    {

    super(id, Material.plants);

    this.setStepSound(soundGrassFootstep);

    this.setHardness(0.0f);

    this.disableStats();

    }

     

    @SideOnly(Side.CLIENT)

     

        /**

        * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata

        */

        public Icon getIcon(int par1, int par2)

        {

            return this.icon[par2 % this.icon.length];

        }

       

        public int getDamageValue(World par1World, int par2, int par3, int par4)

        {

            return par1World.getBlockMetadata(par2, par3, par4);

        }

     

    @Override

    public int damageDropped (int metadata) {

    return metadata;

    }

     

    @SideOnly(Side.CLIENT)

    public void getSubBlocks(int unknown, CreativeTabs tab, List subItems) {

    for (int ix = 0; ix < 6; ix++) {

    subItems.add(new ItemStack(this, 1, ix));

    }

    }

     

    @Override

    @SideOnly(Side.CLIENT)

    public void registerIcons(IconRegister par1IconRegister) {

        this.icon = new Icon[6];

        for(int i = 0; i < 6; i++) {

            this.icon = par1IconRegister.registerIcon("Nature:flower_" + i);

        }

    }

     

        @Override

        public EnumPlantType getPlantType(World world, int x, int y, int z)

        {

            return Plains;

        }

     

        @Override

        public int getPlantID(World world, int x, int y, int z)

        {

            return blockID;

        }

     

        @Override

        public int getPlantMetadata(World world, int x, int y, int z)

        {

            return world.getBlockMetadata(x, y, z);

        }

    }

     

     

     

     

    and this is the error im getting:

     

     

    2013-07-02 22:08:23 [iNFO] [sTDOUT] Time: 02/07/13 22:08

    2013-07-02 22:08:23 [iNFO] [sTDOUT] Description: Unexpected error

    2013-07-02 22:08:23 [iNFO] [sTDOUT]

    2013-07-02 22:08:23 [iNFO] [sTDOUT] java.lang.NullPointerException

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at naturemod.common.blocks.BlockMoreFlowers.getIcon(BlockMoreFlowers.java:50)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.renderer.RenderBlocks.getBlockIconFromSideAndMetadata(RenderBlocks.java:8164)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.renderer.RenderBlocks.drawCrossedSquares(RenderBlocks.java:3604)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.renderer.RenderBlocks.renderCrossedSquares(RenderBlocks.java:3482)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.renderer.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:449)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.renderer.WorldRenderer.updateRenderer(WorldRenderer.java:224)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.renderer.RenderGlobal.updateRenderers(RenderGlobal.java:1561)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1129)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:930)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:822)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)

    2013-07-02 22:08:23 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

     

     

  6. Hi guys, im trying to work out how i add a smelting recipe that can do the following. how can i make a recipe that could for say, smelt 9 iron ore into 1 iron block. now, the custom furnace i am making has 2 item inputs excluding the fuel slot

     

     

     

    package naturemod.common.recipes;

     

    import java.util.Arrays;

    import java.util.HashMap;

    import java.util.Map;

     

    import naturemod.common.lib.NatureItems;

    import net.minecraft.block.Block;

    import net.minecraft.item.Item;

    import net.minecraft.item.ItemStack;

     

    public class LabBenchRecipes

    {

    private static final LabBenchRecipes labBenchBase = new LabBenchRecipes();

    private Map labBenchList;

     

    public static final LabBenchRecipes labBench()

    {

    return labBenchBase;

    }

     

    private LabBenchRecipes()

    {

    labBenchList = new HashMap();

    //Add a recipe (here: Stone,Grass->1Diamond)

     

    addLabBenchRecipe(Item.lightStoneDust.itemID, NatureItems.ingotStrange.itemID, new ItemStack(Item.enderPearl));

    addLabBenchRecipe(NatureItems.acrylicBottle.itemID, Item.diamond.itemID, new ItemStack(Item.ghastTear));

    addLabBenchRecipe(NatureItems.oilDrop.itemID, Item.redstone.itemID, new ItemStack(Item.gunpowder));

    addLabBenchRecipe(Item.beefRaw.itemID, Block.mushroomBrown.blockID, new ItemStack(Item.rottenFlesh));

    addLabBenchRecipe(Item.chickenRaw.itemID, Block.mushroomBrown.blockID, new ItemStack(Item.rottenFlesh));

    addLabBenchRecipe(Item.porkRaw.itemID, Block.mushroomBrown.blockID, new ItemStack(Item.rottenFlesh));

    addLabBenchRecipe(Item.rottenFlesh.itemID, Item.eyeOfEnder.itemID, new ItemStack(Item.spiderEye));

    }

    /**

    * puts the recipe into a Hashmap

    *@param input1 ItemID of the first item

    *@param input2 ItemID of the second item

    *@param output the ItemStack which gets created by the recipe

    */

    public void addLabBenchRecipe(int input1, int input2, ItemStack output)

    {

     

    StringBuffer sb= new StringBuffer(32);

     

    sb.append(Math.min(input1,input2)).append("_").append(Math.max(input1,input2));

    labBenchList.put(sb.toString(), output);

    }

     

    public ItemStack getLabBenchResult(int input1,int input2)

    {

    StringBuffer sb= new StringBuffer(32);

     

    sb.append(Math.min(input1,input2)).append("_").append(Math.max(input1,input2));

    return (ItemStack) labBenchList.get(sb.toString());

    }

     

    public Map getLabBenchList()

    {

    return labBenchList;

    }

     

    public Object getLabBenchResult(ItemStack item)

    {

    if (item == null)

            {

                return null;

            }

            ItemStack ret = (ItemStack)labBenchList.get(Arrays.asList(item.itemID, item.getItemDamage()));

            if (ret != null)

            {

                return ret;

            }

            return (ItemStack)labBenchList.get(Integer.valueOf(item.itemID));

    }

     

    }

     

     

     

    can anybody help?

  7. hi, im trying to make a custom render for a block that has parts rotating while its active (much like a mill in a windmill). so far i have got it to render, but i cant figure out how to do the rotations. atm, it is either always rotating, not rotating or if one rotates all other blocks of the same type rotate. can anybody help me? here is the code = (sorry, its very messy)

     

    BlockGrinder:

     

     

    package naturemod.common.blocks;

     

    import java.util.Random;

     

    import naturemod.common.Nature;

    import naturemod.common.lib.NatureBlocks;

    import net.minecraft.block.Block;

    import net.minecraft.block.BlockContainer;

    import net.minecraft.block.material.Material;

    import net.minecraft.client.renderer.texture.IconRegister;

    import net.minecraft.entity.EntityLiving;

    import net.minecraft.entity.item.EntityItem;

    import net.minecraft.entity.player.EntityPlayer;

    import net.minecraft.item.ItemStack;

    import net.minecraft.nbt.NBTTagCompound;

    import net.minecraft.tileentity.TileEntity;

    import net.minecraft.util.AxisAlignedBB;

    import net.minecraft.util.MathHelper;

    import net.minecraft.world.IBlockAccess;

    import net.minecraft.world.World;

    import cpw.mods.fml.relauncher.Side;

    import cpw.mods.fml.relauncher.SideOnly;

     

    public class BlockGrinder extends BlockContainer

    {

        /**

        * Is the random generator used by grinder to drop the inventory contents in random directions.

        */

        private static Random grinderRand = new Random();

     

        /** True if this is an active grinder, false if idle */

        private final boolean isActive;

     

        /**

        * This flag is used to prevent the grinder inventory to be dropped upon block removal, is used internally when the

        * grinder block changes from idle to active and vice-versa.

        */

        private static boolean keepgrinderInventory = false;

     

        public BlockGrinder(int par1, boolean par2)

        {

            super(par1, Material.rock);

            this.isActive = par2;

            this.setUnlocalizedName("Grinder");

        }

     

        public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4, Block block)

        {

    return null;

        }

     

    public boolean isOpaqueCube()

        {

            return false;

        }

     

    @Override

    public boolean renderAsNormalBlock()

    {

    return false;

    }

     

    @Override

    public int getRenderType()

    {

    return -1;

    }

     

        public TileEntity createNewTileEntity(World par1World)

        {

            TileEntityGrinder tileentitygrinder = new TileEntityGrinder();

            return tileentitygrinder;

        }

     

        /**

        * Returns the ID of the items to drop on destruction.

        */

        public int idDropped(int par1, Random par2Random, int par3)

        {

            return NatureBlocks.grinderIdle.blockID;

        }

     

        /**

        * Called whenever the block is added into the world. Args: world, x, y, z

        */

        public void onBlockAdded(World par1World, int par2, int par3, int par4)

        {

        updateRender(par1World, par2, par3, par4); //Used For Blocks Just Added

            super.onBlockAdded(par1World, par2, par3, par4);

        }

     

     

        /*

        @SideOnly(Side.CLIENT)

        public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)

        {

            if (this.isActive)

            {

        float f = (float) par2 + 0.5F;

        float f1 = (float) par3 + 0.0F + (par5Random.nextFloat() * 6F) / 16F;

        float f2 = (float) par4 + 0.5F;

        float f3 = 0.52F;

        float f4 = par5Random.nextFloat() * 0.6F - 0.3F;

     

        par1World.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);

        par1World.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);

        par1World.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);

        par1World.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);

            }

        }

        */

       

        /**

        * Called upon block activation (right click on the block.)

        */

        public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)

        {

            if (par1World.isRemote)

            {

                return true;

            }

            else

            {

                TileEntityGrinder var10 = (TileEntityGrinder)par1World.getBlockTileEntity(par2, par3, par4);

     

                if (var10 != null)

                {

                par5EntityPlayer.openGui(Nature.instance, 0, par1World, par2, par3, par4);

                }

     

                return true;

            }

        }

       

        /**

        * Update which block ID the grinder is using depending on whether or not it is burning

        */

        //@SideOnly(Side.CLIENT)

        public static void updateGrinderBlockState(boolean par0, World par1World, int par2, int par3, int par4)

        {

            int l = par1World.getBlockMetadata(par2, par3, par4);

            TileEntity tileentity = par1World.getBlockTileEntity(par2, par3, par4);

            TileEntityGrinder tileEntity = new TileEntityGrinder();

            keepgrinderInventory = true;

           

            if (par0)

            {

                par1World.setBlock(par2, par3, par4, NatureBlocks.grinderActive.blockID);

                System.out.println("X"+"*"+par2+"");System.out.println("Y"+"*"+par3+"");System.out.println("Z"+"*"+par4+"");

                System.out.println("Active");

            }

            else

            {

                par1World.setBlock(par2, par3, par4, NatureBlocks.grinderIdle.blockID);

                System.out.println("DeActivated");

            }

     

            keepgrinderInventory = false;

            par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);

     

            if (tileentity != null)

            {

                tileentity.validate();

                par1World.setBlockTileEntity(par2, par3, par4, tileentity);

            }

        }

       

        /**

        * ejects contained items into the world, and notifies neighbours of an update, as appropriate

        */

        public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)

        {

            if (!keepgrinderInventory)

            {

                TileEntityGrinder var7 = (TileEntityGrinder)par1World.getBlockTileEntity(par2, par3, par4);

     

                if (var7 != null)

                {

                    for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8)

                    {

                        ItemStack var9 = var7.getStackInSlot(var8);

     

                        if (var9 != null)

                        {

                            float var10 = this.grinderRand.nextFloat() * 0.8F + 0.1F;

                            float var11 = this.grinderRand.nextFloat() * 0.8F + 0.1F;

                            float var12 = this.grinderRand.nextFloat() * 0.8F + 0.1F;

     

                            while (var9.stackSize > 0)

                            {

                                int var13 = this.grinderRand.nextInt(21) + 10;

     

                                if (var13 > var9.stackSize)

                                {

                                    var13 = var9.stackSize;

                                }

     

                                var9.stackSize -= var13;

                                EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage()));

     

                                if (var9.hasTagCompound())

                                {

                                var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy());

                                }

     

                                float var15 = 0.05F;

                                var14.motionX = (double)((float)this.grinderRand.nextGaussian() * var15);

                                var14.motionY = (double)((float)this.grinderRand.nextGaussian() * var15 + 0.2F);

                                var14.motionZ = (double)((float)this.grinderRand.nextGaussian() * var15);

                                par1World.spawnEntityInWorld(var14);

                            }

                        }

                    }

                }

            }

     

            super.breakBlock(par1World, par2, par3, par4, par5, par6);

        }

       

        @SideOnly(Side.CLIENT)

     

        /**

        * A randomly called display update to be able to add particles or other items for display

        */

        public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)

        {

            if (this.isActive)

            {

                int l = par1World.getBlockMetadata(par2, par3, par4);

                float f = (float)par2 + 0.5F;

                float f1 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F;

                float f2 = (float)par4 + 0.5F;

                float f3 = 0.52F;

                float f4 = par5Random.nextFloat() * 0.6F - 0.3F;

     

                if (l == 0)

                {

                    par1World.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);

                    par1World.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);

                    par1World.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);

                    par1World.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);

                    par1World.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);

                    par1World.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);

                    par1World.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);

                    par1World.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);

                }

               

                updateRender(par1World, par2, par3, par4); //For When The World Is Loaded

            }

        }

       

        private void updateRender(World par1World, int par2, int par3, int par4)

        {

        TileEntityGrinder tileEntity = (TileEntityGrinder)par1World.getBlockTileEntity(par2, par3, par4);

        if(this.isActive)

        {

        tileEntity.Active = true;

        }

     

        }

       

    @Override

    @SideOnly(Side.CLIENT)

    public void registerIcons(IconRegister par1IconRegister) {

            this.blockIcon = par1IconRegister.registerIcon("wood");

    }

    }

     

     

     

     

    TileEntityGrinder:

     

     

    package naturemod.common.blocks;

     

    import naturemod.common.recipes.GrinderRecipes;

    import net.minecraft.block.Block;

    import net.minecraft.block.material.Material;

    import net.minecraft.entity.player.EntityPlayer;

    import net.minecraft.inventory.IInventory;

    import net.minecraft.item.Item;

    import net.minecraft.item.ItemBlock;

    import net.minecraft.item.ItemHoe;

    import net.minecraft.item.ItemStack;

    import net.minecraft.item.ItemSword;

    import net.minecraft.item.ItemTool;

    import net.minecraft.nbt.NBTTagCompound;

    import net.minecraft.nbt.NBTTagList;

    import net.minecraft.tileentity.TileEntity;

    import net.minecraftforge.common.ForgeDirection;

    import net.minecraftforge.common.ISidedInventory;

    import cpw.mods.fml.common.registry.GameRegistry;

    import cpw.mods.fml.relauncher.Side;

    import cpw.mods.fml.relauncher.SideOnly;

     

    public class TileEntityGrinder extends TileEntity implements IInventory, ISidedInventory

    {

    public boolean Active = false;

     

    public float grindAngle;

     

        /** The angle of the lid last tick */

        public float prevGrindAngle;

        /**

        * The ItemStacks that hold the items currently being used in the grinder

        */

        private ItemStack[] grinderItemStacks = new ItemStack[3];

     

        /** The number of ticks that the grinder will keep burning */

        public int grinderBurnTime = -1;

     

        /**

        * The number of ticks that a fresh copy of the currently-burning item would keep the grinder burning for

        */

        public int currentItemBurnTime = -1;

     

        /** The number of ticks that the current item has been cooking for */

        public int grinderCookTime = 0;

     

        /**

        * Returns the number of slots in the inventory.

        */

        public int getSizeInventory()

        {

            return this.grinderItemStacks.length;

        }

     

        /**

        * Returns the stack in slot i

        */

        public ItemStack getStackInSlot(int par1)

        {

            return this.grinderItemStacks[par1];

        }

     

        /**

        * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a

        * new stack.

        */

        public ItemStack decrStackSize(int par1, int par2)

        {

            if (this.grinderItemStacks[par1] != null)

            {

                ItemStack var3;

     

                if (this.grinderItemStacks[par1].stackSize <= par2)

                {

                    var3 = this.grinderItemStacks[par1];

                    this.grinderItemStacks[par1] = null;

                    return var3;

                }

                else

                {

                    var3 = this.grinderItemStacks[par1].splitStack(par2);

     

                    if (this.grinderItemStacks[par1].stackSize == 0)

                    {

                        this.grinderItemStacks[par1] = null;

                    }

     

                    return var3;

                }

            }

            else

            {

                return null;

            }

        }

     

        /**

        * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -

        * like when you close a workbench GUI.

        */

        public ItemStack getStackInSlotOnClosing(int par1)

        {

            if (this.grinderItemStacks[par1] != null)

            {

                ItemStack var2 = this.grinderItemStacks[par1];

                this.grinderItemStacks[par1] = null;

                return var2;

            }

            else

            {

                return null;

            }

        }

     

        /**

        * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).

        */

        public void setInventorySlotContents(int par1, ItemStack par2ItemStack)

        {

            this.grinderItemStacks[par1] = par2ItemStack;

     

            if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit())

            {

                par2ItemStack.stackSize = this.getInventoryStackLimit();

            }

        }

     

        /**

        * Returns the name of the inventory.

        */

        public String getInvName()

        {

            return "container.grinder";

        }

     

        /**

        * Reads a tile entity from NBT.

        */

        public void readFromNBT(NBTTagCompound par1NBTTagCompound)

        {

            super.readFromNBT(par1NBTTagCompound);

            NBTTagList var2 = par1NBTTagCompound.getTagList("Items");

            this.grinderItemStacks = new ItemStack[this.getSizeInventory()];

     

            for (int var3 = 0; var3 < var2.tagCount(); ++var3)

            {

                NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);

                byte var5 = var4.getByte("Slot");

     

                if (var5 >= 0 && var5 < this.grinderItemStacks.length)

                {

                    this.grinderItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4);

                }

            }

     

            this.grinderBurnTime = par1NBTTagCompound.getShort("BurnTime");

            this.grinderCookTime = par1NBTTagCompound.getShort("CookTime");

            this.currentItemBurnTime = getItemBurnTime(this.grinderItemStacks[1]);

        }

     

        /**

        * Writes a tile entity to NBT.

        */

        public void writeToNBT(NBTTagCompound par1NBTTagCompound)

        {

            super.writeToNBT(par1NBTTagCompound);

            par1NBTTagCompound.setShort("BurnTime", (short)this.grinderBurnTime);

            par1NBTTagCompound.setShort("CookTime", (short)this.grinderCookTime);

            NBTTagList var2 = new NBTTagList();

     

            for (int var3 = 0; var3 < this.grinderItemStacks.length; ++var3)

            {

                if (this.grinderItemStacks[var3] != null)

                {

                    NBTTagCompound var4 = new NBTTagCompound();

                    var4.setByte("Slot", (byte)var3);

                    this.grinderItemStacks[var3].writeToNBT(var4);

                    var2.appendTag(var4);

                }

            }

     

            par1NBTTagCompound.setTag("Items", var2);

        }

     

        /**

        * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't

        * this more of a set than a get?*

        */

        public int getInventoryStackLimit()

        {

            return 64;

        }

     

        @SideOnly(Side.CLIENT)

     

        /**

        * Returns an integer between 0 and the passed value representing how close the current item is to being completely

        * cooked

        */

        public int getCookProgressScaled(int par1)

        {

            return this.grinderCookTime * par1 / 200;

        }

     

        @SideOnly(Side.CLIENT)

     

        /**

        * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel

        * item, where 0 means that the item is exhausted and the passed value means that the item is fresh

        */

        public int getBurnTimeRemainingScaled(int par1)

        {

            if (this.currentItemBurnTime == 0)

            {

                this.currentItemBurnTime = 200;

            }

     

            return this.grinderBurnTime * par1 / this.currentItemBurnTime;

        }

     

        /**

        * Returns true if the grinder is currently burning

        */

        public boolean isBurning()

        {

            return this.grinderBurnTime < 0;

        }

       

        public boolean isGrinding()

        {

            return this.grinderCookTime < 0;

        }

     

        /**

        * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count

        * ticks and creates a new spawn inside its implementation.

        */

        public void updateEntity()

        {

            boolean var1 = this.grinderCookTime > 0;

            boolean var2 = false;

     

            if (this.grinderBurnTime < 0)

            {

                --this.grinderBurnTime;

            }

     

            if (!this.worldObj.isRemote)

            {

                    if (this.grinderBurnTime > 0)

                    {

                        var2 = true;

     

                        if (this.grinderItemStacks[1] != null)

                        {

                            --this.grinderItemStacks[1].stackSize;

     

                            if (this.grinderItemStacks[1].stackSize == 0)

                            {

                                this.grinderItemStacks[1] = this.grinderItemStacks[1].getItem().getContainerItemStack(grinderItemStacks[1]);

                            }

                        }

                }

     

                if (this.canSmelt())

                {

                    ++this.grinderCookTime;

     

                    if (this.grinderCookTime == 500)

                    {

                        this.grinderCookTime = 0;

                        this.smeltItem();

                        var2 = true;

                    }

                }

                else

                {

                    this.grinderCookTime = 0;

                }

     

                if (var1 != this.grinderCookTime > 0)

                {

                    var2 = true;

                    BlockGrinder.updateGrinderBlockState(this.grinderCookTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);

                }

            }

     

            if (var2)

            {

                this.onInventoryChanged();

            }

        }

     

        /**

        * Returns true if the grinder can smelt an item, i.e. has a source item, destination stack isn't full, etc.

        */

        private boolean canSmelt()

        {

            if (this.grinderItemStacks[0] == null)

            {

                return false;

            }

            else

            {

                ItemStack var1 = GrinderRecipes.smelting().getSmeltingResult(this.grinderItemStacks[0]);

                if (var1 == null) return false;

                if (this.grinderItemStacks[2] == null) return true;

                if (!this.grinderItemStacks[2].isItemEqual(var1)) return false;

                int result = grinderItemStacks[2].stackSize + var1.stackSize;

                return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize());

            }

        }

     

        /**

        * Turn one item from the grinder source stack into the appropriate smelted item in the grinder result stack

        */

        public void smeltItem()

        {

            if (this.canSmelt())

            {

                ItemStack var1 = GrinderRecipes.smelting().getSmeltingResult(this.grinderItemStacks[0]);

     

                if (this.grinderItemStacks[2] == null)

                {

                    this.grinderItemStacks[2] = var1.copy();

                }

                else if (this.grinderItemStacks[2].isItemEqual(var1))

                {

                    grinderItemStacks[2].stackSize += var1.stackSize;

                }

     

                --this.grinderItemStacks[0].stackSize;

     

                if (this.grinderItemStacks[0].stackSize <= 0)

                {

                    this.grinderItemStacks[0] = null;

                }

            }

        }

     

        /**

        * Returns the number of ticks that the supplied fuel item will keep the grinder burning, or 0 if the item isn't

        * fuel

        */

        public static int getItemBurnTime(ItemStack par0ItemStack)

        {

            if (par0ItemStack == null)

            {

                return 0;

            }

            else

            {

                int var1 = par0ItemStack.getItem().itemID;

                Item var2 = par0ItemStack.getItem();

     

                if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[var1] != null)

                {

                    Block var3 = Block.blocksList[var1];

     

                    if (var3 == Block.woodSingleSlab)

                    {

                        return 150;

                    }

     

                    if (var3.blockMaterial == Material.wood)

                    {

                        return 300;

                    }

                }

     

                if (var2 instanceof ItemTool && ((ItemTool) var2).getToolMaterialName().equals("WOOD")) return 200;

                //if (var2 instanceof ItemSword && ((ItemSword) var2).func_77825_f().equals("WOOD")) return 200;

                if (var2 instanceof ItemHoe && ((ItemHoe) var2).func_77842_f().equals("WOOD")) return 200;

                if (var1 == Item.stick.itemID) return 100;

                if (var1 == Item.coal.itemID) return 1600;

                if (var1 == Item.bucketLava.itemID) return 20000;

                if (var1 == Block.sapling.blockID) return 100;

                if (var1 == Item.blazeRod.itemID) return 2400;

                return GameRegistry.getFuelValue(par0ItemStack);

            }

        }

     

        /**

        * Return true if item is a fuel source (getItemBurnTime() > 0).

        */

        public static boolean isItemFuel(ItemStack par0ItemStack)

        {

            return getItemBurnTime(par0ItemStack) > 0;

        }

     

        /**

        * Do not make give this method the name canInteractWith because it clashes with Container

        */

        public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer)

        {

            return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;

        }

     

        public void openChest() {}

     

        public void closeChest() {}

     

        @Override

        public int getStartInventorySide(ForgeDirection side)

        {

            if (side == ForgeDirection.DOWN) return 1;

            if (side == ForgeDirection.UP) return 0;

            return 2;

        }

     

        @Override

        public int getSizeInventorySide(ForgeDirection side)

        {

            return 1;

        }

     

    @Override

    public boolean isInvNameLocalized() {

    // TODO Auto-generated method stub

    return false;

    }

     

    @Override

    public boolean isStackValidForSlot(int i, ItemStack itemstack) {

    // TODO Auto-generated method stub

    return false;

    }

    }

     

     

     

     

    RenderGrinder:

     

     

    package naturemod.client.renders;

     

    import naturemod.client.models.ModelGrinder;

    import naturemod.common.blocks.BlockGrinder;

    import naturemod.common.blocks.TileEntityGrinder;

    import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

    import net.minecraft.tileentity.TileEntity;

    import net.minecraft.tileentity.TileEntityChest;

     

    import org.lwjgl.opengl.GL11;

    import org.lwjgl.opengl.GL12;

     

    import cpw.mods.fml.relauncher.Side;

    import cpw.mods.fml.relauncher.SideOnly;

     

    @SideOnly(Side.CLIENT)

    public class RenderGrinder extends TileEntitySpecialRenderer

    {

    private ModelGrinder aModel;

    private BlockGrinder grinder;

    private double angle;

    private double angle1;

     

    public RenderGrinder()

    {

    aModel = new ModelGrinder();

    }

     

    public void renderAModelAt(TileEntityGrinder tileEntity, double d, double d1, double d2, float f)

    {

      int i = 0;

     

      if (tileEntity.func_70309_m()) {

      i = tileEntity.getBlockMetadata();

      }

     

        GL11.glPushMatrix();

        GL11.glEnable(GL12.GL_RESCALE_NORMAL);

    GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);

    GL11.glRotatef(180, 0F, 0F, 1F);

    bindTextureByName("/Nature/textures/blocks/grinder.png");

    aModel.renderModel(0.0625F);

    aModel.renderGrindWheel1();

    aModel.renderGrindWheel2();

    float f1 = tileEntity.prevGrindAngle + (tileEntity.grindAngle - tileEntity.prevGrindAngle) * f;

        angle = angle + 0.01;

    angle1 = angle1 - 0.01;

    f1 = 1.0F - f1;

        f1 = 1.0F - f1 * f1 * f1;

    if(tileEntity.Active == true)

    {

    aModel.GrindWheel.rotateAngleY = -(f1 * (float)Math.PI / 2.0F);

    aModel.GrindWheel1.rotateAngleY = (float)angle1;

    }

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);

        GL11.glPopMatrix();

     

    }

     

    public boolean shouldRender3DInInventory()

    {

        // This is where it asks if you want the renderInventory part called or not.

        return true; // Change to 'true' if you want the Inventory render to be called.

    }

     

    public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)

    {

        this.renderAModelAt((TileEntityGrinder)par1TileEntity, par2, par4, par6, par8);

    }

    }

     

     

     

    ModelGrinder:

     

     

    package naturemod.client.models;

     

    import net.minecraft.client.model.ModelBase;

    import net.minecraft.client.model.ModelRenderer;

    import net.minecraft.entity.Entity;

     

    public class ModelGrinder extends ModelBase

    {

      //fields

    public ModelRenderer Base;

        public ModelRenderer Pilar;

        public ModelRenderer Pilar1;

        public ModelRenderer Pilar2;

        public ModelRenderer Pilar3;

        public ModelRenderer Pole;

        public ModelRenderer GrindWheel = (new ModelRenderer(this, 0, 19)).setTextureSize(128, 64);

        public ModelRenderer GrindWheel1;

        public ModelRenderer Hopper;

        public ModelRenderer HopperSide;

        public ModelRenderer HopperSide1;

        public ModelRenderer HopperSide2;

        public ModelRenderer HopperSide3;

        public ModelRenderer Strut;

        public ModelRenderer StrutTop;

        public ModelRenderer Strut1;

        public ModelRenderer StrutTop1;

        public ModelRenderer Strut2;

        public ModelRenderer Strut3;

        public ModelRenderer StrutTop3;

        public ModelRenderer StrutTop2;

        public ModelRenderer Item;

     

      public ModelGrinder()

      {

        textureWidth = 128;

        textureHeight = 64;

       

          Base = new ModelRenderer(this, 0, 0);

          Base.addBox(0F, 0F, 0F, 16, 3, 16);

          Base.setRotationPoint(-8F, 21F, -8F);

          Base.setTextureSize(128, 64);

          Base.mirror = true;

          setRotation(Base, 0F, 0F, 0F);

          Pilar = new ModelRenderer(this, 0, 32);

          Pilar.addBox(0F, 0F, 0F, 14, 2, 1);

          Pilar.setRotationPoint(-7F, 19F, 6.5F);

          Pilar.setTextureSize(128, 64);

          Pilar.mirror = true;

          setRotation(Pilar, 0F, 0F, 0F);

          Pilar1 = new ModelRenderer(this, 0, 32);

          Pilar1.addBox(0F, 0F, 0F, 1, 2, 14);

          Pilar1.setRotationPoint(6.5F, 19F, -7F);

          Pilar1.setTextureSize(128, 64);

          Pilar1.mirror = true;

          setRotation(Pilar1, 0F, 0F, 0F);

          Pilar2 = new ModelRenderer(this, 0, 32);

          Pilar2.addBox(0F, 0F, 0F, 14, 2, 1);

          Pilar2.setRotationPoint(-7F, 19F, -7.5F);

          Pilar2.setTextureSize(128, 64);

          Pilar2.mirror = true;

          setRotation(Pilar2, 0F, 0F, 0F);

          Pilar3 = new ModelRenderer(this, 0, 32);

          Pilar3.addBox(0F, 0F, 0F, 1, 2, 14);

          Pilar3.setRotationPoint(-7.5F, 19F, -7F);

          Pilar3.setTextureSize(128, 64);

          Pilar3.mirror = true;

          setRotation(Pilar3, 0F, 0F, 0F);

          Pole = new ModelRenderer(this, 44, 19);

          Pole.addBox(0F, 0F, 0F, 2, 7, 2);

          Pole.setRotationPoint(-1F, 14F, -1F);

          Pole.setTextureSize(128, 64);

          Pole.mirror = true;

          //addBox(Pole, 0F, 0F, 0F, 2, 7, 2);

          setRotation(Pole, 0F, 0F, 0F);

          GrindWheel.addBox(-5.5F, 0F, -5.5F, 11, 2, 11);

          GrindWheel.setRotationPoint(0F, 17F, 0F);

          //GrindWheel.mirror = true;

          setRotation(GrindWheel, 0F, 0F, 0F);

          GrindWheel1 = new ModelRenderer(this, 0, 19);

          GrindWheel1.addBox(-5.5F, 0F, -5.5F, 11, 2, 11);

          GrindWheel1.setRotationPoint(0F, 14.8F, 0F);

          GrindWheel1.setTextureSize(128, 64);

          GrindWheel1.mirror = true;

          setRotation(GrindWheel1, 0F, 0F, 0F);

          Hopper = new ModelRenderer(this, 52, 19);

          Hopper.addBox(0F, 0F, 0F, 6, 1, 6);

          Hopper.setRotationPoint(-3F, 13F, -3F);

          Hopper.setTextureSize(128, 64);

          Hopper.mirror = true;

          setRotation(Hopper, 0F, 0F, 0F);

          HopperSide = new ModelRenderer(this, 30, 32);

          HopperSide.addBox(0F, 0F, 0F, 1, 4, 7);

          HopperSide.setRotationPoint(-4F, 10F, -3F);

          HopperSide.setTextureSize(128, 64);

          HopperSide.mirror = true;

          setRotation(HopperSide, 0F, 0F, 0F);

          HopperSide1 = new ModelRenderer(this, 30, 32);

          HopperSide1.addBox(0F, 0F, 0F, 1, 4, 7);

          HopperSide1.setRotationPoint(3F, 10F, -4F);

          HopperSide1.setTextureSize(128, 64);

          HopperSide1.mirror = true;

          setRotation(HopperSide1, 0F, 0F, 0F);

          HopperSide2 = new ModelRenderer(this, 30, 32);

          HopperSide2.addBox(0F, 0F, 0F, 7, 4, 1);

          HopperSide2.setRotationPoint(-4F, 10F, -4F);

          HopperSide2.setTextureSize(128, 64);

          HopperSide2.mirror = true;

          setRotation(HopperSide2, 0F, 0F, 0F);

          HopperSide3 = new ModelRenderer(this, 30, 32);

          HopperSide3.addBox(0F, 0F, 0F, 7, 4, 1);

          HopperSide3.setRotationPoint(-3F, 10F, 3F);

          HopperSide3.setTextureSize(128, 64);

          HopperSide3.mirror = true;

          setRotation(HopperSide3, 0F, 0F, 0F);

          Strut = new ModelRenderer(this, 64, 0);

          Strut.addBox(0F, 0F, 0F, 1, 10, 2);

          Strut.setRotationPoint(7F, 11F, -1F);

          Strut.setTextureSize(128, 64);

          Strut.mirror = true;

          setRotation(Strut, 0F, 0F, 0F);

          StrutTop = new ModelRenderer(this, 70, 0);

          StrutTop.addBox(0F, 0F, 0F, 4, 1, 2);

          StrutTop.setRotationPoint(3F, 11F, -1F);

          StrutTop.setTextureSize(128, 64);

          StrutTop.mirror = true;

          setRotation(StrutTop, 0F, 0F, 0F);

          Strut1 = new ModelRenderer(this, 64, 0);

          Strut1.addBox(0F, 0F, 0F, 1, 10, 2);

          Strut1.setRotationPoint(-8F, 11F, -1F);

          Strut1.setTextureSize(128, 64);

          Strut1.mirror = true;

          setRotation(Strut1, 0F, 0F, 0F);

          StrutTop1 = new ModelRenderer(this, 70, 0);

          StrutTop1.addBox(0F, 0F, 0F, 4, 1, 2);

          StrutTop1.setRotationPoint(-7F, 11F, -1F);

          StrutTop1.setTextureSize(128, 64);

          StrutTop1.mirror = true;

          setRotation(StrutTop1, 0F, 0F, 0F);

          Strut2 = new ModelRenderer(this, 64, 0);

          Strut2.addBox(0F, 0F, 0F, 2, 10, 1);

          Strut2.setRotationPoint(-1F, 11F, -8F);

          Strut2.setTextureSize(128, 64);

          Strut2.mirror = true;

          setRotation(Strut2, 0F, 0F, 0F);

          Strut3 = new ModelRenderer(this, 64, 0);

          Strut3.addBox(0F, 0F, 0F, 2, 10, 1);

          Strut3.setRotationPoint(-1F, 11F, 7F);

          Strut3.setTextureSize(128, 64);

          Strut3.mirror = true;

          setRotation(Strut3, 0F, 0F, 0F);

          StrutTop3 = new ModelRenderer(this, 70, 0);

          StrutTop3.addBox(0F, 0F, 0F, 2, 1, 4);

          StrutTop3.setRotationPoint(-1F, 11F, 3F);

          StrutTop3.setTextureSize(128, 64);

          StrutTop3.mirror = true;

          setRotation(StrutTop3, 0F, 0F, 0F);

          StrutTop2 = new ModelRenderer(this, 70, 0);

          StrutTop2.addBox(0F, 0F, 0F, 2, 1, 4);

          StrutTop2.setRotationPoint(-1F, 11F, -7F);

          StrutTop2.setTextureSize(128, 64);

          StrutTop2.mirror = true;

          setRotation(StrutTop2, 0F, 0F, 0F);

          Item = new ModelRenderer(this, 64, 12);

          Item.addBox(0F, 0F, 0F, 6, 1, 6);

          Item.setRotationPoint(-3F, 11F, -3F);

          Item.setTextureSize(128, 64);

          Item.mirror = true;

          setRotation(Item, 0F, 0F, 0F);

      }

     

      /*

      public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)

      {

        super.render(entity, f, f1, f2, f3, f4, f5);

        setRotationAngles(f, f1, f2, f3, f4, f5, entity);

        Base.render(f5);

        Pilar.render(f5);

        Pilar1.render(f5);

        Pilar2.render(f5);

        Pilar3.render(f5);

        Pole.render(f5);

        GrindWheel.render(f5);

        GrindWheel1.render(f5);

        Hopper.render(f5);

        HopperSide.render(f5);

        HopperSide1.render(f5);

        HopperSide2.render(f5);

        HopperSide3.render(f5);

        Strut.render(f5);

        StrutTop.render(f5);

        Strut1.render(f5);

        StrutTop1.render(f5);

        Strut2.render(f5);

        Strut3.render(f5);

        StrutTop3.render(f5);

        StrutTop2.render(f5);

        Item.render(f5);

      }

      */

     

     

      private void setRotation(ModelRenderer model, float x, float y, float z)

      {

        model.rotateAngleX = x;

        model.rotateAngleY = y;

        model.rotateAngleZ = z;

      }

     

      /*

      public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)

      {

        super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);

      }

      */

     

      public void renderModel(float f1)

      {

        Base.render(f1);

        Pilar.render(f1);

        Pilar1.render(f1);

        Pilar2.render(f1);

        Pilar3.render(f1);

        Pole.render(f1);

        Hopper.render(f1);

        HopperSide.render(f1);

        HopperSide1.render(f1);

        HopperSide2.render(f1);

        HopperSide3.render(f1);

        Strut.render(f1);

        StrutTop.render(f1);

        Strut1.render(f1);

        StrutTop1.render(f1);

        Strut2.render(f1);

        Strut3.render(f1);

        StrutTop3.render(f1);

        StrutTop2.render(f1);

        Item.render(f1);

      }

     

      public void renderGrindWheel1()

      {

      GrindWheel.render(0.0625F);

      }

     

      public void renderGrindWheel2()

      {

      GrindWheel1.render(0.0625F);

      }

    }

     

     

     

  8. right what you will want is something like this:

     

    you will need a variable to be stored somewhere, something like isUpsideDown = false;

    on block added, check to see if there is a block above it, if so set isUpsideDown = true;

    then have it change the bounding box dependant on whether or not upsidedown is true or not and then same for texture

     

     

     

    public static boolean isUpsideDown;

     

      public (yourblockclass)(int id, boolean par2)

      {

          super(id, Material.rock);

          isUpsideDown = par2;

      }

     

    public void onBlockAdded(World par1World, int par2, int par3, int par4) {

          if (par1World.getBlockMetadata(par2, par3, par4) == 0) {

    } if (this.canPlaceFlowerOn(par1World, par2, par3 + 1, par4)) {

                this.isUpsideDown = true;

            }else

            {

              this.isUpsideDown = false;

            }

          }

     

    public void onUpdate(World par1World)

    {

      if(par1World.isRemote)

        {

          if(isUpsideDown == true)

          {

          this.blockIndexInTexture = (your upsidedown texture id);

          }else

          {

          this.blockIndexInTexture = (your normal flower texture);

          }

        }

    }

     

     

     

    that code might work (it goes into your block file) , im in college right now so i cant access my code, but if you havent solved it by when i get home ill make some working code, hope this helps!

  9. here is the tile entity, and unfortunatly, i could get it to work with those suggestions

     

     

     

    package naturemod.common.blocks;

     

    import naturemod.common.Nature;

    import naturemod.common.recipes.GrinderRecipes;

    import net.minecraft.block.Block;

    import net.minecraft.block.material.Material;

    import net.minecraft.entity.player.EntityPlayer;

    import net.minecraft.inventory.IInventory;

    import net.minecraft.item.Item;

    import net.minecraft.item.ItemBlock;

    import net.minecraft.item.ItemHoe;

    import net.minecraft.item.ItemStack;

    import net.minecraft.item.ItemSword;

    import net.minecraft.item.ItemTool;

    import net.minecraft.nbt.NBTTagCompound;

    import net.minecraft.nbt.NBTTagList;

    import net.minecraft.tileentity.TileEntity;

    import net.minecraftforge.common.ForgeDirection;

    import net.minecraftforge.common.ISidedInventory;

    import cpw.mods.fml.common.registry.GameRegistry;

    import cpw.mods.fml.relauncher.Side;

    import cpw.mods.fml.relauncher.SideOnly;

     

    public class TileEntityGrinder extends TileEntity implements IInventory, ISidedInventory

    {

     

        /**

        * The ItemStacks that hold the items currently being used in the grinder

        */

        private ItemStack[] grinderItemStacks = new ItemStack[3];

     

        /** The number of ticks that the grinder will keep burning */

        public int grinderBurnTime = -1;

     

        /**

        * The number of ticks that a fresh copy of the currently-burning item would keep the grinder burning for

        */

        public int currentItemBurnTime = -1;

     

        /** The number of ticks that the current item has been cooking for */

        public static int grinderCookTime = 0;

     

    public String getInvName()

        {

            return "container.grinder";

        }

     

        /**

        * Returns the number of slots in the inventory.

        */

        public int getSizeInventory()

        {

            return this.grinderItemStacks.length;

        }

        /**

        * Returns the stack in slot i

        */

        public ItemStack getStackInSlot(int par1)

        {

            return this.grinderItemStacks[par1];

        }

     

        /**

        * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a

        * new stack.

        */

        public ItemStack decrStackSize(int par1, int par2)

        {

            if (this.grinderItemStacks[par1] != null)

            {

                ItemStack var3;

     

                if (this.grinderItemStacks[par1].stackSize <= par2)

                {

                    var3 = this.grinderItemStacks[par1];

                    this.grinderItemStacks[par1] = null;

                    return var3;

                }

                else

                {

                    var3 = this.grinderItemStacks[par1].splitStack(par2);

     

                    if (this.grinderItemStacks[par1].stackSize == 0)

                    {

                        this.grinderItemStacks[par1] = null;

                    }

     

                    return var3;

                }

            }

            else

            {

                return null;

            }

        }

     

        /**

        * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -

        * like when you close a workbench GUI.

        */

        public ItemStack getStackInSlotOnClosing(int par1)

        {

            if (this.grinderItemStacks[par1] != null)

            {

                ItemStack var2 = this.grinderItemStacks[par1];

                this.grinderItemStacks[par1] = null;

                return var2;

            }

            else

            {

                return null;

            }

        }

     

        /**

        * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).

        */

        public void setInventorySlotContents(int par1, ItemStack par2ItemStack)

        {

            this.grinderItemStacks[par1] = par2ItemStack;

     

            if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit())

            {

                par2ItemStack.stackSize = this.getInventoryStackLimit();

            }

        }

     

        /**

        * Reads a tile entity from NBT.

        */

        public void readFromNBT(NBTTagCompound par1NBTTagCompound)

        {

            super.readFromNBT(par1NBTTagCompound);

            NBTTagList var2 = par1NBTTagCompound.getTagList("Items");

            this.grinderItemStacks = new ItemStack[this.getSizeInventory()];

     

            for (int var3 = 0; var3 < var2.tagCount(); ++var3)

            {

                NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);

                byte var5 = var4.getByte("Slot");

     

                if (var5 >= 0 && var5 < this.grinderItemStacks.length)

                {

                    this.grinderItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4);

                }

            }

     

            this.grinderBurnTime = par1NBTTagCompound.getShort("BurnTime");

            this.grinderCookTime = par1NBTTagCompound.getShort("CookTime");

            this.currentItemBurnTime = getItemBurnTime(this.grinderItemStacks[1]);

        }

     

        /**

        * Writes a tile entity to NBT.

        */

        public void writeToNBT(NBTTagCompound par1NBTTagCompound)

        {

            super.writeToNBT(par1NBTTagCompound);

            par1NBTTagCompound.setShort("BurnTime", (short)this.grinderBurnTime);

            par1NBTTagCompound.setShort("CookTime", (short)this.grinderCookTime);

            NBTTagList var2 = new NBTTagList();

     

            for (int var3 = 0; var3 < this.grinderItemStacks.length; ++var3)

            {

                if (this.grinderItemStacks[var3] != null)

                {

                    NBTTagCompound var4 = new NBTTagCompound();

                    var4.setByte("Slot", (byte)var3);

                    this.grinderItemStacks[var3].writeToNBT(var4);

                    var2.appendTag(var4);

                }

            }

     

            par1NBTTagCompound.setTag("Items", var2);

        }

     

        /**

        * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't

        * this more of a set than a get?*

        */

        public int getInventoryStackLimit()

        {

            return 64;

        }

     

        @SideOnly(Side.CLIENT)

     

        /**

        * Returns an integer between 0 and the passed value representing how close the current item is to being completely

        * cooked

        */

        public int getCookProgressScaled(int par1)

        {

            return this.grinderCookTime * par1 / 200;

        }

     

        @SideOnly(Side.CLIENT)

     

        /**

        * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel

        * item, where 0 means that the item is exhausted and the passed value means that the item is fresh

        */

        public int getBurnTimeRemainingScaled(int par1)

        {

            if (this.currentItemBurnTime == 0)

            {

                this.currentItemBurnTime = 200;

            }

     

            return this.grinderBurnTime * par1 / this.currentItemBurnTime;

        }

     

        /**

        * Returns true if the grinder is currently burning

        */

        public boolean isBurning()

        {

            return this.grinderBurnTime > 0;

        }

     

        /**

        * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count

        * ticks and creates a new spawn inside its implementation.

        */

        public void updateEntity()

        {

            boolean var1 = this.grinderBurnTime < 0;

            boolean var2 = false;

     

            if (this.grinderBurnTime < 0)

            {

                --this.grinderBurnTime;

            }

     

            if (!this.worldObj.isRemote)

            {

                if (this.grinderCookTime > 0)

                {

                Nature.powered = true;

                }else

                {

                Nature.powered = false;

                }

               

            /*

                if (this.grinderBurnTime == 0 && this.canSmelt())

                {

     

                    if (this.grinderBurnTime < 0)

                    {

                        var2 = true;

     

                        if (this.grinderItemStacks[1] != null)

                        {

                            --this.grinderItemStacks[1].stackSize;

     

                            if (this.grinderItemStacks[1].stackSize == 0)

                            {

                                this.grinderItemStacks[1] = this.grinderItemStacks[1].getItem().getContainerItemStack(grinderItemStacks[1]);

                            }

                        }

                    }

                }

                */

     

                if (this.canSmelt())

                {

                    ++this.grinderCookTime;

     

                    if (this.grinderCookTime == 200)

                    {

                        this.grinderCookTime = 0;

                        this.smeltItem();

                        var2 = true;

                    }

                }

                else

                {

                    this.grinderCookTime = 0;

                }

     

                if (var1 != this.grinderBurnTime > 0)

                {

                    var2 = true;

                }

            }

     

            if (var2)

            {

                this.onInventoryChanged();

            }

        }

     

        /**

        * Returns true if the grinder can smelt an item, i.e. has a source item, destination stack isn't full, etc.

        */

        private boolean canSmelt()

        {

            if (this.grinderItemStacks[0] == null)

            {

                return false;

            }

            else

            {

                ItemStack var1 = GrinderRecipes.smelting().getSmeltingResult(this.grinderItemStacks[0]);

                if (var1 == null) return false;

                if (this.grinderItemStacks[2] == null) return true;

                if (!this.grinderItemStacks[2].isItemEqual(var1)) return false;

                int result = grinderItemStacks[2].stackSize + var1.stackSize;

                return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize());

            }

        }

     

        /**

        * Turn one item from the grinder source stack into the appropriate smelted item in the grinder result stack

        */

        public void smeltItem()

        {

            if (this.canSmelt())

            {

                ItemStack var1 = GrinderRecipes.smelting().getSmeltingResult(this.grinderItemStacks[0]);

     

                if (this.grinderItemStacks[2] == null)

                {

                    this.grinderItemStacks[2] = var1.copy();

                }

                else if (this.grinderItemStacks[2].isItemEqual(var1))

                {

                    grinderItemStacks[2].stackSize += var1.stackSize;

                }

     

                --this.grinderItemStacks[0].stackSize;

     

                if (this.grinderItemStacks[0].stackSize <= 0)

                {

                    this.grinderItemStacks[0] = null;

                }

            }

        }

     

        /**

        * Returns the number of ticks that the supplied fuel item will keep the grinder burning, or 0 if the item isn't

        * fuel

        */

        public static int getItemBurnTime(ItemStack par0ItemStack)

        {

            if (par0ItemStack == null)

            {

                return 0;

            }

            else

            {

                int var1 = par0ItemStack.getItem().shiftedIndex;

                Item var2 = par0ItemStack.getItem();

     

                if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[var1] != null)

                {

                    Block var3 = Block.blocksList[var1];

     

                    if (var3 == Block.woodSingleSlab)

                    {

                        return 150;

                    }

     

                    if (var3.blockMaterial == Material.wood)

                    {

                        return 300;

                    }

                }

     

                if (var2 instanceof ItemTool && ((ItemTool) var2).getToolMaterialName().equals("WOOD")) return 200;

                if (var2 instanceof ItemSword && ((ItemSword) var2).func_77825_f().equals("WOOD")) return 200;

                if (var2 instanceof ItemHoe && ((ItemHoe) var2).func_77842_f().equals("WOOD")) return 200;

                if (var1 == Item.stick.shiftedIndex) return 100;

                if (var1 == Item.coal.shiftedIndex) return 1600;

                if (var1 == Item.bucketLava.shiftedIndex) return 20000;

                if (var1 == Block.sapling.blockID) return 100;

                if (var1 == Item.blazeRod.shiftedIndex) return 2400;

                return GameRegistry.getFuelValue(par0ItemStack);

            }

        }

     

        /**

        * Return true if item is a fuel source (getItemBurnTime() > 0).

        */

        public static boolean isItemFuel(ItemStack par0ItemStack)

        {

            return getItemBurnTime(par0ItemStack) > 0;

        }

     

        /**

        * Do not make give this method the name canInteractWith because it clashes with Container

        */

        public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer)

        {

            return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;

        }

     

        public void openChest() {}

     

        public void closeChest() {}

     

        @Override

        public int getStartInventorySide(ForgeDirection side)

        {

            if (side == ForgeDirection.DOWN) return 1;

            if (side == ForgeDirection.UP) return 0;

            return 2;

        }

     

        @Override

        public int getSizeInventorySide(ForgeDirection side)

        {

            return 1;

        }

    }

     

     

  10.  

    Model File:

     

     

    package naturemod.client.models;

     

    import net.minecraft.client.model.ModelBase;

    import net.minecraft.client.model.ModelRenderer;

    import net.minecraft.entity.Entity;

     

    public class ModelGrinder extends ModelBase

    {

      //fields

        ModelRenderer Base;

        ModelRenderer Pilar;

        ModelRenderer Pilar1;

        ModelRenderer Pilar2;

        ModelRenderer Pilar3;

        ModelRenderer Pole;

        public static ModelRenderer GrindWheel;

        public static ModelRenderer GrindWheel1;

        ModelRenderer Hopper;

        ModelRenderer HopperSide;

        ModelRenderer HopperSide1;

        ModelRenderer HopperSide2;

        ModelRenderer HopperSide3;

        ModelRenderer Strut;

        ModelRenderer StrutTop;

        ModelRenderer Strut1;

        ModelRenderer StrutTop1;

        ModelRenderer Strut2;

        ModelRenderer Strut3;

        ModelRenderer StrutTop3;

        ModelRenderer StrutTop2;

        ModelRenderer Item;

     

      public ModelGrinder()

      {

        textureWidth = 128;

        textureHeight = 64;

       

          Base = new ModelRenderer(this, 0, 0);

          Base.addBox(0F, 0F, 0F, 16, 3, 16);

          Base.setRotationPoint(-8F, 21F, -8F);

          Base.setTextureSize(128, 64);

          Base.mirror = true;

          setRotation(Base, 0F, 0F, 0F);

          Pilar = new ModelRenderer(this, 0, 32);

          Pilar.addBox(0F, 0F, 0F, 14, 2, 1);

          Pilar.setRotationPoint(-7F, 19F, 6.5F);

          Pilar.setTextureSize(128, 64);

          Pilar.mirror = true;

          setRotation(Pilar, 0F, 0F, 0F);

          Pilar1 = new ModelRenderer(this, 0, 32);

          Pilar1.addBox(0F, 0F, 0F, 1, 2, 14);

          Pilar1.setRotationPoint(6.5F, 19F, -7F);

          Pilar1.setTextureSize(128, 64);

          Pilar1.mirror = true;

          setRotation(Pilar1, 0F, 0F, 0F);

          Pilar2 = new ModelRenderer(this, 0, 32);

          Pilar2.addBox(0F, 0F, 0F, 14, 2, 1);

          Pilar2.setRotationPoint(-7F, 19F, -7.5F);

          Pilar2.setTextureSize(128, 64);

          Pilar2.mirror = true;

          setRotation(Pilar2, 0F, 0F, 0F);

          Pilar3 = new ModelRenderer(this, 0, 32);

          Pilar3.addBox(0F, 0F, 0F, 1, 2, 14);

          Pilar3.setRotationPoint(-7.5F, 19F, -7F);

          Pilar3.setTextureSize(128, 64);

          Pilar3.mirror = true;

          setRotation(Pilar3, 0F, 0F, 0F);

          Pole = new ModelRenderer(this, 44, 19);

          Pole.addBox(0F, 0F, 0F, 2, 7, 2);

          Pole.setRotationPoint(-1F, 14F, -1F);

          Pole.setTextureSize(128, 64);

          Pole.mirror = true;

          setRotation(Pole, 0F, 0F, 0F);

          GrindWheel = new ModelRenderer(this, 0, 19);

          GrindWheel.addBox(-5.5F, 0F, -5.5F, 11, 2, 11);

          GrindWheel.setRotationPoint(0F, 17F, 0F);

          GrindWheel.setTextureSize(128, 64);

          GrindWheel.mirror = true;

          setRotation(GrindWheel, 0F, 0F, 0F);

          GrindWheel1 = new ModelRenderer(this, 0, 19);

          GrindWheel1.addBox(-5.5F, 0F, -5.5F, 11, 2, 11);

          GrindWheel1.setRotationPoint(0F, 14.8F, 0F);

          GrindWheel1.setTextureSize(128, 64);

          GrindWheel1.mirror = true;

          setRotation(GrindWheel1, 0F, 0F, 0F);

          Hopper = new ModelRenderer(this, 52, 19);

          Hopper.addBox(0F, 0F, 0F, 6, 1, 6);

          Hopper.setRotationPoint(-3F, 13F, -3F);

          Hopper.setTextureSize(128, 64);

          Hopper.mirror = true;

          setRotation(Hopper, 0F, 0F, 0F);

          HopperSide = new ModelRenderer(this, 30, 32);

          HopperSide.addBox(0F, 0F, 0F, 1, 4, 7);

          HopperSide.setRotationPoint(-4F, 10F, -3F);

          HopperSide.setTextureSize(128, 64);

          HopperSide.mirror = true;

          setRotation(HopperSide, 0F, 0F, 0F);

          HopperSide1 = new ModelRenderer(this, 30, 32);

          HopperSide1.addBox(0F, 0F, 0F, 1, 4, 7);

          HopperSide1.setRotationPoint(3F, 10F, -4F);

          HopperSide1.setTextureSize(128, 64);

          HopperSide1.mirror = true;

          setRotation(HopperSide1, 0F, 0F, 0F);

          HopperSide2 = new ModelRenderer(this, 30, 32);

          HopperSide2.addBox(0F, 0F, 0F, 7, 4, 1);

          HopperSide2.setRotationPoint(-4F, 10F, -4F);

          HopperSide2.setTextureSize(128, 64);

          HopperSide2.mirror = true;

          setRotation(HopperSide2, 0F, 0F, 0F);

          HopperSide3 = new ModelRenderer(this, 30, 32);

          HopperSide3.addBox(0F, 0F, 0F, 7, 4, 1);

          HopperSide3.setRotationPoint(-3F, 10F, 3F);

          HopperSide3.setTextureSize(128, 64);

          HopperSide3.mirror = true;

          setRotation(HopperSide3, 0F, 0F, 0F);

          Strut = new ModelRenderer(this, 64, 0);

          Strut.addBox(0F, 0F, 0F, 1, 10, 2);

          Strut.setRotationPoint(7F, 11F, -1F);

          Strut.setTextureSize(128, 64);

          Strut.mirror = true;

          setRotation(Strut, 0F, 0F, 0F);

          StrutTop = new ModelRenderer(this, 70, 0);

          StrutTop.addBox(0F, 0F, 0F, 4, 1, 2);

          StrutTop.setRotationPoint(3F, 11F, -1F);

          StrutTop.setTextureSize(128, 64);

          StrutTop.mirror = true;

          setRotation(StrutTop, 0F, 0F, 0F);

          Strut1 = new ModelRenderer(this, 64, 0);

          Strut1.addBox(0F, 0F, 0F, 1, 10, 2);

          Strut1.setRotationPoint(-8F, 11F, -1F);

          Strut1.setTextureSize(128, 64);

          Strut1.mirror = true;

          setRotation(Strut1, 0F, 0F, 0F);

          StrutTop1 = new ModelRenderer(this, 70, 0);

          StrutTop1.addBox(0F, 0F, 0F, 4, 1, 2);

          StrutTop1.setRotationPoint(-7F, 11F, -1F);

          StrutTop1.setTextureSize(128, 64);

          StrutTop1.mirror = true;

          setRotation(StrutTop1, 0F, 0F, 0F);

          Strut2 = new ModelRenderer(this, 64, 0);

          Strut2.addBox(0F, 0F, 0F, 2, 10, 1);

          Strut2.setRotationPoint(-1F, 11F, -8F);

          Strut2.setTextureSize(128, 64);

          Strut2.mirror = true;

          setRotation(Strut2, 0F, 0F, 0F);

          Strut3 = new ModelRenderer(this, 64, 0);

          Strut3.addBox(0F, 0F, 0F, 2, 10, 1);

          Strut3.setRotationPoint(-1F, 11F, 7F);

          Strut3.setTextureSize(128, 64);

          Strut3.mirror = true;

          setRotation(Strut3, 0F, 0F, 0F);

          StrutTop3 = new ModelRenderer(this, 70, 0);

          StrutTop3.addBox(0F, 0F, 0F, 2, 1, 4);

          StrutTop3.setRotationPoint(-1F, 11F, 3F);

          StrutTop3.setTextureSize(128, 64);

          StrutTop3.mirror = true;

          setRotation(StrutTop3, 0F, 0F, 0F);

          StrutTop2 = new ModelRenderer(this, 70, 0);

          StrutTop2.addBox(0F, 0F, 0F, 2, 1, 4);

          StrutTop2.setRotationPoint(-1F, 11F, -7F);

          StrutTop2.setTextureSize(128, 64);

          StrutTop2.mirror = true;

          setRotation(StrutTop2, 0F, 0F, 0F);

          Item = new ModelRenderer(this, 64, 12);

          Item.addBox(0F, 0F, 0F, 6, 1, 6);

          Item.setRotationPoint(-3F, 11F, -3F);

          Item.setTextureSize(128, 64);

          Item.mirror = true;

          setRotation(Item, 0F, 0F, 0F);

      }

     

      public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)

      {

        super.render(entity, f, f1, f2, f3, f4, f5);

        setRotationAngles(f, f1, f2, f3, f4, f5, entity);

        Base.render(f5);

        Pilar.render(f5);

        Pilar1.render(f5);

        Pilar2.render(f5);

        Pilar3.render(f5);

        Pole.render(f5);

        GrindWheel.render(f5);

        GrindWheel1.render(f5);

        Hopper.render(f5);

        HopperSide.render(f5);

        HopperSide1.render(f5);

        HopperSide2.render(f5);

        HopperSide3.render(f5);

        Strut.render(f5);

        StrutTop.render(f5);

        Strut1.render(f5);

        StrutTop1.render(f5);

        Strut2.render(f5);

        Strut3.render(f5);

        StrutTop3.render(f5);

        StrutTop2.render(f5);

        Item.render(f5);

      }

     

      private void setRotation(ModelRenderer model, float x, float y, float z)

      {

        model.rotateAngleX = x;

        model.rotateAngleY = y;

        model.rotateAngleZ = z;

      }

     

      public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)

      {

        super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);

      }

     

      public void renderModel(float f1)

      {

        Base.render(f1);

        Pilar.render(f1);

        Pilar1.render(f1);

        Pilar2.render(f1);

        Pilar3.render(f1);

        Pole.render(f1);

        GrindWheel.render(f1);

        GrindWheel1.render(f1);

        Hopper.render(f1);

        HopperSide.render(f1);

        HopperSide1.render(f1);

        HopperSide2.render(f1);

        HopperSide3.render(f1);

        Strut.render(f1);

        StrutTop.render(f1);

        Strut1.render(f1);

        StrutTop1.render(f1);

        Strut2.render(f1);

        Strut3.render(f1);

        StrutTop3.render(f1);

        StrutTop2.render(f1);

        Item.render(f1);

      }

     

    }

     

     

     

    Render File:

     

     

    package naturemod.client.renders;

     

    import naturemod.client.models.ModelGrinder;

    import naturemod.common.blocks.TileEntityGrinder;

    import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

    import net.minecraft.tileentity.TileEntity;

     

    import org.lwjgl.opengl.GL11;

     

    public class RenderGrinder extends TileEntitySpecialRenderer

    {

    private ModelGrinder aModel;

     

    public RenderGrinder()

    {

    aModel = new ModelGrinder();

    }

     

    public void renderAModelAt(TileEntityGrinder tileEntity, double d, double d1, double d2, float f)

    {

    GL11.glPushMatrix();

    GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);

    GL11.glRotatef(180, 0F, 0F, 1F);

    bindTextureByName("/warpcraft/blocks/Grinder.png");

    GL11.glPushMatrix();

    aModel.renderModel(0.0625F);

    GL11.glPopMatrix();

    GL11.glPopMatrix();

    }

     

    public boolean shouldRender3DInInventory()

    {

        // This is where it asks if you want the renderInventory part called or not.

        return true; // Change to 'true' if you want the Inventory render to be called.

    }

     

    public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8)

    {

    this.renderAModelAt((TileEntityGrinder)tileEntity, var2, var4, var6, var8);

    }

    }

     

     

     

    Block File:

     

     

    package naturemod.common.blocks;

     

    import java.util.Random;

     

    import naturemod.common.Nature;

    import net.minecraft.block.Block;

    import net.minecraft.block.BlockContainer;

    import net.minecraft.block.material.Material;

    import net.minecraft.entity.player.EntityPlayer;

    import net.minecraft.tileentity.TileEntity;

    import net.minecraft.tileentity.TileEntityFurnace;

    import net.minecraft.tileentity.TileEntityNote;

    import net.minecraft.util.AxisAlignedBB;

    import net.minecraft.world.World;

     

    public class BlockGrinder extends BlockContainer

    {

     

    public BlockGrinder(int id)

    {

    super(id, Material.rock);

    setHardness(3.0f);

     

    setBlockName("Grinder");

    blockIndexInTexture = 1;

     

    //this.setRequiresSelfNotify();

    //disableStats();

     

    this.setCreativeTab(Nature.natureTab);

    }

     

    public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4, Block block)

        {

    return null;

        }

     

    public boolean isOpaqueCube()

        {

            return false;

        }

     

    @Override

    public boolean renderAsNormalBlock()

    {

    return false;

    }

     

    @Override

    public int getRenderType()

    {

    return -1;

    }

     

    public TileEntity createNewTileEntity(World var1)

    {

    return new TileEntityGrinder();

    }

     

     

    public TileEntity getBlockEntity()

    {

    try{

    return (TileEntity)TileEntityGrinder.class.newInstance();

    }

    catch(Exception exception){

    throw new RuntimeException(exception);

    }

    }

     

     

    public void onNeighborBlockChange(World world, int i, int j, int k, int l)

        {

            if(l > 0 && Block.blocksList[l].canProvidePower())

            {

                    world.scheduleBlockUpdate(i, j, k, blockID, tickRate());

            }

        }

     

        public void updateTick(World world, int i, int j, int k, Random random)

        {

            if(!world.editingBlocks && (world.isBlockIndirectlyGettingPowered(i, j, k) || world.isBlockIndirectlyGettingPowered(i, j + 1, k)))

            {

            Nature.powered = true;

            }else

            {

            Nature.powered = false;

            }

        }

     

        public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)

        {

            if (par1World.isRemote)

            {

                return true;

            }

            else

            {

                TileEntityGrinder var10 = (TileEntityGrinder)par1World.getBlockTileEntity(par2, par3, par4);

     

                if (var10 != null)

                {

                par5EntityPlayer.openGui(Nature.instance, 0, par1World, par2, par3, par4);

                }

     

                return true;

            }

        }

    }

     

     

     

     

    say if you need any more

     

  11. hi guys, ive been playing around with custom block renders and block animations(like buildcraft engines). i have a block that when powered by redstone part of it moves, however, all the blocks of that type move including the one in my inventory, how do i make this model only affect one block?

     

  12. you need a tick update

     

     

    package <your package>

     

    import java.util.EnumSet;

     

    import net.minecraft.client.Minecraft;

    import net.minecraft.src.GuiScreen;

     

    import cpw.mods.fml.client.FMLClientHandler;

    import cpw.mods.fml.common.ITickHandler;

    import cpw.mods.fml.common.TickType;

     

    public class ClientTickHandler implements ITickHandler

    {

        @Override

        public void tickStart(EnumSet<TickType> type, Object... tickData) {}

     

        @Override

        public void tickEnd(EnumSet<TickType> type, Object... tickData)

        {

            if (type.equals(EnumSet.of(TickType.RENDER)))

            {

                onRenderTick();

            }

            else if (type.equals(EnumSet.of(TickType.CLIENT)))

            {

                GuiScreen guiscreen = Minecraft.getMinecraft().currentScreen;

                if (guiscreen != null)

                {

                    onTickInGUI(guiscreen);

                } else {

                    onTickInGame();

                }

            }

        }

     

        @Override

        public EnumSet<TickType> ticks()

        {

            return EnumSet.of(TickType.RENDER, TickType.CLIENT);

            // In my testing only RENDER, CLIENT, & PLAYER did anything on the client side.

            // Read 'cpw.mods.fml.common.TickType.java' for a full list and description of available types

        }

     

        @Override

        public String getLabel() { return null; }

     

     

        private void onRenderTick() {

            if(Minecraft.getMinecraft().theWorld != null)

            {

              <Your Block>.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics);

            }

            }

     

        public void onTickInGUI(GuiScreen guiscreen)

        {

          if(Minecraft.getMinecraft().theWorld != null)

          {

            <Your Block>.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics);

          }

        }

     

        public void onTickInGame()

        {

          if(Minecraft.getMinecraft().theWorld != null)

          {

            <Your Block>.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics);

          }

        }

    }

     

     

     

    and in your clientproxy

     

     

    public void registerRenderInformation()

    {

    TickRegistry.registerTickHandler(new <YourTickHandler>(), Side.CLIENT);

    }

     

     

  13. you need to have them change on tick,

     

    here's what i used when i made my leaves:

     

     

    package <your package>

     

    import java.util.EnumSet;

     

    import net.minecraft.client.Minecraft;

    import net.minecraft.src.GuiScreen;

     

    import cpw.mods.fml.client.FMLClientHandler;

    import cpw.mods.fml.common.ITickHandler;

    import cpw.mods.fml.common.TickType;

     

    public class ClientTickHandler implements ITickHandler

    {

        @Override

        public void tickStart(EnumSet<TickType> type, Object... tickData) {}

     

        @Override

        public void tickEnd(EnumSet<TickType> type, Object... tickData)

        {

            if (type.equals(EnumSet.of(TickType.RENDER)))

            {

                onRenderTick();

            }

            else if (type.equals(EnumSet.of(TickType.CLIENT)))

            {

                GuiScreen guiscreen = Minecraft.getMinecraft().currentScreen;

                if (guiscreen != null)

                {

                    onTickInGUI(guiscreen);

                } else {

                    onTickInGame();

                }

            }

        }

     

        @Override

        public EnumSet<TickType> ticks()

        {

            return EnumSet.of(TickType.RENDER, TickType.CLIENT);

            // In my testing only RENDER, CLIENT, & PLAYER did anything on the client side.

            // Read 'cpw.mods.fml.common.TickType.java' for a full list and description of available types

        }

     

        @Override

        public String getLabel() { return null; }

     

     

        private void onRenderTick() {

          if(Minecraft.getMinecraft().theWorld != null)

          {

          <Your Block>.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics);

          }

        }

     

        public void onTickInGUI(GuiScreen guiscreen)

        {

        if(Minecraft.getMinecraft().theWorld != null)

        {

        <Your Block>.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics);

        }

        }

     

        public void onTickInGame()

        {

        if(Minecraft.getMinecraft().theWorld != null)

        {

        <Your Block>.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics);

        }

        }

    }

     

     

     

    this will make them change as soon as you change the graphics from fast to fancy and visa versa

  14. hi guys, ive recently started making a Lost Planet VS SUIT, however im having some difficulty with a couple of things.

    1) making the entity jump whilst the player is riding the entity, and being able to move forward (similar to the ic2 jetpack)

    2) having arrows fire from the entity when a key is pressed (i have the keybinds, im just not sure how to make them work)

    3) having a text overlay on the player's HUD when in the entity to show the entity's health.

     

    here's my current entity code:

     

     

    package mod.warp.entity;

     

    import java.util.List;

    import java.util.Random;

     

    import cpw.mods.fml.common.Side;

    import cpw.mods.fml.common.asm.SideOnly;

     

    import mod.warp.KeyBindHandler;

    import net.minecraft.src.DamageSource;

    import net.minecraft.src.Entity;

    import net.minecraft.src.EntityAIControlledByPlayer;

    import net.minecraft.src.EntityAgeable;

    import net.minecraft.src.EntityAnimal;

    import net.minecraft.src.EntityCreature;

    import net.minecraft.src.EntityGolem;

    import net.minecraft.src.EntityLiving;

    import net.minecraft.src.EntityMob;

    import net.minecraft.src.EntityPlayer;

    import net.minecraft.src.EntityPlayerMP;

    import net.minecraft.src.EntitySnowball;

    import net.minecraft.src.Item;

    import net.minecraft.src.ItemStack;

    import net.minecraft.src.KeyBinding;

    import net.minecraft.src.MathHelper;

    import net.minecraft.src.NBTTagCompound;

    import net.minecraft.src.World;

    import net.minecraftforge.common.MinecraftForge;

    import net.minecraftforge.event.ForgeSubscribe;

    import net.minecraftforge.event.entity.living.LivingFallEvent;

    import net.minecraftforge.event.entity.minecart.MinecartInteractEvent;

     

    public class EntityRoboSuit extends EntityAnimal

    {

     

    private final EntityAIControlledByPlayer aiControlledByPlayer;

    private boolean leap;

     

        public EntityRoboSuit(World par1World)

        {

            super(par1World);

            this.texture = "/warpcraft/mobs/RoboSuit.png";

            this.tasks.addTask(1, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.01F));

            setSize(1.0F, 2.0F);

            int attackStrength = 15;

        }

       

        protected void updateEntityActionState()

        {

     

        }

       

        public boolean isAIEnabled()

        {

            return true;

        }

     

        protected void updateAITasks()

        {

            super.updateAITasks();

        }

     

     

        public int getMaxHealth()

        {

            return 50;

        }

     

        /**

        * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden

        * by a player and the player is holding a carrot-on-a-stick

        */

        public boolean canBeSteered()

        {

            return true;

        }

       

        public void updateRidden()

        {

            if(ridingEntity.isDead)

            {

                ridingEntity = null;

                return;

            }

            motionX = 0.0D;

            motionZ = 0.0D;

            motionY = 0.0D;

            onUpdate();

            //onUpdate();

            if(ridingEntity == null)

            {

            return;

            }

            ridingEntity.updateRiderPosition();

        }

       

        public double getMountedYOffset()

        {

            return (double)height * 0.0D + 1.5D;

        }

       

        public boolean interact(EntityPlayer entityplayer)

    {

            if(riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer)

            {

                return true;

            }

            if(!worldObj.isRemote)

            {

                entityplayer.mountEntity(this);

            }

            return true;

        }

       

        public void moveEntity(double d, double d1, double d2)

        {

        if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer))

            {

       

            prevRotationYaw = rotationYaw = riddenByEntity.rotationYaw;

            prevRotationPitch = rotationPitch = 0.0F;                                                 

                    if(leap)

                    {//have it fly up a bit

                    motionX += riddenByEntity.motionX * 0.0D;

                        motionZ += riddenByEntity.motionZ * 0.0D;

                        motionY += 0.0D;

                    leap = false;

                    }else

                    {//regular run on the ground movement

                    motionX += riddenByEntity.motionX * 3.0D;

                        motionZ += riddenByEntity.motionZ * 3.0D;

                    EntityPlayer entityplayer = (EntityPlayer)riddenByEntity;

            if(((EntityPlayer)entityplayer).isJumping && !isJumping)

    {

        motionY +=  0.1D;

    }

           

                    }

                    if(isCollidedHorizontally)

                    {

       

                                if(onGround)                    //else not fly

                                {

                                motionY += 0.6F;    //let it try to jump over obstacle

                                }

                    }

     

                super.moveEntity(motionX, motionY, motionZ);

            }else

            {

            super.moveEntity(d, d1, d2);

            }

        }

       

        public void writeEntityToNBT(NBTTagCompound nbttagcompound)

        {

            super.writeEntityToNBT(nbttagcompound);

        }

     

        public void readEntityFromNBT(NBTTagCompound nbttagcompound)

        {

            super.readEntityFromNBT(nbttagcompound);

        }

     

        protected String getLivingSound()

        {

            return "none";

        }

     

        protected String getHurtSound()

        {

            return "none";

        }

     

        protected String getDeathSound()

        {

            return "none";

        }

       

        public void attackEntityWithRangedAttack(EntityLiving par1EntityLiving)

        {

            EntitySnowball var2 = new EntitySnowball(this.worldObj, this);

            double var3 = par1EntityLiving.posX - this.posX;

            double var5 = par1EntityLiving.posY + (double)par1EntityLiving.getEyeHeight() - 1.100000023841858D - var2.posY;

            double var7 = par1EntityLiving.posZ - this.posZ;

            float var9 = MathHelper.sqrt_double(var3 * var3 + var7 * var7) * 0.2F;

            var2.setThrowableHeading(var3, var5 + (double)var9, var7, 1.6F, 12.0F);

            this.func_85030_a("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));

            this.worldObj.spawnEntityInWorld(var2);

        }

       

        protected void playStepSound(int par1, int par2, int par3, int par4)

        {

            this.func_85030_a("mob.irongolem.walk", 1.0F, 1.0F);

        }

     

        protected float getSoundVolume()

        {

            return 0.4F;

        }

       

        public EntityAIControlledByPlayer getAIControlledByPlayer()

        {

            return this.aiControlledByPlayer;

        }

     

    @Override

    public EntityAgeable func_90011_a(EntityAgeable var1) {

    // TODO Auto-generated method stub

    return null;

    }

    }

     

     

     

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.