Commit Graph
13 Commits
Author SHA1 Message Date
KAMKEEL 68b5191db6 Fix trader edits being lost on an existing linked market
Closing the setup GUI saved the market from the server''s stale role and then
re-read that market over the edits it had just applied, so stock and currency
cost changes never survived. The role now saves first and the market is written
from it, and relinking to another market no longer pushes pre-link data over it.
2026-08-11 03:21:46 -04:00
Kam 3577701edf Auction Fixes + Auction API Hookup 2026-01-24 15:11:50 -05:00
Kam a9b602713c Large Cleanup to Code Imports and Formatting 2026-01-22 23:07:38 -05:00
Kam d0dc8a4578 Trader System + Stocks Implemented
- Removed Auction System Temporarily for Full Rebase
2026-01-22 12:38:56 -05:00
Claude c9f77bed05 Implement Phase 2: Trader Enhancements with stock and currency system
- Add EnumStockReset.java for stock reset timing types
  - NONE, MCDAILY, MCWEEKLY, MCCUSTOM (MC time)
  - RLDAILY, RLWEEKLY, RLCUSTOM (real time)
  - Helper methods for interval calculation and display formatting

- Add TraderStock.java for stock management
  - Per-slot stock limits with -1 for unlimited
  - Per-player vs per-server stock tracking modes
  - Automatic reset timer with configurable intervals
  - PlayerTraderStock inner class for per-player tracking
  - NBT serialization for persistence

- Modify RoleTrader.java to support stock and currency
  - Add TraderStock instance for stock management
  - Add useCurrency flag and slotPrices array for virtual currency
  - Auto-check for stock reset on interact()
  - Helper methods: hasStock(), getAvailableStock(), consumeStock()
  - Helper methods: getSlotPrice(), setSlotPrice(), hasSlotPrice()
  - getTimeUntilResetFormatted() for GUI display

- Modify ContainerNPCTrader.java for transactions
  - Check stock availability before purchase
  - Handle virtual currency purchases via CurrencyController
  - Fall back to item-based currency when useCurrency disabled
  - Consume stock after successful purchase
2026-01-04 08:29:03 +00:00
Kam 6815f579a7 Full Imports and Code Format Optimization 2025-03-12 20:12:01 -04:00
Kam 3507cb85c5 Multithread Market Saving + Record History for Markets 2024-02-20 20:29:49 -05:00
KAMKEEL bda76bafe6 Optimize Imports 2023-01-12 21:33:06 -05:00
Luis C.M fd1ac6dce4 Merge KAMKEEL-dev into dev. 2022-06-12 04:23:05 -05:00
1whohears 17fa6328c9 fixed crash when hovering over a trader item slot
HashMap.put doesn't work the way I thought it did
2022-06-06 14:38:33 -05:00
1whohears 3cf780d9a2 add get reset disable purchase num by slot number and IPlayer
needed to add get/setStringIntegerArrayMap to NBTTags so save the player purchases and disabled slots with a String int[] hashmap
2022-05-26 15:57:24 -05:00
1whohears a4361b8420 Added various things to the API and other small changes
This adds some useful functions to the api and a few other changes.
I had been creating a custom build of this mod while working on stuff because I couldn't figure out how to do certain things without changing the mod. So this is a collection api features that I think everyone would find useful.

Api additions:
-purchase counting, and disabling trades for the trader role. (if a trade is disabled the gui still says insufficient funds, maybe allow a custom message to appear) added get the traders currency items and sell items.
-if an npc's projectile does explosive damage, you can disable it destroying blocks even if mob griefing is on
-int arrays as stored data for entities
-entity.playSound(...)
-get set if npcs can drown
-player read and unread dialog
-player set faction points
-extra player.sendMessage functions to add custom colors/bold/underline
-player clear inventory
-get set if a follower npc is following a player or waiting
-a bunch of stuff to script faction
-is an item food and how many food points?
-get scoreboard team by it's name
-get and create factions from the script world
-world.rayCastBlockPos is used for getting what block a player is looking at.
-world.getNearestAir is meant to get the block of air above or around the result of world.rayCastBlockPos, or at least that's how I've been using it.

Changes:
-in NoppesUtilServer I feel like if an npc is cloned it's ticksExisted or age should bee zero
-follower npcs should have the canDespawn field automatically set to false...? maybe make it an option
2022-05-24 03:06:16 -05:00
KAMKEEL a31efb2dc3 1.7.10 Files
Files added
2018-09-13 12:03:28 -04:00