Conversation
Took 1 minute
Took 3 minutes
Took 3 minutes
Took 5 minutes
There was a problem hiding this comment.
Pull request overview
This PR represents a major structural overhaul of the MinigamesAPI, removing the example sumo module and adding comprehensive world management capabilities.
- Complete removal of the
sumoexample minigame module - Introduction of a new
classmodifiermodule for NMS bytecode modification to enable custom world loading - Addition of comprehensive world management services with support for MySQL and MongoDB storage
- Major refactoring of the team system architecture from a service-based to a manager-based approach
- Enhanced logging system with colorized console output
- Addition of decompiled code from external libraries for world serialization/deserialization
Reviewed changes
Copilot reviewed 83 out of 87 changed files in this pull request and generated 141 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle | Removed sumo module, added classmodifier module |
| sumo/* | Complete removal of example implementation (all files deleted) |
| classmodifier/* | New module for NMS bytecode modification and world loading hooks |
| plugin/src/main/java/it/fedet/minigames/world/* | New world management service with loaders for MySQL/MongoDB |
| plugin/src/main/java/it/fedet/minigames/team/TeamService.java | Refactored from service pattern to manager pattern with concurrent collections |
| plugin/src/main/java/it/fedet/minigames/game/GameService.java | Enhanced event dispatching with comprehensive event coverage |
| plugin/src/main/java/it/fedet/minigames/MinigamesCore.java | Added world provider registration, inventory manager, and enhanced startup logging |
| api/src/main/java/it/fedet/minigames/api/world/* | New world-related APIs, exceptions, and property management |
| api/src/main/java/it/fedet/minigames/api/game/team/* | Refactored team system with UUID-based player tracking |
| build.gradle | Updated dependencies including fastutil, zstd, flow-nbt, and MongoDB drivers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // | ||
| // Source code recreated from a .class file by IntelliJ IDEA | ||
| // (powered by FernFlower decompiler) | ||
| // |
There was a problem hiding this comment.
The source code header comments indicate this code was "recreated from a .class file by IntelliJ IDEA (powered by FernFlower decompiler)". This suggests the code may have been decompiled from compiled bytecode rather than being original source code. Consider whether this is appropriate for your project's licensing and whether you have the rights to use decompiled code.
| Logging.error(WorldService.class, "Failed to establish connection to the MySQL server:"); | ||
| ex.printStackTrace(); |
There was a problem hiding this comment.
The error message refers to "MySQL server" but this is actually the MongoDB loader. This will be confusing when debugging connection issues.
| files.put(setting.getClazz(), SettingsManagerBuilder | ||
| .withYamlFile( | ||
| new File(getDataFolder().getAbsolutePath() + setting.getPath(), setting.getFileName()) | ||
| new File(getDataFolder().getAbsolutePath() + setting.getPath(), setting.getFileName() + ".yml") |
There was a problem hiding this comment.
The config file name is being appended with ".yml" but the getFileName() method should already return the full filename including extension (e.g., "config.yml"). This will result in filenames like "config.yml.yml". Either remove the concatenation here or remove the extension from the getFileName() implementations.
|
|
||
| try { | ||
| Properties props = new Properties(); | ||
| props.load(new FileInputStream("server.properties")); |
There was a problem hiding this comment.
This FileInputStream is not always closed on method exit.
| private static CompoundTag loadMap(File mapFile) throws IOException { | ||
| String fileName = mapFile.getName(); | ||
| int mapId = Integer.parseInt(fileName.substring(4, fileName.length() - 4)); | ||
| NBTInputStream nbtStream = new NBTInputStream(new FileInputStream(mapFile), 1, ByteOrder.BIG_ENDIAN); |
There was a problem hiding this comment.
This FileInputStream is not always closed on method exit.
|
|
||
| } | ||
|
|
||
| public boolean worldExists(String worldName) throws IOException { |
There was a problem hiding this comment.
This method overrides SlimeLoader.worldExists; it is advisable to add an Override annotation.
| mongoCollection.createIndex(Indexes.ascending("name"), (new IndexOptions()).unique(true)); | ||
| } | ||
|
|
||
| public void update() { |
There was a problem hiding this comment.
This method overrides UpdatableLoader.update; it is advisable to add an Override annotation.
| return this.loadWorld(worldName, readOnly, false); | ||
| } | ||
|
|
||
| public byte[] loadWorld(String worldName, boolean readOnly, boolean ignoreLocked) throws UnknownWorldException, WorldInUseException, IOException { |
There was a problem hiding this comment.
This method overrides SlimeLoader.loadWorld; it is advisable to add an Override annotation.
| } | ||
| } | ||
|
|
||
| public byte[] loadWorld(String worldName, boolean readOnly) throws UnknownWorldException, IOException, WorldInUseException { |
There was a problem hiding this comment.
This method overrides SlimeLoader.loadWorld; it is advisable to add an Override annotation.
|
|
||
| } | ||
|
|
||
| public void update() throws IOException, UpdatableLoader.NewerDatabaseException { |
There was a problem hiding this comment.
This method overrides UpdatableLoader.update; it is advisable to add an Override annotation.
No description provided.