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

Good day. I have a problem! When I add the recipe to craft an instrument, it works well. But when I take a damaged tool from the crafting grid disappears

Is code of tool:

 

public class Mortar extends Item {

public Mortar(String name) {

super();

this.setCreativeTab(HighEnergetics.tabHEI);

this.setUnlocalizedName(name);

this.setMaxDamage( 27 );

this.setMaxStackSize( 1 );

}

 

@Override

public ItemStack getContainerItem(ItemStack itemStack )

{

itemStack.setItemDamage( itemStack.getItemDamage() + 1 );

return itemStack;

}

 

@Override

public boolean hasContainerItem(ItemStack stack)

{

return true;

}

 

}

 

And of recipe:

 

GameRegistry.addRecipe(new ItemStack(HEItems.copperDust), new Object[] {"MI", 'M', new ItemStack(HEItems.mortar, 1, OreDictionary.WILDCARD_VALUE), 'I', HEItems.copperIngot});

 

 

I want tool like hammer from IC2

  • Author

And a few information. Then damaged tool is staing in crafting grid, It are the icon and the zero sub.

That's the method.

 

Remember that you're working with pointers, so you don't want to operate on the input until the product is removed from the output slot. If you act on the original, you could damage it while the output dust is just sitting in the slot waiting to be grabbed (and if the grid is updated every tick, then that might be why your mortar disappeared).

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Sorry about that. We may have a language barrier.

 

Make a copy of the item stack using the object's copy method. Manipulate and return the copy.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.