Jump to content

Recommended Posts

Posted

Hello, I created a furnace in 1.2.5 and I just updated everything to the latest furnace code. I even moved my GUI file into where the  guifurnace is.

 

But I dont get anything when I right click it, nothing happens, code:

 

Mod File:

 

  Reveal hidden contents

 

 

Block Class:

 

 

  Reveal hidden contents

 

 

Tile Entity:

 

  Reveal hidden contents

 

 

Gui File

 

  Reveal hidden contents

 

 

Container:

 

  Reveal hidden contents

 

 

Slot:

 

  Reveal hidden contents

 

 

Recipes class:

 

  Reveal hidden contents

 

 

Please Help :D

Posted
  On 9/1/2012 at 10:10 PM, Thor597 said:

Some Help please? I Need to release my mod soon

You need a server and client proxy.

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

Posted
  On 9/2/2012 at 12:56 AM, Thor597 said:

  Quote

  Quote

Some Help please? I Need to release my mod soon

You need a server and client proxy.

I have them

Then you need to show me them.

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

Posted

In the main file I have this under my constructor:

@SidedProxy
(
		clientSide = "thormod.ThorMod_ClientProxy", serverSide = "thormod.ThorMod_CommonProxy"
		)

public static ThorMod_CommonProxy proxy;
@Instance
public static ThorMod instance;

@PreInit
public void preInit(FMLPreInitializationEvent event)
{
	proxy.registerRenderInformation();
}

 

And these are the files:

 

ClientProxy

package thormod;                                                             
import net.minecraft.src.*;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.TickRegistry;

public class ThorMod_ClientProxy extends ThorMod_CommonProxy
{
@Override
public void registerRenderInformation() 
{  
	MinecraftForge.EVENT_BUS.register(new ThorMod_SoundHandler());
	GameRegistry.registerCraftingHandler(new ThorMod_CraftingHandler());
	MinecraftForgeClient.preloadTexture("/Thormod/blocks.png");
	MinecraftForgeClient.preloadTexture("/Thormod/items.png");
	RenderingRegistry.registerEntityRenderingHandler(ThorMod_EntitySteveMonkey.class, new RenderBiped(new ModelBiped(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(ThorMod_EntityThor.class, new ThorMod_RenderThor(new ThorMod_ModelThor(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(ThorMod_MadgeniumArrow.class, new RenderArrow());
	RenderingRegistry.registerEntityRenderingHandler(ThorMod_EntityEmeraldPrimed.class, new ThorMod_RenderEmeraldBomb());
	TickRegistry.registerTickHandler(new ThorMod_TickHandler(), Side.CLIENT);
}

}

 

CommonProxy

package thormod;                                                             import net.minecraft.src.*;

import net.minecraft.src.EntityPlayer;
import net.minecraft.src.World;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameRegistry;

public class ThorMod_CommonProxy implements IGuiHandler
{

/**
 * Client side only register stuff...
 */
public void registerRenderInformation() 
{

}

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
	// TODO Auto-generated method stub
	return null;
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
	// TODO Auto-generated method stub
	return null;
}

}

Posted

You have to make sure you actually return a GUI in get client gui element and get server GUI element.

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

Posted
  On 9/2/2012 at 12:53 PM, Thor597 said:

Uhh, what GUI should I return then? And how does this help my furnace?

In client gui element, return an instance of your gui.

In the server one, return the container.

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

Posted

I had the same problem with no GUI on right click and for me helped adding in init:

 

NetworkRegistry.instance().registerGuiHandler(your_mod_instance, your_proxy);

Posted
  On 9/3/2012 at 10:00 AM, zavvias said:

I had the same problem with no GUI on right click and for me helped adding in init:

 

NetworkRegistry.instance().registerGuiHandler(your_mod_instance, your_proxy);

That's what it is, had it on the tip of my tongue.

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

Posted

Uh, so how do I use the registerGuiHandler and the new GuiHandler class then? Please help because the last thing didnt work, code:

 

ClientProxy

package thormod;                                                             
import net.minecraft.src.*;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.TickRegistry;

public class ThorMod_ClientProxy extends ThorMod_CommonProxy
{
@Override
public void registerRenderInformation() 
{  
	MinecraftForge.EVENT_BUS.register(new ThorMod_SoundHandler());
	GameRegistry.registerCraftingHandler(new ThorMod_CraftingHandler());
	MinecraftForgeClient.preloadTexture("/Thormod/blocks.png");
	MinecraftForgeClient.preloadTexture("/Thormod/items.png");
	RenderingRegistry.registerEntityRenderingHandler(ThorMod_EntitySteveMonkey.class, new RenderBiped(new ModelBiped(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(ThorMod_EntityThor.class, new ThorMod_RenderThor(new ThorMod_ModelThor(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(ThorMod_MadgeniumArrow.class, new RenderArrow());
	RenderingRegistry.registerEntityRenderingHandler(ThorMod_EntityEmeraldPrimed.class, new ThorMod_RenderEmeraldBomb());
	TickRegistry.registerTickHandler(new ThorMod_TickHandlerClient(), Side.CLIENT);
	TickRegistry.registerTickHandler(new ThorMod_TickHandlerCommon(), Side.SERVER);
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
	ThorMod_TileEntityGoldronFurnace var10 = (ThorMod_TileEntityGoldronFurnace)world.getBlockTileEntity(x, y, z);
	return new ThorMod_ContainerGoldronFurnace(player.inventory, var10);
}

}

 

CommonProxy:

package thormod;                                                             
import net.minecraft.src.*;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameRegistry;

public class ThorMod_CommonProxy implements IGuiHandler
{

/**
 * Client side only register stuff...
 */
public void registerRenderInformation() 
{

}

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
	ThorMod_TileEntityGoldronFurnace var10 = (ThorMod_TileEntityGoldronFurnace)world.getBlockTileEntity(x, y, z);
	return new ThorMod_GUIGoldronFurnace(player.inventory, var10);
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
	return null;
}

}

 

also how do I have multiple(I have a couple furnaces)?

Posted
  On 9/9/2012 at 3:24 PM, Thor597 said:

I have tried in every possible way to get it to work, replacing recipes that work with it, and everything. It even works for my other furnace and the default furnace, just not this one, and I dont understand it. All my other recipes and all the other vanilla recipes work

 

Just had a look at the code you've posted on the OP and I have found this in your canSmelt and smeltItem methods:

ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);

I know that was over a week ago and is probably old code by now, but did you change those lines to something like this?

ItemStack var1 = ThorMod_GoldronFurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);

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.

Announcements



×
×
  • Create New...

Important Information

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