[BUG] ON_USE retrieval type ignored by operator override
ginsm opened this issue ยท 1 comments
Describe the bug
If you have the appropriate operator override level you can still break graves while retrieval type is set to ON_USE. However, useGrave will still prevent you from receiving any of the loot.
Forgotten Graves Version
v1.2.0 (affects v1.1.0 as well)
To Reproduce
- Set
Minimum OP Level Overrideto4(and make sure you are oped). - Set your
Retrieval TypetoON_USE. - Spawn a grave that you do not own (see additional context).
- Break the grave you spawned.
Expected behavior
There are two things that could be expected when Retrieval Type is set to ON_USE for players who meet the operator level requirements:
- The operator can override
Retrieval Typeand retrieve the grave (i.e. they would still get the items/XP). - The operator cannot override the
Retrieval Typeand thus cannot break the grave.
I'm not entirely sure which I prefer. I'm going to choose the latter but if someone requests the former I wouldn't be opposed.
Additional context
This likely takes place in the PlayerBlockBreakEvents.BEFORE event handler.
Here's the command to spawn a grave that you do not own:
/setblock ~ ~ ~ forgottengraves:grave{XP: 0, ItemCount: 41, Items: {Items: [{Slot: 0b, id: "minecraft:wheat_seeds", Count: 1b}]}, id: "forgottengraves:grave", GraveOwner: {Id: [I; -147600996, 943405439, -1674657691, 1983108200], Name: "DUMMY"}}
Commit d0dcae4 resolved this issue.
The issue occurred due to the order of the conditionals in the PlayerBlockBreakEvents.BEFORE event handler.
Closing.