Как расширить инвентарь? Буквально расширить по бокам.

Статус
В этой теме нельзя размещать новые ответы.
Версия Minecraft
1.7.10
173
1
3
Сделал вот свой инвентарь, всё работает, все слоты работают. 
Только вот кажется остались у этого инвентаря рамки стандартного. То есть, когда я выношу предмет за эти невидимые границы, он выпадает. Как буквально расширить инвентарь?

Наглядно:
Так предмет НЕ выпадает


А так предмет выпадает:



Писал инвентарь по туториалу coolAlias'a ссылка

P.S Выпадает и с другой стороны гуи, да.
P.P.S Он падает не только со слота, он падает и просто при тыке предметом на пустые места гуишки
 
173
1
3
Если не лень разбираться в 1000 строках :Р
Добавил в первом сообщении
 
173
1
3
Дальше читать надо -_-
У него там всё есть для 1.7.10 и 1.8, в самом конце написано что нужно изменить
 
173
1
3
Проблема вроде похожая, но я не понял :D

Гуишка то у меня реализована и отцентрована, как так получилось, что ее на самом деле нет? 0_0

Вот код:
Код:
public class GuiCustomPlayerInventory extends GuiContainer
{
    /** x size of the inventory window in pixels. Defined as float, passed as int */
    private float xSize_lo;

    /** y size of the inventory window in pixels. Defined as float, passed as int. */
    private float ySize_lo;

    /** Normally I use '(ModInfo.MOD_ID, "textures/...")', but it can be done this way as well */
    private static final ResourceLocation iconLocation = new ResourceLocation("main:textures/gui/custom_inventory.png");

    /** Could use IInventory type to be more generic, but this way will save an import... */
    private final InventoryCustomPlayer inventory;

    public GuiCustomPlayerInventory(EntityPlayer player, InventoryPlayer inventoryPlayer, InventoryCustomPlayer

            inventoryCustom)
    {
        super(new ContainerCustomPlayer(player, inventoryPlayer, inventoryCustom));
        this.inventory = inventoryCustom;
        // if you need the player for something later on, store it in a local variable here as well
    }

    /**
     * Draws the screen and all the components in it.
     */
    public void drawScreen(int mouseX, int mouseY, float f)
    {
        super.drawScreen(mouseX, mouseY, f);
        xSize_lo = mouseX;
        ySize_lo = mouseY;
    }

    /**
     * Draw the foreground layer for the GuiContainer (everything in front of the items)
     */
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
    {
        // This method will simply draw inventory names on the screen - you could do without it entirely
        // if that's not important to you, since we are overriding the default inventory rather than
        // creating a specific type of inventory

        String s = this.inventory.hasCustomInventoryName() ? this.inventory.getInventoryName() : I18n.format(this.inventory.getInventoryName());
        // with the name "Custom Inventory", the 'Cu' will be drawn in the first slot
       // this.fontRendererObj.drawString(s, this.xSize - this.fontRendererObj.getStringWidth(s), 12, 4210752);
        // this just adds "Inventory" above the player's inventory below
       // this.fontRendererObj.drawString(I18n.format("container.inventory"), 80, this.ySize - 96, 4210752);
    }

    /**
     * Draw the background layer for the GuiContainer (everything behind the items)
     */
    protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY)
    {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        mc.getTextureManager().bindTexture(iconLocation);
        drawTexturedModalRect(guiLeft - 41, guiTop, 0, 0, 256, ySize);
        drawPlayerModel(guiLeft + 2, guiTop + 75 + 20, 45, guiLeft + 51 - xSize_lo, guiTop + 25 - ySize_lo, mc.thePlayer);
    }
 

Вложения

  • 2016-07-28_19.56.42.png
    2016-07-28_19.56.42.png
    130.3 KB · Просмотры: 49
173
1
3
Всё, решено. CMTV был прав, просто у анти там как-то очень образно описано решение проблемы :)
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху