Fulmineo64 / Guild

Other
6 stars 12 forks source link

Add support for the OctoEconomyAPI #14

Closed ExcessiveAmountsOfZombies closed 2 years ago

ExcessiveAmountsOfZombies commented 2 years ago

Hello

I wrote an Economy API and am now looking to integrate it into other mods where it makes sense to do so. I remember seeing Guild in the Fabric discord and thought it might be a nice place to start.

You can find the API here https://github.com/ExcessiveAmountsOfZombies/OctoEconomyApi and an implementation here if you'd like to test things https://www.curseforge.com/minecraft/mc-mods/eightseconomyp

I just edited the common_rewards loot pool like so to test and see if it worked

{
    "type": "currency",
    "icon": "minecraft:emerald",
    "name": "eights_economy:dollars",
    "number": {
        "min": 3,
        "max": 320
    },
    "unit_worth": 5,
    "weight": 100
},

A caveat I came across is after removing the economy and editing the datapack to remove the currency type reward, the quest would stay and when completed would give nothing, while appearing to say it would give a reward. Not sure how you'd like that handled, or if you would like to handle it yourself. Maybe it's not even worth handling seeing as removing a content mod and its subsequent rewards would do the same thing. Can also hide the entire 'issue' by making the icon air.

Fulmineo64 commented 2 years ago

Hi ExcessiveAmountsOfZombies, i see that you've made quite a bit of changes!

If i'm understanding correctly all these changes are needed because your economy mod stores a value per player instead as an item right?

The fact that the quest remains without rewards when you remove the mod / datapack, is because the quest has already been generated with some parameters that aren't available anymore, so as a compatibility measure it will still be shown but without the missing items.

I have one very simple solution that comes to mind in this case that could enable you to integrate your mod with mine and many others.

If your plan is to reward the player with the currency while avoiding it to be used to complete quests (so paying to complete a quest), you could simply offer an item representation of your money, like a dollar bill, that whenever it gets picked up by the player it will be removed from the inventory and added to the player's balance.

This could mean that with this approach you could add money to treasure chest, to villager trades (as a reward) and of course as a datapack for The Guild mod.

If this approach doesn't cut it, I'd be happy to help you with the integration with The Guild mod.

Also if you'd like to have a chat feel free to join my Discord Server.