Search in sources :

Example 11 with SCManualPage

use of net.geforcemods.securitycraft.misc.SCManualPage in project SecurityCraft by Geforce132.

the class ConfigurationHandler method registerBlock.

/**
	 * Registers the given block with GameRegistry.registerBlock(), and adds the help info for the block to the SecurityCraft manual item.
	 */
private void registerBlock(Block block) {
    GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5));
    mod_SecurityCraft.instance.manualPages.add(new SCManualPage(Item.getItemFromBlock(block), I18n.translateToLocal("help." + block.getUnlocalizedName().substring(5) + ".info")));
}
Also used : SCManualPage(net.geforcemods.securitycraft.misc.SCManualPage)

Example 12 with SCManualPage

use of net.geforcemods.securitycraft.misc.SCManualPage in project SecurityCraft by Geforce132.

the class RegistrationHandler method registerBlock.

/**
 * Registers the given block with GameRegistry.registerBlock(), and adds the help info for the block to the SecurityCraft manual item.
 */
private static void registerBlock(Block block) {
    GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5));
    SecurityCraft.instance.manualPages.add(new SCManualPage(Item.getItemFromBlock(block), "help." + block.getUnlocalizedName().substring(5) + ".info"));
}
Also used : SCManualPage(net.geforcemods.securitycraft.misc.SCManualPage)

Example 13 with SCManualPage

use of net.geforcemods.securitycraft.misc.SCManualPage in project SecurityCraft by Geforce132.

the class RegistrationHandler method registerItemWithCustomRecipe.

/**
 * Registers the given item with GameData.register_implItem(), and adds the help info for the item to the SecurityCraft manual item.
 * Also overrides the default recipe that would've been drawn in the manual with a new recipe.
 */
private static void registerItemWithCustomRecipe(Item item, ItemStack... customRecipe) {
    GameData.register_impl(item);
    NonNullList<Ingredient> recipeItems = NonNullList.<Ingredient>withSize(customRecipe.length, Ingredient.EMPTY);
    for (int i = 0; i < recipeItems.size(); i++) recipeItems.set(i, Ingredient.fromStacks(customRecipe[i]));
    SecurityCraft.instance.manualPages.add(new SCManualPage(item, "help." + item.getUnlocalizedName().substring(5) + ".info", recipeItems));
}
Also used : Ingredient(net.minecraft.item.crafting.Ingredient) SCManualPage(net.geforcemods.securitycraft.misc.SCManualPage)

Example 14 with SCManualPage

use of net.geforcemods.securitycraft.misc.SCManualPage in project SecurityCraft by Geforce132.

the class RegistrationHandler method registerItem.

/**
 * Registers the given item with GameData.register_implItem(), and adds the help info for the item to the SecurityCraft manual item.
 */
private static void registerItem(Item item) {
    GameData.register_impl(item);
    SecurityCraft.instance.manualPages.add(new SCManualPage(item, "help." + item.getUnlocalizedName().substring(5) + ".info"));
}
Also used : SCManualPage(net.geforcemods.securitycraft.misc.SCManualPage)

Example 15 with SCManualPage

use of net.geforcemods.securitycraft.misc.SCManualPage in project SecurityCraft by Geforce132.

the class RegistrationHandler method registerBlock.

/**
 * Registers a block with a custom ItemBlock
 * @param block The Block to register
 * @param itemBlock The ItemBlock to register
 * @param initPage Wether a SecurityCraft Manual page should be added for the block
 */
private static void registerBlock(Block block, ItemBlock itemBlock, boolean initPage) {
    GameRegistry.register(block);
    GameRegistry.register(itemBlock.setRegistryName(block.getRegistryName().toString()));
    if (initPage)
        if (block == SCContent.reinforcedStone)
            SecurityCraft.instance.manualPages.add(new SCManualPage(Item.getItemFromBlock(block), "help.reinforced.info"));
        else
            SecurityCraft.instance.manualPages.add(new SCManualPage(Item.getItemFromBlock(block), "help." + block.getUnlocalizedName().substring(5) + ".info"));
}
Also used : SCManualPage(net.geforcemods.securitycraft.misc.SCManualPage)

Aggregations

SCManualPage (net.geforcemods.securitycraft.misc.SCManualPage)15 Ingredient (net.minecraft.item.crafting.Ingredient)1