From 35987496e4aa7bd9dbe4ccc19ba8f4bf59f3f6da Mon Sep 17 00:00:00 2001 From: mattymatty Date: Wed, 28 Jun 2023 19:36:41 +0200 Subject: [PATCH] V1.10.2 Fixed beta.8 of MixinExtras Fixed tooltips not beeing shown on multiplayer if client has mod too --- build.gradle | 32 ++++++++++++------- gradle.properties | 5 +-- .../carpet_shadow/interfaces/ShadowItem.java | 2 ++ ...ScreenHandlerSlotUpdateS2CPacketMixin.java | 2 +- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index e5063ae..b80fdbd 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,8 @@ dependencies { modImplementation "carpet:fabric-carpet:${project.carpet_core_version}" implementation 'de.cronn:reflection-util:2.13.2' provided group: 'org.apache.commons', name: 'commons-collections4', version: 'latest.release' - provided(annotationProcessor("com.github.LlamaLad7:MixinExtras:${project.mixinextast_version}")) + provided(annotationProcessor("com.github.LlamaLad7.mixinextras:mixinextras-fabric:${project.mixin_extras_fabric_version}")) + //provided(annotationProcessor("com.github.LlamaLad7:MixinExtras:${project.mixin_extras_version}")) } @@ -102,18 +103,25 @@ jar { // configure the maven publication publishing { - publications { - mavenJava(MavenPublication) { - from components.java + if (System.getenv("CI")!=null){ + publications { + maven(MavenPublication) { + groupId = this.getGroup() + artifactId = this.getName().toLowerCase() + version = System.getenv("GITHUB_REF_NAME") + from components.java + } + } + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/"+System.getenv("GITHUB_REPOSITORY") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - // Notice: This block does NOT have the same function as the block in the top level. - // The repositories here will be used for publishing your artifact, not for - // retrieving dependencies. } } diff --git a/gradle.properties b/gradle.properties index fe17cc1..ec5c084 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,10 +6,11 @@ minecraft_version=1.20.1 yarn_mappings=1.20.1+build.8 loader_version=0.14.21 # Mod Properties -mod_version=1.10.1 +mod_version=1.10.2 mod_suffix=-MC1.20.1+ maven_group=carpet-shadow-item archives_base_name=carpet-shadow # Dependencies carpet_core_version=1.20-1.4.112+v230608 -mixinextast_version=0.2.0-beta.4 \ No newline at end of file +mixin_extras_version=0.2.0-beta.4 +mixin_extras_fabric_version=0.2.0-beta.8 \ No newline at end of file diff --git a/src/main/java/com/carpet_shadow/interfaces/ShadowItem.java b/src/main/java/com/carpet_shadow/interfaces/ShadowItem.java index 1b5927a..89f8cae 100644 --- a/src/main/java/com/carpet_shadow/interfaces/ShadowItem.java +++ b/src/main/java/com/carpet_shadow/interfaces/ShadowItem.java @@ -9,11 +9,13 @@ public interface ShadowItem { static ItemStack copy_redirect(ItemStack instance, Operation original) { ItemStack stack = original.call(instance); ((ShadowItem) (Object) stack).setShadowId(((ShadowItem) (Object) instance).getShadowId()); + ((ShadowItem) (Object) stack).setClientShadowId(((ShadowItem) (Object) instance).getClientShadowId()); return stack; } static ItemStack copy_supplier(ItemStack instance, ItemStack copy) { ((ShadowItem) (Object) copy).setShadowId(((ShadowItem) (Object) instance).getShadowId()); + ((ShadowItem) (Object) copy).setClientShadowId(((ShadowItem) (Object) instance).getClientShadowId()); return copy; } diff --git a/src/main/java/com/carpet_shadow/mixins/tooltip/ScreenHandlerSlotUpdateS2CPacketMixin.java b/src/main/java/com/carpet_shadow/mixins/tooltip/ScreenHandlerSlotUpdateS2CPacketMixin.java index 878a80d..9fb3ff6 100644 --- a/src/main/java/com/carpet_shadow/mixins/tooltip/ScreenHandlerSlotUpdateS2CPacketMixin.java +++ b/src/main/java/com/carpet_shadow/mixins/tooltip/ScreenHandlerSlotUpdateS2CPacketMixin.java @@ -27,7 +27,7 @@ public ItemStack copy_redirect(ItemStack instance, Operation original @ModifyReturnValue(method = "getItemStack", at = @At("RETURN")) public ItemStack getShadowStack(ItemStack ret){ if (CarpetShadowSettings.shadowItemTooltip){ - String id = ((ShadowItem)(Object)ret).getShadowId(); + String id = ((ShadowItem)(Object)ret).getClientShadowId(); ((ShadowItem)(Object)ret).setShadowId(null); ((ShadowItem)(Object)ret).setClientShadowId(id); }