[1.7.10] Не срабатывает GUI. И пару вопросов про initGUI();

Статус
В этой теме нельзя размещать новые ответы.
Собственно проблема описана в названий темы, не срабатывает GUI после использования предмета.
Коды файлов:
ClientProxy.
Код:
package last2424.mods.***.gui;





import net.minecraft.entity.player.EntityPlayer;


import net.minecraft.tileentity.TileEntity;


import net.minecraft.world.World;





public class ClientProxy extends CommonProxy


{


@Override


public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)


{


TileEntity tileEntity = world.getTileEntity(x, y, z);


if (tileEntity != null)


{


switch(ID)


{


case 0: /* your GUIs go here */


}


}


return tileEntity;





}


}

CommonProxy.

Код:
package last2424.mods.***.gui;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;

public class CommonProxy implements IGuiHandler
{
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
return null;
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);

if(tileEntity != null)
{
switch(ID)
{
case 0: /* your Containers go here*/
}
}
return tileEntity;
}


}

theBookofAllGui.

Код:
package last2424.mods.***.gui;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

public class theBookofAllGui extends GuiScreen {
    
    public final int xSizeOfTexture = 176;
    public final int ySizeOfTexture = 88;
    
    public ResourceLocation locationtexture = new ResourceLocation("/Block/changeColorGUI.png");
    
    public theBookofAllGui(EntityPlayer player)
    {

    }
    
    /*@Override
    public void initGui()
    {
        super.initGui();
       this.controlList.clear();

    int posX = (this.width - xSizeOfTexture) / 2;
    int posY = (this.height - ySizeOfTexture) / 2;

    this.controlList.add(new GuiButton(0, posX+ 40, posY + 40, 100, 20, "no use"));
    }*/
    
    @Override
    public void drawScreen(int x, int y, float f){
        
        drawDefaultBackground();
        
        ITextureObject var4 = this.mc.renderEngine.getTexture(locationtexture);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.getTexture((ResourceLocation) var4);

        int posX = (this.width - xSizeOfTexture) / 2;
        int posY = (this.height - ySizeOfTexture) / 2;

        drawTexturedModalRect(posX, posY, 0, 0, xSizeOfTexture, ySizeOfTexture);

        super.drawScreen(x, y, f);
        
    }
    
}

Вызов:
Код:
    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
    {
    player.openGui(mdc_main.instance, 3, world, 0, 0, 0);
    return itemstack;
    }

Делал по вот этому туториалу, понимаю он старый, но смысла искать что то другое нет, либо на официальной вики вроде как там написано тоже ещё нету нормального туториала по GUI.

Так же хотел узнать про initGUI, почему не работает controlList, чем его заменить надо.
 
В ClientProxy в методе getClientGuiElement нужно создавать экземпляр класса theBookofAllGui и его же возвращать.

Код:
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    return new theBookofAllGui(player);
}

Также необходимо зарегистрировать GuiHandler.
Это то что сразу в глаза бросилось.
Предвижу появление вопросов вроде: "А почему не сохраняется?". Необходимо понимать, что гуи работает на клиентской стороне, а все сохраняется на серверной стороне. И без дополнительных действий, ничего между гуи клиента и сервером передаваться не будет.
 
Удали из прокси всё про гуи.

В mdc_main.java добавь в метод modLoad(..)

Код:
NetworkRegistry.instance().registerGuiHandler(instance, new YourGuiHandler());

Создай класс YourGuiHandler.java

в него пиши:

Код:
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) 
{
    switch (ID)
    {
    case 0: return new YourServerGui();
    case 1: return new YourServerGui1(); // И т.д
    }
    return null;
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) 
{
    switch (ID)
    {
    case 0: return new YourClientGui();
    case 1: return new YourClientGui1(); // И т.д
    }
    return null;
}

Призыв Gui:

Код:
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
{
    player.openGui(mdc_main.instance, <То самое ID>, world, 0, 0, 0);
    return itemstack;
}
 
last24242 написал(а):
Код:
switch(ID)
{
case 0: /* your Containers go here*/
}
Я не ослеп?
*опущенное слово*.

Никогда не думал, что доживу до момента, когда кто-то всерьез будет думать, что написав комментарий в коде, тот магическим образом преобразуется в нужный код.
Ну ёклмн, вы когда копипаст делаете, голову вообще отрубаете, или что?
Нахера тогда в туториале помимо кода зачастую имеется какой-либо посторонний текст?
 
[font=Verdana, Helvetica, Arial, sans-serif]Oldestkon[/font]
Это мой способ обучения, в JAVA я не первый месяц, раньше писал маленькие игры на Swing и LibGDX, сейчас решил попробовать написать мод на майну.
P.S. зачем мне посторонний текст вообще читать если я его не понимаю?
Для меня GUI в Forge это невиданное "Аминь + Ё-маё вместе взятоё".

[font=Verdana, Helvetica, Arial, sans-serif]Slyfarmerjon, вы кажется не соображаете ничего в forge 1.7.10.[/font]



Код:
NetworkRegistry.instance().registerGuiHandler(instance, new YourGuiHandler());

Правильно будет.
Код:
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new CommonProxy());

Это вам не 1.6, сударь.

У меня уже есть класс с гуи хандлером, лол.

Ну а так в принципе спасибо, кажется я разобрался немного. :)

P.S. а вы думали я не зарегал хендлер?

P.P.S. case number:, number - это айди я так понял?

P.P.P.S. initGUI всё ещё под вопросом.
[merge_posts_bbcode]Добавлено: 08.09.2014 18:56:44[/merge_posts_bbcode]

Продолжим тему, ваш способ при открытий вообще у меня крашит мк.

main
Код:
package last2424.mods.***;

import last2424.mods.***.gui.ClientProxy;
import last2424.mods.***.gui.CommonProxy;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.*;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod ( modid = "**", name = "***", version = "0.1" )

public class mdc_main {
    
    
    @SidedProxy(clientSide = "last2424.mods.***.gui.ClientProxy", serverSide = "last2424.mods.***.gui.CommonProxy")

    @Instance("name")
    public static mdc_main instance;
    public static Item theBookofAll;
    
    @EventHandler
    public void preLoad(FMLPreInitializationEvent event){
        
        theBookofAll = new theBookofAll().setUnlocalizedName("The Book of All");
        GameRegistry.registerItem(theBookofAll, "The Book of All");
        
    }
    
    @EventHandler
    public void init(FMLPreInitializationEvent event){
        

    }
    
    @EventHandler
    public void modLoad(){
        
        NetworkRegistry.INSTANCE.registerGuiHandler(instance, new CommonProxy());
        
    }
    
}
commonproxy
Код:
package last2424.mods.***.gui;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;

public class CommonProxy implements IGuiHandler
{
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
       switch (ID)
        {
        case 100: return new theBookofAllGui(player);
        }
        return null;
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
      switch (ID)
        {
        case 100: return new theBookofAllGui(player);
        }
        return null;
}


}

ClientProxy
Код:
package last2424.mods.***.gui;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

public class ClientProxy extends CommonProxy
{
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
       switch (ID)
        {
        case 100: return new theBookofAllGui(player);
        }
        return null;

}
}

Вызов:
Код:
player.openGui(mdc_main.instance, 100, world, 0, 0, 0);

Сам гуи не менял.
 
Классы с маленькой буквы. Убило просто.
[merge_posts_bbcode]Добавлено: 08.09.2014 21:00:57[/merge_posts_bbcode]

И ты бы показывал краши, хотя-бы. И твое modLoad фордж не будет вызывать, ибо в его аргументах нет эвента. Скорей всего из за этого и крашит.
 
[font=Verdana, Helvetica, Arial, sans-serif]Dragon2488[/font]
а какой именно эвент?
[merge_posts_bbcode]Добавлено: 08.09.2014 19:08:48[/merge_posts_bbcode]

[font=Verdana, Helvetica, Arial, sans-serif]Dragon2488[/font]
ну я какэбы такой динозавр который не различает классы с маленькой и большой буквы :D

[merge_posts_bbcode]Добавлено: 08.09.2014 19:11:15[/merge_posts_bbcode]

Краш.
Код:
---- Minecraft Crash Report ----
// Why did you do that?

Time: 08.09.14 18:08
Description: Initializing game

java.lang.NullPointerException: Initializing game
    at cpw.mods.fml.common.network.NetworkRegistry.registerGuiHandler(NetworkRegistry.java:217)
    at last2424.mods.mandastrialcraft.mdc_main.modLoad(mdc_main.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
    at cpw.mods.fml.common.Loader.loadMods(Loader.java:492)
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:532)
    at net.minecraft.client.Minecraft.run(Minecraft.java:941)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at GradleStart.bounce(GradleStart.java:107)
    at GradleStart.startClient(GradleStart.java:100)
    at GradleStart.main(GradleStart.java:65)


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

-- Head --
Stacktrace:
    at cpw.mods.fml.common.network.NetworkRegistry.registerGuiHandler(NetworkRegistry.java:217)
    at last2424.mods.mandastrialcraft.mdc_main.modLoad(mdc_main.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
    at cpw.mods.fml.common.Loader.loadMods(Loader.java:492)
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:532)

-- Initialization --
Details:
Stacktrace:
    at net.minecraft.client.Minecraft.run(Minecraft.java:941)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at GradleStart.bounce(GradleStart.java:107)
    at GradleStart.startClient(GradleStart.java:100)
    at GradleStart.main(GradleStart.java:65)

-- System Details --
Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 7 (x86) version 6.1
    Java Version: 1.7.0_51, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 399078568 bytes (380 MB) / 518979584 bytes (494 MB) up to 518979584 bytes (494 MB)
    JVM Flags: 4 total; -Xincgc -Xmx512M -Xms512M -Xmx512M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active
    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
    FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed
    Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed
    mdc{0.1} [Mandastrial Craft] (bin) Unloaded->Errored
    Launched Version: 1.7
    LWJGL: 2.9.1
    OpenGL: ATI Radeon HD 5570 GL version 4.1.10516 Compatibility Profile Context, ATI Technologies Inc.
    GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: []
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Anisotropic Filtering: Off (1)
 
Конечно крашит, ты возвращаешь GUI в серверном методе, а должен возвращать контейнер.
Да и зачем ты имплементил IGuiHandler в прокси, лол?
Сделай уже отдельный класс.
А то, что ты пишешь классы с маленькой буквы - говорит о несоблюдении норм кодестайла вообще, не знаю какие ты там игры писал на Swing (который вообще интерфейс) или LibGDX.
> NetworkRegistry.INSTANCE.registerGuiHandler(instance, new CommonProxy());
Ойлол, у тебя ещё и 2 серверных прокси, выходит, создается.

Короче вот тебе пример, не мучайся ты так больше.
adSzsut.png

3XtqxjX.png

Про instance() мне ничего не говори, у меня 1.6.4.
 
[font=Verdana, Helvetica, Arial, sans-serif]Oldestkon лол, ты бы мне объяснил как правильно раз такой умный, помоги новичку :)[/font]
Лол, я регаю его только раз, если ты имеешь ввиду SidedProxy. То я хз что надо вызывать, класс есть, ты не понимаешь?
Я его ещё в первом посте опубликовал.
Код:
package last2424.mods.***.gui;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

public class theBookofAllGui extends GuiScreen {
    
    public final int xSizeOfTexture = 176;
    public final int ySizeOfTexture = 88;
    
    public ResourceLocation locationtexture = new ResourceLocation("/Block/changeColorGUI.png");
    
    public theBookofAllGui(EntityPlayer player)
    {

    }
    
    /*@Override
    public void initGui()
    {
        super.initGui();
       this.controlList.clear();

    int posX = (this.width - xSizeOfTexture) / 2;
    int posY = (this.height - ySizeOfTexture) / 2;

    this.controlList.add(new GuiButton(0, posX+ 40, posY + 40, 100, 20, "no use"));
    }*/
    
    @Override
    public void drawScreen(int x, int y, float f){
        
        drawDefaultBackground();
        
        ITextureObject var4 = this.mc.renderEngine.getTexture(locationtexture);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.getTexture((ResourceLocation) var4);

        int posX = (this.width - xSizeOfTexture) / 2;
        int posY = (this.height - ySizeOfTexture) / 2;

        drawTexturedModalRect(posX, posY, 0, 0, xSizeOfTexture, ySizeOfTexture);

        super.drawScreen(x, y, f);
        
    }
    
}
 
last24242 написал(а):
[font=Verdana, Helvetica, Arial, sans-serif] То я хз что надо вызывать, класс есть, ты не понимаешь?[/font]
Ну да, говори мне.
Тебе уже и выше говорили.
Сделай.
Отдельный.
Класс.
Для.
GuiHandler'а.
Так.
Понятнее?
Или.
Ты.
До.
Сих.
Пор.
Не.
Понял?
 
Сталкивались уже с таким. Пиши вместо NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); это:
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
 
Oldestkon
нету в 1.7 никаких д"Р"опбоксов и кэмпфаэров, где ты их взял.


Dragon2488
первая версия регистраций не отличалась.
 
Конечно нет, потому что это гуи и контейнер блоков из его мода.
А сейчас у тебя не работает из-за того, что в getServerGuiElement возвращаешь не контейнер.
Если ты не используешь контейнер, то в getServerGuiElement возвращай null.
 
Если нет контейнера, то хандлер не нужен )
 
Код:
---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 08.09.14 19:50
Description: There was a severe problem during mod loading that has caused the game to fail

cpw.mods.fml.common.LoaderException: cpw.mods.fml.common.LoaderException
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:76)
    at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:492)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
    at cpw.mods.fml.common.Loader.loadMods(Loader.java:492)
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:532)
    at net.minecraft.client.Minecraft.run(Minecraft.java:941)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at GradleStart.bounce(GradleStart.java:107)
    at GradleStart.startClient(GradleStart.java:100)
    at GradleStart.main(GradleStart.java:65)
Caused by: cpw.mods.fml.common.LoaderException
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:69)
    ... 40 more


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

-- System Details --
Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 7 (x86) version 6.1
    Java Version: 1.7.0_51, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 407206672 bytes (388 MB) / 518979584 bytes (494 MB) up to 518979584 bytes (494 MB)
    JVM Flags: 4 total; -Xincgc -Xmx512M -Xms512M -Xmx512M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active
    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
    FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed
    Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed
    mdc{0.1} [Mandastrial Craft] (bin) Unloaded->Errored

Может кто мне объяснит что за зверь такой напал?
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху