From 03be7908505f6b9eaa81aac2dd6b7c503c701254 Mon Sep 17 00:00:00 2001 From: Ramid Khan Date: Sat, 7 Oct 2023 21:21:08 +1100 Subject: [PATCH] Move JEI plugin --- .../ramidzkh/mekae2/integration/jade/package-info.java | 7 +++++++ .../mekae2/{ => integration/jei}/AMJEIPlugin.java | 3 ++- .../ramidzkh/mekae2/integration/jei/package-info.java | 7 +++++++ src/main/java/me/ramidzkh/mekae2/qio/QioSupport.java | 6 ++---- src/main/java/me/ramidzkh/mekae2/qio/package-info.java | 7 +++++++ src/main/resources/appmek.mixins.json | 10 ---------- 6 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 src/main/java/me/ramidzkh/mekae2/integration/jade/package-info.java rename src/main/java/me/ramidzkh/mekae2/{ => integration/jei}/AMJEIPlugin.java (92%) create mode 100644 src/main/java/me/ramidzkh/mekae2/integration/jei/package-info.java create mode 100644 src/main/java/me/ramidzkh/mekae2/qio/package-info.java delete mode 100644 src/main/resources/appmek.mixins.json diff --git a/src/main/java/me/ramidzkh/mekae2/integration/jade/package-info.java b/src/main/java/me/ramidzkh/mekae2/integration/jade/package-info.java new file mode 100644 index 0000000..40ec270 --- /dev/null +++ b/src/main/java/me/ramidzkh/mekae2/integration/jade/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +package me.ramidzkh.mekae2.integration.jade; + +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/me/ramidzkh/mekae2/AMJEIPlugin.java b/src/main/java/me/ramidzkh/mekae2/integration/jei/AMJEIPlugin.java similarity index 92% rename from src/main/java/me/ramidzkh/mekae2/AMJEIPlugin.java rename to src/main/java/me/ramidzkh/mekae2/integration/jei/AMJEIPlugin.java index be6222c..a4912d5 100644 --- a/src/main/java/me/ramidzkh/mekae2/AMJEIPlugin.java +++ b/src/main/java/me/ramidzkh/mekae2/integration/jei/AMJEIPlugin.java @@ -1,7 +1,8 @@ -package me.ramidzkh.mekae2; +package me.ramidzkh.mekae2.integration.jei; import net.minecraft.resources.ResourceLocation; +import me.ramidzkh.mekae2.AppliedMekanistics; import me.ramidzkh.mekae2.ae2.ChemicalIngredientConverter; import mekanism.api.IMekanismAccess; import mezz.jei.api.IModPlugin; diff --git a/src/main/java/me/ramidzkh/mekae2/integration/jei/package-info.java b/src/main/java/me/ramidzkh/mekae2/integration/jei/package-info.java new file mode 100644 index 0000000..3242e34 --- /dev/null +++ b/src/main/java/me/ramidzkh/mekae2/integration/jei/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +package me.ramidzkh.mekae2.integration.jei; + +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/me/ramidzkh/mekae2/qio/QioSupport.java b/src/main/java/me/ramidzkh/mekae2/qio/QioSupport.java index 31d76df..9137985 100644 --- a/src/main/java/me/ramidzkh/mekae2/qio/QioSupport.java +++ b/src/main/java/me/ramidzkh/mekae2/qio/QioSupport.java @@ -18,7 +18,6 @@ import me.ramidzkh.mekae2.AppliedMekanistics; import mekanism.api.inventory.qio.IQIOComponent; -import appeng.api.features.IPlayerRegistry; import appeng.api.networking.GridHelper; import appeng.api.storage.MEStorage; @@ -62,9 +61,8 @@ public LazyOptional getCapability(@NotNull Capability capability, break out; } - var owner = IPlayerRegistry.getMapping(object.getLevel()) - .getProfileId(source.getOwningPlayerId()); - var adapter = new QioStorageAdapter<>((BlockEntity & IQIOComponent) object, arg, owner); + var adapter = new QioStorageAdapter<>((BlockEntity & IQIOComponent) object, arg, + source.getOwningPlayerProfileId()); if (adapter.getFrequency() != null) { return LazyOptional.of(() -> adapter).cast(); diff --git a/src/main/java/me/ramidzkh/mekae2/qio/package-info.java b/src/main/java/me/ramidzkh/mekae2/qio/package-info.java new file mode 100644 index 0000000..a7a6084 --- /dev/null +++ b/src/main/java/me/ramidzkh/mekae2/qio/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +package me.ramidzkh.mekae2.qio; + +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/resources/appmek.mixins.json b/src/main/resources/appmek.mixins.json deleted file mode 100644 index a69b99c..0000000 --- a/src/main/resources/appmek.mixins.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "minVersion": "0.8", - "required": true, - "package": "me.ramidzkh.mekae2.mixin", - "compatibilityLevel": "JAVA_17", - "mixins": [], - "injectors": { - "defaultRequire": 1 - } -}