Jump to content

Hilfe bei GUI


Empfohlene Beiträge

Ich habe schon öfters mit Guis programmiert doch ich weiß nicht mehr weiter. Wenn ich das Gui öffnen will hängt sich das spiel auf speichert schließt aber nicht und ich bekommen keinen error :\

LOG

[18:05:39] [main/INFO]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[18:05:39] [main/INFO]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker [18:05:39] [main/INFO]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker [18:05:39] [main/INFO]: Forge Mod Loader version 7.2.211.1124 for Minecraft 1.7.2 loading [18:05:39] [main/INFO]: Java is Java HotSpot Client VM, version 1.7.0_21, running on Windows 7:x86:6.1, installed at C:\Program Files (x86)\Java\jdk1.7.0_21\jre [18:05:39] [main/INFO]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [18:05:39] [main/INFO]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [18:05:39] [main/INFO]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker [18:05:39] [main/INFO]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [18:05:39] [main/INFO]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [18:05:39] [main/INFO]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [18:05:39] [main/ERROR]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [18:05:40] [main/ERROR]: The minecraft jar file:/C:/Users/Leon/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1124/forgeBin-1.7.2-10.12.2.1124.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again! [18:05:40] [main/ERROR]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem! [18:05:40] [main/ERROR]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Leon/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1124/forgeBin-1.7.2-10.12.2.1124.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it [18:05:40] [main/ERROR]: FML appears to be missing any signature data. This is not a good thing [18:05:40] [main/INFO]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [18:05:40] [main/INFO]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker [18:05:40] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main} [18:05:41] [main/INFO]: Setting user: Player876 [18:05:42] [Client thread/INFO]: LWJGL Version: 2.9.0 [18:05:43] [Client thread/INFO]: Attempting early MinecraftForge initialization [18:05:43] [Client thread/INFO]: MinecraftForge v10.12.2.1124 Initialized [18:05:43] [Client thread/INFO]: Replaced 182 ore recipies [18:05:43] [Client thread/INFO]: Completed early MinecraftForge initialization [18:05:43] [Client thread/INFO]: Searching C:\Users\Leon\Desktop 3\MCP\forge-1.7.2-10.12.2.1124-src\eclipse\mods for mods [18:05:43] [Client thread/ERROR]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! [18:05:43] [Client thread/ERROR]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.Start. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! [18:05:45] [Client thread/INFO]: Forge Mod Loader has identified 5 mods to load [18:05:46] [Client thread/ERROR]: The mod tutorial appears to have an invalid event annotation EventHandler. This annotation can only apply to methods with recognized event arguments - it will not be called [18:05:46] [Client thread/ERROR]: The mod phone appears to have an invalid event annotation EventHandler. This annotation can only apply to methods with recognized event arguments - it will not be called [18:05:46] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Tutorial, FMLFileResourcePack:Phonemod [18:05:46] [Client thread/INFO]: Processing ObjectHolder annotations [18:05:46] [Client thread/INFO]: Found 341 ObjectHolder annotations [18:05:46] [Client thread/INFO]: Configured a dormant chunk cache size of 0 [18:05:46] [Client thread/INFO]: Applying holder lookups [18:05:46] [Client thread/INFO]: Holder lookups applied Starting up SoundSystem... Initializing LWJGL OpenAL (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) OpenAL initialized. [18:05:46] [sound Library Loader/INFO]: Sound engine started [18:05:47] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [18:05:47] [Client thread/INFO]: Created: 256x256 textures/items-atlas [18:05:47] [Client thread/INFO]: Forge Mod Loader has successfully loaded 5 mods [18:05:47] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Tutorial, FMLFileResourcePack:Phonemod [18:05:47] [Client thread/INFO]: Created: 256x256 textures/items-atlas [18:05:47] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas SoundSystem shutting down... Author: Paul Lamb, www.paulscode.com Starting up SoundSystem... Initializing LWJGL OpenAL (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) OpenAL initialized. [18:05:48] [sound Library Loader/INFO]: Sound engine started [18:05:49] [MCO Availability Checker #1/ERROR]: Couldn't connect to Realms [18:05:50] [server thread/INFO]: Starting integrated minecraft server version 1.7.2 [18:05:50] [server thread/INFO]: Generating keypair [18:05:50] [server thread/INFO]: Injecting existing block and item data into this server instance [18:05:50] [server thread/INFO]: Applying holder lookups [18:05:50] [server thread/INFO]: Holder lookups applied [18:05:50] [server thread/INFO]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@f3437d) [18:05:50] [server thread/INFO]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@f3437d) [18:05:50] [server thread/WARN]: Unable to read forced chunk data at C:\Users\Leon\Desktop 3\MCP\forge-1.7.2-10.12.2.1124-src\eclipse\.\saves\New World\DIM1\forcedchunks.dat - it will be ignored java.io.IOException: Root tag must be a named compound tag at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:127) ~[CompressedStreamTools.class:?] at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:203) ~[CompressedStreamTools.class:?] at net.minecraftforge.common.ForgeChunkManager.loadWorld(ForgeChunkManager.java:406) [ForgeChunkManager.class:?] at net.minecraftforge.common.ForgeInternalHandler.onDimensionLoad(ForgeInternalHandler.java:64) [ForgeInternalHandler.class:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler_1_ForgeInternalHandler_onDimensionLoad_Load.invoke(.dynamic) [?:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) [ASMEventHandler.class:?] at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) [EventBus.class:?] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:73) [integratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:92) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:670) [MinecraftServer$2.class:?] [18:05:50] [server thread/INFO]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@f3437d) [18:05:50] [server thread/WARN]: Unable to read forced chunk data at C:\Users\Leon\Desktop 3\MCP\forge-1.7.2-10.12.2.1124-src\eclipse\.\saves\New World\DIM-1\forcedchunks.dat - it will be ignored java.io.IOException: Root tag must be a named compound tag at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:127) ~[CompressedStreamTools.class:?] at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:203) ~[CompressedStreamTools.class:?] at net.minecraftforge.common.ForgeChunkManager.loadWorld(ForgeChunkManager.java:406) [ForgeChunkManager.class:?] at net.minecraftforge.common.ForgeInternalHandler.onDimensionLoad(ForgeInternalHandler.java:64) [ForgeInternalHandler.class:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler_1_ForgeInternalHandler_onDimensionLoad_Load.invoke(.dynamic) [?:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) [ASMEventHandler.class:?] at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) [EventBus.class:?] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:73) [integratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:92) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:670) [MinecraftServer$2.class:?] [18:05:50] [server thread/WARN]: Unable to read forced chunk data at C:\Users\Leon\Desktop 3\MCP\forge-1.7.2-10.12.2.1124-src\eclipse\.\saves\New World\forcedchunks.dat - it will be ignored java.io.IOException: Root tag must be a named compound tag at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:127) ~[CompressedStreamTools.class:?] at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:203) ~[CompressedStreamTools.class:?] at net.minecraftforge.common.ForgeChunkManager.loadWorld(ForgeChunkManager.java:406) [ForgeChunkManager.class:?] at net.minecraftforge.common.ForgeInternalHandler.onDimensionLoad(ForgeInternalHandler.java:64) [ForgeInternalHandler.class:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler_1_ForgeInternalHandler_onDimensionLoad_Load.invoke(.dynamic) [?:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) [ASMEventHandler.class:?] at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) [EventBus.class:?] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:73) [integratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:92) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:670) [MinecraftServer$2.class:?] [18:05:50] [server thread/INFO]: Preparing start region for level 0 [18:05:51] [server thread/INFO]: Preparing spawn area: 52% [18:05:52] [Netty Client IO #0/INFO]: Server protocol version 1 [18:05:52] [Netty IO #1/INFO]: Client protocol version 1 [18:05:52] [Netty IO #1/INFO]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected] [18:05:52] [Netty IO #1/INFO]: Attempting connection with missing mods [] at CLIENT [18:05:52] [Netty Client IO #0/INFO]: Attempting connection with missing mods [] at SERVER [18:05:52] [server thread/INFO]: [server thread] Server side modded connection established [18:05:52] [server thread/INFO]: Player876[local:E:859b54eb] logged in with entity id 284 at (136.76358290801795, 72.0, 270.65754956006845) [18:05:52] [Client thread/INFO]: [Client thread] Client side modded connection established [18:05:52] [server thread/INFO]: Player876 joined the game [18:05:54] [server thread/INFO]: Saving and pausing game... [18:05:54] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [18:05:54] [server thread/INFO]: Saving chunks for level 'New World'/Nether [18:05:54] [server thread/INFO]: Saving chunks for level 'New World'/The End [18:06:16] [server thread/INFO]: Saving and pausing game... [18:06:16] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [18:06:16] [server thread/INFO]: Saving chunks for level 'New World'/Nether [18:06:16] [server thread/INFO]: Saving chunks for level 'New World'/The End [18:11:34] [Client thread/INFO]: Stopping! SoundSystem shutting down... [18:11:34] [server thread/INFO]: Stopping server [18:11:34] [server thread/INFO]: Saving players [18:11:34] [server thread/INFO]: Saving worlds [18:11:34] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [18:11:34] [server thread/INFO]: Saving chunks for level 'New World'/Nether [18:11:34] [server thread/INFO]: Saving chunks for level 'New World'/The End

[18:11:34] [server thread/INFO]: Unloading dimension 0 [18:11:34] [server thread/INFO]: Unloading dimension -1 [18:11:34] [server thread/INFO]: Unloading dimension 1 [18:11:34] [server thread/INFO]: Applying holder lookups [18:11:34] [server thread/INFO]: Holder lookups applied Author: Paul Lamb, www.paulscode.com

ModPhone

package de.smiles.phone;import cpw.mods.fml.common.Mod;import cpw.mods.fml.common.SidedProxy;import cpw.mods.fml.common.Mod.EventHandler;import cpw.mods.fml.common.Mod.Instance;import cpw.mods.fml.common.event.FMLLoadEvent;import cpw.mods.fml.common.event.FMLPostInitializationEvent;import cpw.mods.fml.common.event.FMLPreInitializationEvent;import cpw.mods.fml.common.registry.GameRegistry;import de.smiles.phone.proxy.CommonProxy;import de.smiles.phone.proxy.GuiHandler;@Mod(modid="phone", name="Phonemod", version="1.0.0")public class ModPhone {		@Instance(value = "phone")	public static ModPhone instance;		@SidedProxy(clientSide="de.smiles.phone.proxy.ClientProxy", serverSide="de.smiles.phone.proxy.CommonProxy")	public static CommonProxy proxy;		public static ItemPhone phone;		@EventHandler	public void preInit(FMLPreInitializationEvent event) {		new GuiHandler();				phone = new ItemPhone();		GameRegistry.registerItem(phone, "phone");			}		@EventHandler	public void load(FMLLoadEvent event) {	}		@EventHandler	public void postInit(FMLPostInitializationEvent event) {			}}

GuiPhone

package de.smiles.phone;import org.lwjgl.opengl.GL11;import com.sun.xml.internal.stream.Entity;import net.minecraft.client.Minecraft;import net.minecraft.client.gui.GuiScreen;import net.minecraft.entity.player.EntityPlayer;import net.minecraft.util.ResourceLocation;public class GuiPhone extends GuiScreen{		private static final int xSize = 300;	private static final int ySize = 600;	ResourceLocation texture = new ResourceLocation("phone", "textures/gui/backgr");	public GuiPhone (EntityPlayer player) {			}		@Override	public void drawBackground(int i) {		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);        this.mc.renderEngine.bindTexture(texture);        int x = (width - xSize) / 2;        int y = (height - ySize) / 2;        this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);	}			@Override	public void drawScreen(int x, int y, float f) {			}}

ContainerPhone

package de.smiles.phone;import net.minecraft.entity.player.EntityPlayer;import net.minecraft.inventory.Container;public class ContainerPhone extends Container{	public ContainerPhone(EntityPlayer player) {			}		@Override	public boolean canInteractWith(EntityPlayer arg0) {		return true;	}}

ItemPhone

package de.smiles.phone;import net.minecraft.creativetab.CreativeTabs;import net.minecraft.entity.player.EntityPlayer;import net.minecraft.item.Item;import net.minecraft.item.ItemStack;import net.minecraft.world.World;public class ItemPhone extends Item {	public ItemPhone() {		maxStackSize = 1;		setCreativeTab(CreativeTabs.tabMisc);		setUnlocalizedName("phone");		setTextureName("phone:phone");	}		@Override	public ItemStack onItemRightClick(ItemStack par1ItemStack, World world, EntityPlayer player)	{		player.openGui(ModPhone.instance, 0, world, 0, 0, 0);		return par1ItemStack;	}}

GuiHandler

package de.smiles.phone.proxy;import net.minecraft.entity.player.EntityPlayer;import net.minecraft.world.World;import cpw.mods.fml.common.network.IGuiHandler;import cpw.mods.fml.common.network.NetworkRegistry;import de.smiles.phone.ContainerPhone;import de.smiles.phone.GuiPhone;import de.smiles.phone.ModPhone;public class GuiHandler implements IGuiHandler{	public GuiHandler() {		NetworkRegistry.INSTANCE.registerGuiHandler(ModPhone.instance, this);	}		@Override	public Object getClientGuiElement(int ID, EntityPlayer arg1, World arg2,			int arg3, int arg4, int arg5) {		switch(ID) {		default: return null;		case 0: return new GuiPhone(arg1);	    }	}	@Override	public Object getServerGuiElement(int ID, EntityPlayer arg1, World arg2,			int arg3, int arg4, int arg5) {		switch(ID) {			default: return null;			case 0: return new ContainerPhone(arg1);		}	}}

Link zu diesem Kommentar
Auf anderen Seiten teilen

Dein Spiel stürzt garnicht ab. Drücke zweimal Esc und du bist wieder im Spiel. Um nur einmel Esc zum Schließen drücken zu müssen veränderst du deinen GuiHandler so, dass der Server keinen Container mehr bekommt. (Ohne Tile Entity ist der sowieso nutzlos)

package de.smiles.phone;     import net.minecraft.entity.player.EntityPlayer;import net.minecraft.world.World;import cpw.mods.fml.common.network.IGuiHandler;import cpw.mods.fml.common.network.NetworkRegistry;         public class GuiHandler implements IGuiHandler{         public GuiHandler() {    NetworkRegistry.INSTANCE.registerGuiHandler(ModPhone.instance, this);    }    @Override    public Object getClientGuiElement(int ID, EntityPlayer arg1, World arg2,    int arg3, int arg4, int arg5) {    switch(ID) {    default: return null;    case 0: return new GuiPhone(arg1);    }    }         @Override    public Object getServerGuiElement(int ID, EntityPlayer arg1, World arg2,    int arg3, int arg4, int arg5) {    	return null;    }    }

Jetzt kannst du natürlich den Container löschen.

Um die Gui anzuzeigen verschiebst du das Anzeigen der Gui einfach in die drawScreen Methode.

package de.smiles.phone;     import net.minecraft.client.gui.GuiScreen;import net.minecraft.entity.player.EntityPlayer;import net.minecraft.util.ResourceLocation;import org.lwjgl.opengl.GL11;         public class GuiPhone extends GuiScreen{    private static final int xSize = 300;    private static final int ySize = 600;    ResourceLocation texture = new ResourceLocation("phone", "textures/gui/backgr");         public GuiPhone (EntityPlayer player) {    }        @Override    public void drawScreen(int par1, int par2, float f) {    	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);        this.mc.renderEngine.bindTexture(texture);        int x = (width - xSize) / 2;        int y = (height - ySize) / 2;        this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);    }    }

Link zu diesem Kommentar
Auf anderen Seiten teilen

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Du musst ein Benutzerkonto haben, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen. Es ist einfach!

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...
B
B