Guest User

Untitled

a guest
May 12th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. package com.makersfactory.mfygps;
  2.  
  3. import java.io.BufferedInputStream;
  4. import java.io.BufferedOutputStream;
  5. import java.io.File;
  6. import java.io.FileInputStream;
  7. import java.io.FileNotFoundException;
  8. import java.io.FileOutputStream;
  9. import java.io.IOException;
  10. import java.io.OutputStreamWriter;
  11. import java.net.URL;
  12. import java.nio.charset.Charset;
  13. import java.nio.file.Files;
  14. import java.nio.file.Path;
  15. import java.util.ArrayList;
  16. import java.util.Calendar;
  17. import java.util.Date;
  18. import java.util.Set;
  19. import java.util.zip.ZipEntry;
  20. import java.util.zip.ZipOutputStream;
  21. import java.util.zip.GZIPOutputStream;
  22.  
  23. import org.apache.commons.lang3.ArrayUtils;
  24. import org.apache.logging.log4j.Level;
  25. import org.apache.logging.log4j.LogManager;
  26. import org.apache.logging.log4j.Logger;
  27. import org.apache.logging.log4j.spi.LoggerContextFactory;
  28.  
  29. import com.google.common.base.Charsets;
  30. import com.google.common.collect.ImmutableSet;
  31.  
  32. import net.minecraft.block.Block;
  33. import net.minecraft.block.BlockStone;
  34. import net.minecraft.block.material.Material;
  35. import net.minecraft.client.Minecraft;
  36. import net.minecraft.command.ServerCommandManager;
  37. import net.minecraft.creativetab.CreativeTabs;
  38. import net.minecraft.init.Items;
  39. import net.minecraft.item.Item;
  40. import net.minecraft.item.ItemStack;
  41. import net.minecraft.server.MinecraftServer;
  42. import net.minecraftforge.common.MinecraftForge;
  43. import net.minecraftforge.common.config.Configuration;
  44. import cpw.mods.fml.common.FMLCommonHandler;
  45. import cpw.mods.fml.common.Mod;
  46. import cpw.mods.fml.common.Mod.EventHandler;
  47. import cpw.mods.fml.common.Mod.Instance;
  48. import cpw.mods.fml.common.SidedProxy;
  49. import cpw.mods.fml.common.event.FMLInitializationEvent;
  50. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  51. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  52. import cpw.mods.fml.common.event.FMLServerStartingEvent;
  53. import cpw.mods.fml.common.event.FMLServerStoppingEvent;
  54. import cpw.mods.fml.common.network.NetworkRegistry;
  55. import cpw.mods.fml.common.registry.EntityRegistry;
  56. import cpw.mods.fml.common.registry.GameRegistry;
  57. import cpw.mods.fml.relauncher.Side;
  58.  
  59. import com.makersfactory.mfygps.GuiGPS;
  60.  
  61. @Mod(modid="MFYGPS", name="MFYGPS", version="0.0.4")
  62. public class MFYGPS {
  63.  
  64. @Instance(value = "1")
  65. public static MFYGPS instance;
  66.  
  67. public static Item handheldGPS = new Item()
  68. .setUnlocalizedName("handheldGPS")
  69. .setCreativeTab(CreativeTabs.tabTools)
  70. .setTextureName("mfygps-assets:handheldGPS");
  71.  
  72. @EventHandler
  73. public void preInit(FMLPreInitializationEvent event) {
  74. GameRegistry.registerItem(handheldGPS, "handheldGPS");
  75. }
  76.  
  77. @EventHandler
  78. public void serverLoad(FMLServerStartingEvent event) {
  79.  
  80. }
  81.  
  82. @EventHandler
  83. public void load(FMLInitializationEvent event) {
  84.  
  85. // INITIALIZE EVENT LISTENERS
  86. MinecraftForge.EVENT_BUS.register(new GuiGPS(Minecraft.getMinecraft()));
  87.  
  88. ItemStack oneIron = new ItemStack(Items.iron_ingot);
  89. ItemStack oneCompass = new ItemStack(Items.compass);
  90. ItemStack oneMap = new ItemStack(Items.map);
  91. ItemStack oneRedstone = new ItemStack(Items.redstone);
  92. ItemStack oneGPS = new ItemStack(handheldGPS);
  93.  
  94. GameRegistry.addRecipe(oneGPS, "ici", "iri", "imi", 'i', oneIron, 'c', oneCompass, 'r', oneRedstone, 'm', oneMap);
  95. }
  96.  
  97. @EventHandler
  98. public void postInit(FMLPostInitializationEvent event) {
  99.  
  100. }
  101. }
Advertisement
Add Comment
Please, Sign In to add comment