Removed the reload system

This commit is contained in:
2025-08-16 14:17:55 +02:00
parent 2c64eed329
commit 08cee2172c
6 changed files with 7 additions and 106 deletions
@@ -115,7 +115,10 @@ public class Auth {
if (SaturnClient.client.currentScreen instanceof SaturnScreen) { if (SaturnClient.client.currentScreen instanceof SaturnScreen) {
String[] a = parser.error.replace("!", "").split(": "); String[] a = parser.error.replace("!", "").split(": ");
((SaturnScreen) SaturnClient.client.currentScreen).draw(new Notification(SaturnClient.client.currentScreen.width, SaturnClient.client.currentScreen.height, NotificationKind.Error, a[0], a[1])); ((SaturnScreen) SaturnClient.client.currentScreen)
.draw(new Notification(SaturnClient.client.currentScreen.width,
SaturnClient.client.currentScreen.height, NotificationKind.Error,
a[0], a[1]));
} }
} }
break; break;
@@ -179,7 +182,7 @@ public class Auth {
public static void setCloak(String cloakName) { public static void setCloak(String cloakName) {
try { try {
Network.write("set_cloak@cloak=" + cloakName); Network.write("set_cloak@cloak=" + cloakName + "@notify=" + "d362a04228bd49e1a807ae74dbe8aba9");
} catch (Exception e) { } catch (Exception e) {
SaturnClient.LOGGER.error("Request failed", e); SaturnClient.LOGGER.error("Request failed", e);
} }
@@ -187,7 +190,7 @@ public class Auth {
public static void setHat(String hatName) { public static void setHat(String hatName) {
try { try {
Network.write("set_hat@hat=" + hatName); Network.write("set_hat@hat=" + hatName + "@notify=" + "d362a04228bd49e1a807ae74dbe8aba9");
} catch (Exception e) { } catch (Exception e) {
SaturnClient.LOGGER.error("Request failed", e); SaturnClient.LOGGER.error("Request failed", e);
} }
@@ -202,41 +205,6 @@ public class Auth {
} }
} }
public static void sendReload() {
for (Map.Entry<String, String> player : playerNames.entrySet()) {
if (players.containsKey(player.getValue()) && !player.getValue().equals(uuid)) {
SaturnClient.client.player.networkHandler
.sendChatCommand("msg " + player.getKey() + " "
+ "$SATURN_RELOAD if you are seeing this as a player, please report this to https://github.com/saturnclientmc/saturnclient/issues");
;
}
}
}
public static void sendEmote(String emote) {
String uuid = SaturnClient.client.player.getUuidAsString().replace("-", "");
for (Map.Entry<String, String> player : playerNames.entrySet()) {
if (players.containsKey(player.getValue()) && !player.getValue().equals(uuid)) {
SaturnClient.client.player.networkHandler
.sendChatCommand("msg " + player.getKey() + " "
+ "$SATURN_EMOTE&@"+uuid+"&@"+emote+"&@ if you are seeing this as a player, please report this to https://github.com/saturnclientmc/saturnclient/issues");
;
}
}
}
public static void cancelEmote() {
String uuid = SaturnClient.client.player.getUuidAsString().replace("-", "");
for (Map.Entry<String, String> player : playerNames.entrySet()) {
if (players.containsKey(player.getValue()) && !player.getValue().equals(uuid)) {
SaturnClient.client.player.networkHandler
.sendChatCommand("msg " + player.getKey() + " "
+ "$SATURN_CANCEL_EMOTE&@"+uuid+"&@ if you are seeing this as a player, please report this to https://github.com/saturnclientmc/saturnclient/issues");
;
}
}
}
public static void buyCloak(String name) { public static void buyCloak(String name) {
try { try {
Network.write("buy_cloak@cloak=" + name); Network.write("buy_cloak@cloak=" + name);
@@ -16,7 +16,6 @@ public class Hats {
public static void setHat(String uuid, String hatName) { public static void setHat(String uuid, String hatName) {
setHatSilent(uuid, hatName); setHatSilent(uuid, hatName);
Auth.setHat(hatName); Auth.setHat(hatName);
Auth.sendReload();
} }
public static void setHatSilent(String uuid, String hatName) { public static void setHatSilent(String uuid, String hatName) {
@@ -45,7 +45,6 @@ public class Cloaks {
public static void setCloak(String uuid, String cloakName) { public static void setCloak(String uuid, String cloakName) {
Auth.setCloak(cloakName); Auth.setCloak(cloakName);
setCloakSilent(uuid, cloakName); setCloakSilent(uuid, cloakName);
Auth.sendReload();
SaturnClient.LOGGER.info("Cloak set to " + cloakName); SaturnClient.LOGGER.info("Cloak set to " + cloakName);
} }
@@ -1,62 +0,0 @@
package org.saturnclient.saturnclient.mixin;
import java.util.Map;
import org.jetbrains.annotations.Nullable;
import org.saturnclient.saturnclient.SaturnClient;
import org.saturnclient.saturnclient.auth.Auth;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import dev.kosmx.playerAnim.api.layered.AnimationStack;
import dev.kosmx.playerAnim.minecraftApi.PlayerAnimationAccess;
import dev.kosmx.playerAnim.minecraftApi.PlayerAnimationRegistry;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.client.gui.hud.MessageIndicator;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.network.message.MessageSignatureData;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
@Mixin(ChatHud.class)
public class SaturnReload {
@Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", at = @At("HEAD"), cancellable = true)
public void onAddMessage(Text message, @Nullable MessageSignatureData signatureData,
@Nullable MessageIndicator indicator, CallbackInfo ci) {
try {
String msg = message.toString();
if (msg.contains("$SATURN_RELOAD")) {
for (Map.Entry<String, String> player : Auth.playerNames.entrySet()) {
String name = player.getKey();
if (msg.contains(name)) {
Auth.player(name, player.getValue());
}
ci.cancel();
}
} else if (msg.contains("$SATURN_EMOTE")) {
String[] args = msg.split("&@");
for (AbstractClientPlayerEntity player : SaturnClient.client.world.getPlayers()) {
if (player.getUuidAsString().replace("-", "").equals(args[1])) {
AnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(player);
animationStack.addAnimLayer(1000, PlayerAnimationRegistry.getAnimation(Identifier.of("saturnclient", args[2])).playAnimation());
ci.cancel();
break;
}
}
} else if (msg.contains("$SATURN_CANCEL_EMOTE")) {
String[] args = msg.split("&@");
for (AbstractClientPlayerEntity player : SaturnClient.client.world.getPlayers()) {
if (player.getUuidAsString().replace("-", "").equals(args[1])) {
AnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(player);
animationStack.removeLayer(1000);
ci.cancel();
break;
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -64,10 +64,8 @@ public class EmoteWheel extends SaturnScreen {
AnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(SaturnClient.client.player); AnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(SaturnClient.client.player);
if (animationStack.isActive() && animationStack.getPriority() == 1000) { if (animationStack.isActive() && animationStack.getPriority() == 1000) {
animationStack.removeLayer(1000); animationStack.removeLayer(1000);
// Auth.cancelEmote();
} }
animationStack.addAnimLayer(1000, PlayerAnimationRegistry.getAnimation(Identifier.of("saturnclient", emote)).playAnimation()); animationStack.addAnimLayer(1000, PlayerAnimationRegistry.getAnimation(Identifier.of("saturnclient", emote)).playAnimation());
// Auth.sendEmote(emote);
close(); close();
}).dimensions(70, 70).centerOffset(width, height, -80 + (col * 80), -35 + (row * 80)).animation(new Fade(700))); }).dimensions(70, 70).centerOffset(width, height, -80 + (col * 80), -35 + (row * 80)).animation(new Fade(700)));
@@ -8,7 +8,6 @@
"NameTagMixin", "NameTagMixin",
"PlayerEntityRendererMixin", "PlayerEntityRendererMixin",
"WhoAmI", "WhoAmI",
"SaturnReload",
"DrawContextAccessor", "DrawContextAccessor",
"TitleScreenMixin" "TitleScreenMixin"
], ],