Skip to content

A high-performance, packet-based ability system for Paper 1.21.11 servers with a flexible Cell-based API, persistent SQLite storage, and keybind support.

Notifications You must be signed in to change notification settings

sun-mc-dev/Smite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smite - High-Performance Ability Plugin

A high-performance, packet-based ability system for Paper 1.21.11+ servers with a flexible Cell-based API, persistent database storage using HikariCP, and modern Java 21 features.

✨ Features

  • High Performance: Packet-based particle effects, GUIs, and virtual thread async processing
  • 🔐 Cell System: Players select one permanent Cell containing two abilities
  • 🗄️ HikariCP Database: Persistent player data with connection pooling for optimal performance
  • 🎨 Packet-Based GUIs: Client-side inventory rendering using PacketEvents
  • 🎯 Zero Deprecated Methods: Uses only modern Paper API methods
  • 🌟 Adventure API: Modern text formatting
  • Java 21: Virtual threads, records, text blocks, and modern features
  • 📦 Minimal JAR Size: ~2-3MB (85% smaller than previous version)

📋 System Requirements

  • Minecraft Version: 1.21.4+
  • Server Software: Paper (or forks like Purpur)
  • Java Version: 21 or higher
  • Dependencies: None (all shaded)

🎮 Cell System

What are Cells?

Cells are permanent ability containers that players must choose when they first join. Each Cell contains exactly two abilities. Once a player selects a Cell, they cannot change it.

Available Cells

Spark Cell

Icon: Nether Star
Description: Harness the power of lightning and darkness

Abilities:

  • Heavenly Smite - Lightning-based ability triggered by critical hits
  • Demonic Spark - Damage storage and release ability

🔥 Included Abilities

Heavenly Smite

Cooldown: 45 seconds
Damage: 10.0 (5 hearts)
Type: Offensive

A lightning-based ability triggered by landing three critical hits in succession. Each strike deals 5 hearts (10.0 damage) bypassing armor entirely. Features cascading circular particles during critical hits and a dramatic explosion effect on activation.

Activation: Land 3 critical hits within 3 seconds
Manual Activation: /smite activate heavenly_smite

Demonic Spark

Cooldown: 45 seconds
Duration: 5 seconds
Type: Hybrid

Temporarily disables damage output for 5 seconds while storing all damage dealt. After the duration ends, unleashes all stored damage in a single devastating strike with a massive X-shaped slash effect.

Activation: /smite activate demonic_spark

📥 Installation

  1. Download the plugin JAR (~2-3MB)
  2. Place in your server's plugins folder
  3. Restart your server
  4. Players will be prompted to select a Cell on first join

🔨 Building from Source

Maven

mvn clean package

The compiled JAR will be in target/ directory.

Dependencies

The plugin uses:

  • HikariCP 7.0.2 - Connection pooling
  • PacketEvents 2.11.1 - Packet manipulation
  • SQLite JDBC 3.47.1.0 - Database driver

All dependencies are shaded and relocated.

💻 Commands

Command Description Permission
/smite select Open cell selection GUI smite.use
/smite cells List all available cells smite.use
/smite list List all abilities smite.use
/smite activate <ability> Manually activate an ability smite.use
/smite info <ability> Show ability information smite.use
/smite cooldown <player> <ability> clear Clear a cooldown smite.admin
/smite reload Reload configuration smite.admin

🔐 Permissions

  • smite.use - Basic command usage (default: true)
  • smite.admin - Admin commands (default: op)
  • smite.reload - Reload config (default: op)
  • smite.cooldown - Manage cooldowns (default: op)

🎯 Creating Custom Cells

The Cell API makes it easy to create custom ability combinations.

1. Create Your Abilities

package com.example.abilities;

import me.sunmc.smite.Smite;
import me.sunmc.smite.ability.api.AbstractAbility;
import me.sunmc.smite.ability.api.AbilityType;
import me.sunmc.smite.ability.api.ActivationContext;
import me.sunmc.smite.ability.api.ActivationResult;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

import java.util.concurrent.CompletableFuture;

public final class IceShardAbility extends AbstractAbility {

    public IceShardAbility(@NotNull Smite plugin) {
        super(
                plugin,
                "ice_shard",
                "Ice Shard",
                30,
                "Launch deadly ice shards at enemies",
                AbilityType.OFFENSIVE
        );
    }

    @Override
    protected boolean canActivateCustom(@NotNull Player player, @NotNull ActivationContext context) {
        return true;
    }

    @Override
    protected CompletableFuture<ActivationResult> executeAbility(@NotNull Player player, @NotNull ActivationContext context) {
        // Your ability logic here
        sendActivationMessage(player, "Ice shards launched!");
        return CompletableFuture.completedFuture(ActivationResult.success());
    }
}

2. Register Your Cell

// Register abilities
plugin.getAbilityManager().registerAbility(new IceShardAbility(plugin));
plugin.getAbilityManager().registerAbility(new FrozenHeartAbility(plugin));

// Create and register cell
Cell frostCell = new Cell(
        "frost_cell",
        "Frost Cell",
        "Control ice and freeze your enemies",
        "ice_shard",
        "frozen_heart",
        "ICE",
        true
);

plugin.getCellManager().registerCell(frostCell);

📖 API Reference

Core Interfaces

Cell

Represents a container of two abilities.

Key Methods:

  • String getId() - Unique identifier
  • String getDisplayName() - Display name
  • List<String> getAbilityIds() - Get both ability IDs
  • boolean containsAbility(String) - Check if cell has ability

CellManager

CellManager manager = plugin.getCellManager();

// Register a cell
manager.registerCell(new Cell(...));

// Get all cells
Collection<Cell> cells = manager.getAllCells();

Database System

DatabaseManager

DatabaseManager db = plugin.getDatabaseManager();

// Save player data
db.savePlayerData(player, "spark_cell", true);

// Load player data
db.loadPlayerData(player.getUniqueId())
    .thenAccept(data -> {
        // Use data
    });

GUI System

PacketGUIManager

PacketGUIManager gui = plugin.getGuiManager();

// Open cell selection GUI
gui.openCellSelectionGUI(player);

⚙️ Configuration

config.yml:

abilities:
  heavenly_smite:
    enabled: true
    cooldown: 45
    damage: 10.0
    required_crits: 3
    crit_chain_timeout: 3000

  demonic_spark:
    enabled: true
    cooldown: 45
    duration: 5

particles:
  use_packets: true
  max_distance: 64

database:
  file: "smite.db"
  pool:
    maximum_pool_size: 10
    minimum_idle: 2

performance:
  async_processing: true
  use_virtual_threads: true

🗄️ Database Schema

player_data Table

Column Type Description
uuid TEXT Player UUID (Primary Key)
player_name TEXT Player name
selected_cell TEXT Selected cell ID
cell_locked BOOLEAN Whether cell is permanent
created_at INTEGER Creation timestamp
updated_at INTEGER Last update timestamp

🚀 Advanced Features

Packet-Based Systems

The plugin uses PacketEvents for:

  1. Particles - Client-side particle rendering
  2. GUIs - Inventory rendering without server-side inventories
  3. Title/Action Bar - Client-side text rendering

Asynchronous Operations

All database operations use virtual threads (Java 21):

plugin.getDatabaseManager().loadPlayerData(uuid)
    .thenAccept(data -> {
        // Handle data on virtual thread
    });

HikariCP Connection Pooling

  • Pool Size: 10 connections
  • WAL Mode: Concurrent reads
  • Statement Caching: 250 statements
  • Auto-reconnect: Automatic connection management

📊 Performance

  • JAR Size: ~2-3MB (minimized)
  • Database: 5-10x faster with HikariCP
  • Async Operations: Handle 10,000+ concurrent tasks
  • Memory: Optimized with proper cleanup
  • Particles: Client-side, no server overhead

🔧 Java 21 Features Used

  • Virtual Threads - Massive concurrency
  • Records - Immutable data classes
  • Text Blocks - Clean SQL queries
  • Pattern Matching - Better switch statements
  • Sealed Classes - Restricted hierarchies
  • Enhanced NPE - Better error messages

🛣️ Roadmap

  • Add more ability cells
  • Implement ability upgrade system
  • Add ability combos
  • Create web dashboard for statistics
  • Add PvP arenas with ability restrictions
  • Metrics and monitoring
  • Admin debug tools

📜 License

This plugin is provided as-is for educational and commercial use.

🙏 Support

For issues, feature requests, or questions:

  • Check the API Documentation
  • Review example abilities in source code
  • Open an issue on GitHub

👨‍💻 Credits

Developed by SunMC with 5+ years of Java experience and modern Paper plugin development practices.


About

A high-performance, packet-based ability system for Paper 1.21.11 servers with a flexible Cell-based API, persistent SQLite storage, and keybind support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages