Skip to content

Latest commit

 

History

History
128 lines (99 loc) · 5.67 KB

File metadata and controls

128 lines (99 loc) · 5.67 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Chat is a BentoBox addon for Minecraft (Paper) that provides Team Chat and Island Chat for island-type game modes (BSkyBlock, AcidIsland, CaveBlock, SkyGrid). It requires Java 21 and targets Paper 1.21.11.

Build Commands

mvn clean package          # Build (default goal)
mvn test                   # Run all tests
mvn -Dtest=ChatListenerTest test   # Run a single test class
mvn -Dtest=ChatListenerTest#onChat test  # Run a single test method

The build produces target/Chat-{version}-SNAPSHOT-LOCAL.jar.

Architecture

This is a BentoBox Pladdon (plugin-addon):

  • ChatPladdon — Entry point loaded by BentoBox's Pladdon system, creates the Chat addon instance
  • Chat — Main addon class. On enable: loads Settings from config.yml, registers commands per game mode, creates ChatListener, and registers the IsTeamChatHandler request handler
  • ChatListener — Core logic. Implements both Listener and EventExecutor. Intercepts AsyncPlayerChatEvent (registered manually with configurable priority from Settings). Maintains in-memory sets for team chat users, island chatters, team spies, and island spies. All toggle state is held in memory (not persisted)
  • Settings — BentoBox ConfigObject stored at addons/Chat/config.yml. Controls which game modes have team/island chat, logging, event priority, and default chat game mode
  • IsTeamChatHandler — BentoBox request handler that lets other addons query if a player has team chat enabled

Commands follow BentoBox's CompositeCommand pattern and are registered dynamically onto each game mode's player/admin command trees:

  • Player: IslandChatCommand (chat), IslandTeamChatCommand (teamchat), IslandTeamMuteCommand (muteteamchat)
  • Admin: AdminIslandChatSpyCommand (chatspy), AdminTeamChatSpyCommand (teamchatspy)

Testing

Tests use JUnit 5 + Mockito + MockBukkit. The CommonTestSetup base class provides standard mocks for BentoBox, Bukkit, Player, World, Island, etc. New test classes should extend CommonTestSetup and call super.setUp()/super.tearDown(). The WhiteBox utility sets private/static fields via reflection for test setup.

Localization strings are defined in src/main/resources/locales/ (en-US.yml is the primary locale).

Dependency Source Lookup

When you need to inspect source code for a dependency (e.g., BentoBox, addons):

  1. Check local Maven repo first: ~/.m2/repository/ — sources jars are named *-sources.jar
  2. Check the workspace: Look for sibling directories or Git submodules that may contain the dependency as a local project (e.g., ../bentoBox, ../addon-*)
  3. Check Maven local cache for already-extracted sources before downloading anything
  4. Only download a jar or fetch from the internet if the above steps yield nothing useful

Prefer reading .java source files directly from a local Git clone over decompiling or extracting a jar.

In general, the latest version of BentoBox should be targeted.

Project Layout

Related projects are checked out as siblings under ~/git/:

Core:

  • bentobox/ — core BentoBox framework

Game modes:

  • addon-acidisland/ — AcidIsland game mode
  • addon-bskyblock/ — BSkyBlock game mode
  • Boxed/ — Boxed game mode (expandable box area)
  • CaveBlock/ — CaveBlock game mode
  • OneBlock/ — AOneBlock game mode
  • SkyGrid/ — SkyGrid game mode
  • RaftMode/ — Raft survival game mode
  • StrangerRealms/ — StrangerRealms game mode
  • Brix/ — plot game mode
  • parkour/ — Parkour game mode
  • poseidon/ — Poseidon game mode
  • gg/ — gg game mode

Addons:

  • addon-level/ — island level calculation
  • addon-challenges/ — challenges system
  • addon-welcomewarpsigns/ — warp signs
  • addon-limits/ — block/entity limits
  • addon-invSwitcher/ / invSwitcher/ — inventory switcher
  • addon-biomes/ / Biomes/ — biomes management
  • Bank/ — island bank
  • Border/ — world border for islands
  • Chat/ — island chat
  • CheckMeOut/ — island submission/voting
  • ControlPanel/ — game mode control panel
  • Converter/ — ASkyBlock to BSkyBlock converter
  • DimensionalTrees/ — dimension-specific trees
  • discordwebhook/ — Discord integration
  • Downloads/ — BentoBox downloads site
  • DragonFights/ — per-island ender dragon fights
  • ExtraMobs/ — additional mob spawning rules
  • FarmersDance/ — twerking crop growth
  • GravityFlux/ — gravity addon
  • Greenhouses-addon/ — greenhouse biomes
  • IslandFly/ — island flight permission
  • IslandRankup/ — island rankup system
  • Likes/ — island likes/dislikes
  • Limits/ — block/entity limits
  • lost-sheep/ — lost sheep adventure
  • MagicCobblestoneGenerator/ — custom cobblestone generator
  • PortalStart/ — portal-based island start
  • pp/ — pp addon
  • Regionerator/ — region management
  • Residence/ — residence addon
  • TopBlock/ — top ten for OneBlock
  • TwerkingForTrees/ — twerking tree growth
  • Upgrades/ — island upgrades (Vault)
  • Visit/ — island visiting
  • weblink/ — web link addon
  • CrowdBound/ — CrowdBound addon

Data packs:

  • BoxedDataPack/ — advancement datapack for Boxed

Documentation & tools:

  • docs/ — main documentation site
  • docs-chinese/ — Chinese documentation
  • docs-french/ — French documentation
  • BentoBoxWorld.github.io/ — GitHub Pages site
  • website/ — website
  • translation-tool/ — translation tool

Check these for source before any network fetch.

Key Dependencies (source locations)

  • world.bentobox:bentobox 3.14.0-SNAPSHOT~/git/bentobox/src/