happy_zen

i want a tool added, like a item, that can be used on/to configure a bamboo plant and tell the plant how high it can naturally grow

Kodari AI
KodariMay 17 at 12:07 pm 8,759 (v2)

I’ll create a plugin that adds a configurable tool to set bamboo growth height limits.

BambooConfigurator
A tool-based plugin that allows players to configure bamboo plants by setting custom height limits. Players use a special configurator tool to set maximum growth heights for individual bamboo plants, preventing them from growing beyond the specified limit. Includes a user-friendly GUI for height selection, persistent storage of bamboo configurations, and admin commands. Perfect for maintaining aesthetic bamboo gardens and controlled farming areas.

Now I’ll create the plugin structure:

Plugin created! BambooConfigurator adds a blaze rod tool that players can use to right-click bamboo plants and set custom height limits via a GUI. The plugin tracks each bamboo base location and prevents growth beyond the configured height.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
10 513
src/main/java/com/bambooconfig/BambooConfigurator.java
package com.bambooconfig;

import com.bambooconfig.commands.ConfiguratorCommand;
import com.bambooconfig.data.BambooDataManager;
import com.bambooconfig.listeners.BambooGrowthListener;
import com.bambooconfig.listeners.BambooInteractListener;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class BambooConfigurator extends JavaPlugin {

    private BambooDataManager dataManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.dataManager = new BambooDataManager(this);
        this.dataManager.load();

        getServer().getPluginManager().registerEvents(new BambooInteractListener(this), this);
        getServer().getPluginManager().registerEvents(new BambooGrowthListener(this), this);

        getCommand("bambooconfigurator").setExecutor(new ConfiguratorCommand(this));

        getLogger().info("BambooConfigurator has been enabled!");
    }

    @Override
    public void onDisable() {
        if (dataManager != null) {
            dataManager.save();
        }
        getLogger().info("BambooConfigurator has been disabled!");
    }
}