From d8c33ac50f5c5c55c5095bbd5afa6b0c8bed2bb5 Mon Sep 17 00:00:00 2001 From: PotatoPresident <51728317+PotatoPresident@users.noreply.github.com> Date: Sat, 27 Nov 2021 14:28:35 -0800 Subject: [PATCH] Update to 1.18 Disable origins and trinkets compat until updated --- build.gradle | 14 ++++++-------- gradle.properties | 14 +++++++------- src/main/java/us/potatoboy/invview/InvView.java | 4 ++++ .../java/us/potatoboy/invview/ViewCommand.java | 9 ++------- src/main/resources/fabric.mod.json | 5 ++--- src/main/resources/invview.accesswidener | 3 --- 6 files changed, 21 insertions(+), 28 deletions(-) delete mode 100644 src/main/resources/invview.accesswidener diff --git a/build.gradle b/build.gradle index eb08f30..860c475 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.8-SNAPSHOT' + id 'fabric-loom' version '0.10.+' id 'maven-publish' } @@ -23,8 +23,8 @@ repositories { maven { url 'https://jitpack.io' } } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = project.archives_base_name version = project.mod_version + "-" + project.minecraft_version + "+" @@ -43,6 +43,7 @@ dependencies { // You may need to force-disable transitiveness on them. modImplementation include("eu.pb4:sgui:${project.sgui_version}") + /* modImplementation "com.github.emilyalexandra:trinkets:main-SNAPSHOT" modImplementation "io.github.onyxstudios.Cardinal-Components-API:cardinal-components-base:3.0.0" modImplementation "io.github.onyxstudios.Cardinal-Components-API:cardinal-components-entity:3.0.0" @@ -50,11 +51,12 @@ dependencies { modImplementation ("com.github.apace100:origins-fabric:${project.origins_version}") { exclude group: "com.terraformersmc" } + */ modImplementation "me.lucko:fabric-permissions-api:0.1-SNAPSHOT" include "me.lucko:fabric-permissions-api:0.1-SNAPSHOT" - compileOnly 'net.luckperms:api:5.2' + compileOnly 'net.luckperms:api:5.3' } processResources { @@ -83,10 +85,6 @@ jar { from "LICENSE" } -loom { - accessWidener "src/main/resources/invview.accesswidener" -} - // configure the maven publication publishing { publications { diff --git a/gradle.properties b/gradle.properties index c787c3d..0fcf088 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,16 +2,16 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.17.1 -yarn_mappings=1.17.1+build.10 -loader_version=0.11.6 +minecraft_version=1.18-rc3 +yarn_mappings=1.18-rc3+build.1 +loader_version=0.12.5 # Mod Properties -mod_version=1.4.6 +mod_version=1.4.7 maven_group=us.potatoboy archives_base_name=InvView # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.36.1+1.17 +fabric_version=0.43.1+1.18 trinkets_version=3.0.0 -origins_version=v1.0.2 -sgui_version=1.0.0-rc4+1.17.1 +origins_version=v1.0.3 +sgui_version=1.0.0-rc6+1.18-pre5 diff --git a/src/main/java/us/potatoboy/invview/InvView.java b/src/main/java/us/potatoboy/invview/InvView.java index c91dd34..d06c4d6 100644 --- a/src/main/java/us/potatoboy/invview/InvView.java +++ b/src/main/java/us/potatoboy/invview/InvView.java @@ -52,6 +52,7 @@ public void onInitialize() { .executes(ViewCommand::eChest)) .build(); + /* LiteralCommandNode trinketNode = CommandManager .literal("trinket") .requires(Permissions.require("invview.command.trinket", 2)) @@ -65,17 +66,20 @@ public void onInitialize() { .then(CommandManager.argument("target", GameProfileArgumentType.gameProfile()) .executes(ViewCommand::origin)) .build(); + */ dispatcher.getRoot().addChild(viewNode); viewNode.addChild(invNode); viewNode.addChild(echestNode); + /* if (isTrinkets) { viewNode.addChild(trinketNode); } if (isOrigins) { viewNode.addChild(originNode); } + */ }); ServerLifecycleEvents.SERVER_STARTING.register(this::onLogicalServerStarting); diff --git a/src/main/java/us/potatoboy/invview/ViewCommand.java b/src/main/java/us/potatoboy/invview/ViewCommand.java index eeb0318..21e0f45 100644 --- a/src/main/java/us/potatoboy/invview/ViewCommand.java +++ b/src/main/java/us/potatoboy/invview/ViewCommand.java @@ -4,12 +4,7 @@ import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.serialization.Dynamic; -import dev.emi.trinkets.api.TrinketComponent; -import dev.emi.trinkets.api.TrinketInventory; -import dev.emi.trinkets.api.TrinketsApi; import eu.pb4.sgui.api.gui.SimpleGui; -import io.github.apace100.apoli.component.PowerHolderComponent; -import io.github.apace100.apoli.power.InventoryPower; import net.luckperms.api.LuckPermsProvider; import net.luckperms.api.cacheddata.CachedPermissionData; import net.luckperms.api.util.Tristate; @@ -27,8 +22,6 @@ import net.minecraft.world.dimension.DimensionType; import us.potatoboy.invview.gui.SavingPlayerDataGui; -import java.util.List; -import java.util.Map; import java.util.concurrent.CompletableFuture; public class ViewCommand { @@ -77,6 +70,7 @@ public static int eChest(CommandContext context) throws Com return 1; } + /* public static int trinkets(CommandContext context) throws CommandSyntaxException { ServerPlayerEntity player = context.getSource().getPlayer(); ServerPlayerEntity requestedPlayer = getRequestedPlayer(context); @@ -134,6 +128,7 @@ public static int origin(CommandContext context) throws Com return 1; } + */ private static ServerPlayerEntity getRequestedPlayer(CommandContext context) throws CommandSyntaxException { GameProfile requestedProfile = GameProfileArgumentType.getProfileArgument(context, "target").iterator().next(); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 266559f..5600f99 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -31,7 +31,6 @@ "depends": { "fabricloader": ">=0.7.2", "fabric": "*", - "minecraft": ">=1.17.1" - }, - "accessWidener": "invview.accesswidener" + "minecraft": "1.18.x" + } } diff --git a/src/main/resources/invview.accesswidener b/src/main/resources/invview.accesswidener deleted file mode 100644 index 75c3ae9..0000000 --- a/src/main/resources/invview.accesswidener +++ /dev/null @@ -1,3 +0,0 @@ -accessWidener v1 named -accessible method net/minecraft/server/network/ServerPlayerEntity incrementScreenHandlerSyncId ()V -accessible field net/minecraft/server/network/ServerPlayerEntity screenHandlerSyncId I \ No newline at end of file