Skip to content

Commit

Permalink
Fix conflict with BetterMap (SCC 1.2.1)
Browse files Browse the repository at this point in the history
more accurately, fix issue with ourselves??? idk this was a weird crash
  • Loading branch information
Wyvest committed Aug 2, 2024
1 parent 52ea5a7 commit c5fc658
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 170 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ loom {
if (project.platform.isLegacyForge) {
runConfigs {
"client" {
programArgs("--tweakClass", "co.skyclient.scc.hooks.ReplacedModRemover")
programArgs("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker")
property("mixin.debug.export", "true")
}
}
Expand Down Expand Up @@ -192,7 +192,7 @@ tasks {
"ForceLoadAsMod" to true, // We want to load this jar as a mod, so we force Forge to do so.
"TweakOrder" to "0", // Makes sure that the OneConfig launch wrapper is loaded as soon as possible.
"MixinConfigs" to "mixins.scc.json", // We want to use our mixin configuration, so we specify it here.
"TweakClass" to "co.skyclient.scc.hooks.ReplacedModRemover" // Loads the OneConfig launch wrapper.
"TweakClass" to "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker" // Loads the OneConfig launch wrapper.
)
}
dependsOn(shadowJar)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod_id=skyclientcosmetics
mod_name=SkyClientCosmetics
mod_version=1.2.0
mod_version=1.2.1
mod_archives_name=SkyClientCosmetics

# Gradle Configuration -- DO NOT TOUCH THESE VALUES.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/co/skyclient/scc/SkyclientCosmetics.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void onPreInit(FMLPreInitializationEvent event) {

Files.setup();

progress.step("Loading Vigilance");
progress.step("Loading config");

config = new Settings();
config.preload();
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/co/skyclient/scc/hooks/GuiPlayerTabOverlayHook.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package co.skyclient.scc.hooks;

import cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils;
import co.skyclient.scc.SkyclientCosmetics;
import co.skyclient.scc.config.Settings;
import co.skyclient.scc.cosmetics.Tag;
import net.minecraft.client.network.NetworkPlayerInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

public class GuiPlayerTabOverlayHook {
public static void iHateMixinZeroPointSeven(NetworkPlayerInfo networkPlayerInfoIn, CallbackInfoReturnable<String> cir) {
if (SkyclientCosmetics.config.enabled) {
if (Settings.showTags) {
if (HypixelUtils.INSTANCE.isHypixel()) {
Tag tag = ((NetworkPlayerInfoHook) networkPlayerInfoIn).scc$getTag();
if (tag != null) {
cir.setReturnValue(tag.getTag() + " " + cir.getReturnValue());
}
}
}
}
}
}
151 changes: 0 additions & 151 deletions src/main/java/co/skyclient/scc/hooks/ReplacedModRemover.java

This file was deleted.

8 changes: 4 additions & 4 deletions src/main/java/co/skyclient/scc/listeners/TagListeners.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class TagListeners {
private static final HashMap<String, String> filteredPotentialRanks = new HashMap<>(50);
public static Map<String, String> nametags = new HashMap<>(400);

@SubscribeEvent
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onChatMsgTags(ClientChatReceivedEvent event) {
if (SkyclientCosmetics.config.enabled && Settings.showTags && HypixelUtils.INSTANCE.isHypixel()) {
try {
Expand All @@ -72,7 +72,7 @@ public void onChatMsgTags(ClientChatReceivedEvent event) {
}
}

@SubscribeEvent
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onTooltip(ItemTooltipEvent event) {
if (SkyclientCosmetics.config.enabled && Settings.showTags && HypixelUtils.INSTANCE.isHypixel()) {
for (int i = 0; i < event.toolTip.size(); i++) {
Expand All @@ -87,7 +87,7 @@ public void onTooltip(ItemTooltipEvent event) {
}
}

@SubscribeEvent(priority = EventPriority.LOW)
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onRenderLiving(RenderLivingEvent.Specials.Pre<EntityLivingBase> event) {
if (SkyclientCosmetics.config.enabled && Settings.showTags && HypixelUtils.INSTANCE.isHypixel()) {
Entity entity = event.entity;
Expand Down Expand Up @@ -115,7 +115,7 @@ public void onRenderLiving(RenderLivingEvent.Specials.Pre<EntityLivingBase> even
}
}

@SubscribeEvent
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onWorldChange(WorldEvent.Load event) {
nametags.clear();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package co.skyclient.scc.mixins;

import cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils;
import co.skyclient.scc.SkyclientCosmetics;
import co.skyclient.scc.config.Settings;
import co.skyclient.scc.cosmetics.Tag;
import co.skyclient.scc.hooks.NetworkPlayerInfoHook;
import co.skyclient.scc.hooks.GuiPlayerTabOverlayHook;
import net.minecraft.client.gui.GuiPlayerTabOverlay;
import net.minecraft.client.network.NetworkPlayerInfo;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -16,11 +12,6 @@
public class GuiPlayerTabOverlayMixin {
@Inject(method = "getPlayerName", at = @At("RETURN"), cancellable = true)
private void getPlayerName(NetworkPlayerInfo networkPlayerInfoIn, CallbackInfoReturnable<String> cir) {
if (SkyclientCosmetics.config.enabled && Settings.showTags && HypixelUtils.INSTANCE.isHypixel()) {
Tag tag = ((NetworkPlayerInfoHook) networkPlayerInfoIn).scc$getTag();
if (tag != null) {
cir.setReturnValue(tag.getTag() + " " + cir.getReturnValue());
}
}
GuiPlayerTabOverlayHook.iHateMixinZeroPointSeven(networkPlayerInfoIn, cir);
}
}

0 comments on commit c5fc658

Please sign in to comment.