codetaylor / dropt-1.12

Flexible block drop strategies.
https://minecraft.curseforge.com/projects/dropt
Other
6 stars 2 forks source link

Allow XP to drop without selecting a drop #42

Closed lOmicronl closed 6 years ago

lOmicronl commented 6 years ago

I'm currently trying to make it so that ores that drop themselves (vanilla iron and gold, for example) also drop XP.

However, it is impossible to simply add experience drops to something. If the "item" field in IRuleDrop is omitted, or if it contains only drops with a fixed amount of 0, then the "xp" field will not even be parsed. In order to get the "xp" field to be parsed, the current syntax implementation forces you to drop at least one item.

As a result, you have to work with "replaceStrategy":"REPLACE_ALL", and write a rule that drops the block itself, even though it already does that without a rule present.

The reason to modify this behavior, and let the "xp" field be parsed even without parsing an item drop, is one of convenience. Right now, the modded instance I am tring to modify has 19 ores that drop themselves. Which means, I have to write 19 complete, individual drop replacement rules, each targeting only one single ore. If, instead, I could work with "replaceStrategy":"ADD" and an empty "item" field, I would need only two or three rules, each of which matches several different ores, based on grouping them by harvest level.

codetaylor commented 6 years ago

Changed in 1.12.2-1.10.1.

Verified that this now works:

{
  "rules": [
    {
      "match": {
        "blocks": {
          "blocks": [
            "minecraft:stone"
          ]
        }
      },
      "drops": [
        {
          "xp": {
            "fixed": 20
          }
        }
      ]
    }
  ]
}
lOmicronl commented 6 years ago

Awesome 👍