Commit Graph
8 Commits
Author SHA1 Message Date
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 180d257024 Proper Reformating 2025-03-13 17:14:45 -04: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 422dd3fc90 added trader.slotdisabled to trader gui
I just copied what was done to display the trader.insufficient and added trader.slotdisabled to en_US.lang
2022-05-26 01:43:17 -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