Commit Graph
3659 Commits
Author SHA1 Message Date
bigguy345 c3e032dcf2 Abstracted ScriptContainer & JaninoScript to IScriptUnit + global implementation 2026-01-13 18:25:28 +02:00
bigguy345 1372127266 GuiScript now extends GuiScriptInterface + Full screen support 2026-01-13 18:25:20 +02:00
bigguy345 ca8285e23f Made these 3 detached GuiScripts depend on GuiScriptInterface 2026-01-13 18:25:09 +02:00
bigguy345 88d43f8199 Merge branch 'dev' into janino-scripts
# Conflicts:
#	repositories.gradle
2026-01-13 18:18:06 +02:00
Kam 0328be57eb Add BukkitUtil, VaultUtil for Future Economy Handling 2026-01-12 12:50:08 -05:00
Kam 63c704f80a Fix Compile 2026-01-12 05:55:49 -05:00
Kam ff5ce2f556 Add Ability Hooks to NPCs 2026-01-11 20:35:53 -05:00
Kam 276465a175 Merge branch 'ability' into dev 2026-01-11 20:35:45 -05:00
Kam 11808df036 Script Hook Handler 2026-01-11 17:15:13 -05:00
Kam 828e99d427 Revise ability logic and configs 2026-01-11 16:04:49 -05:00
Kam fdb2ff98d8 Large Ability changes, cleanup, langs, fixes. 2026-01-10 23:06:13 -05:00
Claude c7d04cb9d3 Simplify ability interrupt logic and reorganize GUI
- Remove interruptThreshold field entirely - interrupts now based on damage source type
- Update canInterrupt() to only allow interrupts from direct physical hits (not magic/fire/explosions)
- Interruption only occurs during WINDUP phase, not ACTIVE
- Reorganize SubGuiAbilityConfig into 4 tabs: General, Type, Target, Effects
- Increase GUI size to 420x216 for better layout
2026-01-10 10:32:24 +00:00
Claude b40fec2270 Clean up imports to use short class names
Replace fully qualified class names with proper imports in ability files:
- Added cpw.mods.fml.relauncher.Side and SideOnly imports
- Added IAbilityConfigCallback and SubGuiAbilityConfig imports
- Added SubGuiAbility* imports for each ability type
- Replaced @cpw.mods.fml.relauncher.SideOnly(...) with @SideOnly(Side.CLIENT)
- Replaced fully qualified return types with short class names
2026-01-10 10:03:10 +00:00
Claude f28d3483e6 Refactor Ability GUI to support third-party extensibility
This refactoring allows third-party mods to provide their own custom GUI
for ability type settings by extending SubGuiAbilityConfig.

Changes:
- Refactored SubGuiAbilityConfig as base class with GuiMenuTopButton tabs
- Added virtual methods: initTypeTab(), handleTypeButton(), handleTypeTextField()
- Added createConfigGui() method to Ability base class for GUI instantiation
- Created 15 SubGuiAbility* subclasses in new ability package
- Updated GuiNPCAbilities and GuiNpcManageAbilities to use ability.createConfigGui()

Third-party mods can now:
1. Create a custom Ability subclass
2. Extend SubGuiAbilityConfig with their own GUI
3. Override createConfigGui() to return their custom GUI
2026-01-10 09:48:37 +00:00
bigguy345 fb0332e5cf Merge branch 'dev' into janino-scripts 2026-01-10 00:19:14 +02:00
bigguy345 deec2a1986 Merge remote-tracking branch 'origin/janino-scripts' into janino-scripts 2026-01-10 00:04:12 +02:00
bigguy345 b5df6b1709 Moved all janino classes to CNPC+ janino-scripts branch 2026-01-09 23:44:07 +02:00
Kam 18bab07f33 Fix Slam 2026-01-09 16:22:39 -05:00
Kam 166c8aa228 Ability Push 2026-01-09 15:29:00 -05:00
bigguy345 60af203165 Renamed to moveFromGlobalToLocal 2026-01-05 20:32:18 +02:00
bigguy345 e8ef60deb4 Important IAnimation takeTasksFrom global instance in AnimationController to local instance in entity AnimationData 2026-01-05 20:25:34 +02:00
bigguy345 db0aa94a3a IAnimation instead of Animation 2026-01-05 20:17:55 +02:00
bigguy345 eb660b38ae Added IAnimation consumers to API 2026-01-05 17:14:45 +02:00
bigguy345 68681931f8 Animation Data Store (for cross event/frame data handling) 2026-01-05 16:53:58 +02:00
bigguy345 a33acee117 Added Animation task consumers (much better than animation events) 2026-01-05 16:49:48 +02:00
Kam db14662e90 Fix auction GUI tab actions 2026-01-04 20:10:58 -05:00
Kam bc7e768d5f Show auction inventory only on create tab 2026-01-04 15:59:01 -05:00
Claude e7f6177be8 Add Auctioneer role to NPC GUI and connect auction system
- Add Auctioneer to role dropdown in GuiNpcAdvanced
- Create GuiNpcAuctioneer setup GUI for configuring:
  - Tab visibility (browse, my listings, my bids, claims)
  - Player actions (create, bid, buyout)
  - Custom welcome/disabled messages
- Add PlayerAuction container handler in CommonProxy
- Add PlayerAuction GUI handler in ClientProxy
- Add all role.auctioneer lang keys to en_US.lang
2026-01-04 20:37:00 +00:00
Kam d657bab73c Harden auction display and trader stock init 2026-01-04 15:21:11 -05:00
Claude 740c2852e5 Refactor auction system: consolidate controllers, add lang keys, remove categories
- Consolidate AuctionLogger and AuctionNotificationController into AuctionController
- Add inline logging and notification methods to AuctionController
- Add comprehensive LANG keys for all auction GUI strings
- Update EnumAuctionSort and EnumAuctionDuration to use lang keys
- Remove category filtering system (EnumAuctionCategory deleted)
- Update AuctionFilter to remove category references
- Update GuiAuction and all sub-GUIs to use StatCollector.translateToLocal()
- Update AuctionListing to remove category field and NBT serialization
2026-01-04 10:26:56 +00:00
Claude a1de79053b Implement Phase 6: GUI components, notifications, and logging system
Add auction GUI components:
- GuiAuction: Main auction browse interface with search, categories,
  sorting, pagination, and live countdown timers
- SubGuiAuctionBid: Bid placement dialog with quick bid buttons
- SubGuiAuctionCreate: Listing creation form with duration options
- SubGuiAuctionDetails: Item details view with 2x scaled rendering
- ContainerAuction: Container class for auction GUI inventory

Add notification system:
- AuctionNotificationController: Handles real-time notifications
- Supports outbid, won, sold, expired, cancelled events
- Queues notifications for offline players
- Sends pending notifications on player login

Add auction logging:
- AuctionLogger: Comprehensive logging to CNPC+ log system
- Logs all auction events (create, bid, buyout, expire, claim)
- Includes system startup and processing tick logs
- Admin action tracking

Integrate with existing systems:
- Initialize AuctionNotificationController on server start
- Hook player login for notification delivery
- Add logging calls to all AuctionController methods
2026-01-04 10:09:40 +00:00
Claude d09c6b0c81 Add auction filtering and sorting system
New files:
- EnumAuctionSort: Sorting options (price, time, name, bids, etc.)
- AuctionFilter: Search/filter criteria with builder pattern
- AuctionDataPacket: Large packet for server->client listing data

AuctionController changes:
- getFilteredListings(): Main filtering/pagination method
- sortListings(): Comprehensive sorting by various criteria
- quickSearch(): Convenience method for simple searches
- FilterResult: Pagination result container

AuctionListing changes:
- Added bidCount field with NBT persistence
- Added creationTime alias methods

AuctionActionPacket changes:
- QueryListings: Filter-based search
- QueryMyListings: Player's own listings
- QueryMyBids: Player's active bids
- QueryClaimable: Items ready to claim

NoppesUtil changes:
- Auction data storage and IAuctionData interface
- Client-side data handling for GUI integration
2026-01-04 09:33:29 +00:00
Claude 57f9b706bf Implement Phase 5: Network packets, permissions, and scripting API
- Add auction permission nodes (use, list, bid, buyout, admin)
- Create AuctionActionPacket for client-server communication
  - Supports: CreateListing, PlaceBid, Buyout, CancelListing, ClaimItem, ClaimProceeds
  - Includes permission checks and validation
- Register packet in PacketHandler
- Add auction scripting API methods to ScriptPlayer:
  - getAuctionListingCount()
  - getMaxAuctionListings()
  - hasAuctionClaims()
  - getAuctionClaimCount()
  - getActiveAuctionBidCount()
2026-01-04 08:57:13 +00:00
Claude c1dc58ae54 Implement Phase 4: Auction House core system
- Add auction enums:
  - EnumAuctionDuration.java - configurable auction durations (SHORT/MEDIUM/LONG/VERY_LONG)
  - EnumAuctionStatus.java - listing statuses (ACTIVE/SOLD/EXPIRED/CANCELLED/CLAIMED)
  - EnumAuctionCategory.java - auto-categorization of items for browsing

- Add AuctionListing.java data class:
  - Complete auction listing with seller/bidder tracking
  - Pricing with starting price, buyout price, current bid
  - Timing with snipe protection (extends TO X minutes, not by)
  - Item validation (checks trade restrictions and blacklist)
  - Previous bidder tracking for refund notifications
  - NBT serialization for persistence

- Add AuctionController.java:
  - Global auction house management
  - Create/cancel/finalize listings
  - Bid placement with automatic outbid refunds via claims system
  - Buyout support with immediate sale
  - Claim system for sellers (proceeds) and buyers (items)
  - Search and filter by category/name
  - Periodic expiration processing
  - Persistence via auctions.dat

- Add RoleAuctioneer.java NPC role:
  - Configurable tabs (listings, my listings, my bids, claims)
  - Configurable permissions (create, bid, buyout)
  - Custom welcome/disabled messages
  - Opens auction GUI on interaction

- Update ConfigMarket.java:
  - Duration-specific settings (hours and fees)
  - Removed deprecated AvailableDurations string

- Update EnumRoleType.java - add Auctioneer
- Update EnumGuiType.java - add PlayerAuction, SetupAuctioneer
- Update DataAdvanced.java - handle Auctioneer role creation
- Update CustomNpcs.java - initialize AuctionController
2026-01-04 08:43:55 +00:00
Claude dc9d15f3e3 Implement Phase 3: Item Attributes & Restrictions
- Add ItemTradeAttribute.java for trade restriction utilities
  - TAG_UNTRADEABLE for items that cannot be traded
  - Check existing TAG_PROFILE_SLOT and TAG_SOULBIND tags
  - canTrade() checks all three restriction types
  - getTradeBlockReason() returns localization key for UI
  - Utility methods for setting/getting each restriction type
  - clearAllRestrictions() and getRestrictionSummary() helpers

- Add AuctionBlacklist.java controller
  - Blacklist items by registry name (e.g., "minecraft:diamond_sword")
  - Blacklist entire mods by mod ID (e.g., "minecraft")
  - Blacklist items with specific NBT tags (supports dot notation)
  - isBlacklisted() and getBlacklistReason() for checking
  - Persistence via auction_blacklist.dat
  - Add/remove methods for each blacklist type

- Initialize AuctionBlacklist in CustomNpcs.java

- Add scripting API methods to ScriptItemStack.java
  - canTrade() - check if item can be traded
  - getTradeBlockReason() - get block reason
  - isUntradeable() / setUntradeable() - manage untradeable flag
  - isProfileSlotBound() / getProfileSlot() / setProfileSlotBound()
  - isSoulbound() / getSoulbindOwner() / removeSoulbind()
  - clearTradeRestrictions() - remove all restrictions
  - getRestrictionSummary() - human-readable summary
2026-01-04 08:34:45 +00: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
Claude 60b985d33d Fix currency storage to use main PlayerData file
- Currency now stored in main player save file, not separate file
- Currency excluded from getNBT/setNBT (slot-specific data)
- Currency saved in save() after getNBT(), loaded before setNBT()
- This ensures currency is preserved during profile slot changes
- Removed loadCurrency() and saveCurrency() separate file methods
- Updated VaultHelper to call save() instead of saveCurrency()
2026-01-04 08:23:50 +00:00
Claude 7e6b17c106 Implement Phase 1: Currency System foundation
- Add ConfigMarket.java with separate market.cfg config file
  - Currency settings (name, starting balance, max balance, Vault integration)
  - Auction settings (durations, fees, snipe protection, claim expiration)
  - Trader settings (stock system defaults)

- Add PlayerCurrencyData.java for balance storage
  - NOT profile slot bound - shared across all slots
  - Tracks balance, lifetime earned, and lifetime spent
  - Deposit/withdraw with overflow protection

- Add VaultHelper.java for Bukkit hybrid server integration
  - Reflection-based VaultAPI integration
  - Falls back to internal currency when Vault unavailable
  - Supports getBalance, deposit, withdraw, transfer operations

- Add CurrencyController.java for currency operations
  - Claims system for auction refunds and NPC payments
  - Claim expiration with configurable days
  - Persistence via currency_claims.dat

- Update PlayerData.java to integrate currency
  - Separate loadCurrency/saveCurrency methods
  - Currency file stored separately from slot data

- Add scripting API methods to ScriptPlayer.java
  - getCurrencyBalance(), addCurrency(), removeCurrency()
  - canAffordCurrency(), getCurrencyName(), formatCurrency()
  - hasPendingClaims(), getPendingClaimsTotal(), claimAllCurrency()
2026-01-04 08:14:29 +00:00
Kam a0de82b8e4 Merge branch 'claude/fix-npc-spawn-biomes-hPE8Q' into dev 2026-01-03 15:55:31 -05:00
Kam 12696996a6 1.10.3 2026-01-03 01:23:45 -05:00
somehussar f78fc30660 Ban java.lang.reflect package 2026-01-03 02:54:08 +01:00
Claude f6114dfa5e Fix NPC biome spawn settings not persisting after editing
When users modified biomes, dimensions, or spawning options through the
sub-GUI dialogs, changes were only stored in client memory and never sent
to the server. This caused spawn configurations to appear correct in the
UI but fail to work after server restarts.

The closeSubGui() method now calls save() when SubGuiNpcBiomes,
SubGuiNpcDimensions, or SubGuiSpawningOptions dialogs close, ensuring
changes are immediately sent to the server via NaturalSpawnSavePacket.

Added @Override annotation for consistency with other GUI classes.
2026-01-02 09:50:28 +00:00
Kam 6cc78a62aa Merge branch 'claude/fix-bard-music-dialog-bug-Rm8DP' into dev 2026-01-02 00:09:38 -05:00
Kam cb0b18310a Merge remote-tracking branch 'origin/claude/fix-quest-cooldown-timer-hoXkh' into dev 2026-01-02 00:08:42 -05:00
Claude 1d191413fb Fix quest cooldown not working for MCCUSTOM and RLCUSTOM types
The canQuestBeAccepted() method was missing cases for MCCUSTOM and
RLCUSTOM repeat types, causing quests with custom cooldowns to become
permanently inaccessible after first completion. Added the missing
checks using quest.customCooldown for both MC ticks and real-life
milliseconds.
2026-01-02 03:58:52 +00:00
Claude f5deb8a823 Fix Bard music restarting/duplicating when opening dialogs
Two issues were causing the bug:
1. GuiDialogInteract.close() called stopAllSounds() unconditionally,
   which stopped Bard music even when the dialog had no sound or
   when a different Bard was playing nearby.

2. MusicController.stopMusic() didn't set playDelay, allowing Bards
   to immediately restart their music after dialog close.

Changes:
- MusicController.stopMusic() now sets playDelay=20 and clears entity
  reference to prevent immediate music restart
- Added MusicController.stopSound(key) to stop specific sounds
- Dialog GUIs now track their dialog sound and only stop that on close,
  preserving Bard music and other sounds
2026-01-02 03:54:19 +00:00
Kam 07a10b8414 Remove this 2026-01-01 22:35:32 -05:00
Kam e2291f8ccc Fix Debugging Error 2026-01-01 22:02:54 -05:00
Kam f19c53758e 1.10.3-beta 2026-01-01 21:47:17 -05:00
Claude 9b654621e8 Add attack speed check to NPC's attackEntityFrom before immunity check
The LivingAttackEvent handler was firing too late for NPCs because
EntityNPCInterface.attackEntityFrom() has its own immunity check that
runs BEFORE calling super (which fires LivingAttackEvent).

Now the attack speed bypass is checked directly in the NPC's
attackEntityFrom() method, before the immunity check at line 658.
2025-12-31 01:00:33 +00:00