Jump to content

Recommended Posts

Posted

So, as I was working on doing some achievement based stuff for my mod, I tried to create a crafting handler. Upon doing so, I noticed that ICraftingHandler is no longer an interface.

 

Just wondering if anyone knows what it was replaced by or what I can use to get the same functionality? An event, possibly?

 

Thanks in advance!

-Mitchellbrine

 

  Quote

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

  Quote
I don't want your charity, I want your information
Posted

Funny, when I remembered the crafting handlers, I had always wanted a way of cancelling them. Thanks diesieben07!

-Mitchellbrine

 

  Quote

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

  Quote
I don't want your charity, I want your information
Posted

Um, diesieben, I'm having a bit of issues with the fact that the event is not working. I have it with a @SubscribeEvent, but it doesn't seem to even run the event.

-Mitchellbrine

 

  Quote

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

  Quote
I don't want your charity, I want your information
Posted

Thanks, Alias, but I already got that part. It still doesn't work after I register it.

-Mitchellbrine

 

  Quote

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

  Quote
I don't want your charity, I want your information
Posted

Okay, here are the classes. I would link you to my repository, but I'd have to add you to it on BitBucket (it's private while I'm updating).

 

So here they are:

 

Here's my MainMod class (Sorry it's so long, It's a big mod)

 

  Reveal hidden contents

 

 

And here's my class for the event:

 

  Reveal hidden contents

 

-Mitchellbrine

 

  Quote

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

  Quote
I don't want your charity, I want your information
Posted

Derp... sorry, the PlayerEvent is an FML event, my bad. You have to register it like this:

 

FMLCommonHandler.instance().bus().register(new CraftingHandler());

 

EDIT: It's confusing, because there are multiple PlayerEvents, one for FML, and one for MinecraftForge, so you have to double-check the import you are using and subscribe based on that import. The FML PlayerEvents contain most of what used to be in IPlayerTracker, plus item crafting and smelting events.

Posted

Thank you so much Alias! Just got it to work!

-Mitchellbrine

 

  Quote

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

  Quote
I don't want your charity, I want your information

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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