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

Cannot make a static reference to the non-static method registerOre(String, ItemStack) from the type IOreHandler

 

Line of declaration (did import):

 

IOreHandler.registerOre("ingotRefinedIron", ingotSteelStack);

 

 

ingotSteelStack Declaration:

 

ItemStack ingotSteelStack = new ItemStack(ingotSteel);

 

 

ingotSteel Declaration (Don't bug me for using default Modloader sprites, gonna fix):

 

public final Item ingotSteel = new itemSteel(144).setIconIndex(ModLoader.addOverride("/gui/items.png", "/physicraft/items/ingotSteel.png")).setItemName("ingotSteel");

 

 

itemSteel Class:

 

package net.minecraft.src;

 

public class itemSteel extends Item

{

        public itemSteel(int i)

        {

                super(i);

        }

}

 

 

  • Author

BTW, I was trying to implement the Dictionary without asking(I'm a beginner in Java), but I ended up posting anyways (*facepalm*).

  • 2 weeks later...

IOreHandler.registerOre("ingotRefinedIron", ingotSteelStack);

You are calling an abstract static method that does not exist.  IOreHandler (hence the I on the front for Interface) means that 'you' need to implement it.  This is how you handle callbacks.  :)

 

Actually, here is an idea, look at the IronChest mods source code (https://github.com/cpw/ironchest/), it uses the IOreHandler callback to set up recipes for mod added copper/tin/etc...

 

You also need to register your ores, there should be a method for that on the MinecraftForge class or ForgeHooks or something.

  • 2 weeks later...

if you are using MForge you should consider making a sprite sheet like what minecraft has, a 256x256 png file

 

add this line to your load() method

MinecraftForgeClient.preloadTexture("Directory Here");

 

also have the item code look something like this

public final Item ingotSteel = new itemSteel(144).setIconIndex(0).setItemName("ingotSteel");

0 is the first 16x16 section on the sprite sheet

  • Author

I know how to use infinite sprite indexing, but i'm sticking to modloader sprites because many tuts use them (for like furnaces and such) and eventually i will convert all of them.

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.