Jump to content

java.lang.ClassCastException when opening GUI of custom furnace


Recommended Posts

Posted

When I open the GUI of my custom furnace on MC 1.6.4, the game crashes with the following stacktrace:

[embed=425,349]java.lang.ClassCastException: net.minecraft.tileentity.TileEntityFurnace cannot be cast to MatthewGB.MoarOres.TileEntityEFurnace

2014-02-22 16:37:36 [iNFO] [sTDOUT] at MatthewGB.MoarOres.MoarOresFurnace.onBlockActivated(MoarOresFurnace.java:138)[/embed]

 

The block's class:

 

  Reveal hidden contents

 

 

TileEntityEFurnace Class:

 

  Reveal hidden contents

 

 

Anyone know how to fix this error?

Posted

 

  Reveal hidden contents

 

Posted

The error log indicates that you have tried to downcast a vanilla furnace into your own class. Downcasting is not allowed unless you are holding an instance of the proper class or of its subclasses. In this case the TileEntityFurnace is the vanilla one and it cannot be cast into a subclass (your own class). You If you are wrapping a vanilla class, you have to construct your class and pass that as the instance to place instead of the vanilla one.

Posted

If you had any idea what you were doing you would know exactly where to look when I said that.

public class TileEntityEFurnace extends TileEntityFurnace implements ISidedInventory

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

Posted

Sorry for snapping at you then. Post your gui handler, your container, and your gui. Also, just go through every class and make sure the TileEntityFurnace isn't imported. Thst should immediately point out your problem.

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

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.