diff --git a/README.md b/README.md index de26fc74..75a3acbd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Resonant Induction ====== -Resonsnt Induction is a Minecraft mod focusing on the manipulation of electricity and wireless technology. Ever wanted blazing electrical shocks flying off your evil lairs? You've came to the right place! +Resonant Induction is a Minecraft mod focusing on the manipulation of electricity and wireless technology. Ever wanted blazing electrical shocks flying off your evil lairs? You've came to the right place! ### Developers * Calclavia diff --git a/src/resonantinduction/PacketHandler.java b/src/resonantinduction/PacketHandler.java new file mode 100644 index 00000000..c4e5e2a0 --- /dev/null +++ b/src/resonantinduction/PacketHandler.java @@ -0,0 +1,31 @@ +/** + * + */ +package resonantinduction; + +import net.minecraft.network.INetworkManager; +import net.minecraft.network.packet.Packet250CustomPayload; +import cpw.mods.fml.common.network.IPacketHandler; +import cpw.mods.fml.common.network.Player; + +/** + * @author Calclavia + * + */ +public class PacketHandler implements IPacketHandler +{ + + /* + * (non-Javadoc) + * + * @see + * cpw.mods.fml.common.network.IPacketHandler#onPacketData(net.minecraft.network.INetworkManager + * , net.minecraft.network.packet.Packet250CustomPayload, cpw.mods.fml.common.network.Player) + */ + @Override + public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) + { + + } + +} diff --git a/src/resonantinduction/ResonantInduction.java b/src/resonantinduction/ResonantInduction.java index 9b0551b7..e9397dd2 100644 --- a/src/resonantinduction/ResonantInduction.java +++ b/src/resonantinduction/ResonantInduction.java @@ -1,9 +1,12 @@ package resonantinduction; import java.io.File; +import java.util.Arrays; +import java.util.logging.Logger; import net.minecraft.block.Block; import net.minecraftforge.common.Configuration; +import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; @@ -12,12 +15,15 @@ import cpw.mods.fml.common.ModMetadata; 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.NetworkMod; +import cpw.mods.fml.common.registry.LanguageRegistry; /** * @author Calclavia * */ @Mod(modid = ResonantInduction.ID, name = ResonantInduction.NAME, version = ResonantInduction.VERSION) +@NetworkMod(channels = ResonantInduction.CHANNEL, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) public class ResonantInduction { /** @@ -25,6 +31,7 @@ public class ResonantInduction */ public static final String ID = "ResonantInduction"; public static final String NAME = "Resonant Induction"; + public static final String CHANNEL = "resonantinduc"; public static final String MAJOR_VERSION = "@MAJOR@"; public static final String MINOR_VERSION = "@MINOR@"; @@ -38,6 +45,8 @@ public class ResonantInduction @Mod.Metadata(ID) public static ModMetadata metadata; + public static final Logger LOGGER = Logger.getLogger(NAME); + /** * Directory Information */ @@ -84,13 +93,22 @@ public class ResonantInduction @EventHandler public void preInit(FMLPreInitializationEvent evt) { + LOGGER.setParent(FMLLog.getLogger()); } @EventHandler public void init(FMLInitializationEvent evt) { + LOGGER.fine("Loaded:" + loadLanguages(LANGUAGE_DIRECTORY, LANGUAGES)); + metadata.modId = ID; + metadata.name = NAME; + metadata.description = "Resonant Induction is a Minecraft mod focusing on the manipulation of electricity and wireless technology. Ever wanted blazing electrical shocks flying off your evil lairs? You've came to the right place!"; + metadata.url = "http://universalelectricity.com"; + metadata.version = VERSION + BUILD_VERSION; + metadata.authorList = Arrays.asList(new String[] { "Calclavia", "Aidancbrady" }); + metadata.autogenerated = true; } @EventHandler @@ -98,4 +116,17 @@ public class ResonantInduction { } + + public static int loadLanguages(String languagePath, String[] languageSupported) + { + int loaded = 0; + + for (String language : languageSupported) + { + LanguageRegistry.instance().loadLocalization(languagePath + language + ".properties", language, false); + loaded++; + } + + return loaded; + } }