В данном гайде представлено обобщение и структурирование информации о работе с jar файлами.
This guide provides a summary and structure of information about working with jar files.

В папке server_bin/jars содержится скомпилированный код игры в запакованном виде.
Вы можете просмотреть данные файлы например с помощью 7zip
The server_bin/jars folder contains the compiled game code in a compressed form.
You can view these files, for example, using 7zip

Файлы c префиксом .class это скомпилированные .java файлы при сборке серверной части.
Files with the .class prefix are compiled .java files when building the server part.

Данные файлы легко можно декомпилировать в .java класс например с помощью Idea Community
или других более простых инструментов например JD (java decompiler)
Окей, мы не имеем исходного кода, но нам ничто не мешает изменить имеющийся код, так как .class легко можно декомпилировать в .java.
Для кого-то это "черный ящик", но я попытаюсь вам показать, что эти файлы могут помочь вам в работе с .xdb конфигурациями и пониманием работы механик сервера.
These files can be easily decompiled into a .java class, for example, using Idea Community
or other simpler tools, such as JD (java decompiler)
Okay, we don't have the source code, but nothing prevents us from changing the existing code, since .class can easily be decompiled into .java.
For some, this is a "black box", but I will try to show you that these files can help you in working with .xdb configurations and understanding the work of the server mechanics.

Посмотрите на ваш xdb файл - это же десериализованный в xml java объект!
gameMechanics.world.mob.MobWorld - это путь который реально существует в исходных файлах.
Обычно первое слово перед точкой в первом же теге xdb это и есть тот самый исходный jar (но бывают исключения например itemService назван itemServer можно перепутать)
Look at your xdb file - it's a deserialized xml java object!
gameMechanics.world.mob.MobWorld is a path that actually exists in the source files.
Usually the first word before the dot in the first xdb tag is the same original jar (but there are exceptions, for example itemService is called itemServer, which can be confused)

Подготовьте вашу папку для работы. 1. Скопируйте jdk для удобной работы сразу в одну папку 2. Распакуйте файлы из jar
Prepare your folder for work. 1. Copy jdk for convenient work in one folder 2. Unpack files from jar

Откройте данную папку в Idea Comunity для удобной работы с файлами. Найдем для примера gameMechanics.world.mob.MobWorld
Как видите здесь имеются даже некоторые комментарии от разработчиков и некоторые аннотации которые могут вам давать дополнительную информацию для разработки, советую пользоваться этим.
Open this folder in Idea Community for easy work with files. Let's find gameMechanics.world.mob.MobWorld for example
As you can see, there are even some comments from the developers and some annotations that can give you additional information.

И ещё захардкодил здесь для примера
And also hardcode this for example

Давайте попробуем изменить базовую скорость перемещения мобов ради эксперимента.
Создадим папку "source" и в ней создадим MobWorld.java (аналогичное название для .class) и переместим декомпилированный код в этот файл.
Не обращайте внимание на ошибки, это взятый из контекста файл, у него естественно нет зависимостей.
Let's try changing the base speed of mobs for the sake of experiment. (walkSpeed)
Create a "source" folder and in it create MobWorld.java (similar name to .class) and move the decompiled code to this file.
Ignore the errors, this is a file taken out of context, it naturally has no dependencies.


Изменяем значение walkSpeed с 1.0F на 6.0F. Готово теперь нам надо декомпилировать .java -> .class.
Change the value of walkSpeed from 1.0F to 6.0F. Done, now we need to decompile .java -> .class.

Используем следующую команду:

Напоминаю перед заменой .class в jar файле, не забывайте делать бэкап исходного jar файла, чтобы его откатить в случае ошибок!
Заменяем все файлы, которые мы получили в папке "source" кроме исходного .java. Запускаем сервер.
I remind you that before replacing .class in a jar file, do not forget to make a backup of the original jar file to roll it back in case of errors!
We replace all the files that we received in the "source" folder except for the original .java. We start the server.

View attachment presentation (2).mp4
This guide provides a summary and structure of information about working with jar files.

В папке server_bin/jars содержится скомпилированный код игры в запакованном виде.
Вы можете просмотреть данные файлы например с помощью 7zip
You do not have permission to view link
Log in or register now.
или WinRarThe server_bin/jars folder contains the compiled game code in a compressed form.
You can view these files, for example, using 7zip
You do not have permission to view link
Log in or register now.
or WinRar
Файлы c префиксом .class это скомпилированные .java файлы при сборке серверной части.
Files with the .class prefix are compiled .java files when building the server part.

Данные файлы легко можно декомпилировать в .java класс например с помощью Idea Community
You do not have permission to view link
Log in or register now.
или других более простых инструментов например JD (java decompiler)
You do not have permission to view link
Log in or register now.
Окей, мы не имеем исходного кода, но нам ничто не мешает изменить имеющийся код, так как .class легко можно декомпилировать в .java.
Для кого-то это "черный ящик", но я попытаюсь вам показать, что эти файлы могут помочь вам в работе с .xdb конфигурациями и пониманием работы механик сервера.
These files can be easily decompiled into a .java class, for example, using Idea Community
You do not have permission to view link
Log in or register now.
or other simpler tools, such as JD (java decompiler)
You do not have permission to view link
Log in or register now.
Okay, we don't have the source code, but nothing prevents us from changing the existing code, since .class can easily be decompiled into .java.
For some, this is a "black box", but I will try to show you that these files can help you in working with .xdb configurations and understanding the work of the server mechanics.

Посмотрите на ваш xdb файл - это же десериализованный в xml java объект!
gameMechanics.world.mob.MobWorld - это путь который реально существует в исходных файлах.
Обычно первое слово перед точкой в первом же теге xdb это и есть тот самый исходный jar (но бывают исключения например itemService назван itemServer можно перепутать)
Look at your xdb file - it's a deserialized xml java object!
gameMechanics.world.mob.MobWorld is a path that actually exists in the source files.
Usually the first word before the dot in the first xdb tag is the same original jar (but there are exceptions, for example itemService is called itemServer, which can be confused)

Подготовьте вашу папку для работы. 1. Скопируйте jdk для удобной работы сразу в одну папку 2. Распакуйте файлы из jar
Prepare your folder for work. 1. Copy jdk for convenient work in one folder 2. Unpack files from jar

Откройте данную папку в Idea Comunity для удобной работы с файлами. Найдем для примера gameMechanics.world.mob.MobWorld
Как видите здесь имеются даже некоторые комментарии от разработчиков и некоторые аннотации которые могут вам давать дополнительную информацию для разработки, советую пользоваться этим.
Open this folder in Idea Community for easy work with files. Let's find gameMechanics.world.mob.MobWorld for example
As you can see, there are even some comments from the developers and some annotations that can give you additional information.

И ещё захардкодил здесь для примера
And also hardcode this for example

Давайте попробуем изменить базовую скорость перемещения мобов ради эксперимента.
Создадим папку "source" и в ней создадим MobWorld.java (аналогичное название для .class) и переместим декомпилированный код в этот файл.
Не обращайте внимание на ошибки, это взятый из контекста файл, у него естественно нет зависимостей.
Let's try changing the base speed of mobs for the sake of experiment. (walkSpeed)
Create a "source" folder and in it create MobWorld.java (similar name to .class) and move the decompiled code to this file.
Ignore the errors, this is a file taken out of context, it naturally has no dependencies.


Изменяем значение walkSpeed с 1.0F на 6.0F. Готово теперь нам надо декомпилировать .java -> .class.
Change the value of walkSpeed from 1.0F to 6.0F. Done, now we need to decompile .java -> .class.

Используем следующую команду:
"./jdk/bin/javac" -encoding UTF-8 -cp "C:/Server_7.0/server_bin/jars/*" ./source/MobWorld.java
- -cp (или -classpath) — указывает путь к зависимостям (библиотекам .jar), которые нужны для компиляции.
- "C:/Server_7.0/server_bin/jars/*" — компилятор включает все .jar-файлы из этой папки.
- Без этого флага компилятор не найдёт внешние классы, используемые в MobWorld.java.
- ./source/MobWorld.java - компиляция указанного файла который мы изменили
- -cp (or -classpath) — specifies the path to dependencies (.jar libraries) that are needed for compilation.
- "C:/Server_7.0/server_bin/jars/*"— the compiler includes all .jar files from this folder.
- Without this flag, the compiler will not find external classes used in MobWorld.java.
- ./source/MobWorld.java - compilation of the specified file that we changed

Напоминаю перед заменой .class в jar файле, не забывайте делать бэкап исходного jar файла, чтобы его откатить в случае ошибок!
Заменяем все файлы, которые мы получили в папке "source" кроме исходного .java. Запускаем сервер.
I remind you that before replacing .class in a jar file, do not forget to make a backup of the original jar file to roll it back in case of errors!
We replace all the files that we received in the "source" folder except for the original .java. We start the server.

View attachment presentation (2).mp4