Это изображение просто отображается на экране. То, что я хочу, это отобразить Предметы хотбар на экране.Может у тебя просто картинка ,а слотов нет?
Тебе не надо отображать предметы,а надо отобразить слоты,в которых уже буду предметы твои ,просто добавить картинку не канаетТо, что я хочу, это отобразить Предметы хотбар на экране.
protected static final RenderItem itemRenderer;
public void drawHotBarUI(final RenderGameOverlayEvent e) {
if (e.type == RenderGameOverlayEvent.ElementType.ALL) {
GL11.glPushMatrix();
GL11.glTranslatef((float)(e.resolution.getScaledWidth() / 2 - 50 + 2), (float)(e.resolution.getScaledHeight() - 66), 0.0f);
final Tessellator t = Tessellator.instance;
//тут бинд текстуры на обводку слота
if (((EntityPlayer)this.mc.thePlayer).inventory.currentItem >= 0 && ((EntityPlayer)this.mc.thePlayer).inventory.currentItem <= 9) {
t.startDrawingQuads();
t.addVertexWithUV((double)(-2 + ((EntityPlayer)this.mc.thePlayer).inventory.currentItem * 20), -2.0, 0.0, 0.0, 0.0);
t.addVertexWithUV((double)(-2 + ((EntityPlayer)this.mc.thePlayer).inventory.currentItem * 20), 18.0, 0.0, 0.0, 1.0);
t.addVertexWithUV((double)(18 + ((EntityPlayer)this.mc.thePlayer).inventory.currentItem * 20), 18.0, 0.0, 1.0, 1.0);
t.addVertexWithUV((double)(18 + ((EntityPlayer)this.mc.thePlayer).inventory.currentItem * 20), -2.0, 0.0, 1.0, 0.0);
t.draw();
}
for (int i = 0; i < 9; ++i) {
//тут бинд текстуры на сам слот.
GL11.glEnable(3042);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
RenderHelper.disableStandardItemLighting();
t.startDrawingQuads();
t.addVertexWithUV((double)(0 + i * 20), 0.0, 0.0, 0.0, 0.0);
t.addVertexWithUV((double)(0 + i * 20), 16.0, 0.0, 0.0, 1.0);
t.addVertexWithUV((double)(16 + i * 20), 16.0, 0.0, 1.0, 1.0);
t.addVertexWithUV((double)(16 + i * 20), 0.0, 0.0, 1.0, 0.0);
t.draw();
this.renderInventorySlot(i, i * 20, 0, 0.0f);
}
RenderHelper.disableStandardItemLighting();
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GL11.glPopMatrix();
}
}
protected void renderInventorySlot(final int p_73832_1_, final int p_73832_2_, final int p_73832_3_, final float p_73832_4_) {
final ItemStack itemstack = ((EntityPlayer)this.mc.thePlayer).inventory.mainInventory[p_73832_1_];
if (itemstack != null) {
final float f1 = itemstack.animationsToGo - p_73832_4_;
if (f1 > 0.0f) {
GL11.glPushMatrix();
final float f2 = 1.0f + f1 / 5.0f;
GL11.glTranslatef((float)(p_73832_2_ + 8), (float)(p_73832_3_ + 12), 0.0f);
GL11.glScalef(1.0f / f2, (f2 + 1.0f) / 2.0f, 1.0f);
GL11.glTranslatef((float)(-(p_73832_2_ + 8)), (float)(-(p_73832_3_ + 12)), 0.0f);
}
RenderGameOverlayHandler.itemRenderer.renderItemIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), itemstack, p_73832_2_, p_73832_3_);
if (f1 > 0.0f) {
GL11.glPopMatrix();
}
RenderGameOverlayHandler.itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), itemstack, p_73832_2_, p_73832_3_);
}
}
static {
itemRenderer = new RenderItem();
}
protected static final RenderItem itemRenderer;
public void drawHotBarUI(final RenderGameOverlayEvent e) {
if (e.type == RenderGameOverlayEvent.ElementType.ALL) {
GL11.glPushMatrix();
GL11.glTranslatef((float)(e.resolution.getScaledWidth() / 2 - 50 + 2), (float)(e.resolution.getScaledHeight() - 66), 0.0f);
for (int i = 0; i < 9; ++i) {
GL11.glEnable(3042);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
RenderHelper.disableStandardItemLighting();
this.renderInventorySlot(i, i * 20, 0, 0.0f);
}
RenderHelper.disableStandardItemLighting();
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GL11.glPopMatrix();
}
}
protected void renderInventorySlot(final int p_73832_1_, final int p_73832_2_, final int p_73832_3_, final float p_73832_4_) {
final ItemStack itemstack = ((EntityPlayer)this.mc.thePlayer).inventory.mainInventory[p_73832_1_];
if (itemstack != null) {
final float f1 = itemstack.animationsToGo - p_73832_4_;
if (f1 > 0.0f) {
GL11.glPushMatrix();
final float f2 = 1.0f + f1 / 5.0f;
GL11.glTranslatef((float)(p_73832_2_ + 8), (float)(p_73832_3_ + 12), 0.0f);
GL11.glScalef(1.0f / f2, (f2 + 1.0f) / 2.0f, 1.0f);
GL11.glTranslatef((float)(-(p_73832_2_ + 8)), (float)(-(p_73832_3_ + 12)), 0.0f);
}
RenderGameOverlayHandler.itemRenderer.renderItemIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), itemstack, p_73832_2_, p_73832_3_);
if (f1 > 0.0f) {
GL11.glPopMatrix();
}
RenderGameOverlayHandler.itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), itemstack, p_73832_2_, p_73832_3_);
}
}
static {
itemRenderer = new RenderItem();
}
Could you answer the question? There is a problem, First, the vanilla hotbar item is still displayed. Second, I do not know how to modify the location of this hotbar. Third, items such as fleece lose their light. Finally, the item appears above the chat overlay.Если хочешь чтобы всё работало также как стандартно то есть,обводка выбранного слота бинд текстуры на каждый слот.
то вот.
Jeong#2454Hi, write me in discord, i can help u
Need to cancel RenderGameOverlayEvent when custom hotbar are renderFirst, the vanilla hotbar item is still displayed
TrySecond, I do not know how to modify the location of this hotbar
GlStatemanager#translate
Thank you. But how do I fix only the light problem in this code (https://pastebin.com/UuwCYZSP)?If you not found solve still
sorry, public class DrawScreen extends Gui{ @SubscribeEvent public void Drawhotba - Pastebin.com. The brightness of the slot is different when player hold the item and when player do not hold the item. and How do I change the location of the vanilla actionbar?Page not work.
УдалиPage not work.
)?
из ссылки.Try to handle RenderGameOverlayEvent.ElementType.SUBTITLES or RenderGameOverlayEvent.ElementType.TEXTHow do I change the location of the vanilla actionbar?