Dropt

Dropt

3M Downloads

Integer overflow when too far from spawn

codetaylor opened this issue ยท 1 comments

commented

Issue Description

Integer overflow in distance matcher when too far from spawn.

Discord discussion: https://discord.com/channels/516841320594276353/516847563085840395/940488566264459355

What Happens

  1. Set up a rule to change dirt drops with debug.
  2. Travel 1000000 blocks from spawn using /tp @p 1000000 ~ ~.
  3. Break dirt nearby.
  4. Notice this in log:
[DEBUG] [MATCH] [!!] Distance [NaN] inside range [0,2147483647]
[DEBUG] [!!] Rule not matched

Script

{
  "rules": [
    {
      "debug": true,
      "match": {
        "blocks": {"blocks": ["minecraft:dirt"]}
      },
      "drops": [
        {"item": {"items": ["minecraft:diamond"]}}
      ]
    }
  ]
}
commented

Fixed in 1.12.2-1.19.2