Virtuoel / Pehkui

Fabric/Forge/NeoForge/Quilt mod that allows for changing the size of any entity.
MIT License
87 stars 34 forks source link

[Bug]: Compatibility issue between Pehkui-3.7.8+1.18.2-forge and bucolicorigins-3.6.6[FORGE] #454

Closed Rhyssia closed 9 months ago

Rhyssia commented 9 months ago

Minecraft version(s)

1.18.2

Minecraft version details

No response

Mod loader

Forge

Mod loader version

Forge 40.2.10

Fabric API version

No response

In what kind of world or server did the problem occur?

My singleplayer world that I opened to LAN

What went wrong? (Crash logs don't go here)

Bucolic Origins adjusts "Race/Origin" scale through Pehkui. Oddly when running /scale get pehkui:base @player it returns a value of 1 even when the player's visual scale is 0.5

When the player dies, their local scale is reset to normal 1.0 instead of the scale set by the specific Bucolic origin. (Specific Origin is "Hare" with a 3 block jump height.)

This is with default config settings.

Changing the default config setting of " keepAllScalesOnRespawn = false " to " keepAllScalesOnRespawn = True " resolves player height issue by allowing the change to persist after death, but presents a new issue... Player can no longer retain 3 block jump height of origin

Attempt to circumvent this issue by using " scalesKeptOnRespawn = [] " by trying the following values - " scalesKeptOnRespawn = [pehkui:base] " " scalesKeptOnRespawn = [base] " " scalesKeptOnRespawn = [{pehkui:base}] " " scalesKeptOnRespawn = [{base}] "

All of which causes crash on startup, as I cannot find documentation on proper usage.

If someone could explain proper syntax/usage of scalesKeptOnRespawn it would be greatly appreciated.

Full list of installed mods and their version numbers

It's over 200 lines so added as: https://pastebin.com/3pChvk2i

Did the problem cause the game to crash?

No.

Full crash report contents (if you experienced a crash)

Crash report output:

Rhyssia commented 9 months ago

Addendum: The actual issue seems to specifically be an issue with Bucolic Origins not setting the scale to persist in it's resize function. Or, at least that's what I've come to notice when comparing it to Origins Plus Plus. I figured I'd add the comment here so that if anyone else runs into this issue they might stumble upon this.

Additionally the scope of the issue might fall upon Origins mod not correctly handling "entity_action_respawned"

Additionally if Virtuoel could provide insight on the proper syntax/usage of scalesKeptOnRespawn it would, again, be greatly appreciated.

Bucolic's function:

{
  "type": "origins:action_on_callback",
  "entity_action_added": {
    "type": "origins:and",
            "actions": [
                {
                    "type": "origins:execute_command",
                    "command": "scale set pehkui:width 0.5"
                },
                {
                    "type": "origins:execute_command",
                    "command": "scale set pehkui:height 0.5"
                }
            ]
  },
  "entity_action_chosen": {
    "type": "origins:and",
            "actions": [
                {
                    "type": "origins:execute_command",
                    "command": "scale set pehkui:width 0.5"
                },
                {
                    "type": "origins:execute_command",
                    "command": "scale set pehkui:height 0.5"
                }
            ]
  },
  "entity_action_removed": {
    "type": "origins:execute_command",
    "command": "scale reset @s",
    "permission_level": 4
  },
  "entity_action_respawned": {
    "type": "origins:and",
    "actions": [
      {
        "type": "origins:execute_command",
        "command": "scale set pehkui:width 0.5"
      },
      {
        "type": "origins:execute_command",
        "command": "scale set pehkui:height 0.5"
      }
    ]
  },
  "execute_chosen_when_orb": true,

  "name": "Small",
  "description": "You are a measly block tall!"

Compared to Origin Plus Plus

{
    "type":"origins:multiple",
    "scale":{
        "type":"origins:action_over_time",
        "entity_action":{
            "type":"origins:execute_command",
            "command":"function origins-plus-plus:flea/size"
        },
        "interval":20
    },
    "reset":{
        "type":"origins:action_on_callback",
        "entity_action_lost":{
            "type":"origins:execute_command",
            "command":"scale reset"
        }
    }
}

With "function origins-plus-plus:flea/size" running...

scale set pehkui:base 0.1
scale set pehkui:reach 8
scale set pehkui:motion 12
scale persist set true
Rhyssia commented 9 months ago

After going through Origin documentation; This is not an issue of Pehkui but bad function choice by Bucolic Origins.

  "entity_action_removed": {
    "type": "origins:execute_command",
    "command": "scale reset @s",
    "permission_level": 4
  },
  "entity_action_respawned": {
    "type": "origins:and",
    "actions": [
      {
        "type": "origins:execute_command",
        "command": "scale set pehkui:width 0.5"
      },
      {
        "type": "origins:execute_command",
        "command": "scale set pehkui:height 0.5"
      }
    ]
  },

_removed and _respawned both fire on entity respawn possibly with *_removed being applied last. Also explains why Pehkuli:base returns 1.0

"entity_action_respawned" should probably be replaced with "entity_action_lost" in this occurance.

Closing as this is not an issue regarding specifically Pehkuli