Spruce Framework

Revolutionary platform for Minecraft plugin development with microservice architecture, gRPC integration and lightning-fast performance

Get Started

🚀 Incredible Features

Modular Architecture

Automatic plugin discovery, dependency injection and hot-reload for maximum development flexibility

gRPC Gateway

Ultra-fast inter-service communication with performance up to 50,000 requests per second

Redis Pub/Sub

Real-time events with latency less than 1ms for synchronization between servers

KSP Annotations

Compile-time annotation processing for DI, configurations and tasks without reflection at runtime

Smart Configurations

Automatic YAML configuration loading with validation and hot-reload support

Advanced Scheduler

Tick-based and time-based tasks with async support for optimal performance

🏗️ System Architecture

System Layers

🎮 Presentation Layer

Commands, Events, Player Interactions

🔄 Service Layer

gRPC Services, Event Bus, Message Queue

💾 Data Layer

Redis Cache, Database ORM, File Storage

💡 Code Examples

Basic Plugin

FriendsPlugin.java
@SprucePlugin(name = "FriendsPlugin", version = "1.0", author = "Spruce") public class FriendsPlugin { @Inject public Server server; @Inject public SpruceGatewayClient client; @PostConstruct public void enable() { server.getConsoleSender().sendMessage("§aFriendsPlugin enabled!"); } @PreDestroy public void disable() { server.getConsoleSender().sendMessage("§aFriendsPlugin disabled!"); } @Command("example") public void example(CommandSender sender, String[] args) { client.emitGlobal(new ExampleEvent(sender.getName(), String.join(" ", args))); } @EventListener public void onJoin(PlayerJoinEvent event) { event.getPlayer().sendMessage("Hello"); } @GlobalEventListener public void onExample(ExampleEvent event) { server.broadcastMessage(event.player() + " -> " + event.message()); } @Command("friends") public void friends(CommandSender sender, String[] args) { GatewayCall<FriendListResponse> call = GatewayCall.of("friends", "list", new FriendListRequest(sender.getName()), FriendListResponse.class); client.call(call).whenComplete((response, error) -> { if (error != null) { sender.sendMessage("§cError: " + error.getMessage()); } else { sender.sendMessage("§aYour friends: " + String.join(", ", response.friends())); } }); } }

Service Implementation

FriendsService.java
public class FriendsService extends SpruceServiceBase { public FriendsService() { super("friends"); } @Action("list") public FriendListResponse list(FriendListRequest req) { return new FriendListResponse(List.of("Example")); } public static void main(String[] args) { run(new FriendsService()); } }

Data Models

FriendsModels.java
public class FriendsModels { public record FriendListRequest(String player) {} public record FriendListResponse(List<String> friends) {} @GatewayEventType("ExampleEvent") public record ExampleEvent(String player, String message) implements GatewayEvent {} }

Configuration

FriendsConfiguration.java
@FileConfig("friends.yml") public class FriendsConfiguration { @Inject public Logger logger; public int maxFriends; public boolean messagesEnabled; public Messages messages; @PostConstruct public void onLoad() { logger.info("Friends config loaded"); } public static class Messages { public String friendJoinMessage; } }

Component Configuration

ComponentConfiguration.java
@Configuration public class ComponentConfiguration { @Bean public Component1 c1() { return new Component1(); } @Bean public Component2 c2() { return new Component2(); } }

Scheduled Tasks

Tasks.java
@Component public class Tasks { @Inject public Logger logger; @Scheduled(period = 100) public void everyFiveSeconds() { logger.info("Every five seconds"); } @Scheduled(delay = 200, async = true) public void inTenSecondsAsync() { logger.info("In ten seconds by " + Thread.currentThread().getName()); } }

Incredible Performance

50K+
Requests per second
0.1ms
Average latency
0%
Runtime reflection

🔗 Integrations and Ecosystem

Docker & Kubernetes

Built-in containerization support with ready Dockerfile and docker-compose for rapid deployment

Redis Streams

Real-time event streaming with Redis Streams for high-throughput message processing and durable event logs

Cross-Platform

Spruce plugins for Spigot and Velocity share similar code structure, making migration and multi-platform development seamless

🧪 Plugin Generator

Create your first Spruce plugin in seconds!