Posts by yahwho

    Clearly not going to make it into this upcoming update. (super excited for it by the way - the screenshots look amazing! 👏)


    This would be really useful to have (I know there are other ways but this would be the cleanest)


    Java
    Chunk c = p.getChunk();

    All working :D

    I was also using...


    Java
    this.player.addUIElement(this);


    ...because I use my own UIElements that extend the base UIElement class.


    Java
    if (autoAttach) {
    this.player.addUIElement(this);
    }


    I added a simple boolean to my constructor for these special cases.

    Adding addUIElement() caused the element to go to the default UI bucket and therefore the coords were all off.

    Sorry to be a pain... :wacko:


    Is it currently possible to get a UIElement from the games HUD?


    For example grabing the UIElement of HudLayer/hudContainer/statusContainer/statusBarContainer/locationLabelContainer/locationLabel


    I want to add children to an existing vanilla UI element.


    This is what I've been trying (amongst others)


    Java
    Style parentStyle = new Style();// create a new style
    parentStyle.overflow.set(Overflow.Visible); // ensure children can render outside
    Internals.overwriteUIStyle(player, LOCATION_LABEL_PATH, parentStyle); //use internals class to overwrite with new style
    myUIElement = new MRUIElement(plugin, player);//my new element
    myUIElement.style.position.set(Position.Absolute);//my new element
    myUIElement.setPivot(Pivot.LowerCenter);//my new element central pivot
    myUIElement.setPosition(50f, 0f, true);//horizontally (50%) relative to parent
    myUIElement.style.translate.set(initposx, initposy - 10f);


    :dizzy:

    Hi humbrol2


    This is a little off your original question, but I noticed you mentioned trying to download the JDK from Oracle.


    Just as a heads-up: Oracle’s JDK builds now come with licensing restrictions and their download process can be awkward. Java itself is still open source under the OpenJDK project, and there are several free, production-ready builds you can use instead.


    One of the most popular is Eclipse Temurin:


    https://adoptium.net/en-GB/temurin


    It’s fully open source, TCK-certified, and works as a drop-in replacement for Oracle’s JDK.


    :nerd:

    Hi Red,


    We could do with a few more PlayerEvent classes, I will update this post as and when to keep them all together.


    PlayerPlaceOreEvent - player is placing ore in a furnace

    PlayerPlaceUncookedFoodEvent (probably with a better name) - event listener for placing food in an oven, on cooking grate etc


    PlayerSheerSheepEvent (or similar)


    PlayerPlacePeltEvent (or similar) - I know picking up a pelt from a drying rack triggers the OnPlayerRemoveObjectEvent event, so maybe placing pelts need to triggered on the OnPlayerPlaceObjectEvent



    PlayerPlacePaintObjectEvent - both for painting and paint removal

    Addition:


    PlayerDestroyTerrainEvent - not the event itself (already exists) moreso the getTerrainID always returns 1. So there are no means to determine what has been hit.

    Argh, looks like even if you set a status of a door to open via the API, if it's locked you still can't open it. :dizzy:



    Java
    println("obj.getStatus() = " + obj.getStatus(), PrintlnColour.YELLOW); //prints 0 (locked door)
    final byte next = (obj.getStatus() == 0) ? (byte) 1 : (byte) 0;//flip the bit
    obj.setStatus(next);//sets to 1



    Console states "Door <long id> is locked..."





    EDIT: Wait a minute... not 1 its 100 :crazy: let me try that...
    EDIT2: Nope, setting to 100 still doesn't override the lock.