diff options
author | Lorenz <ESs95s3P5z8Pheb> | 2022-07-08 16:02:54 +0200 |
---|---|---|
committer | Lorenz <ESs95s3P5z8Pheb> | 2022-07-08 16:02:54 +0200 |
commit | 9e08dbf2baa9819abd281ad285df7462c99491e2 (patch) | |
tree | 6e874e1c5b74a522d6acca08dd6b64c808ddbbbe /src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java | |
parent | 1e268208cd700b379952d1718dca66fa4aad305c (diff) | |
download | skyhanni-9e08dbf2baa9819abd281ad285df7462c99491e2.tar.gz skyhanni-9e08dbf2baa9819abd281ad285df7462c99491e2.tar.bz2 skyhanni-9e08dbf2baa9819abd281ad285df7462c99491e2.zip |
remove old stuff
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java index 6c5f55e24..9d5bf57bc 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java @@ -1,67 +1,67 @@ -package com.thatgravyboat.skyblockhud.mixins; - -import at.lorenz.mod.LorenzMod; -import com.thatgravyboat.skyblockhud.tracker.TrackerHandler; -import net.minecraft.client.Minecraft; -import net.minecraft.client.network.NetHandlerPlayClient; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.PacketThreadUtil; -import net.minecraft.network.play.server.S2FPacketSetSlot; -import net.minecraft.network.play.server.S3EPacketTeams; -import net.minecraft.scoreboard.ScorePlayerTeam; -import net.minecraft.scoreboard.Scoreboard; -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 org.spongepowered.asm.mixin.injection.callback.LocalCapture; - -@Mixin(NetHandlerPlayClient.class) -public class MixinNetHandlerPlayClient { - - @Inject(method = "handleSetSlot", at = @At("HEAD")) - public void onHandleSetSlot(S2FPacketSetSlot packetIn, CallbackInfo ci) { - if (LorenzMod.hasSkyblockScoreboard()) { - Minecraft mc = Minecraft.getMinecraft(); - PacketThreadUtil.checkThreadAndEnqueue(packetIn, mc.getNetHandler(), mc); - if (packetIn.func_149175_c() == 0) { - ItemStack stack = packetIn.func_149174_e(); - - if (stack != null && stack.hasTagCompound()) { - if (stack.getTagCompound().hasKey("ExtraAttributes")) { - NBTTagCompound extraAttributes = stack.getTagCompound().getCompoundTag("ExtraAttributes"); - String id = extraAttributes.getString("id"); - ItemStack slotStack = Minecraft.getMinecraft().thePlayer.inventoryContainer.getSlot(packetIn.func_149173_d()).getStack(); - int changeAmount = stack.stackSize - (slotStack == null ? 0 : slotStack.stackSize); - String specialId = null; - int number = -1; - if (extraAttributes.hasKey("enchantments")) { - NBTTagCompound enchantments = extraAttributes.getCompoundTag("enchantments"); - if (enchantments.getKeySet().size() == 1) { - for (String e : enchantments.getKeySet()) { - specialId = e; - break; - } - if (specialId != null) number = enchantments.getInteger(specialId); - } - } - TrackerHandler.onItemAdded(id, changeAmount, specialId, number); - } - } - } - } - } - - @Inject(method = "handleTeams", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/network/play/server/S3EPacketTeams;getAction()I", ordinal = 0, shift = At.Shift.BEFORE), cancellable = true) - public void handleTeams(S3EPacketTeams packetIn, CallbackInfo ci, Scoreboard scoreboard) { - //This stops Hypixel from being stupid and spamming our logs because they dont have different ids for things. - if (scoreboard.getTeam(packetIn.getName()) != null && packetIn.getAction() == 0) ci.cancel(); - } - - @Inject(method = "handleTeams", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/network/play/server/S3EPacketTeams;getAction()I", ordinal = 6, shift = At.Shift.BEFORE), cancellable = true) - public void handleTeamRemove(S3EPacketTeams packetIn, CallbackInfo ci, Scoreboard scoreboard, ScorePlayerTeam scoreplayerteam) { - //This stops Hypixel from being stupid and spamming our logs because they dont have different ids for things. - if (scoreplayerteam == null) ci.cancel(); - } -} +//package com.thatgravyboat.skyblockhud.mixins; +// +//import at.lorenz.mod.LorenzMod; +//import com.thatgravyboat.skyblockhud.tracker.TrackerHandler; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.network.NetHandlerPlayClient; +//import net.minecraft.item.ItemStack; +//import net.minecraft.nbt.NBTTagCompound; +//import net.minecraft.network.PacketThreadUtil; +//import net.minecraft.network.play.server.S2FPacketSetSlot; +//import net.minecraft.network.play.server.S3EPacketTeams; +//import net.minecraft.scoreboard.ScorePlayerTeam; +//import net.minecraft.scoreboard.Scoreboard; +//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 org.spongepowered.asm.mixin.injection.callback.LocalCapture; +// +//@Mixin(NetHandlerPlayClient.class) +//public class MixinNetHandlerPlayClient { +// +// @Inject(method = "handleSetSlot", at = @At("HEAD")) +// public void onHandleSetSlot(S2FPacketSetSlot packetIn, CallbackInfo ci) { +// if (LorenzMod.hasSkyblockScoreboard()) { +// Minecraft mc = Minecraft.getMinecraft(); +// PacketThreadUtil.checkThreadAndEnqueue(packetIn, mc.getNetHandler(), mc); +// if (packetIn.func_149175_c() == 0) { +// ItemStack stack = packetIn.func_149174_e(); +// +// if (stack != null && stack.hasTagCompound()) { +// if (stack.getTagCompound().hasKey("ExtraAttributes")) { +// NBTTagCompound extraAttributes = stack.getTagCompound().getCompoundTag("ExtraAttributes"); +// String id = extraAttributes.getString("id"); +// ItemStack slotStack = Minecraft.getMinecraft().thePlayer.inventoryContainer.getSlot(packetIn.func_149173_d()).getStack(); +// int changeAmount = stack.stackSize - (slotStack == null ? 0 : slotStack.stackSize); +// String specialId = null; +// int number = -1; +// if (extraAttributes.hasKey("enchantments")) { +// NBTTagCompound enchantments = extraAttributes.getCompoundTag("enchantments"); +// if (enchantments.getKeySet().size() == 1) { +// for (String e : enchantments.getKeySet()) { +// specialId = e; +// break; +// } +// if (specialId != null) number = enchantments.getInteger(specialId); +// } +// } +// TrackerHandler.onItemAdded(id, changeAmount, specialId, number); +// } +// } +// } +// } +// } +// +// @Inject(method = "handleTeams", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/network/play/server/S3EPacketTeams;getAction()I", ordinal = 0, shift = At.Shift.BEFORE), cancellable = true) +// public void handleTeams(S3EPacketTeams packetIn, CallbackInfo ci, Scoreboard scoreboard) { +// //This stops Hypixel from being stupid and spamming our logs because they dont have different ids for things. +// if (scoreboard.getTeam(packetIn.getName()) != null && packetIn.getAction() == 0) ci.cancel(); +// } +// +// @Inject(method = "handleTeams", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/network/play/server/S3EPacketTeams;getAction()I", ordinal = 6, shift = At.Shift.BEFORE), cancellable = true) +// public void handleTeamRemove(S3EPacketTeams packetIn, CallbackInfo ci, Scoreboard scoreboard, ScorePlayerTeam scoreplayerteam) { +// //This stops Hypixel from being stupid and spamming our logs because they dont have different ids for things. +// if (scoreplayerteam == null) ci.cancel(); +// } +//} |