-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
276 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/nekiplay/main/events/hud/RenderArmorBarEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package nekiplay.main.events.hud; | ||
import nekiplay.main.events.Cancellable; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
public class RenderArmorBarEvent extends Cancellable { | ||
private static final RenderArmorBarEvent INSTANCE = new RenderArmorBarEvent(); | ||
private DrawContext context; | ||
private PlayerEntity player; | ||
private int i; | ||
private int j; | ||
private int k; | ||
private int x; | ||
public static RenderArmorBarEvent get(DrawContext context, PlayerEntity player, int i, int j, int k, int x) { | ||
INSTANCE.context = context; | ||
INSTANCE.player = player; | ||
INSTANCE.i = i; | ||
INSTANCE.j = j; | ||
INSTANCE.k = k; | ||
INSTANCE.x = x; | ||
return INSTANCE; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/nekiplay/main/events/hud/RenderExperienceBarEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package nekiplay.main.events.hud; | ||
import nekiplay.main.events.Cancellable; | ||
import net.minecraft.client.gui.DrawContext; | ||
|
||
public class RenderExperienceBarEvent extends Cancellable { | ||
private static final RenderExperienceBarEvent INSTANCE = new RenderExperienceBarEvent(); | ||
private DrawContext context; | ||
private int x; | ||
public static RenderExperienceBarEvent get(DrawContext context, int x) { | ||
INSTANCE.context = context; | ||
INSTANCE.x = x; | ||
return INSTANCE; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/nekiplay/main/events/hud/RenderExperienceLevelEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package nekiplay.main.events.hud; | ||
import nekiplay.main.events.Cancellable; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.render.RenderTickCounter; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
public class RenderExperienceLevelEvent extends Cancellable { | ||
private static final RenderExperienceLevelEvent INSTANCE = new RenderExperienceLevelEvent(); | ||
private DrawContext context; | ||
private RenderTickCounter tickCounter; | ||
public static RenderExperienceLevelEvent get(DrawContext context, RenderTickCounter tickCounter) { | ||
INSTANCE.context = context; | ||
INSTANCE.tickCounter = tickCounter; | ||
return INSTANCE; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/nekiplay/main/events/hud/RenderFoodBarEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package nekiplay.main.events.hud; | ||
import nekiplay.main.events.Cancellable; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.render.RenderTickCounter; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
public class RenderFoodBarEvent extends Cancellable { | ||
private static final RenderFoodBarEvent INSTANCE = new RenderFoodBarEvent(); | ||
private DrawContext context; | ||
private PlayerEntity player; | ||
private int top; | ||
private int right; | ||
public static RenderFoodBarEvent get(DrawContext context, PlayerEntity player, int top, int right) { | ||
INSTANCE.context = context; | ||
INSTANCE.player = player; | ||
INSTANCE.top = top; | ||
INSTANCE.right = right; | ||
return INSTANCE; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/nekiplay/main/events/hud/RenderHealthBarEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package nekiplay.main.events.hud; | ||
import nekiplay.main.events.Cancellable; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
public class RenderHealthBarEvent extends Cancellable { | ||
private static final RenderHealthBarEvent INSTANCE = new RenderHealthBarEvent(); | ||
private DrawContext context; | ||
private PlayerEntity player; | ||
private int x; | ||
private int y; | ||
private int lines; | ||
private int regeneratingHeartIndex; | ||
private float maxHealth; | ||
private int lastHealth; | ||
private int health; | ||
private int absorption; | ||
private boolean blinking; | ||
public static RenderHealthBarEvent get(DrawContext context, PlayerEntity player, int x, int y, int lines, int regeneratingHeartIndex, float maxHealth, int lastHealth, int health, int absorption, boolean blinking) { | ||
INSTANCE.context = context; | ||
INSTANCE.player = player; | ||
INSTANCE.x = x; | ||
INSTANCE.y = y; | ||
INSTANCE.lines = lines; | ||
INSTANCE.regeneratingHeartIndex = regeneratingHeartIndex; | ||
INSTANCE.maxHealth = maxHealth; | ||
INSTANCE.lastHealth = lastHealth; | ||
INSTANCE.health = health; | ||
INSTANCE.absorption = absorption; | ||
INSTANCE.blinking = blinking; | ||
return INSTANCE; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/nekiplay/main/events/hud/RenderMountHealthBarEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package nekiplay.main.events.hud; | ||
import nekiplay.main.events.Cancellable; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
public class RenderMountHealthBarEvent extends Cancellable { | ||
private static final RenderMountHealthBarEvent INSTANCE = new RenderMountHealthBarEvent(); | ||
private DrawContext context; | ||
public static RenderMountHealthBarEvent get(DrawContext context) { | ||
INSTANCE.context = context; | ||
return INSTANCE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/nekiplay/meteorplus/mixin/minecraft/hud/InGameHudMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
package nekiplay.meteorplus.mixin.minecraft.hud; | ||
import meteordevelopment.meteorclient.MeteorClient; | ||
import nekiplay.main.events.hud.*; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.gui.hud.InGameHud; | ||
import net.minecraft.client.render.RenderTickCounter; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
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(InGameHud.class) | ||
public class InGameHudMixin { | ||
@Inject(method = "renderHealthBar", at = @At("HEAD"), cancellable = true) | ||
private void onRenderHealthBar(DrawContext context, PlayerEntity player, int x, int y, int lines, int regeneratingHeartIndex, float maxHealth, int lastHealth, int health, int absorption, boolean blinking, CallbackInfo ci) { | ||
RenderHealthBarEvent healthBarRenderEvent = RenderHealthBarEvent.get(context, player, x, y, lines, regeneratingHeartIndex, maxHealth, lastHealth, health, absorption, blinking); | ||
MeteorClient.EVENT_BUS.post(healthBarRenderEvent); | ||
if (healthBarRenderEvent.isCancelled()) { | ||
ci.cancel(); | ||
} | ||
} | ||
@Inject(method = "renderExperienceBar", at = @At("HEAD"), cancellable = true) | ||
private void onRenderExperienceBar(DrawContext context, int x, CallbackInfo ci) { | ||
RenderExperienceBarEvent renderExperienceBarEvent = RenderExperienceBarEvent.get(context, x); | ||
MeteorClient.EVENT_BUS.post(renderExperienceBarEvent); | ||
if (renderExperienceBarEvent.isCancelled()) { | ||
ci.cancel(); | ||
} | ||
} | ||
@Inject(method = "renderExperienceLevel", at = @At("HEAD"), cancellable = true) | ||
private void onRenderExperienceBar(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) { | ||
RenderExperienceLevelEvent renderExperienceLevelEvent = RenderExperienceLevelEvent.get(context, tickCounter); | ||
MeteorClient.EVENT_BUS.post(renderExperienceLevelEvent); | ||
if (renderExperienceLevelEvent.isCancelled()) { | ||
ci.cancel(); | ||
} | ||
} | ||
@Inject(method = "renderFood", at = @At("HEAD"), cancellable = true) | ||
private void onRenderFoodBar(DrawContext context, PlayerEntity player, int top, int right, CallbackInfo ci) { | ||
RenderFoodBarEvent renderFoodBarEvent = RenderFoodBarEvent.get(context, player, top, right); | ||
MeteorClient.EVENT_BUS.post(renderFoodBarEvent); | ||
if (renderFoodBarEvent.isCancelled()) { | ||
ci.cancel(); | ||
} | ||
} | ||
@Inject(method = "renderArmor", at = @At("HEAD"), cancellable = true) | ||
private static void onRenderArmor(DrawContext context, PlayerEntity player, int i, int j, int k, int x, CallbackInfo ci) { | ||
RenderArmorBarEvent renderArmorBarEvent = RenderArmorBarEvent.get(context, player, i, j, k, x); | ||
MeteorClient.EVENT_BUS.post(renderArmorBarEvent); | ||
if (renderArmorBarEvent.isCancelled()) { | ||
ci.cancel(); | ||
} | ||
} | ||
@Inject(method = "renderMountHealth", at = @At("HEAD"), cancellable = true) | ||
private void onRenderMountHealth(DrawContext context, CallbackInfo ci) { | ||
RenderMountHealthBarEvent renderMountHealthBarEvent = RenderMountHealthBarEvent.get(context); | ||
MeteorClient.EVENT_BUS.post(renderMountHealthBarEvent); | ||
if (renderMountHealthBarEvent.isCancelled()) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters