Вопрос Ошибка при добавление шейдера в главное меню

Начинающий
Статус
Оффлайн
Регистрация
28 Июл 2022
Сообщения
205
Реакции[?]
2
Поинты[?]
0
Привет, добавил шейдер в главное меню (база рич) и появилась ошибка в виде краша при загрузке чита
Прикрепил крашлог, и вот если что код мейн меню чита

package fun.rich.client.ui.mainmenu;

import com.mojang.realmsclient.gui.ChatFormatting;
import fun.rich.client.Rich;
import fun.rich.client.ui.altmanager.GuiAltManager;
import fun.rich.client.ui.button.GuiMainMenuButton;
import fun.rich.client.utils.math.animations.Animation;
import fun.rich.client.utils.math.animations.impl.DecelerateAnimation;
import fun.rich.client.utils.render.RenderUtils;
import fun.rich.client.utils.render.RoundedUtil;
import net.minecraft.client.gui.*;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import fun.rich.client.utils.render.GLSLSandboxShader;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL20;

import java.awt.*;
import java.io.IOException;

public class RichMainMenu extends GuiScreen {
private int width;
public float scale = 2;
private int height;
private long initTime = System.currentTimeMillis();
private Animation initAnimation;

private GLSLSandboxShader backgroundShader;

@Override
public void initGui() {
ScaledResolution sr = new ScaledResolution(this.mc);
this.width = sr.getScaledWidth();
this.height = sr.getScaledHeight();
initAnimation = new DecelerateAnimation(300, 1);

this.buttonList.add(new GuiMainMenuButton(0, (this.width / 2) - 90, this.height / 2 + 4, 180, 15, "Singleplayer"));
this.buttonList.add(new GuiMainMenuButton(1, this.width / 2 - 90, this.height / 2 + 32, 180, 15, "Multiplayer"));
this.buttonList.add(new GuiMainMenuButton(2, this.width / 2 - 90, this.height / 2 + 60, 180, 15, "Alt Manager"));
this.buttonList.add(new GuiMainMenuButton(3, this.width / 2 - 90, this.height / 2 + 88, 180, 15, "Options"));
this.buttonList.add(new GuiMainMenuButton(4, this.width / 2 - 90, this.height / 2 + 116, 180, 15, "Quit"));


}

@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
ScaledResolution res = new ScaledResolution(mc);
int width = res.getScaledWidth() / 2;
int height = res.getScaledHeight() / 2;
try {this.backgroundShader = new GLSLSandboxShader("/assets/minecraft/sokol.glsl");
} catch (IOException e) {
throw new IllegalStateException("Failed to load backgound shader", e);
}
this.backgroundShader.useShader(this.width, this.height, mouseX, mouseY, (System.currentTimeMillis() - initTime) / 1000f);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2f(-1.0f, -1.0f);
GL11.glVertex2f(-1.0f, 1.0f);
GL11.glVertex2f(1.0f, 1.0f);
GL11.glVertex2f(1.0f, -1.0f);
GL11.glEnd();
GL20.glUseProgram(0);
GlStateManager.disableCull();
RenderUtils.drawBlurredShadow(res.getScaledWidth() / 2 - 93, res.getScaledHeight() / 2 - 40, 186, 190,1, new Color(10,10,10, 169));
RoundedUtil.drawRoundOutline(res.getScaledWidth() / 2 - 93, res.getScaledHeight() / 2 - 40, 186, 190, 2, 0.5f, new Color(26, 26, 26, 0), new Color(255, 255, 255, 255));
String changelog1 = "Keaz Client" + Rich.instance.version + " ChangeLog";
String changelog2 = ChatFormatting.GOLD + "[/]" + ChatFormatting.RESET + " Recoded all";
String changelog3 = ChatFormatting.RED + "[-]" + ChatFormatting.RESET + " Deleted Matrix mode in velocity";
String changelog4 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Optimized jar file";
String changelog5 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Update Matrix mode in speed, now work in reallyworld";
String changelog6 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Change all font";
String changelog7 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Add new .tp for reallyworld";
String changelog8 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Add new background";
String changelog9 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " New Better Killaura, and KeepSprint";


ScaledResolution sr = new ScaledResolution(mc);
mc.neverlose500_13.drawStringWithShadow(changelog1, 2, 2, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog2, 2, 8, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog3, 2, 14, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog4, 2, 20, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog5, 2, 26, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog6, 2, 32, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog7, 2, 38, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog8, 2, 44, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog9, 2, 50, new Color(255, 255, 255).getRGB());


mc.rubik_30.drawCenteredStringWithShadow("Keaz Client", (float) (sr.getScaledWidth() / 2), (float) (sr.getScaledHeight() / 2.2), -1);
super.drawScreen(mouseX, mouseY, partialTicks);
}

public void actionPerformed(GuiButton button) throws IOException {
switch (button.id) {
case 0:
this.mc.displayGuiScreen(new GuiWorldSelection(this));
break;
case 1:
this.mc.displayGuiScreen(new GuiMultiplayer(this));
break;
case 2:
this.mc.displayGuiScreen(new GuiAltManager());
break;
case 3:
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
break;
case 4:
System.exit(0);
Rich.instance.configManager.saveConfig("default");
Rich.instance.fileManager.saveFiles();
break;
}

super.actionPerformed(button);
}
}
 

Вложения

Начинающий
Статус
Оффлайн
Регистрация
28 Июл 2022
Сообщения
205
Реакции[?]
2
Поинты[?]
0
Я указал верный путь, все равно крашит, прошу если есть возможность, отпишите в лс дискорда с помощью
 
Пользователь
Статус
Оффлайн
Регистрация
23 Авг 2021
Сообщения
521
Реакции[?]
53
Поинты[?]
20K
Привет, добавил шейдер в главное меню (база рич) и появилась ошибка в виде краша при загрузке чита
Прикрепил крашлог, и вот если что код мейн меню чита

package fun.rich.client.ui.mainmenu;

import com.mojang.realmsclient.gui.ChatFormatting;
import fun.rich.client.Rich;
import fun.rich.client.ui.altmanager.GuiAltManager;
import fun.rich.client.ui.button.GuiMainMenuButton;
import fun.rich.client.utils.math.animations.Animation;
import fun.rich.client.utils.math.animations.impl.DecelerateAnimation;
import fun.rich.client.utils.render.RenderUtils;
import fun.rich.client.utils.render.RoundedUtil;
import net.minecraft.client.gui.*;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import fun.rich.client.utils.render.GLSLSandboxShader;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL20;

import java.awt.*;
import java.io.IOException;

public class RichMainMenu extends GuiScreen {
private int width;
public float scale = 2;
private int height;
private long initTime = System.currentTimeMillis();
private Animation initAnimation;

private GLSLSandboxShader backgroundShader;

@Override
public void initGui() {
ScaledResolution sr = new ScaledResolution(this.mc);
this.width = sr.getScaledWidth();
this.height = sr.getScaledHeight();
initAnimation = new DecelerateAnimation(300, 1);

this.buttonList.add(new GuiMainMenuButton(0, (this.width / 2) - 90, this.height / 2 + 4, 180, 15, "Singleplayer"));
this.buttonList.add(new GuiMainMenuButton(1, this.width / 2 - 90, this.height / 2 + 32, 180, 15, "Multiplayer"));
this.buttonList.add(new GuiMainMenuButton(2, this.width / 2 - 90, this.height / 2 + 60, 180, 15, "Alt Manager"));
this.buttonList.add(new GuiMainMenuButton(3, this.width / 2 - 90, this.height / 2 + 88, 180, 15, "Options"));
this.buttonList.add(new GuiMainMenuButton(4, this.width / 2 - 90, this.height / 2 + 116, 180, 15, "Quit"));


}

@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
ScaledResolution res = new ScaledResolution(mc);
int width = res.getScaledWidth() / 2;
int height = res.getScaledHeight() / 2;
try {this.backgroundShader = new GLSLSandboxShader("/assets/minecraft/sokol.glsl");
} catch (IOException e) {
throw new IllegalStateException("Failed to load backgound shader", e);
}
this.backgroundShader.useShader(this.width, this.height, mouseX, mouseY, (System.currentTimeMillis() - initTime) / 1000f);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2f(-1.0f, -1.0f);
GL11.glVertex2f(-1.0f, 1.0f);
GL11.glVertex2f(1.0f, 1.0f);
GL11.glVertex2f(1.0f, -1.0f);
GL11.glEnd();
GL20.glUseProgram(0);
GlStateManager.disableCull();
RenderUtils.drawBlurredShadow(res.getScaledWidth() / 2 - 93, res.getScaledHeight() / 2 - 40, 186, 190,1, new Color(10,10,10, 169));
RoundedUtil.drawRoundOutline(res.getScaledWidth() / 2 - 93, res.getScaledHeight() / 2 - 40, 186, 190, 2, 0.5f, new Color(26, 26, 26, 0), new Color(255, 255, 255, 255));
String changelog1 = "Keaz Client" + Rich.instance.version + " ChangeLog";
String changelog2 = ChatFormatting.GOLD + "[/]" + ChatFormatting.RESET + " Recoded all";
String changelog3 = ChatFormatting.RED + "[-]" + ChatFormatting.RESET + " Deleted Matrix mode in velocity";
String changelog4 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Optimized jar file";
String changelog5 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Update Matrix mode in speed, now work in reallyworld";
String changelog6 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Change all font";
String changelog7 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Add new .tp for reallyworld";
String changelog8 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " Add new background";
String changelog9 = ChatFormatting.GREEN + "[+]" + ChatFormatting.RESET + " New Better Killaura, and KeepSprint";


ScaledResolution sr = new ScaledResolution(mc);
mc.neverlose500_13.drawStringWithShadow(changelog1, 2, 2, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog2, 2, 8, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog3, 2, 14, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog4, 2, 20, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog5, 2, 26, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog6, 2, 32, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog7, 2, 38, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog8, 2, 44, new Color(255, 255, 255).getRGB());
mc.neverlose500_13.drawStringWithShadow(changelog9, 2, 50, new Color(255, 255, 255).getRGB());


mc.rubik_30.drawCenteredStringWithShadow("Keaz Client", (float) (sr.getScaledWidth() / 2), (float) (sr.getScaledHeight() / 2.2), -1);
super.drawScreen(mouseX, mouseY, partialTicks);
}

public void actionPerformed(GuiButton button) throws IOException {
switch (button.id) {
case 0:
this.mc.displayGuiScreen(new GuiWorldSelection(this));
break;
case 1:
this.mc.displayGuiScreen(new GuiMultiplayer(this));
break;
case 2:
this.mc.displayGuiScreen(new GuiAltManager());
break;
case 3:
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
break;
case 4:
System.exit(0);
Rich.instance.configManager.saveConfig("default");
Rich.instance.fileManager.saveFiles();
break;
}

super.actionPerformed(button);
}
}
java.lang.NullPointerException: Rendering screen
at fun.rich.client.utils.render.GLSLSandboxShader.readStreamToString(GLSLSandboxShader.java:86)

ну да, зачем читать эти строки, когда есть югейм
зачем гуглить что такое NullPointerException когда есть югейм
зачем смотреть метод readStreamToString конкретно 86 строку когда есть югейм
 
Пользователь
Статус
Оффлайн
Регистрация
2 Авг 2021
Сообщения
276
Реакции[?]
33
Поинты[?]
0
Я указал верный путь, все равно крашит, прошу если есть возможность, отпишите в лс дискорда с помощью
если бы ты указал верный путь то у тебя не было бы ошибки как отписал человек на 1 комментарий выше
 
Начинающий
Статус
Оффлайн
Регистрация
28 Июл 2022
Сообщения
205
Реакции[?]
2
Поинты[?]
0
если бы ты указал верный путь то у тебя не было бы ошибки как отписал человек на 1 комментарий выше
Да, только я даже проверял, что путь верный, интеллидж даже говорит путь, я проверял, и файл там есть...
 
Начинающий
Статус
Оффлайн
Регистрация
4 Июн 2017
Сообщения
21
Реакции[?]
5
Поинты[?]
0
1670429991673.png Чел я в ахуе с тебя ты хотя бы почитай что такое getResourceAsStream, ты реально думаешь что вписав 1670430056828.pngты попадешь в assets, я молчу вообще про утечки памяти в том туторе откуда ты копировал 1в1
 
Начинающий
Статус
Оффлайн
Регистрация
28 Июл 2022
Сообщения
205
Реакции[?]
2
Поинты[?]
0
1670431581351.png
Интеллидж указывает, что путь ведёт куда надо, перехожу по тому пути, и открывается нужный файл, в чем проблема тогда?
1670431644639.png
1670431581351.png
Интеллидж указывает, что путь ведёт куда надо, перехожу по тому пути, и открывается нужный файл, в чем проблема тогда?
1670431644639.png
Я просто не пойму что я не так сделал, если можешь помоги в дискорде, прошу
 
Сверху Снизу