Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Grand Economy support - allow Grand Economy to use Sewing Machine currency #50

Open
The-Fireplace opened this issue Feb 27, 2022 · 2 comments
Labels
feature request New feature or request

Comments

@The-Fireplace
Copy link

Hello, some of my users are requesting support for Sewing Machine Utilities currency in Grand Economy. Since I was unable to find any documentation here about it being available on Maven, I thought I would post something here to see if you can handle creating the adapter, or if you'd be open to a PR which does so. In short, here's what basic support would involve. If this is done, Grand Economy and mods that support it will be able to use Sewing Machine Utilities currency.

One other important note here, Grand Economy is designed to allow accounts which are not players as well as player accounts. This comes in handy for mods such as Clans, where a clan can have an account. I took a glance through MoneyUtils and saw that there is some online/offline player support there. I'm not sure if the offline player stuff will be able to handle UUIDs which are not players, so if not, some adjustments may have to be made to accommodate that before support can be added.

If you have any questions, feel free to ask here or reach out on Discord.

Bonus: If you're up for something a little more advanced, it would be neat if all the economy-using features of Sewing Machine Utilities could use Grand Economy when it's present, and by extension, other economies Grand Economy has integrated with. I have details on what all that would entail and how to make the soft dependency if you're interested, but that is out of scope for this issue. I can make a new one for that if you're open to the idea.

The-Fireplace-Minecraft-Mods/Grand-Economy#37

@GStefanowich GStefanowich added the feature request New feature or request label Feb 27, 2022
@GStefanowich
Copy link
Owner

Seems like something that would be interesting to implement.

Everything thus far in my mod has been it's own self-contained ecosystem. I started it early in Fabrics upbringing and AFAIK there weren't any economy APIs at the time, so I just rolled my own (Same goes for the permissions). I wanted to implement chest shops, so I had to implement currency as well.

I have plans to support other mods implementations of currency or permissions, it just comes down to free time and where I allocate it.

Do you have any examples of a mod that would trigger the isPlayer = false in Grand Economy? Towns in SewingMachine are given their own UUIDs separate from Player UUIDs to prevent collision. Currently towns don't have coffers, only players can hold money. Just to keep money management simplistic.

My best guess would be to give these non-player UUIDs a storage space and just act as the transaction handler. There's not really any other identifying information such as "Charge this town" or "This UUID comes from this mod", just that it's a non-player.

@The-Fireplace
Copy link
Author

The-Fireplace commented Feb 28, 2022

I don't have any working examples of a non-player account for Fabric at the moment, I'm still in the process of rewriting the mods that use them. One other possibility to consider is the case where isPlayer is null, for if a mod doesn't know whether the UUID is being given for a player or not. I don't have any examples for that either, generally a mod should know whose currency it is interacting with. IIRC the whole "isPlayer" thing originated from integrating with some other economy system that required it to be set up like that; my own economy implementation doesn't care about it and only checks by UUID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants