Jump to content

[UNSOLVED][4.0.0.241] Help to create a new furnace


esquerbatua

Recommended Posts

Well, I wanna see your code! POST REPLY!

 

And look at another mod's source to see how to do the register, you don't need a custom slot, and, well, if you copied the furnace code exactly, it should work.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Link to comment
Share on other sites

Thanks, but I've done more or less what you've told me I looked at the code of other mods and I copied some code furace things but when you right click on the block in minecraft a screen saying that the server has thrown me. And I modified the post to display the message, my mistake.

Well, you might need a client and server proxy, a getserverguielement() function that returns the GUI.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Link to comment
Share on other sites

Yes, in the CommonProxy. But since? I've been looking for tutorials or mods that add furnaces or crafting tables and record the gui but I have not found much, but I found this does not work you check the server by right-clicking in the oven.

 

@Override

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

{

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

        if(tileEntity instanceof TileEntityCoalFurnace)

        {

                return new GuiCoalFurnace(player.inventory, (TileEntityCoalFurnace) tileEntity);

        }

        return null;

}

 

@Override

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

{

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

        if(tileEntity instanceof TileEntityCoalFurnace)

        {

                return new GuiCoalFurnace(player.inventory, (TileEntityCoalFurnace) tileEntity);

        }

        return null;

}

 

when I run this code I get this error:

 

 

2012-09-13 13:30:20 [iNFO] [ForgeModLoader] Forge Mod Loader version 3.0.165.344 for Minecraft client:1.3.2, server:1.3.2 loading

2012-09-13 13:30:21 [iNFO] [sTDOUT] 27 achievements

2012-09-13 13:30:21 [iNFO] [sTDOUT] 195 recipes

2012-09-13 13:30:22 [iNFO] [sTDOUT] Setting user: Player147, -

2012-09-13 13:30:22 [iNFO] [sTDERR] Client asked for parameter: server

2012-09-13 13:30:22 [iNFO] [sTDOUT] LWJGL Version: 2.4.2

2012-09-13 13:30:22 [iNFO] [ForgeModLoader] Attempting early MinecraftForge initialization

2012-09-13 13:30:22 [iNFO] [ForgeModLoader] Completed early MinecraftForge initialization

2012-09-13 13:30:22 [iNFO] [ForgeModLoader] Searching C:\Users\Carlos Esquerdo\Desktop\MCP\1.3.2 forge\jars\mods for mods

2012-09-13 13:30:22 [iNFO] [ForgeModLoader] No mcmod.info file found in directory bin

2012-09-13 13:30:23 [iNFO] [ForgeModLoader] The mod container minecraft.jar appears to be missing an mcmod.info file

2012-09-13 13:30:23 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 3 mods to load

2012-09-13 13:30:23 [sEVERE] [ForgeModLoader] The mod CEVICRAFT appears to have an invalid method annotation PreInit. This annotation can only apply to methods with argument types [class cpw.mods.fml.common.event.FMLPreInitializationEvent] -it will not be called

2012-09-13 13:30:24 [iNFO] [sTDOUT] Starting up SoundSystem...

2012-09-13 13:30:24 [iNFO] [sTDOUT] Initializing LWJGL OpenAL

2012-09-13 13:30:24 [iNFO] [sTDOUT]    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

2012-09-13 13:30:24 [iNFO] [sTDOUT] OpenAL initialized.

2012-09-13 13:30:24 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 3 mods

2012-09-13 13:30:27 [iNFO] [ForgeModLoader] MinecraftForge v4.0.0.241 Initialized

2012-09-13 13:30:42 [sEVERE] [ForgeModLoader] A critical server error occured handling a packet, kicking net.minecraft.src.NetServerHandler@2c51de03

java.lang.NullPointerException

at cpw.mods.fml.common.modloader.ModLoaderHelper.openGui(ModLoaderHelper.java:151)

at net.minecraft.src.ModLoader.serverOpenWindow(ModLoader.java:788)

at cevicraft.coal_furnace.onBlockActivated(coal_furnace.java:129)

at net.minecraft.src.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:346)

at net.minecraft.src.NetServerHandler.handlePlace(NetServerHandler.java:500)

at net.minecraft.src.Packet15Place.processPacket(Packet15Place.java:78)

at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:75)

at net.minecraft.src.NetServerHandler.networkTick(NetServerHandler.java:72)

at net.minecraft.src.NetworkListenThread.networkTick(NetworkListenThread.java:55)

at net.minecraft.src.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:132)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:630)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:547)

at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:105)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:453)

at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:17)

2012-09-13 13:30:45 [iNFO] [sTDERR] Someone is closing me!

 

Link to comment
Share on other sites

getServerGuiElement must return a container.class both so it doesn't crash and so you can have items in you GUI.

if you want a good reference code check out my github https://github.com/DarkGuardsman/SteamPower/tree/master/src. Tutorials can only get you so far, looking at other peoples code can get you even further.

 

Also if you want to get really good help post your code on github reading it in these post is not easy. If you can do that i can find your errors really fast.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.