diff --git a/.gitignore b/.gitignore index a25ae14..ca6d1fc 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,6 @@ build # Other logs/ log/ -gradle.properties -run/ \ No newline at end of file +run/ +*.hprof +java_pid*/ \ No newline at end of file diff --git a/README.md b/README.md index 985009b..7941ff4 100644 --- a/README.md +++ b/README.md @@ -20,5 +20,5 @@ See LICENSE Anonymous request from [2ch.hk/mc/](https://2ch.hk/mc/) ## Links -[curseforge.com](https://www.curseforge.com/minecraft/mc-mods/bookstealer) +[curseforge.com](https://www.curseforge.com/minecraft/mc-mods/bookstealer) \ [forum.mcmodding.ru](https://forum.mcmodding.ru/resources/bookstealer.275/) diff --git a/build.gradle b/build.gradle index 5b4f653..a48213f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'idea' - id 'fabric-loom' version '0.10-SNAPSHOT' + id 'fabric-loom' version '0.11-SNAPSHOT' id 'maven-publish' } @@ -20,7 +20,8 @@ repositories { } [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' -sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' +sourceCompatibility = compileJava.sourceCompatibility = '1.8' +targetCompatibility = compileJava.targetCompatibility = '17' version = "${buildprop.game_version}-${modprop.version}" group = modprop.group diff --git a/build.properties b/build.properties index 5c3b55b..aaead01 100644 --- a/build.properties +++ b/build.properties @@ -2,17 +2,17 @@ # Game # Minecraft - game_version=1.16.5 + game_version=1.18.1 # Fabric Loader fabric_loader_version=0.12.12 # Launch directory run_dir=run # Game mappings - yarn_mappings=1.16.5+build.10 + yarn_mappings=1.18.1+build.22 # Cloth Config - cloth_version=4.13.49 + cloth_version=6.2.57 # Mod Menu - menu_version=1.16.22 + menu_version=3.0.1 # Other libs version # Project Lombok diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..49b4806 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx3072M \ No newline at end of file diff --git a/src/main/java/com/github/mjaroslav/bookstealer/mixin/BookEditScreenMixin.java b/src/main/java/com/github/mjaroslav/bookstealer/mixin/BookEditScreenMixin.java index 24ebf48..9320c82 100644 --- a/src/main/java/com/github/mjaroslav/bookstealer/mixin/BookEditScreenMixin.java +++ b/src/main/java/com/github/mjaroslav/bookstealer/mixin/BookEditScreenMixin.java @@ -24,7 +24,7 @@ protected BookEditScreenMixin(Text title) { @Inject(method = "init", at = @At("TAIL")) private void init(CallbackInfo ci) { - this.addButton(new ButtonWidget(this.width / 2 - 100, 220, 200, 20, + this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, 220, 200, 20, ModUtils.getButtonTranslatedText(), new SaveAction(this, itemStack))); } } diff --git a/src/main/java/com/github/mjaroslav/bookstealer/mixin/BookScreenMixin.java b/src/main/java/com/github/mjaroslav/bookstealer/mixin/BookScreenMixin.java index ccc9f26..292b336 100644 --- a/src/main/java/com/github/mjaroslav/bookstealer/mixin/BookScreenMixin.java +++ b/src/main/java/com/github/mjaroslav/bookstealer/mixin/BookScreenMixin.java @@ -19,7 +19,7 @@ protected BookScreenMixin(Text title) { @Inject(method = "init", at = @At("TAIL")) public void init(CallbackInfo ci) { - this.addButton(new ButtonWidget(this.width / 2 - 100, 220, 200, 20, + this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, 220, 200, 20, ModUtils.getButtonTranslatedText(), new SaveAction(this, ModUtils.getBookStackFromHands()))); } } diff --git a/src/main/java/com/github/mjaroslav/bookstealer/util/ModUtils.java b/src/main/java/com/github/mjaroslav/bookstealer/util/ModUtils.java index c53fb42..0f7b532 100644 --- a/src/main/java/com/github/mjaroslav/bookstealer/util/ModUtils.java +++ b/src/main/java/com/github/mjaroslav/bookstealer/util/ModUtils.java @@ -78,7 +78,7 @@ private Path getBookPath(@NotNull String author, @NotNull String title) { @Nullable public Path saveBook(@Nullable ItemStack book) throws Exception { if (book == null) return null; - val nbt = book.getTag(); + val nbt = book.getNbt(); if (nbt == null) return null; val author = !nbt.contains("author", 8) ? "Unknown" : nbt.getString("author"); val title = !nbt.contains("title", 8) ? "Unknown" : nbt.getString("title"); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 13ad414..e28eba4 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,10 +29,10 @@ ], "depends": { "fabricloader": ">=0.12.12", - "minecraft": "1.16.x", - "cloth-config2": ">=4.13.49" + "minecraft": "1.18.x", + "cloth-config2": ">=6.1.48" }, "suggests": { - "modmenu": ">=1.16.22" + "modmenu": ">=3.0.1" } }