Conversation
- Rename filter modes: SHARES -> COMPANY_SHARES, CRYPTO -> CRYPTO_SHARES - Add new ITEM_SHARES filter mode - Update MarketGUI to display item instruments from database - Add createItemInstrumentItem() method to render items with their Minecraft material - Update filter toggle to cycle through all 4 modes (ALL/COMPANY_SHARES/CRYPTO_SHARES/ITEM_SHARES) - Update guis.yml with new filter configurations and item_instrument display config - Make ItemSeederService read from market.yml configuration - Add configurable seedItems section in market.yml with all default items - Maintain backward compatibility with hardcoded defaults as fallback Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
- Update MarketGUIListener to handle all instrument types (company shares, crypto, items) - Add handleInstrumentClick() to route clicks based on instrument type - Implement handleGenericInstrumentClick() for crypto and item instruments - Add buy/sell handlers for generic instruments using TradingService - Add showGenericInstrumentDetails() to display instrument information - Add new Translation enum values for instrument-specific messages - Add translations in Translations.yml for instrument errors and details - Import Instrument and InstrumentState models in MarketGUIListener Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
- Create comprehensive ITEM_INSTRUMENTS_INTEGRATION.md document - Document all changes made to integrate item instruments - Include usage guide for players and administrators - Add configuration examples and customization instructions - Provide technical details about database schema and trading - Include testing checklist and future enhancements section Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
|
@copilot Please populate more information into the market gui regarding those TransactionType.
Furthermore, I see that many click checks are based on Material#getType. However, we should be able to use proper HashMap with Integer for Slot and Stock for the click. Please make this more fancy |
…nt info
- Replace Material-based click checks with slot-to-instrument HashMap
- Add SlotInstrument class to store instrument metadata (symbol, type, data)
- Remove string parsing from getStockSymbolFromSlot, use direct HashMap lookup
- Add share price to company item display
- Add instrument_type field to all instrument displays (Company Share, Cryptocurrency, Item Instrument)
- Make all display fields configurable through guis.yml
- Deprecate old string-parsing methods in favor of HashMap approach
- Remove Material checks from button handlers, use slot numbers only
- Update guis.yml with new placeholders: {instrument_type}, {price} for companies
Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
Implemented all requested changes in commit 1e6d6a2: Enhanced Instrument Information:
Refactored Click Handling:
Configuration Updates:
The architecture is now cleaner and more performant - direct HashMap access vs multiple database lookups. |
- Create HASHMAP_REFACTORING.md documenting the click handling improvements - Explain performance benefits (0 database queries per click) - Show before/after code examples - Document new SlotInstrument class and HashMap approach - Include migration guide for developers - List enhanced display information features Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
|
@copilot Looks better, however I think:
|
…lParser - Add display_names config section in guis.yml for customizable filter labels - Implement dynamic filter toggling that skips disabled features - Add getFilterDisplayName() to retrieve configurable filter text - Hide disabled features from GUI and filter cycle (companies, crypto, items) - Add addMissingFromResource() to YamlParser for automatic config updates - Update all config classes to use addMissingFromResource() - Check feature flags before displaying instruments in market GUI - Filter cycle now adapts to enabled/disabled features dynamically Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
Implemented all requested changes in commit 8837fb1: 1. Configurable Filter Names: 2. Feature-Based Hiding:
3. Enhanced YamlParser:
All configs now use |
|
@copilot please make sure that the market is really not running, not openable and not buysellable while the time its closed |
- Add market hours check in MarketCommand before opening GUI - Add market hours check in MarketGUIListener before allowing any trading - Update market update task to check MarketScheduler.isMarketOpen() - Block all market access when outside configured trading hours - Display market closed message with open/close times and timezone - Market now truly non-functional when closed (no GUI, no trades, no updates) Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
Implemented complete market hours enforcement in commit 52a0706: Market is now fully non-functional when closed:
User experience:
Configuration (market.yml): market:
hours:
enabled: true
open-at: "06:00:00"
close-at: "22:00:00"
timezone: "UTC" |
ItemInstruments exist as database entries but aren't visible or tradeable in the market GUI. This adds complete GUI integration with filter support, makes item seeding configurable via
market.yml, refactors click handling for better performance, adds smart configuration management with feature-aware filtering, and enforces strict market hours restrictions.Filter System Refactor
SHARES→COMPANY_SHARES,CRYPTO→CRYPTO_SHARESfor clarityITEM_SHARESfilter modeguis.yml(display_namessection)ALL→COMPANY_SHARES→ITEM_SHARES→ALL)Item Display & Trading
MarketGUI.java:
createItemInstrumentItem()renders items using their Minecraft material as iconInstrumentPersistenceService.getInstrumentsByType("ITEM")MarketGUIListener.java:
Enhanced Instrument Display
All instruments now show:
Company shares display (NEW):
All display fields are fully configurable via
guis.yml.Configurable Item Seeding
ItemSeederService.java:
market.items.seedItemsfrommarket.ymlmarket.yml:
Smart Configuration Management
YamlParser.java - NEW
addMissingFromResource()method:Applied to all configuration classes:
/market.yml/companies.yml/crypto.yml/trading.ymlMarket Hours Enforcement
NEW: Complete enforcement of market trading hours to ensure market is non-functional when closed:
MarketCommand.java:
MarketScheduler.isMarketOpen()before opening GUI/marketcommands when market is closedMarketGUIListener.java:
QuickStocksPlugin.java:
StockMarketService.isMarketOpen()andMarketScheduler.isMarketOpen()Configuration (market.yml):
When market is closed:
Configuration Files
company_shares,crypto_shares,item_sharesfilter configsitem_instrumentdisplay templatemarket.filter.display_namessection for customizable filter labels{instrument_type}placeholder for all instrument types{price}placeholder for company sharesMarket_InstrumentDetails,Market_Error_InstrumentNotFound,Market_Error_PriceNotAvailablePerformance Improvements
Feature-Based UI Adaptation
companyCfg.isEnabled(),cryptoCfg.isEnabled(),marketCfg.isItemsEnabled()Technical Notes
instrumentstable withtype='ITEM'market.hours.enabledconfigurationDocumentation
Warning
<issue_title>Seamless integration of ItemInstruments into the /market gui</issue_title>
<issue_description>An ItemSeeder server is existent to create instruments next to company shares and crypto currencies. However, there is no integration of those into the market gui. Please make the following:
Comments on the Issue (you are @copilot in this section)
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.