aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/mixins
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/mixins')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEndermanRenderer.java7
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java6
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java39
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java3
4 files changed, 27 insertions, 28 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEndermanRenderer.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEndermanRenderer.java
index 3cdbae5..7363a45 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEndermanRenderer.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEndermanRenderer.java
@@ -2,6 +2,7 @@ package com.thatgravyboat.skyblockhud.mixins;
import com.thatgravyboat.skyblockhud.SpecialColour;
import com.thatgravyboat.skyblockhud.handlers.sbentities.EntityTypeHelper;
+import java.awt.*;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderEnderman;
import net.minecraft.entity.monster.EntityEnderman;
@@ -10,14 +11,12 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import java.awt.*;
-
@Mixin(RenderEnderman.class)
public class MixinEndermanRenderer {
@Inject(method = "doRender(Lnet/minecraft/entity/monster/EntityEnderman;DDDFF)V", at = @At("HEAD"))
- public void onRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci){
- if (EntityTypeHelper.isZealot(entity)){
+ public void onRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) {
+ if (EntityTypeHelper.isZealot(entity)) {
Color color = new Color(SpecialColour.specialToChromaRGB("255:255:0:48:255"));
GlStateManager.color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 255f);
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java
index 93537ea..cc1edaf 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java
@@ -12,11 +12,13 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable;
@Mixin(EntityArrow.class)
public class MixinEntityArrow {
+
//Disabled as kill tracker stuff not fully added yet.
- @Shadow public Entity shootingEntity;
+ @Shadow
+ public Entity shootingEntity;
@ModifyVariable(method = "onUpdate", at = @At(value = "STORE", ordinal = 1))
- public MovingObjectPosition onUpdate(MovingObjectPosition position){
+ public MovingObjectPosition onUpdate(MovingObjectPosition position) {
if (position != null && position.entityHit != null && this.shootingEntity != null && this.shootingEntity.getUniqueID().equals(Minecraft.getMinecraft().thePlayer.getUniqueID())) {
KillTrackerHandler.attackedEntities.add(position.entityHit.getUniqueID());
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java
index ce7c228..9886ba0 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java
@@ -1,5 +1,7 @@
package com.thatgravyboat.skyblockhud.mixins;
+import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*;
+
import com.thatgravyboat.skyblockhud.SkyblockHud;
import net.minecraftforge.client.GuiIngameForge;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
@@ -10,8 +12,6 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*;
-
@Mixin(GuiIngameForge.class)
public class MixinGuiIngameForge {
@@ -19,8 +19,8 @@ public class MixinGuiIngameForge {
private RenderGameOverlayEvent eventParent;
@Inject(method = "renderArmor", at = @At("HEAD"), cancellable = true, remap = false)
- public void onRenderArmor(int width, int height, CallbackInfo ci){
- if (SkyblockHud.config.renderer.hideArmor && SkyblockHud.hasSkyblockScoreboard()){
+ public void onRenderArmor(int width, int height, CallbackInfo ci) {
+ if (SkyblockHud.config.renderer.hideArmor && SkyblockHud.hasSkyblockScoreboard()) {
ci.cancel();
if (pre(ARMOR)) return;
post(ARMOR);
@@ -28,8 +28,8 @@ public class MixinGuiIngameForge {
}
@Inject(method = "renderHealth", at = @At("HEAD"), cancellable = true, remap = false)
- public void onRenderHealth(int width, int height, CallbackInfo ci){
- if (SkyblockHud.config.renderer.hideHearts && SkyblockHud.hasSkyblockScoreboard()){
+ public void onRenderHealth(int width, int height, CallbackInfo ci) {
+ if (SkyblockHud.config.renderer.hideHearts && SkyblockHud.hasSkyblockScoreboard()) {
ci.cancel();
if (pre(HEALTH)) return;
post(HEALTH);
@@ -37,8 +37,8 @@ public class MixinGuiIngameForge {
}
@Inject(method = "renderAir", at = @At("HEAD"), cancellable = true, remap = false)
- public void onRenderAir(int width, int height, CallbackInfo ci){
- if (SkyblockHud.config.renderer.hideAir && SkyblockHud.hasSkyblockScoreboard()){
+ public void onRenderAir(int width, int height, CallbackInfo ci) {
+ if (SkyblockHud.config.renderer.hideAir && SkyblockHud.hasSkyblockScoreboard()) {
ci.cancel();
if (pre(AIR)) return;
post(AIR);
@@ -46,8 +46,8 @@ public class MixinGuiIngameForge {
}
@Inject(method = "renderHealthMount", at = @At("HEAD"), cancellable = true, remap = false)
- public void onRenderHealthMount(int width, int height, CallbackInfo ci){
- if (SkyblockHud.config.renderer.hideAnimalHearts && SkyblockHud.hasSkyblockScoreboard()){
+ public void onRenderHealthMount(int width, int height, CallbackInfo ci) {
+ if (SkyblockHud.config.renderer.hideAnimalHearts && SkyblockHud.hasSkyblockScoreboard()) {
ci.cancel();
if (pre(HEALTHMOUNT)) return;
post(HEALTHMOUNT);
@@ -55,8 +55,8 @@ public class MixinGuiIngameForge {
}
@Inject(method = "renderExperience", at = @At("HEAD"), cancellable = true, remap = false)
- public void onRenderExperience(int width, int height, CallbackInfo ci){
- if (SkyblockHud.config.renderer.hideXpBar && SkyblockHud.hasSkyblockScoreboard()){
+ public void onRenderExperience(int width, int height, CallbackInfo ci) {
+ if (SkyblockHud.config.renderer.hideXpBar && SkyblockHud.hasSkyblockScoreboard()) {
ci.cancel();
if (pre(EXPERIENCE)) return;
post(EXPERIENCE);
@@ -64,8 +64,8 @@ public class MixinGuiIngameForge {
}
@Inject(method = "renderJumpBar", at = @At("HEAD"), cancellable = true, remap = false)
- public void onRenderJumpBar(int width, int height, CallbackInfo ci){
- if (SkyblockHud.config.renderer.hideXpBar && SkyblockHud.hasSkyblockScoreboard()){
+ public void onRenderJumpBar(int width, int height, CallbackInfo ci) {
+ if (SkyblockHud.config.renderer.hideXpBar && SkyblockHud.hasSkyblockScoreboard()) {
ci.cancel();
if (pre(JUMPBAR)) return;
post(JUMPBAR);
@@ -73,20 +73,19 @@ public class MixinGuiIngameForge {
}
@Inject(method = "renderFood", at = @At("HEAD"), cancellable = true, remap = false)
- public void onRenderFood(int width, int height, CallbackInfo ci){
- if (SkyblockHud.config.renderer.hideFood && SkyblockHud.hasSkyblockScoreboard()){
+ public void onRenderFood(int width, int height, CallbackInfo ci) {
+ if (SkyblockHud.config.renderer.hideFood && SkyblockHud.hasSkyblockScoreboard()) {
ci.cancel();
if (pre(FOOD)) return;
post(FOOD);
}
}
- private boolean pre(RenderGameOverlayEvent.ElementType type)
- {
+ private boolean pre(RenderGameOverlayEvent.ElementType type) {
return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(eventParent, type));
}
- private void post(RenderGameOverlayEvent.ElementType type)
- {
+
+ private void post(RenderGameOverlayEvent.ElementType type) {
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(eventParent, type));
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java
index 679da20..df36b8f 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinNetHandlerPlayClient.java
@@ -45,9 +45,8 @@ public class MixinNetHandlerPlayClient {
*/
@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){
+ 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();
}
-
}