Posts by yahwho

    Hi!


    When is it too late to cancel an event? ?(


    I'm passing an event reference to a helper class and then trying to reference it in a different method (within a GUI class) but after getting a reference to the event and then calling setCancelled(true) on it the event is not cancelled.


    Hope that makes sense :S

    Hmm well a little more info.


    I see these illegal state messages whilst working on a local test server (i.e. 127.0.0.1) (and both client and server are not modified).


    If I pick up a stack and split it - usually splitting the stack into an inventory location other than the origin I get these messages on the server log. Not always, but sometimes.


    For example, pick up a stack of 64 ingots of iron from a chest, then right click to drop 1 ingot into my "local" inventory. The stack split will happen but I see this message on the server (again, sometimes but not always).


    This "illegal state" message will continue for each subsequent stack split. Whilst the stack is still in use. Dropping the stack back to original chest, left clicking on another item and then accessing the original item (i.e. 64 ingots of iron) then stops the message.


    A PlayerIllegalStateEvent would be good for starters even if I don't choose to cancel the event, at least I can create a log file. That way I can determine the frequency of these events as well as any pattern (i.e. if its specific players mainly causing them or like with my testing an infrequent anomaly).

    Hi @red51


    Is there a method in which I can catch an illegal state and cancel the event?


    I'm getting a few:


    Code
    INFO: Player <playername> illegal state: InventoryStackExchange: Origin item is null

    I'm finding it difficult to replicate the exact cause, sometimes I can get it to happen, other times I can't. ?(





    Edit: not super important as it doesn't seem to happen often. . . also, it seems to happen when splitting stacks.

    Hi @red51


    I'm working on some code that uses a GUI when items are moved from or to a chest (for player operated shops).


    The problem I am having is the GUI always appears underneath the in-game inventory's GUI. So I could do with something like:




    Behind this screen (indicated by red arrow) appears my confirmation GUI. Which is only visible once you close the inventory screen.





    As it appears behind the inventory screen its not much use currently ;(



    Edit: Maybe a way to show and hide (.setVisible(false || true) ) the inventory screen might work?

    Hi!


    Code
    public void onPlayerSetExplosiveEvent(PlayerSetExplosiveEvent event){
    //this would be a super useful event method
    }


    This would be great - currently I have had to make TNT explosions on Medieval Realms server zero damage to prevent griefers using it maliciously. But if someone could use it on their own land. . .

    There is already a mini pig.


    But yet, I would assume smaller animals would just require the object to be made smaller ( or even bigger! Imagine attacking a giant leopard! :) )


    An API call for setting an NPCs size by ID would be great!

    I'm struggling to get a chest ID via a raycast, I'm using this code:



    But as my code comment states, I always get a -1 return on the r.getCollisionInfor();

    Hi all, and seasons greetings!


    I am trying to determine when a firework is lit, I have tried PlayerObjectInteraction, PlayerChangeObjectStatusEvent, and PlayerObjectEvent, but none seem to be called when a firework is lit. Looking through the API I do not see anything obvious to use?


    Any help would be greatly received 8o