Posted February 21, 201510 yr 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 !
February 22, 201510 yr What? It is supposed to be automatically there. You did setupDecompWorkspace right? Maker of the Craft++ mod.
February 22, 201510 yr 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:
February 22, 201510 yr 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:
February 22, 201510 yr Regarding you item problem. You are running your code client side. You need to run it server side if (!world.isRemote) I am the author of Draconic Evolution
February 22, 201510 yr 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
February 22, 201510 yr Author Yeah, thank you very much diesieben07 and brandon3055 ! Everything is fine now !
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.