This commit is contained in:
kirillsaint 2023-06-29 00:46:18 +06:00
parent ff09bce5a7
commit 303d9d353e
7 changed files with 24 additions and 15 deletions

Binary file not shown.

View File

@ -64,6 +64,9 @@ async function build() {
console.log("Extracting JAR"); console.log("Extracting JAR");
await unzip(`../build/libs/client-${version}.jar`, tempPaths.jar); await unzip(`../build/libs/client-${version}.jar`, tempPaths.jar);
console.log("Extracting Wrapper");
await unzip(assetsPaths.wrapper, tempPaths.jar);
const libs = await fs.promises.readdir(assetsPaths.libs); const libs = await fs.promises.readdir(assetsPaths.libs);
for (const lib of libs) { for (const lib of libs) {
console.log(`Extracting ${lib}`); console.log(`Extracting ${lib}`);

View File

@ -478,6 +478,22 @@ public class RenderUtil {
setColor(-1); setColor(-1);
} }
public static void drawImage(float x, float y, float width, float height) {
GL11.glPushMatrix();
GL11.glDisable(2929);
GL11.glEnable(3042);
GL11.glDepthMask(false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(1f, 1f, 1f, 1);
Gui.drawModalRectWithCustomSizedTexture((int) x, (int) y, 0.0f, 0.0f, (int) width, (int) height, width, height);
GL11.glDepthMask(true);
GL11.glDisable(3042);
GL11.glEnable(2929);
GL11.glPopMatrix();
GL11.glColor4f(1f, 1f, 1f, 1f);
}
public static void drawImage(ResourceLocation image, float x, float y, float width, float height, float alpha) { public static void drawImage(ResourceLocation image, float x, float y, float width, float height, float alpha) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glDisable(2929); GL11.glDisable(2929);

View File

@ -54,6 +54,9 @@ public class SilentClientTweaker implements ITweaker {
@Override @Override
public final void injectIntoClassLoader(LaunchClassLoader classLoader) public final void injectIntoClassLoader(LaunchClassLoader classLoader)
{ {
if(hasOptifine) {
classLoader.registerTransformer("optifine.OptiFineClassTransformer");
}
MixinBootstrap.init(); MixinBootstrap.init();
// Retrieve the default mixin environment and register the config file // Retrieve the default mixin environment and register the config file

View File

@ -1,12 +0,0 @@
package net.silentclient.client.mixin.accessors;
import net.minecraft.client.resources.ResourcePackRepository;
import net.minecraft.util.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(ResourcePackRepository.Entry.class)
public interface ResourcePackRepositoryEntryAccessor {
@Accessor
ResourceLocation getLocationTexturePackIcon();
}

View File

@ -14,7 +14,6 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.silentclient.client.Client; import net.silentclient.client.Client;
import net.silentclient.client.gui.util.RenderUtil; import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.mixin.accessors.ResourcePackRepositoryEntryAccessor;
import net.silentclient.client.mods.CustomFontRenderer; import net.silentclient.client.mods.CustomFontRenderer;
import net.silentclient.client.mods.HudMod; import net.silentclient.client.mods.HudMod;
import net.silentclient.client.mods.ModCategory; import net.silentclient.client.mods.ModCategory;
@ -82,7 +81,8 @@ public class PackDisplayMod extends HudMod {
ResourcePackRepository.Entry entry = rps.get(order == "First Pack" ? 0 : count - 1); ResourcePackRepository.Entry entry = rps.get(order == "First Pack" ? 0 : count - 1);
entry.bindTexturePackIcon(Minecraft.getMinecraft().getTextureManager()); entry.bindTexturePackIcon(Minecraft.getMinecraft().getTextureManager());
GlStateManager.disableLighting(); GlStateManager.disableLighting();
RenderUtil.drawImage(((ResourcePackRepositoryEntryAccessor) entry).getLocationTexturePackIcon(), 0, 0, getIconHeight(), getIconHeight(), false); entry.bindTexturePackIcon(mc.getTextureManager());
RenderUtil.drawImage(0, 0, getIconHeight(), getIconHeight());
} else { } else {
if(defaultIcon == null) { if(defaultIcon == null) {
try { try {

View File

@ -11,7 +11,6 @@
"accessors.GuiChatAccessor", "accessors.GuiChatAccessor",
"accessors.GuiAccessor", "accessors.GuiAccessor",
"accessors.RenderItemAccessor", "accessors.RenderItemAccessor",
"accessors.ResourcePackRepositoryEntryAccessor",
"accessors.SimpleReloadableResourceManagerAccessor", "accessors.SimpleReloadableResourceManagerAccessor",
"accessors.TextureManagerAccessor", "accessors.TextureManagerAccessor",
"mixins.EntityRendererMixin", "mixins.EntityRendererMixin",