Краш при открытий GUI

Иногда при открытий GUI моего предмета майн вылетает а в консоле , совершенно ничего не говорящая ошибка:


Код:
net.minecraft.util.ReportedException: Ticking memory connection
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) ~[MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) ~[MinecraftServer.class:?]
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[IntegratedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
Caused by: java.lang.NullPointerException
    at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:657) ~[NetHandlerPlayServer.class:?]
    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) ~[C08PacketPlayerBlockPlacement.class:?]
    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) ~[C08PacketPlayerBlockPlacement.class:?]
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) ~[NetworkManager.class:?]
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]
    ... 5 more
[11:52:35] [Server thread/ERROR]: This crash report has been saved to: D:\forge\forge 1.7.10 1492 rebuild\eclipse\.\crash-reports\crash-2016-04-05_11.52.35-server.txt
[11:52:35] [Server thread/INFO]: Stopping server
[11:52:35] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----
// Who set us up the TNT?

Time: 05.04.16 11:52
Description: Ticking memory connection

java.lang.NullPointerException: Ticking memory connection
    at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:657)
    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74)
    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
    at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:657)
    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74)
    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)

-- Ticking connection --
Details:
    Connection: net.minecraft.network.NetworkManager@1ac67250
Stacktrace:
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)

Container:
Код:
public class ContainerBuilder extends Container {
    
    public InventoryPlayer inventory;
    
    public ContainerBuilder(InventoryPlayer inv)
    {
        this.inventory = inv;
    }

    @Override
    public boolean canInteractWith(EntityPlayer p_75145_1_) {
        return true;
    }
    //anti-crash lines
    @Override
    public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
    {
        return null;
    }
    
    public void addCraftingToCrafters(ICrafting p_75132_1_)
    {
        
    }
    
    public Slot getSlot(int p_75139_1_)
    {
        return null;
    }
    
    public ItemStack slotClick(int p_75144_1_, int p_75144_2_, int p_75144_3_, EntityPlayer p_75144_4_)
    {
        return null;
    }
    
    public void putStacksInSlots(ItemStack[] p_75131_1_)
    {
    }
    
    public void putStackInSlot(int p_75141_1_, ItemStack p_75141_2_)
    {
    }
    
    protected boolean mergeItemStack(ItemStack p_75135_1_, int p_75135_2_, int p_75135_3_, boolean p_75135_4_)
    {
        return false;
    }
    
    public boolean canDragIntoSlot(Slot p_94531_1_)
    {
        return false;
    }
    
    public List getInventory()
    {
    return null;        
    }
    
    @Override
    public void onContainerClosed(EntityPlayer p_75134_1_) {
        super.onContainerClosed(p_75134_1_);
        
    }

}

GUI:
Код:
public class GuiBuilder extends GuiContainer {
    private InventoryPlayer inventory;
    
    public static Map strucutures = new HashMap<Integer, Structure>();

    private ResourceLocation texture = new ResourceLocation(GliderModInfo.ModTestures, "textures/Builder.png");
    private int Xsize = 224;
    private int Ysize = 160;
    private int x;
    private int y;
    private int z;
    private ForgeDirection Ndir;
    private int Bid;
    private int STRlastid = -1;
    private int rot = 0;
    public static Map AstG = new HashMap<String, Integer>();
    public Map Ast = new HashMap<Integer, Structure>();
    
     protected MovingObjectPosition getMovingObjectPositionFromPlayer(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_)
        {
            float f = 1.0F;
            float f1 = p_77621_2_.prevRotationPitch + (p_77621_2_.rotationPitch - p_77621_2_.prevRotationPitch) * f;
            float f2 = p_77621_2_.prevRotationYaw + (p_77621_2_.rotationYaw - p_77621_2_.prevRotationYaw) * f;
            double d0 = p_77621_2_.prevPosX + (p_77621_2_.posX - p_77621_2_.prevPosX) * (double)f;
            double d1 = p_77621_2_.prevPosY + (p_77621_2_.posY - p_77621_2_.prevPosY) * (double)f + (double)(p_77621_1_.isRemote ? p_77621_2_.getEyeHeight() - p_77621_2_.getDefaultEyeHeight() : p_77621_2_.getEyeHeight()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences
            double d2 = p_77621_2_.prevPosZ + (p_77621_2_.posZ - p_77621_2_.prevPosZ) * (double)f;
            Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2);
            float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI);
            float f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI);
            float f5 = -MathHelper.cos(-f1 * 0.017453292F);
            float f6 = MathHelper.sin(-f1 * 0.017453292F);
            float f7 = f4 * f5;
            float f8 = f3 * f5;
            double d3 = 5.0D;
            if (p_77621_2_ instanceof EntityPlayerMP)
            {
                d3 = ((EntityPlayerMP)p_77621_2_).theItemInWorldManager.getBlockReachDistance();
            }
            Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3);
            return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false);
        }
    
    public GuiBuilder(EntityPlayer player) {
        super(new ContainerBuilder(player.inventory));
        MovingObjectPosition mop = getMovingObjectPositionFromPlayer((World)Minecraft.getMinecraft().theWorld, player, false);
        x = mop.blockX;
        y = mop.blockY;
        z = mop.blockZ;
        Ndir = ForgeDirection.getOrientation(mop.sideHit).getOpposite();
        if (Ndir == ForgeDirection.EAST)
        {
            x = x - 1;
        }else if (Ndir == ForgeDirection.WEST)
        {
            x = x + 1;
        }else if (Ndir == ForgeDirection.SOUTH)
        {
            z = z - 1;
        }else if (Ndir == ForgeDirection.NORTH)
        {
            z = z + 1;
        }
        inventory = player.inventory;
    }
    
    

    public static String HOLLID = "hall";
    public static String CORNERID = "corner";
    public static String CROSSROADID = "crossroad";
    public static String HALLAIRLOCKID = "hallairlock";
    public static String WINDOWID = "window";
    public static String CUPOLAID = "cupola";
    public static String DOCKPORTID = "dockport";
    public static String SOLARPANELID = "solarpanel";
    public static String THALLID = "thall";
    public static String BIGHHALL = "bighall";
    
    
    public static void init()
    {
        RegisterStructure(0,new StructureHoll(false));
        RegisterStructure(1, new StructureCornerHall(false),0);
        RegisterStructure(2, new StructureCrossroad(false));
        RegisterStructure(3, new StructureHallWAirlock(false));
        RegisterStructure(4, new StructureWindow(false),0);
        RegisterStructure(5, new StructureCupola(false));
        RegisterStructure(6, new StructureDockingPort(false));
        RegisterStructure(7, new StructureSolarPanel(false));
        RegisterStructure(8, new StructureThall(false),0);
        RegisterStructure(9, new StructureBigHall(false),0);
    }
    
    public static void RegisterStructure(int id, Structure strc)
    {
        strucutures.put(id, strc);
    }
    
    public static void RegisterStructure(int id, StructureRotatable strc,int rot)
    {
        strc.setRotation(rot);
        strucutures.put(id, strc);
    }
    
    private int getLines(int size)
    {
        if (size < 3)
        {
            return 0;
        }else if (size > 2 && size < 6)
        {
            return 1;
        }else if (size > 5)
        {
            return 2;
        }
        return 0;
    }
    

            
    @Override
    public void initGui() {
        AstG.clear();
        Ast.clear();
        boolean disp;
        
        int x = (width - Xsize-40) / 2;
        int y = (height - Ysize) / 2;

        
                for (int a=0;a < strucutures.size();a++)
                {
                    World world = (World)Minecraft.getMinecraft().theWorld;
                    if (((Structure)strucutures.get(a)).Check(world, Ndir, x, y, z))
                    {
                        Ast.put(Ast.size(), ((Structure)strucutures.get(a)));
                    }
                }
        int xm = 0;
        int ym = 0;
                
        for (int i=0;i < Ast.size();i++)
        {
            ym = getLines(i);
            xm = i - (ym*3);
            GLoger.logInfo(xm+" "+ym+" "+i);
            buttonList.add(new GuiButtonBulder(i, x + 12 +((xm)*68), y +22  + (ym*38), ((Structure)Ast.get(i)).getName()));
            ((GuiButtonBulder)buttonList.get(i)).setDirection(Ndir);
            AstG.put(((Structure)Ast.get(i)).getUnlocalizedName(),i);
            Bid++;    
        }
        buttonList.add(new GuiButton(Bid, x + 159, y + 135,40,20, "Build"));
        
        super.initGui();
    }
    
    public boolean compareItems(ItemStack[] is)
    {
        int Ifinded = 0;
        
        for (int iss=0;iss < is.length;iss++)
        {
        for (int i=0;i < inventory.getSizeInventory();i++)
        {
            if (inventory.getStackInSlot(i) == is[iss])
            {
                Ifinded++;
            }
        }
        }
        if (Ifinded == is.length) return true;
        return false;
    }
    
    @Override
    protected void actionPerformed(GuiButton button) {
        super.actionPerformed(button);
        if (button.id == Bid)
        {
        if (STRlastid != -1)
        {
            boolean send = false;
            if (((Structure)Ast.get(STRlastid)).getRequiredItems() != null)
            {
                if (compareItems(((Structure)Ast.get(STRlastid)).getRequiredItems()))
                {
                    send = true;
                }
            }else send = true;
                
            if (send)
            {
            PacketHandler.sendToServer(new BuildPacket(Ndir,((Structure)Ast.get(STRlastid)).getUnlocalizedName(),x,y,z,rot));
            GLoger.logInfo("Sending packet");
            Minecraft.getMinecraft().displayGuiScreen(null);
            }
        }
        }else
        {
            

            if (STRlastid == button.id)
            {
            rot = ((GuiButtonBulder)button).rot;
            if (Ast.get(STRlastid) instanceof StructureRotatable)
            {
                int N;
            for (int i = rot+1;i<5+rot;i++)
            {
            if (i >= 4) 
            N = (i - 4);
            else
            N = i;
            if (((StructureRotatable)Ast.get(STRlastid)).isPossible(Ndir,N)) 
            {
            rot = N; 
            break;
            }
            }
            ((GuiButtonBulder)button).setRotation(rot);
            }
            }else
            {
            if (STRlastid != -1)
            {
             ((GuiButtonBulder)buttonList.get(STRlastid)).setEnabled(false);
            
            }
            
            STRlastid = button.id;
            ((GuiButtonBulder)button).setEnabled(true);
            if (AstG.containsKey(GuiBuilder.CORNERID) && button.id == (int)AstG.get(GuiBuilder.CORNERID))
            {
                if (Ndir == ForgeDirection.EAST)
                {
                    rot = 2;
                }else if (Ndir == ForgeDirection.NORTH)
                {
                    rot = 1;
                }
            }else if (GuiBuilder.AstG.containsKey(GuiBuilder.THALLID) && button.id == (int)GuiBuilder.AstG.get(GuiBuilder.THALLID) )
            {
                if (Ndir == ForgeDirection.NORTH) rot = 1;
            }
            ((GuiButtonBulder)button).setRotation(rot);
            }
        }
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float p_146976_1_,int p_146976_2_, int p_146976_3_) {
        Minecraft.getMinecraft().renderEngine.bindTexture(texture);

        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); 
 
        int x = (width - Xsize-40) / 2;
        int y = (height - Ysize) / 2;
        drawTexturedModalRect(x, y, 0, 0, Xsize, Ysize);
        

            
        
    }
    
    @Override
    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    {
       
       fontRendererObj.drawString(StatCollector.translateToLocal("builder.name"), (int)(xSize /4.5D) - (fontRendererObj.getStringWidth(I18n.format("builder.name")) / 2) - 20, 10, 4210752, false);
    }


}

Сам не могу понять в чем дело. GUI без слотов.
 

timaxa007

Модератор
5,831
409
672
А GuiHandler правельно сделал и зарегистрировал?
 
Код:
public class GuiHandler implements IGuiHandler
{
    
    public static final int BUILDERGUI = 0;
    
    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) 
    { 
        TileEntity te = world.getTileEntity(x, y, z);
 

            switch (ID)
            {
            case BUILDERGUI:
                return new ContainerBuilder(player.inventory);
            }

     
        return null;
    }
    
    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
        TileEntity te = world.getTileEntity(x, y, z);
 
        
            
            switch (ID)
            {
            case BUILDERGUI:
                return new GuiBuilder(player);
            }
        
        return null;
    }
}

Регистрация, в главном классе:
NetworkRegistry.INSTANCE.registerGuiHandler(this.instance, new GuiHandler());
 

timaxa007

Модератор
5,831
409
672
Трудно предположить, учитывая что есть у тебя свои классы. Если их закомментировать, то получиться вот:

---
Код:
[11:52:35] [Server thread/ERROR]: This crash report has been saved to: D:\forge\forge 1.7.10 1492 rebuild\eclipse\.\crash-reports\crash-2016-04-05_11.52.35-server.txt
То что он ругается на сервер при открытии этого GUI странно, хотя возможно где-то в другом может быть ошибка.
 
в том то и дело. GUI работает, но в рандомные моменты любит вот так скрашить(лог в верхнем посте). а из крашлога ничего говоряшего что не так, не вытянешь.
я предполагаю что дело в контейнере тк до этого были и другие краши связанные с ним, которые я убрал добавив в него пустые методы.
 

timaxa007

Модератор
5,831
409
672
kremnev8 написал(а):
в рандомные моменты любит вот так скрашить
Хм... Т.е. не только при открытии GUI окна. Тогда не обязательно, что сам GUI крашиться. А ты уверен, что пакет отправляется правельно и так-же правельно этот пакет обрабатывается?
 
Если ты про этот пакет:
Код:
PacketHandler.sendToServer(new BuildPacket(Ndir,((Structure)Ast.get(STRlastid)).getUnlocalizedName(),x,y,z,rot));

то он отправляется по нажатию кнопки Build и он точно работает хорошо, без крашей.

а краши бывают когда я нажимаю на кастомные кнопки:
AJFbzMv.png
 

timaxa007

Модератор
5,831
409
672
kremnev8 написал(а):
на кастомные кнопки
Ты имеешь виду про кнопки от NEI? Ну в этом случаи я не знаю как исправлять.
 
нет , большие с текстом и иконкой которые

Класс кнопки
Код:
@SideOnly(Side.CLIENT)
public class GuiButtonBulder extends GuiButton
{
    protected static final ResourceLocation buttonTextures = new ResourceLocation(GliderModInfo.ModTestures, "textures/Builder.png");
    /** Button width in pixels */
    public int width = 64;
    /** Button height in pixels */
    public int height = 32;
    /** The x position of this control. */
    public int xPosition;
    /** The y position of this control. */
    public int yPosition;
    /** The string displayed on this control. */
    public String displayString;
    public int id;
    /** True if this control is enabled, false to disable. */
    public boolean enabled;
    /** Hides the button completely if false. */
    public boolean visible;    
    protected boolean field_146123_n;
    private static final String __OBFID = "CL_00000668";
    public int packedFGColour;
    private boolean Enabled;
    
    public int rot = 0;
    private ForgeDirection dir = ForgeDirection.UNKNOWN;
    
    

    public GuiButtonBulder(int id, int xpos, int ypos, String Dispstring)
    {
        super(id, xpos, ypos, 64, 32, Dispstring);
        super.visible = false;
        this.enabled = true;
        this.visible = true;
        this.id = id;
        this.xPosition = xpos;
        this.yPosition = ypos;
        this.displayString = Dispstring;
    }

    public void setEnabled(boolean e)
    {
        this.Enabled = e;
    }
    
    public void setRotation(int rot)
    {
        this.rot = rot;
    }
    public void setDirection(ForgeDirection dir)
    {
        this.dir = dir;
    }

    /**
     * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over
     * this button.
     */
    public int getHoverState(boolean p_146114_1_)
    {
        byte b0 = 1;

        if (!this.enabled)
        {
            b0 = 0;
        }
        else if (p_146114_1_)
        {
            b0 = 2;
        }

        return b0;
    }

    /**
     * Draws this button to the screen.
     */
    public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_)
    {
        if (this.visible)
        {
            FontRenderer fontrenderer = p_146112_1_.fontRenderer;
            p_146112_1_.getTextureManager().bindTexture(buttonTextures);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            this.field_146123_n = p_146112_2_ >= this.xPosition && p_146112_3_ >= this.yPosition && p_146112_2_ < this.xPosition + this.width && p_146112_3_ < this.yPosition + this.height;
            int k = this.getHoverState(this.field_146123_n);
            GL11.glEnable(GL11.GL_BLEND);
            OpenGlHelper.glBlendFunc(770, 771, 1, 0);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            if (!Enabled)
            {
            this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 162, this.width , this.height+2);
            }else if (!this.field_146123_n)
            {
            this.drawTexturedModalRect(this.xPosition, this.yPosition, 160, 162, this.width , this.height+2);
            }else
            this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 196, this.width, this.height+2);
            
           // GLoger.logInfo(dir+" "+rot+" "+id);
            
            renderIcons();
            
            this.mouseDragged(p_146112_1_, p_146112_2_, p_146112_3_);
            int l = 14737632;

            if (packedFGColour != 0)
            {
                l = packedFGColour;
            }
            else if (!this.enabled)
            {
                l = 10526880;
            }
            else if (this.field_146123_n)
            {
                l = 16777120;
            }
          // while (true)
         //  {
         //  GLoger.logInfo(Minecraft.getMinecraft().getLanguageManager().getLanguages().iterator().next());
         //  if (Minecraft.getMinecraft().getLanguageManager().getLanguages().iterator().hasNext())
         //  {
        //       break;
          // }
         //  }
            int a;
            if (Minecraft.getMinecraft().getLanguageManager().isCurrentLocaleUnicode())
                a = 5;
            else
                a = 0;
           
            this.drawString(fontrenderer, this.displayString, (this.xPosition + this.width / 2 - this.displayString.length()*3)+a, this.yPosition + (this.height - 8) - 3 / 2, l);
            
          //  this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
        }
    }
    
    private void renderIcons()
    {
        if (GuiBuilder.AstG.size() != 0)
        {
        if (GuiBuilder.AstG.containsKey(GuiBuilder.HOLLID) && id == (int)GuiBuilder.AstG.get(GuiBuilder.HOLLID))
        {
        this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 162, 16 , 16);
        }else if (GuiBuilder.AstG.containsKey(GuiBuilder.CORNERID) && id == (int)GuiBuilder.AstG.get(GuiBuilder.CORNERID))
        {
        if (dir == ForgeDirection.WEST)
        {
            if (rot == 0)
            {
                this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 180, 16 , 16);
            }else if (rot == 1)
            {
                this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 84, 180, 16 , 16);
            }
        }else if (dir == ForgeDirection.EAST)
        {
            if (rot == 2)
            {
                this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 180, 16 , 16);
            }else if (rot == 3)
            {
                this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 84, 180, 16 , 16);
            }else 
            {
             this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 180, 16 , 16);
            }
        }else if (dir == ForgeDirection.NORTH)
        {
            if (rot == 1)
            {
                this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 180, 16 , 16);
            }else if (rot == 2)
            {
                this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 84, 180, 16 , 16);
            }else 
            {
            this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 180, 16 , 16);
            }
        }else if (dir == ForgeDirection.SOUTH)
        {
            if (rot == 0)
            {
                this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 180, 16 , 16);
            }else if (rot == 3)
            {
                this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 84, 180, 16 , 16);
            }
        }
        }else if (GuiBuilder.AstG.containsKey(GuiBuilder.CROSSROADID) && id == (int)GuiBuilder.AstG.get(GuiBuilder.CROSSROADID) )
        {
            this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 102, 162, 16 , 16);
        }else if (GuiBuilder.AstG.containsKey(GuiBuilder.HALLAIRLOCKID) && id == (int)GuiBuilder.AstG.get(GuiBuilder.HALLAIRLOCKID))
        {
            this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 198, 16 , 16);
        }else if (GuiBuilder.AstG.containsKey(GuiBuilder.WINDOWID) && id == (int)GuiBuilder.AstG.get(GuiBuilder.WINDOWID) )
        {
            if (rot == 0)
            {
            this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 216, 16 , 16);
            }else if (rot == 1)
            {
            this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 102, 198, 16 , 16);
            }
        }else if (GuiBuilder.AstG.containsKey(GuiBuilder.CUPOLAID) && id == (int)GuiBuilder.AstG.get(GuiBuilder.CUPOLAID) )
        {
            this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 120, 162, 16 , 16);
        }else if (GuiBuilder.AstG.containsKey(GuiBuilder.DOCKPORTID) && id == (int)GuiBuilder.AstG.get(GuiBuilder.DOCKPORTID) )
        {
            this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 84, 216, 16 , 16);
        }else if (GuiBuilder.AstG.containsKey(GuiBuilder.SOLARPANELID) && id == (int)GuiBuilder.AstG.get(GuiBuilder.SOLARPANELID) )
        {
            if (rot == 0)
            {
            this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 102, 216, 16 , 16);
            }else if (rot == 1)
            {
            this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 120, 216, 16 , 16);
            }
        }else if (GuiBuilder.AstG.containsKey(GuiBuilder.THALLID) && id == (int)GuiBuilder.AstG.get(GuiBuilder.THALLID) )
        {
            if (dir == ForgeDirection.WEST)
            {
                if (rot == 0)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 234, 16 , 16);
                }else if (rot == 1)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 84, 234, 16 , 16);
                }else if (rot == 2)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 102, 234, 16 , 16);
                }
            }else if (dir == ForgeDirection.EAST)
            {
                if (rot == 0)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 234, 16 , 16);
                }else if (rot == 2)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 84, 234, 16 , 16);
                }else if (rot == 3)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 102, 234, 16 , 16);
                }
            }else if (dir == ForgeDirection.NORTH)
            {
                if (rot == 1)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 234, 16 , 16);
                }else if (rot == 2)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 84, 234, 16 , 16);
                }else if (rot == 3)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 102, 234, 16 , 16);
                }else
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 234, 16 , 16);
                }
            }else if (dir == ForgeDirection.SOUTH)
            {
                if (rot == 0)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 66, 234, 16 , 16);
                }else if (rot == 1)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 84, 234, 16 , 16);
                }else if (rot == 3)
                {
                    this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 102, 234, 16 , 16);
                }
            }
        }else if (GuiBuilder.AstG.containsKey(GuiBuilder.BIGHHALL) && id == (int)GuiBuilder.AstG.get(GuiBuilder.BIGHHALL) )
        {
             if (rot == 0)
             {
                 this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 154, 234, 16 , 16);
             }else if (rot == 1)
             {
                 this.drawTexturedModalRect(this.xPosition+3, this.yPosition+3, 138, 234, 16 , 16);
             }
        }
        }
    }

    /**
     * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).
     */
    protected void mouseDragged(Minecraft p_146119_1_, int p_146119_2_, int p_146119_3_) {}

    /**
     * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e).
     */
    public void mouseReleased(int p_146118_1_, int p_146118_2_) {}

    /**
     * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent
     * e).
     */
    public boolean mousePressed(Minecraft p_146116_1_, int p_146116_2_, int p_146116_3_)
    {
        return this.enabled && this.visible && p_146116_2_ >= this.xPosition && p_146116_3_ >= this.yPosition && p_146116_2_ < this.xPosition + this.width && p_146116_3_ < this.yPosition + this.height;
    }

    public boolean func_146115_a()
    {
        return this.field_146123_n;
    }

    public void func_146111_b(int p_146111_1_, int p_146111_2_) {}

    public void func_146113_a(SoundHandler p_146113_1_)
    {
        p_146113_1_.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
    }

    public int getButtonWidth()
    {
        return this.width;
    }

    public int func_154310_c()
    {
        return this.height;
    }
}
 
timaxa007 написал(а):
Хм... Т.е. не только при открытии GUI окна.

нет конкретно эту ошибку я фиксирую при открытий GUI.

Только что пытался ее специально поймать. Если двигать курсор по блоку(мой GUI открывается только на спец. блоке), то через 5-6 открытий она выскакивала. иначе ошибка не появляется вообше.

Судя по всему из-за постоянного движения курсора за время пока майн обработает открытие, курсор сходил с блока.

Хотя в GUI поставил проверки на null MovingObjectPosition'а ошибка по прежнему появляется.
 
Сверху