Jump to content

All mods trying to use the same CommonProxy?


dmillerw

Recommended Posts

I have two mods, in separate eclipse packages, but when I define the CommonProxy...

public static final CommonProxy proxy;

...but both mods will try to use the first mod's CommonProxy.

 

AnkhMainFile (First mod):

 

package dmillerw.mods.ankh;

import java.util.Iterator;
import java.util.List;

import net.minecraft.src.CraftingManager;
import net.minecraft.src.IRecipe;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import dmillerw.mods.rfidtags.TileEntityRFIDDetector;

@Mod (modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.MOD_VERSION)
public class AnkhMainFile {

public static int SandstoneColumnRenderID = 100;
public static int SandstoneColumnLightRenderID = 101;

    @SidedProxy(clientSide = "dmillerw.mods.ankh.client.ClientProxy", serverSide = "dmillerw.mods.ankh.CommonProxy")
    public static CommonProxy proxy;

    @Instance("ankh")
    public static AnkhMainFile instance;
    
    @PreInit
public static void preInit(FMLPreInitializationEvent event) {}
    
    @Init
    public static void Init(FMLInitializationEvent event) {
    	GameRegistry.registerTileEntity(TileEntitySunstone.class, "sunStone");
    	
    	proxy.test();
    	
    	//Initializes rendering and textures
    	proxy.initRenderingAndTextures();
    	//Initializes mod blocks.
    	ModBlocks.init();
    	//Initializes mod items.
    	ModItems.init();
    }

}

 

 

RFIDMainFile (Second mod):

 

package dmillerw.mods.rfidtags;

import net.minecraft.src.Block;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import dmillerw.mods.ankh.CommonProxy;

@Mod (modid = "rfidtags", name = "RFID Tags", version = "1.0.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false,
clientPacketHandlerSpec =
@SidedPacketHandler(channels = {"RFIDTags" }, packetHandler = ClientPacketHandler.class),
serverPacketHandlerSpec =
@SidedPacketHandler(channels = {"RFIDTags" }, packetHandler = ServerPacketHandler.class))
public class RFIDMainFile {

@SidedProxy(clientSide = "dmillerw.mods.rfidtags.client.ClientProxy", serverSide = "dmillerw.mods.rfidtags.CommonProxy")
public static CommonProxy proxy;
    
    @Instance("rfidtags")
    public static RFIDMainFile instance;
    
    //BLOCKS
    public static Block blockRFIDDetector;
    
    //ITEMS
    public static Item itemRFIDTag;
    
    @PreInit
public void preInit(FMLPreInitializationEvent event) {}
    
    @Init
    public void Init(FMLInitializationEvent event) {  	  	
    	//NetworkRegistry.instance().registerGuiHandler(this, );
    	
    	//proxy.initTileEntities();
    	//proxy.initCraftingHandler();
    	
    	proxy.test();
    	
    	GameRegistry.registerCraftingHandler(new CustomCraftingHandler());
    	
    	itemRFIDTag = new ItemRFIDTag(3500).setItemName("itemRFIDTag");
    	blockRFIDDetector = new BlockRFIDDetector(3501, Material.iron).setBlockName("blockRFIDDetector");
    	
    	GameRegistry.registerBlock(blockRFIDDetector);
    	
    	LanguageRegistry.addName(blockRFIDDetector, "RFID Detector");
    	LanguageRegistry.addName(itemRFIDTag, "RFID Tag");
    	
    	GameRegistry.addRecipe(new ItemStack(itemRFIDTag, 1), new Object[] {"IRI", "ILI", "IRI", 'I', Item.ingotIron, 'R', Item.redstone, 'L', Item.goldNugget});
    	GameRegistry.addShapelessRecipe(new ItemStack(Item.pickaxeDiamond, 1), new Object[] {itemRFIDTag, Item.pickaxeDiamond});
    }

}

 

 

The RFID Tag mod is constantly trying to use the CommonProxy in the Ankh mod package.

Link to comment
Share on other sites

If you have different packages for your mods you could have example dmillerw.mod1name.commonproxy and dmillerw.mod2name.commonproxy.

As long as you import the correct one for the correct mod and use the correct one inn the @NetworkMod annotation.

If you guys dont get it.. then well ya.. try harder...

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.