Example #1
0
public class ChaosTabs {
  public ChaosTabs() {}

  public static final CreativeTabs tabChaosMaterials =
      new CreativeTabs(CreativeTabs.getNextID(), "tabChaosMaterials") {
        public Item getTabIconItem() {
          return ChaosItems.ItemRuby;
        }
      };

  public static final CreativeTabs tabChaosCombat =
      new CreativeTabs(CreativeTabs.getNextID(), "tabChaosCombat") {
        public Item getTabIconItem() {
          return ChaosItems.swordangelic;
        }
      };

  public static final CreativeTabs tabChaosTools =
      new CreativeTabs(CreativeTabs.getNextID(), "tabChaosTools") {
        public Item getTabIconItem() {
          return ChaosItems.pickaxeSapphire;
        }
      };

  public static final CreativeTabs tabChaosBlocks =
      new CreativeTabs(CreativeTabs.getNextID(), "tabChaosBlocks") {
        public Item getTabIconItem() {
          return Item.getItemFromBlock(ChaosBlocks.EnergyReactor);
        }
      };
}
Example #2
0
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
@NetworkMod(clientSideRequired = true, serverSideRequired = true)
public class Particular {

  @Instance(Reference.MOD_ID)
  public static Particular instance;

  @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
  public static CommonProxy proxy;

  public static CreativeTabs tabsParticular =
      new CreativeTabParticular(CreativeTabs.getNextID(), Reference.MOD_ID);

  EventManager eventmanager = new EventManager();

  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    // Register blocks & items
    ModItems.init();
    ModBlocks.init();
  }

  @EventHandler
  public void load(FMLInitializationEvent event) {
    // Register events
    NetworkRegistry.instance().registerGuiHandler(instance, proxy);
    LanguageRegistry.instance().addStringLocalization("itemGroup.Particular", "Particular");
    GameRegistry.registerWorldGenerator(eventmanager);
  }

  @EventHandler
  public void postInit(FMLPostInitializationEvent event) {
    // Interact with other mods
  }
}
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    config = new Configuration(event.getSuggestedConfigurationFile());

    tabRu =
        new CreativeTabs(CreativeTabs.getNextID(), Reference.Mod.MODID) { // Creative tab
          @Override
          public Item getTabIconItem() {
            return ItemInit.itemPancake;
          }

          @Override
          public String getTranslatedTabLabel() {
            return "Random Utilities";
          }
        };

    // Registration
    ItemInit.init();
    BlockInit.init();
    RecipeInit.init();
    MiscInit.init();
    MiscInit.eventInit();
    syncConfig();
  }
Example #4
0
/** Created by Tim on 7/29/2014. */
@Mod(modid = Defaults.MODID, version = Defaults.VERSION, name = Defaults.NAME)
public class Bagginses {
  @Mod.Instance(Defaults.MODID)
  public static Bagginses instance;

  @SidedProxy(clientSide = Defaults.CLIENTPROXY, serverSide = Defaults.COMMONPROXY)
  public static CommonProxy proxy;

  public static GuiHandler guiHandler = new GuiHandler();

  public static CreativeTabs BagTab = new BagTab(CreativeTabs.getNextID(), "Bagginses");

  public static String path;

  public static Configuration configuration;

  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {

    path =
        event.getModConfigurationDirectory().getAbsolutePath()
            + File.separator
            + Defaults.MODID.toLowerCase()
            + File.separator;
    ConfigHandler.init(path);

    ModItems.init();
  }

  @Mod.EventHandler
  public void init(FMLInitializationEvent event) {
    instance = this;
    proxy.registerEvents();
    NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);
    MinecraftForge.EVENT_BUS.register(this);
  }

  @Mod.EventHandler
  public void postInit(FMLPostInitializationEvent event) {
    BlockList.addFromString(ModConfig.black, "black");
    BlockList.addFromString(ModConfig.red, "red");
    BlockList.addFromString(ModConfig.brown, "brown");
    BlockList.addFromString(ModConfig.blue, "blue");
    BlockList.addFromString(ModConfig.cyan, "cyan");
    BlockList.addFromString(ModConfig.gray, "gray");
    BlockList.addFromString(ModConfig.green, "green");
    BlockList.addFromString(ModConfig.lightBlue, "lightBlue");
    BlockList.addFromString(ModConfig.lime, "lime");
    BlockList.addFromString(ModConfig.magenta, "magenta");
    BlockList.addFromString(ModConfig.orange, "orange");
    BlockList.addFromString(ModConfig.pink, "pink");
    BlockList.addFromString(ModConfig.purple, "purple");
    BlockList.addFromString(ModConfig.silver, "silver");
    BlockList.addFromString(ModConfig.white, "white");
    BlockList.addFromString(ModConfig.yellow, "yellow");
  }
}
@Mod(modid = "Ash_AmossomaAllTabs", name = "AmosomaAllTabs", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class AmossomaAllTabs {
  @SidedProxy(
      clientSide = "amossoma.ClientProxyAmossoma",
      serverSide = "amossoma.CommonProxyAmossoma")
  public static CommonProxyAmossoma proxy;

  @Init
  public void load(FMLInitializationEvent event) {
    proxy.registerRenderThings();
  }

  public static CreativeTabs AmossomaBlocksTab =
      new AmossomaBlocksTab(
          CreativeTabs.getNextID(), "AmossomaBlocksTab"); // Our custom creative tab's object
  public static CreativeTabs AmossomaReefsTab =
      new AmossomaReefsTab(
          CreativeTabs.getNextID(), "AmossomaReefsTab"); // Our custom creative tab's object
  public static CreativeTabs AmossomaDecoTab =
      new AmossomaDecoTab(
          CreativeTabs.getNextID(), "AmossomaDecoTab"); // Our custom creative tab's object
  public static CreativeTabs AmossomaMaterialsTab =
      new AmossomaMaterialsTab(
          CreativeTabs.getNextID(), "AmossomaMaterialsTab"); // Our custom creative tab's object
  public static CreativeTabs AmossomaPlantsTab =
      new AmossomaPlantsTab(
          CreativeTabs.getNextID(), "AmossomaPlantsTab"); // Our custom creative tab's object
  public static CreativeTabs AmossomaProductsTab =
      new AmossomaProductsTab(
          CreativeTabs.getNextID(), "AmossomaProductsTab"); // Our custom creative tab's object
}
Example #6
0
public class Reference {
  public static final String MOD_ID = "MMOMats";
  public static final String MOD_NAME = "MMO Materials";
  public static final String VERSION_NUMBER = "Alpha 0.1";
  public static final String CHANNEL_NAME = MOD_ID;
  public static final String DEPENDENCIES = "required-after:Forge@[7.7.1.650,)";
  public static final String FINGERPRINT = "@FINGERPRINT@";
  public static final int SECOND_IN_TICKS = 20;
  public static final int SHIFTED_ID_RANGE_CORRECTION = 256;
  public static final String SERVER_PROXY_CLASS = "uk.co.alteff4.mm.core.proxy.CommonProxy";
  public static final String CLIENT_PROXY_CLASS = "uk.co.alteff4.mm.core.proxy.ClientProxy";
  public static final int VERSION_CHECK_ATTEMPTS = 3;

  public static CreativeTabs CREATIVE_TAB_MATERIALS =
      new CreativeTabMaterials(CreativeTabs.getNextID(), MOD_ID + "Materials");
  public static CreativeTabs CREATIVE_TAB_GENERAL =
      new CreativeTabGeneral(CreativeTabs.getNextID(), MOD_ID);

  public static String createUnlocalizedName(String name) {
    return MOD_ID.toLowerCase() + "." + name;
  }
}
Example #7
0
/** Created by Tim on 7/29/2014. */
@Mod(modid = Defaults.MODID, version = Defaults.VERSION, name = Defaults.NAME)
public class Bagginses {
  @Mod.Instance(Defaults.MODID)
  public static Bagginses instance;

  @SidedProxy(clientSide = Defaults.CLIENTPROXY, serverSide = Defaults.COMMONPROXY)
  public static CommonProxy proxy;

  public static GuiHandler guiHandler = new GuiHandler();

  public static CreativeTabs BagTab = new BagTab(CreativeTabs.getNextID(), "Bagginses");

  public static String path;

  public static Configuration configuration;

  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    path =
        event.getModConfigurationDirectory().getAbsolutePath()
            + File.separator
            + Defaults.MODID.toLowerCase()
            + File.separator;
    ConfigHandler.init(path);

    ModItems.init();
  }

  @Mod.EventHandler
  public void init(FMLInitializationEvent event) {
    instance = this;
    NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);
    MinecraftForge.EVENT_BUS.register(this);
  }

  @Mod.EventHandler
  public void postInit(FMLPostInitializationEvent event) {}
}
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
@NetworkMod(
    channels = {Reference.CHANNEL_NAME},
    clientSideRequired = true,
    serverSideRequired = false,
    packetHandler = PacketHandler.class)
public class IndustrialAddons {

  @Instance(Reference.MOD_ID)
  public static IndustrialAddons instance;

  @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.COMMON_PROXY_CLASS)
  public static CommonProxy proxy;

  public static CreativeTabs tabsIndustrialAddons =
      new CreativeTabs(CreativeTabs.getNextID(), Reference.MOD_ID);

  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    ModFluids.init();
    ModBlocks.init();
    ModItems.init();

    // MultiPartContent.init();

    proxy.registerTileEntities();
  }

  @EventHandler
  public void init(FMLInitializationEvent event) {
    proxy.initRenderingAndTextures();
  }

  @EventHandler
  public void postInit(FMLPostInitializationEvent event) {
    ExtraRecipes.init();
  }
}
Example #9
0
@Mod(modid = References.MODID, name = References.MODNAME, version = References.VERSION)
public class MicroMod {

  public static Item farmerTop, farmerBottom, farmerBoots;

  @SidedProxy(
      clientSide = References.CLIENTPROXYLOCATION,
      serverSide = References.COMMONPROXYLOCATION)
  public static CommonProxy proxy;

  @Mod.Instance public static MicroMod instance;

  private static CreativeTabs wardTab = new MicroTab(CreativeTabs.getNextID(), References.MODID);

  public static CreativeTabs getCreativeTab() {
    return wardTab;
  }

  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    final ArmorMaterial farmer =
        EnumHelper.addArmorMaterial("Farmer", 3, new int[] {1, 3, 2, 1}, 2);
    int armor = proxy.addArmor("FarmerArmor");
    farmerTop = new FarmerArmor(farmer, armor, 1);
    farmerBottom = new FarmerArmor(farmer, armor, 2);
    farmerBoots = new FarmerArmor(farmer, armor, 3);
    CreateBlocks.init();
    CreateItems.init();
    CraftingHandler.init();
  }

  @Mod.EventHandler
  public static void init(FMLInitializationEvent event) {}

  @Mod.EventHandler
  public static void postInit(FMLPostInitializationEvent event) {}
}
Example #10
0
@Mod(
    modid = ReferenceLib.MOD_ID,
    name = ReferenceLib.MOD_ID,
    version = ReferenceLib.MOD_VERSION,
    certificateFingerprint = "5c22df6c25d089dce879c287801a862b3fe2cc4d",
    useMetadata = false)
@NetworkMod(
    versionBounds = ReferenceLib.MOD_VERSION,
    clientSideRequired = ReferenceLib.clientSideRequired,
    serverSideRequired = ReferenceLib.serverSideRequired)
public class CraftMineCore implements ISmartMod {
  @SidedProxy(
      clientSide = ReferenceLib.CLIENT_PROXY_CLASS,
      serverSide = ReferenceLib.SERVER_PROXY_CLASS)
  public static CommonProxy proxy;

  @Instance(ReferenceLib.MOD_ID)
  public static CraftMineCore instance;

  /** Is this the server? */
  public static boolean isServer = false;

  /** The logger instance. */
  public static Logger logger = Logger.getLogger("CraftMine");

  // CreativeTab
  public static CreativeTabs tabsCraftMine =
      new CreativeTabCraftMine(CreativeTabs.getNextID(), "CraftMine");
  public static CreativeTabs tabsCraftMineConstruction =
      new CreativeTabCraftMineConstruction(
          CreativeTabs.getNextID(), "CraftMine Construction Blocks");
  public static CreativeTabs tabsCraftMineTools =
      new CreativeTabCraftMineTools(CreativeTabs.getNextID(), "CraftMine Tools");

  public static Material liquidMat = (new MaterialLiquid(MapColor.woodColor));

  public static TextureEngine textureEngine = new TextureEngine(ReferenceLib.MOD_ID);
  public static LanguageEngine langEngine = new LanguageEngine("/mods/CraftMine/lang/");

  // Preinitialisation Event
  @PreInit
  public void preInit(FMLPreInitializationEvent event) throws Exception {
    logger.setParent(FMLLog.getLogger());
    try {
      if (CoreLoadingPlugin.callBack()) {
        CraftMineCore.logger.info("nintendofan9797-Core callback succeeded!");
      } else {
        throw new Exception();
      }
    } catch (Exception e) {
      throw new RuntimeException("nintendofan9797-Core is not installed/corrupt! Cannot proceed!");
    }

    try {
      Validator.verify(); // Do some loading checks, for example checking
      // the jar signature.

      EnumPacketType.put(
          "KEYARMOR",
          PacketKeyArmor.class,
          "KEYARMOR",
          PacketChannelLib.CHANNEL_ARMOR_TO_SERVER,
          EnumDirection.SERVER);
      EnumPacketType.put(
          "SOUND",
          PacketSound.class,
          "SOUND",
          PacketChannelLib.CHANNEL_SV_TO_CL,
          EnumDirection.CLIENT);
      EnumPacketType.put(
          "ENDPICK",
          PacketEndPick.class,
          "ENDPICK",
          PacketChannelLib.CHANNEL_ENDPICK,
          EnumDirection.SERVER);
      EnumPacketType.put(
          "RENAME",
          PacketRename.class,
          "RENAME",
          PacketChannelLib.CHANNEL_SV_TO_CL,
          EnumDirection.CLIENT);
      EnumPacketType.put(
          "GUI", PacketGui.class, "GUI", PacketChannelLib.CHANNEL_SV_TO_CL, EnumDirection.CLIENT);
      EnumPacketType.put(
          "CAMO", PacketCamo.class, "CAMO", PacketChannelLib.CHANNEL_CAMO, EnumDirection.CLIENT);
      EnumPacketType.put(
          "KEY", PacketKey.class, "KEY", PacketChannelLib.CHANNEL_KEY, EnumDirection.SERVER);

      CoreLoadingPlugin.manager.registerMod(new PacketHandlerClient(), "CMPKC");
      CoreLoadingPlugin.manager.registerMod(new PacketHandlerServer(), "CMPKS");

      CoreLoadingPlugin.manager.getContainerForId("CMPKC").setSide(Side.CLIENT);
      CoreLoadingPlugin.manager.getContainerForId("CMPKS").setSide(Side.SERVER);

      CoreLoadingPlugin.manager.registerChannelToMultipleHandlers(
          PacketChannelLib.CHANNEL_ARMOR_TO_SERVER, "CMPKS");
      CoreLoadingPlugin.manager.registerChannelToMultipleHandlers(
          PacketChannelLib.CHANNEL_CL_TO_SV, "CMPKS");
      CoreLoadingPlugin.manager.registerChannelToMultipleHandlers(
          PacketChannelLib.CHANNEL_DATA_UPDATE, "CMPKC");
      CoreLoadingPlugin.manager.registerChannelToMultipleHandlers(
          PacketChannelLib.CHANNEL_ENDPICK, "CMPKS");
      CoreLoadingPlugin.manager.registerChannelToMultipleHandlers(
          PacketChannelLib.CHANNEL_INV_CHANGE, "CMPKS");
      CoreLoadingPlugin.manager.registerChannelToMultipleHandlers(
          PacketChannelLib.CHANNEL_MAIN, "CMPKS");
      CoreLoadingPlugin.manager.registerChannelToMultipleHandlers(
          PacketChannelLib.CHANNEL_SV_TO_CL, "CMPKC");
      CoreLoadingPlugin.manager.registerChannelToMultipleHandlers(
          PacketChannelLib.CHANNEL_CAMO, "CMPKC");
      CoreLoadingPlugin.manager.registerChannelToMultipleHandlers(
          PacketChannelLib.CHANNEL_KEY, "CMPKS");

      proxy.registerConfigurationCategories();

      ReferenceLib.DAY = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
      // CraftMineCore.logger.info("Day: " + ReferenceLib.DAY);
      ReferenceLib.MONTH = Calendar.getInstance().get(Calendar.MONTH);
      // CraftMineCore.logger.info("Month: " + ReferenceLib.MONTH);

      logger.info("Attempting AutoUpdate...");
      UpdateMain.doVersionCheck();

      CapeLib.init();
      proxy.registerGuis();

      logger.info("Configuring API...");
      CraftMineApi.constructionTab = tabsCraftMineConstruction;
      CraftMineApi.coreTab = tabsCraftMine;
      CraftMineApi.toolsTab = tabsCraftMineTools;

      if (event.getSide() == Side.SERVER) {
        logger.info("Initializing Server-side...");
        isServer = true;
      } else {
        logger.info("Initializing Client-side...");
      }

      proxy.registerSounds();

      MinecraftForge.EVENT_BUS.register(new AttackHandler());

      logger.info("Reading/Writing configuration values...");

      try {
        Config.init();
      } catch (Exception e) {
        CraftMineCore.logger.warning("Error while initialising configuration!");
        CraftMineCore.logger.warning("Re-writing configuration file.");
        Config.rewriteConfig();
        Config.init();
      }

    } catch (Exception e) {
      CrashLogger.killWithError(e, "Fatal error during pre-initialization");
    }
  }

  // Initialisation Event
  @Init
  public void loadSequence(FMLInitializationEvent event) {
    try {

      MaterialRegistry.init();

      logger.info("Loading Module Aurora...");
      AuroraInit.init();

      proxy.registerCommonEventHandlers();
      proxy.registerClientEventHandlers();
      proxy.registerTileEntities();
      proxy.registerEntities();

      EnchantmentRegistry.init();

      ItemRegistry.init();
      BlockRegistry.init();
      ItemRegistry.initDepend();
      BlockRegistry.initDepend();

      LoaderEngine.registerMod(instance);

      CorruptionRegistry.init();

      OreDictionaryHelper.registerItems();
      LiquidDictionaryHelper.init();

      HandleRegistry.registerTools();

      ArmorRegistry.init();

      LiquidRegistry.init();

      EnergyNetMain.init();

      BiomeRegistry.init();

      Debug.init();

      DimensionManager.registerProviderType(
          Config.providerIDAtlantis.getValueInt(), CraftMineWorldProvider.class, true);
      DimensionManager.registerDimension(
          Config.dimensionIDAtlantis.getValueInt(), Config.providerIDAtlantis.getValueInt());

      GameRegistry.registerWorldGenerator(new WorldGenHandler());

      proxy.registerClientTicks();
      proxy.registerServerTicks();
      proxy.registerMiscTicks();

      KeyLib.beginKeyValueLocalization();

      proxy.registerKeyBindings();

      RecipeManager.init();

      proxy.registerRenderInformation();
      ItemDuplicatorRegistry.init();

      DictionaryLib.init();

      AchievementManager.init();

      TurretRegistry.init();

    } catch (Exception e) {
      CrashLogger.killWithError(e, "Fatal error during initialization");
    }
  }

  @PostInit
  public void postInit(FMLPostInitializationEvent event) throws Exception {
    try {

      DispenserActionRegistry.init();

      // Now that all mods have completed their main initialization
      // sequence, scan for other mods we want to
      // use the APIs of.
      ModDetector.beginModDetection();

      // Now, register the stairs and walls because the inclusions have
      // been registered.
      WallStairRegistrationHandler.addWallsAndStairs();

      CoreLoadingPlugin.EVENT_BUS.register(new ArmorProjectionHandler());

      logger.info("Registered " + BlockRegistry.blockcount + " blocks!");
      logger.info("Registered " + ItemRegistry.itemcount + " items!");

      FuelController.registerFuel(ItemRegistry.EndimoniumIngot.itemID, Integer.MAX_VALUE);

    } catch (Exception e) {
      CrashLogger.killWithError(e, "Fatal error during post-initialization");
    }
  }

  // Server Start Event
  @ServerStarting
  public void serverStarting(FMLServerStartingEvent event) {
    try {
      ServerPlatform.registerCommand(new CommandPortal());
      ServerPlatform.registerCommand(new CommandCraftMine());
      ServerPlatform.registerCommand(new CommandAFK());
      ServerPlatform.registerCommand(new CommandExtinguish());
      ServerPlatform.registerCommand(new CommandHat());
      ServerPlatform.registerCommand(new CommandMute());
      ServerPlatform.registerCommand(new CommandRename());
    } catch (Exception e) {
      CrashLogger.killWithError(e, "Fatal error during server start sequence");
    }
  }

  // Run NEI Integration
  @ServerStarted
  public void serverStarted(FMLServerStartedEvent event) {
    if (Loader.isModLoaded("NotEnoughItems")) {
      runNEIIntegration(event);
    }
  }

  // Will be used for advanced block checking.
  @VersionCheckHandler
  public boolean versionCheck(String ver, INetworkManager netMan) {
    return true;
  }

  private void runNEIIntegration(FMLServerStartedEvent event) {}

  @Override
  public CreativeTabs getDefaultCreativeTab() {
    return tabsCraftMine;
  }

  @Override
  public TextureEngine getDefaultTextureEngine() {
    return textureEngine;
  }

  @Override
  public LanguageEngine getDefaultLanguageEngine() {
    return langEngine;
  }
}
/**
 * Equivalent-Exchange-3
 *
 * <p>EquivalentExchange3
 *
 * @author pahimar
 * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
 */
@Mod(
    modid = Reference.MOD_ID,
    name = Reference.MOD_NAME,
    version = Reference.VERSION_NUMBER,
    dependencies = Reference.DEPENDENCIES,
    certificateFingerprint = Reference.FINGERPRINT)
@NetworkMod(
    channels = {Reference.CHANNEL_NAME},
    clientSideRequired = true,
    serverSideRequired = false,
    packetHandler = PacketHandler.class)
public class EquivalentExchange3 {

  @Instance(Reference.MOD_ID)
  public static EquivalentExchange3 instance;

  @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
  public static CommonProxy proxy;

  public static CreativeTabs tabsEE3 =
      new CreativeTabEE3(CreativeTabs.getNextID(), Reference.MOD_ID);

  @FingerprintWarning
  public void invalidFingerprint(FMLFingerprintViolationEvent event) {

    // Report (log) to the user that the version of Equivalent Exchange 3 they are using has been
    // changed/tampered with
    LogHelper.severe(Strings.INVALID_FINGERPRINT_MESSAGE);
  }

  @ServerStarting
  public void serverStarting(FMLServerStartingEvent event) {

    // Initialize the custom commands
    CommandHandler.initCommands(event);
  }

  @PreInit
  public void preInit(FMLPreInitializationEvent event) {

    // Initialize the log helper
    LogHelper.init();

    // Load the localization files into the LanguageRegistry
    LocalizationHandler.loadLanguages();

    // Initialize the configuration
    ConfigurationHandler.init(
        new File(
            event.getModConfigurationDirectory().getAbsolutePath()
                + File.separator
                + Reference.CHANNEL_NAME
                + File.separator
                + Reference.MOD_ID
                + ".cfg"));

    // Conduct the version check and log the result
    VersionHelper.execute();

    // Initialize the Version Check Tick Handler (Client only)
    TickRegistry.registerTickHandler(new VersionCheckTickHandler(), Side.CLIENT);

    // Initialize the Render Tick Handler (Client only)
    proxy.registerRenderTickHandler();

    // Register the KeyBinding Handler (Client only)
    proxy.registerKeyBindingHandler();

    // Register the Sound Handler (Client only)
    proxy.registerSoundHandler();

    // Initialize mod blocks
    ModBlocks.init();

    // Initialize mod items
    ModItems.init();
  }

  @SuppressWarnings("unchecked")
  @Init
  public void load(FMLInitializationEvent event) {

    // Register the GUI Handler
    NetworkRegistry.instance().registerGuiHandler(instance, proxy);

    // Register the PlayerDestroyItem Handler
    MinecraftForge.EVENT_BUS.register(new PlayerDestroyItemHandler());

    // Register the Item Pickup Handler
    MinecraftForge.EVENT_BUS.register(new ItemEventHandler());

    // Register the EntityLiving Handler
    MinecraftForge.EVENT_BUS.register(new EntityLivingHandler());

    MinecraftForge.EVENT_BUS.register(new ActionRequestHandler());

    MinecraftForge.EVENT_BUS.register(new WorldTransmutationHandler());

    GameRegistry.registerCraftingHandler(new CraftingHandler());

    // Register the DrawBlockHighlight Handler
    proxy.registerDrawBlockHighlightHandler();

    // Initialize mod tile entities
    proxy.registerTileEntities();

    // Initialize custom rendering and pre-load textures (Client only)
    proxy.initRenderingAndTextures();

    // Add in the ability to dye Alchemical Bags
    CraftingManager.getInstance().getRecipeList().add(new RecipesAlchemicalBagDyes());

    // Register the Fuel Handler
    GameRegistry.registerFuelHandler(new FuelHandler());

    // Quick test to see that sending an encoded recipe to be added to the recipe registry works
    FMLInterModComms.sendMessage(
        Reference.MOD_ID,
        InterModComms.ADD_RECIPE,
        NBTHelper.encodeRecipeAsNBT(
            Item.bucketWater, Arrays.asList(Item.bucketEmpty, Block.waterStill)));
    FMLInterModComms.sendMessage(
        Reference.MOD_ID,
        InterModComms.ADD_RECIPE,
        NBTHelper.encodeRecipeAsNBT(
            Item.bucketLava, Arrays.asList(Item.bucketEmpty, Block.lavaStill)));
  }

  @PostInit
  public void modsLoaded(FMLPostInitializationEvent event) {

    // Initialize the Addon Handler
    AddonHandler.init();

    // Initialize the DynEMC system
    @SuppressWarnings("unused")
    DynEMC dynEMC = DynEMC.getInstance();
  }

  @IMCCallback
  public void handleIMCMessages(IMCEvent event) {

    InterModCommsHandler.processIMCMessages(event);
  }
}
Example #12
0
@Mod(modid = NeoCraft.modid, name = "NeoCraft", version = "1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class NeoCraft {

  @Instance(NeoCraft.modid)
  public static NeoCraft instance;

  @SidedProxy(
      clientSide = "nucleon.neocraft.client.ClientProxy",
      serverSide = "nucleon.neocraft.CommonProxy")
  public static CommonProxy proxy;

  public static final String modid = "nucleon_neocraft";

  public static final CreativeTabNeoCraft ctab =
      new CreativeTabNeoCraft(net.minecraft.creativetab.CreativeTabs.getNextID(), "NeoCraft");

  Configuration config;

  // Items ============================//
  public static Item ingotChromium;
  public static Item ingotSteel;
  public static Item ingotStainlessSteel;
  public static Item circuitBoard;

  @PreInit
  public void preInit(FMLPreInitializationEvent event) {
    config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    config.save();
  }

  @Init
  public void load(FMLInitializationEvent event) {
    ingotChromium =
        new ItemBase(
            config.get(Configuration.CATEGORY_ITEM, "ingotChromium", 5501).getInt(),
            "ingotChromium");
    ingotSteel =
        new ItemBase(
            config.get(Configuration.CATEGORY_ITEM, "ingotSteel", 5502).getInt(), "ingotSteel");
    ingotStainlessSteel =
        new ItemBase(
            config.get(Configuration.CATEGORY_ITEM, "ingotStainlessSteel", 5503).getInt(),
            "ingotStainlessSteel");
    circuitBoard =
        new ItemBase(
            config.get(Configuration.CATEGORY_ITEM, "circuitBoard", 5504).getInt(), "circuitBoard");

    LanguageRegistry.addName(ingotChromium, "Chromium Ingot");
    LanguageRegistry.addName(ingotSteel, "Steel Ingot");
    LanguageRegistry.addName(ingotStainlessSteel, "Stainless Steel Ingot");
    LanguageRegistry.addName(circuitBoard, "Circuit Board");

    GameRegistry.addRecipe(
        new ItemStack(ingotSteel), "0y0", "yxy", "0y0", 'x', Item.ingotIron, 'y', Item.coal);
    GameRegistry.addRecipe(
        new ItemStack(ingotStainlessSteel, 9),
        "yyy",
        "yxy",
        "yyy",
        'x',
        ingotChromium,
        'y',
        ingotSteel);

    config.save();
  }
}
Example #13
0
@Mod(
    modid = DeeperCaves.MODID,
    version = DeeperCaves.VERSION,
    name = DeeperCaves.NAME) // , guiFactory = "com.kpabr.DeeperCaves.EndPlusConfigGUIFactory")
public class DeeperCaves {
  @SidedProxy(
      clientSide = "com.kpabr.DeeperCaves.client.ClientProxy",
      serverSide = "com.kpabr.DeeperCaves.CommonProxy")
  public static CommonProxy proxy;

  /*Mod ID and Version declarations*/
  public static final String MODID = "DeeperCaves";
  public static final String VERSION = "0.3.0";
  public static final String NAME = "DeeperCaves";
  static int versionID = 6; // Used by version checker!

  static DeeperMaterials materials = new DeeperMaterials();
  static DeeperBlocks blocks = new DeeperBlocks();
  static DeeperFluids fluids = new DeeperFluids();
  static DeeperItems items = new DeeperItems();
  static DeeperRecipes recipes = new DeeperRecipes();
  static DeeperWorldgen worldgen = new DeeperWorldgen();
  static DeeperMobs mobs = new DeeperMobs();
  static DeeperVersionChecker versionChecker = new DeeperVersionChecker();
  public static DeeperCaves instance;
  public static Configuration config;
  public int nearvoid_counter = 0;

  static CreativeTabs tabDeeperCaves =
      new TabDeeperCavesBlocks(
          CreativeTabs.getNextID(), "Deeper Caves Blocks", DeeperCaves.blocks.fragmentedBedrock);
  static CreativeTabs tabDeeperCavesItems =
      new TabDeeperCaves(CreativeTabs.getNextID(), "Deeper Caves Items", 0);
  static CreativeTabs tabDeeperCavesTools =
      new TabDeeperCaves(CreativeTabs.getNextID(), "Deeper Caves Tools", 1);

  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    config = new Configuration(event.getSuggestedConfigurationFile()); // gets default config file

    this.instance = this;

    FMLCommonHandler.instance().bus().register(worldgen);
    MinecraftForge.EVENT_BUS.register(worldgen);

    FMLCommonHandler.instance().bus().register(versionChecker);
    MinecraftForge.EVENT_BUS.register(versionChecker);

    FMLCommonHandler.instance().bus().register(this);
    MinecraftForge.EVENT_BUS.register(this);

    ClientCommandHandler.instance.registerCommand(new VersionCommand());

    fluids.setupFluids();
    fluids.setupFluidBlocks();
    items.setupItems();
    items.registerItems();
    items.registerItemsOreDict();
    blocks.setupBlocks();
    blocks.registerBlocks();
    blocks.registerBlocksOreDict();
    blocks.setupHarvestLevels();
    recipes.setupShapelessCrafting();
    recipes.setupShapedCrafting();
    recipes.setupSmelting();
    worldgen.setupWorldgen();
    mobs.setupMobs();
    proxy.registerRenderers();
  }

  @SubscribeEvent
  public void onPlayerTick(TickEvent.PlayerTickEvent event) {
    if (event.player.posY <= 0.0D) {
      try {
        EntityPlayerMP player = (EntityPlayerMP) event.player;
        if (player.dimension == 22) {
          player
              .mcServer
              .getConfigurationManager()
              .transferPlayerToDimension(
                  player, 0, new DeeperTeleporter(player.mcServer.worldServerForDimension(0)));
        }
        if (player.dimension == 15) {
          player
              .mcServer
              .getConfigurationManager()
              .transferPlayerToDimension(
                  player, 22, new DeeperTeleporter(player.mcServer.worldServerForDimension(22)));
        } else if (player.dimension == 0) {
          player
              .mcServer
              .getConfigurationManager()
              .transferPlayerToDimension(
                  player, 7, new DeeperTeleporter(player.mcServer.worldServerForDimension(7)));
        } else if (player.dimension == 12) {
          player
              .mcServer
              .getConfigurationManager()
              .transferPlayerToDimension(
                  player, 14, new DeeperTeleporter(player.mcServer.worldServerForDimension(14)));
        } else if (player.dimension >= 7 && player.dimension < 15) {
          player
              .mcServer
              .getConfigurationManager()
              .transferPlayerToDimension(
                  player,
                  player.dimension + 1,
                  new DeeperTeleporter(
                      player.mcServer.worldServerForDimension(player.dimension + 1)));
        } else {
        }
      } catch (ClassCastException e) {
        return; // not a player
      }
    } else if (event.player.posY >= 255.0D) {
      try {
        EntityPlayerMP player = (EntityPlayerMP) event.player;
        if (player.dimension == 7) {
          player
              .mcServer
              .getConfigurationManager()
              .transferPlayerToDimension(
                  player, 0, new DeeperTeleporter(player.mcServer.worldServerForDimension(0)));
        } else if (player.dimension == 15) {
          player
              .mcServer
              .getConfigurationManager()
              .transferPlayerToDimension(
                  player,
                  player.dimension - 2,
                  new DeeperTeleporter(
                      player.mcServer.worldServerForDimension(player.dimension - 2)));
        } else if (player.dimension > 7 && player.dimension < 15) {
          player
              .mcServer
              .getConfigurationManager()
              .transferPlayerToDimension(
                  player,
                  player.dimension - 1,
                  new DeeperTeleporter(
                      player.mcServer.worldServerForDimension(player.dimension - 1)));
        }
        if (player.dimension == 22) {
          player
              .mcServer
              .getConfigurationManager()
              .transferPlayerToDimension(
                  player, 15, new DeeperTeleporter(player.mcServer.worldServerForDimension(14)));
        } else {
        }
      } catch (ClassCastException e) {
        return; // not a player
      }
    } else {
    }
    try {
      EntityPlayerMP player = (EntityPlayerMP) event.player;
      if (event.player.posY <= 240.0D && player.dimension == 14) {
        if (this.nearvoid_counter == 200) {
          player.attackEntityFrom(DamageSource.outOfWorld, 0.5F);
          this.nearvoid_counter = 0;
        } else {
          this.nearvoid_counter = this.nearvoid_counter + 1;
        }
      }
    } catch (ClassCastException e) {
      return; // not a player
    }
  }
}
Example #14
0
 public EETab(String par2Str) {
   super(CreativeTabs.getNextID(), par2Str);
   LanguageRegistry.instance()
       .addStringLocalization("itemGroup.ElectricExpansion", "en_US", "Electric Expansion");
 }
Example #15
0
public class ModBlocks {

  /* Mod Block instances */
  public static Block HarmonionOre;
  public static Block HarmonionBlock;
  public static BlockHarmonionPortal HarmonionPortal;
  public static Block HarmonionFire;
  public static Block HarmonionLog;
  public static Block HarmonionLeaves;
  public static Block HarmonionSapling;
  public static Block HarmonionDoor;
  public static Block HarmonionGlass;

  private static Block blockMachineBeta;

  public static BlockMicro blockPower;
  public static BlockMachine blockMachine;
  public static BlockMachinePanel blockMachinePanel;
  public static BlockAppliance blockAppliance;
  public static int customBlockModel;

  public static final CreativeTabs tabHarmonioncraftB =
      new CreativeTabHarmonionB(CreativeTabs.getNextID(), "HarmonionB");
  public static final CreativeTabs tabHarmonioncraftW =
      new CreativeTabHarmonionP(CreativeTabs.getNextID(), "HarmonionP");

  public static void init() {

    /* Initialize each mod block individually */
    HarmonionOre = new BlockHarmonionOre(Config.getBlockID("blocks.base.harmonionore.id"), 0);
    HarmonionBlock = new BlockHarmonionBlock(Config.getBlockID("blocks.base.harmonionblock.id"), 3);
    HarmonionLog = new BlockHarmonionLog(Config.getBlockID("blocks.base.harmonionlog.id"));
    HarmonionLeaves = new BlockHarmonionLeaves(Config.getBlockID("blocks.base.harmonionleaves.id"));
    HarmonionSapling =
        new BlockHarmonionSapling(Config.getBlockID("blocks.base.harmonionsapling.id"), 13);
    HarmonionDoor =
        new BlockHarmonionDoor(
            Config.getBlockID("blocks.base.harmoniondoor.id"), 11, 12, Material.iron);
    HarmonionGlass =
        new BlockHarmonionGlass(
            Config.getBlockID("blocks.base.harmonionglass.id"), 4, Material.glass, false);
    HarmonionPortal =
        (BlockHarmonionPortal)
            ((BlockHarmonionPortal)
                (new BlockHarmonionPortal(
                    Config.getBlockID("blocks.base.harmonionportal.id"), 14)));
    HarmonionFire =
        (new BlockHarmonionFire(
            Config.getBlockID("blocks.base.harmonionfire.id"), Block.fire.blockIndexInTexture));

    blockPower = new BlockMicro(Config.getBlockID("blocks.base.harmonionwire.id"));
    blockPower.setBlockName("Harmonionwire");
    GameRegistry.registerBlock(blockPower, ItemMicro.class, "micro");
    blockPower.addTileEntityMapping(0, TileCovered.class);
    CoverLib.blockCoverPlate = blockPower;

    blockMachine = new BlockMachine(Config.getBlockID("blocks.base.harmonionmachine.id"));
    blockMachine.setBlockName("Harmonionmachine");
    GameRegistry.registerBlock(blockMachine, ItemExtended.class, "machine");
    blockMachine.setItemName(0, "Harmonionbatbox");
    GameRegistry.registerTileEntity(TileBatteryBox.class, "HarmoionBatBox");
    blockMachine.addTileEntityMapping(0, TileBatteryBox.class);

    blockMachinePanel =
        new BlockMachinePanel(Config.getBlockID("blocks.base.harmonionmachinepanel.id"));
    GameRegistry.registerBlock(blockMachinePanel, ItemMachinePanel.class, "machinePanel");
    GameRegistry.registerTileEntity(TileSolarPanel.class, "HarmonionSolar");
    blockMachinePanel.addTileEntityMapping(0, TileSolarPanel.class);
    blockMachinePanel.setItemName(0, "Harmonionsolar");

    blockAppliance = new BlockAppliance(Config.getBlockID("blocks.base.harmonionappliance.id"));
    GameRegistry.registerBlock(blockAppliance, ItemExtended.class, "appliance");
    GameRegistry.registerTileEntity(TileChargingBench.class, "HarmonionCharge");
    blockAppliance.setItemName(0, "harmonioncharge");
    blockAppliance.addTileEntityMapping(0, TileChargingBench.class);

    int var1;
    int var2;
    HarmonionLib.addCompatibleMapping(0, 1);

    for (var1 = 0; var1 < 16; ++var1) {
      HarmonionLib.addCompatibleMapping(0, 2 + var1);
      HarmonionLib.addCompatibleMapping(1, 2 + var1);
      HarmonionLib.addCompatibleMapping(65, 2 + var1);

      for (var2 = 0; var2 < 16; ++var2) {
        HarmonionLib.addCompatibleMapping(19 + var2, 2 + var1);
      }

      HarmonionLib.addCompatibleMapping(18, 2 + var1);
      HarmonionLib.addCompatibleMapping(18, 19 + var1);
    }

    HarmonionLib.addCompatibleMapping(0, 65);
    HarmonionLib.addCompatibleMapping(1, 65);
    HarmonionLib.addCompatibleMapping(64, 65);
    HarmonionLib.addCompatibleMapping(64, 67);
    HarmonionLib.addCompatibleMapping(65, 67);
    HarmonionLib.addCompatibleMapping(66, 67);

    /* Adds Blocks into the game */
    OreDictionary.registerOre("HarmonionOre", HarmonionOre);
    GameRegistry.registerBlock(HarmonionOre, BlockOresMeta.class);
    GameRegistry.registerBlock(HarmonionLeaves);
    GameRegistry.registerBlock(HarmonionLog);
    GameRegistry.registerBlock(HarmonionDoor);
    GameRegistry.registerBlock(HarmonionGlass);

    GameRegistry.registerBlock(HarmonionBlock);
    GameRegistry.registerBlock(HarmonionPortal);
    GameRegistry.registerBlock(HarmonionFire);

    DimensionManager.registerProviderType(
        Config.getBlockID("dimension.dimension.id"), WorldProviderHarmonion.class, false);
    DimensionManager.registerDimension(
        Config.getBlockID("dimension.dimension.id"), Config.getBlockID("dimension.dimension.id"));

    /* WorldGen */
    GameRegistry.registerWorldGenerator(new WorldPopulator());

    EnumMachineBeta[] var6 = EnumMachineBeta.values();
    int var3 = var6.length;
    int var4;
    var3 = var6.length;

    for (var4 = 0; var4 < var3; ++var4) {
      EnumMachineBeta var12 = var6[var4];

      if (var12.isEnabled()) {
        ItemRegistry.registerItem(var12.getTag(), var12.getItem());
      }
    }
  }

  public static void initBlockSmelting() {

    FurnaceRecipes furnaceRecipes = FurnaceRecipes.smelting();

    /* Harmonon Ore Smelting. */
    furnaceRecipes.addSmelting(
        ModBlocks.HarmonionOre.blockID, new ItemStack(ModItems.Refinedsoundstone), 5.0F);
  }

  public static void registerBlockMachineBeta() {
    if (blockMachineBeta == null) {
      int var0 = Config.getBlockID("blocks.base.harmoniontank.id");

      if (var0 > 0) {
        int var1 = Harmonion.proxy.getRenderIdTank();
        int[] var2 = new int[16];
        Arrays.fill(var2, 255);
        var2[EnumMachineBeta.TANK_IRON_WALL.ordinal()] = 0;
        var2[EnumMachineBeta.TANK_IRON_VALVE.ordinal()] = 0;
        var2[EnumMachineBeta.TANK_IRON_GAUGE.ordinal()] = 0;
        blockMachineBeta =
            (new net.Harmonion.tanks.BlockMachine(var0, var1, new MachineProxyBeta(), false, var2))
                .setBlockName("rcBlockMachineBeta");
        GameRegistry.registerBlock(
            blockMachineBeta, ItemMachine.class, blockMachineBeta.getBlockName());
        EnumMachineBeta[] var3 = EnumMachineBeta.values();
        int var4 = var3.length;

        for (int var5 = 0; var5 < var4; ++var5) {
          EnumMachineBeta var6 = var3[var5];
          MinecraftForge.setBlockHarvestLevel(blockMachineBeta, var6.ordinal(), "pickaxe", 2);
        }
      }
    }
  }

  public static Block getBlockMachineBeta() {
    return blockMachineBeta;
  }
}
@Mod(
    modid = LibModInfo.ID,
    name = LibModInfo.NAME,
    version = LibModInfo.VERSION,
    guiFactory = LibModInfo.GUI_FACTORY_CLASS)
public class ArmourersWorkshop {

  @Mod.Instance(LibModInfo.ID)
  public static ArmourersWorkshop instance;

  @SidedProxy(
      clientSide = LibModInfo.PROXY_CLIENT_CLASS,
      serverSide = LibModInfo.PROXY_COMMNON_CLASS)
  public static CommonProxy proxy;

  public static ModCreativeTab creativeTabArmorersWorkshop = new ModCreativeTab(LibModInfo.ID);
  public static CreativeTabArmourersWorkshop tabArmorersWorkshop =
      new CreativeTabArmourersWorkshop(CreativeTabs.getNextID(), LibModInfo.ID.toLowerCase());

  public static ModItems modItems;
  public static ModBlocks modBlocks;

  @Mod.EventHandler
  public void perInit(FMLPreInitializationEvent event) {
    ModLogger.log("Loading " + LibModInfo.NAME + " " + LibModInfo.VERSION);
    creativeTabArmorersWorkshop.setMinecraftCreativeTab(tabArmorersWorkshop);
    ConfigHandler.init(event.getSuggestedConfigurationFile());

    Addons.preInit();
    proxy.preInit();

    SkinIOUtils.makeLibraryDirectory();
    UpdateCheck.checkForUpdates();
    SkinExtractor.extractSkins();

    modItems = new ModItems();
    modBlocks = new ModBlocks();

    SkinTypeRegistry.init();
    CubeRegistry.init();
    proxy.initLibraryManager();
  }

  @Mod.EventHandler
  public void load(FMLInitializationEvent event) {
    CraftingManager.init();

    modBlocks.registerTileEntities();

    new GuiHandler();
    new ConfigSynchronizeHandler();

    PacketHandler.init();
    EntityEquipmentDataManager.init();
    EntitySkinHandler.init();

    proxy.init();
    proxy.registerKeyBindings();
    proxy.initRenderers();

    Addons.init();
  }

  @Mod.EventHandler
  public void postInit(FMLPostInitializationEvent event) {
    proxy.postInit();
    Addons.postInit();
    proxy.libraryManager.reloadLibrary();
  }

  @Mod.EventHandler
  public void serverStart(FMLServerStartingEvent event) {
    event.registerServerCommand(new CommandArmourers());
    SkinDataCache.INSTANCE.serverStarted();
  }

  @Mod.EventHandler
  public void serverStopped(FMLServerStoppedEvent event) {
    SkinDataCache.INSTANCE.serverStopped();
  }

  @Mod.EventHandler
  public void processIMC(FMLInterModComms.IMCEvent event) {
    for (IMCMessage imcMessage : event.getMessages()) {
      if (!imcMessage.isStringMessage()) continue;
      if (imcMessage.key.equalsIgnoreCase("register")) {
        ModLogger.log(
            String.format(
                "Receiving registration request from %s for class %s",
                imcMessage.getSender(), imcMessage.getStringValue()));
        ApiRegistrar.INSTANCE.addApiRequest(imcMessage.getSender(), imcMessage.getStringValue());
      }
    }
  }

  public static boolean isDedicated() {
    return proxy.getClass() == CommonProxy.class;
  }
}