Java Code Examples for net.minecraftforge.event.RegistryEvent#Register

The following examples show how to use net.minecraftforge.event.RegistryEvent#Register . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommonProxy.java    From TofuCraftReload with MIT License 6 votes vote down vote up
@SubscribeEvent
   public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
	//boildEdamame
	GameRegistry.addSmelting( new ItemStack(ItemLoader.material,1,3), new ItemStack(ItemLoader.foodset,16,22), 0.25f);
	//SoyBeenParched
	GameRegistry.addSmelting( new ItemStack(ItemLoader.soybeans,1), new ItemStack(ItemLoader.material,1,6), 0.2f);

	GameRegistry.addSmelting( new ItemStack(ItemLoader.material,1,13), new ItemStack(ItemLoader.material,1,14), 0.2f);
	
	RecipesUtil.addOreDictionarySmelting("listAlltofu", new ItemStack(ItemLoader.tofu_food,1,3), 0.2f);
	
	GameRegistry.addSmelting(new ItemStack(ItemLoader.tofu_food,1,2), new ItemStack(ItemLoader.foodset,1,16), 0.2f);
	GameRegistry.addSmelting(new ItemStack(ItemLoader.material,1,20), new ItemStack(ItemLoader.foodset,1,8), 0.2f);
	GameRegistry.addSmelting(new ItemStack(ItemLoader.foodset,1,11), new ItemStack(ItemLoader.foodset,1,12), 0.2f);
	
	RecipesUtil.addOreDictionarySmelting("listAlltofuBlock", new ItemStack(BlockLoader.GRILD), 0.6f);
}
 
Example 2
Source File: ItemToroArmor.java    From ToroQuest with GNU General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void init(final RegistryEvent.Register<Item> event) {
	bootsItem = new ItemToroArmor(NAME + "_boots", 1, EntityEquipmentSlot.FEET);
	leggingsItem = new ItemToroArmor(NAME + "_leggings", 2, EntityEquipmentSlot.LEGS);
	helmetItem = new ItemToroArmor(NAME + "_helmet", 1, EntityEquipmentSlot.HEAD);
	chestplateItem = new ItemToroArmor(NAME + "_chestplate", 1, EntityEquipmentSlot.CHEST);

	bootsItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_boots"));
	event.getRegistry().register(bootsItem);

	leggingsItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_leggings"));
	event.getRegistry().register(leggingsItem);

	helmetItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_helmet"));
	event.getRegistry().register(helmetItem);

	chestplateItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_chestplate"));
	event.getRegistry().register(chestplateItem);
}
 
Example 3
Source File: ItemBookCode.java    From Minecoprocessors with GNU General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void registerRecipes(final RegistryEvent.Register<IRecipe> event) {
  NonNullList<Ingredient> lst = NonNullList.create();
  lst.add(Ingredient.fromItem(Items.WRITABLE_BOOK));
  lst.add(Ingredient.fromItem(BlockMinecoprocessor.ITEM_INSTANCE));
  event.getRegistry().register(new ShapelessRecipes("", new ItemStack(ItemBookCode.INSTANCE), lst) {
    @Override
    public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) {
      NonNullList<ItemStack> l = NonNullList.withSize(inv.getSizeInventory(), ItemStack.EMPTY);

      for (int i = 0; i < l.size(); ++i) {
        ItemStack stack = inv.getStackInSlot(i);

        if (stack.getItem() == BlockMinecoprocessor.ITEM_INSTANCE) {
          ItemStack returnStack = stack.copy();
          returnStack.setCount(1);
          l.set(i, returnStack);
          return l;
        }
      }

      throw new RuntimeException("Item to return not found in inventory");
    }
  }.setRegistryName(ItemBookCode.REGISTRY_NAME));
}
 
Example 4
Source File: ValkyrienSkiesMod.java    From Valkyrien-Skies with Apache License 2.0 6 votes vote down vote up
void registerBlocks(RegistryEvent.Register<Block> event) {
    physicsInfuser = new BlockPhysicsInfuser(Material.ROCK).setHardness(8f)
        .setTranslationKey("physics_infuser")
        .setRegistryName(MOD_ID, "physics_infuser")
        .setCreativeTab(VS_CREATIVE_TAB);
    physicsInfuserCreative = new BlockPhysicsInfuserCreative(Material.ROCK).setHardness(12f)
        .setTranslationKey("creative_physics_infuser")
        .setRegistryName(MOD_ID, "creative_physics_infuser")
        .setCreativeTab(VS_CREATIVE_TAB);
    // // Do not put the VS_CREATIVE_TAB block into the creative tab
    physicsInfuserDummy = new BlockPhysicsInfuserDummy(Material.ROCK).setHardness(12f)
        .setTranslationKey("dummy_physics_infuser")
        .setRegistryName(MOD_ID, "dummy_physics_infuser")
        .setCreativeTab(VS_CREATIVE_TAB);

    event.getRegistry().register(physicsInfuser);
    event.getRegistry().register(physicsInfuserCreative);
    event.getRegistry().register(physicsInfuserDummy);

    registerTileEntities();
}
 
Example 5
Source File: ValkyrienSkiesControl.java    From Valkyrien-Skies with Apache License 2.0 6 votes vote down vote up
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
    INSTANCE.relayWire = new ItemRelayWire().setTranslationKey("relay_wire")
        .setRegistryName(MOD_ID, "relay_wire")
        .setCreativeTab(ValkyrienSkiesMod.VS_CREATIVE_TAB);
    INSTANCE.multiBlockWrench = new ItemWrench().setTranslationKey("vs_wrench")
        .setRegistryName(MOD_ID, "vs_wrench")
        .setCreativeTab(ValkyrienSkiesMod.VS_CREATIVE_TAB);

    event.getRegistry()
        .register(INSTANCE.relayWire);
    event.getRegistry()
        .register(INSTANCE.multiBlockWrench);

    INSTANCE.vsControlBlocks.registerBlockItems(event);
    // This doesn't really belong here, but whatever.
    MultiblockRegistry
        .registerAllPossibleSchematicVariants(ValkyriumEngineMultiblockSchematic.class);
    MultiblockRegistry
        .registerAllPossibleSchematicVariants(ValkyriumCompressorMultiblockSchematic.class);
    MultiblockRegistry
        .registerAllPossibleSchematicVariants(RudderAxleMultiblockSchematic.class);
    MultiblockRegistry
        .registerAllPossibleSchematicVariants(GiantPropellerMultiblockSchematic.class);
}
 
Example 6
Source File: CommonProxy.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
public void registerSounds(RegistryEvent.Register<SoundEvent> event)
{
    IForgeRegistry<SoundEvent> registry = event.getRegistry();

    this.registerSound(registry, "jailer");
    this.registerSound(registry, "molecular_exciter");
}
 
Example 7
Source File: RoutiductBlocks.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void register(Block block, RegistryEvent.Register<Block> event, String... oreNames) {
    block.setCreativeTab(CommunityGlobals.TAB);
    event.getRegistry().register(block);
    ItemBlock itemBlock = new ItemBlock(block);
    ShootingStar.registerModel(new ModelCompound(RoutiductConstants.MOD_ID, itemBlock));
    itemBlock.setRegistryName(block.getRegistryName());
    ForgeRegistries.ITEMS.register(itemBlock);
    for (String oreName : oreNames) {
        OreDictionary.registerOre(oreName, block);
    }
}
 
Example 8
Source File: BaublesPlugin.java    From AgriCraft with MIT License 5 votes vote down vote up
@SubscribeEvent
public void registerItems(RegistryEvent.Register<Item> event) {
    if (ENABLE_AGRI_BAUBLE) {
        final ItemAgriBauble agriBauble = new ItemAgriBauble();
        agriBauble.setUnlocalizedName("agricraft:agri_bauble");
        agriBauble.setRegistryName("agricraft:agri_bauble");
        event.getRegistry().register(agriBauble);
        if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
            for (Tuple<Integer, ModelResourceLocation> entry : agriBauble.getModelDefinitions()) {
                ModelLoader.setCustomModelResourceLocation(agriBauble, entry.getFirst(), entry.getSecond());
            }
        }
    }
}
 
Example 9
Source File: AdvancedRocketry.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
@SubscribeEvent(priority=EventPriority.HIGH)
public void registerEnchants(RegistryEvent.Register<Enchantment> evt)
{
	//Enchantments
	AdvancedRocketryAPI.enchantmentSpaceProtection = new EnchantmentSpaceBreathing();
	AdvancedRocketryAPI.enchantmentSpaceProtection.setRegistryName(new ResourceLocation("advancedrocketry:spacebreathing"));
	evt.getRegistry().register(AdvancedRocketryAPI.enchantmentSpaceProtection);
}
 
Example 10
Source File: ModParticles.java    From MiningGadgets with MIT License 5 votes vote down vote up
@SubscribeEvent
public static void registerParticles(RegistryEvent.Register<ParticleType<?>> evt) {
    evt.getRegistry().registerAll(
            new LaserParticleType().setRegistryName("laserparticle"),
            new PlayerParticleType().setRegistryName("playerparticle"),
            new LightParticleType().setRegistryName("light_particle")
    );
}
 
Example 11
Source File: TQPotionTypes.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public static void registerPotionTypes(RegistryEvent.Register<PotionType> event) {
	event.getRegistry().registerAll(ROYALTY, ROYALTY_LONG, ROYALTY_STRONG, LOYALTY, LOYALTY_LONG, LOYALTY_STRONG);
}
 
Example 12
Source File: ItemSpicyChicken.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public static void init(final RegistryEvent.Register<Item> event) {
	INSTANCE = new ItemSpicyChicken();
	INSTANCE.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME));
	event.getRegistry().register(INSTANCE);
}
 
Example 13
Source File: CommonProxy.java    From Sakura_mod with MIT License 4 votes vote down vote up
@SubscribeEvent
public static void onSoundEvenrRegistration(RegistryEvent.Register<SoundEvent> event) {
    event.getRegistry().register(TAIKO.setRegistryName(new ResourceLocation(SakuraMain.MODID, "taiko")));
}
 
Example 14
Source File: SakuraMain.java    From Sakura_mod with MIT License 4 votes vote down vote up
@SubscribeEvent
public void registerBiomes(RegistryEvent.Register<Biome> event) {
    IForgeRegistry<Biome> registry = event.getRegistry();
    SakuraBiomes.register(registry);
}
 
Example 15
Source File: RoutiductRegistry.java    From CommunityMod with GNU Lesser General Public License v2.1 4 votes vote down vote up
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
    RoutiductBlocks.init(event);
}
 
Example 16
Source File: ItemSwordOfPain.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public static void init(final RegistryEvent.Register<Item> event) {
	INSTANCE = new ItemSwordOfPain();
	INSTANCE.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME));
	event.getRegistry().register(INSTANCE);
}
 
Example 17
Source File: ItemPickaxeOfGreed.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public static void init(final RegistryEvent.Register<Item> event) {
	INSTANCE = new ItemPickaxeOfGreed();
	INSTANCE.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME));
	event.getRegistry().register(INSTANCE);
}
 
Example 18
Source File: TinkerToolLeveling.java    From TinkersToolLeveling with MIT License 4 votes vote down vote up
@SubscribeEvent
protected void registerTools(RegistryEvent.Register<Item> event) {
  Config.INSTANCE.load(new File(modConfigurationDirectory, "TinkerToolLeveling.cfg"));
  Config.INSTANCE.save();
}
 
Example 19
Source File: Potions.java    From ToroQuest with GNU General Public License v3.0 3 votes vote down vote up
@SubscribeEvent
public static void registerPotions(RegistryEvent.Register<Potion> event) {

	event.getRegistry().registerAll(PotionRoyal.INSTANCE);

	initRecipes();
}
 
Example 20
Source File: TofuMain.java    From TofuCraftReload with MIT License 3 votes vote down vote up
@SubscribeEvent
public void registerBiomes(RegistryEvent.Register<Biome> event) {
    IForgeRegistry<Biome> registry = event.getRegistry();

    TofuBiomes.register(registry);

}