aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java
index 93537ea..57ea2dc 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinEntityArrow.java
@@ -12,14 +12,22 @@ 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;
- @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())) {
- KillTrackerHandler.attackedEntities.add(position.entityHit.getUniqueID());
- }
- return position;
+ //Disabled as kill tracker stuff not fully added yet.
+ @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())
+ ) {
+ KillTrackerHandler.attackedEntities.add(position.entityHit.getUniqueID());
}
+ return position;
+ }
}