-
tout est bien appellé :
[19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:36]: container Custom [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:46]: slots crafting [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:46]: slots crafting [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:46]: slots crafting [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:46]: slots crafting [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:53]: slots armor [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:53]: slots armor [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:53]: slots armor [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:53]: slots armor [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:50] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:31]: Inv Modifié ! [19:16:50] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2 [19:16:50] [Netty Server IO #1/INFO] [FML]: Client protocol version 2 [19:16:50] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : minecraft@1.12.2,pyrion@1.0.0,FML@8.0.99.99,forge@14.23.5.2768,mcp@9.42 [19:16:50] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established [19:16:50] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established [19:16:50] [Server thread/INFO] [minecraft/PlayerList]: Eno_gamer10[local:E:0c3da24b] logged in with entity id 0 at (161.87898783306562, 11.0, 12.957892389510452) [19:16:50] [Server thread/INFO] [minecraft/MinecraftServer]: Eno_gamer10 a rejoint la partie [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:36]: container Custom [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:46]: slots crafting [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:46]: slots crafting [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:46]: slots crafting [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:46]: slots crafting [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:53]: slots armor [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:53]: slots armor [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:53]: slots armor [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:53]: slots armor [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:94]: slots inventory [19:16:51] [main/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:31]: Inv Modifié ! [19:16:52] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game... [19:16:52] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'py-gen'/overworld [19:16:52] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:35]: Entity Constructing ! [19:16:52] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:35]: Entity Constructing ! [19:16:53] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:35]: Entity Constructing ! [19:16:53] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:35]: Entity Constructing ! [19:16:53] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:35]: Entity Constructing ! [19:16:53] [main/INFO] [minecraft/AdvancementList]: Loaded 488 advancements [19:16:54] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game... [19:16:54] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'py-gen'/overworld [19:16:54] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Did the system time change, or is the server overloaded? Running 4101ms behind, skipping 82 tick(s) [19:16:56] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:35]: Entity Constructing ! [19:16:56] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:35]: Entity Constructing ! [19:16:56] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:35]: Entity Constructing !mais le container du joueur n’est pas set

-
Tu peux montrer ton code ?
Car je ne vois pas trop pour quelle raison le container ne serait pas prit en compte.
-
mon container :
package fr.eno.pyrion.gui.container; import javax.annotation.Nullable; import fr.eno.pyrion.events.EventRandoms; import net.minecraft.client.Minecraft; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerPlayer; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCraftResult; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotCrafting; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ContainerPlayerCustom extends Container { private static final EntityEquipmentSlot[] VALID_EQUIPMENT_SLOTS = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET}; /** The crafting matrix inventory. */ public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2); public InventoryCraftResult craftResult = new InventoryCraftResult(); /** Determines if inventory manipulation should be handled. */ public boolean isLocalWorld; private final EntityPlayer player; public ContainerPlayerCustom(InventoryPlayer playerInventory, boolean localWorld, EntityPlayer player) { System.out.println("container Custom"); this.isLocalWorld = localWorld; this.player = player; this.addSlotToContainer(new SlotCrafting(player, this.craftMatrix, this.craftResult, 0, 154, 28)); for (int i = 0; i < 2; ++i) { for (int j = 0; j < 2; ++j) { System.out.println("slots crafting"); this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 2, 98 + j * 18, 18 + i * 18)); } } for (int k = 0; k < 4; ++k) { System.out.println("slots armor"); final EntityEquipmentSlot entityequipmentslot = VALID_EQUIPMENT_SLOTS[k]; this.addSlotToContainer(new Slot(playerInventory, 36 + (3 - k), 8, 8 + k * 18) { /** * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 * in the case of armor slots) */ public int getSlotStackLimit() { return 1; } /** * Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace * fuel. */ public boolean isItemValid(ItemStack stack) { return stack.getItem().isValidArmor(stack, entityequipmentslot, player); } /** * Return whether this slot's stack can be taken from this slot. */ public boolean canTakeStack(EntityPlayer playerIn) { ItemStack itemstack = this.getStack(); return !itemstack.isEmpty() && !playerIn.isCreative() && EnchantmentHelper.hasBindingCurse(itemstack) ? false : super.canTakeStack(playerIn); } @Nullable @SideOnly(Side.CLIENT) public String getSlotTexture() { return ItemArmor.EMPTY_SLOT_NAMES[entityequipmentslot.getIndex()]; } }); } for (int l = 0; l < 3; ++l) { for (int j1 = 0; j1 < 9; ++j1) { System.out.println("slots inventory"); this.addSlotToContainer(new Slot(playerInventory, j1 + (l + 1) * 9, 8 + j1 * 18, 84 + l * 18)); } } for (int i1 = 0; i1 < 9; ++i1) { this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 142)); } this.addSlotToContainer(new Slot(playerInventory, 40, 100, 62) { @Nullable @SideOnly(Side.CLIENT) public String getSlotTexture() { //return "minecraft:items/empty_armor_slot_shield"; return "minecraft:items/apple"; } }); } /** * Callback for when the crafting matrix is changed. */ public void onCraftMatrixChanged(IInventory inventoryIn) { this.slotChangedCraftingGrid(this.player.world, this.player, this.craftMatrix, this.craftResult); } /** * Called when the container is closed. */ public void onContainerClosed(EntityPlayer playerIn) { super.onContainerClosed(playerIn); this.craftResult.clear(); if (!playerIn.world.isRemote) { this.clearContainer(playerIn, playerIn.world, this.craftMatrix); } } /** * Determines whether supplied player can use this container */ public boolean canInteractWith(EntityPlayer playerIn) { return true; } /** * Handle when the stack in slot {@code index} is shift-clicked. Normally this moves the stack between the player * inventory and the other inventory(s). */ public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = ItemStack.EMPTY; Slot slot = this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); EntityEquipmentSlot entityequipmentslot = EntityLiving.getSlotForItemStack(itemstack); if (index == 0) { if (!this.mergeItemStack(itemstack1, 9, 45, true)) { return ItemStack.EMPTY; } slot.onSlotChange(itemstack1, itemstack); } else if (index >= 1 && index < 5) { if (!this.mergeItemStack(itemstack1, 9, 45, false)) { return ItemStack.EMPTY; } } else if (index >= 5 && index < 9) { if (!this.mergeItemStack(itemstack1, 9, 45, false)) { return ItemStack.EMPTY; } } else if (entityequipmentslot.getSlotType() == EntityEquipmentSlot.Type.ARMOR && !((Slot)this.inventorySlots.get(8 - entityequipmentslot.getIndex())).getHasStack()) { int i = 8 - entityequipmentslot.getIndex(); if (!this.mergeItemStack(itemstack1, i, i + 1, false)) { return ItemStack.EMPTY; } } else if (entityequipmentslot == EntityEquipmentSlot.OFFHAND && !((Slot)this.inventorySlots.get(45)).getHasStack()) { if (!this.mergeItemStack(itemstack1, 45, 46, false)) { return ItemStack.EMPTY; } } else if (index >= 9 && index < 36) { if (!this.mergeItemStack(itemstack1, 36, 45, false)) { return ItemStack.EMPTY; } } else if (index >= 36 && index < 45) { if (!this.mergeItemStack(itemstack1, 9, 36, false)) { return ItemStack.EMPTY; } } else if (!this.mergeItemStack(itemstack1, 9, 45, false)) { return ItemStack.EMPTY; } if (itemstack1.isEmpty()) { slot.putStack(ItemStack.EMPTY); } else { slot.onSlotChanged(); } if (itemstack1.getCount() == itemstack.getCount()) { return ItemStack.EMPTY; } ItemStack itemstack2 = slot.onTake(playerIn, itemstack1); if (index == 0) { playerIn.dropItem(itemstack2, false); } } return itemstack; } /** * Called to determine if the current slot is valid for the stack merging (double-click) code. The stack passed in * is null for the initial slot that was double-clicked. */ public boolean canMergeSlot(ItemStack stack, Slot slotIn) { return slotIn.inventory != this.craftResult && super.canMergeSlot(stack, slotIn); } }j’ai pas la pomme

-
Ton gui custom s’affiche ou non ?
-
je ne set pas de gui, juste le container,
est ce que ça pose un problème ? -
Et oui, puisque le gui instancie son propre container dans le constructeur. Et que pour l’instant il utilise donc toujours le container de base de l’inventaire.
-
mais alors comment je set le gui ?
dans l’event EntityConstructing ? -
Non, avec un autre event
GuiOpenEvent. -
draw screen n’est pas appellé dans le gui
:package fr.eno.pyrion.gui.inventory; import java.io.IOException; import fr.eno.pyrion.gui.container.ContainerPlayerCustom; import fr.eno.pyrion.utils.References; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButtonImage; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainerCreative; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.gui.recipebook.GuiRecipeBook; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.InventoryEffectRenderer; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.resources.I18n; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ClickType; import net.minecraft.inventory.ContainerPlayer; import net.minecraft.inventory.Slot; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiInventoryPlayer extends InventoryEffectRenderer { /** The location of the inventory background texture */ public static final ResourceLocation INVENTORY = new ResourceLocation(References.MOD_ID, "textures/gui/container/inventory.png"); /** The old x position of the mouse pointer */ private float oldMouseX; /** The old y position of the mouse pointer */ private float oldMouseY; private GuiButtonImage recipeButton; private boolean widthTooNarrow; private boolean buttonClicked; public GuiInventoryPlayer(EntityPlayer player) { super(player.inventoryContainer); this.allowUserInput = true; System.out.println("GuiInventoryPlayer"); } /** * Called from the main game loop to update the screen. */ public void updateScreen() { if (this.mc.playerController.isInCreativeMode()) { this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.player)); } } /** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ @Override public void initGui() { System.out.println("initGui"); this.buttonList.clear(); if (this.mc.playerController.isInCreativeMode()) { this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.player)); } else { super.initGui(); } this.widthTooNarrow = this.width < 379; } /** * Draw the foreground layer for the GuiContainer (everything in front of the items) */ protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.fontRenderer.drawString(I18n.format("container.crafting"), 97, 8, 4210752); } /** * Draws the screen and all the components in it. */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); this.renderHoveredToolTip(mouseX, mouseY); this.oldMouseX = (float)mouseX; this.oldMouseY = (float)mouseY; System.out.println("drawScreen"); } /** * Draws the background layer of this container (behind the items). */ protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(INVENTORY); int i = this.guiLeft; int j = this.guiTop; this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); drawEntityOnScreen(i + 51, j + 75, 30, (float)(i + 51) - this.oldMouseX, (float)(j + 75 - 50) - this.oldMouseY, this.mc.player); System.out.println("draw gui container background layer"); } /** * Draws an entity on the screen looking toward the cursor. */ public static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent) { GlStateManager.enableColorMaterial(); GlStateManager.pushMatrix(); GlStateManager.translate((float)posX, (float)posY, 50.0F); GlStateManager.scale((float)(-scale), (float)scale, (float)scale); GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); float f = ent.renderYawOffset; float f1 = ent.rotationYaw; float f2 = ent.rotationPitch; float f3 = ent.prevRotationYawHead; float f4 = ent.rotationYawHead; GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F); RenderHelper.enableStandardItemLighting(); GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(-((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F); ent.renderYawOffset = (float)Math.atan((double)(mouseX / 40.0F)) * 20.0F; ent.rotationYaw = (float)Math.atan((double)(mouseX / 40.0F)) * 40.0F; ent.rotationPitch = -((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F; ent.rotationYawHead = ent.rotationYaw; ent.prevRotationYawHead = ent.rotationYaw; GlStateManager.translate(0.0F, 0.0F, 0.0F); RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); rendermanager.setPlayerViewY(180.0F); rendermanager.setRenderShadow(false); rendermanager.renderEntity(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false); rendermanager.setRenderShadow(true); ent.renderYawOffset = f; ent.rotationYaw = f1; ent.rotationPitch = f2; ent.prevRotationYawHead = f3; ent.rotationYawHead = f4; GlStateManager.popMatrix(); RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); GlStateManager.disableTexture2D(); GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); } /** * Test if the 2D point is in a rectangle (relative to the GUI). Args : rectX, rectY, rectWidth, rectHeight, pointX, * pointY */ protected boolean isPointInRegion(int rectX, int rectY, int rectWidth, int rectHeight, int pointX, int pointY) { return false; } /** * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton */ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { } /** * Called when a mouse button is released. */ protected void mouseReleased(int mouseX, int mouseY, int state) { if (this.buttonClicked) { this.buttonClicked = false; } else { super.mouseReleased(mouseX, mouseY, state); } } protected boolean hasClickedOutside(int p_193983_1_, int p_193983_2_, int p_193983_3_, int p_193983_4_) { boolean flag = p_193983_1_ < p_193983_3_ || p_193983_2_ < p_193983_4_ || p_193983_1_ >= p_193983_3_ + this.xSize || p_193983_2_ >= p_193983_4_ + this.ySize; return flag; } /** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { } /** * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code) */ protected void keyTyped(char typedChar, int keyCode) throws IOException { } /** * Called when the mouse is clicked over a slot or outside the gui. */ protected void handleMouseClick(Slot slotIn, int slotId, int mouseButton, ClickType type) { super.handleMouseClick(slotIn, slotId, mouseButton, type); } /** * Called when the screen is unloaded. Used to disable keyboard repeat events */ public void onGuiClosed() { super.onGuiClosed(); } }Event :
@SubscribeEvent public static void onEntityConstructing(EntityConstructing event) { if(event.getEntity() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)event.getEntity(); Container containerPlayer = new ContainerPlayerCustom(player.inventory, player.world.isRemote, player); EventRandoms.containerPlayer = containerPlayer; player.openContainer = containerPlayer; player.inventoryContainer = containerPlayer; player.inventory = new InventoryPlayer(player); System.out.println("Inv Modifié !"); } else { System.out.println("Entity Constructing !"); } } @SubscribeEvent public static void onGuiOpen(GuiOpenEvent event) { EntityPlayer player = MC.player; if(event.getGui() != null && event.getGui() instanceof GuiInventory) { //event.setCanceled(true); System.out.println("gui Inv Player"); MC.displayGuiScreen(new GuiInventoryPlayer(player)); } }Logs :
[17:20:31] [Server thread/INFO] [minecraft/IntegratedServer]: Changing view distance to 16, from 10 [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:36]: container Custom [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:50]: slots crafting [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:50]: slots crafting [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:50]: slots crafting [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:50]: slots crafting [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:57]: slots armor [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:57]: slots armor [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:57]: slots armor [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:57]: slots armor [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.gui.inventory.InventoryPlayer:<init>:56]: Inventory Player [17:20:32] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:41]: Inv Modifié ! [17:20:33] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2 [17:20:33] [Netty Server IO #1/INFO] [FML]: Client protocol version 2 [17:20:33] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : minecraft@1.12.2,pyrion@1.0.0,FML@8.0.99.99,forge@14.23.5.2768,mcp@9.42 [17:20:33] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established [17:20:33] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established [17:20:34] [Server thread/INFO] [minecraft/PlayerList]: Eno_gamer10[local:E:055f8c03] logged in with entity id 0 at (162.57877717409193, 11.0, 12.20632199898026) [17:20:34] [Server thread/INFO] [minecraft/MinecraftServer]: Eno_gamer10 a rejoint la partie [17:20:35] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:45]: Entity Constructing ! [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:36]: container Custom [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:50]: slots crafting [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:50]: slots crafting [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:50]: slots crafting [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:50]: slots crafting [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:57]: slots armor [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:57]: slots armor [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:57]: slots armor [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:57]: slots armor [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:45]: Entity Constructing ! [17:20:36] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:45]: Entity Constructing ! [17:20:36] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:45]: Entity Constructing ! [17:20:36] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:45]: Entity Constructing ! [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:45]: Entity Constructing ! [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.container.ContainerPlayerCustom:<init>:98]: slots inventory [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.inventory.InventoryPlayer:<init>:56]: Inventory Player [17:20:36] [main/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:41]: Inv Modifié ! [17:20:36] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game... [17:20:37] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'py-gen'/overworld [17:20:37] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Did the system time change, or is the server overloaded? Running 2995ms behind, skipping 59 tick(s) [17:20:38] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:45]: Entity Constructing ! [17:20:38] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:45]: Entity Constructing ! [17:20:38] [Server thread/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onEntityConstructing:45]: Entity Constructing ! [17:20:38] [main/INFO] [minecraft/AdvancementList]: Loaded 488 advancements [17:20:40] [pool-2-thread-1/WARN] [mojang/YggdrasilMinecraftSessionService]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@391e3e83[id=43d2a483-f574-3b67-b46e-011d0580b1d7,name=Eno_gamer10,properties={},legacy=false] com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) [guava-21.0.jar:?] at com.google.common.cache.LocalCache.get(LocalCache.java:4154) [guava-21.0.jar:?] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147) [guava-21.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153) [guava-21.0.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?] at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3181) [Minecraft.class:?] at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [SkinManager$3.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_211] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_211] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_211] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_211] at java.lang.Thread.run(Unknown Source) [?:1.8.0_211] [17:20:43] [main/INFO] [STDOUT]: [fr.eno.pyrion.events.EventRandoms:onGuiOpen:57]: gui Inv Player [17:20:43] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.inventory.GuiInventoryPlayer:<init>:46]: GuiInventoryPlayer [17:20:43] [main/INFO] [STDOUT]: [fr.eno.pyrion.gui.inventory.GuiInventoryPlayer:initGui:67]: initGui -
Là comme ça je ne serais pas te dire d’où vient ton problème, le mieux serait que j’ai tout le code pour regarder de mon côté sur eclipse, mais j’ai pas vraiment le temps pour ça

-
oui je comprends, merci déja de m’avoir indiquer la bonne voie
