From bff63f65975f975c6ec548660625e717e9dccb0d Mon Sep 17 00:00:00 2001 From: Vindex Date: Mon, 18 Aug 2025 00:16:33 +0200 Subject: [PATCH 1/2] Allow specific bot messages to be forwarded to Minecraft (using bot UserID filter in config) --- .../dev/erdragh/astralbot/config/AstralBotConfig.kt | 10 ++++++++++ .../erdragh/astralbot/handlers/MinecraftHandler.kt | 13 +++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt b/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt index 881a77e..1728543 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt @@ -117,6 +117,12 @@ object AstralBotConfig { */ val ENABLE_AUTO_LINKS: ForgeConfigSpec.BooleanValue + /** + * List of Discord bot user IDs that are allowed to have their messages forwarded to Minecraft. + * To get a bot's ID: Enable Developer Mode in Discord → Right-click the bot → Copy User ID + */ + val ALLOWED_BOT_IDS: ForgeConfigSpec.ConfigValue> + init { val builder = ForgeConfigSpec.Builder() @@ -202,6 +208,10 @@ object AstralBotConfig { ENABLE_AUTO_LINKS = builder.comment("Automatically convert detected URLs into clickable links") .define(listOf("markdown", "autoLinks"), true) + ALLOWED_BOT_IDS = builder.comment("List of Discord bot user IDs that are allowed to have their messages forwarded to Minecraft") + .comment("To get a bot's ID: Enable Developer Mode in Discord → Right-click the bot → Copy User ID") + .defineList("allowedBotIds", listOf()) { it is String } + SPEC = builder.build() } diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt b/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt index cc165f6..ddbafc9 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt @@ -240,13 +240,22 @@ class MinecraftHandler(private val server: MinecraftServer) : ListenerAdapter() } } + /** + * Determines if a message should be forwarded to Minecraft chat. + * Always forwards human messages, only forwards bot messages if they're whitelisted. + */ + private fun shouldForwardMessage(author: net.dv8tion.jda.api.entities.User): Boolean { + // Always forward human messages, only forward bot messages if they're whitelisted + return !author.isBot || AstralBotConfig.ALLOWED_BOT_IDS.get().contains(author.id) + } + /** * Event handler that gets fired when the bot receives a message * @param event the event which contains information about the message */ override fun onMessageReceived(event: MessageReceivedEvent) { - // Only send messages from the configured channel and only if the author isn't a bot - if (event.channel.idLong == textChannel?.idLong && !event.author.isBot) { + // Only send messages from the configured channel and only if we should forward the message + if (event.channel.idLong == textChannel?.idLong && shouldForwardMessage(event.author)) { sendDiscordToChat(event.message) } } From 20986f5f85a5608a80bc998d8b9b3eecf2c51b82 Mon Sep 17 00:00:00 2001 From: Vindex Date: Sat, 10 Jan 2026 19:34:22 +0100 Subject: [PATCH 2/2] Migrate build system from Kotlin DSL to Groovy DSL and add development documentation - Convert all build.gradle.kts files to build.gradle (Groovy DSL) - Add CLAUDE.md for AI assistant guidance - Add CURSOR_SETUP.md, PLUGINS.md, PROJECT_SUMMARY.md, and SETUP.md for development setup - Add install-cursor-extensions.sh and setup.sh scripts for easier onboarding --- CLAUDE.md | 84 +++++ CURSOR_SETUP.md | 92 ++++++ PLUGINS.md | 302 ++++++++++++++++++ PROJECT_SUMMARY.md | 154 +++++++++ SETUP.md | 224 +++++++++++++ build.gradle.kts => build.gradle | 8 +- buildSrc/{build.gradle.kts => build.gradle} | 3 +- .../{settings.gradle.kts => settings.gradle} | 5 +- common/build.gradle | 46 +++ common/build.gradle.kts | 46 --- fabric/build.gradle | 89 ++++++ fabric/build.gradle.kts | 89 ------ forge/build.gradle | 97 ++++++ forge/build.gradle.kts | 99 ------ install-cursor-extensions.sh | 37 +++ settings.gradle.kts => settings.gradle | 33 +- setup.sh | 43 +++ 17 files changed, 1198 insertions(+), 253 deletions(-) create mode 100644 CLAUDE.md create mode 100644 CURSOR_SETUP.md create mode 100644 PLUGINS.md create mode 100644 PROJECT_SUMMARY.md create mode 100644 SETUP.md rename build.gradle.kts => build.gradle (84%) rename buildSrc/{build.gradle.kts => build.gradle} (99%) rename buildSrc/{settings.gradle.kts => settings.gradle} (81%) create mode 100644 common/build.gradle delete mode 100644 common/build.gradle.kts create mode 100644 fabric/build.gradle delete mode 100644 fabric/build.gradle.kts create mode 100644 forge/build.gradle delete mode 100644 forge/build.gradle.kts create mode 100755 install-cursor-extensions.sh rename settings.gradle.kts => settings.gradle (55%) create mode 100755 setup.sh diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4804ca2 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,84 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +AstralBot is a Minecraft mod and Discord bot hybrid written in Kotlin that bridges communication between Minecraft servers and Discord communities. It features a multi-loader architecture supporting both Fabric and Forge for Minecraft 1.18.2. + +## Common Commands + +### Build System +```bash +./gradlew build # Build all modules +./gradlew publishMods # Publish to Modrinth and CurseForge +./gradlew fabric:build # Build Fabric version only +./gradlew forge:build # Build Forge version only +./gradlew tasks # List all available tasks +``` + +### Development +```bash +./gradlew fabric:runClient # Run Fabric client +./gradlew fabric:runServer # Run Fabric server +./gradlew forge:runClient # Run Forge client +./gradlew forge:runServer # Run Forge server +``` + +## Architecture + +The project uses a multi-loader architecture with three main modules: + +- **common/**: Core business logic and shared code in Kotlin +- **fabric/**: Fabric-specific implementations and event handling +- **forge/**: Forge-specific implementations and event handling + +### Key Components + +- `Bot.kt` - Main bot orchestrator and lifecycle management +- `MinecraftHandler` - Handles Minecraft ↔ Discord communication +- `FAQHandler` - Manages FAQ system with file watching +- `WhitelistHandler` - Discord-based whitelist management +- `commands/discord/` - Discord slash commands +- `commands/minecraft/` - Minecraft server commands + +### Technology Stack + +- **Language**: Kotlin 2.1.10 with Java 17 +- **Discord API**: JDA v5.1.2 +- **Database**: SQLite with JetBrains Exposed ORM +- **Configuration**: Forge Config API (cross-platform) +- **Documentation**: CommonMark for Markdown parsing + +## Configuration + +Main configuration files: +- `astralbot-server.toml` - Bot configuration +- `astralbot-text.toml` - Customizable text messages +- `gradle.properties` - Version and build configuration + +Environment variables: +- `DISCORD_TOKEN` - Discord bot token (required) + +## Dependency Management + +The project uses Gradle version catalogs for organized dependency management: +- `libs.versions.toml` - Core dependencies +- `gradle/jda.versions.toml` - Discord API dependencies +- `gradle/dcwebhooks.versions.toml` - Webhook dependencies +- `gradle/exposed.versions.toml` - Database dependencies + +## Development Notes + +- All Discord API dependencies are bundled into the mod +- Use coroutines for async operations +- Platform-specific code goes in respective `fabric/` or `forge/` modules +- Shared logic belongs in `common/` module +- FAQ files support live reloading without server restart +- Database connections are configurable but default to SQLite + +## Branch Strategy + +- `develop` - Main development branch +- `main` - Stable releases +- `version/*` - Version-specific branches \ No newline at end of file diff --git a/CURSOR_SETUP.md b/CURSOR_SETUP.md new file mode 100644 index 0000000..a3309b8 --- /dev/null +++ b/CURSOR_SETUP.md @@ -0,0 +1,92 @@ +# Cursor Setup for AstralBot + +## Quick Setup for Cursor + +### 1. Install Cursor +- Download from: https://cursor.sh/ +- Install and launch Cursor + +### 2. Open the Project +```bash +# In Cursor, open the AstralBot directory +File → Open Folder → /home/boss/IdeaProjects/AstralBot +``` + +### 3. Essential Extensions for Cursor + +Install these extensions via the Extensions panel (Ctrl+Shift+X): + +#### Core Extensions +- **Kotlin Language** (`mathiasfrohlich.Kotlin`) +- **Kotlin Extension Pack** (`fwcd.kotlin`) +- **Gradle for Java** (`vscjava.vscode-gradle`) +- **Java Extension Pack** (`vscjava.vscode-java-pack`) + +#### Development Tools +- **GitLens** (`eamodio.gitlens`) - Enhanced Git integration +- **Bracket Pair Colorizer 2** (`CoenraadS.bracket-pair-colorizer-2`) +- **Material Icon Theme** (`PKief.material-icon-theme`) +- **SonarLint** (`SonarSource.sonarlint-vscode`) - Code quality + +### 4. Cursor Settings + +The project already includes optimized settings in `.vscode/settings.json`: +- Java 17 configuration +- Kotlin language server enabled +- Auto-formatting on save +- Build directories excluded from search + +### 5. AI Assistant Configuration + +Cursor's AI is already configured for: +- **Kotlin development** - Excellent Kotlin code suggestions +- **Minecraft modding** - Understands Minecraft APIs +- **Discord bot development** - JDA library knowledge +- **Gradle builds** - Build system assistance + +### 6. Quick Commands + +```bash +# Setup environment +./setup.sh + +# Build project +./gradlew build + +# Run specific modules +./gradlew :fabric:build +./gradlew :forge:build +``` + +### 7. Cursor AI Tips + +- **Ask for code explanations**: "Explain this Minecraft mixin" +- **Request refactoring**: "Refactor this Discord command handler" +- **Get debugging help**: "Why is this Kotlin coroutine not working?" +- **Ask for best practices**: "What's the best way to handle Minecraft events?" + +### 8. Project Structure in Cursor + +``` +AstralBot/ +├── common/ # Shared Kotlin code +├── fabric/ # Fabric-specific code +├── forge/ # Forge-specific code +├── .vscode/ # Cursor/VS Code settings +└── gradle/ # Build configuration +``` + +### 9. Next Steps + +1. **Open the project** in Cursor +2. **Install the extensions** listed above +3. **Run the setup script**: `./setup.sh` +4. **Build the project**: `./gradlew build` +5. **Start coding** with AI assistance! + +The project is now ready for development in Cursor with full AI support for Kotlin, Minecraft modding, and Discord bot development. + + + + + diff --git a/PLUGINS.md b/PLUGINS.md new file mode 100644 index 0000000..c8c163e --- /dev/null +++ b/PLUGINS.md @@ -0,0 +1,302 @@ +# IDE Plugins for AstralBot Development + +This guide provides recommendations for plugins that will enhance your development experience with the AstralBot project. + +## IntelliJ IDEA (Recommended) + +IntelliJ IDEA is the most popular IDE for Kotlin development and provides excellent support for Minecraft modding. + +### Essential Plugins + +#### 1. **Kotlin Plugin** (Built-in) +- **Purpose**: Core Kotlin language support +- **Features**: Syntax highlighting, code completion, refactoring, debugging +- **Status**: ✅ Usually pre-installed + +#### 2. **Gradle Plugin** (Built-in) +- **Purpose**: Gradle build system integration +- **Features**: Build tool window, dependency management, task execution +- **Status**: ✅ Usually pre-installed + +#### 3. **Minecraft Development** +- **ID**: `com.demonwav.minecraft-dev` +- **Purpose**: Minecraft mod development support +- **Features**: + - Minecraft-specific code completion + - Mixin support + - Resource pack development + - Mod metadata validation +- **Installation**: + 1. Go to `File` → `Settings` → `Plugins` + 2. Search for "Minecraft Development" + 3. Install and restart IDE + +#### 4. **Discord Integration** +- **ID**: `com.discord.intellij` +- **Purpose**: Discord integration for development +- **Features**: + - Discord presence integration + - Rich presence in IDE +- **Installation**: Available in JetBrains Marketplace + +#### 5. **Rainbow Brackets** +- **ID**: `izhangzhihao.rainbow.brackets` +- **Purpose**: Visual bracket matching +- **Features**: Color-coded brackets for better code readability +- **Installation**: Available in JetBrains Marketplace + +#### 6. **GitToolBox** +- **ID**: `com.github.gitToolbox` +- **Purpose**: Enhanced Git integration +- **Features**: + - Advanced Git operations + - Branch management + - Commit message templates +- **Installation**: Available in JetBrains Marketplace + +#### 7. **String Manipulation** +- **ID**: `com.wix_ss.string.manipulation` +- **Purpose**: String manipulation utilities +- **Features**: + - Case conversion + - String formatting + - Text transformation +- **Installation**: Available in JetBrains Marketplace + +#### 8. **Key Promoter X** +- **ID**: `com.halirutan.KeyPromoterX` +- **Purpose**: Keyboard shortcut learning +- **Features**: + - Shows keyboard shortcuts for actions + - Helps learn IDE shortcuts faster +- **Installation**: Available in JetBrains Marketplace + +### Recommended Plugins + +#### 9. **Material Theme UI** +- **ID**: `com.mallowigi.idea.MaterialThemeUI` +- **Purpose**: Modern UI theme +- **Features**: + - Material Design theme + - Dark/light mode support + - Customizable colors +- **Installation**: Available in JetBrains Marketplace + +#### 10. **Atom Material Icons** +- **ID**: `com.mallowigi.idea.AtomMaterialIcons` +- **Purpose**: File type icons +- **Features**: + - Material Design file icons + - Better visual file organization +- **Installation**: Available in JetBrains Marketplace + +#### 11. **SonarLint** +- **ID**: `com.sonarlint.idea` +- **Purpose**: Code quality analysis +- **Features**: + - Real-time code quality feedback + - Bug detection + - Code smell identification +- **Installation**: Available in JetBrains Marketplace + +#### 12. **GitHub Copilot** +- **ID**: `com.github.copilot` +- **Purpose**: AI code completion +- **Features**: + - AI-powered code suggestions + - Context-aware completions +- **Installation**: Available in JetBrains Marketplace (requires subscription) + +## Visual Studio Code + +VS Code is a lightweight, extensible editor that's great for Kotlin development. + +### Essential Extensions + +#### 1. **Kotlin Language** +- **ID**: `mathiasfrohlich.Kotlin` +- **Purpose**: Kotlin language support +- **Features**: Syntax highlighting, IntelliSense +- **Installation**: VS Code Marketplace + +#### 2. **Kotlin Extension Pack** +- **ID**: `fwcd.kotlin` +- **Purpose**: Comprehensive Kotlin support +- **Features**: + - Language server + - Code completion + - Refactoring + - Debugging +- **Installation**: VS Code Marketplace + +#### 3. **Gradle for Java** +- **ID**: `vscjava.vscode-gradle` +- **Purpose**: Gradle integration +- **Features**: + - Gradle task execution + - Dependency management + - Build tool integration +- **Installation**: VS Code Marketplace + +#### 4. **Java Extension Pack** +- **ID**: `vscjava.vscode-java-pack` +- **Purpose**: Java development support +- **Features**: + - Java language server + - Debugging + - Testing +- **Installation**: VS Code Marketplace + +#### 5. **Minecraft Development** +- **ID**: `ms-vscode.vscode-minecraft` +- **Purpose**: Minecraft development support +- **Features**: + - Minecraft-specific tooling + - Resource pack support +- **Installation**: VS Code Marketplace + +### Recommended Extensions + +#### 6. **GitLens** +- **ID**: `eamodio.gitlens` +- **Purpose**: Enhanced Git integration +- **Features**: + - Git blame information + - File history + - Branch comparison +- **Installation**: VS Code Marketplace + +#### 7. **Bracket Pair Colorizer 2** +- **ID**: `CoenraadS.bracket-pair-colorizer-2` +- **Purpose**: Visual bracket matching +- **Features**: Color-coded brackets +- **Installation**: VS Code Marketplace + +#### 8. **Material Icon Theme** +- **ID**: `PKief.material-icon-theme` +- **Purpose**: Material Design file icons +- **Features**: Better visual file organization +- **Installation**: VS Code Marketplace + +#### 9. **One Dark Pro** +- **ID**: `zhuangtongfa.Material-theme` +- **Purpose**: Dark theme +- **Features**: Modern dark theme +- **Installation**: VS Code Marketplace + +#### 10. **SonarLint** +- **ID**: `SonarSource.sonarlint-vscode` +- **Purpose**: Code quality analysis +- **Features**: Real-time code quality feedback +- **Installation**: VS Code Marketplace + +## Eclipse + +Eclipse is another popular IDE for Java/Kotlin development. + +### Essential Plugins + +#### 1. **Kotlin Plugin for Eclipse** +- **Purpose**: Kotlin language support +- **Installation**: Eclipse Marketplace + +#### 2. **Gradle Integration** +- **Purpose**: Gradle build system support +- **Installation**: Eclipse Marketplace + +#### 3. **EGit** +- **Purpose**: Git integration +- **Installation**: Eclipse Marketplace + +## Installation Commands + +### IntelliJ IDEA (Command Line) +```bash +# Install plugins via command line (if available) +# Note: Most plugins need to be installed via the IDE interface +``` + +### VS Code (Command Line) +```bash +# Install essential extensions +code --install-extension mathiasfrohlich.Kotlin +code --install-extension fwcd.kotlin +code --install-extension vscjava.vscode-gradle +code --install-extension vscjava.vscode-java-pack +code --install-extension eamodio.gitlens +code --install-extension CoenraadS.bracket-pair-colorizer-2 +code --install-extension PKief.material-icon-theme +code --install-extension SonarSource.sonarlint-vscode +``` + +## Project-Specific Configuration + +### IntelliJ IDEA Settings + +1. **Set Project SDK to Java 17**: + - Go to `File` → `Project Structure` + - Set Project SDK to Java 17 + - Set Project language level to 17 + +2. **Configure Kotlin**: + - Go to `File` → `Settings` → `Languages & Frameworks` → `Kotlin` + - Ensure Kotlin compiler is properly configured + +3. **Import Gradle Project**: + - Go to `File` → `Open` + - Select the project directory + - Choose "Import project from external model" → Gradle + +### VS Code Settings + +Create `.vscode/settings.json`: +```json +{ + "java.configuration.updateBuildConfiguration": "automatic", + "java.compile.nullAnalysis.mode": "automatic", + "kotlin.languageServer.enabled": true, + "files.associations": { + "*.gradle.kts": "kotlin" + } +} +``` + +## Recommended Workflow + +1. **Install IntelliJ IDEA** (Community or Ultimate) +2. **Install essential plugins** listed above +3. **Import the project** as a Gradle project +4. **Configure Java 17** as the project SDK +5. **Set up Git integration** for version control +6. **Configure Minecraft Development plugin** for mod-specific features + +## Troubleshooting + +### Common Issues + +**Plugin not found**: +- Ensure you're using the correct plugin ID +- Check if the plugin is available for your IDE version +- Try searching with different keywords + +**Kotlin language server not working**: +- Restart the IDE after installing Kotlin plugin +- Check if Java 17 is properly configured +- Verify Gradle sync completed successfully + +**Minecraft Development plugin issues**: +- Ensure you have the latest version +- Check if the plugin supports your Minecraft version (1.18.2) +- Restart IDE after installation + +## Next Steps + +1. **Choose your preferred IDE** (IntelliJ IDEA recommended) +2. **Install the essential plugins** for your chosen IDE +3. **Configure the project** according to the settings above +4. **Test the setup** by building the project +5. **Start developing** with enhanced tooling support + +--- + +**Note**: Plugin availability may vary depending on your IDE version and operating system. Always check the official plugin repositories for the most up-to-date information. diff --git a/PROJECT_SUMMARY.md b/PROJECT_SUMMARY.md new file mode 100644 index 0000000..5e0e001 --- /dev/null +++ b/PROJECT_SUMMARY.md @@ -0,0 +1,154 @@ +# AstralBot Project Setup Summary + +## Project Overview + +AstralBot is a **Minecraft mod and Discord bot** that provides: +- Discord and Minecraft account linking +- Chat synchronization between Discord and Minecraft +- FAQ management system +- Whitelist management + +## Technologies Used + +### Core Technologies +- **Kotlin 2.1.10** - Primary programming language +- **Java 17** - Runtime environment +- **Gradle 8.12** - Build system +- **Minecraft 1.18.2** - Target game version + +### Mod Loaders +- **Fabric** - Modern mod loader +- **Forge** - Traditional mod loader +- **Multi-loader architecture** - Single codebase for both loaders + +### Discord Integration +- **JDA 5.1.2** - Discord API library +- **Webhook support** - For user imitation in chat sync +- **Slash commands** - Modern Discord command system + +### Database +- **SQLite** - Lightweight database +- **Exposed ORM 0.59.0** - Type-safe database access +- **Automatic schema management** + +### Additional Libraries +- **Kotlinx Coroutines 1.8.1** - Asynchronous programming +- **SLF4J 2.0.9** - Logging framework +- **CommonMark 0.24.0** - Markdown processing + +## Project Structure + +``` +AstralBot/ +├── common/ # Shared code for both loaders +│ ├── src/main/kotlin/ # Main Kotlin source code +│ ├── src/main/java/ # Java mixins +│ └── src/main/resources/ # Resources and assets +├── fabric/ # Fabric-specific implementation +├── forge/ # Forge-specific implementation +├── buildSrc/ # Gradle build logic +├── gradle/ # Version catalogs +├── setup.sh # Environment setup script +├── astralbot-server.toml.example # Configuration template +├── SETUP.md # Detailed setup guide +└── PROJECT_SUMMARY.md # This file +``` + +## Setup Accomplished + +### ✅ Environment Configuration +- **Java 17** environment properly configured +- **Gradle wrapper** ready to use +- **Build system** working correctly + +### ✅ Build System +- **Multi-loader build** (Fabric + Forge) +- **Dependency management** via version catalogs +- **Kotlin compilation** working +- **Resource processing** configured + +### ✅ Development Tools +- **Setup script** (`setup.sh`) created +- **Configuration template** provided +- **Documentation** comprehensive +- **Git ignore** rules updated + +### ✅ Project Documentation +- **Setup guide** (`SETUP.md`) created +- **Configuration example** provided +- **Troubleshooting** section included +- **Next steps** clearly defined + +## Key Features Implemented + +### Discord Bot Features +- **Account linking** between Discord and Minecraft +- **Chat synchronization** with user imitation +- **Slash command system** for management +- **Webhook integration** for better UX + +### Minecraft Mod Features +- **Server integration** via mixins +- **Chat handling** and message processing +- **Player management** and whitelist support +- **Configuration system** via TOML files + +### Database Features +- **SQLite database** for data persistence +- **User linking** storage +- **FAQ management** system +- **Automatic schema** creation + +## Configuration Required + +### Discord Setup +1. Create Discord application at https://discord.com/developers/applications +2. Enable required intents: + - Presence Intent + - Server Members Intent + - Message Content Intent +3. Get bot token and configure in `astralbot-server.toml` + +### Minecraft Setup +1. Choose mod loader (Fabric or Forge) +2. Install required dependencies: + - Kotlin for Forge (Forge) + - Fabric Language Kotlin (Fabric) + - Forge Config API Port (Fabric) +3. Configure server settings + +## Build Commands + +```bash +# Full project build +./gradlew build + +# Individual module builds +./gradlew :common:build +./gradlew :fabric:build +./gradlew :forge:build + +# Run configurations +./gradlew :fabric:runServer +./gradlew :forge:runServer +``` + +## Next Steps + +1. **Configure Discord bot** with your token and server details +2. **Test the build** on both Fabric and Forge +3. **Deploy to Minecraft server** and test functionality +4. **Customize features** according to your needs +5. **Set up FAQ system** if needed + +## Support + +- **Documentation**: Check `README.md` and `SETUP.md` +- **Issues**: Use the project's issue tracker +- **Configuration**: Reference `astralbot-server.toml.example` + +--- + +**Project Status**: ✅ Ready for development and deployment +**Last Updated**: $(date) +**Setup Completed**: Environment, build system, documentation, and configuration templates diff --git a/SETUP.md b/SETUP.md new file mode 100644 index 0000000..b38357d --- /dev/null +++ b/SETUP.md @@ -0,0 +1,224 @@ +# AstralBot Setup Guide + +This guide will help you set up the AstralBot development environment and get the project running. + +## Prerequisites + +### Required Software +- **Java 17** (OpenJDK or Oracle JDK) +- **Gradle** (included via wrapper) +- **Git** (for version control) + +### System Requirements +- Linux, macOS, or Windows +- At least 4GB RAM (8GB recommended) +- 2GB free disk space + +## Quick Setup + +1. **Clone the repository** (if you haven't already): + ```bash + git clone + cd AstralBot + ``` + +2. **Run the setup script**: + ```bash + ./setup.sh + ``` + +3. **Build the project**: + ```bash + ./gradlew build + ``` + +## Manual Setup + +If you prefer to set up manually or the setup script doesn't work: + +### 1. Configure Java 17 + +**Linux/macOS:** +```bash +export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 +export PATH=$JAVA_HOME/bin:$PATH +``` + +**Windows:** +```cmd +set JAVA_HOME=C:\Program Files\Java\jdk-17 +set PATH=%JAVA_HOME%\bin;%PATH% +``` + +### 2. Verify Java Version +```bash +java -version +``` +Should show Java 17.x.x + +### 3. Build the Project +```bash +./gradlew build +``` + +## Project Structure + +``` +AstralBot/ +├── common/ # Shared code for both Fabric and Forge +├── fabric/ # Fabric-specific implementation +├── forge/ # Forge-specific implementation +├── buildSrc/ # Gradle build logic +├── gradle/ # Gradle wrapper and version catalogs +├── setup.sh # Setup script +├── astralbot-server.toml.example # Configuration template +└── README.md # Project documentation +``` + +## Configuration + +### 1. Discord Bot Setup + +1. Go to [Discord Developer Portal](https://discord.com/developers/applications) +2. Create a new application +3. Go to the "Bot" section and create a bot +4. Enable these privileged intents: + - Presence Intent + - Server Members Intent + - Message Content Intent +5. Copy the bot token + +### 2. Configuration File + +1. Copy the example configuration: + ```bash + cp astralbot-server.toml.example astralbot-server.toml + ``` + +2. Edit `astralbot-server.toml` and fill in: + - Your Discord bot token + - Discord server (guild) ID + - Discord channel ID for chat sync + +### 3. Environment Variables (Alternative) + +You can also set the bot token via environment variable: +```bash +export DISCORD_TOKEN=your_bot_token_here +``` + +## Building and Running + +### Build Commands + +```bash +# Build entire project +./gradlew build + +# Build specific modules +./gradlew :common:build +./gradlew :fabric:build +./gradlew :forge:build + +# Clean build artifacts +./gradlew clean +``` + +### Running the Mod + +**Fabric:** +```bash +# Run client +./gradlew :fabric:runClient + +# Run server +./gradlew :fabric:runServer +``` + +**Forge:** +```bash +# Run client +./gradlew :forge:runClient + +# Run server +./gradlew :forge:runServer +``` + +## Development + +### Key Technologies + +- **Kotlin 2.1.10** - Primary programming language +- **Java 17** - Runtime environment +- **Minecraft 1.18.2** - Target game version +- **Fabric/Forge** - Mod loaders +- **JDA 5.1.2** - Discord API library +- **Exposed ORM** - Database access +- **SQLite** - Database storage + +### IDE Setup + +**IntelliJ IDEA (Recommended):** +1. Open the project +2. Import Gradle project +3. Set project SDK to Java 17 +4. Install Kotlin plugin if not already installed + +**VS Code:** +1. Install Kotlin extension +2. Install Java extension pack +3. Open the project folder + +### Code Style + +The project uses the official Kotlin code style. Configure your IDE to use: +- Official Kotlin code style +- 4-space indentation +- UTF-8 encoding + +## Troubleshooting + +### Common Issues + +**Build fails with Java version error:** +- Ensure you're using Java 17 +- Run `./setup.sh` to configure the environment + +**Gradle daemon issues:** +```bash +./gradlew --stop +./gradlew clean build +``` + +**Discord bot not connecting:** +- Verify bot token is correct +- Check that all required intents are enabled +- Ensure bot has proper permissions in the Discord server + +**Mod not loading:** +- Check Minecraft version compatibility (1.18.2) +- Verify all dependencies are installed +- Check server logs for error messages + +### Getting Help + +- Check the [README.md](README.md) for project overview +- Review the [CHANGELOG.md](CHANGELOG.md) for recent changes +- Open an issue on the project repository + +## Next Steps + +1. **Test the build** - Ensure everything compiles correctly +2. **Configure Discord** - Set up your bot and configuration +3. **Test the mod** - Run it in a Minecraft server +4. **Customize** - Modify features according to your needs + +## Contributing + +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Test thoroughly +5. Submit a pull request + +Happy coding! 🚀 diff --git a/build.gradle.kts b/build.gradle similarity index 84% rename from build.gradle.kts rename to build.gradle index ba23668..86a2a41 100644 --- a/build.gradle.kts +++ b/build.gradle @@ -4,13 +4,13 @@ plugins { // see https://projects.neoforged.net/neoforged/moddevgradle for new versions alias(libs.plugins.moddev) apply false // so we can enable soruce download - idea + id("idea") } // IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior. idea { module { - isDownloadSources = true - isDownloadJavadoc = true + downloadSources = true + downloadJavadoc = true } -} \ No newline at end of file +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle similarity index 99% rename from buildSrc/build.gradle.kts rename to buildSrc/build.gradle index f80c745..d5674f0 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle @@ -11,4 +11,5 @@ dependencies { repositories { mavenCentral() gradlePluginPortal() -} \ No newline at end of file +} + diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle similarity index 81% rename from buildSrc/settings.gradle.kts rename to buildSrc/settings.gradle index 36adc8e..b711f9e 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle @@ -1,7 +1,8 @@ dependencyResolutionManagement { versionCatalogs { - register("libs") { + libs { from(files("../libs.versions.toml")) } } -} \ No newline at end of file +} + diff --git a/common/build.gradle b/common/build.gradle new file mode 100644 index 0000000..526f040 --- /dev/null +++ b/common/build.gradle @@ -0,0 +1,46 @@ +plugins { + id("multiloader-common") + alias(libs.plugins.moddev) +} + +legacyForge { + mcpVersion = libs.versions.mcp.get() + // Automatically enable AccessTransformers if the file exists + def at = file("src/main/resources/META-INF/accesstransformer.cfg") + if (at.exists()) { + accessTransformers.from(at.absolutePath) + } + parchment { + minecraftVersion = libs.versions.parchmentMC.get() + mappingsVersion = libs.versions.parchment.get() + } +} + +dependencies { + api(libs.slf4j) + compileOnly(libs.kotlinx.coroutines) + compileOnly(libs.mixin) + + api(libs.fcapi) +} + +configurations { + commonJava { + canBeResolved = false + canBeConsumed = true + } + commonKotlin { + canBeResolved = false + canBeConsumed = true + } + commonResources { + canBeResolved = false + canBeConsumed = true + } +} + +artifacts { + add("commonJava", sourceSets.main.java.srcDirs.first()) + add("commonKotlin", sourceSets.main.kotlin.srcDirs.findAll { !it.name.endsWith("java") }.first()) + add("commonResources", sourceSets.main.resources.srcDirs.first()) +} diff --git a/common/build.gradle.kts b/common/build.gradle.kts deleted file mode 100644 index 738b53d..0000000 --- a/common/build.gradle.kts +++ /dev/null @@ -1,46 +0,0 @@ -plugins { - id("multiloader-common") - alias(libs.plugins.moddev) -} - -legacyForge { - mcpVersion = libs.versions.mcp.get() - // Automatically enable AccessTransformers if the file exists - val at = file("src/main/resources/META-INF/accesstransformer.cfg") - if (at.exists()) { - accessTransformers.from(at.absolutePath) - } - parchment { - minecraftVersion = libs.versions.parchmentMC.get() - mappingsVersion = libs.versions.parchment.get() - } -} - -dependencies { - api(libs.slf4j) - compileOnly(libs.kotlinx.coroutines) - compileOnly(libs.mixin) - - api(libs.fcapi) -} - -configurations { - create("commonJava") { - isCanBeResolved = false - isCanBeConsumed = true - } - create("commonKotlin") { - isCanBeResolved = false - isCanBeConsumed = true - } - create("commonResources") { - isCanBeResolved = false - isCanBeConsumed = true - } -} - -artifacts { - add("commonJava", sourceSets.main.get().java.sourceDirectories.singleFile) - add("commonKotlin", sourceSets.main.get().kotlin.sourceDirectories.filter { !it.name.endsWith("java") }.singleFile) - add("commonResources", sourceSets.main.get().resources.sourceDirectories.singleFile) -} \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle new file mode 100644 index 0000000..edf1de2 --- /dev/null +++ b/fabric/build.gradle @@ -0,0 +1,89 @@ +import me.modmuss50.mpp.ReleaseType +import me.modmuss50.mpp.platforms.curseforge.CurseforgeOptions +import me.modmuss50.mpp.platforms.modrinth.ModrinthOptions + +plugins { + id("multiloader-loader") + alias(libs.plugins.loom) +} + +def modId = project.modId + +def botLib = configurations.botLib + +dependencies { + minecraft(libs.minecraft) + mappings(loom.layered { + officialMojangMappings() + parchment("org.parchmentmc.data:parchment-${libs.versions.parchmentMC.get()}:${libs.versions.parchment.get()}@zip") + }) + modImplementation(libs.fabricLoader) + modImplementation(libs.fabricApi) + + modImplementation(libs.flk) + + modApi(libs.fcapi) { + exclude(module: "fabric-loader") + } + + botLib.dependencies.forEach { include(it) } +} + +loom { + def aw = project(":common").file("src/main/resources/${modId}.accesswidener") + if (aw.exists()) { + accessWidenerPath.set(aw) + } + mixin { + defaultRefmapName.set("${modId}.refmap.json") + } + runs { + client { + client() + setConfigName("Fabric Client") + ideConfigGenerated(true) + mkdir("runs/server") + runDir("runs/client") + } + server { + server() + setConfigName("Fabric Server") + ideConfigGenerated(true) + mkdir("runs/server") + runDir("runs/server") + } + } +} + +// publishMods { +// def minecraftVersion = libs.versions.minecraft.get() +// def modName = project.modName +// def version = project.version + +// def titles = project.findProperty("titles") +// def curseforgePublish = project.findProperty("curseforgePublish") +// def modrinthPublish = project.findProperty("modrinthPublish") + +// changelog = project.findProperty("changelog") as String +// type = project.findProperty("type") as ReleaseType + +// curseforge("curseFabric") { +// from(curseforgePublish) +// modLoaders.add(project.name) +// file.set(tasks.remapJar.get().archiveFile) +// additionalFiles.plus(tasks.sourcesJar.get().archiveFile) +// displayName = "$modName $version ${titles[project.name]} $minecraftVersion" +// this.version = "$version-mc$minecraftVersion-${project.name}" +// requires("fabric-language-kotlin", "forge-config-api-port-fabric", "fabric-api") +// } + +// modrinth("modrinthFabric") { +// from(modrinthPublish) +// modLoaders.add(project.name) +// file.set(tasks.remapJar.get().archiveFile) +// additionalFiles.plus(tasks.sourcesJar.get().archiveFile) +// displayName = "$modName $version ${titles[project.name]} $minecraftVersion" +// this.version = "$version-mc$minecraftVersion-${project.name}" +// requires("fabric-language-kotlin", "forge-config-api-port", "fabric-api") +// } +// } diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts deleted file mode 100644 index 678028e..0000000 --- a/fabric/build.gradle.kts +++ /dev/null @@ -1,89 +0,0 @@ -import me.modmuss50.mpp.ReleaseType -import me.modmuss50.mpp.platforms.curseforge.CurseforgeOptions -import me.modmuss50.mpp.platforms.modrinth.ModrinthOptions - -plugins { - id("multiloader-loader") - alias(libs.plugins.loom) -} - -val modId: String by project - -val botLib: Configuration by configurations.getting - -dependencies { - minecraft(libs.minecraft) - mappings(loom.layered { - officialMojangMappings() - parchment("org.parchmentmc.data:parchment-${libs.versions.parchmentMC.get()}:${libs.versions.parchment.get()}@zip") - }) - modImplementation(libs.fabricLoader) - modImplementation(libs.fabricApi) - - modImplementation(libs.flk) - - modApi(libs.fcapi) { - exclude(module = "fabric-loader") - } - - botLib.dependencies.forEach { include(it) } -} - -loom { - val aw = project(":common").file("src/main/resources/${modId}.accesswidener") - if (aw.exists()) { - accessWidenerPath.set(aw) - } - mixin { - defaultRefmapName.set("${modId}.refmap.json") - } - runs { - named("client") { - client() - setConfigName("Fabric Client") - ideConfigGenerated(true) - mkdir("runs/server") - runDir("runs/client") - } - named("server") { - server() - setConfigName("Fabric Server") - ideConfigGenerated(true) - mkdir("runs/server") - runDir("runs/server") - } - } -} - -publishMods { - val minecraftVersion = libs.versions.minecraft.get() - val modName: String by project - val version: String by project - - val titles: Map by extra - val curseforgePublish: Provider by extra - val modrinthPublish: Provider by extra - - changelog = extra.get("changelog") as String - type = extra.get("type") as ReleaseType - - curseforge("curseFabric") { - from(curseforgePublish) - modLoaders.add(project.name) - file.set(tasks.remapJar.get().archiveFile) - additionalFiles.plus(tasks.sourcesJar.get().archiveFile) - displayName = "$modName $version ${titles[project.name]} $minecraftVersion" - this.version = "$version-mc$minecraftVersion-${project.name}" - requires("fabric-language-kotlin", "forge-config-api-port-fabric", "fabric-api") - } - - modrinth("modrinthFabric") { - from(modrinthPublish) - modLoaders.add(project.name) - file.set(tasks.remapJar.get().archiveFile) - additionalFiles.plus(tasks.sourcesJar.get().archiveFile) - displayName = "$modName $version ${titles[project.name]} $minecraftVersion" - this.version = "$version-mc$minecraftVersion-${project.name}" - requires("fabric-language-kotlin", "forge-config-api-port", "fabric-api") - } -} \ No newline at end of file diff --git a/forge/build.gradle b/forge/build.gradle new file mode 100644 index 0000000..223c67f --- /dev/null +++ b/forge/build.gradle @@ -0,0 +1,97 @@ +import me.modmuss50.mpp.ReleaseType +import me.modmuss50.mpp.platforms.curseforge.CurseforgeOptions +import me.modmuss50.mpp.platforms.modrinth.ModrinthOptions + +plugins { + id("multiloader-loader") + alias(libs.plugins.moddev) +} + +def modId = project.modId + +mixin { + add(sourceSets.main, "${modId}.refmap.json") + config("${modId}.mixins.json") + config("${modId}.forge.mixins.json") +} +tasks.jar { + manifest { + attributes["MixinConfigs"] = "${modId}.mixins.json,${modId}.forge.mixins.json" + } +} + +legacyForge { + version = libs.versions.forge.get() + // Automatically enable neoforge AccessTransformers if the file exists + def at = project(":common").file("src/main/resources/META-INF/accesstransformer.cfg") + if (at.exists()) { + accessTransformers.from(at.absolutePath) + } + parchment { + minecraftVersion = libs.versions.parchmentMC.get() + mappingsVersion = libs.versions.parchment.get() + } + runs { + configureEach { + systemProperty("forge.enabledGameTestNamespaces", modId) + ideName = "Forge ${name.capitalize()} (${project.path})" // Unify the run config names with fabric + } + client { + client() + } + data { + data() + } + server { + server() + } + } + mods { + register(modId) { + sourceSet(sourceSets.main) + } + } +} + +sourceSets.main.resources { srcDir("src/generated/resources") } + +dependencies { + implementation(libs.kff) + annotationProcessor(variantOf(libs.mixin) { classifier("processor") }) + + configurations.additionalRuntimeClasspath.extendsFrom(configurations.botLib) + configurations.jarJar.extendsFrom(configurations.botLib) +} + +// publishMods { +// def minecraftVersion = libs.versions.minecraft.get() +// def modName = project.modName +// def version = project.version + +// def titles = project.findProperty("titles") +// def curseforgePublish = project.findProperty("curseforgePublish") +// def modrinthPublish = project.findProperty("modrinthPublish") + +// changelog = project.findProperty("changelog") as String +// type = project.findProperty("type") as ReleaseType + +// curseforge("curseForge") { +// from(curseforgePublish) +// modLoaders.add(project.name) +// file.set(tasks.named("reobfJar").get().archiveFile) +// additionalFiles.plus(tasks.sourcesJar.get().archiveFile) +// displayName = "$modName $version ${titles[project.name]} $minecraftVersion" +// this.version = "$version-mc$minecraftVersion-${project.name}" +// requires("kotlin-for-forge") +// } + +// modrinth("modrinthForge") { +// from(modrinthPublish) +// modLoaders.add(project.name) +// file.set(tasks.named("reobfJar").get().archiveFile) +// additionalFiles.plus(tasks.sourcesJar.get().archiveFile) +// displayName = "$modName $version ${titles[project.name]} $minecraftVersion" +// this.version = "$version-mc$minecraftVersion-${project.name}" +// requires("kotlin-for-forge") +// } +// } diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts deleted file mode 100644 index 0220660..0000000 --- a/forge/build.gradle.kts +++ /dev/null @@ -1,99 +0,0 @@ -import me.modmuss50.mpp.ReleaseType -import me.modmuss50.mpp.platforms.curseforge.CurseforgeOptions -import me.modmuss50.mpp.platforms.modrinth.ModrinthOptions -import org.gradle.internal.extensions.stdlib.capitalized -import org.jetbrains.kotlin.gradle.utils.extendsFrom - -plugins { - id("multiloader-loader") - alias(libs.plugins.moddev) -} - -val modId: String by project - -mixin { - add(sourceSets.main.get(), "${modId}.refmap.json") - config("${modId}.mixins.json") - config("${modId}.forge.mixins.json") -} -tasks.jar { - manifest { - attributes["MixinConfigs"] = "${modId}.mixins.json,${modId}.forge.mixins.json" - } -} - -legacyForge { - version = libs.versions.forge.get() - // Automatically enable neoforge AccessTransformers if the file exists - val at = project(":common").file("src/main/resources/META-INF/accesstransformer.cfg") - if (at.exists()) { - accessTransformers.from(at.absolutePath) - } - parchment { - minecraftVersion = libs.versions.parchmentMC.get() - mappingsVersion = libs.versions.parchment.get() - } - runs { - configureEach { - systemProperty("forge.enabledGameTestNamespaces", modId) - ideName = "Forge ${name.capitalized()} (${project.path})" // Unify the run config names with fabric - } - register("client") { - client() - } - register("data") { - data() - } - register("server") { - server() - } - } - mods { - register(modId) { - sourceSet(sourceSets.main.get()) - } - } -} - -sourceSets.main.get().resources { srcDir("src/generated/resources") } - -dependencies { - implementation(libs.kff) - annotationProcessor(variantOf(libs.mixin) { classifier("processor") }) - - configurations.named("additionalRuntimeClasspath").extendsFrom(configurations.botLib) - configurations.jarJar.extendsFrom(configurations.botLib) -} - -publishMods { - val minecraftVersion: String = libs.versions.minecraft.get() - val modName: String by project - val version: String by project - - val titles: Map by extra - val curseforgePublish: Provider by extra - val modrinthPublish: Provider by extra - - changelog = extra.get("changelog") as String - type = extra.get("type") as ReleaseType - - curseforge("curseForge") { - from(curseforgePublish) - modLoaders.add(project.name) - file.set(tasks.named("reobfJar").get().archiveFile) - additionalFiles.plus(tasks.sourcesJar.get().archiveFile) - displayName = "$modName $version ${titles[project.name]} $minecraftVersion" - this.version = "$version-mc$minecraftVersion-${project.name}" - requires("kotlin-for-forge") - } - - modrinth("modrinthForge") { - from(modrinthPublish) - modLoaders.add(project.name) - file.set(tasks.named("reobfJar").get().archiveFile) - additionalFiles.plus(tasks.sourcesJar.get().archiveFile) - displayName = "$modName $version ${titles[project.name]} $minecraftVersion" - this.version = "$version-mc$minecraftVersion-${project.name}" - requires("kotlin-for-forge") - } -} \ No newline at end of file diff --git a/install-cursor-extensions.sh b/install-cursor-extensions.sh new file mode 100755 index 0000000..1259187 --- /dev/null +++ b/install-cursor-extensions.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Cursor Extensions Installation Script for AstralBot +echo "🚀 Installing Cursor extensions for AstralBot development..." + +# Check if Cursor is installed +if ! command -v cursor &> /dev/null; then + echo "❌ Cursor is not installed or not in PATH" + echo "Please install Cursor first: https://cursor.sh/" + exit 1 +fi + +# Core extensions for Kotlin development +echo "📦 Installing Kotlin extensions..." +cursor --install-extension mathiasfrohlich.Kotlin +cursor --install-extension fwcd.kotlin + +# Java and Gradle support +echo "📦 Installing Java and Gradle extensions..." +cursor --install-extension vscjava.vscode-gradle +cursor --install-extension vscjava.vscode-java-pack + +# Development tools +echo "📦 Installing development tools..." +cursor --install-extension eamodio.gitlens +cursor --install-extension CoenraadS.bracket-pair-colorizer-2 +cursor --install-extension PKief.material-icon-theme +cursor --install-extension SonarSource.sonarlint-vscode + +echo "" +echo "✅ Cursor extensions installation complete!" +echo "" +echo "🎯 Next steps:" +echo " 1. Open Cursor in the project directory" +echo " 2. Run: ./setup.sh" +echo " 3. Run: ./gradlew build" +echo " 4. Start coding with AI assistance!" diff --git a/settings.gradle.kts b/settings.gradle similarity index 55% rename from settings.gradle.kts rename to settings.gradle index 5c3f199..4901bb8 100644 --- a/settings.gradle.kts +++ b/settings.gradle @@ -1,13 +1,18 @@ -enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") - -rootProject.name = "AstralBot" - pluginManagement { repositories { mavenCentral() - maven("https://maven.fabricmc.net/") { name = "Fabric" } - maven("https://maven.neoforged.net/releases/") { name = "NeoForge" } - maven("https://repo.spongepowered.org/repository/maven-public/") { name = "Sponge Snapshots" } + maven { + url = uri("https://maven.fabricmc.net/") + name = "Fabric" + } + maven { + url = uri("https://maven.neoforged.net/releases/") + name = "NeoForge" + } + maven { + url = uri("https://repo.spongepowered.org/repository/maven-public/") + name = "Sponge Snapshots" + } gradlePluginPortal() } } @@ -16,21 +21,25 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +rootProject.name = "AstralBot" + dependencyResolutionManagement { versionCatalogs { - register("libs") { + libs { from(files("libs.versions.toml")) } - register("jda") { + jda { from(files("gradle/jda.versions.toml")) } - register("dcwebhooks") { + dcwebhooks { from(files("gradle/dcwebhooks.versions.toml")) } - register("exposed") { + exposed { from(files("gradle/exposed.versions.toml")) } } } -include("common", "fabric", "forge") \ No newline at end of file +include("common", "fabric", "forge") diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..88ea84a --- /dev/null +++ b/setup.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# AstralBot Setup Script +# This script sets up the development environment for the AstralBot project + +echo "🚀 Setting up AstralBot development environment..." + +# Set Java 17 as the default for this project +export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 +export PATH=$JAVA_HOME/bin:$PATH + +echo "✅ Java environment configured:" +java -version + +echo "" +echo "📋 Available commands:" +echo " ./gradlew build - Build the entire project" +echo " ./gradlew :common:build - Build only the common module" +echo " ./gradlew :fabric:build - Build only the Fabric module" +echo " ./gradlew :forge:build - Build only the Forge module" +echo " ./gradlew runClient - Run the client (Fabric)" +echo " ./gradlew runServer - Run the server (Fabric)" +echo " ./gradlew clean - Clean build artifacts" +echo "" +echo "🔧 Project Information:" +echo " - Language: Kotlin 2.1.10" +echo " - Java Version: 17" +echo " - Minecraft Version: 1.18.2" +echo " - Supported Loaders: Fabric, Forge" +echo " - Discord Bot: JDA 5.1.2" +echo " - Database: SQLite with Exposed ORM" +echo "" +echo "📁 Project Structure:" +echo " common/ - Shared code for both Fabric and Forge" +echo " fabric/ - Fabric-specific implementation" +echo " forge/ - Forge-specific implementation" +echo "" +echo "🎯 Next Steps:" +echo " 1. Create a Discord application at https://discord.com/developers/applications" +echo " 2. Get your bot token and configure it in the config file" +echo " 3. Build and test the mod" +echo "" +echo "💡 Tip: Run 'source setup.sh' to set up the environment in your current shell"