Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Forge 1.16.5-36.2.39] Create new screen error


Recommended Posts

Hello,
Can you help me for this error please,
For information, I do not speak English, I am French. But, you can answer me in English, I will use a translator.
Thank

Exception message: java.lang.RuntimeException: Attempted to load class net/minecraft/client/gui/screen/Screen for invalid dist DEDICATED_SERVER

Main().class

Spoiler

ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY, () -> (mc, screen) -> new NewGui());

NewGui().class
 

Spoiler

private final ResourceLocation guiTextureLocation = new ResourceLocation(Main.MODID, "textures/gui/bann.png");
private final int xSize = 256;
private final int ySize = 202;
private int guiLeft;
private int guiTop;

public NewGui(){
     super(new TranslationTextComponent("gui.bann.test"));
}

@Override
public void init(){
     this.guiLeft = (this.width - this.xSize) / 2;
     this.guiTop = (this.height - this.ySize) / 2;
}

public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks){
     drawBackground(matrixStack);
     super.render(matrixStack, mouseX, mouseY, partialTicks);
}

private void drawBackground(MatrixStack matrixStack){
     this.minecraft.getTextureManager().bindTexture(guiTextureLocation);
     this.blit(matrixStack, guiLeft, guiTop, 0, 0, this.xSize, this.ySize);
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.