Repository navigation
Plugin version 1.2.0 release - #3
Merged
Merged
Conversation
A stock and a per-player limit counted purchases, so an entry selling sixteen at a time with a limit of ten handed over a hundred and sixty items, and one click spent one of the ten however much it moved. Both now count items. A trade spends bundleSize * bundles of each, and maxBuyable divides what is left by the bundle, because half a bundle is not a purchase. Existing shops are converted as the file is read, so every entry keeps trading exactly as it did. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
An entry could cap how much one player bought from it but not how much they sold to it, so the only way to stop a shop buying a farm's whole output was to take the sell side off entirely. The two sides now have a limit each, set apart in the entry editor and counted apart, so neither spends the other's allowance. Buying keeps the counter key it has always had, so what players have already bought today still counts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Buying as many as you could always blamed the player's wallet when it came back with nothing, which is wrong whenever the stock or their own limit is what ran out — and now more often wrong, because a limit counted in items can leave a remainder too small for one more bundle. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Prices, payouts, what is left and what a click does ran together in one list, so reading a price meant picking it out of a set of instructions. The lore is now built in blocks that ShopRender.sections spaces apart, dropping the ones an entry has nothing for. A price is red and a payout green wherever either appears, down to the items each side asks for, so the two directions are told apart before the number is read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Giving a player items, asking whether they would fit, and adding lines to an item's lore are not shop-specific. They move to InventoryUtil and LoreUtil.withLore so anything else that hands over items or draws a menu decides both the same way shops already do. ShopInventory keeps what is genuinely its own: finding and taking goods by MatchMode. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Shift-right-clicking another player, or /trade <player>, asks them to trade; once they accept both get the same table, drawn for its own viewer so your half is always on the left. What a player puts up leaves their inventory and is held by the trade, so the other side can trust what it is looking at. Money is named rather than held, because a balance quietly missing from everything that reads it would be the worse lie, so confirming re-checks it and the swap can still refuse over it. Every change to either offer drops both confirmations and locks them for a moment, so nothing can be swapped out after the other player has agreed to it. TradeManager.cancel is the only way a trade ends without the swap and is idempotent, so escrow is handed back exactly once however many things end the trade at the same instant. The quit path returns items inside PlayerQuitEvent, which still runs before the server writes the player's inventory. Money settles as a single net payment, attributed as a player trade so it lands in the ledger and the panel as a payment rather than an anonymous Vault call. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.