From 943f1a493b27c630e95730b385e6524643d98564 Mon Sep 17 00:00:00 2001 From: bspkrs Date: Sat, 14 Dec 2013 20:51:01 -0500 Subject: changed mod back to being Jewelrycraft and removed all Briefcase Speakers code Let's face it, they don't belong together in the same mod... I'll still help you with the SMP compatibility like you originally asked me to, but I'd rather keep my mod idea for another day instead of have it be part of a mod that I'm not really that interested in. Let me know when your code is far enough that you're ready for SMP stuff. --- .../darkknight/jewelrycraft/JewelrycraftMod.java | 122 +++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 common/darkknight/jewelrycraft/JewelrycraftMod.java (limited to 'common/darkknight/jewelrycraft/JewelrycraftMod.java') diff --git a/common/darkknight/jewelrycraft/JewelrycraftMod.java b/common/darkknight/jewelrycraft/JewelrycraftMod.java new file mode 100644 index 0000000..d7a2939 --- /dev/null +++ b/common/darkknight/jewelrycraft/JewelrycraftMod.java @@ -0,0 +1,122 @@ +package darkknight.jewelrycraft; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetworkManager; +import net.minecraft.network.NetLoginHandler; +import net.minecraft.network.packet.NetHandler; +import net.minecraft.network.packet.Packet1Login; +import net.minecraft.server.MinecraftServer; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.Mod.Metadata; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.IConnectionHandler; +import cpw.mods.fml.common.network.NetworkMod; +import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler; +import cpw.mods.fml.common.network.Player; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.JewelryCraftClient; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.lib.Reference; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.server.JewelryCraftServer; +import darkknight.jewelrycraft.worldGen.Generation; + +@Mod(modid = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION) +@NetworkMod(clientSideRequired = false, serverSideRequired = false, + clientPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftClient.class), + serverPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftServer.class), + connectionHandler = JewelrycraftMod.class) +public class JewelrycraftMod implements IConnectionHandler +{ + @Instance(Reference.MODID) + public static JewelrycraftMod instance; + + @Metadata(Reference.MODID) + public static ModMetadata metadata; + + @SidedProxy(clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy") + public static CommonProxy proxy; + + public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft") + { + @Override + public ItemStack getIconItemStack() + { + return new ItemStack(ItemList.shadowIngot, 1, 0); + } + }; + + @EventHandler + public void preInit(FMLPreInitializationEvent e) + { + ConfigHandler.preInit(e); + ItemList.preInit(e); + BlockList.preInit(e); + CraftingRecipes.preInit(e); + } + + @EventHandler + public void init(FMLInitializationEvent e) + { + OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); + GameRegistry.registerWorldGenerator(new Generation()); + } + + @EventHandler + public void postInit(FMLPostInitializationEvent e) + { + + } + + @Override + // 2) Called when a player logs into the server SERVER SIDE + public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager) + { + + } + + @Override + // If you don't want the connection to continue, return a non-empty string here SERVER SIDE + public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager) + { + return null; + } + + @Override + // 1) Fired when a remote connection is opened CLIENT SIDE + public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager) + { + + } + + @Override + // 1) Fired when a local connection is opened CLIENT SIDE + public void connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager) + { + + } + + @Override + // Fired when a connection closes ALL SIDES + public void connectionClosed(INetworkManager manager) + { + + } + + @Override + // 3) Fired when the client established the connection to the server CLIENT SIDE + public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login) + { + + } +} -- cgit v1.2.3