mirror of
https://github.com/xoo0524tw/OpenMBedwars.git
synced 2026-12-05 22:06:02 +02:00
9b48f25a4aaf3792e19f94c736c37842939fc1f5
Update IntelliJ file-encoding settings.
MBedwars (v5.5.9.1 Reconstructed)
This repository contains the deobfuscated and reconstructed source code of MBedwars
5.5.9.1, a plugin for the Minecraft Spigot / Paper ecosystem, organized as a multi-module Maven project with IntelliJ IDEA support (original author: Marcel Seibel / Marcely1199).
1. Plugin Overview
MBedwars is a highly customizable Bedwars minigame core plugin designed for Minecraft servers:
- Main entry point:
de.marcely.bedwars.MBedwars - Version compatibility: Natively supports Minecraft 1.8.8 through 1.26.x via a shared abstraction layer and version-specific NMS adapter modules, covering Legacy (1.8–1.16), Modern (1.17–1.26), and Paper hard-fork compatibility.
- API version declaration:
api-version: 1.13(for compatibility with different server versions at plugin load time).
2. Original Obfuscation Design, Strength, and Reverse Engineering Process
Original Obfuscation Design and Strength Assessment
- Obfuscation method: The original distributed JAR was obfuscated using ProGuard:
- The vast majority of internal implementation classes were flattened into the root package (
de.marcely.bedwars.*), with classes, methods, fields, and inner classes renamed to meaningless identifiers consisting of 1–3 characters. Some enum constants and member names even conflicted with Java reserved keywords, such asdoandif. - The public developer API (
de.marcely.bedwars.api.*), certain bundled libraries (de.marcely.bedwars.libraries.*), someSourceFileattributes, and all 128 original resource files were left unencrypted and intact.
- The vast majority of internal implementation classes were flattened into the root package (
- Obfuscation strength: Moderately low to moderate — primarily identifier obfuscation and package flattening, with no string encryption, control-flow flattening, or
invokedynamic-based virtualization.
Reverse Engineering and Reconstruction Process
- Bijective bytecode remapping and resource preservation: Used ASM to perform bijective identifier and package remapping across 2,334 original
.classfiles, resolve member names conflicting with Java reserved keywords, and restore enum constant names according to their initialization order in<clinit>. All 128 original resource files, signatures, and loading logic were preserved without modification. - Multi-module architecture decomposition: Split the project into 25 Maven modules (
mbedwars-common,mbedwars-nmsand its 21 version-specific submodules, andmbedwars-core) according to their Minecraft / Spigot / NMS version dependencies, with independent compile-time stubs (deps/*.jar) provided for each version. - Two-stage semantic package restructuring: Reorganized the originally flattened and intermingled internal classes into a meaningful, hierarchical package structure based on functional domains and responsibilities, maintaining high cohesion within internal implementation packages.
- Project-wide AST-based identifier deobfuscation: Performed semantic renaming across the entire project using compiler-level AST analysis based on the JDK's
JavacTask. Restored 3,839 root method names (21,837 occurrences, including overrides and call sites), 2,097 fields, and 261 named inner classes. - Multi-layer equivalence verification: Successfully validated the full build using
javac --release 8andmvn clean package. Additional equivalence checks covered public and internal ABIs, enum ordering, resource SHA-256 hashes, and the runtime behavior of core utilities.
3. Reconstruction Results and Feature Overview
Maven Multi-Module Structure
| Module | Description |
|---|---|
mbedwars-common |
Public developer API (api.*), compatibility annotations (annotation.*), NBT data model (nbt.*), NMS abstractions and cross-version handlers (nms.*), general-purpose utilities, and bundled libraries (tools.*, libraries.*) |
mbedwars-nms/ |
21 Minecraft version adapter submodules: legacy (1.8–1.16), paper-hardfork, v1_17_R1 through v1_21_R7, v1_26_R1_3, and v1_26_R1 |
mbedwars-core |
Core game logic, commands, GUIs, holograms / NPCs, data storage, configuration system, network packets, and all 128 plugin resource files |
Core Features (mbedwars-core)
- Arenas and game loop (
arena.*): Arena creation and lifecycle management (ArenaStartHandler,ArenaEndHandler,ArenaGameLoop), multi-team balancing and automatic team assignment, spectator and respawn mechanics, arena voting and cloning, and multiple terrain restoration and world regeneration engines (Region/VanillaWorld/CustomWorldFormat/ClearSafely). - Shops, upgrades, and special items (
shop.*,specialitem.*): Item shops and team upgrade systems, multiple layouts and renderers (Hypixel / Normal), trap systems (alarm, counter-offensive, mining fatigue, etc.), and special items including fireballs, TNT sheep, rescue platforms, guard dogs, mini shops, bridge eggs, teleporters, and trackers. - Holograms, packet-based NPCs, and visual HUDs (
hologram.*,gui.*): Packet-basedPacketHologramandArmorStand/NPCmanagement, leaderboard statues, animated scoreboards / experience bars / LocatorBar (gui.hud.*), arena selector interfaces (gui.arenas.*), and comprehensive graphical in-game configuration editors and setup tools (gui.editor.*,gui.setup.*). - Commands and event systems (
command.*,event.*): Comprehensive administrator commands (backups, modules, statistics, migrations, and utilities), arena configuration / spawn point / team commands, lobby spawn and player commands, as well as block, entity, inventory, player, and world event listeners. - Data persistence and configuration architecture (
storage.*,config.*): Supports local file storage, SQL (MySQL / MariaDB / SQLite / SQL Server via HikariCP), and MongoDB backends, including player statistics, achievements, attributes, inventory caching, and legacy data migration. - Network communication and platform compatibility (
network.*,compat.*): Netty packet injection and packet read/write listeners, BungeeCord cross-server communication, web administration communication protocols, and cross-version compatibility wrappers for Spigot / Paper events and materials. - Extensive third-party plugin integrations (
hook.*): Supports Vault / Coins / DKCoins, PlaceholderAPI (including arena, player, and statistics placeholders), WorldEdit (v6/v7), SlimeWorldManager / AdvancedSlimePaper / ASWM / Polar, CloudNet v2–v4 / TimoCloud / CaveCloud / ReformCloud, Parties / PartyAndFriends, ProtocolLib / ViaVersion / ProtocolSupport, Geyser / Floodgate, TAB / FeatherBoard / NametagEdit, AdvancedReplay / XReplay, EssentialsX / CMI / Plan / OldCombatMechanics, and more.
4. Environment Setup, Installation, Build, and Usage Guide (IDEA Ready)
System and Development Environment Requirements
- JDK: JDK 17 or later is recommended. The project uses
maven-compiler-pluginwith--release 8for cross-compilation, producing bytecode compatible with Java 8+ Minecraft server environments. - Build tool: Maven
3.8+(or the bundled Maven installation provided by IntelliJ IDEA). - Offline-ready dependencies: All Bukkit / Spigot / NMS and third-party compile-time dependencies are packaged as stubs in
deps/*.jar, allowing the project to be compiled out of the box without manually running BuildTools or executing additional scripts.
Getting Started with IntelliJ IDEA
- Open the project: Select Open in IntelliJ IDEA and open the project root directory containing
pom.xmland.idea/. - Import the Maven project and configure the local JDK:
- IntelliJ IDEA automatically imports all 25 Maven modules using
.idea/misc.xmland the rootpom.xml, and loads the-Xpkginfo:alwayscompiler option (.idea/compiler.xml) and UTF-8 encoding settings (.idea/encodings.xml). - Navigate to File → Project Structure → Project and select your locally installed JDK 17+ from the SDK dropdown. The
Language levelcan remain at the default Java 8 level synchronized withpom.xml. - If Maven does not synchronize automatically, open the Maven tool window and click Reload All Maven Projects (the refresh icon).
- IntelliJ IDEA automatically imports all 25 Maven modules using
- Build and package the project:
- Using the IDE: In the Maven tool window on the right, expand
mbedwars-parent→Lifecycleand double-clickpackage. Runningcleanbeforepackageis recommended. - Using the command line: Run the following command from the project root directory:
mvn clean package
- Using the IDE: In the Maven tool window on the right, expand
Build Output and Server Installation
- After a successful build, the complete plugin JAR is available at:
mbedwars-core/target/mbedwars-core-5.5.9.1.jar - The
maven-shade-pluginis configured to mergembedwars-commonandmbedwars-nms-*into the final JAR, while automatically excluding compile-time stubs indeps/*.jarand redundantMETA-INF/maven/**metadata, and preserving the originalMANIFEST.MFand plugin resource files. - Installation: Copy
mbedwars-core/target/mbedwars-core-5.5.9.1.jarinto theplugins/directory of your Minecraft (Spigot / Paper) server, then restart the server to start using the plugin.
Languages
Java
100%