Skip to content

Commit

Permalink
Added back in the SplashProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
sinender committed Nov 1, 2024
1 parent bc9172b commit afcbae0
Show file tree
Hide file tree
Showing 6 changed files with 689 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,13 @@ public void renderPlayerlist(int width) {
int s;
//draw hsob
drawRect(width / 2 - r / 2 - 1, 0, width / 2 + r / 2 + 1, (int) ((r/2.688172043) + 10), Integer.MIN_VALUE);
GlStateManager.pushAttrib();
this.mc.getTextureManager().bindTexture(hsob);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
drawModalRectWithCustomSizedTexture(width / 2 - (r + 10) / 2, 0, 0, 0, r + 10, (int) ((r/2.688172043) + 10), r + 10, r/3f + 10);
GlStateManager.popAttrib();
q += (int) (r/2.688172043);
this.mc.getTextureManager().bindTexture(GuiIngame.icons);


drawRect(width / 2 - r / 2 - 1, q - 1, width / 2 + r / 2 + 1, q + m * 9, Integer.MIN_VALUE);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package llc.redstone.hysentials.mixin;

import llc.redstone.hysentials.util.SplashProgress;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.IReloadableResourceManager;
import net.minecraftforge.fml.client.FMLClientHandler;
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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.List;
import java.util.concurrent.Semaphore;

@Mixin(value=FMLClientHandler.class, remap = false)
public class FMLClientHandlerMixin {
@Redirect(method = "beginMinecraftLoading", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/SplashProgress;start()V"))
private void rdStart() {
SplashProgress.start();
}

@Redirect(method = "onInitializationComplete", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/SplashProgress;finish()V"))
private void rdFinish3() {
SplashProgress.finish();
}

@Redirect(method = "haltGame", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/SplashProgress;finish()V"))
private void rdFinish() {
SplashProgress.finish();
}

@Redirect(method = "finishMinecraftLoading", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/SplashProgress;finish()V"))
private void rdFinish2() {
SplashProgress.finish();
}

@Redirect(method = "processWindowMessages", at = @At(value = "INVOKE", target = "Ljava/util/concurrent/Semaphore;tryAcquire()Z"))
private boolean rdTryAcquire(Semaphore instance) {
return SplashProgress.mutex.tryAcquire();
}

@Redirect(method = "processWindowMessages", at = @At(value = "INVOKE", target = "Ljava/util/concurrent/Semaphore;release()V"))
private void rdRelease(Semaphore instance) {
SplashProgress.mutex.release();
}
}
Loading

0 comments on commit afcbae0

Please sign in to comment.