Thank you for your quick reply.
i included my log files because i don't understand what my mistake is.
my code is as follows:
public class ModContainerTypes {
public static final DeferredRegister<ContainerType<?>> CONTAINER_TYPES = new DeferredRegister<>(ForgeRegistries.CONTAINERS, NovusTechnica.MODID);
public static final RegistryObject<ContainerType<SolarPanelContainer>> SOLAR_PANEL = CONTAINER_TYPES.register("solar_panel",() -> (IForgeContainerType.create(SolarPanelContainer::new)));
}
public class SolarPanelScreen extends ContainerScreen<SolarPanelContainer> {
private static final ResourceLocation BACKGROUND_TEXTURE = new ResourceLocation(NovusTechnica.MODID,"/textures/gui/solar_panle_container.png");
public SolarPanelScreen(SolarPanelContainer screenContainer, PlayerInventory inv, ITextComponent titleIn) {
super(screenContainer, inv, titleIn);
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(BACKGROUND_TEXTURE);
int startX = this.guiLeft;
int startY = this.guiTop;
this.blit(startX,startY, 0,0,this.xSize,this.ySize);
final SolarPanelTileEntity tileEntity = container.tileEntity;
final SettableEnergyStorage settableStorage = tileEntity.energy;
final int energyStored = settableStorage.getEnergyStored();
if (energyStored > 0) { // Draw energy bar
//this.blit();
// ToDo set blit
}
}
@Override
public void render(int mouseX, int mouseY, float partickelTicks) {
this.renderBackground();
super.render(mouseX, mouseY, partickelTicks);
this.renderHoveredToolTip(mouseX,mouseY);
// TODO zahlen werte anpassen
int relMouseX = mouseX - this.guiLeft;
int relMouseY = mouseY - this.guiTop;
boolean energyBarHovered = relMouseX > 151 && relMouseX < 166 && relMouseY > 10 && relMouseY < 76;
if (energyBarHovered) {
String tooltip = new TranslationTextComponent(
"gui." + NovusTechnica.MODID + ".energy",
this.container.tileEntity.energy.getEnergyStored()
).getFormattedText();
this.renderTooltip(tooltip, mouseX, mouseY);
}
}
}
I have absolutly no idea whats wrong so i really need your help Thank you very much for your support !!!!
latest.log