Bashula Posted December 29, 2013 Posted December 29, 2013 I`ve updated my mod and i have a furnace but the gui dont show no errors in console. Bryan Quote
mardiff Posted December 29, 2013 Posted December 29, 2013 onBlockActivated code in the TileEntity please? Quote If you really want help, give that modder a thank you. Modders LOVE thank yous.
Bashula Posted December 29, 2013 Author Posted December 29, 2013 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; } } Quote
mardiff Posted December 29, 2013 Posted December 29, 2013 Can we see the Strings class too? Quote If you really want help, give that modder a thank you. Modders LOVE thank yous.
Bashula Posted December 29, 2013 Author Posted December 29, 2013 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; } Quote
mardiff Posted December 29, 2013 Posted December 29, 2013 How about your gui handler? Quote If you really want help, give that modder a thank you. Modders LOVE thank yous.
Bashula Posted December 29, 2013 Author Posted December 29, 2013 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; } } Quote
mardiff Posted December 29, 2013 Posted December 29, 2013 did you register your gui handler and your tile entity? Quote If you really want help, give that modder a thank you. Modders LOVE thank yous.
Bashula Posted December 29, 2013 Author Posted December 29, 2013 heres the tile entity GameRegistry.registerTileEntity(TileEntityDarkIronFurnace.class, "TileEntityDarkIronFurnace"); and i think this is the guihandler NetworkRegistry.instance().registerGuiHandler(this, GuiHandlerDIFurnace); Quote
Bashula Posted December 29, 2013 Author Posted December 29, 2013 I dont Know ive even changed the code to 1.6.4 furance code and no luck i have no clue? Quote
CJLetsGame Posted December 29, 2013 Posted December 29, 2013 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()); Quote
CJLetsGame Posted December 29, 2013 Posted December 29, 2013 Does your block code override this: public TileEntity createNewTileEntity(World par1World) { return new TileEntityHere(); } Quote
CJLetsGame Posted December 29, 2013 Posted December 29, 2013 Did you try debugging and breakpoints to check if the tile is null or not? Quote
Bashula Posted December 29, 2013 Author Posted December 29, 2013 How do i do that i have the debug up and i found the breakpoints tab Quote
CJLetsGame Posted December 29, 2013 Posted December 29, 2013 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. Quote
Bashula Posted December 29, 2013 Author Posted December 29, 2013 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 Quote
CJLetsGame Posted December 29, 2013 Posted December 29, 2013 The line in block activated where you check if the tile entity is null. Or in your case, the very inconveniently named var10. Quote
Bashula Posted January 3, 2014 Author Posted January 3, 2014 I got it to work i don`t know how i did it i think it was the gui handler Quote
Recommended Posts
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.