Jump to content

leviathan01

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by leviathan01

  1.     just use an array x being the number of different textures you want

    IIcon[] Textures = new IIcon[x];

     

    @SideOnly(Side.CLIENT)

        public void registerIcons(IIconRegister par1IconRegister)

        {

        // example of different textures assigned to a number

            this.Textures[0] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture one");

            this.Textures[1] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture two");

            this.Textures[2] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture three");

            this.Textures[3] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture four");

        }

     

    once you have this just change the texture based on its damage value maybe?

     

    thanks but I knew all that I just do not know how to change the texture.

  2. I fixed my problem, old code...

            @Override
    public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
    	System.out.println("test");
                    return itemStack;
            }
    

    new code...

            @Override
    public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
                    if (!world.isRemote) {
    	      System.out.println("test");
                          // more code here
                    }
                    return itemStack;
            }
    

  3. when I use setBlock the block appears then disappears. this is my code ...

    public boolean onCast(EntityPlayer player, int x, int y, int z) {
    	y += 1;
    	World world = player.worldObj;
    	if (world.getBlock(x, y, z) == Blocks.water) {
    		world.setBlock(x, y, z, Blocks.ice);
                            return true;
    	}
    	return false;
    }
    

     

    the x, y, z is the block the player right clicks.

×
×
  • Create New...

Important Information

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