Jump to content

Recommended Posts

Posted

Hey everyone,

 

I would like to know how to add the universal.jar file to my project, for I would like to use the EnumHelper class, could someone hlep me ?

 

I have another small question : I would like to add damage t an item when it's used, but the damaged item gets <<healed>> when used again. Here is the item's class:

 

public class ToolTamis extends Item{

public ToolTamis()
{		
	super();
	this.setMaxStackSize(1);
	this.setMaxDamage(20);

}
   
    public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player)
    {   	
        MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(world, player, false);
        if (mop != null)
        {
        	System.out.println("1");
        	if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
        	{
        		System.out.println("2");
        		BlockPos bp = new BlockPos(mop.getBlockPos());
        		BlockPos up = new BlockPos(bp.add(0, 1, 0));
        		IBlockState bs =world.getBlockState(bp);
        		Block block = bs.getBlock();
        		Block blockup = world.getBlockState(up).getBlock();
        		BiomeGenBase bb =world.getBiomeGenForCoords(bp);

        		if (!player.canPlayerEdit(bp, null, item))
        		{
        			System.out.println("3bis");
        		}
        		else 
        		{
        			System.out.println("3");
	    		    if ((bb == BiomeGenBase.river || bb == BiomeGenBase.frozenRiver) && block == Blocks.sand && blockup == Blocks.water)
	    		    {
	    		    	System.out.println("4");
	    		    	if (world.isRemote)
	    		    	{
	    		    		System.out.println("5");
	    		    		Random rd = new Random();
	    		    		int n=rd.nextInt(50)+1;
	    		    		System.out.println("6");
	    		    		if (bb == BiomeGenBase.river && (n == 1 || n == 2))
	    		    			player.inventory.addItemStackToInventory(new ItemStack(Items.gold_nugget));
	    		    		else if (bb == BiomeGenBase.frozenRiver && (n >= 10 && n <= 13 ))
	    		    			player.inventory.addItemStackToInventory(new ItemStack(Items.gold_nugget));
	        		        	
	    		    		if (n >= 3 && n <= 9)
	    		    			player.inventory.addItemStackToInventory(new ItemStack(KlondikCraft.caillou_coeur));
	            
	    		    		item.damageItem(5, player);
	    		    	}
	    		    }      
        		}
        	}
        }
    return item;
}


    	
}

 

Thank you very much for any help you can give me !

 

Posted

Well, to be honest, I don't even know what it is...

But as you should see on this picture, I have most of the thing I should have, but I don't have the common.util for example. Maybe it's because I downloaded a too early version of Forge, before they had done everything ? ???

 

The bottom of fml.bin:

1424608375-capture.png

Posted

Ok, I just installed what I think is the right version of forge ( it's the src version), and did all the gradlew and configuration stuff, but now I have a new problem, the game won't start.

 

Here is the report :

 

[20:10:48] [main/INFO]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[20:10:48] [main/ERROR]: Unable to launch

java.lang.ClassNotFoundException: cpw.mods.fml.common.launcher.FMLTweaker

at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_31]

at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_31]

at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_31]

at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_31]

at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_31]

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[?:1.8.0_31]

at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_31]

at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:106) ~[launchwrapper-1.11.jar:?]

at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_31]

at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_31]

at java.lang.Class.forName0(Native Method) ~[?:1.8.0_31]

at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_31]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:98) [launchwrapper-1.11.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

 

 

 

And here are pictures of the configuration panel, it may be useful:

 

1424633279-capture.png

1424633279-capture2.png

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

Announcements



×
×
  • Create New...

Important Information

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