private static void registerArtifacts() {
   GameRegistry.registerItem(anachDoodad, Names.ANACH_DOODAD);
   GameRegistry.registerItem(mustyJournal, Names.MUSTY_JOURNAL);
   GameRegistry.registerItem(perGuiVox, Names.PER_GUI_VOX);
   GameRegistry.registerItem(plotoniumScrap, Names.PLOTONIUM_SCRAP);
   GameRegistry.registerItem(voxBox, Names.VOX_BOX);
 }
Пример #2
0
  public static void init() {
    GameRegistry.addRecipe(
        new ItemStack(ModItems.findingRod), "A A", " A ", "A A", 'A', Blocks.COBBLESTONE);

    GameRegistry.addRecipe(
        new ItemStack(Items.ARROW), "A A", " A ", "A  ", 'A', Blocks.COBBLESTONE);
  }
Пример #3
0
  public static void oreCompressedCraft(Item item, Block block, Block ore, float exp) {

    if (ore != null) GameRegistry.addSmelting(ore, new ItemStack(item), exp);

    GameRegistry.addRecipe(new ItemStack(block), new Object[] {"###", "###", "###", '#', item});
    GameRegistry.addShapelessRecipe(new ItemStack(item, 9), new Object[] {block});
  }
 public void preInit(FMLPreInitializationEvent event) {
   GameRegistry.register(CustomModelBlock.instance);
   GameRegistry.register(
       new ItemBlock(CustomModelBlock.instance)
           .setRegistryName(CustomModelBlock.instance.getRegistryName()));
   GameRegistry.registerTileEntity(
       CustomTileEntity.class, MODID.toLowerCase() + ":custom_tile_entity");
 }
Пример #5
0
 @Override
 public void fire(FMLInitializationEvent e) {
   if (e.getSide() == Side.CLIENT) this.registerRender();
   if (this.recipe != null) {
     if (this.isShapeless) GameRegistry.addShapelessRecipe(new ItemStack(this), this.recipe);
     else GameRegistry.addRecipe(new ItemStack(this), this.recipe);
   }
 }
Пример #6
0
 public BlockBase(String blockName, Material materialIn) {
   super(materialIn);
   this.setCreativeTab(InterconnectTab.TAB);
   this.setUnlocalizedName(Interconnect.MODID + "." + blockName);
   this.setRegistryName(Interconnect.MODID, blockName);
   GameRegistry.register(this);
   GameRegistry.register(new ItemBlock(this).setRegistryName(Interconnect.MODID, blockName));
   registerItemModel(blockName);
 }
Пример #7
0
 public BlockPedestal() {
   super(Material.ROCK);
   setUnlocalizedName("pedestal");
   setRegistryName("pedestal");
   GameRegistry.register(this);
   GameRegistry.register(new ItemBlock(this), getRegistryName());
   GameRegistry.registerTileEntity(TilePedestal.class, "pedestal");
   setCreativeTab(Wizardry.tab);
 }
Пример #8
0
 public BlockManaBattery() {
   super(Material.GROUND);
   setUnlocalizedName("mana_battery");
   setRegistryName("mana_battery");
   GameRegistry.register(this);
   GameRegistry.register(new ItemBlock(this), getRegistryName());
   GameRegistry.registerTileEntity(TileManaBattery.class, "mana_battery");
   setCreativeTab(Wizardry.tab);
 }
Пример #9
0
  public static void armorCraft(
      Item item, Item armorHelmet, Item armorChestplate, Item armorLeggings, Item armorBoots) {

    GameRegistry.addRecipe(new ItemStack(armorHelmet), new Object[] {"###", "# #", '#', item});
    GameRegistry.addRecipe(
        new ItemStack(armorChestplate), new Object[] {"# #", "###", "###", '#', item});
    GameRegistry.addRecipe(
        new ItemStack(armorLeggings), new Object[] {"###", "# #", "# #", '#', item});
    GameRegistry.addRecipe(new ItemStack(armorBoots), new Object[] {"# #", "# #", '#', item});
  }
Пример #10
0
 protected void register(
     String name, Class<? extends GenericTE> clazz, Class<? extends ItemBlock> itemBlockClass) {
   setRegistryName(name);
   setUnlocalizedName(name);
   if (itemBlockClass == null) {
     GameRegistry.registerBlock(this);
   } else {
     GameRegistry.registerBlock(this, itemBlockClass);
   }
 }
 /**
  * Gives achievements/adds crafting recipes once certain blockcrafting objectives are completed
  *
  * @param e
  */
 @SubscribeEvent
 public void onBlockCrafted(PlayerEvent.ItemCraftedEvent e) {
   if (e.crafting.getItem().equals(Item.getItemFromBlock(ReimaginedBlocks.woodenStructure))) {
     e.player.addStat(AchievementLists.Achievement_woodenStructure, 1);
     GameRegistry.addRecipe(
         new ItemStack(ReimaginedBlocks.smoothStructure, 1),
         "CBC",
         "ASA",
         "CBC",
         'B',
         Blocks.stone,
         'A',
         Blocks.cobblestone,
         'C',
         Blocks.stone_slab,
         'S',
         ReimaginedItems.stickySubstance);
   } else if (e.crafting
       .getItem()
       .equals(Item.getItemFromBlock(ReimaginedBlocks.smoothStructure))) {
     e.player.addStat(AchievementLists.Achievement_smoothStructure, 1);
     GameRegistry.addRecipe(
         new ItemStack(ReimaginedBlocks.netherStructure, 1),
         "CBC",
         "ASA",
         "CBC",
         'B',
         Blocks.netherrack,
         'A',
         Blocks.nether_brick_fence,
         'C',
         Blocks.nether_brick,
         'S',
         ReimaginedItems.superGlue);
   } else if (e.crafting
       .getItem()
       .equals(Item.getItemFromBlock(ReimaginedBlocks.netherStructure))) {
     e.player.addStat(AchievementLists.Achievement_netherStructure, 1);
   } else if (e.crafting
       .getItem()
       .equals(Item.getItemFromBlock(ReimaginedBlocks.reinforcedStructure))) {
     e.player.addStat(AchievementLists.Achievement_reinforcedStructure, 1);
   } else if (e.crafting.getItem().equals(Item.getItemFromBlock(ReimaginedBlocks.basicGearbox))) {
     e.player.addStat(AchievementLists.Achievement_basicGearbox, 1);
   } else if (e.crafting
       .getItem()
       .equals(Item.getItemFromBlock(ReimaginedBlocks.advancedGearbox))) {
     e.player.addStat(AchievementLists.Achievement_advancedGearbox, 1);
   } else if (e.crafting
       .getItem()
       .equals(Item.getItemFromBlock(ReimaginedBlocks.reinforcedGearbox))) {
     e.player.addStat(AchievementLists.Achievement_reinforcedGearbox, 1);
   }
 }
 public static void addRecipe(
     ItemFoodAppleMagic apple, ItemStack ingredient, boolean isExpensive) {
   int refund = 8;
   if (isExpensive) {
     GameRegistry.addRecipe(
         new ItemStack(apple), "lll", "lal", "lll", 'l', ingredient, 'a', Items.APPLE);
   } else {
     GameRegistry.addShapelessRecipe(new ItemStack(apple), ingredient, Items.APPLE);
     refund = 1;
   }
   GameRegistry.addSmelting(
       apple, new ItemStack(ingredient.getItem(), refund, ingredient.getMetadata()), smeltexp);
 }
Пример #13
0
 public ItemTrolldenApple() {
   super(-4, -9.6F, false);
   this.setAlwaysEdible();
   setCreativeTab(DerpMod.tabDerpMod);
   setUnlocalizedName(DerpMod.MODID + "_" + name);
   GameRegistry.registerItem(this, name);
 }
Пример #14
0
  public static void makeRecipes() {

    // 2 items shapeless is 1 block

    GameRegistry.addShapelessRecipe(
        new ItemStack(MyBlocks.block_light), MyItems.item_ring, MyItems.item_ring);

    // 4 items in pattern results in 3 blocks
    GameRegistry.addRecipe(
        new ItemStack(MyBlocks.block_light, 3), "## ", " ##", '#', MyItems.item_ring);

    // Lapiz in furnace = item_ring
    // last argument is XP, iron (0.7), gold/diamond/em ore (1) beef/meat (0.35)
    GameRegistry.addSmelting(
        new ItemStack(Items.dye, 1, 4), new ItemStack(MyItems.item_ring), 0.5f);
  }
  public static void registerBlocks() {

    BlockRegistry.block_storewater = new BlockBucketStorage(Items.water_bucket);
    registerBucketBlock(BlockRegistry.block_storewater, "block_storewater");

    BlockRegistry.block_storemilk = new BlockBucketStorage(Items.milk_bucket);
    registerBucketBlock(BlockRegistry.block_storemilk, "block_storemilk");

    BlockRegistry.block_storelava = new BlockBucketStorage(Items.lava_bucket);
    registerBucketBlock(BlockRegistry.block_storelava, "block_storelava");

    GameRegistry.registerTileEntity(TileEntityBucketStorage.class, ModBucketBlocks.MODID);

    BlockRegistry.block_storeempty = new BlockBucketStorage(null); // null
    // for
    // emtpy,
    // no
    // liquids
    // stored
    // inside
    BlockRegistry.block_storeempty.setCreativeTab(CreativeTabs.tabMisc);
    registerBucketBlock(BlockRegistry.block_storeempty, "block_storeempty");

    BlockRegistry.block_storeempty.addRecipe();
  }
Пример #16
0
 public static void registerAll() {
   for (ModBlocks block : ModBlocks.values()) {
     Block b = block.get();
     b.setLightLevel(1.0f);
     GameRegistry.registerBlock(b, block.getName());
   }
 }
 public CookingPlusHeartCutter() {
   GameRegistry.registerItem(this, name);
   setUnlocalizedName("heartcutter");
   setCreativeTab(CreativeTabs.tabMisc);
   // setTextureName(CookingPlusMain.MODID + ":dough");
   setMaxStackSize(1);
 }
  private static void registerTools() {
    GameRegistry.registerItem(shovelBronze, shovelBronze.getUndecoratedName());
    GameRegistry.registerItem(pickBronze, pickBronze.getUndecoratedName());
    GameRegistry.registerItem(axeBronze, axeBronze.getUndecoratedName());
    GameRegistry.registerItem(hoeBronze, hoeBronze.getUndecoratedName());

    GameRegistry.registerItem(buildToolForm, buildToolForm.getUndecoratedName() + "_form");

    GameRegistry.registerItem(shovelSteel, shovelSteel.getUndecoratedName());
    GameRegistry.registerItem(pickSteel, pickSteel.getUndecoratedName());
    GameRegistry.registerItem(axeSteel, axeSteel.getUndecoratedName());
    GameRegistry.registerItem(hoeSteel, hoeSteel.getUndecoratedName());
  }
Пример #19
0
  public void preInit(FMLPreInitializationEvent e) {
    AdvancedIndustryItems.createItems();
    AdvancedIndustryBlock.createBlocks();
    AdvancedIndustryTileEntities.init();
    AdvancedIndustryRecipes.initCrafting();

    GameRegistry.registerWorldGenerator(new WorldGen(), 0);
  }
  public static void registerBucketBlock(Block s, String name) {

    s.setUnlocalizedName(name);

    GameRegistry.registerBlock(s, ItemBlockBucket.class, name);

    blocks.add(s);
  }
Пример #21
0
 public AdvancedArmor(String name, int renderIndex, EntityEquipmentSlot type) {
   super(GAMod.AdvancedArmorMaterial, renderIndex, type);
   this.setNoRepair();
   this.name = name;
   this.setUnlocalizedName(name);
   this.setCreativeTab(GeoActivity.tabMain);
   GameRegistry.register(this.setRegistryName(Reference.MOD_ID, name));
 }
Пример #22
0
 public BasicMoment() {
   this.setMaxStackSize(64);
   this.setRegistryName("basicmoment");
   GameRegistry.registerItem(this, "b");
   this.setUnlocalizedName("parachronology:basicmoment");
   this.setHasSubtypes(false);
   this.setMaxDamage(0);
 }
 /**
  * Registers a new ItemModel.
  *
  * <p>Will only work if the itemModel json file has the same name as the registered blocks/items
  * id.
  *
  * @param name The itemModel/block name
  */
 private static void registerItemRendering(String name) {
   Minecraft.getMinecraft()
       .getRenderItem()
       .getItemModelMesher()
       .register(
           GameRegistry.findItem("kalstuff", name),
           0,
           new ModelResourceLocation("kalstuff:" + name, "inventory"));
 }
Пример #24
0
  public void register() {
    MinecraftForge.EVENT_BUS.register(this);

    GameRegistry.registerItem(itemTest, "itemTest");
    Minecraft.getMinecraft()
        .getRenderItem()
        .getItemModelMesher()
        .register(itemTest, 0, new ModelResourceLocation("airix:itemTest", "inventory"));
  }
  @Override
  public void registerRecipes() {

    // todo: make it work with knifes
    GameRegistry.addShapelessRecipe(
        new ItemStack(this),
        new ItemStack(ReforgedRegistry.MUSKET),
        materialDefinition.getRepairMaterial());
  }
Пример #26
0
 /**
  * Imports resources from resource packs that contain the "modbuilder" metadata.
  *
  * @param manager - the resource manager to use
  */
 private void importResources(IResourceManager manager) {
   List entries = Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries();
   for (Object entry : entries) {
     try {
       MetadataSection data =
           (MetadataSection)
               ((ResourcePackRepository.Entry) entry)
                   .getResourcePack()
                   .getPackMetadata(new MetadataSerializer(), "modbuilder");
       if (data.modbuilder != null) importResources(manager, data.modbuilder);
     } catch (IOException e) {
       // ignore
     }
   }
   GameRegistry.registerWorldGenerator(registry, 0);
   IFuelHandler f = new FuelHandler(fuels);
   GameRegistry.registerFuelHandler(f);
 }
  /**
   * Registers a valid dust into the RunesOfWizardry system. MUST EXTEND IDUST!! <br>
   * Note: also registers it as an Item in the GameRegistry, sets up its unlocalized name and
   * creative tab.
   */
  public static void registerDust(final IDust dustclass) {
    // add it to our list of dusts
    dusts.add(dustclass);

    dustclass.setUnlocalizedName(dustclass.getmodid() + "_" + dustclass.getName());
    dustclass.setCreativeTab(dustclass.creativeTab());

    GameRegistry.registerItem(dustclass, dustclass.getName());

    // list of subItems
    List<ItemStack> subDusts = new ArrayList<ItemStack>(15);
    // get the subDusts. hopefully, tabAllSearch is the right one
    dustclass.getSubItems(dustclass, CreativeTabs.tabAllSearch, subDusts);

    // create the block form of the dust
    if (!dustclass.hasCustomBlock()) {
      Block dustBlock =
          new IDustStorageBlock(Material.sand) {

            @Override
            public IDust getIDust() {
              return dustclass;
            }
          };

      // Crafting
      // hopefully this is enough for metadata
      for (ItemStack i : subDusts) {
        GameRegistry.addShapedRecipe(
            new ItemStack(dustBlock, 1, i.getItemDamage()),
            new Object[] {"XXX", "XXX", "XXX", 'X', i});
        GameRegistry.addShapelessRecipe(i, new ItemStack(dustBlock, 1, i.getItemDamage()));
      }
    }

    // register the recipes for this dust
    // TODO use a custom RecipeHandler
    for (ItemStack i : subDusts) {
      ItemStack[] items = dustclass.getInfusionItems(i);
      if (items != null) {
        recipes.put(items, i);
      }
    }
  }
  private static void registerArmor() {
    GameRegistry.registerItem(helmetBronze, helmetBronze.getUndecoratedName());
    GameRegistry.registerItem(chestplateBronze, chestplateBronze.getUndecoratedName());
    GameRegistry.registerItem(leggingsBronze, leggingsBronze.getUndecoratedName());
    GameRegistry.registerItem(bootsBronze, bootsBronze.getUndecoratedName());

    GameRegistry.registerItem(helmetSteel, helmetSteel.getUndecoratedName());
    GameRegistry.registerItem(chestplateSteel, chestplateSteel.getUndecoratedName());
    GameRegistry.registerItem(leggingsSteel, leggingsSteel.getUndecoratedName());
    GameRegistry.registerItem(bootsSteel, bootsSteel.getUndecoratedName());
  }
Пример #29
0
  @EventHandler
  public void init(FMLInitializationEvent event) throws Exception {
    packetPipeline.registerMessage(
        AnvilTechniquePacket.Handler.class, AnvilTechniquePacket.class, 0, Side.SERVER);
    packetPipeline.registerMessage(
        ChunkPutNbtPacket.Handler.class, ChunkPutNbtPacket.class, 1, Side.CLIENT);
    packetPipeline.registerMessage(
        ChunkRemoveNbtPacket.Handler.class, ChunkRemoveNbtPacket.class, 2, Side.CLIENT);
    packetPipeline.registerMessage(
        SoundEffectToServerPacket.Handler.class, SoundEffectToServerPacket.class, 3, Side.SERVER);
    packetPipeline.registerMessage(
        MechanicalNetworkNBTPacket.ClientHandler.class,
        MechanicalNetworkNBTPacket.class,
        4,
        Side.CLIENT);
    packetPipeline.registerMessage(
        StartMeteorShowerPacket.ClientHandler.class, StartMeteorShowerPacket.class, 5, Side.CLIENT);
    packetPipeline.registerMessage(
        WorldDataPacket.ClientHandler.class, WorldDataPacket.class, 6, Side.CLIENT);
    packetPipeline.registerMessage(
        CarpentryTechniquePacket.Handler.class, CarpentryTechniquePacket.class, 7, Side.SERVER);

    BlocksVC.init();
    ItemsVC.init();
    AchievementsVC.init();

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

    proxy.registerTileEntities();

    NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);

    System.out.println("vcraft has init.");

    GameRegistry.registerWorldGenerator(new WorldGenDeposits(), 4);

    WorldType.DEFAULT = WorldTypeVC.DEFAULT;
    WorldType.FLAT = WorldTypeVC.FLAT;

    // DimensionManager.unregisterDimension(-1);
    DimensionManager.unregisterDimension(0);
    DimensionManager.unregisterDimension(1);

    // DimensionManager.unregisterProviderType(-1);
    DimensionManager.unregisterProviderType(0);
    DimensionManager.unregisterProviderType(1);
    DimensionManager.registerProviderType(0, WorldProviderVC.class, true);
    DimensionManager.registerProviderType(1, WorldProviderVC.class, false);

    // DimensionManager.registerDimension(-1, -1);
    DimensionManager.registerDimension(0, 0);
    DimensionManager.registerDimension(1, 1);

    proxy.init(event);
  }
Пример #30
0
  @EventHandler
  public static void preinit(FMLPreInitializationEvent PreEvent) {
    // Enum Item ToolMaterials
    ToolMaterial copper = EnumHelper.addToolMaterial("copper", 2, 320, 5.5F, 2.5F, 16);

    // Blocks
    copperOre = new CopperOre();

    // Blocks Language Registry
    LanguageRegistry.addName(copperOre, "Copper Ore");

    // Tools
    copperAxe = new CopperAxe(copper);
    copperPickaxe = new CopperPickaxe(copper);
    copperSpade = new CopperSpade(copper);
    copperSword = new CopperSword(copper);
    copperHoe = new CopperHoe(copper);

    GameRegistry.registerItem(copperAxe = new CopperAxe(copper), "copperAxe");
    GameRegistry.registerItem(copperPickaxe = new CopperPickaxe(copper), "copperPickaxe");
    GameRegistry.registerItem(copperSpade = new CopperSpade(copper), "copperSpade");
    GameRegistry.registerItem(copperSword = new CopperSword(copper), "copperSword");
    GameRegistry.registerItem(copperHoe = new CopperHoe(copper), "copperHoe");

    // Tools Language Registry
    LanguageRegistry.addName(copperAxe, "Copper Axe");
    LanguageRegistry.addName(copperPickaxe, "Copper Pickaxe");
    LanguageRegistry.addName(copperSpade, "Copper Shovel");
    LanguageRegistry.addName(copperHoe, "Copper Hoe");
    LanguageRegistry.addName(copperSword, "Copper Sword");

    // Items
    copperIngot = new CopperIngot();

    // Items Language Registry
    LanguageRegistry.addName(copperIngot, "Copper Ingot");

    // Recipes
    ModRecipes.addRecipes();

    // Event Handler Registry
    proxy.registerRenderInfo();
  }