Dropt

Dropt

3M Downloads

How to Prevent XP / Resonating Redstone Crystals from Dropping from Redstone

KAfable opened this issue ยท 7 comments

commented

Hi CT,

I'm using the following JSON to try and replace all redstone ores drops as if they drop like silk touch. However this continues to result in experience dropping, and other drops such as XU2's Resonating Redstone Crystal. I recently moved to your system from Block Drops Tweaker (which somehow prevented the drops, but not exactly sure what I did ther).

The documentation on the wiki says that it should replace all of the drops and by default give 0 xp if I left it blank, any idea what I'm doing wrong?

commented

So, without digging into it, I would venture a guess that XU2 is dropping the crystals in a way that doesn't trigger the Forge event that Dropt listens for and reacts to. I'm not sure what to do about that without digging deeper and since XU2 isn't open source, I can't quickly investigate what he's doing to drop them. I'll look into this when I have some time.

As far as the XP is concerned, the documentation is not clear. By default, Dropt doesn't add any xp to the world when a block is broken, but it doesn't prevent existing xp from being dropped. If you need this functionality, I will see what I can do.

commented

Ah, well this is new: https://github.com/rwtema/Extra-Utilities-2-Source

I stand corrected.

commented

Nah, it looks like XU2 adds drops to the same event that I'm manipulating. It might be that I'm processing the event before XU2 and allowing the other mod to alter the drops after Dropt alters them. I can try setting the event handler to the absolute lowest priority to try and get it to process the event as late as possible.

commented

Great! Just curious is there a reason why it wasn't on the lowest priority? Would it be laggier / less performant the lower you go? In either case, thanks again for taking a look at this - while my settings might make silk touhc redundant for ores, I wanted to encourage players to develop ore processing - that and I wanted to inconvenience those who don't bring enough torches the first time heh.

commented

It wasn't on the lowest priority because my understanding of Forge event handling was flawed until recently. I was under the impression that Forge processed events in the order that mods are loaded and if you set the mod to be loaded last, it would then process events last. This doesn't seem to be true. After I learned this, I never thought to go back and change Dropt. :-/

commented

Ok, I've come up with a solution to the XP drops.

By default, Dropt will add any xp you specify to the existing xp dropped. However, you can now specify to replace the xp dropped. So to achieve what you set out to do in your example, you would do this:

{
  "rules": [
    {
      "match": {
        "blocks": {
          "blocks": [
            "minecraft:redstone_ore:0",
            "minecraft:lit_redstone_ore"
          ]
        }
      },
      "drops": [
        {
          "item": {
            "items": [
              "minecraft:redstone_ore:0"
            ]
          },
          "xpReplaceStrategy": "REPLACE"
        }
      ]
    }
  ]
}

The xp parameter defaults to zero and Dropt then replaces any xp dropped with zero. :)

commented

Feature and fix available in 1.12.2-1.7.0