Posted December 29, 201311 yr I`ve updated my mod and i have a furnace but the gui dont show no errors in console. Bryan
December 29, 201311 yr onBlockActivated code in the TileEntity please? If you really want help, give that modder a thank you. Modders LOVE thank yous.
December 29, 201311 yr Author I used Microjunks code for this part becouse i could not fix the error for it here it is public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (par1World.isRemote) { return true; } else if (!par5EntityPlayer.isSneaking()) { TileEntityDarkIronFurnace var10 = (TileEntityDarkIronFurnace) par1World.getBlockTileEntity(par2, par3, par4); if (var10 != null) { par5EntityPlayer.openGui(Strings.instance, 0, par1World, par2, par3, par4); } return true; } else { return false; } }
December 29, 201311 yr Can we see the Strings class too? If you really want help, give that modder a thank you. Modders LOVE thank yous.
December 29, 201311 yr Author this is the strings class i worked before the update public class Strings { protected boolean enableStats = true; public static final String MOD_ID = "Darkcraft"; public static final String Name = "Darkcraft-1.6.4 Beta-Dev"; public static final String Version = "1.6.3 Beta-Dev"; public static final String ServerProxylocation = "Darkcraft.main.ServerProxy"; public static final String ClientProxylocation = "Darkcraft.main.ClientProxy"; public static String get(String string) { // TODO Auto-generated method stub return null; } public boolean getEnableStats() { return this.enableStats; } /** * * Disable statistics for the block, the block will no count for mined or placed. * */ protected Strings disableStats() { this.enableStats = false; return this; } @Instance("Darkcraft") public static MainRegistry instance; }
December 29, 201311 yr How about your gui handler? If you really want help, give that modder a thank you. Modders LOVE thank yous.
December 29, 201311 yr Author public class GuiHandlerDIFurnace implements IGuiHandler { @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile_entity = world.getBlockTileEntity(x, y, z); switch(id) { case 0: return new DarkIronFurnaceContainer(player.inventory, (TileEntityDarkIronFurnace) tile_entity); } return null; } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile_entity = world.getBlockTileEntity(x, y, z); switch(id) { case 0: return new GUIDarkIronFurnace(player.inventory, (TileEntityDarkIronFurnace) tile_entity); } return null; } }
December 29, 201311 yr did you register your gui handler and your tile entity? If you really want help, give that modder a thank you. Modders LOVE thank yous.
December 29, 201311 yr Author heres the tile entity GameRegistry.registerTileEntity(TileEntityDarkIronFurnace.class, "TileEntityDarkIronFurnace"); and i think this is the guihandler NetworkRegistry.instance().registerGuiHandler(this, GuiHandlerDIFurnace);
December 29, 201311 yr Author I dont Know ive even changed the code to 1.6.4 furance code and no luck i have no clue?
December 29, 201311 yr Try using an instance of your mod file instead of using 'this'. Example: @Instance public static YourMod instance = new YourMod(); NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
December 29, 201311 yr Does your block code override this: public TileEntity createNewTileEntity(World par1World) { return new TileEntityHere(); }
December 29, 201311 yr Run in debug and double click in the left margin of that line of code. All the way to the left were that blue line is. You should see a circle appear. Double clicking again will remove it. Then, when that line executes, it pauses the execution, and you can mouse over the variables to see their values.
December 29, 201311 yr Author im running in debug mode but what line of code i have outline in the middle right debug in the left top sorry i just never debugged before
December 29, 201311 yr The line in block activated where you check if the tile entity is null. Or in your case, the very inconveniently named var10.
January 3, 201411 yr Author I got it to work i don`t know how i did it i think it was the gui handler
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.