tryng to make ICONS for a GUI, having NO luck due to the fact "(getpath()" needs a Throws clause.

  • I've tried creating the "Buttons" in the main class, NO luck, moved it to the "onplayerCommand" it worked, but I get
    "GuiImage cannot be cast to net.risingworld.api.gui.GuiLabel" when I go to click on it.. ANY HELP??????????????

  • please send the Full ErrorMessage ;)


    then show me please the Method that fired the PlayerGuiElementClickEvent


    the Error can be

    Java
    GuiImage image = (GuiImage) p.getAttribute("nameOfAttribute")
    the Content of the p.getAttribute("nameOfAttribute") is a GuiLabel


    best regard

    Programmierer machen nie Fehler! Sie bauen nur neue Features ein....

  • About the "needs a throw clause": This is required by the "ImageInformation" constructor, since it can throw an IOException (file not found, invalid file etc). The easiest way is to surround it with a try-catch-statement:


    About the cast exception, it indicates that you're trying to assign a GuiImage to a GuiLabel object. As @Blacky1004 mentioned, please post the full error message and the according code

  • PLUGIN EXCEPTION (EffNet, , Bleckman) ---->
    java.lang.ClassCastException: net.risingworld.api.gui.GuiImage cannot be cast to net.risingworld.api.gui.GuiLabel
    at EffNet.EffNet.PlayerGuiElementClick(EffNet.java:262)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at pluginapi.PluginEventHandler.triggerEvent(SourceFile:169)
    at aE.b.a(SourceFile:1789)
    at aE.b.messageReceived(SourceFile:125)
    at j.e.a(SourceFile:109)
    at j.c.run(SourceFile:65)

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!