Skip to content

api: changed all structure#3

Merged
xFedeT merged 12 commits intomainfrom
dev
Dec 30, 2025
Merged

api: changed all structure#3
xFedeT merged 12 commits intomainfrom
dev

Conversation

@xFedeT
Copy link
Owner

@xFedeT xFedeT commented Dec 30, 2025

No description provided.

@xFedeT xFedeT merged commit e74d9ba into main Dec 30, 2025
3 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sumo example minigame module
  • Introduction of a new classmodifier module 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.

Comment on lines +1 to +4
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +59 to +60
Logging.error(WorldService.class, "Failed to establish connection to the MySQL server:");
ex.printStackTrace();
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message refers to "MySQL server" but this is actually the MongoDB loader. This will be confusing when debugging connection issues.

Copilot uses AI. Check for mistakes.
files.put(setting.getClazz(), SettingsManagerBuilder
.withYamlFile(
new File(getDataFolder().getAbsolutePath() + setting.getPath(), setting.getFileName())
new File(getDataFolder().getAbsolutePath() + setting.getPath(), setting.getFileName() + ".yml")
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

try {
Properties props = new Properties();
props.load(new FileInputStream("server.properties"));
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This FileInputStream is not always closed on method exit.

Copilot uses AI. Check for mistakes.
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);
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This FileInputStream is not always closed on method exit.

Copilot uses AI. Check for mistakes.

}

public boolean worldExists(String worldName) throws IOException {
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method overrides SlimeLoader.worldExists; it is advisable to add an Override annotation.

Copilot uses AI. Check for mistakes.
mongoCollection.createIndex(Indexes.ascending("name"), (new IndexOptions()).unique(true));
}

public void update() {
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method overrides UpdatableLoader.update; it is advisable to add an Override annotation.

Copilot uses AI. Check for mistakes.
return this.loadWorld(worldName, readOnly, false);
}

public byte[] loadWorld(String worldName, boolean readOnly, boolean ignoreLocked) throws UnknownWorldException, WorldInUseException, IOException {
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method overrides SlimeLoader.loadWorld; it is advisable to add an Override annotation.

Copilot uses AI. Check for mistakes.
}
}

public byte[] loadWorld(String worldName, boolean readOnly) throws UnknownWorldException, IOException, WorldInUseException {
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method overrides SlimeLoader.loadWorld; it is advisable to add an Override annotation.

Copilot uses AI. Check for mistakes.

}

public void update() throws IOException, UpdatableLoader.NewerDatabaseException {
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method overrides UpdatableLoader.update; it is advisable to add an Override annotation.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants