Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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...

  • Author

Ah. Turns out it was auto-importing the one from the ankh package. Never even thought to look there. Thanks. :)

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.