Skip to content

Commit

Permalink
v0.3
Browse files Browse the repository at this point in the history
Серьёзно, обновлений тут столько, что я заколебусь писать!
  • Loading branch information
forkgenesis committed Dec 7, 2024
1 parent be14b97 commit fdcb9d3
Show file tree
Hide file tree
Showing 11 changed files with 306 additions and 187 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ run

# Files from Forge MDK
forge*changelog.txt

libs/
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2024 Fork Genesis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7 changes: 0 additions & 7 deletions LICENSE.md

This file was deleted.

18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Minecraft Client Bot
Мод на Forge 1.20.1

## Пример сервера
Имплементация многопоточного сервера на Python для работы с этим модом приведена в [этом файле](server.py)
# Fork's Minecraft Botting Framework
Мод на Minecraft для версии 1.20.1, на движке Forge версии 47.3.0 и выше

## Самостоятельная сборка мода
1. Установите Git и JDK 17. Убедитесь, что `git` и `java` выдают желаемый результат.
2. Откройте в терминале папку, где желаете создать папку проекта, и введите
```bash
git clone https://github.com/VasyaProgrammist/Minecraft-Client-Bot.git
```
3. Перейдите в эту папку в терминале и введите `./gradlew build` (на Linux) или `gradlew.bat build` (на Windows). В папке `build/libs` лежит собранный мод.
1. Установите [Git](https://git-scm.com/downloads) и [JDK 17](https://adoptium.net/temurin/releases/?version=17&package=jdk)
2. Откройте терминал и убедитесь, что команды `git` и `java` не выдают ошибку
2. Откройте в терминале папку, где желаете создать папку проекта, и введите `git clone https://github.com/vpgel/fmbf.git -b forge-1.20.1`
3. Перейдите в эту папку в терминале
4. Введите `./gradlew build` (на Linux) или `gradlew build` (на Windows). В папке `build/libs` лежит собранный мод - тот, чьё имя кончается на `-all`.
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Поддержка API Barione
22 changes: 13 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ base {
}

java.toolchain.languageVersion = JavaLanguageVersion.of(17)
//jarJar.enable()
jarJar.enable()

println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
Expand Down Expand Up @@ -118,9 +118,9 @@ repositories {

// If you have mod jar dependencies in ./libs, you can declare them as a repository like so.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver
// flatDir {
// dir 'libs'
// }
flatDir {
dir 'libs'
}
}

dependencies {
Expand All @@ -141,12 +141,15 @@ dependencies {
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
// The group id is ignored when searching -- in this case, it is "blank"
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
/*jarJar(group: 'org.glassfish', name: 'javax.json', version: '[1.0,1.0.5)') {
// Includes examplelib 2.8.0

jarJar(group: 'org.glassfish', name: 'javax.json', version: '[1.0,1.0.5)') {
jarJar.pin(it, '1.0.4')
}
minecraftLibrary 'org.glassfish:javax.json:1.0.4'
*/
minecraftLibrary fg.deobf('org.glassfish:javax.json:1.0.4')

// TODO
//implementation fg.deobf("blank:baritone-api-1.20.1:1.10.1")

// For more info:
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
Expand All @@ -162,7 +165,8 @@ tasks.named('processResources', ProcessResources).configure {
forge_version: forge_version, forge_version_range: forge_version_range,
loader_version_range: loader_version_range,
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description,
mod_authors: mod_authors, mod_description: mod_description, mod_issue_tracker: mod_issue_tracker,
mod_url: mod_url
]
inputs.properties replaceProperties

Expand Down
10 changes: 6 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ mapping_version=2023.09.03-1.20.1

mod_id=fmbf
mod_name=Fork's Minecraft Botting Framework
mod_license=All Rights Reserved
mod_version=0.2.1
mod_license=MIT
mod_version=0.3
mod_group_id=io.github.vpgel.fmbf
mod_authors=ForkGenesis
mod_description=Socket-driven mod for controlling player via any language you desire. (Presumably Python)
mod_authors=ForkGenesis, GLaDOS23
mod_description=Socket-driven mod for controlling player via any language you desire. (Presumably Python)
mod_issue_tracker=https://github.com/vpgel/FMBF/issues
mod_url=https://github.com/vpgel/FMBF/
8 changes: 7 additions & 1 deletion src/main/java/io/github/vpgel/fmbf/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.minecraftforge.fml.event.config.ModConfigEvent;

/**
* Конфиг мода: хост (127.0.0.1 по умолчанию) и порт (2323 по умолчанию)
* Конфиг мода: хост (127.0.0.1 по умолчанию), порт (2323 по умолчанию) и режим дебага (true по умолчанию).
*/
@Mod.EventBusSubscriber(modid=FMBF.modid, bus=Mod.EventBusSubscriber.Bus.MOD)
public class Config {
Expand All @@ -20,14 +20,20 @@ public class Config {
.comment("Port for the socket server")
.defineInRange("port", 2323, 0, 65535);

private static final ForgeConfigSpec.BooleanValue DEBUG = configBuilder
.comment("Whether enable additional messages from the mod's internal server")
.define("debug", true);

static final ForgeConfigSpec SPEC = configBuilder.build();

public static String ip;
public static int port;
public static boolean debug;

@SubscribeEvent
static void onLoad(final ModConfigEvent event) {
ip = IP.get();
port = PORT.get();
debug = DEBUG.get();
}
}
Loading

0 comments on commit fdcb9d3

Please sign in to comment.