-
-
Notifications
You must be signed in to change notification settings - Fork 26
Create 6 Shopkeeper payment integration (1.21.1) #134
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
base: 1.21.1/1.0.x
Are you sure you want to change the base?
Create 6 Shopkeeper payment integration (1.21.1) #134
Conversation
|
Wow! Looks awesome! Would love to test it out on my survival world. Is it okay just to build it from your PR or is there something else I would need to think about before testing it out? :) |
|
Thanks! Yeah it should build just fine, and doesn’t need any extra dependencies. Have fun! If you notice any issues that I didn’t catch lmk. No telling if the maintainers will actually accept the PR, so don’t get too attached just yet :) |
Sounds great! Have you heard anything from the maintainers? This PR is the only thing we missed while using this mod just now. We have a bank terminal infront of every shopkeeper, but to have a card to use is much cleaner. :) I'll comment here if I find any bugs, and I wish you the best to getting this merged! I wish you a nice weekend here from Sweden! |
|
I haven’t heard anything recently! However I get that they’re all volunteers and probably focused on Steam n’ Rails right now, so I imagine someone will get to it eventually. And same here, it’s the main thing holding us back from having an economy really based on numismatics coins. I made this PR cause I was in the same position as you! Hope you have a wonderful weekend as well :) |
|
Hello again @adam8797 ! I realized when I was compiling this that you have (for obvious reasons) aimed this for the 1.21 version, however the server me and my friends are on is 1.20.1. Is it still possible to compile or is there too big of a difference? Take care! |
|
Hey @Bjorkan yeah I can take a look, I may end up with a few hours today. It should be pretty easy, but if it turns into a big effort I probably wont unless the maintainers want to be supporting both 1.20 and 1.21 |
How kind! However feel no pressure from me to do it! I am just impressed with what you have already done! So don't push yourself! Wishing you all the best :) |
|
Hey Sorry @Bjorkan it looks like its gonna be more than just a simple rebase, so I'm not going to put the effort into back-porting to 1.20 for now... sorry! I tried it, but they made a number of changes between 1.20 and 1.21 that I'm not looking to try and unwind. Hopefully if you all move the server to 1.21 in the future you can give it a try! :) |
|
@IThundxr I noticed you pushed recently to |
No need to apologize! 🥳 Thank you for taking a look! |
That's fine, i can rebase it whenever we merge it |
|
@Bjorkan you're in luck, my friends decided they wanted to run a pack on 1.20.1 so I'm backporting these changes anyway! I hope to have it done in a few days, if you're still willing to pilot the feature :) |
Wow! Is that so? Of course! 🤩 |
|
@Bjorkan see the other PR I have open! It should build for Fabric and Forge, whichever you're running on. As always, please backup your world! I can't really see how it would break anything, but I don't want to be responsible if anything goes bad :) Let me know if you find any issues! |
d71997e to
76adb75
Compare
|
Ok, Sorry for all the noise. I've done the following:
Please let me know if there's anything else I can do! |
49e5ee7 to
fcb37f3
Compare
This PR implements a workflow for users to both make and accept payments using numismatics coins (or cards) at Create shopkeepers.
Player Experience
Enabling the shopkeeper to accept coins
Opting into these features is as simple as placing a coin depositor next to the same stock ticker that serves the shop. It can be placed on any orthogonal side, like so:

The player may then optionally place a card in the depositor. If they do not insert a card, coins will be accepted but they will remain in the depositor.
Placing an order as a customer
If a customer attempts a transaction that does not include any numismatics coins in its costs, the player will not experience any difference. The standard Create shop mechanics will take over and fulfill the order.
If the order does have costs in the form of coins, they'll be prompted with a payment screen:
They can then place a card in the slot, or pay with coins out of their inventory. The
Pay with Coinsbutton is disabled if they do not have the requisite amount of coins available in their inventory.Upon clicking one of the payment buttons, the transaction is processed, and then any non-coin item costs are processed in the standard way.
If the player pays with coins, we withdraw coins in a greedy fashion, and will break a coin into change if needed. This is a one-click coin payment, regardless of the number and variety of coins needed.
This patch does allow for payment of mixed item & coin, but each individual item can still only have a cost of a single item or coin.
Technical details
The main flow here is that of a deferred payment system. We intercept calls to the Create
interactWithShop()function which is called whenever the player right clicks on a stock keeper with a shopping list. We check a handful of preconditions, and if they all pass we:resolves #119