Paper Migration Guide
Transitioning from Java (Bukkit/Spigot/Paper) to Rust (PotatoMC) is designed to be intuitive. PotatoMC maps familiar OOP concepts to Rust's trait-based architecture while enforcing thread safety.
1. Concept Mapping
| Bukkit (Java) | PotatoMC (Rust) |
|---|---|
JavaPlugin class | Plugin trait + potato_plugin! macro |
onEnable() | fn on_enable(&self, context: &PluginContext) |
@EventHandler | context.register_event(|event| ) |
BukkitRunnable | context.scheduler().run_task(...) |
plugin.yml | Defined in metadata() method of the Plugin trait |
2. Dealing with the Borrow Checker
The biggest shift for Java developers is dealing with Rust's borrow checker. Because PotatoMC uses multi-threaded ticking for chunks, you cannot hold mutable references across await points or tick boundaries. Use IDs (like UUID or EntityId) rather than holding direct references to Player or Entity objects in your long-running state.