From 9e08dbf2baa9819abd281ad285df7462c99491e2 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Fri, 8 Jul 2022 16:02:54 +0200 Subject: remove old stuff --- .../skyblockhud/mixins/MixinEntityArrow.java | 52 ++--- .../skyblockhud/mixins/MixinGuiIngameForge.java | 226 ++++++++++----------- .../skyblockhud/mixins/MixinItemStack.java | 84 ++++---- .../mixins/MixinNetHandlerPlayClient.java | 134 ++++++------ .../skyblockhud/mixins/MixinRenderItem.java | 126 ++++++------ 5 files changed, 311 insertions(+), 311 deletions(-) (limited to 'src/main/java/com/thatgravyboat/skyblockhud/mixins') diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java index dbde075ee..d892c01f1 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java @@ -1,26 +1,26 @@ -package com.thatgravyboat.skyblockhud.mixins; - -import com.thatgravyboat.skyblockhud.api.KillTracking; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.util.MovingObjectPosition; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -@Mixin(EntityArrow.class) -public class MixinEntityArrow { - - @Shadow - public Entity shootingEntity; - - @ModifyVariable(method = "onUpdate", at = @At(value = "STORE", ordinal = 1)) - public MovingObjectPosition onUpdate(MovingObjectPosition position) { - if (position != null && position.entityHit != null && this.shootingEntity != null && this.shootingEntity.getUniqueID().equals(Minecraft.getMinecraft().thePlayer.getUniqueID())) { - KillTracking.attackedEntities.add(position.entityHit.getUniqueID()); - } - return position; - } -} +//package com.thatgravyboat.skyblockhud.mixins; +// +//import com.thatgravyboat.skyblockhud.api.KillTracking; +//import net.minecraft.client.Minecraft; +//import net.minecraft.entity.Entity; +//import net.minecraft.entity.projectile.EntityArrow; +//import net.minecraft.util.MovingObjectPosition; +//import org.spongepowered.asm.mixin.Mixin; +//import org.spongepowered.asm.mixin.Shadow; +//import org.spongepowered.asm.mixin.injection.At; +//import org.spongepowered.asm.mixin.injection.ModifyVariable; +// +//@Mixin(EntityArrow.class) +//public class MixinEntityArrow { +// +// @Shadow +// public Entity shootingEntity; +// +// @ModifyVariable(method = "onUpdate", at = @At(value = "STORE", ordinal = 1)) +// public MovingObjectPosition onUpdate(MovingObjectPosition position) { +// if (position != null && position.entityHit != null && this.shootingEntity != null && this.shootingEntity.getUniqueID().equals(Minecraft.getMinecraft().thePlayer.getUniqueID())) { +// KillTracking.attackedEntities.add(position.entityHit.getUniqueID()); +// } +// return position; +// } +//} diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java index 083b48588..078bdce8f 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java @@ -1,113 +1,113 @@ -package com.thatgravyboat.skyblockhud.mixins; - -import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*; - -import at.lorenz.mod.LorenzMod; -import com.thatgravyboat.skyblockhud.overlay.MiningHud; -import com.thatgravyboat.skyblockhud.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraftforge.client.GuiIngameForge; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.common.MinecraftForge; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(GuiIngameForge.class) -public class MixinGuiIngameForge { - - @Shadow(remap = false) - private RenderGameOverlayEvent eventParent; - - @Inject(method = "renderArmor", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderArmor(int width, int height, CallbackInfo ci) { - if (LorenzMod.config.renderer.hideArmor && LorenzMod.hasSkyblockScoreboard()) { - ci.cancel(); - if (prePost(ARMOR, eventParent)) return; - postPost(ARMOR, eventParent); - } - } - - @Inject(method = "renderHealth", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderHealth(int width, int height, CallbackInfo ci) { - if (LorenzMod.config.renderer.hideHearts && LorenzMod.hasSkyblockScoreboard()) { - ci.cancel(); - if (prePost(HEALTH, eventParent)) return; - postPost(HEALTH, eventParent); - } - } - - @Inject(method = "renderAir", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderAir(int width, int height, CallbackInfo ci) { - if (LorenzMod.config.renderer.hideAir && LorenzMod.hasSkyblockScoreboard()) { - ci.cancel(); - if (prePost(AIR, eventParent)) return; - postPost(AIR, eventParent); - } - } - - @Inject(method = "renderHealthMount", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderHealthMount(int width, int height, CallbackInfo ci) { - if (LorenzMod.config.renderer.hideAnimalHearts && LorenzMod.hasSkyblockScoreboard()) { - ci.cancel(); - if (prePost(HEALTHMOUNT, eventParent)) return; - postPost(HEALTHMOUNT, eventParent); - } - } - - @Inject(method = "renderExperience", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderExperience(int width, int height, CallbackInfo ci) { - if (LorenzMod.config.renderer.hideXpBar && LorenzMod.hasSkyblockScoreboard()) { - ci.cancel(); - if (prePost(EXPERIENCE, eventParent)) return; - postPost(EXPERIENCE, eventParent); - } else if (LorenzMod.config.mining.barMode == 1) { - if (!LorenzMod.config.renderer.hideXpBar && (LorenzMod.config.mining.showDrillBar || LorenzMod.config.mining.showHeatBar) && LorenzMod.hasSkyblockScoreboard()) { - if (MiningHud.getHeat() > 0 || Utils.isDrill(Minecraft.getMinecraft().thePlayer.getHeldItem())) { - ci.cancel(); - if (prePost(EXPERIENCE, eventParent)) return; - postPost(EXPERIENCE, eventParent); - } - } - } - } - - @Inject(method = "renderJumpBar", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderJumpBar(int width, int height, CallbackInfo ci) { - if (LorenzMod.config.renderer.hideXpBar && LorenzMod.hasSkyblockScoreboard()) { - ci.cancel(); - if (prePost(JUMPBAR, eventParent)) return; - postPost(JUMPBAR, eventParent); - } else if (LorenzMod.config.mining.barMode == 1) { - if (!LorenzMod.config.renderer.hideXpBar && (LorenzMod.config.mining.showDrillBar || LorenzMod.config.mining.showHeatBar) && LorenzMod.hasSkyblockScoreboard()) { - if (MiningHud.getHeat() > 0 || Utils.isDrill(Minecraft.getMinecraft().thePlayer.getHeldItem())) { - ci.cancel(); - if (prePost(JUMPBAR, eventParent)) return; - postPost(JUMPBAR, eventParent); - } - } - } - } - - @Inject(method = "renderFood", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderFood(int width, int height, CallbackInfo ci) { - if (LorenzMod.config.renderer.hideFood && LorenzMod.hasSkyblockScoreboard()) { - ci.cancel(); - if (prePost(FOOD, eventParent)) return; - postPost(FOOD, eventParent); - } - } - - @Unique - private static boolean prePost(RenderGameOverlayEvent.ElementType type, RenderGameOverlayEvent eventParent) { - return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(eventParent, type)); - } - - @Unique - private static void postPost(RenderGameOverlayEvent.ElementType type, RenderGameOverlayEvent eventParent) { - MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(eventParent, type)); - } -} +//package com.thatgravyboat.skyblockhud.mixins; +// +//import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*; +// +//import at.lorenz.mod.LorenzMod; +//import com.thatgravyboat.skyblockhud.overlay.MiningHud; +//import com.thatgravyboat.skyblockhud.utils.Utils; +//import net.minecraft.client.Minecraft; +//import net.minecraftforge.client.GuiIngameForge; +//import net.minecraftforge.client.event.RenderGameOverlayEvent; +//import net.minecraftforge.common.MinecraftForge; +//import org.spongepowered.asm.mixin.Mixin; +//import org.spongepowered.asm.mixin.Shadow; +//import org.spongepowered.asm.mixin.Unique; +//import org.spongepowered.asm.mixin.injection.At; +//import org.spongepowered.asm.mixin.injection.Inject; +//import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +// +//@Mixin(GuiIngameForge.class) +//public class MixinGuiIngameForge { +// +// @Shadow(remap = false) +// private RenderGameOverlayEvent eventParent; +// +// @Inject(method = "renderArmor", at = @At("HEAD"), cancellable = true, remap = false) +// public void onRenderArmor(int width, int height, CallbackInfo ci) { +// if (LorenzMod.config.renderer.hideArmor && LorenzMod.hasSkyblockScoreboard()) { +// ci.cancel(); +// if (prePost(ARMOR, eventParent)) return; +// postPost(ARMOR, eventParent); +// } +// } +// +// @Inject(method = "renderHealth", at = @At("HEAD"), cancellable = true, remap = false) +// public void onRenderHealth(int width, int height, CallbackInfo ci) { +// if (LorenzMod.config.renderer.hideHearts && LorenzMod.hasSkyblockScoreboard()) { +// ci.cancel(); +// if (prePost(HEALTH, eventParent)) return; +// postPost(HEALTH, eventParent); +// } +// } +// +// @Inject(method = "renderAir", at = @At("HEAD"), cancellable = true, remap = false) +// public void onRenderAir(int width, int height, CallbackInfo ci) { +// if (LorenzMod.config.renderer.hideAir && LorenzMod.hasSkyblockScoreboard()) { +// ci.cancel(); +// if (prePost(AIR, eventParent)) return; +// postPost(AIR, eventParent); +// } +// } +// +// @Inject(method = "renderHealthMount", at = @At("HEAD"), cancellable = true, remap = false) +// public void onRenderHealthMount(int width, int height, CallbackInfo ci) { +// if (LorenzMod.config.renderer.hideAnimalHearts && LorenzMod.hasSkyblockScoreboard()) { +// ci.cancel(); +// if (prePost(HEALTHMOUNT, eventParent)) return; +// postPost(HEALTHMOUNT, eventParent); +// } +// } +// +// @Inject(method = "renderExperience", at = @At("HEAD"), cancellable = true, remap = false) +// public void onRenderExperience(int width, int height, CallbackInfo ci) { +// if (LorenzMod.config.renderer.hideXpBar && LorenzMod.hasSkyblockScoreboard()) { +// ci.cancel(); +// if (prePost(EXPERIENCE, eventParent)) return; +// postPost(EXPERIENCE, eventParent); +// } else if (LorenzMod.config.mining.barMode == 1) { +// if (!LorenzMod.config.renderer.hideXpBar && (LorenzMod.config.mining.showDrillBar || LorenzMod.config.mining.showHeatBar) && LorenzMod.hasSkyblockScoreboard()) { +// if (MiningHud.getHeat() > 0 || Utils.isDrill(Minecraft.getMinecraft().thePlayer.getHeldItem())) { +// ci.cancel(); +// if (prePost(EXPERIENCE, eventParent)) return; +// postPost(EXPERIENCE, eventParent); +// } +// } +// } +// } +// +// @Inject(method = "renderJumpBar", at = @At("HEAD"), cancellable = true, remap = false) +// public void onRenderJumpBar(int width, int height, CallbackInfo ci) { +// if (LorenzMod.config.renderer.hideXpBar && LorenzMod.hasSkyblockScoreboard()) { +// ci.cancel(); +// if (prePost(JUMPBAR, eventParent)) return; +// postPost(JUMPBAR, eventParent); +// } else if (LorenzMod.config.mining.barMode == 1) { +// if (!LorenzMod.config.renderer.hideXpBar && (LorenzMod.config.mining.showDrillBar || LorenzMod.config.mining.showHeatBar) && LorenzMod.hasSkyblockScoreboard()) { +// if (MiningHud.getHeat() > 0 || Utils.isDrill(Minecraft.getMinecraft().thePlayer.getHeldItem())) { +// ci.cancel(); +// if (prePost(JUMPBAR, eventParent)) return; +// postPost(JUMPBAR, eventParent); +// } +// } +// } +// } +// +// @Inject(method = "renderFood", at = @At("HEAD"), cancellable = true, remap = false) +// public void onRenderFood(int width, int height, CallbackInfo ci) { +// if (LorenzMod.config.renderer.hideFood && LorenzMod.hasSkyblockScoreboard()) { +// ci.cancel(); +// if (prePost(FOOD, eventParent)) return; +// postPost(FOOD, eventParent); +// } +// } +// +// @Unique +// private static boolean prePost(RenderGameOverlayEvent.ElementType type, RenderGameOverlayEvent eventParent) { +// return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(eventParent, type)); +// } +// +// @Unique +// private static void postPost(RenderGameOverlayEvent.ElementType type, RenderGameOverlayEvent eventParent) { +// MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(eventParent, type)); +// } +//} diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinItemStack.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinItemStack.java index 9e2fcc519..eef185561 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinItemStack.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinItemStack.java @@ -1,42 +1,42 @@ -package com.thatgravyboat.skyblockhud.mixins; - -import at.lorenz.mod.LorenzMod; -import com.thatgravyboat.skyblockhud.api.item.IAbility; -import com.thatgravyboat.skyblockhud.handlers.CooldownHandler; -import java.util.regex.Matcher; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -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; - -@Mixin(ItemStack.class) -public class MixinItemStack implements IAbility { - - private String ability; - private int abilityTime; - - @Inject(method = "setTagCompound", at = @At("HEAD")) - public void onNbt(NBTTagCompound nbt, CallbackInfo ci) { - if (LorenzMod.config != null && !LorenzMod.config.misc.hideItemCooldowns) { - Matcher abilityMatcher = CooldownHandler.getAbility(nbt); - if (abilityMatcher != null) { - ability = abilityMatcher.group(1); - try { - abilityTime = Integer.parseInt(abilityMatcher.group(2).trim()); - } catch (Exception ignored) {} - } - } - } - - @Override - public String getAbility() { - return ability; - } - - @Override - public int getAbilityTime() { - return abilityTime; - } -} +//package com.thatgravyboat.skyblockhud.mixins; +// +//import at.lorenz.mod.LorenzMod; +//import com.thatgravyboat.skyblockhud.api.item.IAbility; +//import com.thatgravyboat.skyblockhud.handlers.CooldownHandler; +//import java.util.regex.Matcher; +//import net.minecraft.item.ItemStack; +//import net.minecraft.nbt.NBTTagCompound; +//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; +// +//@Mixin(ItemStack.class) +//public class MixinItemStack implements IAbility { +// +// private String ability; +// private int abilityTime; +// +// @Inject(method = "setTagCompound", at = @At("HEAD")) +// public void onNbt(NBTTagCompound nbt, CallbackInfo ci) { +// if (LorenzMod.config != null && !LorenzMod.config.misc.hideItemCooldowns) { +// Matcher abilityMatcher = CooldownHandler.getAbility(nbt); +// if (abilityMatcher != null) { +// ability = abilityMatcher.group(1); +// try { +// abilityTime = Integer.parseInt(abilityMatcher.group(2).trim()); +// } catch (Exception ignored) {} +// } +// } +// } +// +// @Override +// public String getAbility() { +// return ability; +// } +// +// @Override +// public int getAbilityTime() { +// return abilityTime; +// } +//} 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(); +// } +//} diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java index ae7d5bf89..64f9086fb 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java @@ -1,63 +1,63 @@ -package com.thatgravyboat.skyblockhud.mixins; - -import com.thatgravyboat.skyblockhud.handlers.CooldownHandler; -import com.thatgravyboat.skyblockhud.location.MinesHandler; -import java.lang.ref.WeakReference; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.item.ItemStack; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(RenderItem.class) -public abstract class MixinRenderItem { - - @Shadow - protected abstract void draw(WorldRenderer renderer, int x, int y, int width, int height, int red, int green, int blue, int alpha); - - @Inject(method = "renderItemOverlayIntoGUI", at = @At("RETURN")) - public void renderItemOverlayIntoGUI(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text, CallbackInfo ci) { - if (stack == null) return; - float cooldown = CooldownHandler.getAbilityTime(stack); - - WeakReference weakProgress = MinesHandler.getEggColorAndProgress(stack); - - if (weakProgress != null) { - MinesHandler.PrehistoricEggProgress progress = weakProgress.get(); - if (progress == null) return; - GlStateManager.disableLighting(); - GlStateManager.disableDepth(); - GlStateManager.disableTexture2D(); - GlStateManager.disableAlpha(); - GlStateManager.disableBlend(); - WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); - this.draw(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255); - this.draw(worldrenderer, xPosition + 2, yPosition + 13, Math.round(progress.progress * 13f), 1, (progress.currentColor >> 16) & 0xFF, (progress.currentColor >> 8) & 0xFF, progress.currentColor & 0xFF, 255); - GlStateManager.enableAlpha(); - GlStateManager.enableTexture2D(); - GlStateManager.enableLighting(); - GlStateManager.enableDepth(); - } - - if (cooldown > -1) { - GlStateManager.disableLighting(); - GlStateManager.disableDepth(); - GlStateManager.disableTexture2D(); - GlStateManager.disableAlpha(); - GlStateManager.disableBlend(); - WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); - this.draw(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255); - this.draw(worldrenderer, xPosition + 2, yPosition + 13, Math.round(cooldown * 13f), 1, 102, 102, 255, 255); - GlStateManager.enableAlpha(); - GlStateManager.enableTexture2D(); - GlStateManager.enableLighting(); - GlStateManager.enableDepth(); - } - } -} +//package com.thatgravyboat.skyblockhud.mixins; +// +//import com.thatgravyboat.skyblockhud.handlers.CooldownHandler; +//import com.thatgravyboat.skyblockhud.location.MinesHandler; +//import java.lang.ref.WeakReference; +//import net.minecraft.client.gui.FontRenderer; +//import net.minecraft.client.renderer.GlStateManager; +//import net.minecraft.client.renderer.Tessellator; +//import net.minecraft.client.renderer.WorldRenderer; +//import net.minecraft.client.renderer.entity.RenderItem; +//import net.minecraft.item.ItemStack; +//import org.spongepowered.asm.mixin.Mixin; +//import org.spongepowered.asm.mixin.Shadow; +//import org.spongepowered.asm.mixin.injection.At; +//import org.spongepowered.asm.mixin.injection.Inject; +//import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +// +//@Mixin(RenderItem.class) +//public abstract class MixinRenderItem { +// +// @Shadow +// protected abstract void draw(WorldRenderer renderer, int x, int y, int width, int height, int red, int green, int blue, int alpha); +// +// @Inject(method = "renderItemOverlayIntoGUI", at = @At("RETURN")) +// public void renderItemOverlayIntoGUI(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text, CallbackInfo ci) { +// if (stack == null) return; +// float cooldown = CooldownHandler.getAbilityTime(stack); +// +// WeakReference weakProgress = MinesHandler.getEggColorAndProgress(stack); +// +// if (weakProgress != null) { +// MinesHandler.PrehistoricEggProgress progress = weakProgress.get(); +// if (progress == null) return; +// GlStateManager.disableLighting(); +// GlStateManager.disableDepth(); +// GlStateManager.disableTexture2D(); +// GlStateManager.disableAlpha(); +// GlStateManager.disableBlend(); +// WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); +// this.draw(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255); +// this.draw(worldrenderer, xPosition + 2, yPosition + 13, Math.round(progress.progress * 13f), 1, (progress.currentColor >> 16) & 0xFF, (progress.currentColor >> 8) & 0xFF, progress.currentColor & 0xFF, 255); +// GlStateManager.enableAlpha(); +// GlStateManager.enableTexture2D(); +// GlStateManager.enableLighting(); +// GlStateManager.enableDepth(); +// } +// +// if (cooldown > -1) { +// GlStateManager.disableLighting(); +// GlStateManager.disableDepth(); +// GlStateManager.disableTexture2D(); +// GlStateManager.disableAlpha(); +// GlStateManager.disableBlend(); +// WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); +// this.draw(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255); +// this.draw(worldrenderer, xPosition + 2, yPosition + 13, Math.round(cooldown * 13f), 1, 102, 102, 255, 255); +// GlStateManager.enableAlpha(); +// GlStateManager.enableTexture2D(); +// GlStateManager.enableLighting(); +// GlStateManager.enableDepth(); +// } +// } +//} -- cgit