Skip to content

Commit

Permalink
I Hate Sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Leclowndu93150 committed Apr 30, 2024
1 parent 34d37ea commit 4837177
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 23 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ dependencies {
implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.3.5")) {
jarJar.ranged(it, "[0.3.5,)")
}
implementation('cpw.mods:securejarhandler') { version { strictly '0.9.45' } }
}

mixin {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/leclowndu93150/duradisplay/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public boolean render(Font font, ItemStack stack, int xPosition, int yPosition)
case ENERGY:
if (energyStorage.isPresent()) {
energyStorage.ifPresent(es -> {
System.out.println("Found energy item: " + stack.getItem());
int energyStored = es.getEnergyStored();
int maxEnergyStorage = es.getMaxEnergyStored();
double energyPercentage = ((double) energyStored / (double) maxEnergyStorage) * 100D;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.leclowndu93150.duradisplay.mixins;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.minecraft.client.gui.Font;
import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.world.item.ItemStack;
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(value = ItemRenderer.class)
public abstract class GuiGraphicsMixin {
@ModifyExpressionValue(
method = "Lnet/minecraft/client/renderer/entity/ItemRenderer;renderGuiItemDecorations(Lnet/minecraft/client/gui/Font;Lnet/minecraft/world/item/ItemStack;IILjava/lang/String;)V",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/item/ItemStack;isBarVisible()Z"
)

)
private boolean disableBarInGui(boolean barVisible) {
return false;
}

@Inject(
method = "Lnet/minecraft/client/renderer/entity/ItemRenderer;renderGuiItemDecorations(Lnet/minecraft/client/gui/Font;Lnet/minecraft/world/item/ItemStack;IILjava/lang/String;)V",
at = @At("TAIL")
)
public void renderItemDecoration(Font p_115175_, ItemStack p_115176_, int p_115177_, int p_115178_, String p_115179_, CallbackInfo ci){
System.out.println("I work");
}
}

This file was deleted.

0 comments on commit 4837177

Please sign in to comment.