Skip to content

Create 6 Shopkeeper payment integration (1.21.1)#134

Open
adam8797 wants to merge 7 commits intoLayers-of-Railways:1.21.1/1.0.xfrom
adam8797:feature/shopkeeper_integration
Open

Create 6 Shopkeeper payment integration (1.21.1)#134
adam8797 wants to merge 7 commits intoLayers-of-Railways:1.21.1/1.0.xfrom
adam8797:feature/shopkeeper_integration

Conversation

@adam8797
Copy link

@adam8797 adam8797 commented Aug 14, 2025

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:
Screenshot 2025-08-14 at 9 11 29 AM

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:

Screenshot 2025-08-14 at 9 10 57 AM

They can then place a card in the slot, or pay with coins out of their inventory. The Pay with Coins button 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:

  1. Save the context of the current transaction, assign it a unique ID, and register it in a global registry, and cancel the underlying Create function call.
  2. Pop the menu open for the player to interact with, and they make a selection of payment method
  3. Once the selection has been made, we send a packet back to the server to complete a given deferred transaction.
  4. If the user abandons the menu, we send a packet back to void the deferred transaction.

resolves #119

@Bjorkan
Copy link

Bjorkan commented Oct 18, 2025

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? :)

@adam8797
Copy link
Author

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 :)

@Bjorkan
Copy link

Bjorkan commented Oct 18, 2025

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!

@adam8797
Copy link
Author

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 :)

@Bjorkan
Copy link

Bjorkan commented Oct 21, 2025

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!

@adam8797
Copy link
Author

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

@Bjorkan
Copy link

Bjorkan commented Oct 25, 2025

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 :)

@adam8797
Copy link
Author

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! :)

@adam8797
Copy link
Author

@IThundxr I noticed you pushed recently to 1.21.1/1.0.x, would you like me to re-base onto that?

@Bjorkan
Copy link

Bjorkan commented Oct 28, 2025

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! :)

No need to apologize! 🥳 Thank you for taking a look!

@IThundxr
Copy link
Member

@IThundxr I noticed you pushed recently to 1.21.1/1.0.x, would you like me to re-base onto that?

That's fine, i can rebase it whenever we merge it

@adam8797
Copy link
Author

@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 :)

@Bjorkan
Copy link

Bjorkan commented Nov 27, 2025

@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! 🤩

@adam8797
Copy link
Author

@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!

@adam8797 adam8797 force-pushed the feature/shopkeeper_integration branch from d71997e to 76adb75 Compare November 29, 2025 22:35
@adam8797 adam8797 changed the base branch from 1.21.1/1.0.x-next to 1.21.1/1.0.x November 29, 2025 22:36
@adam8797 adam8797 changed the title Create 6 Shopkeeper payment integration Create 6 Shopkeeper payment integration (1.21.1) Nov 29, 2025
@adam8797
Copy link
Author

Ok, Sorry for all the noise. I've done the following:

  1. I've submitted a PR for the 1.20.1 branch (both forge and fabric)
  2. I've done a small refactor to this branch to bring it in-line with how its done in the 1.20.1 branch. If Create Fabric ever supports 1.21.1 we can implement this behavior in the same way as its done there.
  3. I squashed a bunch of commits, as I was getting tired of wrangling them all around.

Please let me know if there's anything else I can do!

@adam8797 adam8797 force-pushed the feature/shopkeeper_integration branch from 49e5ee7 to fcb37f3 Compare November 30, 2025 03:38
@n1ght-hunter
Copy link

is there anything holding this back? looking to use it in one of my mod packs. i may just end up using the fork until its merged

@adam8797
Copy link
Author

adam8797 commented Feb 4, 2026

From my standpoint, no- its ready to go. I've been using a local build of the 1.20.1 branch for weeks on my personal server. It just depends on when the maintainers accept it, or ask for changes. I think they're mostly focused on Create and SnR right now

I wont provide a build, but you should be able to build it locally for yourself off the fork.

@n1ght-hunter
Copy link

From my standpoint, no- its ready to go. I've been using a local build of the 1.20.1 branch for weeks on my personal server. It just depends on when the maintainers accept it, or ask for changes. I think they're mostly focused on Create and SnR right now

I wont provide a build, but you should be able to build it locally for yourself off the fork.

thanks. will definitively build it locally for my server im running atm. thanks again for the work and hopfully this can be merged in at some point

@SCPRedMage
Copy link

SCPRedMage commented Mar 4, 2026

I went ahead and compiled this for 1.20.1 and 1.21.1 and created both CurseForge and Modrinth projects for them, so people can use them in modpacks published there, since it's been so long; CurseForge is already approved, and the Modrinth one is under review.

I made sure to start the description off with crediting and linking both you and the pull requests you made here.

EDIT: If you have any desire to take ownership of them, I'm more than willing to transfer them; I just did this because a modded server I've been playing on/helping out with uses CurseForge to publish their modpack, and they don't allow mods they don't host to be included, unless there's specific approval for that mod.

@IThundxr
Copy link
Member

IThundxr commented Mar 4, 2026

I went ahead and compiled this for 1.20.1 and 1.21.1 and created both CurseForge and Modrinth projects for them, so people can use them in modpacks published there, since it's been so long; CurseForge is already approved, and the Modrinth one is under review.

I made sure to start the description off with crediting and linking both you and the pull requests you made here.

EDIT: If you have any desire to take ownership of them, I'm more than willing to transfer them; I just did this because a modded server I've been playing on/helping out with uses CurseForge to publish their modpack, and they don't allow mods they don't host to be included, unless there's specific approval for that mod.

We would rather people not publish reuploads.

As for the curseforge situation i hereby give permission for people to include unpublished versions of this mod in their pack.

(If your pack gets denied for using a override, just show curseforge this)

@SCPRedMage
Copy link

As for the curseforge situation i hereby give permission for people to include unpublished versions of this mod in their pack.

(If your pack gets denied for using a override, just show curseforge this)

They specifically require pre-approval to get it added to a list of approved non-hosted mods; I think there's also concerns for safety, since they know what scrutiny they apply to mods they host themselves. Problem is, it is slow to get that updated; I'm still waiting for them to approve a version of Apotheotic Creation updated with Create 6.0 support that's hosted on Modrinth. They also require you to provide a link to where the mod can be downloaded, so it has to be hosted somewhere.

@adam8797
Copy link
Author

adam8797 commented Mar 4, 2026

(If your pack gets denied for using a override, just show curseforge this)

I’ve been hosting my friends’ personal mod pack on curseforge and using the override with my personal version for weeks now. They shouldn’t give you any trouble going down that route.

I’d say you’ll probably be better served doing that until this is ready for the official merge, that way there’s not an extra fork floating around to confuse people.

@SCPRedMage
Copy link

Sounds like their enforcement isn't as strict as their written policy, I guess.

@SCPRedMage
Copy link

I've gone ahead and deleted the Modrinth project (which never finished review); the CurseForge project is already being used by 1.20.1 modpack that just got published, so once the main project gets the 1.20.1 update, I'll personally DM that author to let them know I'm deleting the project 24 hours later.

@Fealtous
Copy link

Fealtous commented Mar 11, 2026

I've gone ahead and deleted the Modrinth project (which never finished review); the CurseForge project is already being used by 1.20.1 modpack that just got published, so once the main project gets the 1.20.1 update, I'll personally DM that author to let them know I'm deleting the project 24 hours later.

Your build on curseforge is compiled with java 21 for 1.20.1 (this is an error), though I'm not sure how relevant this is going to be if these PRs get merged in a reasonable amount of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants