MerchantPug / apugli

An extension to Apoli for certain mods' use.
MIT License
5 stars 4 forks source link

`apugli:key_pressed` condition not working #15

Closed Lilwhiteshark closed 2 years ago

Lilwhiteshark commented 2 years ago

Minecraft 1.19 Fabric 0.14.8 Apugli 1.8.0

JSON used for testing below:

{
    "type": "origins:action_over_time",
    "interval": 10,
    "entity_action":
    {
        "type": "origins:apply_effect",
        "effect":
        {
            "effect": "minecraft:glowing",
            "duration": 15
        }
    },
    "condition":
    {
        "type": "apugli:key_pressed",
        "key":
        {
            "key": "key.origins.secondary_active",
            "continuous": true
        }
    }
}

Expected result: Glowing effect is applied every 10 ticks when holding down the secondary active key

Actual result: Nothing happens

Nothing is showing up in the logs, the game is reading and validating the datapack correctly, the condition just appears to never become true when pressing the key.

I have tried with different keys and actions, as well as changing the "continuous" field; nothing seems to trigger the condition.

MerchantPug commented 2 years ago

Thanks for the report.

My guess is that the condition is not being synced serverside.

MerchantPug commented 2 years ago

Okay I've got it!

Key Pressed is missing its first initial step that's done on the client, Action Over Time is a serverside power so it can't access this first step. I'll look into how I could perform this step on the server without sending a packet every tick.

MerchantPug commented 2 years ago

I'm unsure how I'm going to go about fixing this, it may be a logistical nightmare.

This was definitely an oversight in how this condition functions.

MerchantPug commented 2 years ago

Will be fixed in v1.8.1, this version will release soon.

Lilwhiteshark commented 2 years ago

Wow you work fast!

Just tested and it's working perfectly. Very much appreciated!