Skip to content
Merged

v1 #2

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
c05d75e
feat: add messages and first config
Traqueur-dev Jul 20, 2025
189e231
feat: start commands
Traqueur-dev Jul 20, 2025
2138897
feat: add model id
Traqueur-dev Jul 20, 2025
625581e
feat: start breeds
Traqueur-dev Jul 20, 2025
b9b7608
feat: finish breed
Traqueur-dev Jul 20, 2025
6da574f
feat: track grow up of bees to rescale model
Traqueur-dev Jul 20, 2025
aec2aef
feat: pass watcher in async
Traqueur-dev Jul 21, 2025
76504c2
Feat/nms (#1)
Traqueur-dev Jul 21, 2025
3919431
feat: handle simple animation
Traqueur-dev Jul 21, 2025
016fd63
feat: remove all nms functionnality to use paper goal
Traqueur-dev Jul 24, 2025
1c40469
feat: handle food
Traqueur-dev Jul 24, 2025
19cf76b
feat: extract feed logic in manager
Traqueur-dev Jul 24, 2025
9cf48cf
feat: start pollinate goal
Traqueur-dev Jul 24, 2025
1d742a4
feat: change find flower algorithm
Traqueur-dev Jul 25, 2025
6b8e03e
feat: rename file docs
Traqueur-dev Jul 25, 2025
2abee9a
feat: add entities load
Traqueur-dev Jul 25, 2025
97e7616
feat: add rolling
Traqueur-dev Jul 25, 2025
7f203be
feat: add hooks
Traqueur-dev Jul 25, 2025
60d9101
feat: add mutation
Traqueur-dev Jul 25, 2025
a45eb24
feat: add honey production
Traqueur-dev Jul 25, 2025
3f5449a
feat: add drop of beehive
Traqueur-dev Jul 25, 2025
c757a97
feat: add check of honey level to prevent drop from classic drop
Traqueur-dev Jul 25, 2025
ef81eb0
feat: add recipes
Traqueur-dev Jul 26, 2025
a747f7f
fix: better usage of method
Traqueur-dev Jul 26, 2025
ad4d03d
feat: add production of resource fron honey
Traqueur-dev Jul 26, 2025
c10f4ac
feat: start tools
Traqueur-dev Jul 26, 2025
604545e
feat: add docs in readme
Traqueur-dev Jul 26, 2025
0bdfe25
feat: handle bee placeholders
Traqueur-dev Jul 26, 2025
18e9411
feat: continue tools
Traqueur-dev Jul 26, 2025
b26abf8
feat: add catch bee
Traqueur-dev Jul 26, 2025
894dfef
feat: finish tools
Traqueur-dev Jul 26, 2025
32bd6d0
feat: better handle of catchers
Traqueur-dev Jul 26, 2025
84a978f
feat: pass all tool related thing in Tool enum
Traqueur-dev Jul 26, 2025
5892a65
feat: structure code
Traqueur-dev Jul 26, 2025
a65e76e
feat: start upgrades
Traqueur-dev Jul 27, 2025
bf4b01d
feat: add upgrade command
Traqueur-dev Jul 27, 2025
c7008d4
feat: add upgrade change system
Traqueur-dev Jul 27, 2025
bd1db1e
feat: add default craft
Traqueur-dev Jul 27, 2025
51516b0
feat: add uopgrade item display
Traqueur-dev Jul 27, 2025
f179da3
feat: move place beehive logic in same place to remove 1 tick delay
Traqueur-dev Jul 27, 2025
4cc8690
feat: add javadoc in the api
Traqueur-dev Jul 27, 2025
197bcc7
feat: use my own config lib
Traqueur-dev Jul 30, 2025
c1b8f20
feat: update version of libs
Traqueur-dev Jul 30, 2025
f99358c
feat: start readme
Traqueur-dev Jul 31, 2025
04e9ce6
feat: use right method
Traqueur-dev Jul 31, 2025
151fa18
fix: tools
Traqueur-dev Jul 31, 2025
48c14a7
feat: handle classic bee
Traqueur-dev Jul 31, 2025
37dd623
feat: handle custom goal for normal bee
Traqueur-dev Jul 31, 2025
03879c6
feat: add nectar to spawn bee
Traqueur-dev Jul 31, 2025
0fb5571
feat: version
Traqueur-dev Jul 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Traqueur

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
192 changes: 192 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# 🐝 MoreBees

**A comprehensive Minecraft plugin that adds custom bee types, advanced beehive mechanics, and powerful bee management tools.**

## ✨ Features

### 🐝 Custom Bee Types
- **Multiple bee variants**: Redstone, Emerald, Diamond, Gold, Iron bees, and what you create!
- **Unique behaviors**: Each bee type has specific food preferences and flower requirements
- **Custom models**: Support for ModelEngine integration with custom 3D models
- **Breeding system**: Cross-breed different bee types to create new variants
- **Mutation mechanics**: Bees can mutate when flying over specific blocks

### 🏠 Advanced Beehive System
- **Upgradeable beehives**: Three upgrade levels with different capacities and multipliers
- **Visual upgrade displays**: See your upgrades as 3D items on beehives
- **Custom honey production**: Each bee type produces unique honey and resources
- **Automatic resource conversion**: Honey can be converted to blocks and resources

### 🛠️ Bee Management Tools
- **Bee Jar** 🍯: Capture and transport individual bees
- **Bee Box** 📦: Store up to 10 bees in a portable container
- **Easy release system**: Right-click to release bees, sneak+right-click to release all

## 🔧 Installation

1. **Download** the latest release from [GitHub Releases](https://github.com/Traqueur-Dev/MoreBees/releases) or [SpigotMC]().
2. **Place** the JAR file in your server's `plugins/` folder
3. **Restart** your server
4. **Configure** the plugin using the generated config files

## 📋 Requirements

- **Minecraft**: 1.21+
- **Server Software**: Paper, Purpur, or other Paper-based servers
- **Java**: 17+

## 🔌 Soft Dependencies

- **[ModelEngine](https://mythiccraft.io/index.php?resources/model-engine%E2%80%94ultimate-entity-model-manager-1-16-5-1-20-4.389/)**: For custom 3D bee models
- **[ItemsAdder](https://www.spigotmc.org/resources/itemsadder.73355/)**: Custom item integration
- **[Oraxen](https://www.spigotmc.org/resources/oraxen.72448/)**: Custom item integration
- **[Nexo](https://polymart.org/product/6901/nexo)**: Custom item integration

## ⚙️ Configuration

### Main Configuration (`config.yml`)

```yaml
debug: true
fly-animation: flying # For ModelEngine, set this model in ModelEngine bees

bees:
- type: redstone-bee
display-name: <red>Redstone Bee
foods: [REDSTONE]
flowers: [REDSTONE_BLOCK]
product: REDSTONE_ORE
model: redstone-bee # Optional: ModelEngine model
# ... more bee types
```

### Breeding Configuration (`breeds.yml`)

```yaml
breeds:
- parents: [redstone-bee, diamond-bee]
child: emerald-bee
chance: 1.0

mutations:
- parent: redstone-bee
child: emerald-bee
blocks: [REDSTONE_ORE]
```

### Upgrade Configuration (`upgrades.yml`)

```yaml
upgrades:
- id: level-1
max-bees: 3
production-multiplier: 1.5
produce-blocks: false
item:
material: COPPER_INGOT
name: Level 1 Upgrade
```

## 🎮 Commands

| Command | Permission | Description |
|---------|------------|-------------|
| `/morebees` | `morebees.command.help` | Show help menu |
| `/morebees reload` | `morebees.command.reload` | Reload configuration |
| `/morebees egg <player> <beetype> [amount]` | `morebees.command.egg` | Give bee spawn eggs |
| `/morebees spawn <beetype> [baby]` | `morebees.command.spawn` | Spawn a bee |
| `/morebees honey <player> <beetype> <block> [amount]` | `morebees.command.honey` | Give honey items |
| `/morebees tool <player> <tool>` | `morebees.command.tool` | Give bee tools |
| `/morebees upgrade <player> <upgrade>` | `morebees.command.upgrade` | Give beehive upgrades |

**Aliases**: `/bees`, `/mb`, `/bee`

## 🎯 How to Use

### Getting Started
1. **Spawn bees** using `/morebees egg <player> <beetype>`
2. **Feed bees** with their preferred foods to breed them
3. **Place beehives** and let bees populate them
4. **Upgrade beehives** by right-clicking with upgrade items
5. **Harvest honey** using shears when beehives are full

### Bee Management
- **Capture bees**: Right-click with a Bee Jar or Bee Box
- **Release bees**: Right-click to release, sneak+right-click to release all
- **Breed bees**: Feed two adult bees to make them breed
- **Create mutations**: Let bees with nectar fly over specific blocks

### Beehive Upgrades
- **Apply upgrades**: Right-click beehive with upgrade item
- **Remove upgrades**: Sneak+right-click to retrieve upgrade
- **Visual feedback**: Upgrades appear as 3D items on beehives

## 📘 Recipes Usage: How It Works

All custom recipes in this plugin are powered by [**RecipesAPI**](https://github.com/Traqueur-Dev/RecipesAPI) — a lightweight and flexible library purpose-built to simplify and centralize the crafting system in Minecraft.

This API was developed in-house to streamline how recipes are created, registered, and managed. It supports two ways to define recipes:

* **YAML files** – perfect for server owners and developers who prefer clean, file-based configuration.
* **Java code** – ideal for dynamic recipe generation or advanced programmatic control.

With **RecipesAPI**, you can:

* Easily add, modify, or remove recipes without dealing with low-level Minecraft internals.
* Automatically validate crafting inputs and prevent invalid crafts.
* Use custom items, tags, and even advanced conditions in your recipes.

🔍 For full documentation, visit the [**GitHub Wiki**](https://github.com/Traqueur-Dev/RecipesAPI/wiki). It includes everything you need — from YAML format examples to Java integration guides — to get started and make the most of RecipesAPI.

## 🚀 Performance Optimization: Spiral Search Algorithm

Our custom bee AI uses an optimized spiral search algorithm that reduces block scanning by up to **90%**.

**[🎬 View Interactive Demo](https://traqueur-dev.github.io/MoreBees/)**

### Key Benefits:
- ⚡ **10x faster** than traditional cube scanning
- 🎯 **Early termination** when target found
- 📈 **Scales perfectly** with multiple bees
- 🛡️ **TPS-friendly** for production servers

## 🎨 ModelEngine Integration

When ModelEngine is installed:
- **Custom 3D models** replace default bee textures
- **Animated bees** with flying animations
- **Automatic scaling** for baby bees

## 🛠️ API for Developers

MoreBees provides a comprehensive API for developers:

```java
// Get the BeeManager
BeeManager beeManager = BeePlugin.getPlugin().getManager(BeeManager.class);
// or use the ServiceManager from spigot

// Spawn a custom bee
beeManager.spawnBee(location, beeType, SpawnReason.CUSTOM, false, false);

// Get bee type from entity
Optional<BeeType> beeType = beeManager.getBeeTypeFromEntity(bee);
```

### Debug Mode
Enable debug logging in `config.yml`:
```yaml
debug: true
```

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- **[RecipesAPI](https://github.com/Traqueur-Dev/RecipesAPI)** - Recipe management system
- **[Structura](https://github.com/Traqueur-Dev/Structura)** - Configuration framework
- **ModelEngine** - 3D model support

**Made with ❤️ by [Traqueur_](https://github.com/Traqueur-Dev)**
4 changes: 4 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
group 'api'

dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
}

shadowJar {
destinationDirectory = rootProject.apiFolder
archiveFileName = rootProject.name + "-API-" + rootProject.version + ".jar"
Expand Down
6 changes: 0 additions & 6 deletions api/src/main/java/fr/traqueur/morebees/BeePlugin.java

This file was deleted.

86 changes: 86 additions & 0 deletions api/src/main/java/fr/traqueur/morebees/api/BeePlugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package fr.traqueur.morebees.api;

import fr.traqueur.commands.spigot.CommandManager;
import fr.traqueur.morebees.api.settings.Settings;
import fr.traqueur.recipes.api.RecipesAPI;
import org.bukkit.event.Listener;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

import java.util.NoSuchElementException;

/**
* The main class for the MoreBees plugin.
* This class provides methods to access various managers and settings.
* It also allows for registering listeners and managers.
*/
public abstract class BeePlugin extends JavaPlugin {

/**
* Gets the command manager for this plugin.
*
* @return the command manager
*/
public abstract CommandManager<@NotNull BeePlugin> getCommandManager();

/**
* Retrieve a manager instance of the specified class.
* This method uses the Bukkit Services API to get the registered service provider for the specified class.
* If no provider is found, it throws a NoSuchElementException.
* @param clazz the class of the manager to retrieve
* @return the manager instance of the specified class
* @param <T> the type of the manager
*/
public <T extends Manager> T getManager(Class<T> clazz) {
RegisteredServiceProvider<T> provider = getServer().getServicesManager().getRegistration(clazz);
if (provider == null) {
throw new NoSuchElementException("No provider found for " + clazz.getSimpleName() + " class.");
}
return provider.getProvider();
}

/**
* Registers a manager instance for the specified class.
* This method uses the Bukkit Services API to register the manager instance with normal service priority.
* @param clazz the class of the manager to register
* @param instance the instance of the manager to register
* @param <I> the type of the manager interface
* @param <T> the type of the manager implementation
*/
public <I extends Manager, T extends I> void registerManager( Class<I> clazz, T instance) {
getServer().getServicesManager().register(clazz, instance, this, ServicePriority.Normal);
Logger.debug("<green>Registered manager for {} successfully", clazz.getSimpleName());
}

/**
* Registers a listener for this plugin.
* This method registers the listener with the plugin's server and logs the registration.
*
* @param listener the listener to register
*/
public void registerListener(Listener listener) {
getServer().getPluginManager().registerEvents(listener, this);
Logger.debug("<green>Registered listener {} successfully", listener.getClass().getSimpleName());
}

/**
* Retrieves the settings of the specified class.
* This method uses the Bukkit Services API to get the registered service provider for the specified settings class.
* If no provider is found, it throws a NoSuchElementException.
*
* @param clazz the class of the settings to retrieve
* @return the settings instance of the specified class
* @param <T> the type of the settings
*/
public abstract <T extends Settings> T getSettings(Class<T> clazz);

/**
* Retrieves the RecipesAPI instance for this plugin.
* This method uses the Bukkit Services API to get the registered service provider for RecipesAPI.
*
* @return the RecipesAPI instance
*/
public abstract RecipesAPI getRecipesAPI();
}
Loading