- 11
- 1
- 0
Решил сделать кастомную картинку в главном меню своего чит клиента, но после запуска майнкрафта ставится картинка отсутствующей текстуры. Картинка расположена в папке resources с размерами 2048x2048. В чём может быть проблема?
Код, отвечающий за главное меню и картинку.:
@SideOnly(Side.CLIENT)
public class BThackMenu extends GuiScreen {
private static final ResourceLocation MainTexture = new ResourceLocation("MainMenu.png");
public BThackMenu() {
super();
}
@Override
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
GL11.glColor4f(1, 1, 1, 1);
drawDefaultBackground();
mc.renderEngine.bindTexture(MainTexture);
drawTexturedModalRectCustom(0,0, width, height);
drawLogo.drawString(5, "BThack", this.width / 10 - this.fontRenderer.getStringWidth("BThack") / 2,
this.height / 20, 0x191CFF);
for (GuiButton guiButton : this.buttonList) {
guiButton.drawButton(this.mc, p_73863_1_, p_73863_2_, p_73863_3_);
}
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
}
public void drawTexturedModalRectCustom(int x, int y, int width, int height) {
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
bufferbuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
bufferbuilder.pos((double)(x + 0), (double)(y + height), (double)this.zLevel)
.tex(0, 1).endVertex();
bufferbuilder.pos((double)(x + width), (double)(y + height), (double)this.zLevel)
.tex(1, 1).endVertex();
bufferbuilder.pos((double)(x + width), (double)(y + 0), (double)this.zLevel)
.tex(1, 0).endVertex();
bufferbuilder.pos((double)(x + 0), (double)(y + 0), (double)this.zLevel)
.tex(0, 0).endVertex();
tessellator.draw();
}
@Override
public void initGui() {
int i = this.height / 4 + 48;
this.buttonList.clear();
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72 + 12, 98,
20, "Options"));
this.buttonList.add(new GuiButton(1, this.width / 2 + 2, i + 72 + 12, 98,
20, "Quit"));
this.buttonList.add(new GuiButton(2, this.width / 2 + 2, i + 72 - 12, 98,
20, "Change Nickname"));
this.buttonList.add(new GuiButton(3, this.width / 2 - 100, i + 72 - 12, 98,
20, "Author"));
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, i + 72 - 34, 200,
20, "Multiplayer"));
this.buttonList.add(new GuiButton(5, this.width / 2 - 100, i + 72 - 58, 200,
20, "Singleplayer"));
}
@Override
protected void actionPerformed(GuiButton p_146284_1_) throws IOException {
if (selectedButton.id == 0) {
mc.displayGuiScreen(new GuiOptions(this, mc.gameSettings));
} if (selectedButton.id == 1) {
mc.shutdown();
} if (selectedButton.id == 2) {
mc.displayGuiScreen(new ChangeNickname());
} if (selectedButton.id == 4) {
mc.displayGuiScreen(new GuiMultiplayer(this));
} if (selectedButton.id == 5) {
mc.displayGuiScreen(new GuiWorldSelection(this));
}
super.actionPerformed(p_146284_1_);
}
}