PikaMug / Quests

Easy-to-use, open-source plugin for the creation and execution of quests on Minecraft servers.
https://modrinth.com/plugin/quests.classic
MIT License
142 stars 105 forks source link

Crafting quests when inventory is full #2245

Closed HorusApl closed 1 week ago

HorusApl commented 1 week ago

What is your Quests version / build number (do not say "latest")?

5.0.5-b480

Describe the problem and how to replicate it.

Make any crafting quest that makes more then 1 item of any type. Fill up your inventory with any random junk to occupy space, and then shift+click to craft. Regardless if the materials are actually used and the item is actually crafted, it will mark the quest as complete. Video attached if I didn't describe it well. Harder crafting quests (like crafting beacons) can more or less be bypassed without spending materials.

https://github.com/PikaMug/Quests/assets/64336395/35754d09-06d3-4f32-9737-a279df7f7b38

Any console errors to share?

n/a

If applicable, can you provide an example quest from quests.yml?

'9999':
    name: Test Crafting
    ask-message: '        &x&e&9&9&8&2&0&l⭐ &x&f&f&d&5&7&e&l<quest> &x&e&9&9&8&2&0&l⭐'
    finish-message: §8§l[§x§7§6§8§b§f§5§lBOT§8§l]§r §fTake another quest with §x§f§f§d§5§7§e§l/quests§f!
    stages:
      ordered:
        '1':
          items-to-craft:
          - ==: org.bukkit.inventory.ItemStack
            v: 3700
            type: MUSHROOM_STEW
            amount: 64
PikaMug commented 1 week ago

@HorusApl Thanks for reporting this. Please try this development build: https://ci.codemc.io/job/PikaMug/job/Quests/483/

HorusApl commented 1 week ago

Seems to work similar to the brewing abuse fixes by canceling the event. If at all possible, could I propose letting the event pass, but only counting the actual amount of items sent to the inventory? So if I shift click and only have room to make 5, it should let me make those 5 and only count those 5. If too time consuming as this really only applies to very few quest types, this fix will work well.

Thanks again.

PikaMug commented 1 week ago

Seems to work similar to the brewing abuse fixes by canceling the event. If at all possible, could I propose letting the event pass, but only counting the actual amount of items sent to the inventory? So if I shift click and only have room to make 5, it should let me make those 5 and only count those 5. If too time consuming as this really only applies to very few quest types, this fix will work well.

Thanks again.

Unfortunately, the event doesn't provide a method for partial completion; it's all or nothing. We could handle it ourselves, but then there's the matter of what should happen to the unused materials—should we throw them on the ground where someone else could pick them up, or maybe try to calculate leaving the player enough space to take them back as well? I really think just canceling the event is best, but I'd be open to a Pull Request.