Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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 !

 

What? It is supposed to be automatically there.

You did setupDecompWorkspace right?

Maker of the Craft++ mod.

  • Author

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

  • Author

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

 

 

  • Author

Looks like a good idea, I'll try it as soon as the mod itself is working.

 

EDIT : Ok, I understood, Eclipse can't find cpw.mods.fml.common.launcher.FMLTweaker because there is no cpw.mods.fml.common.launcher.FMLTweaker anywhere in the Libraries.

What is the right version on this list please ?

 

http://www.minecraftforge.net/forum/index.php/topic,27505.0.html

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.