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.

El_Ludolf

Members
  • Joined

  • Last visited

Everything posted by El_Ludolf

  1. Interesting way of handling it. Definitly gonna remember IRecipeFactory, as the mod may grow larger it may come in handy.
  2. Thanks a lot. I haven't found a way to meddle with the NBT values inside a JSON file. All the other recipes are JSONs.
  3. Good Morning People, maybe someone can help me with a Mod I'm triying to program right now. The mod also includes a grindstone which applies Sharpness every time used. The class looks like this till now: public class katanasharpening implements IRecipe { @Override public boolean matches(InventoryCrafting inv, World worldIn) { Boolean meitouexistend = false; Boolean grindstoneexistend = false; for(int slot = 0; slot < inv.getSizeInventory(); slot++) { if(inv.getStackInSlot(slot).getItem().getUnlocalizedName() == "meitoukokuhikari") { meitouexistend = true; } if(inv.getStackInSlot(slot).getItem().getUnlocalizedName() == "grindstone") { grindstoneexistend = true; } } if(grindstoneexistend && meitouexistend) { return true; } else { return false; } } @Override public ItemStack getCraftingResult(InventoryCrafting inv) { int meitouposition = 0; int currentlevel = 0; for(int slot = 0; slot < inv.getSizeInventory(); slot++) { if(inv.getStackInSlot(slot).getItem().getUnlocalizedName() == "meitoukokuhikari") { meitouposition = slot; } } NBTTagList tags = inv.getStackInSlot(meitouposition).getEnchantmentTagList(); if(tags != null) { for (int i = 0; i < tags.tagCount(); ++i) { int j = tags.getCompoundTagAt(i).getShort("id"); int k = tags.getCompoundTagAt(i).getShort("lvl"); if(j == 16) { currentlevel = k; } } } inv.removeStackFromSlot(meitouposition); ItemStack kokumeitou = new ItemStack(HikariTouMod.meitoukokuhikari); kokumeitou.addEnchantment(Enchantments.SHARPNESS, currentlevel +1); return kokumeitou; } Questions: Is inv.getStackInSlot(slot).getItem().getUnlocalizedName() == "something" a good way to check if the right items inside? Through debugging it seems 16 is the id for sharpness? How would I now register the recipe? GameRegistry.addShaplessRecipe(katanasharpening); ?? addShapelessRecipe has a optional ResourceLocation parameter, is that it? Happy for anyone who can give me some hints.

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.