Posts by Bamse

A new update (0.9.2) is available now!
Latest Hotfix: 0.9.2.1 (2026-05-13)

    About shearing sheeps, basically this is handled by PlayerNpcInteractionEvent, but I just realized that this is way too limited... this definitely needs some better handling which provides more information about the actual interaction type. Right now it's triggered if you just press F, but it's also triggered when shearing sheeps etc. I will put this on my list (but I'm not sure if this will make it into the next hotfix)!

    Here i think about a more generic event like PlayerUseAction. This can be triggered basically when player use equipped item, like rope to leash, shear to shear a shep, knife to skin, knife on tanning rack, bucket to get milk, bucket to get water, etc. and maybe more like use on bread to get half bread, on melon to get slices, etc.

    I think on a long run the best is to threat them as metaobject, even if game not supplementary do some processing to them.
    On short term probable one enum with target will be very good to know exactly where item is placed (help in future too if other case will appear) and a getRelatedObjectDefinition() to can get definition (where item was placed in tanning rack or gramophone?) for sure is helpful.
    And second thing on item pickup (hide,leather,disk) can be do a fake event PlayerItemPickup (cancelable of course)? I see this event is not trigger at all for tanning rack. On place event is triggered, but on pickup no event.

    I don't see mention anywhere as issue is fixed, but after server update from yesterday, it seems new event PlayerPlaceItemEvent is fixed!


    I test with a few metaobjects:

    - Furnace - ok

    - drying rack - ok

    - oven - ok

    - grill - ok

    - skewer - ok

    - grinder - ok

    -paper press - ok


    But with tanning rack i encountered a new issue. I don't think is related with first one but same code who works for other station here give error because when i call method to retrieve definition of metaobject, return null if metaobject is a tanning rack!


    from log:


    Code
    [10:49:11] [ADMIN MESSAGE] (Notification) EXCEPTION OCCURRED IN PLUGIN 'TestRw' (AUTHOR: Bamse) <-- here i put a hide in tanning rack
    -> java.lang.NullPointerException: Cannot read field "name" because "def" is null
    at PLUGIN_CLASS_LOADER//bamse.rw.PermanentItemPlacement2.onPlayerPlaceItem(PermanentItemPlacement2.java:32)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at net.jiw.unity.runtime.PluginEventHandler.triggerEvent(PluginEventHandler.java:138)
    16711680
    Object tanningrack (2060346) change info 0 -> 745



    Note (after more research):


    It seems tanning rack is a special object and not a metaobject? Maybe must threat same as a meta object? I can pickup hide from him and no event PlayerPickupItemEvent fired at all! (New event

    PlayerPlaceItemEvent is fired).

    So no way to know if item (hide or leather) is take from tanning rack or how to deny take item from him on some condition?


    Thx


    Bamse

    Hi


    First thx for adding this new event!


    Now i try to use but i hit some issue. For persistent item placement it work as expected, but it is a issue when try to add items on a metabject (furnace, grill). For example when i want to put ore in furnace, ore gone from inventory but on furnace don't appear nothing and i can put in same slot over and over new ore. If i don't use at all new event i can put items in metaobjects! it's like, with new event activated is canceled by default when put items in metaobjects!


    For testing purpose i use following code:


    From logs:


    Thx


    Bamse

    I tried to prevent baby animals pickup on some conditions, But i already solved with PlayerNpcInteractionEvent!


    About breeding of animals.


    So far i breed some cows, pigs and horses

    - For horse i always i get variant 0 (light brown) even mother are different variants.

    - For cow i always get same variant as mother


    So question is any got male version of adult from babies get from breeding? Or i was exceptionally unlucky and i got all babies as female variant when they grow, or is something wrong and no male from breeding? Some other player reported same thing, just female.

    I make some progress but i don't know how to cancel PlayerMouseButtonEvent (it seems this event don't have setCanceled(true) method ...


    But i even if find a method to cancel mouse press button i don't think this is the best approach because left button is used very heavy in game ..


    Idealy i want some Event who is triggered on start of special action of equipped item like "Catch Animal", "Shear sheep", etc ...


    Hi!


    I try to control, via API, when animals can be leashed with a rope. I looked in API but not yet any clue how to detect when a player leash a animal and eventually deny this if some conditions are meet. If any have any hint, that will be very appreciated!


    Thx.


    Bamse

    Hi


    If i cancel event PlayerInventoryAddItemEvent when i try to pickup a small animal, it's normal to animal got removed from world, even if i cancel event and in inventory not get Item of category NPC?


    Thx.


    Bamse

    Hi!


    I searched on API events to can interact with item placement / pickup item placed but not find any. They are exist and i missed? Something like:

    Code
    PlayerItemPermanentPlaceEvent();
    PlayerItemPermanentPickupEvent();

    If this type of event are not yet in API i can use another solution to detect if player want to place a permanent item and eventually stop it? Same for pickup permanent item?


    Maybe another solution can be to extend PlayerPickupItemEvent() with a method to get source of item pickedup.

    Source can be:

    - Ground - for item dropped on ground

    - PermanentItem - for items placed permanently

    - CraftStation - For items take from crafting station (ex: ingots / ore from furnace, meat/dried meat from Drying rack, meat/cooked meat from grill/oven, etc.)

    - etc.


    In meantime maybe is a solution for this problem which i don't see it!


    Thx in advance!


    Bamse

    Oh, thanks for the update! I think I have an idea what's causing this... I will try to prepare a hotfix for that, but it might still take 1-2 days until it's ready :/



    Nice to know you find a possible solution!

    Maybe this will fix too other bug related to crafting station where sometimes objects from inside become invisible, like put some meat/fish on a drying rack and after relog they become invisible. I see same thing to furnace too for example, or oven. This is a old bug who apparently previously update (0.9.1) fixed, but he come back after last update.


    BTW:

    After last hotfix no blue screen at start of game! Start now with a black screen followed by logo and main menu.

    Which part of the light do you consider too bright exactly? The grass specifically? Or the glare of the sun? Or the overall brightness?


    About the moon light, basically it's mainly the direct moonlight that has become brighter (at least it appears brighter)... when walking through a forest, you won't benefit much from it (especially considering that the moon now also casts shadows), so it's still relatively dark there. However, you can also change the brightness of the moon/nights specifically in the game settings :)

    I think the glare of sun is ok, but overall brightness is to strong.
    But to change brightness of the moon/nights, don't need first to disable moon phases?

    Hmm... does it only happen after skipping a night? Can you also reproduce this issue in singleplayer (when skipping the night, for example, or when changing the weather)?

    I tested on my local server. It seems if i have clouds and sun is rising in the morning FPS have a huge negative impact (50 fps from 120). If i stay more in same place fps slowly come back to 120 (sync with my monitor) after time pass. Problem occur i think between 7am clock
    I sent a report too.


    I made more test. Fps drop issue appear on clear weather too. For me is from 7:00 to 7:30 when sunrise. Before and after 120 fps, in this time fps drop to 50.



    BTW:

    After last update i think, at least summer on clear weather, light is to much to texture started to look unnaturally from to much exposure. Personally i like more like before. Maybe increased light during day is too much? I know you made some adjustment for moon/sun light but maybe too strong?. For example night on full moon is so brightness and see almost as day.
    Where is my green grass? I know sun can change color, but ... to much.

    Hi.


    First, i thx again red51 for implemented method to reset a chunk via API.


    Now come next challenge. I wonder if is possible to obtain from game engine a chunk of unmodified chunk (not actual chunk, but the original default one) and have some method to query about data like:

    - What materials contains (stone, ore, coal, air, water,tree, vegetation, etc.).

    - If chunks contain object from POI, and list of them (Ex. is involved in a POI/Dungeon generated and have some objects inside)


    Example of desired data:

    The chunk x,y,z contain :


    a) Terrain/ore:

    - 200 blocks stone

    - 800 blocks air

    - 400 blocks of water

    - 10 blocks of iron ore

    - 30 blocks of gold ore

    - etc.


    b) Vegetation:

    - 2 tree birch

    - 2 flower

    - 10 fern

    - etc.


    c) Chunk contain a POI/Dungeon = true

    - POI INFO

    - etc.

    d) Objects (from POI/Dungeons)
    - 2 primitive tent
    - 1 golden chest
    - etc.



    This data is required to calculate "value" of chunks. If i give player posibility to reset a chunk i don't want a player to find a "rich" chunk and reset over and over for resources. I want player to pay some resource/currency for resetting chunk and this cost will be more higher than resource from inside so over time if player just reset chunk get a net loss. The scope of reset chunk is not to gather resource over and over but to help restore default generation of chunk and help to quick demolish some complex building, re enable posibility of start spawning again of animal inside, etc.



    Thx for any hint how can achieve that.


    BTW: Obtaining same data from actual chunk can be a thing too who can be used for other purpose.

    I see too FPS drop. For example when night is skipped (hour 0 become 6 am) a few minutes i encounter huge FPS loss (half of FPS) for several minutes. After some time FPS start to rise. Same settings as before update and play on a server.