@Init
  public void init(FMLInitializationEvent event) {
    try {
      Class mystcraftApi = Class.forName("xcompwiz.mystcraft.api.APICallHandler");
      Class ageSymbol = Class.forName("xcompwiz.mystcraft.api.symbol.AgeSymbol");
      Class oreSymbol = Class.forName("shadow.mods.metallurgy.mystcraft.OreSymbol");
      Constructor constructor = oreSymbol.getConstructor(new Class[] {MetalSet.class});
      Method registerSymbol = mystcraftApi.getMethod("registerSymbol", new Class[] {ageSymbol});
      registerSymbol.invoke(mystcraftApi, constructor.newInstance(ores));
    } catch (Exception e) {
    }

    GameRegistry.registerBlock(PreciousChest, FC_ChestItemBlock.class);
    GameRegistry.registerTileEntity(FC_TileEntityChest.class, "PreciousChest");
    GameRegistry.registerBlock(Mint);
    GameRegistry.registerTileEntity(FM_TileEntityMint.class, "Mint");
    GameRegistry.registerBlock(MintStorage);
    GameRegistry.registerTileEntity(FM_TileEntityMintStorage.class, "MintStorage");

    if (ConfigPrecious.tradesEnabled)
      for (int i = 0; i < 5; i++)
        VillagerRegistry.instance().registerVillageTradeHandler(i, new PreciousTradeHandler());

    NetworkRegistry.instance().registerGuiHandler(instance, proxy);

    ((CreativeTabMetallurgy) creativeTab).setTabIconItemIndex(ores.Helmet[2].shiftedIndex);
    alloys.load();
    ores.load();

    proxy.addNames();
    proxy.registerTileEntitySpecialRenderer();
    proxy.registerRenderInformation();
    registerWithApi();
  }
Exemple #2
0
  public static void registerTrade(int profession, TradeEntry entry) {
    assert profession < tradeHelpers.length : "The profession is out of bounds";
    if (tradeHelpers[profession] == null) {
      tradeHelpers[profession] = new ModLoaderVillageTradeHandler();
      VillagerRegistry.instance().registerVillageTradeHandler(profession, tradeHelpers[profession]);
    }

    tradeHelpers[profession].addTrade(entry);
  }
  public void init() {
    super.init();
    RenderingRegistry.registerEntityRenderingHandler(
        EntityTriceratops.class, new RenderPrehistoric(new ModelTriceratops()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityVelociraptor.class, new RenderPrehistoric(new ModelVelociraptor()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityTyrannosaurus.class, new RenderPrehistoric(new ModelTyrannosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityPterosaur.class, new RenderPrehistoric(new ModelPteranodon()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityNautilus.class, new RenderFish(new ModelNautilus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityPlesiosaurus.class, new RenderPrehistoric(new ModelPlesiosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityMosasaurus.class, new RenderPrehistoric(new ModelMosasaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityStegosaurus.class, new RenderPrehistoric(new ModelStegosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityDilophosaurus.class, new RenderPrehistoric(new ModelDilophosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntitySmilodon.class, new RenderPrehistoric(new ModelSmilodon()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityBrachiosaurus.class, new RenderPrehistoric(new ModelBrachiosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityMammoth.class, new RenderPrehistoric(new ModelMammoth()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntitySpinosaurus.class, new RenderPrehistoric(new ModelSpinosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityCompsognathus.class,
        new RenderGlowingPrehistoric(
            new ModelCompsognathus(),
            new ResourceLocation("fossil:textures/mob/compsognathus/compsognathus_overlay.png")));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityDodo.class, new RenderPrehistoric(new ModelDodo()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityAnkylosaurus.class, new RenderPrehistoric(new ModelAnkylosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityPachycephalosaurus.class, new RenderPrehistoric(new ModelPachycephalosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityDeinonychus.class, new RenderPrehistoric(new ModelDeinonychus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityGallimimus.class, new RenderPrehistoric(new ModelGallimimus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntitySarcosuchus.class, new RenderPrehistoric(new ModelSarcosuchus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityAllosaurus.class, new RenderPrehistoric(new ModelAllosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityCoelacanth.class, new RenderFish(new ModelCoelacanth()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityLiopleurodon.class, new RenderPrehistoric(new ModelLiopleurodon()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityElasmotherium.class, new RenderPrehistoric(new ModelElasmotherium()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityCeratosaurus.class, new RenderPrehistoric(new ModelCeratosaurus()));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityConfuciusornis.class,
        new RenderFlyingPrehistoric(new ModelConfuciusornis(), new ModelFlyingConfuciusornis()));

    RenderingRegistry.registerEntityRenderingHandler(
        EntityStoneboard.class, new RenderStoneboard());
    RenderingRegistry.registerEntityRenderingHandler(
        EntityFailuresaurus.class, new RenderFailuresaurus(new ModelFailuresaurus(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityAnu.class, new RenderPigBoss(new ModelPigBoss(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityFriendlyPigZombie.class, new RenderFPZ());
    RenderingRegistry.registerEntityRenderingHandler(EntityDinoEgg.class, new RenderDinoEgg(1.5F));
    RenderingRegistry.registerEntityRenderingHandler(EntityJavelin.class, new RenderJavelin());
    RenderingRegistry.registerEntityRenderingHandler(
        EntityAncientJavelin.class, new RenderJavelin());
    RenderingRegistry.registerEntityRenderingHandler(EntityBones.class, new RenderBones());
    RenderingRegistry.registerEntityRenderingHandler(EntityAnuEffect.class, new RenderAnuEffect());
    RenderingRegistry.registerEntityRenderingHandler(EntityAnubite.class, new RenderAnubite());
    RenderingRegistry.registerEntityRenderingHandler(
        EntitySentryPigman.class, new RenderSentryPigman());
    RenderingRegistry.registerEntityRenderingHandler(
        EntityAnuDead.class, new RenderDeadAnu(new ModelDeadAnu(), 0.3F));
    RenderingRegistry.registerEntityRenderingHandler(EntityBirdEgg.class, new RenderBirdEgg());

    RenderingRegistry.registerEntityRenderingHandler(
        EntityQuagga.class, new RenderQuagga(new ModelQuagga(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(
        EntityTerrorBird.class, new RenderTerrorBird(new ModelTerrorBird(), 0.5F));

    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.figurineBlock), new ItemFigurineRenderer());
    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.vaseVoluteBlock), new ItemVaseVoluteRenderer());
    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.vaseAmphoraBlock), new ItemVaseAmphoraRenderer());
    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.vaseKylixBlock), new ItemVaseKylixRenderer());
    MinecraftForgeClient.registerItemRenderer(
        FAItemRegistry.ancientClock, new ItemAncientClocRender());

    RenderingRegistry.registerBlockHandler(Revival.feederRenderID, new RenderFeeder());

    VillagerRegistry.instance()
        .registerVillagerSkin(10, new ResourceLocation("fossil:textures/model/Archaeologist.png"));

    if (FossilConfig.skullOverlay) {
      MinecraftForge.EVENT_BUS.register(new EventOverlay(Minecraft.getMinecraft()));
    }

    TileEntitySpecialRenderer cultivate = new TileEntityCultivateRenderer();
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCultivate.class, cultivate);
    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.blockcultivateActive),
        new ItemRenderTileEntity(cultivate, new TileEntityCultivate()));
    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.blockcultivateIdle),
        new ItemRenderTileEntity(cultivate, new TileEntityCultivate()));

    TileEntitySpecialRenderer ancChest = new TileEntityAncientChestRender();
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAncientChest.class, ancChest);
    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.ancientChest),
        new ItemRenderTileEntity(ancChest, new TileEntityAncientChest()));

    TileEntitySpecialRenderer totem = new TileEntityAnuTotemRender();
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAnuTotem.class, totem);
    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.anuTotem),
        new ItemRenderAnuTotem(totem, new TileEntityAnuTotem()));

    TileEntitySpecialRenderer anubite = new TileEntityAnubiteStatueRender();
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAnubiteStatue.class, anubite);
    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.anubiteStatue),
        new ItemRenderAnubite(anubite, new TileEntityAnubiteStatue()));

    TileEntitySpecialRenderer sarcophagus = new TileEntitySarcophagusRender();
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySarcophagus.class, sarcophagus);
    MinecraftForgeClient.registerItemRenderer(
        Item.getItemFromBlock(FABlockRegistry.sarcophagus),
        new ItemRenderSarcophagus(sarcophagus, new TileEntitySarcophagus()));

    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTimeMachine.class, new RenderTNClock());
    ClientRegistry.bindTileEntitySpecialRenderer(
        TileEntityFigurine.class, new TileEntityFigurineRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(
        TileEntityVase.class, new TileEntityVaseRenderer());

    MinecraftForge.EVENT_BUS.register(new RenderPlayerCapes());
    MinecraftForge.EVENT_BUS.register(new EventNewMenu());
  }
 public void load() {
   VillagerRegistry.instance().registerVillageTradeHandler(GeneralConfiguration.villagerId, this);
 }
Exemple #5
0
 void addTradeHandler(int villagerID, IVillageTradeHandler handler) {
   VillagerRegistry.instance().registerVillageTradeHandler(villagerID, handler);
 }