Java Examples for net.minecraftforge.fml.common.registry.GameRegistry
The following java examples will help you to understand the usage of net.minecraftforge.fml.common.registry.GameRegistry. These source code samples are taken from different open source projects.
Example 1
| Project: Pearcel-Mod-master File: PearcelMod.java View source code |
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
ConfigurationHandler.init(event.getSuggestedConfigurationFile());
MinecraftForge.EVENT_BUS.register(new ConfigurationHandler());
ModItems.init();
ModItems.register();
ModBlocks.init();
ModBlocks.register();
ModTileEntities.init();
ModEntities.init();
ModLoots.init();
ModSoundEvents.registerSounds();
EntityRegistry.registerModEntity(EntityEnderPearcel.class, "EnderPearcel", 10, this, 350, 50, true);
GameRegistry.registerFuelHandler(new ItemPearcelFuel());
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
proxy.preInit(event);
}Example 2
| Project: ExoticPower-master File: TileEntityTestGui.java View source code |
public static int getItemBurnTime(ItemStack p_145952_0_) {
if (p_145952_0_ == null) {
return 0;
} else {
Item item = p_145952_0_.getItem();
if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
Block block = Block.getBlockFromItem(item);
if (block == Blocks.wooden_slab) {
return 150;
}
if (block.getMaterial() == Material.wood) {
return 300;
}
if (block == Blocks.coal_block) {
return 16000;
}
}
if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD"))
return 200;
if (item == Items.stick)
return 100;
if (item == Items.coal)
return 1600;
if (item == Items.lava_bucket)
return 20000;
if (item == Item.getItemFromBlock(Blocks.sapling))
return 100;
if (item == Items.blaze_rod)
return 2400;
return net.minecraftforge.fml.common.registry.GameRegistry.getFuelValue(p_145952_0_);
}
}Example 3
| Project: Jons-Useless-Mod-master File: UselessItems.java View source code |
public static void registerItems() {
GameRegistry.register(useless_material);
GameRegistry.register(super_useless_material);
GameRegistry.register(legitimate_diamond);
GameRegistry.register(useless_sword);
GameRegistry.register(useless_axe);
GameRegistry.register(useless_shovel);
GameRegistry.register(useless_pickaxe);
GameRegistry.register(useless_hoe);
GameRegistry.register(useless_bro);
GameRegistry.register(useless_food);
GameRegistry.register(useless_helmet);
GameRegistry.register(useless_chestplate);
GameRegistry.register(useless_leggings);
GameRegistry.register(useless_boots);
GameRegistry.register(useless_multitool);
GameRegistry.register(useless_bow);
GameRegistry.register(useless_arrow);
}Example 4
| Project: Wolf-s-addons-master File: TileEntityFurnace.java View source code |
public static int getItemBurnTime(ItemStack itemStack) {
if (itemStack == null) {
return 0;
} else {
Item item = itemStack.getItem();
if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
Block block = Block.getBlockFromItem(item);
if (block == Blocks.wooden_slab) {
return 150;
}
if (block.getMaterial() == Material.wood) {
return 300;
}
if (block == Blocks.coal_block) {
return 16000;
}
}
if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD"))
return 200;
if (item == Items.stick)
return 100;
if (item == Items.coal)
return 1600;
if (item == Items.lava_bucket)
return 20000;
if (item == Item.getItemFromBlock(Blocks.sapling))
return 100;
if (item == Items.blaze_rod)
return 2400;
return GameRegistry.getFuelValue(itemStack);
}
}Example 5
| Project: BBTweaks-master File: ItemRecipeRegistry.java View source code |
// Self explanatory. Continue these how you wish. EG: registerSmeltingRecipes
private static void registerShapedRecipes() {
ItemStack invar = new ItemStack(ModItems.breakbitinvar, 1);
ItemStack electrum = new ItemStack(ModItems.breakbitelectrum, 1);
ItemStack enderium = new ItemStack(ModItems.breakbitenderium, 1);
GameRegistry.addRecipe(new ShapedOreRecipe(electrum, new Object[] { "XXX", "XXX", "XXX", 'X', invar }));
GameRegistry.addRecipe(new ShapedOreRecipe(enderium, new Object[] { "XXX", "XXX", "XXX", 'X', electrum }));
}Example 6
| Project: IronBackpacks-master File: RecipeRegistry.java View source code |
//=================================================================================Helper Registers==========================================================
/**
* Register the upgrade removal recipes for every backpack (if it is an IUpgradableBackpack)
*/
private static void registerBackpackUpgradeRemovalRecipes() {
for (int i = 0; i < ItemIBackpackRegistry.getSize(); i++) {
IBackpack backpack = ItemIBackpackRegistry.getBackpackAtIndex(i);
if (backpack instanceof IUpgradableBackpack) {
//Hardcoded to ItemBackpack
BackpackRemoveUpgradeRecipe recipe = new BackpackRemoveUpgradeRecipe(new ItemStack((ItemBackpack) backpack), new ItemStack((ItemBackpack) backpack));
GameRegistry.addRecipe(recipe);
IAllRecipesRegistry.registerUpgradeRemovalRecipe(recipe);
}
}
}Example 7
| Project: OpenRadio-master File: Crafting.java View source code |
public static void init() {
//**************************************************************************************************************
//Register Items
GameRegistry.addRecipe(new //Laser Socket
ShapedOreRecipe(//Laser Socket
new ItemStack(Items.laserSocketItem), "IDI", "I I", "IDI", 'I', "ingotIron", 'D', "gemDiamond"));
GameRegistry.addRecipe(new //ADC Tier 1
ShapedOreRecipe(//ADC Tier 1
new ItemStack(Items.adcItem, 1, 0), "III", "IMI", "ICI", 'I', "ingotIron", 'C', new ItemStack(net.minecraft.init.Items.COMPARATOR), 'M', li.cil.oc.api.Items.get("chip1").createItemStack(1)));
GameRegistry.addRecipe(new //ADC Tier 2
ShapedOreRecipe(//ADC Tier 2
new ItemStack(Items.adcItem, 1, 1), "ICI", "IMI", "ICI", 'I', "ingotIron", 'C', new ItemStack(net.minecraft.init.Items.COMPARATOR), 'M', li.cil.oc.api.Items.get("chip2").createItemStack(2)));
GameRegistry.addRecipe(new //ADC Tier 3
ShapedOreRecipe(//ADC Tier 3
new ItemStack(Items.adcItem, 1, 2), "ICI", "CMC", "ICI", 'I', "ingotIron", 'C', new ItemStack(net.minecraft.init.Items.COMPARATOR), 'M', li.cil.oc.api.Items.get("chip3").createItemStack(1)));
GameRegistry.addRecipe(new //DSP Tier 1
ShapedOreRecipe(//DSP Tier 1
new ItemStack(Items.dspItem, 1, 0), "IAI", "MCM", "IAI", 'I', "ingotIron", 'M', li.cil.oc.api.Items.get("chip1").createItemStack(1), 'C', li.cil.oc.api.Items.get("cu").createItemStack(1), 'A', new ItemStack(Items.adcItem, 1, 0)));
GameRegistry.addRecipe(new //DSP Tier 2
ShapedOreRecipe(//DSP Tier 2
new ItemStack(Items.dspItem, 1, 1), "IAI", "MCM", "IAI", 'I', "ingotIron", 'M', li.cil.oc.api.Items.get("chip2").createItemStack(1), 'C', li.cil.oc.api.Items.get("cu").createItemStack(1), 'A', new ItemStack(Items.adcItem, 1, 1)));
GameRegistry.addRecipe(new //DSP Tier 3
ShapedOreRecipe(//DSP Tier 3
new ItemStack(Items.dspItem, 1, 2), "IAI", "MCM", "IAI", 'I', "ingotIron", 'M', li.cil.oc.api.Items.get("chip3").createItemStack(1), 'C', li.cil.oc.api.Items.get("cu").createItemStack(1), 'A', new ItemStack(Items.adcItem, 1, 2)));
GameRegistry.addRecipe(new //Photo Receptor
ShapedOreRecipe(//Photo Receptor
new ItemStack(Items.photoReceptorItem), "IDI", "TGT", "IDI", 'I', "ingotIron", 'D', "gemDiamond", 'G', "blockGlass", 'T', li.cil.oc.api.Items.get("transistor").createItemStack(1)));
GameRegistry.addRecipe(new //Semi Reflective Mirror
ShapedOreRecipe(//Semi Reflective Mirror
new ItemStack(Items.mirrorItem), " IG", "IGD", "GD ", 'I', "ingotIron", 'D', "gemDiamond", 'G', "blockGlass"));
GameRegistry.addRecipe(new //Laser tier 1
ShapedOreRecipe(//Laser tier 1
new ItemStack(Items.laserItem, 1, 0), "IGI", "INI", "ITI", 'I', "ingotIron", 'G', "blockGlass", 'N', "nuggetGold", 'T', li.cil.oc.api.Items.get("transistor").createItemStack(1)));
GameRegistry.addRecipe(new //Laser tier 2
ShapedOreRecipe(//Laser tier 2
new ItemStack(Items.laserItem, 1, 1), "GDG", "N N", "GDG", 'D', "gemDiamond", 'G', "blockGlass", 'N', "ingotGold"));
GameRegistry.addRecipe(new //Laser tier 3
ShapedOreRecipe(//Laser tier 3
new ItemStack(Items.laserItem, 1, 2), "IGI", "IEI", "INI", 'I', "ingotIron", 'G', "blockGlass", 'N', "nuggetGold", 'E', "gemEmerald"));
//**************************************************************************************************************
//Register Blocks
GameRegistry.addRecipe(new //Laser Block
ShapedOreRecipe(//Laser Block
new ItemStack(Blocks.laserBlock), "III", "NSL", "III", 'I', "ingotIron", 'N', li.cil.oc.api.Items.get("cable").createItemStack(1), 'S', li.cil.oc.api.Items.get("relay").createItemStack(1), 'L', new ItemStack(Items.laserSocketItem)));
GameRegistry.addRecipe(new //Glass Lens
ShapedOreRecipe(//Glass Lens
new ItemStack(Blocks.lensBlock1), "IGI", "GGG", "IGI", 'I', "ingotIron", 'G', "blockGlass"));
GameRegistry.addRecipe(new //Quartz Infused Lens
ShapedOreRecipe(//Quartz Infused Lens
new ItemStack(Blocks.lensBlock2), " Q ", "QLQ", " Q ", 'L', new ItemStack(Blocks.lensBlock1), 'Q', "gemQuartz"));
GameRegistry.addRecipe(new //Shaped Diamond Lens
ShapedOreRecipe(//Shaped Diamond Lens
new ItemStack(Blocks.lensBlock3), "GDG", "DLD", "GDG", 'L', new ItemStack(Blocks.lensBlock2), 'G', "ingotGold", 'D', "gemDiamond"));
GameRegistry.addRecipe(new //Laser Block
ShapedOreRecipe(//Laser Block
new ItemStack(Blocks.mirrorBlock), "IGI", "GMQ", "IQI", 'I', "ingotIron", 'M', new ItemStack(Items.mirrorItem), 'G', "blockGlass", 'Q', new ItemStack(Blocks.lensBlock2)));
/*if(Loader.isModLoaded("appliedenergistics2")){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.aeencoderBlock),
"INI", "CMC", "INI",
'I', "ingotIron",
'N', li.cil.oc.api.Items.get("cable").createItemStack(1),
'M', Item.itemRegistry.getObject("appliedenergistics2:tile.BlockController"),
'C', appeng.api.AEApi.instance().definitions().parts().cableSmart().stack(appeng.api.util.AEColor.Transparent, 1)));
}*/
}Example 8
| Project: simpleretrogen-master File: TestGenerator.java View source code |
@Mod.EventHandler
public void preinit(FMLPreInitializationEvent init) {
final Logger modLog = init.getModLog();
IWorldGenerator gen = new IWorldGenerator() {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
modLog.log(Level.INFO, "Calling!");
}
};
GameRegistry.registerWorldGenerator(gen, 10);
}Example 9
| Project: Wanderer-master File: ModItems.java View source code |
public static void init() {
GameRegistry.registerItem(itemScroll, ItemLib.SCROLL_NAME);
GameRegistry.registerItem(itemStoneShears, ItemLib.SHEARS_NAME);
GameRegistry.registerItem(itemGrassSoup, ItemLib.SOUP_NAME);
GameRegistry.registerItem(itemNamelessBlade, ItemLib.NAMELESS_BLADE_NAME);
GameRegistry.registerItem(itemNamelessChestplate, ItemLib.NAMELESS_CHESTPLATE_NAME);
GameRegistry.registerItem(itemThriftyTear, ItemLib.THRIFTY_TEAR_NAME);
}Example 10
| Project: Mekanism-master File: GeneratorsCommonProxy.java View source code |
/**
* Register normal tile entities
*/
public void registerRegularTileEntities() {
GameRegistry.registerTileEntity(TileEntityReactorFrame.class, "ReactorFrame");
GameRegistry.registerTileEntity(TileEntityReactorGlass.class, "ReactorGlass");
GameRegistry.registerTileEntity(TileEntityReactorLaserFocusMatrix.class, "ReactorLaserFocus");
GameRegistry.registerTileEntity(TileEntityReactorNeutronCapture.class, "ReactorNeutronCapture");
GameRegistry.registerTileEntity(TileEntityReactorPort.class, "ReactorPort");
GameRegistry.registerTileEntity(TileEntityReactorLogicAdapter.class, "ReactorLogicAdapter");
GameRegistry.registerTileEntity(TileEntityRotationalComplex.class, "RotationalComplex");
GameRegistry.registerTileEntity(TileEntityElectromagneticCoil.class, "ElectromagneticCoil");
GameRegistry.registerTileEntity(TileEntitySaturatingCondenser.class, "SaturatingCondenser");
}Example 11
| Project: AgriCraft-master File: ItemJournal.java View source code |
@Override
public void registerRecipes() {
// Normal Crafting
GameRegistry.addRecipe(new ShapedOreRecipe(this, "csc", "sbs", "csc", 'c', AgriItems.getInstance().CROPS, 's', Items.WHEAT_SEEDS, 'b', Items.BOOK));
// Copy Crafting
RecipeSorter.register("recipe.copy_journal", RecipeCopyJournal.class, RecipeSorter.Category.SHAPELESS, "");
GameRegistry.addRecipe(new RecipeCopyJournal());
}Example 12
| Project: Botania-master File: ModFluffBlocks.java View source code |
public static void init() {
livingwoodStairs = new BlockLivingwoodStairs();
livingwoodSlab = new BlockLivingwoodSlab(false);
livingwoodSlabFull = new BlockLivingwoodSlab(true);
livingwoodWall = new BlockLivingwoodWall();
livingwoodPlankStairs = new BlockLivingwoodPlankStairs();
livingwoodPlankSlab = new BlockLivingwoodPlankSlab(false);
livingwoodPlankSlabFull = new BlockLivingwoodPlankSlab(true);
livingrockStairs = new BlockLivingrockStairs();
livingrockSlab = new BlockLivingrockSlab(false);
livingrockSlabFull = new BlockLivingrockSlab(true);
livingrockWall = new BlockLivingrockWall();
livingrockBrickStairs = new BlockLivingrockBrickStairs();
livingrockBrickSlab = new BlockLivingrockBrickSlab(false);
livingrockBrickSlabFull = new BlockLivingrockBrickSlab(true);
dreamwoodStairs = new BlockDreamwoodStairs();
dreamwoodSlab = new BlockDreamwoodSlab(false);
dreamwoodSlabFull = new BlockDreamwoodSlab(true);
dreamwoodWall = new BlockDreamwoodWall();
dreamwoodPlankStairs = new BlockDreamwoodPlankStairs();
dreamwoodPlankSlab = new BlockDreamwoodPlankSlab(false);
dreamwoodPlankSlabFull = new BlockDreamwoodPlankSlab(true);
biomeStoneA = new BlockBiomeStoneA();
biomeStoneB = new BlockBiomeStoneB();
pavement = new BlockPavement();
if (ConfigHandler.darkQuartzEnabled) {
darkQuartz = new BlockSpecialQuartz(LibBlockNames.QUARTZ_DARK);
darkQuartzSlab = new BlockSpecialQuartzSlab(darkQuartz, false);
darkQuartzSlabFull = new BlockSpecialQuartzSlab(darkQuartz, true);
darkQuartzStairs = new BlockSpecialQuartzStairs(darkQuartz);
}
manaQuartz = new BlockSpecialQuartz(LibBlockNames.QUARTZ_MANA);
manaQuartzSlab = new BlockSpecialQuartzSlab(manaQuartz, false);
manaQuartzSlabFull = new BlockSpecialQuartzSlab(manaQuartz, true);
manaQuartzStairs = new BlockSpecialQuartzStairs(manaQuartz);
blazeQuartz = new BlockSpecialQuartz(LibBlockNames.QUARTZ_BLAZE);
blazeQuartzSlab = new BlockSpecialQuartzSlab(blazeQuartz, false);
blazeQuartzSlabFull = new BlockSpecialQuartzSlab(blazeQuartz, true);
blazeQuartzStairs = new BlockSpecialQuartzStairs(blazeQuartz);
lavenderQuartz = new BlockSpecialQuartz(LibBlockNames.QUARTZ_LAVENDER);
lavenderQuartzSlab = new BlockSpecialQuartzSlab(lavenderQuartz, false);
lavenderQuartzSlabFull = new BlockSpecialQuartzSlab(lavenderQuartz, true);
lavenderQuartzStairs = new BlockSpecialQuartzStairs(lavenderQuartz);
redQuartz = new BlockSpecialQuartz(LibBlockNames.QUARTZ_RED);
redQuartzSlab = new BlockSpecialQuartzSlab(redQuartz, false);
redQuartzSlabFull = new BlockSpecialQuartzSlab(redQuartz, true);
redQuartzStairs = new BlockSpecialQuartzStairs(redQuartz);
elfQuartz = new BlockSpecialQuartz(LibBlockNames.QUARTZ_ELF);
elfQuartzSlab = new BlockSpecialQuartzSlab(elfQuartz, false);
elfQuartzSlabFull = new BlockSpecialQuartzSlab(elfQuartz, true);
elfQuartzStairs = new BlockSpecialQuartzStairs(elfQuartz);
sunnyQuartz = new BlockSpecialQuartz(LibBlockNames.QUARTZ_SUNNY);
sunnyQuartzSlab = new BlockSpecialQuartzSlab(sunnyQuartz, false);
sunnyQuartzSlabFull = new BlockSpecialQuartzSlab(sunnyQuartz, true);
sunnyQuartzStairs = new BlockSpecialQuartzStairs(sunnyQuartz);
int count = 0;
for (BiomeStoneVariant variant : BiomeStoneVariant.values()) {
biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant));
biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant), count);
biomeStoneFullSlabs[count] = new BlockBiomeStoneSlab(true, biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant), count);
count++;
}
for (BiomeBrickVariant variant : BiomeBrickVariant.values()) {
if (variant.getName().toLowerCase(Locale.ROOT).contains("chiseled")) {
// No chiseled stairs/slabs
continue;
}
biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant));
biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant), count);
biomeStoneFullSlabs[count] = new BlockBiomeStoneSlab(true, biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant), count);
count++;
}
biomeStoneWall = new BlockBiomeStoneWall();
count = 0;
for (EnumDyeColor color : ImmutableList.of(EnumDyeColor.WHITE, EnumDyeColor.BLACK, EnumDyeColor.BLUE, EnumDyeColor.RED, EnumDyeColor.YELLOW, EnumDyeColor.GREEN)) {
pavementStairs[count] = new BlockPavementStairs(color);
pavementSlabs[count] = new BlockPavementSlab(false, color, count);
pavementFullSlabs[count] = new BlockPavementSlab(true, color, count);
count++;
}
shimmerrockSlab = new BlockShimmerrockSlab(false);
shimmerrockSlabFull = new BlockShimmerrockSlab(true);
shimmerrockStairs = new BlockShimmerrockStairs();
shimmerwoodPlankSlab = new BlockShimmerwoodPlankSlab(false);
shimmerwoodPlankSlabFull = new BlockShimmerwoodPlankSlab(true);
shimmerwoodPlankStairs = new BlockShimmerwoodPlankStairs();
managlassPane = new BlockManaglassPane();
alfglassPane = new BlockAlfglassPane();
bifrostPane = new BlockBifrostPane();
for (Block b : slabsToRegister) GameRegistry.register(new ItemBlockModSlab(b), b.getRegistryName());
}Example 13
| Project: CreepTech-master File: TileEntityGenerator.java View source code |
public static int getItemBurnTime(ItemStack p_145952_0_) {
if (p_145952_0_ == null) {
return 0;
} else {
Item item = p_145952_0_.getItem();
if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
Block block = Block.getBlockFromItem(item);
if (block == Blocks.wooden_slab) {
return 150;
}
if (block.getMaterial() == Material.wood) {
return 300;
}
if (block == Blocks.coal_block) {
return 16000;
}
}
if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD"))
return 200;
if (item == Items.stick)
return 100;
if (item == Items.coal)
return 1600;
if (item == Items.lava_bucket)
return 20000;
if (item == Item.getItemFromBlock(Blocks.sapling))
return 100;
if (item == Items.blaze_rod)
return 2400;
return GameRegistry.getFuelValue(p_145952_0_);
}
}Example 14
| Project: ElementalCreepers-Rebooted-master File: ElementalCreepers.java View source code |
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
logger = LogHelper.createLogger(ModLib.MOD_NAME);
config = new ModConfig(ModLib.MOD_ID, event.getSuggestedConfigurationFile(), ModVars.class);
config.loadConfig();
updater = new VersionChecker(ModLib.UPDATE_JSON, ModLib.MOD_ID, ModLib.MOD_NAME, ModLib.MAJOR, ModLib.MINOR, ModLib.REVISION);
if (ModVars.checkForUpdates)
new Thread(updater).start();
AddonBase.registerAddons();
silverCreepBlock = new BlockSilverCreeper();
radiation = new BlockRadiation();
creepapedia = new ItemCreepapedia();
GameRegistry.registerBlock(silverCreepBlock, ItemSilverBlock.class, "silverCreepBlock");
GameRegistry.registerBlock(radiation, "radiation");
GameRegistry.registerItem(creepapedia, "creepapedia");
proxy.registerRenders();
}Example 15
| Project: Equivalent-Exchange-master File: CommonProxy.java View source code |
@Override
public void onPreInit(FMLPreInitializationEvent event) {
ConfigurationHandler.init(event.getSuggestedConfigurationFile());
Files.init(event);
Network.init();
ModItems.getItems().forEach(GameRegistry::register);
for (Block block : ModBlocks.getBlocks()) {
GameRegistry.register(block);
GameRegistry.register(BlockUtils.getItemBlockFor(block), block.getRegistryName());
}
EnergyValues.init();
AlchemyArrays.init();
}Example 16
| Project: FlowstoneEnergy-master File: ItemRecipeRegistry.java View source code |
private static void registerShapedRecipes() {
// tool recipes (vanilla crafting recipe)
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.flowwrench), new Object[] { "X X", " Y ", " X ", 'X', "ingotLead", 'Y', "gearStone" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.enderSword), new Object[] { " X ", " X ", " Y ", 'X', "ingotEnder", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.enderPick), new Object[] { "XXX", " Y ", " Y ", 'X', "ingotEnder", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.enderShovel), new Object[] { " X ", " Y ", " Y ", 'X', "ingotEnder", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.enderAxe), new Object[] { "XX ", "XY ", " Y ", 'X', "ingotEnder", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.enderHoe), new Object[] { "XX ", " Y ", " Y ", 'X', "ingotEnder", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.electrumSword), new Object[] { " X ", " X ", " Y ", 'X', "ingotElectrum", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.electrumPick), new Object[] { "XXX", " Y ", " Y ", 'X', "ingotElectrum", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.electrumShovel), new Object[] { " X ", " Y ", " Y ", 'X', "ingotElectrum", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.electrumAxe), new Object[] { "XX ", "XY ", " Y ", 'X', "ingotElectrum", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.electrumHoe), new Object[] { "XX ", " Y ", " Y ", 'X', "ingotElectrum", 'Y', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(ItemRegistry.tierOne.createItemStack(), new Object[] { " R ", "RIR", "ICI", 'R', Items.redstone, 'I', "ingotIron", 'C', "ingotCopper" }));
GameRegistry.addRecipe(new ShapedOreRecipe(ItemRegistry.tierTwo.createItemStack(), new Object[] { " R ", "LBL", "LRL", 'R', Items.redstone, 'L', "ingotLead", 'B', ItemRegistry.tierOne }));
GameRegistry.addRecipe(new ShapedOreRecipe(ItemRegistry.tierThree.createItemStack(), new Object[] { " R ", "IBI", "IRI", 'R', Items.redstone, 'I', "ingotInvar", 'B', ItemRegistry.tierTwo }));
GameRegistry.addRecipe(new ShapedOreRecipe(ItemRegistry.tierFour.createItemStack(), new Object[] { " R ", "EBE", "ERE", 'R', Items.redstone, 'E', "ingotElectrum", 'B', ItemRegistry.tierThree }));
GameRegistry.addRecipe(new ShapedOreRecipe(ItemRegistry.tierFive.createItemStack(), new Object[] { " R ", "EBE", "ERE", 'R', Items.redstone, 'E', "ingotEnder", 'B', ItemRegistry.tierFour }));
// gear recipes (vanilla crafting recipe)
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 0), new Object[] { " X ", "XXX", " X ", 'X', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 1), new Object[] { " X ", "XYX", " X ", 'X', "stone", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 2), new Object[] { " X ", "XYX", " X ", 'X', "ingotIron", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 3), new Object[] { " X ", "XYX", " X ", 'X', "ingotGold", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 4), new Object[] { " X ", "XYX", " X ", 'X', "gemQuartz", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 5), new Object[] { " X ", "XYX", " X ", 'X', "gemDiamond", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 6), new Object[] { " X ", "XYX", " X ", 'X', "ingotCopper", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 7), new Object[] { " X ", "XYX", " X ", 'X', "ingotTin", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 8), new Object[] { " X ", "XYX", " X ", 'X', "ingotLead", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 9), new Object[] { " X ", "XYX", " X ", 'X', "ingotSilver", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 10), new Object[] { " X ", "XYX", " X ", 'X', "ingotEnder", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 11), new Object[] { " X ", "XYX", " X ", 'X', "ingotElectrum", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 12), new Object[] { " X ", "XYX", " X ", 'X', "ingotNickel", 'Y', "gearWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.metaResourceGear, 1, 13), new Object[] { " X ", "XYX", " X ", 'X', "ingotInvar", 'Y', "gearWood" }));
}Example 17
| Project: harv-master File: needmoarsticks.java View source code |
@EventHandler
public void init(FMLInitializationEvent event) {
//Reeds
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.REEDS, 1, 0), new ItemStack(Items.REEDS, 1, 0) });
//Bone
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 4, 0), new Object[] { new ItemStack(Items.BONE, 1, 0), new ItemStack(Items.BONE, 1, 0) });
//Sapling
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Blocks.SAPLING, 1, OreDictionary.WILDCARD_VALUE) });
//Fishing Pole
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 3, 0), new Object[] { new ItemStack(Items.FISHING_ROD, 1, -1) });
//Carrot on a Stick
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 3, 0), new Object[] { new ItemStack(Items.CARROT_ON_A_STICK, 1, -1) });
//Bow
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 3, 0), new Object[] { new ItemStack(Items.BOW, 1, -1) });
//Arrow
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Items.ARROW, 1, 0) });
//Torch
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Blocks.TORCH, 1, 0) });
//Redstone Torch
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Blocks.REDSTONE_TORCH, 1, 0) });
//Lever
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Blocks.LEVER, 1, 0) });
//Ladder
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Blocks.LADDER, 1, 0) });
//Fence
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 3, 0), new Object[] { new ItemStack(Blocks.OAK_FENCE, 1, -1) });
//Fence Gate
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 4, 0), new Object[] { new ItemStack(Blocks.OAK_FENCE_GATE, 1, -1) });
//Fence
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 3, 0), new Object[] { new ItemStack(Blocks.ACACIA_FENCE, 1, -1) });
//Fence Gate
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 4, 0), new Object[] { new ItemStack(Blocks.ACACIA_FENCE_GATE, 1, -1) });
//Fence
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 3, 0), new Object[] { new ItemStack(Blocks.BIRCH_FENCE, 1, -1) });
//Fence Gate
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 4, 0), new Object[] { new ItemStack(Blocks.BIRCH_FENCE_GATE, 1, -1) });
//Fence
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 3, 0), new Object[] { new ItemStack(Blocks.SPRUCE_FENCE, 1, -1) });
//Fence Gate
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 4, 0), new Object[] { new ItemStack(Blocks.SPRUCE_FENCE_GATE, 1, -1) });
//Fence
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 3, 0), new Object[] { new ItemStack(Blocks.JUNGLE_FENCE, 1, -1) });
//Fence Gate
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 4, 0), new Object[] { new ItemStack(Blocks.JUNGLE_FENCE_GATE, 1, -1) });
//Fence
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 3, 0), new Object[] { new ItemStack(Blocks.DARK_OAK_FENCE, 1, -1) });
//Fence Gate
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 4, 0), new Object[] { new ItemStack(Blocks.DARK_OAK_FENCE_GATE, 1, -1) });
//Sign
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Items.SIGN, 1, 0) });
//Painting
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 8, 0), new Object[] { new ItemStack(Items.PAINTING, 1, 0) });
//Item Frame
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 8, 0), new Object[] { new ItemStack(Items.ITEM_FRAME, 1, 0) });
//Wooden Tools
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.WOODEN_AXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.WOODEN_HOE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.WOODEN_PICKAXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.WOODEN_SHOVEL, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Items.WOODEN_SWORD, 1, -1) });
//Stone Tools
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.STONE_AXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.STONE_HOE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.STONE_PICKAXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.STONE_SHOVEL, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Items.STONE_SWORD, 1, -1) });
//Iron Tools
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.IRON_AXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.IRON_HOE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.IRON_PICKAXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.IRON_SHOVEL, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Items.IRON_SWORD, 1, -1) });
//Gold Tools
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.GOLDEN_AXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.GOLDEN_HOE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.GOLDEN_PICKAXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.GOLDEN_SHOVEL, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Items.GOLDEN_SWORD, 1, -1) });
//Diamond Tools
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.DIAMOND_AXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.DIAMOND_HOE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.DIAMOND_PICKAXE, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 2, 0), new Object[] { new ItemStack(Items.DIAMOND_SHOVEL, 1, -1) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK, 1, 0), new Object[] { new ItemStack(Items.DIAMOND_SWORD, 1, -1) });
}Example 18
| Project: HarvestCraft-master File: BlockRegistry.java View source code |
public static void registerBlock(String registerName, ItemBlock itemBlock, Block block) {
block.setRegistryName(registerName);
block.setUnlocalizedName(registerName);
GameRegistry.register(block);
if (itemBlock != null) {
itemBlock.setRegistryName(registerName);
itemBlock.setUnlocalizedName(registerName);
GameRegistry.register(itemBlock);
}
}Example 19
| Project: Mariculture-master File: BlockMCEnum.java View source code |
@Override
public B register(String name) {
Block block = this;
block.setUnlocalizedName(name.replace("_", "."));
block.setRegistryName(new ResourceLocation(MODID, name));
GameRegistry.register(block);
//Register the item block
getItemBlock().register(name);
Set<Class<? extends TileEntity>> registered = new HashSet<>();
for (E e : values) {
IBlockState state = getStateFromEnum(e);
if (hasTileEntity(state)) {
Class<? extends TileEntity> tile = createTileEntity(null, state).getClass();
if (registered.add(tile))
GameRegistry.registerTileEntity(tile, MODID + ":" + tile.getSimpleName().toLowerCase().replace("tile", ""));
}
}
return (B) this;
}Example 20
| Project: Minestrappolation-4-master File: BlockCarvedPumpkin.java View source code |
public static void inventoryRender(String type) {
Item itemBlockpVariants = GameRegistry.findItem(MReference.MODID, "pumpkin_minestrapp_" + type);
ModelBakery.addVariantName(itemBlockpVariants, "ministrapp:simple_carved_" + type);
ModelBakery.addVariantName(itemBlockpVariants, "ministrapp:average_carved_" + type);
ModelBakery.addVariantName(itemBlockpVariants, "ministrapp:complex_carved_" + type);
Item itemBlockVariants = GameRegistry.findItem(MReference.MODID, "pumpkin_minestrapp_" + type);
MPumpkinType[] aenumtype = MPumpkinType.values();
int i = aenumtype.length;
for (int j = 0; j < i; ++j) {
MPumpkinType enumtype = aenumtype[j];
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(MReference.MODID + ":" + enumtype.getUnlocalizedName() + "_carved_" + type, "inventory");
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlockVariants, enumtype.getMetadata(), itemModelResourceLocation);
}
}Example 21
| Project: NordMod-master File: WorkBrenchVanila.java View source code |
public static void postInit() {
//GameRegistry.addRecipe(new ItemStack(NordBloks.flowingBlock, 1), "xxx", "x x", "xxx", 'x', new ItemStack(Blocks.stone, 1));
GameRegistry.addRecipe(new ItemStack(NordItems.itemStick, 2, EnumDust.IRON.getMetadata()), "x", "x", 'x', new ItemStack(Items.iron_ingot, 1));
GameRegistry.addRecipe(new ItemStack(NordItems.itemStick, 2, EnumDust.GOLD.getMetadata()), "x", "x", 'x', new ItemStack(Items.gold_ingot, 1));
for (EnumMetal metal : EnumMetal.values()) {
GameRegistry.addRecipe(new ItemStack(NordItems.itemStick, 2, metal.getMetadata()), "x", "x", 'x', new ItemStack(NordItems.itemIngot, 2, metal.getMetadata()));
}
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(NordBloks.frame), 1, 1), "yxy", "x x", "yxy", 'x', new ItemStack(Blocks.planks, 1), 'y', new ItemStack(Items.stick));
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(NordBloks.frame), 1, 0), "yxy", "xbx", "yxy", 'x', new ItemStack(Items.iron_ingot, 1), 'y', new ItemStack(NordItems.itemStick, 1, 0), 'b', new ItemStack(NordBloks.frame, 1, 1));
GameRegistry.addRecipe(new ItemStack(NordBloks.energyCableBlock, 12), "xxx", "yyy", "xxx", 'x', new ItemStack(Blocks.wool, 1), 'y', new ItemStack(NordItems.itemIngot, 1, 1));
GameRegistry.addRecipe(new ItemStack(NordItems.itemBlades, 1), " x ", "xyx", " x ", 'x', new ItemStack(NordItems.itemStick, 1, 0), 'y', new ItemStack(Items.iron_ingot, 1));
GameRegistry.addRecipe(new ItemStack(NordItems.energyStorageItem, 1, 16000), "yxy", "xsb", "yxy", 'x', new ItemStack(Blocks.redstone_block, 1), 'y', new ItemStack(NordItems.itemStick, 1, 1), 'b', new ItemStack(NordBloks.energyCableBlock, 1), 's', new ItemStack(Items.gold_ingot, 1, 0));
GameRegistry.addRecipe(new ItemStack(NordBloks.flowingBlock), "yxy", "xsx", "yby", 'x', new ItemStack(NordBloks.energyCableBlock, 1), 'y', new ItemStack(NordItems.itemStick, 1, 0), 'b', new ItemStack(NordBloks.generatorBlock, 1), 's', new ItemStack(NordItems.itemBlades, 1));
GameRegistry.addRecipe(new ItemStack(NordBloks.generatorBlock), "yxy", "xsx", "yby", 'x', new ItemStack(NordBloks.energyCableBlock, 1), 'y', new ItemStack(NordItems.itemStick, 1, 0), 'b', new ItemStack(Blocks.furnace, 1), 's', new ItemStack(Blocks.redstone_block, 1));
GameRegistry.addRecipe(new ItemStack(NordBloks.accumulatorBlock, 1), "yxy", "xsb", "yxy", 'x', new ItemStack(NordItems.energyStorageItem, 1, 16000), 'y', new ItemStack(NordItems.itemStick, 1, 0), 'b', new ItemStack(NordBloks.energyCableBlock, 1), 's', new ItemStack(NordBloks.frame, 1, 0));
GameRegistry.addRecipe(new ItemStack(NordItems.wrench, 1), "xx", "yx", " x", 'x', new ItemStack(NordItems.itemStick, 1, 0), 'y', new ItemStack(Items.iron_ingot));
for (int i = 0; i < EnumMetal.values().length; i++) {
GameRegistry.addRecipe(new ItemStack(NordBloks.metalBlock, 1, i), "xxx", "xxx", "xxx", 'x', new ItemStack(NordItems.itemIngot, 1, i));
}
GameRegistry.addRecipe(new ItemStack(NordBloks.oilLamp), "wfw", "sts", "www", 'w', new ItemStack(Blocks.planks), 's', new ItemStack(NordItems.itemStick, 1, 0), 'f', new ItemStack(Items.flint_and_steel), 't', new ItemStack(Items.string));
GameRegistry.addRecipe(new ItemStack(NordBloks.floorLamp1), "xxx", "ysy", 'x', new ItemStack(Blocks.glass), 'y', new ItemStack(Blocks.planks), 's', new ItemStack(Blocks.redstone_lamp));
GameRegistry.addRecipe(new ItemStack(NordBloks.floorLamp1, 1, 1), "xy", 'x', new ItemStack(NordBloks.floorLamp1, 1, 0), 'y', new ItemStack(Blocks.redstone_torch));
for (int i = 0; i < 15; i++) {
GameRegistry.addRecipe(new ItemStack(NordBloks.empireLamp1, 1, i), "xyx", "ysy", "xyx", 'x', new ItemStack(NordItems.itemStick, 1, 0), 'y', new ItemStack(Blocks.stained_glass, 1, i), 's', new ItemStack(Blocks.torch));
GameRegistry.addRecipe(new ItemStack(NordBloks.empireFloorLamp1, 1, i), "xxx", "ysy", 'x', new ItemStack(Blocks.stained_glass, 1, i), 'y', new ItemStack(Blocks.planks), 's', new ItemStack(Blocks.torch));
}
for (EnumNugget nug : EnumNugget.values()) {
if (nug.getMetal() != null) {
ItemStack nugget = new ItemStack(NordItems.itemOreNugget, 1, nug.getMetadata());
GameRegistry.addShapelessRecipe(new ItemStack(NordItems.itemIngot, 1, nug.getMetal().getMetadata()), nugget, nugget, nugget, nugget, nugget, nugget, nugget, nugget, nugget);
GameRegistry.addShapelessRecipe(new ItemStack(NordItems.itemOreNugget, 9, nug.getMetadata()), new ItemStack(NordItems.itemIngot, 1, nug.getMetal().getMetadata()));
}
}
for (EnumMetal ingot : EnumMetal.values()) {
ItemStack _ingot = new ItemStack(NordItems.itemIngot, 1, ingot.getMetadata());
GameRegistry.addShapelessRecipe(new ItemStack(NordBloks.metalBlock, 1, ingot.getMetadata()), _ingot, _ingot, _ingot, _ingot, _ingot, _ingot, _ingot, _ingot, _ingot);
GameRegistry.addShapelessRecipe(new ItemStack(NordItems.itemIngot, 9, ingot.getMetadata()), new ItemStack(NordBloks.metalBlock, 1, ingot.getMetadata()));
}
for (EnumClearMetal ingot : EnumClearMetal.values()) {
ItemStack _ingot = new ItemStack(NordItems.itemClearIngot, 1, ingot.getMetadata());
GameRegistry.addShapelessRecipe(new ItemStack(NordBloks.metalClearBlock, 1, ingot.getMetadata()), _ingot, _ingot, _ingot, _ingot, _ingot, _ingot, _ingot, _ingot, _ingot);
GameRegistry.addShapelessRecipe(new ItemStack(NordItems.itemClearIngot, 9, ingot.getMetadata()), new ItemStack(NordBloks.metalClearBlock, 1, ingot.getMetadata()));
}
}Example 22
| Project: Oilcraft-master File: UserRecipes.java View source code |
private static void oilCompressorRecipeBuffer(String inputType, String inputItem, int oilAmount, int compressTime, int energyAmount, int metaInput) {
if (inputType.toLowerCase().equals("oredictionary")) {
if (OreDictionary.getOres(inputItem).size() > 0 && compressTime > 0 && oilAmount > 0 && energyAmount >= 0)
OilCompressorRecipe.addRecipe(OreDictionary.getOres(inputItem), oilAmount, energyAmount, compressTime);
} else if (inputType.toLowerCase().equals("id")) {
if (Item.getItemById(Integer.getInteger(inputItem)) != null && compressTime >= 0 && oilAmount > 0 && energyAmount >= 0 && metaInput >= 0)
OilCompressorRecipe.addRecipe(new ItemStack(Item.getItemById(Integer.getInteger(inputItem)), 1, metaInput), oilAmount, energyAmount, compressTime);
} else if (GameRegistry.findItem(inputType, inputItem) != null && compressTime >= 0 && oilAmount > 0 && energyAmount >= 0 && metaInput >= 0) {
OilCompressorRecipe.addRecipe(new ItemStack(GameRegistry.findItem(inputType, inputItem), 1, metaInput), oilAmount, energyAmount, compressTime);
} else if (GameRegistry.findBlock(inputType, inputItem) != null && compressTime >= 0 && oilAmount > 0 && energyAmount >= 0 && metaInput >= 0)
OilCompressorRecipe.addRecipe(new ItemStack(Item.getItemFromBlock(GameRegistry.findBlock(inputType, inputItem)), 1, metaInput), oilAmount, energyAmount, compressTime);
}Example 23
| Project: ProgressiveAutomation-master File: WitherTools.java View source code |
protected static void woodenRecipes() {
RecipeWitherTool recipe = new RecipeWitherTool(Items.WOODEN_AXE, new Object[] { "mm ", "ms ", " s ", 'm', witherWood, 's', "stickWood" });
GameRegistry.addRecipe(recipe);
recipe = new RecipeWitherTool(Items.WOODEN_HOE, new Object[] { "mm ", " s ", " s ", 'm', witherWood, 's', "stickWood" });
GameRegistry.addRecipe(recipe);
recipe = new RecipeWitherTool(Items.WOODEN_PICKAXE, new Object[] { "mmm", " s ", " s ", 'm', witherWood, 's', "stickWood" });
GameRegistry.addRecipe(recipe);
recipe = new RecipeWitherTool(Items.WOODEN_SHOVEL, new Object[] { " m ", " s ", " s ", 'm', witherWood, 's', "stickWood" });
GameRegistry.addRecipe(recipe);
recipe = new RecipeWitherTool(Items.WOODEN_SWORD, new Object[] { " m ", " m ", " s ", 'm', witherWood, 's', "stickWood" });
GameRegistry.addRecipe(recipe);
}Example 24
| Project: TheBackWoods-1.8-master File: Recipes.java View source code |
public static void init() {
//Amethyst Tools
GameRegistry.addShapedRecipe(new ItemStack(ModItems.amethystSword), " A ", " A ", " # ", 'A', new ItemStack(ModItems.amethystItem), '#', new ItemStack(Item.getItemById(280)));
GameRegistry.addShapedRecipe(new ItemStack(ModItems.amethystPickaxe), "AAA", " # ", " # ", 'A', new ItemStack(ModItems.amethystItem), '#', new ItemStack(Item.getItemById(280)));
GameRegistry.addShapedRecipe(new ItemStack(ModItems.amethystShovel), " A ", " # ", " # ", 'A', new ItemStack(ModItems.amethystItem), '#', new ItemStack(Item.getItemById(280)));
GameRegistry.addShapedRecipe(new ItemStack(ModItems.amethystAxe), "AA ", "A# ", " # ", 'A', new ItemStack(ModItems.amethystItem), '#', new ItemStack(Item.getItemById(280)));
GameRegistry.addShapedRecipe(new ItemStack(ModItems.amethystAxe), " AA", " #A", " # ", 'A', new ItemStack(ModItems.amethystItem), '#', new ItemStack(Item.getItemById(280)));
GameRegistry.addShapedRecipe(new ItemStack(ModItems.amethystHoe), "AA ", " # ", " # ", 'A', new ItemStack(ModItems.amethystItem), '#', new ItemStack(Item.getItemById(280)));
GameRegistry.addShapedRecipe(new ItemStack(ModItems.amethystHoe), " AA", " # ", " # ", 'A', new ItemStack(ModItems.amethystItem), '#', new ItemStack(Item.getItemById(280)));
//Gem Blocks
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.amethystBlock), new ItemStack(ModItems.amethystItem), new ItemStack(ModItems.amethystItem), new ItemStack(ModItems.amethystItem), new ItemStack(ModItems.amethystItem), new ItemStack(ModItems.amethystItem), new ItemStack(ModItems.amethystItem), new ItemStack(ModItems.amethystItem), new ItemStack(ModItems.amethystItem), new ItemStack(ModItems.amethystItem));
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.amethystItem, 9), new ItemStack(ModBlocks.amethystBlock));
//Fir Wood
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.firWoodPlanks, 4), new ItemStack(ModBlocks.firWood));
}Example 25
| Project: DayZ-Minecraft-master File: ModItems.java View source code |
public static void loadItems() {
registerItem(gunAk74u = new ItemGunAuto(new ItemAk74u()).setName("item_ak74u"));
registerItem(gunMakarov = new ItemGunSemi(new ItemMakarov()).setName("item_makarov"));
registerItem(gunRemington = new ItemGunSemi(new ItemRemington()).setName("item_remington"));
registerItem(gunLeeEnfield = new ItemGunSemi(new ItemEnfield()).setName("item_leeenfield"));
registerItem(gunGlock17 = new ItemGunAuto(new ItemGlock17()).setName("item_glock17"));
registerItem(gunDoubleBarreledShotgun = new ItemGunSemi(new ItemDbShotgun()).setName("item_dbshotgun"));
registerItem(gunUsp = new ItemGunSemi(new ItemUsp()).setName("item_usp"));
registerItem(ammoAk74u = new ItemAmmo().setName("item_ammo_ak74u"));
registerItem(ammoMakarov = new ItemAmmo().setName("item_ammo_makarov"));
registerItem(ammoRemington = new ItemAmmo().setName("item_ammo_remington"));
registerItem(ammoLeeEnfield = new ItemAmmo().setName("item_ammo_leeenfield"));
registerItem(ammoGlock17 = new ItemAmmo().setName("item_ammo_glock17"));
registerItem(ammoDoubleBarreledShotgun = new ItemAmmo().setName("item_ammo_dbshotgun"));
registerItem(ammoUsp = new ItemAmmo().setName("item_ammo_usp"));
registerItem(itemMatches = (new ItemFirestarter(8)).setName("item_matches"));
registerItem(healBandage = new ItemHeal(0, Effect.bleeding).subNames(StatCollector.translateToLocal("item.item_bandage.description")).setName("item_bandage"));
registerItem(healAntibiotics = new ItemHeal(0, Effect.zombification).subNames(StatCollector.translateToLocal("item.item_antibiotics.description")).setName("item_antibiotics"));
registerItem(healBloodbag = new ItemMod().subNames(StatCollector.translateToLocal("item.item_bloodbag.description")).setName("item_bloodbag"));
registerItem(cannedBeans = new ItemFood().setName("item_beans"));
registerItem(cannedSoup = new ItemFood().setName("item_soup"));
registerItem(cannedPasta = new ItemFood().setName("item_pasta"));
registerItem(cannedFish = new ItemFood().setName("item_fish"));
registerItem(cannedPickles = new ItemFood().setName("item_pickles"));
registerItem(cannedFruit = new ItemFood().setName("item_fruit"));
registerItem(drinkCanBeer = new ItemDrink().setName("item_beer"));
registerItem(drinkCanLemonSoda = new ItemDrink().setName("item_lemonsoda"));
registerItem(drinkCanCola = new ItemDrink().setName("item_cola"));
registerItem(drinkCanEnergyDrink = new ItemDrink().setName("item_energy"));
registerItem(drinkCanOrangeSoda = new ItemDrink().setName("item_orangesoda"));
registerItem(drinkWhiskeyBottle = new ItemDrinkBottle(4000, true).isAlcohol(true).setName("item_whiskeybottle"));
registerItem(drinkCiderBottle = new ItemDrinkBottle(4000, false).setName("item_ciderbottle"));
registerItem(drinkVodkaBottle = new ItemDrinkBottle(4000, true).isAlcohol(true).setName("item_vodkabottle"));
registerItem(meleeBaseballBat = new ItemMelee(6).setName("item_baseballbat"));
registerItem(meleeBaseballBatNailed = new ItemMelee(8).setName("item_baseballbatnailed"));
registerItem(meleePlank = new ItemMelee(7).setName("item_plank"));
registerItem(meleePlankNailed = new ItemMelee(8).setName("item_planknailed"));
registerItem(meleePipe = new ItemMelee(8).setName("item_pipe"));
registerItem(meleeCrowbar = new ItemMelee(8).setName("item_crowbar"));
registerItem(meleeMachete = new ItemMelee(7).setName("item_machete"));
GameRegistry.addShapelessRecipe(new ItemStack(meleeBaseballBatNailed, 1), new ItemStack(meleeBaseballBat, 1), new ItemStack(ModBlocks.nailBlock, 1, 0));
GameRegistry.addShapelessRecipe(new ItemStack(meleePlankNailed, 1), new ItemStack(meleePlank, 1), new ItemStack(ModBlocks.nailBlock, 1, 0));
GameRegistry.addRecipe(new ItemStack(meleePlank, 1), "#", "#", "#", '#', Blocks.planks);
GameRegistry.addRecipe(new ItemStack(meleeBaseballBat, 1), "##!", '#', Blocks.planks, '!', Items.stick);
}Example 26
| Project: Flaxbeards-Steam-Power-master File: ContentModule.java View source code |
/**
* Sets up a Block with an unlocalized name, a registry name, an optional creative tab, and registers it to the
* Block registry.
* @param startingBlock The block to start with
* @param path The name of the block, excluding the EI mod ID
* @param tab The creative tab to add it to. Use null to not add it to any tab. You will have to cast the null to
* {@link CreativeTabs}.
* @param itemBlockFunc A function that passes a {@link Block} and returns an {@link ItemBlock}. The returned value
* is what will be used as the block's according item. Pass null to make this Block not have
* any item. You will have to cast the null to {@link Function}.
* @return The registered block (ItemBlock is not returned).
*/
protected Block setup(Block startingBlock, String path, CreativeTabs tab, Function<Block, ItemBlock> itemBlockFunc) {
startingBlock.setUnlocalizedName(Constants.EI_MODID + ":" + path);
if (tab != null) {
startingBlock.setCreativeTab(tab);
}
startingBlock.setRegistryName(Constants.EI_MODID, path);
GameRegistry.register(startingBlock);
if (itemBlockFunc != null) {
ItemBlock ib = itemBlockFunc.apply(startingBlock);
ib.setRegistryName(startingBlock.getRegistryName());
GameRegistry.register(ib);
}
return startingBlock;
}Example 27
| Project: FortuneOres2-master File: OreDictionaryMagic.java View source code |
public static void addSmelting() {
for (Ore ore : FortuneOres.ores) {
ItemStack ingot = null;
for (String ingotName : ore.ingotNames) {
List<ItemStack> ingots = OreDictionary.getOres(ingotName);
if (!ingots.isEmpty())
ingot = ingots.get(0);
}
if (ingot != null) {
ingot = ingot.copy();
ingot.stackSize = 1;
ItemStack chunk = new ItemStack(FortuneOres.itemChunk, 1, ore.meta);
GameRegistry.addSmelting(chunk, ingot, ore.xpSmelt);
}
}
}Example 28
| Project: Galacticraft-master File: MarsModuleClient.java View source code |
private void addPlanetVariants(String name, String... variants) {
Item itemBlockVariants = GameRegistry.findItem(Constants.MOD_ID_PLANETS, name);
ResourceLocation[] variants0 = new ResourceLocation[variants.length];
for (int i = 0; i < variants.length; ++i) {
variants0[i] = new ResourceLocation(GalacticraftPlanets.TEXTURE_PREFIX + variants[i]);
}
ModelBakery.registerItemVariants(itemBlockVariants, variants0);
}Example 29
| Project: GodsWeapons-master File: RecipeManager.java View source code |
public static void addCraftingRec() {
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.air_essence), ModItems.water_essence, Items.GHAST_TEAR);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.light_essence), ModItems.water_essence, Items.ENDER_EYE);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dark_essence), ModItems.water_essence, Items.ENDER_PEARL);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fire_essence), ModItems.water_essence, Items.BLAZE_POWDER);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.defense_essence), ModItems.water_essence, Items.EMERALD);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.power_essence), ModItems.water_essence, Items.DIAMOND);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.speed_essence), ModItems.water_essence, Items.REDSTONE);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.water_essence), Items.WATER_BUCKET);
GameRegistry.addRecipe(new ItemStack(ModItems.ring), " X ", "X X", " X ", 'X', ModItems.sacred_gold);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.air_ring), ModItems.ring, ModItems.air_essence);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.light_ring), ModItems.ring, ModItems.light_essence);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dark_ring), ModItems.ring, ModItems.dark_essence);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fire_ring), ModItems.ring, ModItems.fire_essence);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.defense_ring), ModItems.ring, ModItems.defense_essence);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.power_ring), ModItems.ring, ModItems.power_essence);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.speed_ring), ModItems.ring, ModItems.speed_essence);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.water_ring), ModItems.ring, ModItems.water_essence);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.soul), Items.SPIDER_EYE, Items.ROTTEN_FLESH, Items.BONE);
GameRegistry.addRecipe(new ItemStack(ModItems.ice_soul), " Y ", "YXY", " Y ", 'X', ModItems.soul, 'Y', Blocks.PACKED_ICE);
GameRegistry.addRecipe(new ItemStack(ModItems.gold_soul), " X ", "XYX", " X ", 'X', ModItems.gold_crystal, 'Y', ModItems.soul);
GameRegistry.addRecipe(new ItemStack(ModItems.emerald_soul), " X ", "XYX", " X ", 'X', ModItems.emerald_crystal, 'Y', ModItems.soul);
GameRegistry.addRecipe(new ItemStack(ModItems.fire_soul), " X ", "XYX", " X ", 'X', Items.BLAZE_POWDER, 'Y', ModItems.soul);
GameRegistry.addRecipe(new ItemStack(ModItems.crystal), "X", "X", "X", 'X', Blocks.GLASS);
GameRegistry.addRecipe(new ItemStack(ModItems.diamond_crystal), "X", "Y", "X", 'X', Items.DIAMOND, 'Y', ModItems.crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.emerald_crystal), "Y", "X", "Y", 'X', ModItems.crystal, 'Y', Items.EMERALD);
GameRegistry.addRecipe(new ItemStack(ModItems.gold_crystal), "X", "Y", "X", 'X', Items.GOLD_INGOT, 'Y', ModItems.crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.gold_soul_crystal), "X", "Y", 'X', ModItems.gold_soul, 'Y', ModItems.crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.ice_crystal), " Y ", " X ", " Y ", 'X', ModItems.diamond_crystal, 'Y', Blocks.PACKED_ICE);
GameRegistry.addRecipe(new ItemStack(ModItems.soul_crystal), "X", "Y", 'X', ModItems.soul, 'Y', ModItems.crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.frost_crystal), " Y ", "YXY", " Y ", 'X', ModItems.ice_crystal, 'Y', ModItems.ice_soul);
GameRegistry.addRecipe(new ItemStack(ModItems.demon_crystal), " X ", "XYX", " X ", 'X', ModItems.fire_soul, 'Y', ModItems.diamond_crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.boreas_sword), " XX", "XYX", "OX ", 'X', ModItems.frost_crystal, 'Y', ModItems.ice_soul, 'O', ModItems.obsidian_stick);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.storm_hammer), ModItems.storm_head, ModItems.diamond_hammer);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.diamond_hammer), ModItems.hammer_head, ModItems.hammer_handle);
ItemStack oath_sword = new ItemStack(ModItems.oath_sword);
oath_sword.addEnchantment(Enchantments.SMITE, 5);
oath_sword.addEnchantment(Enchantments.KNOCKBACK, 10);
GameRegistry.addShapelessRecipe(oath_sword, ModItems.oath_blade, ModItems.smite_sword);
ItemStack smite_sword = new ItemStack(ModItems.smite_sword);
smite_sword.addEnchantment(Enchantments.SMITE, 5);
GameRegistry.addRecipe(smite_sword, " XX", "XXX", "YX ", 'X', ModItems.gold_crystal, 'Y', ModItems.obsidian_stick);
ItemStack hades_sword = new ItemStack(ModItems.hades_sword);
hades_sword.addEnchantment(Enchantments.FIRE_ASPECT, 5);
hades_sword.addEnchantment(Enchantments.KNOCKBACK, 5);
GameRegistry.addShapelessRecipe(hades_sword, ModItems.hades_blade, ModItems.demon_sword);
ItemStack demon_sword = new ItemStack(ModItems.demon_sword);
demon_sword.addEnchantment(Enchantments.FIRE_ASPECT, 5);
GameRegistry.addRecipe(demon_sword, " XX", "XYX", "ZX ", 'X', ModItems.demon_crystal, 'Y', ModItems.fire_soul, 'Z', ModItems.obsidian_stick);
ItemStack apollo_bow = new ItemStack(ModItems.apollo_bow);
apollo_bow.addEnchantment(Enchantments.FLAME, 10);
apollo_bow.addEnchantment(Enchantments.KNOCKBACK, 1);
apollo_bow.addEnchantment(Enchantments.PUNCH, 5);
apollo_bow.addEnchantment(Enchantments.POWER, 5);
GameRegistry.addRecipe(apollo_bow, "XY ", "X Y", "XY ", 'X', ModItems.emerald_string, 'Y', ModItems.pyro_stick);
GameRegistry.addRecipe(apollo_bow, " YX", "Y X", " YX", 'X', ModItems.emerald_string, 'Y', ModItems.pyro_stick);
GameRegistry.addRecipe(new ItemStack(ModItems.storm_head), " X ", "YYY", "YZY", 'X', ModItems.soul_crystal, 'Y', ModItems.diamond_crystal, 'Z', ModItems.hammer_head);
GameRegistry.addRecipe(new ItemStack(ModItems.hammer_head), " X ", "YYY", "YYY", 'X', Items.DIAMOND, 'Y', ModItems.diamond_crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.oath_blade), " XX", "XXX", "YX ", 'X', ModItems.gold_crystal, 'Y', ModItems.gold_soul_crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.hades_blade), " YY", "YYY", "XY ", 'X', ModItems.fire_soul, 'Y', ModItems.demon_crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.hammer_handle), "X ", "Y ", "XX", 'X', ModItems.diamond_crystal, 'Y', ModItems.obsidian_stick);
GameRegistry.addRecipe(new ItemStack(ModItems.ares_chestplate), "Z Z", "ZYZ", "ZXZ", 'X', ModItems.r_iron_chestplate, 'Y', ModItems.fire_soul, 'Z', ModItems.demon_crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.r_iron_chestplate), " Y ", "YXY", " Y ", 'X', Items.IRON_CHESTPLATE, 'Y', Blocks.IRON_BLOCK);
GameRegistry.addRecipe(new ItemStack(ModItems.r_iron_boots), " Y ", "YXY", " Y ", 'X', Items.IRON_BOOTS, 'Y', Blocks.IRON_BLOCK);
GameRegistry.addRecipe(new ItemStack(ModItems.r_iron_boots), "XX", 'X', ModItems.r_iron_boot);
GameRegistry.addRecipe(new ItemStack(ModItems.hermes_boots), "XX", 'X', ModItems.hermes_boot);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.r_iron_boot, 2), ModItems.r_iron_boots);
GameRegistry.addRecipe(new ItemStack(ModItems.hermes_boot), " Z ", "YXY", " Z ", 'X', ModItems.r_iron_boot, 'Y', ModItems.gold_feather, 'Z', ModItems.gold_soul);
GameRegistry.addRecipe(new ItemStack(ModItems.obsidian_stick), "X", "X", 'X', Blocks.OBSIDIAN);
GameRegistry.addRecipe(new ItemStack(ModItems.pyro_stick, 3), "X", "Y", "X", 'X', ModItems.demon_crystal, 'Y', ModItems.emerald_crystal);
GameRegistry.addRecipe(new ItemStack(ModItems.cursed_steel), " X ", "XYX", " X ", 'X', ModItems.dark_steel, 'Y', ModItems.soul);
GameRegistry.addRecipe(new ItemStack(ModItems.sacred_gold), "ZYZ", "YXY", "ZYZ", 'X', ModItems.soul, 'Y', ModItems.gold_crystal, 'Z', ModItems.gold_soul);
GameRegistry.addRecipe(new ItemStack(ModItems.emerald_string, 3), "X", "Y", 'X', ModItems.emerald_soul, 'Y', Items.STRING);
GameRegistry.addRecipe(new ItemStack(ModItems.gold_feather), " Y ", "YXY", " Y ", 'X', Items.FEATHER, 'Y', ModItems.gold_crystal);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.recipe_book), ModItems.cursed_steel, Items.BOOK);
}Example 30
| Project: Lost-Eclipse-master File: ModRecipes.java View source code |
public static void registerMiscRecipes() {
GameRegistry.addShapedRecipe(new ItemStack(ModItems.astrillGem), new Object[] { "AAA", "AAA", "AAA", 'A', ModItems.astrillGemFragment });
GameRegistry.addShapedRecipe(new ItemStack(ModItems.staffBase), new Object[] { "B", "A", "A", 'A', Items.STICK, 'B', ModItems.golemGyro });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.frostDust, 2), new Object[] { ModItems.frostRod });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.frostRod), new Object[] { ModItems.frostDust, Items.STICK });
}Example 31
| Project: Minecraft-master File: CraftingLoader.java View source code |
private static void registerRecipe() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemLoader.goldenEgg), new Object[] { "###", "#*#", "###", '#', "ingotGold", '*', Items.egg }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemLoader.redstonePickaxe), new Object[] { "###", " * ", " * ", '#', "dustRedstone", '*', "stickWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemLoader.redstoneApple), new Object[] { "###", "#*#", "###", '#', "dustRedstone", '*', Items.apple }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemLoader.redstoneHelmet), new Object[] { "###", "# #", '#', "dustRedstone" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemLoader.redstoneChestplate), new Object[] { "# #", "###", "###", '#', "dustRedstone" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemLoader.redstoneLeggings), new Object[] { "###", "# #", "# #", '#', "dustRedstone" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemLoader.redstoneBoots), new Object[] { "# #", "# #", '#', "dustRedstone" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockLoader.metalFurnace, 1, 0), new Object[] { "###", "# #", "###", '#', "blockIron" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockLoader.metalFurnace, 1, 8), new Object[] { "###", "# #", "###", '#', "blockGold" }));
GameRegistry.addShapedRecipe(new ItemStack(BlockLoader.grassBlock), new Object[] { "##", "##", '#', Blocks.vine });
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.vine, 4), BlockLoader.grassBlock);
}Example 32
| Project: MinecraftForge-master File: ModelAnimationDebug.java View source code |
public void preInit(FMLPreInitializationEvent event) {
GameRegistry.register(new Block(Material.WOOD) {
{
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + "." + blockName);
setRegistryName(blockId);
}
@Override
public ExtendedBlockState createBlockState() {
return new ExtendedBlockState(this, new IProperty[] { FACING, Properties.StaticProperty }, new IUnlistedProperty[] { Properties.AnimationProperty });
}
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
return false;
}
@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
return this.getDefaultState().withProperty(FACING, EnumFacing.getDirectionFromEntityLiving(pos, placer));
}
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
}
@Override
public int getMetaFromState(IBlockState state) {
return ((EnumFacing) state.getValue(FACING)).getIndex();
}
@Override
public boolean hasTileEntity(IBlockState state) {
return true;
}
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
return new Chest();
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
return state.withProperty(Properties.StaticProperty, true);
}
/*@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
TileEntity te = world.getTileEntity(pos);
if(te instanceof Chest && state instanceof IExtendedBlockState)
{
return ((Chest)te).getState((IExtendedBlockState)state);
}
return super.getExtendedState(state, world, pos);
}*/
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
if (world.isRemote) {
TileEntity te = world.getTileEntity(pos);
if (te instanceof Chest) {
((Chest) te).click(player.isSneaking());
}
}
return true;
}
});
GameRegistry.register(new ItemBlock(Block.REGISTRY.getObject(blockId)) {
@Override
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable NBTTagCompound nbt) {
return new ItemAnimationHolder();
}
}.setRegistryName(blockId));
GameRegistry.registerTileEntity(Chest.class, MODID + ":" + "tile_" + blockName);
}Example 33
| Project: PowerAdvantageAPI-master File: Recipes.java View source code |
public static void init() {
if (initDone)
return;
Blocks.init();
Items.init();
OreDictionary.registerOre("bread", net.minecraft.init.Items.BREAD);
OreDictionary.registerOre("coal", net.minecraft.init.Items.COAL);
OreDictionary.registerOre("furnace", net.minecraft.init.Blocks.FURNACE);
OreDictionary.registerOre("potato", net.minecraft.init.Items.POISONOUS_POTATO);
OreDictionary.registerOre("potato", net.minecraft.init.Items.POTATO);
CrusherRecipeRegistry.addNewCrusherRecipe("potato", new ItemStack(Items.starch, 1));
GameRegistry.addSmelting(Items.starch, new ItemStack(Items.bioplastic_ingot, 1), 0.1f);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.rotator_tool, 1), "xx", "x*", " x", 'x', "ingotIron", '*', "sprocket"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.item_conveyor, 5), "xxx", "ghg", "xxx", 'x', "plateSteel", 'g', "sprocket", 'h', net.minecraft.init.Blocks.HOPPER));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.item_filter_block, 1), "x", "y", "z", 'y', "stone", 'x', Blocks.item_conveyor, 'z', net.minecraft.init.Blocks.WOODEN_PRESSURE_PLATE));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.item_filter_food, 1), "x", "y", "z", 'y', "bread", 'x', Blocks.item_conveyor, 'z', net.minecraft.init.Blocks.WOODEN_PRESSURE_PLATE));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.item_filter_fuel, 1), "x", "y", "z", 'y', "coal", 'x', Blocks.item_conveyor, 'z', net.minecraft.init.Blocks.WOODEN_PRESSURE_PLATE));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.item_filter_inventory, 1), "x", "y", "z", 'y', "chest", 'x', Blocks.item_conveyor, 'z', net.minecraft.init.Blocks.WOODEN_PRESSURE_PLATE));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.item_filter_ore, 1), "x", "y", "z", 'y', "ingotGold", 'x', Blocks.item_conveyor, 'z', net.minecraft.init.Blocks.WOODEN_PRESSURE_PLATE));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.item_filter_plant, 1), "x", "y", "z", 'y', "treeSapling", 'x', Blocks.item_conveyor, 'z', net.minecraft.init.Blocks.WOODEN_PRESSURE_PLATE));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.item_filter_smelt, 1), "x", "y", "z", 'y', "furnace", 'x', Blocks.item_conveyor, 'z', net.minecraft.init.Blocks.WOODEN_PRESSURE_PLATE));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.item_filter_overflow, 1), "x", "z", 'x', Blocks.item_conveyor, 'z', net.minecraft.init.Blocks.WOODEN_PRESSURE_PLATE));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.steel_frame, 1), "xxx", "x x", "xxx", 'x', "barsSteel"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.storage_tank, 1), "xxx", "xpx", "xxx", 'x', "ingotPlastic", 'p', "pipe"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.metal_storage_tank, 1), "xxx", "xpx", "xxx", 'x', "ingotSteel", 'p', "pipe"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.fluid_drain, 1), " x ", "w#w", "ppp", 'x', "bars", 'w', "plateSteel", '#', "frameSteel", 'p', "pipe"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.fluid_discharge, 1), "ppp", "w#w", " x ", 'x', "bars", 'w', "plateSteel", '#', "frameSteel", 'p', "pipe"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.still, 1), "bpb", " f ", 'b', net.minecraft.init.Items.BUCKET, 'p', "pipe", 'f', net.minecraft.init.Blocks.FURNACE));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.fluid_switch, 1), " l ", "pfp", 'l', net.minecraft.init.Blocks.LEVER, 'p', "pipe", 'f', "frameSteel"));
// recipe modes
if (PowerAdvantage.recipeMode == RecipeMode.NORMAL) {
// normal means easy
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.sprocket, 4), " x ", "x/x", " x ", 'x', "ingotSteel", '/', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.sprocket, 4), " x ", "x/x", " x ", 'x', "ingotSteel", '/', "rod"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.fluid_pipe, 6), "xxx", " ", "xxx", 'x', "ingotIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.fluid_pipe, 6), "xxx", " ", "xxx", 'x', "ingotCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.metal_storage_tank, 1), "xxx", "xpx", "xxx", 'x', "ingotIron", 'p', "pipe"));
} else if (PowerAdvantage.recipeMode == RecipeMode.TECH_PROGRESSION) {
// make things a little more complicated with tech-progression mode
BaseMetals.strongHammers = false;
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.sprocket, 4), " x ", "x/x", " x ", 'x', "ingotSteel", '/', "rod"));
if (OreDictionary.getOres("rod").isEmpty())
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.sprocket, 4), " x ", "x/x", " x ", 'x', "ingotSteel", '/', "nuggetBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.fluid_pipe, 6), "xxx", " ", "xxx", 'x', "ingotIron"));
} else if (PowerAdvantage.recipeMode == RecipeMode.APOCALYPTIC) {
// apocalyptic means some things are not craftable, but some stuff can be recycled
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.item_conveyor, new ItemStack(cyano.basemetals.init.Blocks.steel_plate, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.item_filter_block, new ItemStack(cyano.basemetals.init.Blocks.steel_plate, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.item_filter_food, new ItemStack(cyano.basemetals.init.Blocks.steel_plate, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.item_filter_fuel, new ItemStack(cyano.basemetals.init.Blocks.steel_plate, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.item_filter_inventory, new ItemStack(cyano.basemetals.init.Blocks.steel_plate, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.item_filter_ore, new ItemStack(cyano.basemetals.init.Blocks.steel_plate, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.item_filter_plant, new ItemStack(cyano.basemetals.init.Blocks.steel_plate, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.item_filter_smelt, new ItemStack(cyano.basemetals.init.Blocks.steel_plate, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.item_filter_overflow, new ItemStack(cyano.basemetals.init.Blocks.steel_plate, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.storage_tank, new ItemStack(Blocks.fluid_pipe, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.fluid_discharge, new ItemStack(Blocks.fluid_pipe, 2));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.fluid_drain, new ItemStack(Blocks.fluid_pipe, 2));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.fluid_pipe, 3), "xxx", " ", "xxx", 'x', "ingotIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.fluid_pipe, 3), "xxx", " ", "xxx", 'x', "ingotCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.fluid_pipe, 3), "xxx", " ", "xxx", 'x', "ingotLead"));
}
initDone = true;
}Example 34
| Project: Realistic-Terrain-Generation-master File: StairsEntry.java View source code |
@Override
protected void doRegister() {
getItemBlock().setUnlocalizedName(internalName);
GameRegistry.register(getItemBlock().setRegistryName(internalName));
for (EnumFacing facing : EnumFacing.HORIZONTALS) {
String name = internalName + "_" + facing;
Block block = getBlock(facing);
block.setUnlocalizedName(name);
GameRegistry.register(block.setRegistryName(name));
}
}Example 35
| Project: SpeedyTools-master File: CombinedClientProxy.java View source code |
/**
* Handle interaction with other mods, complete your setup based on this.
*/
@Override
public void postInit() {
ClientSide.postInitialise();
super.postInit();
SpeedyToolControls.initialiseInterceptors();
// register item models for the blocks
for (String blockName : RegistryForBlocks.getAllItemBlockNames()) {
Item itemBlockSimple = GameRegistry.findItem("speedytoolsmod", blockName);
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(SpeedyToolsMod.prependModID(blockName), "inventory");
final int DEFAULT_ITEM_SUBTYPE = 0;
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlockSimple, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation);
}
// register item models for the blocks
for (String itemName : RegistryForItems.getAllItemNames()) {
Item itemBlockSimple = GameRegistry.findItem("speedytoolsmod", itemName);
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(SpeedyToolsMod.prependModID(itemName), "inventory");
if (itemBlockSimple instanceof ItemSpeedyTool) {
ItemSpeedyTool itemSpeedyTool = (ItemSpeedyTool) itemBlockSimple;
for (int metadata : itemSpeedyTool.validMetadataValues()) {
String modelName = itemSpeedyTool.getVariantModelResLoc(itemName, metadata);
ModelBakery.addVariantName(itemSpeedyTool, modelName);
itemModelResourceLocation = new ModelResourceLocation(modelName, "inventory");
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlockSimple, metadata, itemModelResourceLocation);
}
} else {
final int DEFAULT_ITEM_SUBTYPE = 0;
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlockSimple, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation);
}
}
MinecraftForge.EVENT_BUS.register(new ItemEventHandler());
MinecraftForge.EVENT_BUS.register(new InputEventHandler());
MinecraftForge.EVENT_BUS.register(new RenderEventHandlers());
FMLCommonHandler.instance().bus().register(new ClientTickHandler());
MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
}Example 36
| Project: SteamAdvantage-master File: Recipes.java View source code |
public static void init() {
if (initDone)
return;
Blocks.init();
Items.init();
RecipeMode recipeMode = PowerAdvantage.recipeMode;
OreDictionary.registerOre("stick", net.minecraft.init.Items.STICK);
OreDictionary.registerOre("blockObsidian", net.minecraft.init.Blocks.OBSIDIAN);
if (recipeMode == RecipeMode.TECH_PROGRESSION) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.steam_governor, 1), " t ", "srs", "btb", 't', "sprocket", 's', "rod", 'r', "rod", 'b', "ingotBrass"));
if (SteamAdvantage.MUSKET_ENABLE)
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.blackpowder_musket, 1), "fss", "w ", 'f', net.minecraft.init.Items.FLINT_AND_STEEL, 's', "ingotSteel", 'w', "plankWood"));
if (SteamAdvantage.MUSKET_ENABLE)
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.blackpowder_musket, 1), "ssf", " w", 'f', net.minecraft.init.Items.FLINT_AND_STEEL, 's', "ingotSteel", 'w', "plankWood"));
} else if (recipeMode == RecipeMode.APOCALYPTIC) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.steam_governor, 1), " t ", "srs", "btb", 't', "sprocket", 's', "rod", 'r', "rod", 'b', "ingotBrass"));
CrusherRecipeRegistry.addNewCrusherRecipe(Items.steam_governor, new ItemStack(cyano.poweradvantage.init.Items.sprocket, 2));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.steam_crusher, new ItemStack(Items.steam_governor, 2));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.steam_furnace, new ItemStack(Items.steam_governor, 2));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.steam_boiler_coal, new ItemStack(Items.steam_governor, 2));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.steam_boiler_electric, new ItemStack(Items.steam_governor, 2));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.steam_boiler_geothermal, new ItemStack(Items.steam_governor, 2));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.steam_drill, new ItemStack(Items.steam_governor, 2));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.steam_elevator, new ItemStack(Items.steam_governor, 3));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.steam_tank, new ItemStack(Items.steam_governor, 1));
} else {
// normal
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.steam_governor, 1), " t ", "srs", "btb", 't', "nuggetIron", 's', "stick", 'r', "stick", 'b', "ingotBrass"));
if (SteamAdvantage.MUSKET_ENABLE)
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.blackpowder_musket, 1), "fss", "w ", 'f', net.minecraft.init.Items.FLINT_AND_STEEL, 's', "ingotSteel", 'w', "plankWood"));
if (SteamAdvantage.MUSKET_ENABLE)
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.blackpowder_musket, 1), "ssf", " w", 'f', net.minecraft.init.Items.FLINT_AND_STEEL, 's', "ingotSteel", 'w', "plankWood"));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_drill, net.minecraft.init.Items.DIAMOND_PICKAXE));
}
GameRegistry.addRecipe(new ShapedOreRecipe(Items.steam_drill_bit, " g ", " i ", "did", 'g', "sprocket", 'i', "ingotSteel", 'd', "gemDiamond"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.steam_pipe, 6), "xxx", " ", "xxx", 'x', "ingotBrass"));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_crusher, net.minecraft.init.Blocks.PISTON, "blockSteel"));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_furnace, net.minecraft.init.Blocks.FURNACE));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_boiler_coal, "conduitSteam"));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_drill, Items.steam_drill_bit));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_elevator, net.minecraft.init.Blocks.PISTON, "sprocket"));
GameRegistry.addRecipe(new ShapedOreRecipe(Blocks.steam_tank, "xgx", "xpx", "xxx", 'x', "plateCopper", 'p', "conduitSteam", 'g', "governor"));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_boiler_electric, "wire", net.minecraft.init.Items.BUCKET));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_boiler_geothermal, "conduitSteam", "blockObsidian"));
GameRegistry.addRecipe(new ShapedOreRecipe(Items.blackpowder_cartridge, "L", "g", "p", 'L', "nuggetLead", 'g', net.minecraft.init.Items.GUNPOWDER, 'p', net.minecraft.init.Items.PAPER));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.steam_track), Blocks.steam_pipe, cyano.poweradvantage.init.Blocks.steel_frame));
GameRegistry.addRecipe(new ShapedOreRecipe(Blocks.steam_switch, " L ", "pfp", 'L', net.minecraft.init.Blocks.LEVER, 'p', "conduitSteam", 'f', "frameSteel"));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_boiler_oil, net.minecraft.init.Blocks.FURNACE, net.minecraft.init.Items.BUCKET));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_pump, net.minecraft.init.Blocks.PISTON, net.minecraft.init.Items.BUCKET));
GameRegistry.addRecipe(steamMachineRecipe(Blocks.steam_still, net.minecraft.init.Items.BUCKET, net.minecraft.init.Items.BUCKET));
initDone = true;
}Example 37
| Project: TFC2-master File: RegistryItemQueue.java View source code |
public void registerItems() {
Entry e;
while (!listItem.isEmpty()) {
e = listItem.pop();
GameRegistry.register(e.item);
if (e.item instanceof IRegisterSelf) {
for (int c = 0; c < ((IRegisterSelf) e.item).getSubTypeNames().length; c++) {
String path = ((IRegisterSelf) e.item).getPath();
String subName = ((IRegisterSelf) e.item).getSubTypeNames()[c];
ModelLoader.setCustomModelResourceLocation(e.item, c, new ModelResourceLocation(Reference.ModID + ":" + path + subName, "inventory"));
}
} else {
ModelLoader.setCustomModelResourceLocation(e.item, 0, new ModelResourceLocation(Reference.ModID + ":" + e.item.getRegistryName().getResourcePath(), "inventory"));
}
}
}Example 38
| Project: TurtleGun-master File: ModItems.java View source code |
public static void loadItems() {
turtleGun = new ItemTurtleGun();
registerItem(turtleGun, "turtleGun");
turtleShell = new ItemTurtleShell();
registerItem(turtleShell, "turtleShell");
gunParts = new ItemParts();
registerItem(gunParts, "turtleGunPart");
OreDictionary.registerOre("shellTurtle", turtleShell);
addShaped(gunParts, " L", "ISW", "LW ", 'W', "plankWood", 'L', "logWood", 'S', "stickWood", 'I', "ingotIron");
addShaped(new ItemStack(gunParts, 1, 1), "IGI", "IRI", "TLT", 'I', "ingotIron", 'R', "dustRedstone", 'T', "shellTurtle", 'G', Items.gunpowder, 'L', Blocks.lever);
addShaped(new ItemStack(gunParts, 1, 2), "III", " D", "LLI", 'I', "ingotIron", 'L', Items.leather, 'D', Blocks.dispenser);
GameRegistry.addRecipe(new ShapelessOreRecipe(turtleGun, "shellTurtle", new ItemStack(gunParts, 1, 0), new ItemStack(gunParts, 1, 1), new ItemStack(gunParts, 1, 2)));
}Example 39
| Project: WearableBackpacks-master File: BackpacksContent.java View source code |
public static void init() {
if (WearableBackpacks.CONFIG.backpack.enabled.get()) {
BACKPACK = new ItemBackpack();
Block backpackBlock = new BlockBackpack();
GameRegistry.register(BACKPACK.setRegistryName("backpack"));
GameRegistry.register(backpackBlock.setRegistryName("backpack"));
GameRegistry.registerTileEntity(TileEntityBackpack.class, "wearablebackpacks:backpack");
}
// TODO: Register entities to spawn with backpacks.
//BackpackRegistry.registerBackpackEntity(EntityZombie.class, BACKPACK, 1.0 / 800);
//BackpackRegistry.registerBackpackEntity(EntitySkeleton.class, BACKPACK, 1.0 / 1200);
//BackpackRegistry.registerBackpackEntity(EntityPigZombie.class, BACKPACK, 1.0 / 1000);
//BackpackRegistry.registerBackpackEntity(EntityEnderman.class, BACKPACK, 1.0 / 80);
}Example 40
| Project: Better-Mushroom-Islands-master File: BetterMushroomItems.java View source code |
public static void register() {
GameRegistry.registerItem(mushroom_leather, mushroom_leather.getUnlocalizedName().substring(5));
GameRegistry.registerItem(cooked_shroomeat, cooked_shroomeat.getUnlocalizedName().substring(5));
GameRegistry.registerItem(raw_shroomeat, raw_shroomeat.getUnlocalizedName().substring(5));
GameRegistry.addSmelting(raw_shroomeat, new ItemStack(cooked_shroomeat), 1.0F);
GameRegistry.addRecipe(new ItemStack(mooshroom_helm, 1), "AAA", "A A", 'A', mushroom_leather);
GameRegistry.addRecipe(new ItemStack(mooshroom_chest, 1), "A A", "AAA", "AAA", 'A', mushroom_leather);
GameRegistry.addRecipe(new ItemStack(mooshroom_legs, 1), "AAA", "A A", "A A", 'A', mushroom_leather);
GameRegistry.addRecipe(new ItemStack(mooshroom_boots, 1), "A A", "A A", 'A', mushroom_leather);
}Example 41
| Project: ClockworkPhase2-master File: Recipes.java View source code |
public static void initClockworkConstructs() {
ItemStack result;
result = new ItemStack(ModItems.mainspring);
mainspring = new ShapedOreRecipe(result, "iii", "iIi", "iii", 'i', "ingotIron", 'I', "blockIron");
GameRegistry.addRecipe(mainspring);
result = new ItemStack(ModItems.clockworkCore);
clockworkCore = new ShapedOreRecipe(result, "bib", "iii", "bib", 'i', "ingotIron", 'b', "ingotBrass");
GameRegistry.addRecipe(clockworkCore);
result = new ItemStack(ModItems.clockworkPickaxe);
clockworkPickaxe = new ShapedOreRecipe(result, "bbb", "wiw", " i ", 'b', "ingotBrass", 'i', "ingotIron", 'w', "gearWood");
GameRegistry.addRecipe(clockworkPickaxe);
result = new ItemStack(ModItems.clockworkAxe);
clockworkAxeRight = new ShapedOreRecipe(result, "bbw", "biw", " i ", 'b', "ingotBrass", 'i', "ingotIron", 'w', "gearWood");
clockworkAxeLeft = new ShapedOreRecipe(result, "wbb", "wib", " i ", 'b', "ingotBrass", 'i', "ingotIron", 'w', "gearWood");
GameRegistry.addRecipe(clockworkAxeRight);
GameRegistry.addRecipe(clockworkAxeLeft);
result = new ItemStack(ModItems.clockworkShovel);
clockworkShovel = new ShapedOreRecipe(result, "wbw", " i ", " i ", 'b', "ingotBrass", 'i', "ingotIron", 'w', "gearWood");
GameRegistry.addRecipe(clockworkShovel);
result = new ItemStack(ModItems.clockworkSword);
clockworkSword = new ShapedOreRecipe(result, " b ", "ibi", "wiw", 'b', "ingotBrass", 'i', "ingotIron", 'w', "gearWood");
GameRegistry.addRecipe(clockworkSword);
}Example 42
| Project: DeepResonance-master File: ModCrafting.java View source code |
public static void init() {
GameRegistry.addRecipe(new ItemStack(ModItems.deepResonanceManualItem), " o ", "rbr", " r ", 'r', Items.REDSTONE, 'b', Items.BOOK, 'o', ModBlocks.resonatingOreBlock);
GameRegistry.addRecipe(new ItemStack(ModItems.radiationMonitorItem), "qcq", "tot", "qrq", 'r', Items.REDSTONE, 'q', Items.QUARTZ, 'o', ModItems.resonatingPlateItem, 'c', Items.CLOCK, 't', Items.COMPASS);
GameRegistry.addRecipe(new ItemStack(ModBlocks.machineFrame), "ioi", "oso", "ioi", 'i', Items.IRON_INGOT, 's', Blocks.STONE, 'o', ModItems.resonatingPlateItem);
GameRegistry.addRecipe(new ItemStack(ModItems.filterMaterialItem, 8), "gcg", "csc", "gcg", 'g', Blocks.GRAVEL, 'c', Items.COAL, 's', Blocks.SAND);
GameRegistry.addRecipe(new ItemStack(ModItems.filterMaterialItem, 8), "gcg", "csc", "gcg", 'g', Blocks.GRAVEL, 'c', new ItemStack(Items.COAL, 1, 1), 's', Blocks.SAND);
GameRegistry.addRecipe(new ItemStack(ModBlocks.denseObsidianBlock, 4), "sos", "oso", "sos", 's', ModItems.spentFilterMaterialItem, 'o', Blocks.OBSIDIAN);
GameRegistry.addRecipe(new ItemStack(ModBlocks.denseGlassBlock, 4), "sgs", "gog", "sgs", 's', ModItems.spentFilterMaterialItem, 'o', Blocks.OBSIDIAN, 'g', Blocks.GLASS);
GameRegistry.addRecipe(new ItemStack(ModBlocks.resonatingPlateBlock), "ppp", "ppp", "ppp", 'p', ModItems.resonatingPlateItem);
GameRegistry.addRecipe(new ItemStack(ModItems.resonatingPlateItem, 9), "p", 'p', ModBlocks.resonatingPlateBlock);
GameRegistry.addSmelting(ModBlocks.resonatingOreBlock, new ItemStack(ModItems.resonatingPlateItem, 8), 0.0f);
if (DeepResonance.instance.rftools) {
RFToolsSupport.initCrafting();
}
GameRegistry.addRecipe(new ItemStack(ModItems.helmet), "ppp", "p p", " ", 'p', ModItems.resonatingPlateItem);
GameRegistry.addRecipe(new ItemStack(ModItems.chestplate), "p p", "ppp", "ppp", 'p', ModItems.resonatingPlateItem);
GameRegistry.addRecipe(new ItemStack(ModItems.boots), " ", "p p", "p p", 'p', ModItems.resonatingPlateItem);
GameRegistry.addRecipe(new ItemStack(ModItems.leggings), "ppp", "p p", "p p", 'p', ModItems.resonatingPlateItem);
GeneratorSetup.setupCrafting();
GeneratorControllerSetup.setupCrafting();
EnergyCollectorSetup.setupCrafting();
CrystalizerSetup.setupCrafting();
SmelterSetup.setupCrafting();
TankSetup.setupCrafting();
PurifierSetup.setupCrafting();
PedestalSetup.setupCrafting();
ValveSetup.setupCrafting();
LensSetup.setupCrafting();
LaserSetup.setupCrafting();
}Example 43
| Project: Glass-Shards-master File: ModRecipes.java View source code |
private static void addCrafting() {
if (Config.recipesRecolor)
for (int i = 0; i < 16; i++) {
ItemStack shards = new ItemStack(ModItems.glass_shards, 1, 16);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.glass_shards, 8, i), "SSS", "SDS", "SSS", 'S', shards, 'D', "dye" + dyes[i]));
}
if (Config.recipeUncolor)
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.glass_shards, 8, 16), "SSS", "SGS", "SSS", 'S', "shardsGlass", 'G', Items.GUNPOWDER));
if (Config.enableSword) {
GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.glass_sword, "S", "S", "|", 'S', new ItemStack(ModItems.glass_shards, 1, 16), '|', "stickWood"));
for (int i = 0; i < 16; i++) {
NBTTagCompound tag = new NBTTagCompound();
tag.setByte("Color", (byte) i);
ItemStack sword = new ItemStack(ModItems.glass_sword);
sword.setTagCompound(tag);
GameRegistry.addRecipe(new ShapedOreRecipe(sword, "S", "S", "|", 'S', new ItemStack(ModItems.glass_shards, 1, i), '|', "stickWood"));
}
}
}Example 44
| Project: Harvest-Festival-master File: RegistryHelper.java View source code |
private static void addSeeds(Crop crop, ItemStack seeds) {
if (DISABLE_VANILLA_WHEAT_SEEDS || DISABLE_VANILLA_SEEDS) {
//Disable the item
SEEDS_BLACKLIST.register(seeds.getItem());
}
//Add a bag > seed recipe
if (crop.getCropStack(1).getItem() != seeds.getItem()) {
GameRegistry.addRecipe(new SeedRecipeHandler(seeds, crop.getSeedStack(1)));
}
}Example 45
| Project: ItsJustaCharm-master File: ModRecipes.java View source code |
public static void registerCraftingRecipes() {
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.TintedPlanks, 4), ModBlocks.TintedLog);
GameRegistry.addRecipe(new RingAttachmentRecipe());
RecipeSorter.register("ijc:ringAttach", RingAttachmentRecipe.class, RecipeSorter.Category.SHAPELESS, "");
GameRegistry.addRecipe(new RingRemovalRecipe());
RecipeSorter.register("ijc:ringRemove", RingRemovalRecipe.class, RecipeSorter.Category.SHAPELESS, "");
}Example 46
| Project: Kingdom-Keys-Re-Coded-master File: ModItemsRecipes.java View source code |
public static void init() {
RecipeSorter.register(Reference.MODID + ":shapelessnbt", ShapelessNBTRecipe.class, RecipeSorter.Category.SHAPELESS, "after:forge:shapelessore");
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Heart), " H ", "HSH", " H ", 'H', ModItems.DarkHeart, 'S', Blocks.SOUL_SAND);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.PureHeart), " H ", "HSH", " H ", 'H', ModItems.Heart, 'S', Blocks.SOUL_SAND);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.KingdomHearts), " H ", "HSH", " H ", 'H', ModItems.PureHeart, 'S', Blocks.SOUL_SAND);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.DarkLeather), "DDD", "DLD", "DDD", 'D', ModItems.DarkHeart, 'L', Items.LEATHER);
// Organization XIII Robe
GameRegistry.addShapedRecipe(new ItemStack(ModItems.OrganizationRobe_Helmet), "DHD", "I I", 'H', Items.LEATHER_HELMET, 'D', ModItems.DarkLeather, 'I', ModItems.DarkInfusedIron);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.OrganizationRobe_Chestplate), "D D", "ICI", "DDD", 'C', Items.LEATHER_CHESTPLATE, 'D', ModItems.DarkLeather, 'I', ModItems.DarkInfusedIron);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.OrganizationRobe_Leggings), "DLD", "I I", "D D", 'L', Items.LEATHER_LEGGINGS, 'D', ModItems.DarkLeather, 'I', ModItems.DarkInfusedIron);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.OrganizationRobe_Boots), "D D", "IBI", 'B', Items.LEATHER_BOOTS, 'D', ModItems.DarkLeather, 'I', ModItems.DarkInfusedIron);
// Aqua's Keyblade Armour
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Aqua_Helmet), "SHS", "F F", 'H', Items.DIAMOND_HELMET, 'S', ModItems.StormyInfusedIron, 'F', ModItems.FrostInfusedSnowBall);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Aqua_Chestplate), "S S", "FCF", "SSS", 'C', Items.DIAMOND_CHESTPLATE, 'S', ModItems.StormyInfusedIron, 'F', ModItems.FrostInfusedSnowBall);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Aqua_Leggings), "SLS", "F F", "S S", 'L', Items.DIAMOND_LEGGINGS, 'S', ModItems.StormyInfusedIron, 'F', ModItems.FrostInfusedSnowBall);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Aqua_Boots), "S S", "FBF", 'B', Items.DIAMOND_BOOTS, 'S', ModItems.StormyInfusedIron, 'F', ModItems.FrostInfusedSnowBall);
// Ventus' Keyblade Armour
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Ventus_Helmet), "SHS", "F F", 'H', Items.DIAMOND_HELMET, 'S', ModItems.StormyInfusedIron, 'F', ModItems.LightningInfusedGold);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Ventus_Chestplate), "S S", "FCF", "SSS", 'C', Items.DIAMOND_CHESTPLATE, 'S', ModItems.StormyInfusedIron, 'F', ModItems.LightningInfusedGold);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Ventus_Leggings), "SLS", "F F", "S S", 'L', Items.DIAMOND_LEGGINGS, 'S', ModItems.StormyInfusedIron, 'F', ModItems.LightningInfusedGold);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Ventus_Boots), "S S", "FBF", 'B', Items.DIAMOND_BOOTS, 'S', ModItems.StormyInfusedIron, 'F', ModItems.LightningInfusedGold);
// Terra's Keyblade Armour
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Terra_Helmet), "SHS", "F F", 'H', Items.DIAMOND_HELMET, 'S', ModItems.DarkInfusedIron, 'F', ModItems.BlazingInfusedCoal);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Terra_Chestplate), "S S", "FCF", "SSS", 'C', Items.DIAMOND_CHESTPLATE, 'S', ModItems.DarkInfusedIron, 'F', ModItems.BlazingInfusedCoal);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Terra_Leggings), "SLS", "F F", "S S", 'L', Items.DIAMOND_LEGGINGS, 'S', ModItems.DarkInfusedIron, 'F', ModItems.BlazingInfusedCoal);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Terra_Boots), "S S", "FBF", 'B', Items.DIAMOND_BOOTS, 'S', ModItems.DarkInfusedIron, 'F', ModItems.BlazingInfusedCoal);
// Eraqus' Keyblade armour
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Eraqus_Helmet), "SHS", "F F", 'H', Items.DIAMOND_HELMET, 'S', ModItems.BrightInfusedGlowStone, 'F', ModItems.MythrilInfusedDiamond);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Eraqus_Chestplate), "S S", "FCF", "SSS", 'C', Items.DIAMOND_CHESTPLATE, 'S', ModItems.BrightInfusedGlowStone, 'F', ModItems.MythrilInfusedDiamond);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Eraqus_Leggings), "SLS", "F F", "S S", 'L', Items.DIAMOND_LEGGINGS, 'S', ModItems.BrightInfusedGlowStone, 'F', ModItems.MythrilInfusedDiamond);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.Eraqus_Boots), "S S", "FBF", 'B', Items.DIAMOND_BOOTS, 'S', ModItems.BrightInfusedGlowStone, 'F', ModItems.MythrilInfusedDiamond);
ItemStack WHC56skull = new ItemStack(Items.SKULL, 1, 3);
WHC56skull.setTagCompound(new NBTTagCompound());
WHC56skull.getTagCompound().setTag("SkullOwner", new NBTTagString("Wehavecookies56"));
ItemStack AAskull = new ItemStack(Items.SKULL, 1, 3);
AAskull.setTagCompound(new NBTTagCompound());
AAskull.getTagCompound().setTag("SkullOwner", new NBTTagString("Abelatox"));
GameRegistry.addShapedRecipe(WHC56skull, "CCC", "CKC", "CCC", 'C', Items.COOKIE, 'K', ModItems.KingdomHearts);
GameRegistry.addShapedRecipe(AAskull, "FFF", "FKF", "FFF", 'F', Items.BLAZE_POWDER, 'K', ModItems.KingdomHearts);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.SynthesisBagS), "LSL", "L L", "LLL", 'L', Items.LEATHER, 'S', Items.STRING);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.SynthesisBagM), "LSL", "LBL", "LLL", 'L', Items.LEATHER, 'S', Items.STRING, 'B', ModItems.SynthesisBagS);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.SynthesisBagL), "LSL", "LBL", "LLL", 'L', Items.LEATHER, 'S', Items.STRING, 'B', ModItems.SynthesisBagM);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.EmptyBottle), "G G", "GBG", "GGG", 'G', "blockGlass", 'B', Items.GLASS_BOTTLE));
ItemStack BlazingCrystal = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(BlazingCrystal, Strings.SM_BlazingCrystal, "S");
ItemStack FrostCrystal = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(FrostCrystal, Strings.SM_FrostCrystal, "S");
ItemStack StormyCrystal = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(StormyCrystal, Strings.SM_StormyCrystal, "S");
ItemStack MythrilCrystal = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(MythrilCrystal, Strings.SM_MythrilCrystal, "S");
ItemStack LightningCrystal = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(LightningCrystal, Strings.SM_LightningCrystal, "S");
ItemStack BrightCrystal = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(BrightCrystal, Strings.SM_BrightCrystal, "S");
ItemStack DarkCrystal = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(DarkCrystal, Strings.SM_DarkCrystal, "S");
ItemStack DenseShard = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(DenseShard, Strings.SM_DenseShard, "C");
ItemStack DenseStone = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(DenseStone, Strings.SM_DenseStone, "B");
ItemStack DenseGem = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(DenseGem, Strings.SM_DenseGem, "A");
ItemStack DenseCrystal = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(DenseCrystal, Strings.SM_DenseCrystal, "S");
ItemStack TwilightShard = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(TwilightShard, Strings.SM_TwilightShard, "C");
ItemStack TwilightStone = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(TwilightStone, Strings.SM_TwilightStone, "B");
ItemStack TwilightGem = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(TwilightGem, Strings.SM_TwilightGem, "A");
ItemStack TwilightCrystal = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(TwilightCrystal, Strings.SM_TwilightCrystal, "S");
ItemStack MythrilShard = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(MythrilShard, Strings.SM_MythrilShard, "C");
ItemStack MythrilStone = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(MythrilStone, Strings.SM_MythrilStone, "B");
ItemStack MythrilGem = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(MythrilGem, Strings.SM_MythrilGem, "A");
ItemStack SerenityShard = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(SerenityShard, Strings.SM_SerenityShard, "C");
ItemStack SerenityStone = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(SerenityStone, Strings.SM_SerenityStone, "B");
ItemStack LostIllusion = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(LostIllusion, Strings.SM_LostIllusion, "A");
ItemStack ManifestIllusion = new ItemStack(ModItems.SynthesisMaterial, 1);
ItemStacks.createSynthesisItem(ManifestIllusion, Strings.SM_ManifestIllusion, "S");
GameRegistry.addRecipe(new ShapelessNBTRecipe(new ItemStack(ModItems.AbandonedKnowledge), ModItems.DarkLeather, FrostCrystal, BlazingCrystal, LightningCrystal, MythrilCrystal, StormyCrystal, DarkCrystal, Items.BOOK, LostIllusion));
GameRegistry.addRecipe(new ShapelessNBTRecipe(new ItemStack(ModItems.BlazingInfusedCoal), BlazingCrystal, Items.COAL));
GameRegistry.addRecipe(new ShapelessNBTRecipe(new ItemStack(ModItems.FrostInfusedSnowBall), FrostCrystal, Items.SNOWBALL));
GameRegistry.addRecipe(new ShapelessNBTRecipe(new ItemStack(ModItems.StormyInfusedIron), StormyCrystal, "ingotIron"));
GameRegistry.addRecipe(new ShapelessNBTRecipe(new ItemStack(ModItems.MythrilInfusedDiamond), MythrilCrystal, "gemDiamond"));
GameRegistry.addRecipe(new ShapelessNBTRecipe(new ItemStack(ModItems.LightningInfusedGold), LightningCrystal, "ingotGold"));
GameRegistry.addRecipe(new ShapelessNBTRecipe(new ItemStack(ModItems.BrightInfusedGlowStone), BrightCrystal, "dustGlowstone"));
GameRegistry.addRecipe(new ShapelessNBTRecipe(new ItemStack(ModItems.DarkInfusedIron), DarkCrystal, "ingotIron"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.IceCream), "stickWood", Items.SUGAR, Items.WATER_BUCKET, Blocks.ICE));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.IceCream), "stickWood", Items.SUGAR, Items.WATER_BUCKET, Blocks.PACKED_ICE));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.IceCream), "stickWood", Items.SUGAR, Items.POTIONITEM, Blocks.ICE));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.IceCream), "stickWood", Items.SUGAR, Items.POTIONITEM, Blocks.PACKED_ICE));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.EmptyBottle), new ItemStack(ModItems.HpOrb), new ItemStack(ModItems.Potion));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.EmptyBottle), new ItemStack(ModItems.MagicOrb), new ItemStack(ModItems.Ether));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.Ether), new ItemStack(ModItems.MagicOrb), new ItemStack(ModItems.MegaEther));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.EmptyBottle), new ItemStack(ModItems.Ether), new ItemStack(ModItems.MegaEther));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.Potion), new ItemStack(ModItems.MagicOrb), new ItemStack(ModItems.Elixir));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.Ether), new ItemStack(ModItems.HpOrb), new ItemStack(ModItems.Elixir));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.MegaEther), new ItemStack(ModItems.HiPotion), new ItemStack(ModItems.Megalixir));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.EmptyBottle), new ItemStack(ModItems.Potion), new ItemStack(ModItems.HiPotion));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.Potion), new ItemStack(ModItems.HpOrb), new ItemStack(ModItems.HiPotion));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.EmptyBottle), new ItemStack(ModItems.HiPotion), new ItemStack(ModItems.MegaPotion));
BrewingRecipeRegistry.addRecipe(new ItemStack(ModItems.HiPotion), new ItemStack(ModItems.HpOrb), new ItemStack(ModItems.MegaPotion));
}Example 47
| Project: mcplus_mods-master File: _Gems.java View source code |
@EventHandler
@Override
public void PreInitialize(FMLPreInitializationEvent parEvent) {
MCP.item(ruby);
MCP.item(sapphire);
MCP.item(amethyst);
MCP.block(rubyOre);
MCP.block(sapphireOre);
MCP.block(amethystOre);
MCP.block(rubyBlock);
MCP.block(sapphireBlock);
MCP.block(amethystBlock);
MCP.lang(rubyBlock.getUnlocalizedName() + ".name", "Block of Ruby");
MCP.lang(sapphireBlock.getUnlocalizedName() + ".name", "Block of Sapphire");
MCP.lang(amethystBlock.getUnlocalizedName() + ".name", "Block of Amethyst");
GameRegistry.registerWorldGenerator(new WorldGenOreBase(rubyOre.getDefaultState(), 4, 6, Dimensions.SURFACE).setSpawnHeight(70), 10);
GameRegistry.registerWorldGenerator(new WorldGenOreBase(sapphireOre.getDefaultState(), 4, 6, Dimensions.SURFACE).setSpawnHeight(70), 10);
GameRegistry.registerWorldGenerator(new WorldGenOreBase(amethystOre.getDefaultState(), 8, 6, Dimensions.NETHER), 10);
super.PreInitialize(parEvent);
}Example 48
| Project: MrCrayfishSkateboardingMod-master File: MrCrayfishSkateboardingMod.java View source code |
@EventHandler
public void init(FMLInitializationEvent event) {
proxy.registerRenders();
EntityRegistry.registerModEntity(EntitySkateboard.class, "csmSkateboard", 0, this, 64, 1, false);
GameRegistry.registerTileEntity(TileEntitySlope.class, Reference.MOD_ID + "TileEntitySlope");
GameRegistry.registerTileEntity(TileEntityCornerSlope.class, Reference.MOD_ID + "TileEntityCornerSlope");
GameRegistry.registerTileEntity(TileEntityStair.class, Reference.MOD_ID + "TileEntityStair");
if (event.getSide() == Side.CLIENT) {
FMLCommonHandler.instance().bus().register(new SkateboardInput());
FMLCommonHandler.instance().bus().register(new ComboOverlay());
}
}Example 49
| Project: Natura-master File: NaturaCommons.java View source code |
private void registerRecipes() {
// Crops
GameRegistry.addRecipe(wheat_seed_bag.copy(), "sss", "sss", "sss", 's', Items.WHEAT_SEEDS);
GameRegistry.addRecipe(new ShapedOreRecipe(potatoes_seed_bag.copy(), "sss", "sss", "sss", 's', "cropPotato"));
GameRegistry.addRecipe(new ShapedOreRecipe(carrots_seed_bag.copy(), "sss", "sss", "sss", 's', "cropCarrot"));
GameRegistry.addRecipe(nether_wart_seed_bag.copy(), "sss", "sss", "sss", 's', Items.NETHER_WART);
GameRegistry.addRecipe(new ItemStack(boneMealBag, 1, 0), "sss", "sss", "sss", 's', new ItemStack(Items.DYE, 1, 15));
GameRegistry.addRecipe(new ItemStack(Items.WHEAT_SEEDS, 9, 0), "s", 's', wheat_seed_bag.copy());
GameRegistry.addRecipe(new ItemStack(Items.POTATO, 9, 0), "s", 's', potatoes_seed_bag.copy());
GameRegistry.addRecipe(new ItemStack(Items.CARROT, 9, 0), "s", 's', potatoes_seed_bag.copy());
GameRegistry.addRecipe(new ItemStack(Items.NETHER_WART, 9, 0), "s", 's', nether_wart_seed_bag.copy());
GameRegistry.addRecipe(new ItemStack(Items.DYE, 9, 15), "s", 's', boneMealBag);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.STRING), "sss", 's', "cropCotton"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.WOOL), "sss", "sss", "sss", 's', "cropCotton"));
GameRegistry.addRecipe(cactusJuice.copy(), "X", 'X', Blocks.CACTUS);
GameRegistry.addRecipe(new ItemStack(Items.WATER_BUCKET, 1), "www", "wBw", "www", 'w', cactusJuice.copy(), 'B', Items.BUCKET);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.BREAD), "bbb", 'b', "cropBarley"));
GameRegistry.addRecipe(new ShapedOreRecipe(barleyFlour.copy(), "X", 'X', "cropBarley"));
if (Config.enableWheatRecipe) {
GameRegistry.addRecipe(new ShapedOreRecipe(wheatFlour.copy(), "X", 'X', "cropWheat"));
}
// Cake
GameRegistry.addRecipe(new ItemStack(Items.CAKE, 1), "AAA", "BEB", " C ", 'A', Items.MILK_BUCKET, 'B', Items.SUGAR, 'C', wheatFlour.copy(), 'E', Items.EGG);
GameRegistry.addRecipe(new ItemStack(Items.CAKE, 1), "AAA", "BEB", " C ", 'A', Items.MILK_BUCKET, 'B', Items.SUGAR, 'C', barleyFlour.copy(), 'E', Items.EGG);
// Leather
if (isEntitiesLoaded()) {
GameRegistry.addRecipe(new ItemStack(Items.LEATHER, 2), "##", "##", '#', impLeather.copy());
}
// Clouds
GameRegistry.addRecipe(new ItemStack(Items.COAL, 1, 1), "ccc", "ccc", "ccc", 'c', new ItemStack(clouds, 1, BlockCloud.CloudType.ASH.getMeta()));
GameRegistry.addRecipe(sulfurPowder.copy(), "cc", "cc", 'c', new ItemStack(clouds, 1, BlockCloud.CloudType.SULFUR.getMeta()));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.GUNPOWDER, 1, 0), "cc", "cc", 'c', "dustSulfur"));
// Arrows
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.ARROW, 4, 0), " f ", "#s#", " # ", 's', "stickWood", '#', ghostwoodFletching.copy(), 'f', Items.FLINT));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.ARROW, 4, 0), " f ", "#s#", " # ", 's', new ItemStack(sticks, 1, OreDictionary.WILDCARD_VALUE), '#', ghostwoodFletching.copy(), 'f', Items.FLINT));
// Misc
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.GLASS_BOTTLE, 3), "# #", " # ", '#', "glass"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.DAYLIGHT_DETECTOR), "GGG", "QQQ", "WWW", 'G', "glass", 'Q', "gemQuartz", 'W', "slabWood"));
}Example 50
| Project: NOVA-Core-master File: ItemConverter.java View source code |
private void registerNOVAItem(ItemFactory itemFactory) {
if (map.containsKey(itemFactory)) {
// just a safeguard - don't map stuff twice
return;
}
net.minecraft.item.Item itemWrapper;
Item dummy = itemFactory.build();
if (dummy instanceof ItemBlock) {
BlockFactory blockFactory = ((ItemBlock) dummy).blockFactory;
net.minecraft.block.Block mcBlock = BlockConverter.instance().toNative(blockFactory);
itemWrapper = net.minecraft.item.Item.getItemFromBlock(mcBlock);
if (itemWrapper == null) {
throw new InitializationException("ItemConverter: Missing block: " + itemFactory.getID());
}
} else {
itemWrapper = new FWItem(itemFactory);
}
MinecraftItemMapping minecraftItemMapping = new MinecraftItemMapping(itemWrapper, 0);
map.put(itemFactory, minecraftItemMapping);
// Don't register ItemBlocks twice
if (!(dummy instanceof ItemBlock)) {
NovaMinecraft.proxy.registerItem((FWItem) itemWrapper);
String itemId = itemFactory.getID();
if (!itemId.contains(":"))
itemId = NovaLauncher.instance().flatMap(NovaLauncher::getCurrentMod).map(Mod::id).orElse("nova") + ':' + itemId;
GameRegistry.registerItem(itemWrapper, itemId);
if (dummy.components.has(Category.class) && FMLCommonHandler.instance().getSide().isClient()) {
//Add into creative tab
Category category = dummy.components.get(Category.class);
itemWrapper.setCreativeTab(CategoryConverter.instance().toNative(category, itemWrapper));
}
Game.logger().info("Registered item: {}", itemFactory.getID());
}
}Example 51
| Project: redwood-master File: NaturaCommons.java View source code |
private void registerRecipes() {
// Crops
GameRegistry.addRecipe(wheat_seed_bag.copy(), "sss", "sss", "sss", 's', Items.WHEAT_SEEDS);
GameRegistry.addRecipe(new ShapedOreRecipe(potatoes_seed_bag.copy(), "sss", "sss", "sss", 's', "cropPotato"));
GameRegistry.addRecipe(new ShapedOreRecipe(carrots_seed_bag.copy(), "sss", "sss", "sss", 's', "cropCarrot"));
GameRegistry.addRecipe(nether_wart_seed_bag.copy(), "sss", "sss", "sss", 's', Items.NETHER_WART);
GameRegistry.addRecipe(new ItemStack(boneMealBag, 1, 0), "sss", "sss", "sss", 's', new ItemStack(Items.DYE, 1, 15));
GameRegistry.addRecipe(new ItemStack(Items.WHEAT_SEEDS, 9, 0), "s", 's', wheat_seed_bag.copy());
GameRegistry.addRecipe(new ItemStack(Items.POTATO, 9, 0), "s", 's', potatoes_seed_bag.copy());
GameRegistry.addRecipe(new ItemStack(Items.CARROT, 9, 0), "s", 's', potatoes_seed_bag.copy());
GameRegistry.addRecipe(new ItemStack(Items.NETHER_WART, 9, 0), "s", 's', nether_wart_seed_bag.copy());
GameRegistry.addRecipe(new ItemStack(Items.DYE, 9, 15), "s", 's', boneMealBag);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.STRING), "sss", 's', "cropCotton"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.WOOL), "sss", "sss", "sss", 's', "cropCotton"));
GameRegistry.addRecipe(cactusJuice.copy(), "X", 'X', Blocks.CACTUS);
GameRegistry.addRecipe(new ItemStack(Items.WATER_BUCKET, 1), "www", "wBw", "www", 'w', cactusJuice.copy(), 'B', Items.BUCKET);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.BREAD), "bbb", 'b', "cropBarley"));
GameRegistry.addRecipe(new ShapedOreRecipe(barleyFlour.copy(), "X", 'X', "cropBarley"));
if (Config.enableWheatRecipe) {
GameRegistry.addRecipe(new ShapedOreRecipe(wheatFlour.copy(), "X", 'X', "cropWheat"));
}
// Cake
GameRegistry.addRecipe(new ItemStack(Items.CAKE, 1), "AAA", "BEB", " C ", 'A', Items.MILK_BUCKET, 'B', Items.SUGAR, 'C', wheatFlour.copy(), 'E', Items.EGG);
GameRegistry.addRecipe(new ItemStack(Items.CAKE, 1), "AAA", "BEB", " C ", 'A', Items.MILK_BUCKET, 'B', Items.SUGAR, 'C', barleyFlour.copy(), 'E', Items.EGG);
// Leather
if (isEntitiesLoaded()) {
GameRegistry.addRecipe(new ItemStack(Items.LEATHER, 2), "##", "##", '#', impLeather.copy());
}
// Clouds
GameRegistry.addRecipe(new ItemStack(Items.COAL, 1, 1), "ccc", "ccc", "ccc", 'c', new ItemStack(clouds, 1, BlockCloud.CloudType.ASH.getMeta()));
GameRegistry.addRecipe(sulfurPowder.copy(), "cc", "cc", 'c', new ItemStack(clouds, 1, BlockCloud.CloudType.SULFUR.getMeta()));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.GUNPOWDER, 1, 0), "cc", "cc", 'c', "dustSulfur"));
// Arrows
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.ARROW, 4, 0), " f ", "#s#", " # ", 's', "stickWood", '#', ghostwoodFletching.copy(), 'f', Items.FLINT));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.ARROW, 4, 0), " f ", "#s#", " # ", 's', new ItemStack(sticks, 1, OreDictionary.WILDCARD_VALUE), '#', ghostwoodFletching.copy(), 'f', Items.FLINT));
// Misc
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.GLASS_BOTTLE, 3), "# #", " # ", '#', "glass"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.DAYLIGHT_DETECTOR), "GGG", "QQQ", "WWW", 'G', "glass", 'Q', "gemQuartz", 'W', "slabWood"));
}Example 52
| Project: RoboWarsInvasion-master File: RoboWarsMod.java View source code |
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
EntityRegistry.registerGlobalEntityID(EntityHeavyBotMelee.class, "HeavyBotMelee", EntityRegistry.findGlobalUniqueEntityId(), 80, 1);
EntityRegistry.registerGlobalEntityID(EntityBotMelee.class, "BotMelee", EntityRegistry.findGlobalUniqueEntityId(), 80, 1);
EntityRegistry.registerGlobalEntityID(EntityBotShoot.class, "BotShoot", EntityRegistry.findGlobalUniqueEntityId(), 80, 1);
// EntityRegistry.registerGlobalEntityID(EntityLaser.class, "Laser", EntityRegistry.findGlobalUniqueEntityId(), 80, 1);
EntityRegistry.registerModEntity(EntityLaser.class, "Laser", EntityRegistry.findGlobalUniqueEntityId(), MODID, 100, 10, false);
GameRegistry.registerItem(ITEM_POWER_CORE, ITEM_POWER_CORE.getName());
addSpawn(1, 3, EntityHeavyBotMelee.class);
addSpawn(4, 6, EntityBotMelee.class, EntityBotShoot.class);
proxy.RegisterRendering();
}Example 53
| Project: SimpleLabels-master File: SimpleLabels.java View source code |
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
label = new BlockLabel();
GameRegistry.register(new ItemBlockLabel(label));
GameRegistry.registerTileEntity(TileLabel.class, "TileLabel");
vsu = new BlockVastStorageUnit();
GameRegistry.register(new ItemBlockVSU(vsu).setRegistryName("blockVSU"));
GameRegistry.registerTileEntity(TileVastStorageUnit.class, "TileVSU");
label.setCreativeTab(CreativeTabs.DECORATIONS);
vsu.setCreativeTab(CreativeTabs.DECORATIONS);
proxy.registerRenderers();
proxy.initModels();
}Example 54
| Project: StorageDrawers-master File: ModRecipes.java View source code |
public void init() {
ConfigManager config = StorageDrawers.config;
RecipeSorter.register("StorageDrawers:FallbackShapedOreRecipe", FallbackShapedOreRecipe.class, RecipeSorter.Category.SHAPED, "after:forge:shapedore");
for (BlockPlanks.EnumType material : BlockPlanks.EnumType.values()) {
if (config.isBlockEnabled(EnumBasicDrawer.FULL1.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.FULL1, material.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.FULL1.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "xxx", " y ", "xxx", 'x', new ItemStack(Blocks.PLANKS, 1, material.getMetadata()), 'y', "chestWood"));
}
if (config.isBlockEnabled(EnumBasicDrawer.FULL2.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.FULL2, material.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.FULL2.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "xyx", "xxx", "xyx", 'x', new ItemStack(Blocks.PLANKS, 1, material.getMetadata()), 'y', "chestWood"));
}
if (config.isBlockEnabled(EnumBasicDrawer.FULL4.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.FULL4, material.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.FULL4.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "yxy", "xxx", "yxy", 'x', new ItemStack(Blocks.PLANKS, 1, material.getMetadata()), 'y', "chestWood"));
}
if (config.isBlockEnabled(EnumBasicDrawer.HALF2.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.HALF2, material.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.HALF2.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "xyx", "xxx", "xyx", 'x', new ItemStack(Blocks.WOODEN_SLAB, 1, material.getMetadata()), 'y', "chestWood"));
}
if (config.isBlockEnabled(EnumBasicDrawer.HALF4.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.HALF4, material.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.HALF4.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "yxy", "xxx", "yxy", 'x', new ItemStack(Blocks.WOODEN_SLAB, 1, material.getMetadata()), 'y', "chestWood"));
}
if (config.isBlockEnabled("trim")) {
ItemStack result = new ItemStack(ModBlocks.trim, config.getBlockRecipeOutput("trim"), material.getMetadata());
GameRegistry.addRecipe(new ShapedOreRecipe(result, "xyx", "yyy", "xyx", 'x', "stickWood", 'y', new ItemStack(Blocks.PLANKS, 1, material.getMetadata())));
}
}
if (config.cache.enableFallbackRecipes) {
if (config.isBlockEnabled(EnumBasicDrawer.FULL1.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.FULL1, BlockPlanks.EnumType.OAK.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.FULL1.getUnlocalizedName()));
GameRegistry.addRecipe(new FallbackShapedOreRecipe(result, "xxx", " y ", "xxx", 'x', "plankWood", 'y', "chestWood"));
}
if (config.isBlockEnabled(EnumBasicDrawer.FULL2.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.FULL2, BlockPlanks.EnumType.OAK.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.FULL2.getUnlocalizedName()));
GameRegistry.addRecipe(new FallbackShapedOreRecipe(result, "xyx", "xxx", "xyx", 'x', "plankWood", 'y', "chestWood"));
}
if (config.isBlockEnabled(EnumBasicDrawer.FULL4.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.FULL4, BlockPlanks.EnumType.OAK.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.FULL4.getUnlocalizedName()));
GameRegistry.addRecipe(new FallbackShapedOreRecipe(result, "yxy", "xxx", "yxy", 'x', "plankWood", 'y', "chestWood"));
}
if (config.isBlockEnabled(EnumBasicDrawer.HALF2.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.HALF2, BlockPlanks.EnumType.OAK.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.HALF2.getUnlocalizedName()));
GameRegistry.addRecipe(new FallbackShapedOreRecipe(result, "xyx", "xxx", "xyx", 'x', "slabWood", 'y', "chestWood"));
}
if (config.isBlockEnabled(EnumBasicDrawer.HALF4.getUnlocalizedName())) {
ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.HALF4, BlockPlanks.EnumType.OAK.getName(), config.getBlockRecipeOutput(EnumBasicDrawer.HALF4.getUnlocalizedName()));
GameRegistry.addRecipe(new FallbackShapedOreRecipe(result, "yxy", "xxx", "yxy", 'x', "slabWood", 'y', "chestWood"));
}
if (config.isBlockEnabled("trim")) {
ItemStack result = new ItemStack(ModBlocks.trim, config.getBlockRecipeOutput("trim"), BlockPlanks.EnumType.OAK.getMetadata());
GameRegistry.addRecipe(new FallbackShapedOreRecipe(result, "xyx", "yyy", "xyx", 'x', "stickWood", 'y', "slabWood"));
}
}
if (config.isBlockEnabled("compdrawers"))
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.compDrawers, config.getBlockRecipeOutput("compdrawers")), "xxx", "zwz", "xyx", 'x', new ItemStack(Blocks.STONE), 'y', "ingotIron", 'z', new ItemStack(Blocks.PISTON), 'w', "drawerBasic"));
if (config.isBlockEnabled("controller"))
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.controller), "xxx", "yzy", "xwx", 'x', new ItemStack(Blocks.STONE), 'y', Items.COMPARATOR, 'z', "drawerBasic", 'w', "gemDiamond"));
if (config.isBlockEnabled("controllerSlave"))
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.controllerSlave), "xxx", "yzy", "xwx", 'x', new ItemStack(Blocks.STONE), 'y', Items.COMPARATOR, 'z', "drawerBasic", 'w', "ingotGold"));
if (config.cache.enableStorageUpgrades) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeStorage, 1, EnumUpgradeStorage.IRON.getMetadata()), "xyx", "yzy", "xyx", 'x', "ingotIron", 'y', "stickWood", 'z', ModItems.upgradeTemplate));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeStorage, 1, EnumUpgradeStorage.GOLD.getMetadata()), "xyx", "yzy", "xyx", 'x', "ingotGold", 'y', "stickWood", 'z', ModItems.upgradeTemplate));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeStorage, 1, EnumUpgradeStorage.OBSIDIAN.getMetadata()), "xyx", "yzy", "xyx", 'x', Blocks.OBSIDIAN, 'y', "stickWood", 'z', ModItems.upgradeTemplate));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeStorage, 1, EnumUpgradeStorage.DIAMOND.getMetadata()), "xyx", "yzy", "xyx", 'x', "gemDiamond", 'y', "stickWood", 'z', ModItems.upgradeTemplate));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeStorage, 1, EnumUpgradeStorage.EMERALD.getMetadata()), "xyx", "yzy", "xyx", 'x', "gemEmerald", 'y', "stickWood", 'z', ModItems.upgradeTemplate));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeOneStack, 1), "xyx", "yzy", "xyx", 'x', Items.FLINT, 'y', "stickWood", 'z', ModItems.upgradeTemplate));
}
if (config.cache.enableIndicatorUpgrades) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeStatus, 1, EnumUpgradeStatus.LEVEL1.getMetadata()), "wyw", "yzy", "xyx", 'w', new ItemStack(Blocks.REDSTONE_TORCH), 'x', "dustRedstone", 'y', "stickWood", 'z', ModItems.upgradeTemplate));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeStatus, 1, EnumUpgradeStatus.LEVEL2.getMetadata()), "wyw", "yzy", "xyx", 'w', Items.COMPARATOR, 'x', "dustRedstone", 'y', "stickWood", 'z', ModItems.upgradeTemplate));
}
if (config.cache.enableLockUpgrades) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.drawerKey), "xy ", " y ", " z ", 'x', "nuggetGold", 'y', "ingotGold", 'z', ModItems.upgradeTemplate));
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.keyButton, 1, EnumKeyType.DRAWER.getMetadata()), new ItemStack(Blocks.STONE_BUTTON), ModItems.drawerKey);
}
if (config.cache.enableVoidUpgrades) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeVoid), "yyy", "xzx", "yyy", 'x', Blocks.OBSIDIAN, 'y', "stickWood", 'z', ModItems.upgradeTemplate));
}
if (config.cache.enableRedstoneUpgrades) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeRedstone, 1, 0), "xyx", "yzy", "xyx", 'x', "dustRedstone", 'y', "stickWood", 'z', ModItems.upgradeTemplate));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeRedstone, 1, 1), "xxx", "yzy", "yyy", 'x', "dustRedstone", 'y', "stickWood", 'z', ModItems.upgradeTemplate));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeRedstone, 1, 2), "yyy", "yzy", "xxx", 'x', "dustRedstone", 'y', "stickWood", 'z', ModItems.upgradeTemplate));
}
if (config.cache.enableShroudUpgrades) {
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.shroudKey), ModItems.drawerKey, Items.ENDER_EYE);
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.keyButton, 1, EnumKeyType.CONCEALMENT.getMetadata()), new ItemStack(Blocks.STONE_BUTTON), ModItems.shroudKey);
}
if (config.cache.enableQuantifiableUpgrades) {
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.quantifyKey), ModItems.drawerKey, Items.WRITABLE_BOOK);
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.keyButton, 1, EnumKeyType.QUANTIFY.getMetadata()), new ItemStack(Blocks.STONE_BUTTON), ModItems.quantifyKey);
}
if (config.cache.enablePersonalUpgrades) {
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.personalKey), ModItems.drawerKey, Items.NAME_TAG);
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.keyButton, 1, EnumKeyType.PERSONAL.getMetadata()), new ItemStack(Blocks.STONE_BUTTON), ModItems.personalKey);
}
if (config.cache.enableTape) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.tape), " x ", "yyy", 'x', "slimeball", 'y', Items.PAPER));
}
if (config.cache.enableFramedDrawers) {
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.framingTable), "xxx", "x x", 'x', ModBlocks.trim);
if (config.isBlockEnabled("fulldrawers1")) {
ItemStack result = makeCustomDrawerItemStack(EnumBasicDrawer.FULL1, config.getBlockRecipeOutput(EnumBasicDrawer.FULL1.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "xxx", " y ", "xxx", 'x', "stickWood", 'y', "chestWood"));
}
if (config.isBlockEnabled("fulldrawers2")) {
ItemStack result = makeCustomDrawerItemStack(EnumBasicDrawer.FULL2, config.getBlockRecipeOutput(EnumBasicDrawer.FULL2.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "xyx", "xzx", "xyx", 'x', "stickWood", 'y', "chestWood", 'z', "plankWood"));
}
if (config.isBlockEnabled("halfdrawers2")) {
ItemStack result = makeCustomDrawerItemStack(EnumBasicDrawer.HALF2, config.getBlockRecipeOutput(EnumBasicDrawer.HALF2.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "xyx", "xzx", "xyx", 'x', "stickWood", 'y', "chestWood", 'z', "slabWood"));
}
if (config.isBlockEnabled("fulldrawers4")) {
ItemStack result = makeCustomDrawerItemStack(EnumBasicDrawer.FULL4, config.getBlockRecipeOutput(EnumBasicDrawer.FULL4.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "yxy", "xzx", "yxy", 'x', "stickWood", 'y', "chestWood", 'z', "plankWood"));
}
if (config.isBlockEnabled("halfdrawers4")) {
ItemStack result = makeCustomDrawerItemStack(EnumBasicDrawer.HALF4, config.getBlockRecipeOutput(EnumBasicDrawer.HALF4.getUnlocalizedName()));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "yxy", "xzx", "yxy", 'x', "stickWood", 'y', "chestWood", 'z', "slabWood"));
}
if (config.isBlockEnabled("trim")) {
ItemStack result = new ItemStack(ModBlocks.customTrim, config.getBlockRecipeOutput("trim"));
GameRegistry.addRecipe(new ShapedOreRecipe(result, "yxy", "xyx", "yxy", 'x', "stickWood", 'y', "plankWood"));
}
}
RecipeSorter.register("StorageDrawers:UpgradeTemplate", TemplateRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped");
CraftingManager.getInstance().getRecipeList().add(new TemplateRecipe());
}Example 55
| Project: vintagecraft-master File: VintageCraft.java View source code |
@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);
FMLCommonHandler.instance().bus().register(spawner = new ButterflySpawner());
MinecraftForge.EVENT_BUS.register(this);
proxy.registerTileEntities();
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
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);
}Example 56
| Project: vintagetg-master File: VintageTG.java View source code |
@EventHandler
public void init(FMLInitializationEvent event) throws Exception {
DynTreeGen.initGenerators();
packetPipeline.initalise();
FMLCommonHandler.instance().bus().register(this);
MinecraftForge.EVENT_BUS.register(this);
proxy.registerRenderInformation();
//proxy.registerTileEntities();
// NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
System.out.println("vcraft has init.");
GameRegistry.registerWorldGenerator(new WorldGenDeposits(), 4);
//GameRegistry.registerWorldGenerator(new WorldGenFlora(), 5);
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);
if (cfg.getBoolean("regstonerecipes", "general", true, "Whether or not to register stone recipes for Granite, Diorite and Andesite")) {
Recipes.RegisterRecipes();
}
cfg.save();
}Example 57
| Project: Applied-Energistics-2-master File: Registration.java View source code |
public void initialize(@Nonnull final FMLInitializationEvent event, @Nonnull final File recipeDirectory, @Nonnull final CustomRecipeConfig customRecipeConfig) {
Preconditions.checkNotNull(event);
Preconditions.checkNotNull(recipeDirectory);
Preconditions.checkArgument(!recipeDirectory.isFile());
Preconditions.checkNotNull(customRecipeConfig);
final Api api = Api.INSTANCE;
final IPartHelper partHelper = api.partHelper();
final IRegistryContainer registries = api.registries();
ApiDefinitions definitions = api.definitions();
definitions.getRegistry().getBootstrapComponents().forEach( b -> b.initialize(event.getSide()));
// Perform ore camouflage!
ItemMaterial.instance.makeUnique();
final Runnable recipeLoader = new RecipeLoader(recipeDirectory, customRecipeConfig, this.recipeHandler);
recipeLoader.run();
if (Integrations.ic2().isEnabled()) {
partHelper.registerNewLayer("appeng.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink");
partHelper.registerNewLayer("appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource");
}
//
// if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.RF ) )
// {
// partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" );
// }
//
// if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
// {
// partHelper.registerNewLayer( "appeng.parts.layers.LayerSidedEnvironment",
// "li.cil.oc.api.network.SidedEnvironment" );
// }
MinecraftForge.EVENT_BUS.register(TickHandler.INSTANCE);
MinecraftForge.EVENT_BUS.register(new PartPlacement());
if (AEConfig.instance().isFeatureEnabled(AEFeature.CHEST_LOOT)) {
MinecraftForge.EVENT_BUS.register(new ChestLoot());
}
final IGridCacheRegistry gcr = registries.gridCache();
gcr.registerGridCache(ITickManager.class, TickManagerCache.class);
gcr.registerGridCache(IEnergyGrid.class, EnergyGridCache.class);
gcr.registerGridCache(IPathingGrid.class, PathGridCache.class);
gcr.registerGridCache(IStorageGrid.class, GridStorageCache.class);
gcr.registerGridCache(P2PCache.class, P2PCache.class);
gcr.registerGridCache(ISpatialCache.class, SpatialPylonCache.class);
gcr.registerGridCache(ISecurityGrid.class, SecurityCache.class);
gcr.registerGridCache(ICraftingGrid.class, CraftingGridCache.class);
registries.cell().addCellHandler(new BasicCellHandler());
registries.cell().addCellHandler(new CreativeCellHandler());
api.definitions().materials().matterBall().maybeStack(1).ifPresent( ammoStack -> {
final double weight = 32;
registries.matterCannon().registerAmmo(ammoStack, weight);
});
this.recipeHandler.injectRecipes();
final PlayerStatsRegistration registration = new PlayerStatsRegistration(MinecraftForge.EVENT_BUS, AEConfig.instance());
registration.registerAchievementHandlers();
registration.registerAchievements();
if (AEConfig.instance().isFeatureEnabled(AEFeature.ENABLE_DISASSEMBLY_CRAFTING)) {
GameRegistry.addRecipe(new DisassembleRecipe());
RecipeSorter.register("appliedenergistics2:disassemble", DisassembleRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless");
}
if (AEConfig.instance().isFeatureEnabled(AEFeature.ENABLE_FACADE_CRAFTING)) {
definitions.items().facade().maybeItem().ifPresent( facadeItem -> {
GameRegistry.addRecipe(new FacadeRecipe((ItemFacade) facadeItem));
RecipeSorter.register("appliedenergistics2:facade", FacadeRecipe.class, Category.SHAPED, "after:minecraft:shaped");
});
}
}Example 58
| Project: ARKCraft-Code-master File: ItemRangedWeapon.java View source code |
public int getAmmoQuantityInInventory(ItemStack stack, EntityPlayer player) {
InventoryPlayer inventory = player.inventory;
String type = getAmmoType(stack);
Item item = GameRegistry.findItem(ARKCraft.MODID, type);
int out = 0;
if (type != null && inventory.hasItem(item)) {
for (ItemStack s : inventory.mainInventory) {
if (s != null && s.getItem().equals(item)) {
out += s.stackSize;
}
}
}
return out;
}Example 59
| Project: FML-master File: FMLMissingMappingsEvent.java View source code |
/**
* Remap the missing item to the specified Block.
*
* Use this if you have renamed a Block, don't forget to handle the ItemBlock.
* Existing references using the old name will point to the new one.
*
* @param target Block to remap to.
*/
public void remap(Block target) {
if (type != GameRegistry.Type.BLOCK)
throw new IllegalArgumentException("Can't remap an item to a block.");
if (target == null)
throw new NullPointerException("remap target is null");
if (GameData.getBlockRegistry().getId(target) < 0)
throw new IllegalArgumentException(String.format("The specified block %s hasn't been registered at startup.", target));
action = Action.REMAP;
this.target = target;
}Example 60
| Project: FutureCraft-master File: TileEntityAlloyFurnace.java View source code |
/**
* Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
* fuel
*/
public static int getItemBurnTime(ItemStack stack) {
if (stack == null) {
return 0;
} else {
Item item = stack.getItem();
if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
Block block = Block.getBlockFromItem(item);
if (block == Blocks.wooden_slab) {
return 150;
}
if (block.getMaterial() == Material.wood) {
return 300;
}
if (block == Blocks.coal_block) {
return 16000;
}
}
if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD"))
return 200;
if (item == Items.stick)
return 100;
if (item == Items.coal)
return 1600;
if (item == Items.lava_bucket)
return 20000;
if (item == Item.getItemFromBlock(Blocks.sapling))
return 100;
if (item == Items.blaze_rod)
return 2400;
return net.minecraftforge.fml.common.registry.GameRegistry.getFuelValue(stack);
}
}Example 61
| Project: ISBRH-master File: ISBRH.java View source code |
@EventHandler
public void init(FMLInitializationEvent event) {
if (exempleEnabled) {
logger.info("Registering ISBRH Block Exemple...");
testId = RenderRegistry.getNextAvailableRenderId();
GameRegistry.registerBlock(test, "test");
RenderRegistry.registerBlockHandler(new RenderExample());
RenderRegistry.registerTextureHandler((ITextureHandler) test);
}
Minecraft mc = Minecraft.getMinecraft();
// Prerequisite
ModelManager modelManager = ObfuscationReflectionHelper.getPrivateValue(Minecraft.class, mc, "aL", "field_175617_aL", "modelManager");
RenderManager renderManager = mc.getRenderManager();
IReloadableResourceManager resourceManager = ((IReloadableResourceManager) mc.getResourceManager());
// Render Item Hook
RenderItem item = new RenderItemISBRH(mc.getTextureManager(), modelManager, mc.getRenderItem());
ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, mc, item, "X", "field_175621_X", "renderItem");
ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, mc, new ItemRenderer(mc), "Y", "field_175620_Y", "itemRenderer");
renderManager.entityRenderMap.remove(EntityItem.class);
renderManager.entityRenderMap.put(EntityItem.class, new RenderEntityItem(renderManager, item));
renderManager.entityRenderMap.remove(EntityItemFrame.class);
renderManager.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(renderManager, item));
mc.entityRenderer = new EntityRenderer(mc, resourceManager);
// Render Block Dispatcher Hook
BlockRendererDispatcher rendererDispatcher = new ISBRHDispatcher(mc.getBlockRendererDispatcher(), modelManager.getBlockModelShapes(), mc.gameSettings);
ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, mc, rendererDispatcher, "aM", "field_175618_aM", "blockRenderDispatcher");
// Register Reload Listeners
resourceManager.registerReloadListener(rendererDispatcher);
resourceManager.registerReloadListener(item);
resourceManager.registerReloadListener(mc.entityRenderer);
}Example 62
| Project: Kingdom-Keys-1.8--master File: Recipes.java View source code |
public static void initShapedRecipes() {
ItemStack greenDye = new ItemStack(Items.dye, 1, 2);
ItemStack blueDye = new ItemStack(Items.dye, 1, 4);
ItemStack blackDye = new ItemStack(Items.dye, 1, 0);
ItemStack yellowDye = new ItemStack(Items.dye, 1, 11);
if (ConfigBooleans.expensiveDarkMatter == true) {
GameRegistry.addRecipe(new ItemStack(AddedItems.DarkMatter, 2), new Object[] { "DDD", "DOD", "DDD", 'D', Items.diamond, 'O', Blocks.obsidian });
}
if (ConfigBooleans.heartRecipe == false) {
GameRegistry.addRecipe(new ItemStack(AddedItems.Heart), new Object[] { " D ", "DSD", " D ", 'S', Blocks.soul_sand, 'D', AddedItems.DarkHeart });
}
GameRegistry.addRecipe(new ItemStack(AddedBlocks.KKChest), new Object[] { "HGH", "GCG", "HGH", 'H', AddedItems.Heart, 'G', Items.gold_ingot, 'C', Blocks.chest });
if (ConfigBooleans.heartRecipe == true) {
GameRegistry.addRecipe(new ItemStack(AddedItems.Heart), new Object[] { "DDD", "DSD", "DDD", 'S', Blocks.soul_sand, 'D', AddedItems.DarkHeart });
}
if (ConfigBooleans.heartRecipe == false) {
GameRegistry.addRecipe(new ItemStack(AddedItems.PureHeart), new Object[] { " D ", "DSD", " D ", 'S', Blocks.soul_sand, 'D', AddedItems.Heart });
}
if (ConfigBooleans.heartRecipe == true) {
GameRegistry.addRecipe(new ItemStack(AddedItems.PureHeart), new Object[] { "DDD", "DSD", "DDD", 'S', Blocks.soul_sand, 'D', AddedItems.Heart });
}
if (ConfigBooleans.heartRecipe == false) {
GameRegistry.addRecipe(new ItemStack(AddedItems.KingdomHearts), new Object[] { " D ", "DSD", " D ", 'S', Blocks.soul_sand, 'D', AddedItems.PureHeart });
}
if (ConfigBooleans.heartRecipe == true) {
GameRegistry.addRecipe(new ItemStack(AddedItems.KingdomHearts), new Object[] { "DDD", "DSD", "DDD", 'S', Blocks.soul_sand, 'D', AddedItems.PureHeart });
}
GameRegistry.addRecipe(new ItemStack(AddedItems.DarkLeather), new Object[] { "DDD", "DLD", "DDD", 'D', AddedItems.DarkHeart, 'L', Items.leather });
GameRegistry.addRecipe(new ItemStack(AddedItems.OrganizationHood), new Object[] { "LLL", "LDL", "SGS", 'D', AddedItems.DarkCrystal, 'L', AddedItems.DarkLeather, 'S', Items.string, 'G', AddedItems.DarkGem });
GameRegistry.addRecipe(new ItemStack(AddedItems.OrganizationCoat), new Object[] { "LGL", "LDL", "LLL", 'D', AddedItems.DarkCrystal, 'L', AddedItems.DarkLeather, 'G', AddedItems.DarkGem });
GameRegistry.addRecipe(new ItemStack(AddedItems.OrganizationLegs), new Object[] { "LLL", "LGL", "LDL", 'D', AddedItems.DarkCrystal, 'L', AddedItems.DarkLeather, 'G', AddedItems.DarkGem });
GameRegistry.addRecipe(new ItemStack(AddedItems.OrganizationBoots), new Object[] { "LDL", "LGL", 'D', AddedItems.DarkCrystal, 'L', AddedItems.DarkLeather, 'G', AddedItems.DarkGem });
GameRegistry.addRecipe(new ItemStack(AddedItems.Potion), new Object[] { "HHH", "HHH", "HPH", 'P', AddedItems.EmptyBottle, 'H', AddedItems.HP });
GameRegistry.addRecipe(new ItemStack(AddedItems.EmptyBottle), new Object[] { "G G", "G G", " G ", 'G', Blocks.glass });
//Blast blox recipe
GameRegistry.addRecipe(new ItemStack(AddedBlocks.BlastBlox), new Object[] { "NLN", "HTH", "NHN", 'N', AddedBlocks.NormalBlox, 'L', Items.lava_bucket, 'H', AddedBlocks.HardBlox, 'T', Blocks.tnt });
//Bounce blox recipe
GameRegistry.addRecipe(new ItemStack(AddedBlocks.BounceBlox), new Object[] { "MMM", "HPH", "NNN", 'N', AddedBlocks.NormalBlox, 'P', Blocks.piston, 'H', AddedBlocks.HardBlox, 'M', AddedBlocks.MetalBlox });
GameRegistry.addRecipe(new ItemStack(AddedBlocks.NormalBlox), new Object[] { "ED", "DE", 'E', Blocks.end_stone, 'D', Blocks.dirt });
GameRegistry.addRecipe(new ItemStack(AddedBlocks.HardBlox), new Object[] { "ES", "SE", 'E', Blocks.end_stone, 'S', Blocks.stone });
GameRegistry.addRecipe(new ItemStack(AddedBlocks.MetalBlox), new Object[] { "EI", "IE", 'E', Blocks.end_stone, 'I', Items.iron_ingot });
GameRegistry.addRecipe(new ItemStack(AddedBlocks.NormalBlox), new Object[] { "ED", "DE", 'E', Blocks.end_stone, 'D', Blocks.dirt });
GameRegistry.addRecipe(new ItemStack(AddedBlocks.Synthesiser), new Object[] { "MCM", "H5H", "ONO", 'M', AddedBlocks.MetalBlox, 'C', Blocks.crafting_table, 'H', AddedBlocks.HardBlox, '5', Items.diamond, 'N', AddedBlocks.NormalBlox, 'O', AddedItems.HP });
GameRegistry.addRecipe(new ItemStack(AddedItems.DarkKnowledge), new Object[] { "BDB", "DOD", "BDB", 'B', Items.book, 'D', AddedItems.DarkCrystal, 'O', Blocks.obsidian });
GameRegistry.addRecipe(new ItemStack(AddedItems.VoidedKnowledge), new Object[] { "ODO", "DKD", "ODO", 'O', Blocks.obsidian, 'D', AddedItems.DarkMatter, 'K', AddedItems.DarkKnowledge });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeVHelm), new Object[] { "POP", "PKP", 'P', AddedItems.PureHeart, 'O', AddedItems.Orichalcum, 'K', AddedItems.KingdomHearts });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeVChest), new Object[] { "POP", "PKP", "PKP", 'P', AddedItems.PureHeart, 'O', AddedItems.OrichalcumPlus, 'K', AddedItems.KingdomHearts });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeVLegs), new Object[] { "PKP", "POP", "P P", 'P', AddedItems.PureHeart, 'O', AddedItems.OrichalcumPlus, 'K', AddedItems.KingdomHearts });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeVBoots), new Object[] { "P P", "POP", 'P', AddedItems.PureHeart, 'O', AddedItems.Orichalcum });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeAHelm), new Object[] { "POP", "HKH", 'P', AddedItems.PureHeart, 'O', AddedItems.Orichalcum, 'K', AddedItems.KingdomHearts, 'H', AddedItems.Heart });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeAChest), new Object[] { "HOH", "PKP", "PKP", 'P', AddedItems.PureHeart, 'O', AddedItems.OrichalcumPlus, 'K', AddedItems.KingdomHearts, 'H', AddedItems.Heart });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeALegs), new Object[] { "HKH", "POP", "P P", 'P', AddedItems.PureHeart, 'O', AddedItems.OrichalcumPlus, 'K', AddedItems.KingdomHearts, 'H', AddedItems.Heart });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeABoots), new Object[] { "H H", "POP", 'P', AddedItems.PureHeart, 'O', AddedItems.Orichalcum, 'H', AddedItems.Heart });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeTHelm), new Object[] { "DOD", "DKD", 'D', AddedItems.DarkHeart, 'O', AddedItems.Orichalcum, 'K', AddedItems.KingdomHearts });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeTChest), new Object[] { "DOD", "DKD", "DKD", 'D', AddedItems.DarkHeart, 'O', AddedItems.OrichalcumPlus, 'K', AddedItems.KingdomHearts });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeTLegs), new Object[] { "DKD", "DOD", "D D", 'D', AddedItems.DarkHeart, 'O', AddedItems.OrichalcumPlus, 'K', AddedItems.KingdomHearts });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeTBoots), new Object[] { "D D", "DOD", 'D', AddedItems.DarkHeart, 'O', AddedItems.Orichalcum });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeEHelm), new Object[] { "DOD", "PKP", 'D', AddedItems.DarkHeart, 'O', AddedItems.OrichalcumPlus, 'K', AddedItems.KingdomHearts, 'P', AddedItems.PureHeart });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeEChest), new Object[] { "DOD", "PKP", "PKP", 'D', AddedItems.DarkHeart, 'O', AddedItems.OrichalcumPlus, 'K', AddedItems.KingdomHearts, 'P', AddedItems.PureHeart });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeELegs), new Object[] { "DKD", "POP", "P P", 'D', AddedItems.DarkHeart, 'O', AddedItems.OrichalcumPlus, 'K', AddedItems.KingdomHearts, 'P', AddedItems.PureHeart });
GameRegistry.addRecipe(new ItemStack(AddedItems.KeybladeEBoots), new Object[] { "D D", "POP", 'D', AddedItems.DarkHeart, 'O', AddedItems.Orichalcum, 'P', AddedItems.PureHeart });
}Example 63
| Project: Modjam-3-master File: Sync.java View source code |
public static void mapHardmodeRecipe() {
List recipes = CraftingManager.getInstance().getRecipeList();
for (int i = recipes.size() - 1; i >= 0; i--) {
if (recipes.get(i) instanceof ShapedRecipes) {
ShapedRecipes recipe = (ShapedRecipes) recipes.get(i);
if (recipe.getRecipeOutput().isItemEqual(new ItemStack(Sync.itemPlaceholder))) {
recipes.remove(i);
}
}
}
GameRegistry.addRecipe(new ItemStack(Sync.itemPlaceholder), "DLD", "QEQ", "MRM", 'D', Blocks.DAYLIGHT_DETECTOR, 'L', Blocks.LAPIS_BLOCK, 'Q', Items.QUARTZ, 'E', ((Sync.config.hardcoreMode == 1 || Sync.config.hardcoreMode == 2 && DimensionManager.getWorld(0).getWorldInfo().isHardcoreModeEnabled()) ? Blocks.BEACON : Items.ENDER_PEARL), 'M', Items.EMERALD, 'R', Blocks.REDSTONE_BLOCK);
}Example 64
| Project: Progression-master File: PCommonProxy.java View source code |
public void preInit(ASMDataTable asm) {
//Create the API
ProgressionAPI.registry = new APIHandler();
ProgressionAPI.player = new PlayerHandler();
ProgressionAPI.filters = new FilterSelectorHelper();
ProgressionAPI.fields = new FieldRegistry();
//Register Handlers
MinecraftForge.EVENT_BUS.register(CommandManager.INSTANCE);
MinecraftForge.EVENT_BUS.register(new PlayerTracker());
MinecraftForge.EVENT_BUS.register(new ProgressionEvents());
//Register the items
Progression.item = (ItemProgression) new ItemProgression().setUnlocalizedName("item").setRegistryName("item");
GameRegistry.register(Progression.item);
GameRegistry.addRecipe(new ShapedOreRecipe(getStackFromMeta(book), "FS", "PP", 'P', Items.PAPER, 'S', Items.STRING, 'F', FLINT));
if (Options.tileClaimerRecipe) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Progression.item, 1, ItemProgression.ItemMeta.claim.ordinal()), new Object[] { "F", "P", 'F', Items.FLINT, 'P', "plankWood" }));
}
RuleHandler.registerRules(asm);
CommandManager.registerCommands(asm);
PacketHandler.registerPackets(asm);
//Register DamageSources
ProgressionAPI.registry.registerDamageSource(DamageSource.anvil);
ProgressionAPI.registry.registerDamageSource(DamageSource.cactus);
ProgressionAPI.registry.registerDamageSource(DamageSource.drown);
ProgressionAPI.registry.registerDamageSource(DamageSource.fall);
ProgressionAPI.registry.registerDamageSource(DamageSource.fallingBlock);
ProgressionAPI.registry.registerDamageSource(DamageSource.generic);
ProgressionAPI.registry.registerDamageSource(DamageSource.inFire);
ProgressionAPI.registry.registerDamageSource(DamageSource.inWall);
ProgressionAPI.registry.registerDamageSource(DamageSource.lava);
ProgressionAPI.registry.registerDamageSource(DamageSource.lightningBolt);
ProgressionAPI.registry.registerDamageSource(DamageSource.magic);
ProgressionAPI.registry.registerDamageSource(DamageSource.onFire);
ProgressionAPI.registry.registerDamageSource(DamageSource.outOfWorld);
ProgressionAPI.registry.registerDamageSource(DamageSource.starve);
ProgressionAPI.registry.registerDamageSource(DamageSource.wither);
ProgressionAPI.registry.registerDamageSource(DamageSource.flyIntoWall);
ProgressionAPI.registry.registerDamageSource(DamageSource.dragonBreath);
NetworkRegistry.INSTANCE.registerGuiHandler(Progression.instance, Progression.proxy);
}Example 65
| Project: Recall-Stones-master File: RecallItems.java View source code |
public static void preInit(FMLPreInitializationEvent event) {
//load the config file
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
//register the recipe types
RecipeSorter.INSTANCE.register(Ref.MODID + ":copyStone", RecipeCopyStone.class, RecipeSorter.Category.SHAPELESS, "after:forge:shapelessore");
RecipeSorter.INSTANCE.register(Ref.MODID + ":rechargeStone", RecipeRechargeStone.class, RecipeSorter.Category.SHAPELESS, "after:forge:shapelessore");
RecipeSorter.INSTANCE.register(Ref.MODID + ":upgradeStone", RecipeUpgradeStone.class, RecipeSorter.Category.SHAPELESS, "after:forge:shapelessore");
RecipeSorter.INSTANCE.register(Ref.MODID + ":followingStone", RecipeFollowingStone.class, RecipeSorter.Category.SHAPELESS, "after:forge:shapelessore");
//add the recall stone
itemRecallStone = new ItemRecallStone();
itemRecallStone.setConfig(config);
itemRecallStoneBlank = new ItemRecallStoneBlank();
GameRegistry.registerItem(itemRecallStone, itemRecallStone.itemName);
GameRegistry.registerItem(itemRecallStoneBlank, itemRecallStoneBlank.itemName);
if (config.get(itemRecallStone.itemName, "isCraftible", true).getBoolean(true)) {
GameRegistry.addRecipe(new ItemStack(itemRecallStoneBlank), new Object[] { "ses", "ede", "ses", 's', Blocks.STONE, 'e', Items.ENDER_PEARL, 'd', Items.DIAMOND });
}
//add the dimensional stone
itemDimensionStone = new ItemDimensionStone();
itemDimensionStone.setConfig(config);
itemDimensionStoneBlank = new ItemDimensionStoneBlank();
GameRegistry.registerItem(itemDimensionStone, itemDimensionStone.itemName);
GameRegistry.registerItem(itemDimensionStoneBlank, itemDimensionStoneBlank.itemName);
if (config.get(itemDimensionStone.itemName, "isCraftible", true).getBoolean(true)) {
//add the normal recipe
GameRegistry.addRecipe(new ItemStack(itemDimensionStoneBlank), new Object[] { "ebe", "bsb", "ebe", 'b', Items.BLAZE_ROD, 'e', Items.ENDER_PEARL, 's', itemRecallStoneBlank });
//add the upgrade recipe
GameRegistry.addRecipe(new RecipeUpgradeStone(new ItemStack(itemRecallStone), new ItemStack(itemDimensionStone)));
}
//add following stone
itemFollowingStone = new ItemFollowingStone();
itemFollowingStone.setConfig(config);
GameRegistry.registerItem(itemFollowingStone, itemFollowingStone.itemName);
//add the player essence
dropEssence = config.get(Configuration.CATEGORY_GENERAL, "dropPlayerEssence", true).getBoolean(true);
itemPlayerEssence = new ItemPlayerEssence();
GameRegistry.registerItem(itemPlayerEssence, itemPlayerEssence.itemName);
//add the following recipe
if (config.get(itemFollowingStone.itemName, "isCraftible", true).getBoolean(true)) {
GameRegistry.addRecipe(new RecipeFollowingStone());
}
//add refuel recipes
GameRegistry.addRecipe(new RecipeRechargeStone(new ItemStack(itemRecallStone)));
GameRegistry.addRecipe(new RecipeRechargeStone(new ItemStack(itemDimensionStone)));
//add copy recipies
GameRegistry.addRecipe(new RecipeCopyStone(itemRecallStone, itemRecallStoneBlank));
GameRegistry.addRecipe(new RecipeCopyStone(itemDimensionStone, itemDimensionStoneBlank));
//finally save the config
config.save();
}Example 66
| Project: Similsax-Transtructors-master File: SimilsaxTranstructors.java View source code |
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
Config.init(event.getSuggestedConfigurationFile());
ConfigSynchonizer.init();
GameRegistry.register(itemDummy, new ResourceLocation(MOD_ID, "similsaxTranstructor"));
GameRegistry.register(itemBasic, new ResourceLocation(MOD_ID, "similsaxTranstructorBasic"));
GameRegistry.register(itemAdvanced, new ResourceLocation(MOD_ID, "similsaxTranstructorAdvanced"));
proxy.registerItemModel();
}Example 67
| Project: TheErebus-master File: ModItems.java View source code |
public static void init() {
try {
for (Field field : ModItems.class.getDeclaredFields()) {
Object obj = field.get(null);
if (obj instanceof Item) {
Item item = (Item) obj;
String name = field.getName().toLowerCase(Locale.ENGLISH);
GameRegistry.register(item.setRegistryName(Reference.MOD_ID, name).setUnlocalizedName(Reference.MOD_ID + "." + name));
}
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}Example 68
| Project: TwinTails-master File: ItemHairBand.java View source code |
public void AddRecipes() {
ItemStack anyHairTie = new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE);
for (TwinTailType twinTailType : twinTailTypes) {
ItemStack wool = new ItemStack(Blocks.WOOL, 1, twinTailType.getColor().getMetadata());
ItemStack typeHairTie = new ItemStack(this, 1, twinTailType.getOrdinal());
GameRegistry.addRecipe(new ShapedOreRecipe(typeHairTie, " s ", "sbs", " s ", 's', wool, 'b', "slimeball"));
GameRegistry.addRecipe(new ShapelessOreRecipe(typeHairTie, anyHairTie, twinTailType.getRecipeIngredient()));
}
}Example 69
| Project: ZeldaSwordSkills-master File: ClientProxy.java View source code |
/**
* Automated block and item renderer registration using {@link IModItem#registerRenderers}
*/
private void registerRenderers() {
try {
for (Field f : ZSSBlocks.class.getFields()) {
if (Block.class.isAssignableFrom(f.getType())) {
Block block = (Block) f.get(null);
if (block != null) {
if (block instanceof ICustomStateMapper) {
ZSSMain.logger.debug("Setting custom state mapper for " + block.getUnlocalizedName());
ModelLoader.setCustomStateMapper(block, ((ICustomStateMapper) block).getCustomStateMap());
}
String name = block.getUnlocalizedName();
Item item = GameRegistry.findItem(ModInfo.ID, name.substring(name.lastIndexOf(".") + 1));
if (item instanceof IModItem) {
((IModItem) item).registerResources();
}
if (block instanceof ISpecialRenderer) {
((ISpecialRenderer) block).registerSpecialRenderer();
}
if (block instanceof ISwapModel) {
addModelToSwap((ISwapModel) block);
}
if (item instanceof ISwapModel) {
addModelToSwap((ISwapModel) item);
}
}
}
}
} catch (Exception e) {
ZSSMain.logger.warn("Caught exception while registering block renderers: " + e.toString());
e.printStackTrace();
}
try {
for (Field f : ZSSItems.class.getFields()) {
if (Item.class.isAssignableFrom(f.getType())) {
Item item = (Item) f.get(null);
if (item instanceof IModItem) {
((IModItem) item).registerResources();
}
if (item instanceof ISwapModel) {
addModelToSwap((ISwapModel) item);
}
}
}
} catch (Exception e) {
ZSSMain.logger.warn("Caught exception while registering item renderers: " + e.toString());
e.printStackTrace();
}
}Example 70
| Project: AntiqueAtlas-master File: AntiqueAtlasMod.java View source code |
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
Log.setModID(ID);
// load the class
MarkerRegistry.INSTANCE.getClass();
// ...
MarkerTypes.INSTANCE.getClass();
proxy.preInit(event);
settings.load(new File(proxy.configDir, "settings.cfg"));
if (settings.itemNeeded) {
itemAtlas = (ItemAtlas) new ItemAtlas().setRegistryName(ID, "antique_atlas").setUnlocalizedName("antiqueAtlas");
itemEmptyAtlas = (ItemEmptyAtlas) new ItemEmptyAtlas().setRegistryName(ID, "empty_antique_atlas").setUnlocalizedName("emptyAntiqueAtlas").setCreativeTab(CreativeTabs.TOOLS);
GameRegistry.register(itemAtlas);
GameRegistry.register(itemEmptyAtlas);
}
}Example 71
| Project: ElectricAdvantage-master File: Recipes.java View source code |
public static void init() {
if (initDone)
return;
Blocks.init();
Items.init();
RecipeMode recipeMode = PowerAdvantage.recipeMode;
// Recipes for all recipe modes
OreDictionary.registerOre("blockBrick", net.minecraft.init.Blocks.BRICK_BLOCK);
OreDictionary.registerOre("gunpowder", net.minecraft.init.Items.GUNPOWDER);
GameRegistry.addSmelting(Items.lithium_powder, new ItemStack(Items.lithium_ingot), 0.5f);
GameRegistry.addSmelting(Blocks.lithium_ore, new ItemStack(Items.lithium_ingot), 0.5f);
CrusherRecipeRegistry.addNewCrusherRecipe("oreLithium", new ItemStack(Items.lithium_powder, 2));
CrusherRecipeRegistry.addNewCrusherRecipe("ingotLithium", new ItemStack(Items.lithium_powder, 1));
CrusherRecipeRegistry.addNewCrusherRecipe("oreSulfur", new ItemStack(Items.sulfur_powder, 4));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.electric_conduit, 6), "xxx", "ccc", "xxx", 'x', "plastic", 'c', "ingotCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.electric_conduit, 6), "xxx", "ccc", "xxx", 'x', "rubber", 'c', "ingotCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.electric_conduit, 1), "xx", "cc", 'x', "plastic", 'c', "rodCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.electric_conduit, 1), "xx", "cc", 'x', "rubber", 'c', "rodCopper"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.blank_circuit_board, 2), "plastic", "plateCopper"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.control_circuit, 1), Items.blank_circuit_board, "microchip", "solder"));
GameRegistry.addSmelting(Items.silicon_blend, new ItemStack(Items.silicon_ingot), 0.5f);
GameRegistry.addSmelting(Items.solder_blend, new ItemStack(Items.solder), 0.5f);
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.silicon_blend, 1), "sand", "dustCarbon"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.solder_blend, 3), "dustTin", "dustTin", "dustLead"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.solder_blend, 3), "dustTin", "dustTin", "dustSilver"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.led_bar, 3), "ggg", "xxx", "ccc", 'g', "paneGlass", 'x', "microchip", 'c', "wire"));
GameRegistry.addRecipe(batteryRecipe(Items.lead_acid_battery, "ingotLead", "sulfur", net.minecraft.init.Items.WATER_BUCKET));
GameRegistry.addRecipe(batteryRecipe(Items.lead_acid_battery, "ingotLead", "dustSulfur", net.minecraft.init.Items.WATER_BUCKET));
GameRegistry.addRecipe(batteryRecipe(Items.nickel_hydride_battery, "ingotNickel", "dustRedstone", net.minecraft.init.Items.WATER_BUCKET));
GameRegistry.addRecipe(batteryRecipe(Items.alkaline_battery, "ingotIron", "gunpowder", "ingotZinc"));
GameRegistry.addRecipe(batteryRecipe(Items.lithium_battery, "ingotLithium", "dustRedstone", "dustCarbon"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.electric_track, 1), Blocks.electric_conduit, cyano.poweradvantage.init.Blocks.steel_frame));
// non-apocalyctic recipes (high-tech machines cannot be crafted in post-apocalyspe mode)
if (recipeMode != RecipeMode.APOCALYPTIC) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.photovoltaic_generator, 1), "ggg", "sss", "wuw", 'g', "paneGlass", 's', "ingotSilicon", 'w', "wire", 'u', "PSU"));
}
// recipe-mode specific recipes
if (recipeMode == RecipeMode.TECH_PROGRESSION) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.integrated_circuit, 3), "prp", "sss", "ccc", 'p', "plastic", 's', "ingotSilicon", 'r', "dustRedstone", 'c', "nuggetCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.integrated_circuit, 3), "prp", "sss", "ccc", 'p', "plastic", 's', "ingotSilicon", 'r', "dustRedstone", 'c', "nuggetTin"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.integrated_circuit, 3), "prp", "sss", "ccc", 'p', "plastic", 's', "ingotSilicon", 'r', "dustRedstone", 'c', "nuggetGold"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.power_supply_unit, 1), "wcw", " s ", 'w', "wire", 'c', "circuitBoard", 's', "plateSteel"));
} else if (recipeMode == RecipeMode.APOCALYPTIC) {
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.steam_powered_generator, new ItemStack(Items.power_supply_unit, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.arc_furnace, new ItemStack(Items.power_supply_unit, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Blocks.photovoltaic_generator, new ItemStack(Items.power_supply_unit, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Items.power_supply_unit, new ItemStack(Items.control_circuit, 1));
CrusherRecipeRegistry.addNewCrusherRecipe(Items.control_circuit, new ItemStack(Items.integrated_circuit, 1));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.power_supply_unit, 1), "wcw", " s ", 'w', "wire", 'c', "circuitBoard", 's', "plateSteel"));
} else {
// normal
OreDictionary.registerOre("solder", cyano.basemetals.init.Items.lead_ingot);
OreDictionary.registerOre("solder", cyano.basemetals.init.Items.tin_ingot);
OreDictionary.registerOre("solder", cyano.basemetals.init.Items.silver_ingot);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.integrated_circuit, 3), "sss", "ccc", 's', "ingotSilicon", 'c', "nuggetCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.integrated_circuit, 3), "sss", "ccc", 's', "ingotSilicon", 'c', "nuggetTin"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.integrated_circuit, 3), "sss", "ccc", 's', "ingotSilicon", 'c', "nuggetGold"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.blank_circuit_board, 2), "plastic", "ingotCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.power_supply_unit, 1), "wcw", " s ", 'w', "wire", 'c', "circuitBoard", 's', "ingotSteel"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.power_supply_unit, 1), "wcw", " s ", 'w', "wire", 'c', "circuitBoard", 's', "ingotIron"));
}
// Machine recipes
GameRegistry.addRecipe(electricMachineRecipe(Blocks.steam_powered_generator, "conduitSteam", "governor"));
GameRegistry.addRecipe(new ShapedOreRecipe(Blocks.arc_furnace, "bbb", "bub", "bbb", 'b', "blockBrick", 'u', "PSU"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.hydroelectric_generator, "sprocket", "sprocket"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.battery_array, "chest"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.rock_crusher, "sprocket", "gemDiamond"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.laser_turret, "gemDiamond", "gemEmerald"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.laser_turret, "gemEmerald", "gemDiamond"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.laser_drill, "blockDiamond"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.fabricator, net.minecraft.init.Blocks.CRAFTING_TABLE));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.growth_chamber, net.minecraft.init.Items.FLOWER_POT, "microchip"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.growth_chamber_controller, net.minecraft.init.Items.FLOWER_POT, "circuitBoard"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.oven, "paneGlass", "PSU"));
GameRegistry.addRecipe(new ShapedOreRecipe(Blocks.electric_switch, " L ", "pfp", 'L', net.minecraft.init.Blocks.LEVER, 'p', "wire", 'f', "frameSteel"));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.electric_still, net.minecraft.init.Items.BUCKET, net.minecraft.init.Items.BUCKET));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.electric_pump, net.minecraft.init.Blocks.PISTON, net.minecraft.init.Items.BUCKET));
GameRegistry.addRecipe(electricMachineRecipe(Blocks.plastic_refinery, net.minecraft.init.Blocks.PISTON, "sprocket"));
initDone = true;
}Example 72
| Project: FatCatMOD-master File: FatCatMod.java View source code |
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
egg = new ItemFatCatEgg().setUnlocalizedName("fatcat_egg");
unko = new ItemFatCatUnko().setUnlocalizedName("fatcat_unko");
brush = new ItemCatBrush().setUnlocalizedName("fatcat_brush");
furball = new ItemFurball().setUnlocalizedName("furball");
feather_toy = new ItemFeatherToy().setUnlocalizedName("fatcat_feather_toy");
GameRegistry.registerItem(egg, egg.getUnlocalizedName().substring(5));
GameRegistry.registerItem(unko, unko.getUnlocalizedName().substring(5));
GameRegistry.registerItem(brush, brush.getUnlocalizedName().substring(5));
GameRegistry.registerItem(furball, furball.getUnlocalizedName().substring(5));
GameRegistry.registerItem(feather_toy, feather_toy.getUnlocalizedName().substring(5));
EntityRegistry.registerModEntity(EntityFatCat.class, "FatCat", ++modEntityIndex, this, 64, 10, true);
EntityRegistry.registerModEntity(EntityItemUnko.class, "FatCatUnko", ++modEntityIndex, this, 64, 10, true);
GameRegistry.addRecipe(new ItemStack(brush, 1), "BT ", "BT ", " T ", 'B', Blocks.hay_block, 'T', Items.stick);
GameRegistry.addRecipe(new ItemStack(feather_toy, 1), " F ", " F ", " T ", 'F', furball, 'T', Items.stick);
// Get a fatcat egg via fishing.
FishingHooks.addTreasure(new WeightedRandomFishable(new ItemStack(egg), 1));
ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST, new WeightedRandomChestContent(new ItemStack(egg, 1, 0), 1, 1, 15));
ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST, new WeightedRandomChestContent(new ItemStack(egg, 1, 0), 1, 1, 15));
ChestGenHooks.addItem(ChestGenHooks.MINESHAFT_CORRIDOR, new WeightedRandomChestContent(new ItemStack(egg, 1, 0), 1, 1, 7));
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
Property breeding_mode_property = config.get(Configuration.CATEGORY_GENERAL, "BreedingMode", true);
breeding_mode_property.comment = "Breeding MODE(true/false): FatCat status is fixed if you disable this option";
breeding_mode = breeding_mode_property.getBoolean(true);
Property logging_mode_property = config.get(Configuration.CATEGORY_GENERAL, "Logging", false);
logging_mode_property.comment = "logging for debug";
logging = logging_mode_property.getBoolean(false);
Property debug_property = config.get(Configuration.CATEGORY_GENERAL, "Debug", false);
debug_property.comment = "debugging mode for development";
DEBUG = debug_property.getBoolean(false);
config.save();
}Example 73
| Project: FunkyLocomotion-master File: Recipes.java View source code |
public static void addRecipes() {
for (String s : OreDictionary.getOreNames()) {
if (s.startsWith("ingot"))
LogHelper.info(s);
}
if (shouldAddRecipes) {
Object lapis = "gemLapis";
Object gearEnderium = getOreWithVanillaFallback(Blocks.PISTON, "thermalexpansion:machineFrame", "itemMachineChassi");
Object diamond = "gemDiamond";
Object nuggetSignalum = getOreWithVanillaFallback("dustRedstone", "nuggetSignalum", "itemRedstoneAlloy");
Object ingotInvar = getOreWithVanillaFallback("ingotIron", "ingotInvar");
Object IngotInvarIron = getOreWithVanillaFallback("ingotIron", "ingotInvar", "ingotSteel");
Object nuggetInvar = getOreWithVanillaFallback("stickWood", "nuggetInvar", "nuggetIron");
Object nuggetIron = getOreWithVanillaFallback("stickWood", "nuggetIron");
Object nuggetEnderium = getOreWithVanillaFallback(Items.ENDER_EYE, "nuggetEnderium", "ingotPulsatingIron");
Object dustEnderium = getOreWithVanillaFallback(Items.ENDER_PEARL, "dustEnderium", "nuggetPulsatingIron");
Object ingotElectrum = getOreWithVanillaFallback("ingotGold", "ingotElectrum", "ingotVibrantAlloy");
Object dustGlowstone = getOreWithVanillaFallback("dustGlowstone", "ingotEnergeticAlloy");
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.frame[0], 8, 0), "III", "i i", "III", 'I', ingotInvar, 'i', nuggetInvar));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchNormal), "I ", " i ", " I", 'I', "ingotIron", 'i', nuggetIron));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchEye), Items.ENDER_EYE, dustEnderium, dustEnderium, new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchNormal)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchHammer), "WIW", " i ", " i ", 'I', IngotInvarIron, 'W', new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchNormal), 'i', "ingotIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.pusher, 1, 0), "EEE", "CGC", "CTC", 'E', nuggetEnderium, 'G', gearEnderium, 'C', ingotInvar, 'T', diamond));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(FunkyLocomotion.pusher, 1, 1), new ItemStack(FunkyLocomotion.pusher, 1, 0), "slimeball", "dustRedstone", "dustRedstone", "dustRedstone"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(FunkyLocomotion.slider, 1, 0), new ItemStack(FunkyLocomotion.pusher, 1, 0), nuggetSignalum, lapis, lapis, lapis));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.booster, 1, 0), "EEE", "CGC", "CTC", 'E', ingotElectrum, 'G', gearEnderium, 'C', ingotInvar, 'T', FunkyLocomotion.pusher));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.frameProjector, 1, 0), "EEE", "CGC", "CTC", 'E', dustGlowstone, 'G', gearEnderium, 'C', ingotInvar, 'T', new ItemStack(FunkyLocomotion.pusher, 1, 1)));
addCustomRecipe(new ShapedOreRecipe(ItemBlockTeleporter.assignNullID(new ItemStack(FunkyLocomotion.teleporter, 2)), "EEE", "PNY", "EEE", 'E', nuggetEnderium, 'P', new ItemStack(FunkyLocomotion.pusher, 1, 0), 'N', Items.ENDER_PEARL, 'Y', new ItemStack(FunkyLocomotion.pusher, 1, 1)) {
@Override
public ItemStack getCraftingResult(InventoryCrafting var1) {
return ItemBlockTeleporter.assignRandomID(super.getCraftingResult(var1));
}
});
addCustomRecipe(new ShapelessOreRecipe(ItemBlockTeleporter.assignNullID(new ItemStack(FunkyLocomotion.teleporter, 2)), FunkyLocomotion.teleporter, FunkyLocomotion.teleporter) {
@Override
public ItemStack getCraftingResult(InventoryCrafting var1) {
return ItemBlockTeleporter.assignRandomID(super.getCraftingResult(var1));
}
});
}
if (shouldAddFrameCopyResetRecipes) {
ItemStack basicFrame = new ItemStack(FunkyLocomotion.frame[0], 1, 0);
ArrayList<ItemStack> list = new ArrayList<>(64);
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 16; j++) {
if (i != 0 || j != 0) {
ItemStack stack = new ItemStack(FunkyLocomotion.frame[i], 1, j);
list.add(stack);
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(FunkyLocomotion.frame[i], 2, j), stack, basicFrame));
}
}
}
ShapelessOreRecipe t = new ShapelessOreRecipe(FunkyLocomotion.frame[0], new ItemStack(FunkyLocomotion.frame[0]));
t.getInput().clear();
t.getInput().add(list);
GameRegistry.addRecipe(t);
}
}Example 74
| Project: KalStuff-master File: KalStuffItems.java View source code |
/**
* Registers all items from the mod.
*/
public static void registerItems() {
//Please keep all items in alphabetical order!
GameRegistry.register(apple_soda.setRegistryName("apple_soda"));
GameRegistry.register(bacon_core.setRegistryName("bacon_core"));
GameRegistry.register(bacon_wand.setRegistryName("bacon_wand"));
GameRegistry.register(blaze_soup.setRegistryName("blaze_soup"));
GameRegistry.register(boxing_glove.setRegistryName("boxing_glove"));
GameRegistry.register(chocolate_cap.setRegistryName("chocolate_cap"));
GameRegistry.register(closed_apple_soda.setRegistryName("closed_apple_soda"));
GameRegistry.register(closed_grape_soda.setRegistryName("closed_grape_soda"));
GameRegistry.register(closed_melon_soda.setRegistryName("closed_melon_soda"));
GameRegistry.register(closed_root_beer.setRegistryName("closed_root_beer"));
GameRegistry.register(coffee.setRegistryName("coffee"));
GameRegistry.register(coffee_mug.setRegistryName("coffee_mug"));
GameRegistry.register(crushed_ender.setRegistryName("crushed_ender"));
GameRegistry.register(diamond_dagger.setRegistryName("diamond_dagger"));
GameRegistry.register(golden_dagger.setRegistryName("golden_dagger"));
GameRegistry.register(golden_mug.setRegistryName("golden_mug"));
GameRegistry.register(grapes.setRegistryName("grapes"));
GameRegistry.register(grape_seeds.setRegistryName("grape_seeds"));
GameRegistry.register(grape_soda.setRegistryName("grape_soda"));
GameRegistry.register(infused_bacon_core.setRegistryName("infused_bacon_core"));
GameRegistry.register(iron_dagger.setRegistryName("iron_dagger"));
GameRegistry.register(jewel_soup.setRegistryName("jewel_soup"));
GameRegistry.register(light_coffee.setRegistryName("light_coffee"));
GameRegistry.register(lute.setRegistryName("lute"));
GameRegistry.register(melon_soda.setRegistryName("melon_soda"));
GameRegistry.register(plantable_grape_seeds.setRegistryName("plantable_grape_seeds"));
GameRegistry.register(root_beer.setRegistryName("root_beer"));
GameRegistry.register(soda_can.setRegistryName("soda_can"));
GameRegistry.register(stone_dagger.setRegistryName("stone_dagger"));
GameRegistry.register(tea.setRegistryName("tea"));
GameRegistry.register(walking_stick.setRegistryName("walking_stick"));
GameRegistry.register(wine.setRegistryName("wine"));
GameRegistry.register(wine_bottle.setRegistryName("wine_bottle"));
GameRegistry.register(wooden_dagger.setRegistryName("wooden_dagger"));
GameRegistry.register(wooden_round_shield.setRegistryName("wooden_round_shield"));
}Example 75
| Project: locomotion-master File: Recipes.java View source code |
public static void addRecipes() {
for (String s : OreDictionary.getOreNames()) {
if (s.startsWith("ingot"))
LogHelper.info(s);
}
if (shouldAddRecipes) {
Object lapis = "gemLapis";
Object gearEnderium = getOreWithVanillaFallback(Blocks.PISTON, "thermalexpansion:machineFrame", "itemMachineChassi");
Object diamond = "gemDiamond";
Object nuggetSignalum = getOreWithVanillaFallback("dustRedstone", "nuggetSignalum", "itemRedstoneAlloy");
Object ingotInvar = getOreWithVanillaFallback("ingotIron", "ingotInvar");
Object IngotInvarIron = getOreWithVanillaFallback("ingotIron", "ingotInvar", "ingotSteel");
Object nuggetInvar = getOreWithVanillaFallback("stickWood", "nuggetInvar", "nuggetIron");
Object nuggetIron = getOreWithVanillaFallback("stickWood", "nuggetIron");
Object nuggetEnderium = getOreWithVanillaFallback(Items.ENDER_EYE, "nuggetEnderium", "ingotPulsatingIron");
Object dustEnderium = getOreWithVanillaFallback(Items.ENDER_PEARL, "dustEnderium", "nuggetPulsatingIron");
Object ingotElectrum = getOreWithVanillaFallback("ingotGold", "ingotElectrum", "ingotVibrantAlloy");
Object dustGlowstone = getOreWithVanillaFallback("dustGlowstone", "ingotEnergeticAlloy");
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.frame[0], 8, 0), "III", "i i", "III", 'I', ingotInvar, 'i', nuggetInvar));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchNormal), "I ", " i ", " I", 'I', "ingotIron", 'i', nuggetIron));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchEye), Items.ENDER_EYE, dustEnderium, dustEnderium, new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchNormal)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchHammer), "WIW", " i ", " i ", 'I', IngotInvarIron, 'W', new ItemStack(FunkyLocomotion.wrench, 1, ItemWrench.metaWrenchNormal), 'i', "ingotIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.pusher, 1, 0), "EEE", "CGC", "CTC", 'E', nuggetEnderium, 'G', gearEnderium, 'C', ingotInvar, 'T', diamond));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(FunkyLocomotion.pusher, 1, 1), new ItemStack(FunkyLocomotion.pusher, 1, 0), "slimeball", "dustRedstone", "dustRedstone", "dustRedstone"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(FunkyLocomotion.slider, 1, 0), new ItemStack(FunkyLocomotion.pusher, 1, 0), nuggetSignalum, lapis, lapis, lapis));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.booster, 1, 0), "EEE", "CGC", "CTC", 'E', ingotElectrum, 'G', gearEnderium, 'C', ingotInvar, 'T', FunkyLocomotion.pusher));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(FunkyLocomotion.frameProjector, 1, 0), "EEE", "CGC", "CTC", 'E', dustGlowstone, 'G', gearEnderium, 'C', ingotInvar, 'T', new ItemStack(FunkyLocomotion.pusher, 1, 1)));
addCustomRecipe(new ShapedOreRecipe(ItemBlockTeleporter.assignNullID(new ItemStack(FunkyLocomotion.teleporter, 2)), "EEE", "PNY", "EEE", 'E', nuggetEnderium, 'P', new ItemStack(FunkyLocomotion.pusher, 1, 0), 'N', Items.ENDER_PEARL, 'Y', new ItemStack(FunkyLocomotion.pusher, 1, 1)) {
@Override
public ItemStack getCraftingResult(InventoryCrafting var1) {
return ItemBlockTeleporter.assignRandomID(super.getCraftingResult(var1));
}
});
addCustomRecipe(new ShapelessOreRecipe(ItemBlockTeleporter.assignNullID(new ItemStack(FunkyLocomotion.teleporter, 2)), FunkyLocomotion.teleporter, FunkyLocomotion.teleporter) {
@Override
public ItemStack getCraftingResult(InventoryCrafting var1) {
return ItemBlockTeleporter.assignRandomID(super.getCraftingResult(var1));
}
});
}
if (shouldAddFrameCopyResetRecipes) {
ItemStack basicFrame = new ItemStack(FunkyLocomotion.frame[0], 1, 0);
ArrayList<ItemStack> list = new ArrayList<>(64);
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 16; j++) {
if (i != 0 || j != 0) {
ItemStack stack = new ItemStack(FunkyLocomotion.frame[i], 1, j);
list.add(stack);
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(FunkyLocomotion.frame[i], 2, j), stack, basicFrame));
}
}
}
ShapelessOreRecipe t = new ShapelessOreRecipe(FunkyLocomotion.frame[0], new ItemStack(FunkyLocomotion.frame[0]));
t.getInput().clear();
t.getInput().add(list);
GameRegistry.addRecipe(t);
}
}Example 76
| Project: MineChess-master File: MineChess.java View source code |
public void gameRegisters() {
GameRegistry.registerItem(itemPieceMover, "pieceMover", Constants.MOD_ID);
ItemStack chessColumn = new ItemStack(itemPieceMover, 1, 3);
ItemStack blackWool = new ItemStack(Blocks.wool, 1, 15);
ItemStack whiteWool = new ItemStack(Blocks.wool, 1, 0);
// piece movers
for (int i = 0; i < 2; i++) {
GameRegistry.addRecipe(new ItemStack(itemPieceMover, 1, 1 - i), " ww", " ww", "s ", 'w', new ItemStack(Blocks.wool, 1, i * 15), 's', new ItemStack(Items.stick));
}
GameRegistry.addShapelessRecipe(new ItemStack(itemPieceMover, 1, 2), chessColumn, chessColumn, chessColumn, chessColumn, chessColumn, chessColumn, chessColumn, chessColumn);
GameRegistry.addShapelessRecipe(chessColumn, blackWool, blackWool, blackWool, blackWool, whiteWool, whiteWool, whiteWool, whiteWool);
// Entities
// parms: entity class, mobname (for spawners), id, modclass, max player
// distance for update, update frequency, boolean keep server updated
// about velocities.
EntityRegistry.registerModEntity(EntityKing.class, "King", 0, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityRook.class, "Rook", 1, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityPawn.class, "Pawn", 2, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityKnight.class, "Knight", 3, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityQueen.class, "Queen", 4, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityBishop.class, "Bishop", 5, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityPickyXPOrb.class, "Picky XP Orb", 6, this, 80, 1, true);
// worldgenerators
GameRegistry.registerWorldGenerator(new WorldGeneratorMineChess(), 0);
}Example 77
| Project: MrCrayfishFurnitureMod-master File: FurnitureItems.java View source code |
public static void registerItems() {
GameRegistry.registerItem(itemFlesh);
GameRegistry.registerItem(itemCookedFlesh);
GameRegistry.registerItem(itemCoolPack);
GameRegistry.registerItem(itemHammer);
GameRegistry.registerItem(itemEnvelope);
GameRegistry.registerItem(itemEnvelopeSigned);
GameRegistry.registerItem(itemPackage);
GameRegistry.registerItem(itemPackageSigned);
GameRegistry.registerItem(itemInkCartridge);
GameRegistry.registerItem(itemBreadSlice);
GameRegistry.registerItem(itemToast);
GameRegistry.registerItem(itemKnife);
GameRegistry.registerItem(itemCup);
GameRegistry.registerItem(itemDrink);
GameRegistry.registerItem(itemSoap);
GameRegistry.registerItem(itemSoapyWater);
GameRegistry.registerItem(itemSuperSoapyWater);
GameRegistry.registerItem(itemRecipeBook);
GameRegistry.registerItem(itemCrayfish);
GameRegistry.registerItem(itemLog);
GameRegistry.registerItem(itemSpatula);
GameRegistry.registerItem(itemSausage);
GameRegistry.registerItem(itemSausageCooked);
GameRegistry.registerItem(itemKebab);
GameRegistry.registerItem(itemKebabCooked);
GameRegistry.registerItem(itemCrowBar);
}Example 78
| Project: Pillar-master File: Pillar.java View source code |
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
devMode = config.getBoolean("Dev Mode", Configuration.CATEGORY_GENERAL, false, "");
rarityMultiplier = config.getFloat("Rarity Multiplier", Configuration.CATEGORY_GENERAL, 1F, 0F, Float.MAX_VALUE, "");
maxStructuresInOneChunk = config.getInt("Max Structures In One Chunk", Configuration.CATEGORY_GENERAL, 1, 1, Integer.MAX_VALUE, "");
generatorWeight = config.getInt("Generator Weight", Configuration.CATEGORY_GENERAL, 0, Integer.MIN_VALUE, Integer.MAX_VALUE, "The weight to apply to Pillar's generator. Higher weight generators will spawn their structures before other mods'");
maximumGenerationIterations = config.getInt("Maximum Generation Iterations", Configuration.CATEGORY_GENERAL, 50, 0, Integer.MAX_VALUE, "In a chain of structures spawned by 'struct' data blocks in other structures, how many can be spawned before the chain is put to a halt.");
if (config.hasChanged())
config.save();
pillarDir = new File(event.getModConfigurationDirectory().getParentFile(), "pillar");
if (!pillarDir.exists())
pillarDir.mkdir();
structureDir = new File(pillarDir, "structures");
if (!structureDir.exists())
structureDir.mkdir();
lootTablesDir = new File(pillarDir, "loot_tables");
if (!lootTablesDir.exists())
lootTablesDir.mkdir();
File template = new File(pillarDir, TEMPLATE_FILE);
if (!template.exists()) {
try {
template.createNewFile();
InputStream inStream = Pillar.class.getResourceAsStream("/assets/pillar/" + TEMPLATE_FILE);
System.out.println(inStream);
OutputStream outStream = new FileOutputStream(template);
IOUtils.copy(inStream, outStream);
inStream.close();
outStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
StructureLoader.loadStructures(null);
GameRegistry.registerWorldGenerator(new WorldGenerator(), generatorWeight);
}Example 79
| Project: Project-Zed-master File: CommonProxy.java View source code |
protected void registerBlocks() {
BlockRegistry.instance().init(ProjectZed.class);
for (IHBlock b : BlockRegistry.instance().getBlocks().values()) {
if (b != null) {
GameRegistry.register(b.getBlock());
GameRegistry.register(b.getItemBlock().setRegistryName(b.getBlock().getRegistryName()));
ProjectZed.logHelper.info("Registering:", b.getName());
}
}
}Example 80
| Project: SecurityCraft-master File: ClientProxy.java View source code |
/**
* Register the texture files used by blocks with metadata/variants with the ModelBakery.
*/
@Override
@SideOnly(Side.CLIENT)
public void registerTextureFiles() {
Item reinforcedWoodPlanks = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedPlanks");
ModelBakery.registerItemVariants(reinforcedWoodPlanks, new ResourceLocation("securitycraft:reinforcedPlanks_Oak"), new ResourceLocation("securitycraft:reinforcedPlanks_Spruce"), new ResourceLocation("securitycraft:reinforcedPlanks_Birch"), new ResourceLocation("securitycraft:reinforcedPlanks_Jungle"), new ResourceLocation("securitycraft:reinforcedPlanks_Acacia"), new ResourceLocation("securitycraft:reinforcedPlanks_DarkOak"));
Item reinforcedStainedGlass = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedStainedGlass");
ModelBakery.registerItemVariants(reinforcedStainedGlass, new ResourceLocation("securitycraft:reinforcedStainedGlass_white"), new ResourceLocation("securitycraft:reinforcedStainedGlass_orange"), new ResourceLocation("securitycraft:reinforcedStainedGlass_magenta"), new ResourceLocation("securitycraft:reinforcedStainedGlass_light_blue"), new ResourceLocation("securitycraft:reinforcedStainedGlass_yellow"), new ResourceLocation("securitycraft:reinforcedStainedGlass_lime"), new ResourceLocation("securitycraft:reinforcedStainedGlass_pink"), new ResourceLocation("securitycraft:reinforcedStainedGlass_gray"), new ResourceLocation("securitycraft:reinforcedStainedGlass_silver"), new ResourceLocation("securitycraft:reinforcedStainedGlass_cyan"), new ResourceLocation("securitycraft:reinforcedStainedGlass_purple"), new ResourceLocation("securitycraft:reinforcedStainedGlass_blue"), new ResourceLocation("securitycraft:reinforcedStainedGlass_brown"), new ResourceLocation("securitycraft:reinforcedStainedGlass_green"), new ResourceLocation("securitycraft:reinforcedStainedGlass_red"), new ResourceLocation("securitycraft:reinforcedStainedGlass_black"));
Item reinforcedStainedGlassPanes = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedStainedGlassPanes");
ModelBakery.registerItemVariants(reinforcedStainedGlassPanes, new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_white"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_orange"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_magenta"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_light_blue"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_yellow"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_lime"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_pink"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_gray"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_silver"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_cyan"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_purple"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_blue"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_brown"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_green"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_red"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_black"));
Item reinforcedSandstone = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedSandstone");
ModelBakery.registerItemVariants(reinforcedSandstone, new ResourceLocation("securitycraft:reinforcedSandstone_normal"), new ResourceLocation("securitycraft:reinforcedSandstone_chiseled"), new ResourceLocation("securitycraft:reinforcedSandstone_smooth"));
Item reinforcedWoodSlabs = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedWoodSlabs");
ModelBakery.registerItemVariants(reinforcedWoodSlabs, new ResourceLocation("securitycraft:reinforcedWoodSlabs_oak"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_spruce"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_birch"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_jungle"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_acacia"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_darkoak"));
Item reinforcedStoneSlabs = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedStoneSlabs");
ModelBakery.registerItemVariants(reinforcedStoneSlabs, new ResourceLocation("securitycraft:reinforcedStoneSlabs_stone"), new ResourceLocation("securitycraft:reinforcedStoneSlabs_cobblestone"), new ResourceLocation("securitycraft:reinforcedStoneSlabs_sandstone"), new ResourceLocation("securitycraft:reinforcedDirtSlab"));
Item fakeWater = GameRegistry.findItem(mod_SecurityCraft.MODID, "bogusWater");
ModelBakery.registerItemVariants(fakeWater);
ModelLoader.setCustomMeshDefinition(fakeWater, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "water");
}
});
ModelLoader.setCustomStateMapper(mod_SecurityCraft.bogusWater, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "water");
}
});
Item fakeWaterFlowing = GameRegistry.findItem(mod_SecurityCraft.MODID, "bogusWaterFlowing");
ModelBakery.registerItemVariants(fakeWaterFlowing);
ModelLoader.setCustomMeshDefinition(fakeWaterFlowing, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "water_flowing");
}
});
ModelLoader.setCustomStateMapper(mod_SecurityCraft.bogusWaterFlowing, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "water_flowing");
}
});
Item fakeLava = GameRegistry.findItem(mod_SecurityCraft.MODID, "bogusLava");
ModelBakery.registerItemVariants(fakeLava);
ModelLoader.setCustomMeshDefinition(fakeLava, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "lava");
}
});
ModelLoader.setCustomStateMapper(mod_SecurityCraft.bogusLava, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "lava");
}
});
Item fakeLavaFlowing = GameRegistry.findItem(mod_SecurityCraft.MODID, "bogusLavaFlowing");
ModelBakery.registerItemVariants(fakeLavaFlowing);
ModelLoader.setCustomMeshDefinition(fakeLavaFlowing, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "lava_flowing");
}
});
ModelLoader.setCustomStateMapper(mod_SecurityCraft.bogusLavaFlowing, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "lava_flowing");
}
});
}Example 81
| Project: TinkersConstruct-master File: TConstruct.java View source code |
// Old version compatibility
@Mod.EventHandler
public void onMissingMapping(FMLMissingMappingsEvent event) {
for (FMLMissingMappingsEvent.MissingMapping mapping : event.get()) {
// glow is the leftover itemblock form which was removed
if (mapping.type == GameRegistry.Type.ITEM && (mapping.name.equals(Util.resource("bucket")) || mapping.name.equals(Util.resource("glow")))) {
mapping.ignore();
}
}
}Example 82
| Project: NotEnoughItems-master File: ItemInfo.java View source code |
private static void parseModItems() {
HashMap<String, ItemStackSet> modSubsets = new HashMap<String, ItemStackSet>();
for (Item item : (Iterable<Item>) Item.itemRegistry) {
UniqueIdentifier ident = GameRegistry.findUniqueIdentifierFor(item);
if (ident == null) {
NEIClientConfig.logger.error("Failed to find identifier for: " + item);
continue;
}
String modId = GameRegistry.findUniqueIdentifierFor(item).modId;
itemOwners.put(item, modId);
ItemStackSet itemset = modSubsets.get(modId);
if (itemset == null)
modSubsets.put(modId, itemset = new ItemStackSet());
itemset.with(item);
}
API.addSubset("Mod.Minecraft", modSubsets.remove("minecraft"));
for (Entry<String, ItemStackSet> entry : modSubsets.entrySet()) {
ModContainer mc = FMLCommonHandler.instance().findContainerFor(entry.getKey());
if (mc == null)
NEIClientConfig.logger.error("Missing container for " + entry.getKey());
else
API.addSubset("Mod." + mc.getName(), entry.getValue());
}
}Example 83
| Project: Abyss-master File: WorldHandler.java View source code |
@Override
public void preInit(FMLPreInitializationEvent event) {
ACBiomes.darklands = new BiomeGenDarklands(new BiomeProperties("Darklands").setWaterColor(14745518));
ACBiomes.abyssal_wastelands = new BiomeGenAbywasteland(new BiomeProperties("Abyssal Wastelands").setWaterColor(0x24FF83).setRainDisabled());
ACBiomes.dreadlands = new BiomeGenDreadlands(new BiomeProperties("Dreadlands").setRainDisabled());
ACBiomes.purified_dreadlands = new BiomeGenAbyDreadlands(new BiomeProperties("Purified Dreadlands").setRainDisabled());
ACBiomes.dreadlands_forest = new BiomeGenForestDreadlands(new BiomeProperties("Dreadlands Forest").setRainDisabled());
ACBiomes.dreadlands_mountains = new BiomeGenMountainDreadlands(new BiomeProperties("Dreadlands Mountains").setBaseHeight(1.3F).setHeightVariation(0.9F).setRainDisabled());
ACBiomes.darklands_forest = new BiomeGenDarklandsForest(new BiomeProperties("Darklands Forest").setWaterColor(14745518));
ACBiomes.darklands_plains = new BiomeGenDarklandsPlains(new BiomeProperties("Darklands Plains").setWaterColor(14745518));
ACBiomes.darklands_hills = new BiomeGenDarklandsHills(new BiomeProperties("Darklands Highland").setWaterColor(14745518).setBaseHeight(1.1F).setHeightVariation(0.5F).setTemperature(0.2F).setRainfall(0.3F));
ACBiomes.darklands_mountains = new BiomeGenDarklandsMountains(new BiomeProperties("Darklands Mountains").setWaterColor(14745518).setBaseHeight(1.3F).setHeightVariation(0.9F).setTemperature(0.2F).setRainfall(0.3F));
ACBiomes.coralium_infested_swamp = new BiomeGenCorSwamp(new BiomeProperties("Coralium Infested Swamp").setWaterColor(0x24FF83).setBaseHeight(-0.2F).setHeightVariation(0.1F));
ACBiomes.omothol = new BiomeGenOmothol(new BiomeProperties("Omothol").setWaterColor(14745518).setRainDisabled());
ACBiomes.dark_realm = new BiomeGenDarkRealm(new BiomeProperties("Dark Realm").setWaterColor(14745518).setRainDisabled());
if (dark1 == true) {
registerBiomeWithTypes(ACBiomes.darklands, "darklands", darkWeight1, BiomeType.WARM, Type.WASTELAND, Type.SPOOKY);
BiomeManager.addVillageBiome(ACBiomes.darklands, true);
}
if (dark2 == true) {
registerBiomeWithTypes(ACBiomes.darklands_forest, "darklands_forest", darkWeight2, BiomeType.WARM, Type.FOREST, Type.SPOOKY);
BiomeManager.addVillageBiome(ACBiomes.darklands_forest, true);
}
if (dark3 == true) {
registerBiomeWithTypes(ACBiomes.darklands_plains, "darklands_plains", darkWeight3, BiomeType.WARM, Type.PLAINS, Type.SPOOKY);
BiomeManager.addVillageBiome(ACBiomes.darklands_plains, true);
}
if (dark4 == true)
registerBiomeWithTypes(ACBiomes.darklands_hills, "darklands_hills", darkWeight4, BiomeType.COOL, Type.HILLS, Type.SPOOKY);
if (dark5 == true) {
registerBiomeWithTypes(ACBiomes.darklands_mountains, "darklands_mountains", darkWeight5, BiomeType.COOL, Type.MOUNTAIN, Type.SPOOKY);
BiomeManager.addStrongholdBiome(ACBiomes.darklands_mountains);
}
if (coralium1 == true)
registerBiomeWithTypes(ACBiomes.coralium_infested_swamp, "coralium_infested_swamp", coraliumWeight, BiomeType.WARM, Type.SWAMP);
if (darkspawn1 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands);
if (darkspawn2 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands_forest);
if (darkspawn3 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands_plains);
if (darkspawn4 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands_hills);
if (darkspawn5 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands_mountains);
if (coraliumspawn1 == true)
BiomeManager.addSpawnBiome(ACBiomes.coralium_infested_swamp);
GameRegistry.register(ACBiomes.abyssal_wastelands.setRegistryName(new ResourceLocation(modid, "abyssal_wastelands")));
GameRegistry.register(ACBiomes.dreadlands.setRegistryName(new ResourceLocation(modid, "dreadlands")));
GameRegistry.register(ACBiomes.purified_dreadlands.setRegistryName(new ResourceLocation(modid, "purified_dreadlands")));
GameRegistry.register(ACBiomes.dreadlands_forest.setRegistryName(new ResourceLocation(modid, "dreadlands_forest")));
GameRegistry.register(ACBiomes.dreadlands_mountains.setRegistryName(new ResourceLocation(modid, "dreadlands_mountains")));
GameRegistry.register(ACBiomes.omothol.setRegistryName(new ResourceLocation(modid, "omothol")));
GameRegistry.register(ACBiomes.dark_realm.setRegistryName(new ResourceLocation(modid, "dark_realm")));
BiomeDictionary.addTypes(ACBiomes.abyssal_wastelands, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.dreadlands, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.purified_dreadlands, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.dreadlands_mountains, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.dreadlands_forest, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.omothol, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.dark_realm, Type.DEAD);
ACLib.THE_ABYSSAL_WASTELAND = DimensionType.register("The Abyssal Wasteland", "_aw", ACLib.abyssal_wasteland_id, WorldProviderAbyss.class, ACConfig.keepLoaded1);
ACLib.THE_DREADLANDS = DimensionType.register("The Dreadlands", "_dl", ACLib.dreadlands_id, WorldProviderDreadlands.class, ACConfig.keepLoaded2);
ACLib.OMOTHOL = DimensionType.register("Omothol", "_omt", ACLib.omothol_id, WorldProviderOmothol.class, ACConfig.keepLoaded3);
ACLib.THE_DARK_REALM = DimensionType.register("The Dark Realm", "_dl", ACLib.dark_realm_id, WorldProviderDarkRealm.class, ACConfig.keepLoaded4);
DimensionManager.registerDimension(ACLib.abyssal_wasteland_id, ACLib.THE_ABYSSAL_WASTELAND);
DimensionManager.registerDimension(ACLib.dreadlands_id, ACLib.THE_DREADLANDS);
DimensionManager.registerDimension(ACLib.omothol_id, ACLib.OMOTHOL);
DimensionManager.registerDimension(ACLib.dark_realm_id, ACLib.THE_DARK_REALM);
}Example 84
| Project: AbyssalCraft-master File: WorldHandler.java View source code |
@Override
public void preInit(FMLPreInitializationEvent event) {
ACBiomes.darklands = new BiomeGenDarklands(new BiomeProperties("Darklands").setWaterColor(14745518));
ACBiomes.abyssal_wastelands = new BiomeGenAbywasteland(new BiomeProperties("Abyssal Wastelands").setWaterColor(0x24FF83).setRainDisabled());
ACBiomes.dreadlands = new BiomeGenDreadlands(new BiomeProperties("Dreadlands").setRainDisabled());
ACBiomes.purified_dreadlands = new BiomeGenAbyDreadlands(new BiomeProperties("Purified Dreadlands").setRainDisabled());
ACBiomes.dreadlands_forest = new BiomeGenForestDreadlands(new BiomeProperties("Dreadlands Forest").setRainDisabled());
ACBiomes.dreadlands_mountains = new BiomeGenMountainDreadlands(new BiomeProperties("Dreadlands Mountains").setBaseHeight(1.3F).setHeightVariation(0.9F).setRainDisabled());
ACBiomes.darklands_forest = new BiomeGenDarklandsForest(new BiomeProperties("Darklands Forest").setWaterColor(14745518));
ACBiomes.darklands_plains = new BiomeGenDarklandsPlains(new BiomeProperties("Darklands Plains").setWaterColor(14745518));
ACBiomes.darklands_hills = new BiomeGenDarklandsHills(new BiomeProperties("Darklands Highland").setWaterColor(14745518).setBaseHeight(1.1F).setHeightVariation(0.5F).setTemperature(0.2F).setRainfall(0.3F));
ACBiomes.darklands_mountains = new BiomeGenDarklandsMountains(new BiomeProperties("Darklands Mountains").setWaterColor(14745518).setBaseHeight(1.3F).setHeightVariation(0.9F).setTemperature(0.2F).setRainfall(0.3F));
ACBiomes.coralium_infested_swamp = new BiomeGenCorSwamp(new BiomeProperties("Coralium Infested Swamp").setWaterColor(0x24FF83).setBaseHeight(-0.2F).setHeightVariation(0.1F));
ACBiomes.omothol = new BiomeGenOmothol(new BiomeProperties("Omothol").setWaterColor(14745518).setRainDisabled());
ACBiomes.dark_realm = new BiomeGenDarkRealm(new BiomeProperties("Dark Realm").setWaterColor(14745518).setRainDisabled());
if (dark1 == true) {
registerBiomeWithTypes(ACBiomes.darklands, "darklands", darkWeight1, BiomeType.WARM, Type.WASTELAND, Type.SPOOKY);
BiomeManager.addVillageBiome(ACBiomes.darklands, true);
}
if (dark2 == true) {
registerBiomeWithTypes(ACBiomes.darklands_forest, "darklands_forest", darkWeight2, BiomeType.WARM, Type.FOREST, Type.SPOOKY);
BiomeManager.addVillageBiome(ACBiomes.darklands_forest, true);
}
if (dark3 == true) {
registerBiomeWithTypes(ACBiomes.darklands_plains, "darklands_plains", darkWeight3, BiomeType.WARM, Type.PLAINS, Type.SPOOKY);
BiomeManager.addVillageBiome(ACBiomes.darklands_plains, true);
}
if (dark4 == true)
registerBiomeWithTypes(ACBiomes.darklands_hills, "darklands_hills", darkWeight4, BiomeType.COOL, Type.HILLS, Type.SPOOKY);
if (dark5 == true) {
registerBiomeWithTypes(ACBiomes.darklands_mountains, "darklands_mountains", darkWeight5, BiomeType.COOL, Type.MOUNTAIN, Type.SPOOKY);
BiomeManager.addStrongholdBiome(ACBiomes.darklands_mountains);
}
if (coralium1 == true)
registerBiomeWithTypes(ACBiomes.coralium_infested_swamp, "coralium_infested_swamp", coraliumWeight, BiomeType.WARM, Type.SWAMP);
if (darkspawn1 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands);
if (darkspawn2 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands_forest);
if (darkspawn3 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands_plains);
if (darkspawn4 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands_hills);
if (darkspawn5 == true)
BiomeManager.addSpawnBiome(ACBiomes.darklands_mountains);
if (coraliumspawn1 == true)
BiomeManager.addSpawnBiome(ACBiomes.coralium_infested_swamp);
GameRegistry.register(ACBiomes.abyssal_wastelands.setRegistryName(new ResourceLocation(modid, "abyssal_wastelands")));
GameRegistry.register(ACBiomes.dreadlands.setRegistryName(new ResourceLocation(modid, "dreadlands")));
GameRegistry.register(ACBiomes.purified_dreadlands.setRegistryName(new ResourceLocation(modid, "purified_dreadlands")));
GameRegistry.register(ACBiomes.dreadlands_forest.setRegistryName(new ResourceLocation(modid, "dreadlands_forest")));
GameRegistry.register(ACBiomes.dreadlands_mountains.setRegistryName(new ResourceLocation(modid, "dreadlands_mountains")));
GameRegistry.register(ACBiomes.omothol.setRegistryName(new ResourceLocation(modid, "omothol")));
GameRegistry.register(ACBiomes.dark_realm.setRegistryName(new ResourceLocation(modid, "dark_realm")));
BiomeDictionary.addTypes(ACBiomes.abyssal_wastelands, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.dreadlands, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.purified_dreadlands, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.dreadlands_mountains, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.dreadlands_forest, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.omothol, Type.DEAD);
BiomeDictionary.addTypes(ACBiomes.dark_realm, Type.DEAD);
ACLib.THE_ABYSSAL_WASTELAND = DimensionType.register("The Abyssal Wasteland", "_aw", ACLib.abyssal_wasteland_id, WorldProviderAbyss.class, ACConfig.keepLoaded1);
ACLib.THE_DREADLANDS = DimensionType.register("The Dreadlands", "_dl", ACLib.dreadlands_id, WorldProviderDreadlands.class, ACConfig.keepLoaded2);
ACLib.OMOTHOL = DimensionType.register("Omothol", "_omt", ACLib.omothol_id, WorldProviderOmothol.class, ACConfig.keepLoaded3);
ACLib.THE_DARK_REALM = DimensionType.register("The Dark Realm", "_dl", ACLib.dark_realm_id, WorldProviderDarkRealm.class, ACConfig.keepLoaded4);
DimensionManager.registerDimension(ACLib.abyssal_wasteland_id, ACLib.THE_ABYSSAL_WASTELAND);
DimensionManager.registerDimension(ACLib.dreadlands_id, ACLib.THE_DREADLANDS);
DimensionManager.registerDimension(ACLib.omothol_id, ACLib.OMOTHOL);
DimensionManager.registerDimension(ACLib.dark_realm_id, ACLib.THE_DARK_REALM);
}Example 85
| Project: Aura-Cascade-master File: BlockRegistry.java View source code |
public void preInit() {
registerClasses();
for (Class<?> clazz : blockClasses) {
try {
Block newBlock = (Block) clazz.newInstance();
if (((ITTinkererBlock) newBlock).shouldRegister()) {
newBlock.setUnlocalizedName(((ITTinkererBlock) newBlock).getBlockName());
ArrayList<Block> blockList = new ArrayList<Block>();
blockList.add(newBlock);
if (((ITTinkererBlock) newBlock).getSpecialParameters() != null) {
for (Object param : ((ITTinkererBlock) newBlock).getSpecialParameters()) {
for (Constructor<?> constructor : clazz.getConstructors()) {
if (constructor.getParameterTypes().length > 0 && constructor.getParameterTypes()[0].isAssignableFrom(param.getClass())) {
Block nextBlock = (Block) clazz.getConstructor(param.getClass()).newInstance(param);
nextBlock.setUnlocalizedName(((ITTinkererBlock) nextBlock).getBlockName());
blockList.add(nextBlock);
break;
}
}
}
}
blockRegistry.put(clazz, blockList);
if (((ITTinkererBlock) newBlock).getItemBlock() != null) {
Item newItem = ((ITTinkererBlock) newBlock).getItemBlock().getConstructor(Block.class).newInstance(newBlock);
newItem.setUnlocalizedName(((ITTinkererItem) newItem).getItemName());
ArrayList<Item> itemList = new ArrayList<Item>();
itemList.add(newItem);
itemRegistry.put(((ITTinkererBlock) newBlock).getItemBlock(), itemList);
}
}
} catch (InstantiationExceptionIllegalAccessException | InvocationTargetException | NoSuchMethodException | e) {
e.printStackTrace();
}
}
for (Class<?> clazz : itemClasses) {
try {
Item newItem = (Item) clazz.newInstance();
if (((ITTinkererItem) newItem).shouldRegister()) {
newItem.setUnlocalizedName(((ITTinkererItem) newItem).getItemName());
ArrayList<Item> itemList = new ArrayList<Item>();
itemList.add(newItem);
if (((ITTinkererItem) newItem).getSpecialParameters() != null) {
for (Object param : ((ITTinkererItem) newItem).getSpecialParameters()) {
for (Constructor<?> constructor : clazz.getConstructors()) {
if (constructor.getParameterTypes().length > 0 && constructor.getParameterTypes()[0].isAssignableFrom(param.getClass())) {
Item nextItem = (Item) constructor.newInstance(param);
nextItem.setUnlocalizedName(((ITTinkererItem) nextItem).getItemName());
itemList.add(nextItem);
break;
}
}
}
}
itemRegistry.put(clazz, itemList);
}
} catch (InstantiationExceptionIllegalAccessException | InvocationTargetException | e) {
e.printStackTrace();
}
}
for (ArrayList<Block> blockArrayList : blockRegistry.values()) {
for (Block block : blockArrayList) {
if (((ITTinkererBlock) block).getItemBlock() != null) {
//TODO these may break
GameRegistry.registerBlock(block, ((ITTinkererBlock) block).getItemBlock(), ((ITTinkererBlock) block).getBlockName());
//ForgeRegistries.BLOCKS.register(block);
} else {
GameRegistry.registerBlock(block, ((ITTinkererBlock) block).getBlockName());
// ForgeRegistries.BLOCKS.register(block);
//ForgeRegistries.BLOCKS.re
}
if (((ITTinkererBlock) block).getTileEntity() != null) {
GameRegistry.registerTileEntity(((ITTinkererBlock) block).getTileEntity(), ConstantMod.prefixMod + ((ITTinkererBlock) block).getBlockName());
}
if (block instanceof IMultiTileEntityBlock) {
for (Map.Entry<Class<? extends TileEntity>, String> tile : ((IMultiTileEntityBlock) block).getAdditionalTileEntities().entrySet()) {
GameRegistry.registerTileEntity(tile.getKey(), tile.getValue());
}
}
if (((ITTinkererBlock) block).shouldDisplayInTab() && FMLCommonHandler.instance().getSide() == Side.CLIENT) {
ModCreativeTab.INSTANCE.addBlock(block);
}
}
}
for (ArrayList<Item> itemArrayList : itemRegistry.values()) {
for (Item item : itemArrayList) {
if (!(item instanceof ItemBlock)) {
//TODO this may have broken.
GameRegistry.registerItem(item, ((ITTinkererItem) item).getItemName());
//ForgeRegistries.ITEMS.register(item);
if (((ITTinkererItem) item).shouldDisplayInTab() && FMLCommonHandler.instance().getSide() == Side.CLIENT) {
ModCreativeTab.INSTANCE.addItem(item);
}
}
}
}
}Example 86
| Project: Combustible-Lemon-Launcher-master File: CommonProxy.java View source code |
public void initializeBlocks() {
blockLemonTreePlanks = new BlockLemonTreePlanks(BLOCK_LEMON_TREE_PLANKS, 2.0f, 5.0f, SoundType.WOOD);
blockLemonTreeLog = new BlockLemonTreeLog(BLOCK_LEMON_TREE_LOG, SoundType.WOOD);
blockLemonLeavesHarvested = new BlockLemonLeavesHarvested(BLOCK_LEMON_LEAVES_HARVESTED);
blockLemonLeaves = new BlockLemonLeaves(BLOCK_LEMON_LEAVES);
blockLemonTreeSapling = new BlockLemonTreeSapling(BLOCK_LEMON_TREE_SAPLING, SoundType.PLANT);
GameRegistry.register((new ItemBlock(blockLemonTreePlanks).setRegistryName(BLOCK_LEMON_TREE_PLANKS)));
GameRegistry.register((new ItemBlock(blockLemonTreeLog).setRegistryName(BLOCK_LEMON_TREE_LOG)));
GameRegistry.register((new ItemBlock(blockLemonLeavesHarvested).setRegistryName(BLOCK_LEMON_LEAVES_HARVESTED)));
GameRegistry.register((new ItemBlock(blockLemonLeaves).setRegistryName(BLOCK_LEMON_LEAVES)));
GameRegistry.register((new ItemBlock(blockLemonTreeSapling).setRegistryName(BLOCK_LEMON_TREE_SAPLING)));
}Example 87
| Project: Fake-Ores-2-master File: FakeOres.java View source code |
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
try {
config.load();
diamondOre_ID = config.get("Entity", "Diamond Ore Entity", 1010).getInt();
emeraldOre_ID = config.get("Entity", "Emerald Ore Entity", 1011).getInt();
goldOre_ID = config.get("Entity", "Gold Ore Entity", 1012).getInt();
ironOre_ID = config.get("Entity", "Iron Ore Entity", 1013).getInt();
coalOre_ID = config.get("Entity", "Coal Ore Entity", 1014).getInt();
redstoneOre_ID = config.get("Entity", "Redstone Ore Entity", 1015).getInt();
quartzOre_ID = config.get("Entity", "Quartz Ore Entity", 1016).getInt();
lapisOre_ID = config.get("Entity", "Lapis Ore Entity", 1017).getInt();
cup_ID = config.get("Entity", "Cup Entity", 1018).getInt();
boss_teleporter_ID = config.get("Entity", "Boss Teleporter Entity", 1019).getInt();
ores_boss_ID = config.get("Entity", "Ores Boss Entity", 1020).getInt();
fakeOres_prob = config.get("Spawn", "Fake Ore Probability", 7).getInt();
useOldOresBossModel = config.getBoolean("useOldOresBossModel", "Property", false, "Use the old Ores Boss Model (made by UnknownOrigins) from the 1.6 mod version.");
config.save();
} finally {
if (config.hasChanged()) {
config.save();
}
}
antiOresBlade = new ItemSword(ToolMaterial.WOOD).setCreativeTab(fakeOresTab).setUnlocalizedName("antiOresBlade").setRegistryName("antiOresBlade");
boss_fragment_1 = new Item().setCreativeTab(fakeOresTab).setUnlocalizedName("boss_fragment_1").setRegistryName("boss_fragment_1");
boss_fragment_2 = new Item().setCreativeTab(fakeOresTab).setUnlocalizedName("boss_fragment_2").setRegistryName("boss_fragment_2");
boss_fragment_3 = new Item().setCreativeTab(fakeOresTab).setUnlocalizedName("boss_fragment_3").setRegistryName("boss_fragment_3");
boss_fragment_4 = new Item().setCreativeTab(fakeOresTab).setUnlocalizedName("boss_fragment_4").setRegistryName("boss_fragment_4");
boss_spawner = new ItemBossSpawner().setCreativeTab(fakeOresTab).setUnlocalizedName("boss_spawner").setRegistryName("boss_spawner");
GameRegistry.<Item>register(antiOresBlade);
GameRegistry.<Item>register(boss_fragment_1);
GameRegistry.<Item>register(boss_fragment_2);
GameRegistry.<Item>register(boss_fragment_3);
GameRegistry.<Item>register(boss_fragment_4);
GameRegistry.<Item>register(boss_spawner);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:DiamondOre"), EntityDiamondOre.class, "DiamondOre", diamondOre_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:CoalOre"), EntityCoalOre.class, "CoalOre", coalOre_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:EmeraldOre"), EntityEmeraldOre.class, "EmeraldOre", emeraldOre_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:GoldOre"), EntityGoldOre.class, "GoldOre", goldOre_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:IronOre"), EntityIronOre.class, "IronOre", ironOre_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:LapisOre"), EntityLapisOre.class, "LapisOre", lapisOre_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:NetherQuartzOre"), EntityNetherQuartzOre.class, "NetherQuartzOre", quartzOre_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:RedstoneOre"), EntityRedstoneOre.class, "RedstoneOre", redstoneOre_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:Cup"), EntityCup.class, "Cup", cup_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:BossTeleporter"), EntityBossTeleporter.class, "BossTeleporter", boss_teleporter_ID, this, 40, 1, true);
EntityRegistry.registerModEntity(new ResourceLocation("fakeores:OresBoss"), EntityOresBoss.class, "OresBoss", ores_boss_ID, this, 40, 1, true);
MinecraftForge.EVENT_BUS.register(new BlockDropEvent());
antiOreStone = new BlockAntiOreStone().setResistance(1F).setHardness(0.8F).setUnlocalizedName("antiOreStone").setRegistryName("antiOreStone");
GameRegistry.<Block>register(antiOreStone);
GameRegistry.<Item>register(new ItemBlock(antiOreStone), antiOreStone.getRegistryName());
GameRegistry.registerWorldGenerator(new WorldGenAntiOreStone(), 0);
cupAchiev = new Item().setUnlocalizedName("cupAchiev").setRegistryName("cupAchiev");
GameRegistry.<Item>register(cupAchiev);
boss_defeated = new Achievement("achievement.boss_defeated", "boss_defeated", 1, 0, FakeOres.boss_spawner, null).initIndependentStat().registerStat();
broken_Cup = new Achievement("achievement.broken_Cup", "broken_Cup", 1, -2, cupAchiev, boss_defeated).registerStat();
killFakeOreWithAntiOreBlade = new Achievement("achievement.killFakeOreWithAntiOreBlade", "killFakeOreWithAntiOreBlade", 1, -4, antiOresBlade, null).initIndependentStat().registerStat();
FakeOresSoundEvent.registerSounds();
}Example 88
| Project: Floocraft-master File: FloocraftBase.java View source code |
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
//Makes all packets to be used
PacketHandler.init();
//Makes all blocks and items to be used
blockFlooTorch = new BlockFlooTorch().setUnlocalizedName("flootorch").setRegistryName("flootorch").setLightLevel(1.0F).setCreativeTab(CreativeTabs.DECORATIONS);
greenFlamesBusy = new GreenFlamesBusy().setUnlocalizedName("greenflamesbusy").setRegistryName("greenflamesbusy").setLightLevel(1.0F);
greenFlamesIdle = new GreenFlamesIdle().setUnlocalizedName("greenflamesidle").setRegistryName("greenflamesidle").setLightLevel(0.875F);
greenFlamesTemp = new GreenFlamesTemp().setUnlocalizedName("greenflamesbusy").setRegistryName("greenflamestemp").setLightLevel(1.0F);
blockFlooSign = new BlockFlooSign().setRegistryName("blockfloosign");
floowerPot = new BlockFloowerPot().setUnlocalizedName("floowerpot").setRegistryName("floowerpot").setCreativeTab(CreativeTabs.MISC);
iFlooTorch = new ItemBlock(blockFlooTorch).setUnlocalizedName("flootorch").setRegistryName("flootorch");
iFloowerPot = new ItemBlock(floowerPot).setUnlocalizedName("floowerpot").setRegistryName("floowerpot");
floopowder1t = new ItemFlooPowder((byte) 1).setMaxStackSize(64).setUnlocalizedName("floopowder").setRegistryName("floopowder_one").setCreativeTab(CreativeTabs.MISC);
floopowder2t = new ItemFlooPowder((byte) 2).setMaxStackSize(64).setUnlocalizedName("floopowder").setRegistryName("floopowder_two").setCreativeTab(CreativeTabs.MISC);
floopowder4t = new ItemFlooPowder((byte) 4).setMaxStackSize(64).setUnlocalizedName("floopowder").setRegistryName("floopowder_four").setCreativeTab(CreativeTabs.MISC);
floopowder8t = new ItemFlooPowder((byte) 8).setMaxStackSize(64).setUnlocalizedName("floopowder").setRegistryName("floopowder_eight").setCreativeTab(CreativeTabs.MISC);
floopowderc = new ItemFlooPowder((byte) 9).setMaxStackSize(64).setUnlocalizedName("floopowder").setRegistryName("floopowder_infinite").setCreativeTab(CreativeTabs.MISC);
itemFlooSign = new ItemFlooSign().setMaxStackSize(16).setUnlocalizedName("itemfloosign").setRegistryName("itemfloosign").setCreativeTab(CreativeTabs.DECORATIONS);
//Registering blocks
GameRegistry.register(blockFlooSign);
GameRegistry.register(blockFlooTorch);
GameRegistry.register(greenFlamesBusy);
GameRegistry.register(greenFlamesIdle);
GameRegistry.register(greenFlamesTemp);
GameRegistry.register(floowerPot);
//Registering items
GameRegistry.register(iFloowerPot);
GameRegistry.register(iFlooTorch);
GameRegistry.register(floopowder1t);
GameRegistry.register(floopowder2t);
GameRegistry.register(floopowder4t);
GameRegistry.register(floopowder8t);
GameRegistry.register(floopowderc);
GameRegistry.register(itemFlooSign);
//Registering Tile Entities
GameRegistry.registerTileEntity(TileEntityFireplace.class, "fireplaceTE");
GameRegistry.registerTileEntity(TileEntityFloowerPot.class, "potTE");
//Registering sounds
greened = GameRegistry.register(new SoundEvent(new ResourceLocation(DataReference.MODID, "greened")).setRegistryName("greened"));
tp = GameRegistry.register(new SoundEvent(new ResourceLocation(DataReference.MODID, "tp")).setRegistryName("tp"));
flick = GameRegistry.register(new SoundEvent(new ResourceLocation(DataReference.MODID, "flick")).setRegistryName("flick"));
//Adding recipes
//Infinite powder is creative only so no recipe
GameRegistry.addShapelessRecipe(new ItemStack(floopowder1t, 8), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.GUNPOWDER));
GameRegistry.addShapelessRecipe(new ItemStack(floopowder2t, 8), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.GUNPOWDER));
GameRegistry.addShapelessRecipe(new ItemStack(floopowder4t, 8), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.GUNPOWDER));
GameRegistry.addShapelessRecipe(new ItemStack(floopowder8t, 8), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.GUNPOWDER));
GameRegistry.addShapelessRecipe(new ItemStack(FloocraftBase.itemFlooSign, 1), new ItemStack(Items.SIGN), new ItemStack(floopowder1t, 8));
GameRegistry.addShapelessRecipe(new ItemStack(FloocraftBase.blockFlooTorch, 4), new ItemStack(Items.STICK), new ItemStack(FloocraftBase.floopowder1t));
GameRegistry.addShapelessRecipe(new ItemStack(FloocraftBase.floowerPot), new ItemStack(Items.FLOWER_POT), new ItemStack(FloocraftBase.floopowder1t));
}Example 89
| Project: JukeboxReloaded-master File: CommonProxy.java View source code |
@SuppressWarnings("RedundantCast")
public void initItems() {
/* GameRegistry.registerItem(kokoro = new ItemCustomRecord("kokoro", "ココãƒ", new String[]{"Sung by Kagamine Rin", "writer トラボルタ feat. é?¡éŸ³ãƒªãƒ³"}).setDomain("cazzar"), "kokoro");
GameRegistry.registerItem(loveIsWar = new ItemCustomRecord("love_is_war", "Love is War", new String[]{"Sung by Hatsune Miku", "Writer - Supercell feat. �音ミク"}).setDomain("cazzar"), "love_is_war");
GameRegistry.registerItem(shibuya = new ItemCustomRecord("shibuya", "SHIBUYA (Original)", new String[]{"by BECCA"}).setDomain("cazzar"), "shibuya");
GameRegistry.registerItem(spica = new ItemCustomRecord("spica", "SPiCa", new String[]{"by ã?¨ã??"}).setDomain("cazzar"), "spica");
GameRegistry.registerItem(sukiDaiSuki = new ItemCustomRecord("suki_daisuki", "ã?™ã?™ã?™ã?™ã€?ã?™ã??ã€?ã? ã?‚ã?„ã?™ã??", new String[]{"Sung by Kagamine Rin", "Writer - ã?‹ã?Ÿã?»ã?¨ã‚ŠP"}).setDomain("cazzar"), "suki_daisuki");
GameRegistry.registerItem(weArePopcandy = new ItemCustomRecord("we_are_popcandy", "We are POPCANDY!", new String[]{"Sung by Hatsune Miku", "Writer RUNO"}).setDomain("cazzar"), "we_are_popcandy");
// GameRegistry.registerItem(portableJukebox = new ItemPortableJukebox(config.items.portableJukeboxId), "Portable Jukebox");
((Item) kokoro).setCreativeTab(creativeTab);
((Item) loveIsWar).setCreativeTab(creativeTab);
((Item) shibuya).setCreativeTab(creativeTab);
((Item) spica).setCreativeTab(creativeTab);
((Item) sukiDaiSuki).setCreativeTab(creativeTab);
((Item) weArePopcandy).setCreativeTab(creativeTab);*/
}Example 90
| Project: MoarSigns-master File: ModItems.java View source code |
public static void registerRecipes() {
RecipeSorter.register("moarsigns:shaped", ShapedMoarSignRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped before:minecraft:shapeless");
RecipeSorter.register("moarsigns:shapeless", ShapelessMoarSignRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
removeRecipesWithResult(new ItemStack(Items.SIGN, 3));
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
SIGN.getSubItemStacks(list);
ItemStack generalSign = null;
Container dummyContainer = new Container() {
@Override
public boolean canInteractWith(EntityPlayer entityplayer) {
return true;
}
@Override
public void onCraftMatrixChanged(IInventory par1IInventory) {
}
};
InventoryCrafting crafting = new InventoryCrafting(dummyContainer, 2, 2);
for (ItemStack stack : list) {
ItemMoarSign sign = (ItemMoarSign) stack.getItem();
String texture = sign.getTextureFromNBTFull(stack.getTagCompound());
boolean isMetal = stack.getItemDamage() == 1;
stack.stackSize = 3;
if (texture.equals("oak_sign")) {
generalSign = stack;
continue;
}
SignInfo s = SignRegistry.get(texture);
List<MaterialInfo> materials = SignRegistry.getAlternativeMaterials(s);
MaterialInfo material = s != null ? s.material : null;
materials.add(0, material);
for (MaterialInfo infos : materials) {
ItemStack mat = infos.material;
if (mat != null && mat.getItem() != null && material != null) {
if (isMetal) {
mat.stackSize = 1;
if (mat.getItem() instanceof ItemBlock) {
crafting.setInventorySlotContents(0, mat);
mat = CraftingManager.getInstance().findMatchingRecipe(crafting, null);
}
ItemStack recNugget = null;
if (mat != null) {
mat.stackSize = 1;
if (!material.gotNugget) {
String unlocName = mat.getUnlocalizedName();
NuggetRegistry.NuggetInfo nuggetInfo = NuggetRegistry.getNuggetInfo(unlocName);
if (nuggetInfo != null) {
nuggetInfo.needed = true;
recNugget = new ItemStack(NUGGET, 1, nuggetInfo.id);
OreDictionary.registerOre(nuggetInfo.oreName, recNugget.copy());
recNugget.stackSize = 9;
GameRegistry.addShapelessRecipe(recNugget.copy(), mat);
GameRegistry.addRecipe(new ShapedOreRecipe(mat, "xxx", "xxx", "xxx", 'x', nuggetInfo.oreName));
}
} else {
crafting.setInventorySlotContents(0, mat);
recNugget = CraftingManager.getInstance().findMatchingRecipe(crafting, null);
}
}
if (recNugget != null && recNugget.getItem() != null) {
ItemStack stack1 = stack.copy();
stack1.stackSize = 1;
recNugget.stackSize = 1;
if (recNugget.getUnlocalizedName().equals("item.moarsigns.diamond_nugget")) {
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack1, true, true, "XXX", "XXX", " / ", 'X', "diamondNugget", '/', "stickWood"));
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack1, true, true, "XXX", "XXX", " / ", 'X', "nuggetDiamond", '/', "stickWood"));
} else if (recNugget.getUnlocalizedName().equals("item.moarsigns.iron_nugget"))
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack1, true, true, "XXX", "XXX", " / ", 'X', "nuggetIron", '/', "stickWood"));
else if (recNugget.getUnlocalizedName().equals("item.moarsigns.emerald_nugget"))
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack1, true, true, "XXX", "XXX", " / ", 'X', "nuggetEmerald", '/', "stickWood"));
else if (recNugget.getUnlocalizedName().equals("item.moarsigns.lapis_nugget"))
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack1, true, true, "XXX", "XXX", " / ", 'X', "nuggetLapis", '/', "stickWood"));
else if (recNugget.getUnlocalizedName().equals("item.moarsigns.quartz_nugget"))
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack1, true, true, "XXX", "XXX", " / ", 'X', "nuggetQuartz", '/', "stickWood"));
else
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack1, true, true, "XXX", "XXX", " / ", 'X', recNugget, '/', "stickWood"));
}
stack.stackSize = 9;
}
if (mat.getUnlocalizedName().equals(Items.DIAMOND.getUnlocalizedName()))
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack, true, true, "XXX", "XXX", " / ", 'X', "gemDiamond", '/', "stickWood"));
else if (mat.getUnlocalizedName().equals(Items.EMERALD.getUnlocalizedName()))
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack, true, true, "XXX", "XXX", " / ", 'X', "gemEmerald", '/', "stickWood"));
else if (mat.getUnlocalizedName().equals(Items.IRON_INGOT.getUnlocalizedName()))
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack, true, true, "XXX", "XXX", " / ", 'X', "ingotIron", '/', "stickWood"));
else
GameRegistry.addRecipe(new ShapedMoarSignRecipe(stack, true, true, "XXX", "XXX", " / ", 'X', mat, '/', "stickWood"));
}
}
}
GameRegistry.addRecipe(new ShapedMoarSignRecipe(generalSign, true, true, "###", "###", " X ", '#', "plankWood", 'X', "stickWood"));
GameRegistry.addRecipe(new ShapedMoarSignRecipe(SIGN_TOOLBOX, "rxr", "xsx", "rxr", 'x', "ingotIron", 's', ShapedMoarSignRecipe.MatchType.ALL, 'r', "dyeRed"));
if (replaceRecipes) {
ArrayList recipes = (ArrayList) CraftingManager.getInstance().getRecipeList();
ItemStack signStack = new ItemStack(Items.SIGN);
for (int scan = 0; scan < recipes.size(); scan++) {
IRecipe tmpRecipe = (IRecipe) recipes.get(scan);
List input = null;
if (tmpRecipe instanceof ShapedRecipes) {
input = Arrays.asList(((ShapedRecipes) tmpRecipe).recipeItems);
} else if (tmpRecipe instanceof ShapelessRecipes) {
input = ((ShapelessRecipes) tmpRecipe).recipeItems;
} else if (tmpRecipe instanceof ShapedOreRecipe) {
input = Arrays.asList(((ShapedOreRecipe) tmpRecipe).getInput());
} else if (tmpRecipe instanceof ShapelessOreRecipe) {
input = ((ShapelessOreRecipe) tmpRecipe).getInput();
}
if (input != null) {
for (Object stack : input) {
if (stack instanceof ItemStack && OreDictionary.itemMatches((ItemStack) stack, signStack, false)) {
HashMap<ItemStack, Object> map = Maps.newHashMap();
map.put(signStack, ShapedMoarSignRecipe.MatchType.ALL);
IRecipe replacement = null;
if (tmpRecipe instanceof ShapedRecipes || tmpRecipe instanceof ShapedOreRecipe)
GameRegistry.addRecipe(replacement = new ShapedMoarSignRecipe(tmpRecipe, map));
if (tmpRecipe instanceof ShapelessRecipes || tmpRecipe instanceof ShapelessOreRecipe)
GameRegistry.addRecipe(replacement = new ShapelessMoarSignRecipe(tmpRecipe, map));
MoarSigns.logger.info("Replacing Recipe: " + tmpRecipe + " (containing " + stack + ") -> " + replacement);
recipes.remove(scan);
}
}
}
}
}
}Example 91
| Project: TechStack-s-HeavyMachineryMod-master File: ClientProxy.java View source code |
@Override
public void registerRenderers() {
OBJLoader.INSTANCE.addDomain(Reference.MOD_ID);
// LogHelper.info("in register Renderers");
MachineModModelHelper.setupVertexFormat();
RenderingRegistry.registerEntityRenderingHandler(EntityBulldozer.class, new RenderBulldozer(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityDrillingRig.class, new RenderDrillingRig(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityDumpTruck.class, new RenderDumpTruck(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityLoader.class, new RenderLoader(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityGrader.class, new RenderGrader(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityTractor.class, new RenderTractor(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityLawnmower.class, new RenderLawnmower(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityCombine.class, new RenderCombine(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntitySemiTractor.class, new RenderSemiTractor(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityCrane.class, new RenderCrane(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityExcavator.class, new RenderExcavator(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityPaver.class, new RenderPaver(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityBagger.class, new RenderBagger(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityRoadRoller.class, new RenderRoadRoller(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityOilRig.class, new RenderOilRig(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntitySub.class, new RenderSub(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityChopper.class, new RenderChopper(Minecraft.getMinecraft().getRenderManager()));
// RenderingRegistry.registerEntityRenderingHandler(EntityPumpJack.class, new RenderPumpJack(Minecraft.getMinecraft().getRenderManager()));
Item ItemblockBlastedStone = GameRegistry.findItem(Reference.MOD_ID, Reference.MODBLOCK_MACHINE_BLASTED_STONE);
ModelBakery.registerItemVariants(ItemblockBlastedStone, new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "stone"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "granite"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "diorite"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "andesite"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "gold"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "iron"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "coal"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "lapis"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "diamond"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "redstone"), new ResourceLocation(Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "emerald"));
// ModelBakery.addVariantName(ItemblockBlastedStone, Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "stone", Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "granite", Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "diorite", Reference.MOD_ID + ":"
// + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "andesite", Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "gold", Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "iron", Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "coal", Reference.MOD_ID + ":"
// + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "lapis", Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "diamond", Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "redstone", Reference.MOD_ID + ":" + Reference.MODBLOCK_MACHINE_BLASTED_STONE + "_variants_" + "emerald");
ModBlocks.initBlockRender();
ModItems.initItemRender();
// Register TESR (tile Entity Special renderes
// ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPrimaryCrusher.class, new TileEntityPrimaryCrusherRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCentrifuge.class, new TileEntityCentrifugeRenderer());
// ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFuelPump.class, new TileEntityFuelPumpRenderer());
// ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDistiller.class, new TileEntityDistillerRenderer());
// ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFermenter.class, new TileEntityFermenterRenderer());
// ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWellHead.class, new TileEntityWellHeadRenderer());
// ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFractionalDistillation.class, new TileEntityFractionalDistillationRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLiquidPipe.class, new TileEntityLiquidPipeRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrate.class, new TileEntityCrateRenderer());
// regsiter event for overlay
MinecraftForge.EVENT_BUS.register(new RenderOverlayHandler());
}Example 92
| Project: TestMod-master File: ModRecipes.java View source code |
/**
* Add this mod's crafting recipes.
*/
private static void addCraftingRecipes() {
GameRegistry.addRecipe(new ShapelessCuttingRecipe(new ItemStack(Blocks.PLANKS, 2, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(Items.WOODEN_AXE, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.OAK.getMetadata())));
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.PLANKS, 2, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(ModItems.WOODEN_AXE, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.OAK.getMetadata()));
// Upgrade an Iron Helment to a Golden Helmet while preserving its damage - http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2513998-help-needed-creating-crafting-recipe-with-damaged
GameRegistry.addRecipe(new ShapedArmourUpgradeRecipe(Items.GOLDEN_HELMET, "AAA", "ABA", "AAA", 'A', Blocks.GOLD_BLOCK, 'B', new ItemStack(Items.IRON_HELMET, 1, OreDictionary.WILDCARD_VALUE)));
// Recipe for Guardian Spawner - http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2424619-help-needed-creating-non-pig-mob-spawners
final ItemStack guardianSpawner = new ItemStack(Blocks.MOB_SPAWNER);
final NBTTagCompound tileEntityData = guardianSpawner.getOrCreateSubCompound("BlockEntityTag");
final NBTTagCompound spawnData = new NBTTagCompound();
spawnData.setString("id", "Guardian");
tileEntityData.setTag("SpawnData", spawnData);
tileEntityData.setTag("SpawnPotentials", new NBTTagList());
GameRegistry.addRecipe(guardianSpawner, "SSS", "SFS", "SSS", 'S', Items.STICK, 'F', Items.FISH);
final ItemStack bucketOfStaticGas = UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, ModFluids.STATIC_GAS);
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.COBBLESTONE), bucketOfStaticGas, bucketOfStaticGas, bucketOfStaticGas));
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.DIMENSION_REPLACEMENT), ModItems.SUBSCRIPTS, ModItems.SUPERSCRIPTS);
GameRegistry.addSmelting(ModItems.SUBSCRIPTS, new ItemStack(ModItems.DIMENSION_REPLACEMENT), 0.35f);
// Recipe that uses a non-existent ore name - http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2751505-ore-dictionary-dependant-item-registration
GameRegistry.addRecipe(new ShapedOreRecipe(Items.ACACIA_BOAT, "F", 'F', "fooBar"));
}Example 93
| Project: VendingBlock-master File: Vending.java View source code |
@EventHandler
@SuppressWarnings("unused")
public void preInit(FMLPreInitializationEvent event) {
config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
blockVendingMachine = new BlockVendingMachine(false, false, "vendingMachine");
blockAdvancedVendingMachine = new BlockVendingMachine(true, false, "vendingMachineAdvanced");
blockMultipleVendingMachine = new BlockVendingMachine(false, true, "vendingMachineMultiple");
itemWrench = new Item().setRegistryName("vendingMachineWrench").setUnlocalizedName("vendingMachineWrench").setCreativeTab(tabVending).setContainerItem(itemWrench);
GameRegistry.register(itemWrench);
}Example 94
| Project: Bagginses-master File: BlockList.java View source code |
private static int SpecifiedEntry(String color, int added, String entry, short[] dmgs, String[] itemId) {
Item item = GameRegistry.findItem(itemId[0], itemId[1]);
if (item == null) {
Block block = GameRegistry.findBlock(itemId[0], itemId[1]);
if (block == null) {
if (itemId[0].equals("minecraft") || Loader.isModLoaded(itemId[0]))
Log.warn("Invalid entry in whitelist $1, item not found: $0", entry, color);
return added;
} else
item = Item.getItemFromBlock(block);
}
getList(color).put(item, dmgs);
++added;
return added;
}Example 95
| Project: CazzarCoreLib-master File: Recipe.java View source code |
/**
* Register the item in FML
*/
public void register() {
ArrayList<Object> objs = new ArrayList<Object>();
for (char[] row : recipe) {
StringBuilder stringBuilder = new StringBuilder();
for (char col : row) {
stringBuilder.append(col);
}
objs.add(stringBuilder.toString());
}
characterMap.entrySet().stream().filter( entry -> doesRecipeContain(entry.getKey())).forEach( entry -> {
objs.add(entry.getKey());
objs.add(entry.getValue());
});
System.out.println(Arrays.toString(objs.toArray()));
GameRegistry.addRecipe(new ShapedOreRecipe(produces, objs.toArray()));
}Example 96
| Project: CubicChunks-master File: VanillaCompatibilityGenerator.java View source code |
@Override
public void populate(Cube cube) {
// No population takes place
if (cube.getY() >= 0 && cube.getY() < worldHeightCubes) {
for (int x = 0; x < 2; x++) {
for (int z = 0; z < 2; z++) {
for (int y = worldHeightCubes - 1; y >= 0; y--) {
// Vanilla populators break the rules! They need to find the ground!
world.getCubeFromCubeCoords(cube.getX() + x, y, cube.getZ() + z);
}
}
}
for (int y = worldHeightCubes - 1; y >= 0; y--) {
// normal populators would not do this... but we are populating more than one cube!
world.getCubeFromCubeCoords(cube.getX(), y, cube.getZ()).setPopulated(true);
}
vanilla.populate(cube.getX(), cube.getZ());
GameRegistry.generateWorld(cube.getX(), cube.getZ(), (World) world, vanilla, ((World) world).getChunkProvider());
}
}Example 97
| Project: FlansMod-master File: InfoType.java View source code |
/** Reimported from old code */
public void addRecipe(Item par1Item) {
if (smeltableFrom != null) {
GameRegistry.addSmelting(getRecipeElement(smeltableFrom, 0), new ItemStack(item), 0.0F);
}
if (recipeLine == null)
return;
try {
if (!shapeless) {
// Fix oversized recipes
int rows = 3;
// First column
if (((String) recipe[0]).charAt(0) == ' ' && ((String) recipe[1]).charAt(0) == ' ' && ((String) recipe[2]).charAt(0) == ' ') {
for (int i = 0; i < 3; i++) recipe[i] = ((String) recipe[i]).substring(1);
// New first column
if (((String) recipe[0]).charAt(0) == ' ' && ((String) recipe[1]).charAt(0) == ' ' && ((String) recipe[2]).charAt(0) == ' ') {
for (int i = 0; i < 3; i++) recipe[i] = ((String) recipe[i]).substring(1);
}
}
// Last column
int last = ((String) recipe[0]).length() - 1;
if (((String) recipe[0]).charAt(last) == ' ' && ((String) recipe[1]).charAt(last) == ' ' && ((String) recipe[2]).charAt(last) == ' ') {
for (int i = 0; i < 3; i++) recipe[i] = ((String) recipe[i]).substring(0, last);
// New last column
last--;
if (((String) recipe[0]).charAt(last) == ' ' && ((String) recipe[1]).charAt(last) == ' ' && ((String) recipe[2]).charAt(last) == ' ') {
for (int i = 0; i < 3; i++) recipe[i] = ((String) recipe[i]).substring(0, 0);
}
}
// Top row
if (recipe[0].equals(" ") || recipe[0].equals(" ") || recipe[0].equals(" ")) {
Object[] newRecipe = new Object[recipe.length - 1];
newRecipe[0] = recipe[1];
newRecipe[1] = recipe[2];
recipe = newRecipe;
rows--;
// Next top row
if (recipe[0].equals(" ") || recipe[0].equals(" ") || recipe[0].equals(" ")) {
Object[] newRecipe1 = new Object[recipe.length - 1];
newRecipe1[0] = recipe[1];
recipe = newRecipe1;
rows--;
}
}
// Bottom row
if (recipe[rows - 1].equals(" ") || recipe[rows - 1].equals(" ") || recipe[rows - 1].equals(" ")) {
Object[] newRecipe = new Object[recipe.length - 1];
newRecipe[0] = recipe[0];
newRecipe[1] = recipe[1];
recipe = newRecipe;
rows--;
// Next bottom row
if (recipe[rows - 1].equals(" ") || recipe[rows - 1].equals(" ") || recipe[rows - 1].equals(" ")) {
Object[] newRecipe1 = new Object[recipe.length - 1];
newRecipe1[0] = recipe[0];
recipe = newRecipe1;
rows--;
}
}
for (int i = 0; i < (recipeLine.length - 1) / 2; i++) {
recipe[i * 2 + rows] = recipeLine[i * 2 + 1].charAt(0);
recipe[i * 2 + rows + 1] = getRecipeElement(recipeLine[i * 2 + 2]);
}
GameRegistry.addRecipe(new ItemStack(item, recipeOutput), recipe);
} else {
recipe = new Object[recipeLine.length - 1];
for (int i = 0; i < (recipeLine.length - 1); i++) {
recipe[i] = getRecipeElement(recipeLine[i + 1]);
}
GameRegistry.addShapelessRecipe(new ItemStack(item, recipeOutput), recipe);
}
} catch (Exception e) {
FlansMod.log("Failed to add recipe for : " + shortName);
e.printStackTrace();
}
}Example 98
| Project: ImmersiveEngineering-master File: ImmersiveEngineering.java View source code |
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
IEContent.init();
IEWorldGen ieWorldGen = new IEWorldGen();
GameRegistry.registerWorldGenerator(ieWorldGen, 0);
MinecraftForge.EVENT_BUS.register(ieWorldGen);
MinecraftForge.EVENT_BUS.register(new EventHandler());
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
proxy.init();
IESounds.init();
// Lib.IC2 = Loader.isModLoaded("IC2") && Config.getBoolean("ic2compat");
// Lib.GREG = Loader.isModLoaded("gregtech") && Config.getBoolean("gregtechcompat");
// Config.setBoolean("ic2Manual", Lib.IC2);
// Config.setBoolean("gregManual", Lib.GREG);
IECompatModule.doModulesInit();
proxy.initEnd();
int messageId = 0;
packetHandler.registerMessage(MessageMineralListSync.Handler.class, MessageMineralListSync.class, messageId++, Side.CLIENT);
packetHandler.registerMessage(MessageTileSync.HandlerServer.class, MessageTileSync.class, messageId++, Side.SERVER);
packetHandler.registerMessage(MessageTileSync.HandlerClient.class, MessageTileSync.class, messageId++, Side.CLIENT);
packetHandler.registerMessage(MessageSpeedloaderSync.Handler.class, MessageSpeedloaderSync.class, messageId++, Side.CLIENT);
packetHandler.registerMessage(MessageSkyhookSync.Handler.class, MessageSkyhookSync.class, messageId++, Side.CLIENT);
packetHandler.registerMessage(MessageMinecartShaderSync.HandlerServer.class, MessageMinecartShaderSync.class, messageId++, Side.SERVER);
packetHandler.registerMessage(MessageMinecartShaderSync.HandlerClient.class, MessageMinecartShaderSync.class, messageId++, Side.CLIENT);
packetHandler.registerMessage(MessageRequestBlockUpdate.Handler.class, MessageRequestBlockUpdate.class, messageId++, Side.SERVER);
packetHandler.registerMessage(MessageNoSpamChatComponents.Handler.class, MessageNoSpamChatComponents.class, messageId++, Side.CLIENT);
packetHandler.registerMessage(MessageShaderManual.HandlerServer.class, MessageShaderManual.class, messageId++, Side.SERVER);
packetHandler.registerMessage(MessageShaderManual.HandlerClient.class, MessageShaderManual.class, messageId++, Side.CLIENT);
for (FMLInterModComms.IMCMessage message : FMLInterModComms.fetchRuntimeMessages(instance)) {
if (message.key.equals("fluidpipeCover") && message.isFunctionMessage()) {
Optional<Function<ItemStack, Boolean>> opFunc = message.getFunctionValue(ItemStack.class, Boolean.class);
if (opFunc.isPresent())
TileEntityFluidPipe.validPipeCovers.add(opFunc.get());
} else if (message.key.equals("fluidpipeCoverClimb") && message.isFunctionMessage()) {
Optional<Function<ItemStack, Boolean>> opFunc = message.getFunctionValue(ItemStack.class, Boolean.class);
if (opFunc.isPresent())
TileEntityFluidPipe.climbablePipeCovers.add(opFunc.get());
}
}
}Example 99
| Project: Mini-Bosses-master File: MiniBosses.java View source code |
@EventHandler
public void preLoad(FMLPreInitializationEvent event) {
event.getModLog().log(Level.INFO, "Mini-Bosses is starting to load!");
logger = event.getModLog();
ConfigHelper.setupConfig(new Configuration(event.getSuggestedConfigurationFile()), event.getModLog());
Resources.setupArmorMaterials();
GameRegistry.registerItem(MBItems.ingotDarkIron, "ingotDarkIron");
GameRegistry.registerItem(MBItems.darkIronHelm, "darkIronHelm");
GameRegistry.registerItem(MBItems.darkIronChest, "darkIronChest");
GameRegistry.registerItem(MBItems.darkIronLegs, "darkIronLegs");
GameRegistry.registerItem(MBItems.darkIronBoots, "darkIronBoots");
GameRegistry.registerItem(MBItems.occulus_item, "itemOcculus");
GameRegistry.registerItem(MBItems.ingotInferno, "ingotInferno");
GameRegistry.registerItem(MBItems.infernoHelm, "infernoHelm");
GameRegistry.registerItem(MBItems.infernoChest, "infernoChest");
GameRegistry.registerItem(MBItems.infernoLegs, "infernoLegs");
GameRegistry.registerItem(MBItems.infernoBoots, "infernoBoots");
GameRegistry.registerItem(MBItems.feederTooth, "feederTooth");
GameRegistry.registerItem(MBItems.feederSword, "feederSword");
GameRegistry.registerItem(MBItems.reviveHeart, "reviveHeart");
GameRegistry.registerItem(MBItems.medusaEye, "medusaEye");
GameRegistry.registerItem(MBItems.dodgeGem, "dodgeGem");
GameRegistry.registerItem(MBItems.summonScroll, "summonScroll");
GameRegistry.registerItem(MBItems.bloodTablet, "bloodTablet");
GameRegistry.registerBlock(MBBlocks.blockSlime, "blockSlime");
GameRegistry.registerBlock(MBBlocks.cryptStone, "cryptStone");
GameRegistry.registerBlock(MBBlocks.summoningPillar, "summoningPillar");
GameRegistry.registerTileEntity(TileEntitySummoningPillar.class, "MB-SummonPillar");
}Example 100
| Project: BaseMetals-master File: Blocks.java View source code |
public static void init() {
if (initDone)
return;
cyano.basemetals.init.Materials.init();
cyano.basemetals.init.ItemGroups.init();
adamantine_block = createBlock(Materials.adamantine);
adamantine_plate = createPlate(Materials.adamantine);
adamantine_ore = createOre(Materials.adamantine);
adamantine_bars = createBars(Materials.adamantine);
adamantine_door = createDoor(Materials.adamantine);
adamantine_trapdoor = createTrapDoor(Materials.adamantine);
aquarium_block = createBlock(Materials.aquarium);
aquarium_plate = createPlate(Materials.aquarium);
aquarium_bars = createBars(Materials.aquarium);
aquarium_door = createDoor(Materials.aquarium);
aquarium_trapdoor = createTrapDoor(Materials.aquarium);
brass_block = createBlock(Materials.brass);
brass_plate = createPlate(Materials.brass);
brass_bars = createBars(Materials.brass);
brass_door = createDoor(Materials.brass);
brass_trapdoor = createTrapDoor(Materials.brass);
bronze_block = createBlock(Materials.bronze);
bronze_plate = createPlate(Materials.bronze);
bronze_bars = createBars(Materials.bronze);
bronze_door = createDoor(Materials.bronze);
bronze_trapdoor = createTrapDoor(Materials.bronze);
coldiron_block = createBlock(Materials.coldiron);
coldiron_plate = createPlate(Materials.coldiron);
coldiron_ore = createOre(Materials.coldiron);
coldiron_bars = createBars(Materials.coldiron);
coldiron_door = createDoor(Materials.coldiron);
coldiron_trapdoor = createTrapDoor(Materials.coldiron);
copper_block = createBlock(Materials.copper);
copper_plate = createPlate(Materials.copper);
copper_ore = createOre(Materials.copper);
copper_bars = createBars(Materials.copper);
copper_door = createDoor(Materials.copper);
copper_trapdoor = createTrapDoor(Materials.copper);
cupronickel_block = createBlock(Materials.cupronickel);
cupronickel_plate = createPlate(Materials.cupronickel);
cupronickel_bars = createBars(Materials.cupronickel);
cupronickel_door = createDoor(Materials.cupronickel);
cupronickel_trapdoor = createTrapDoor(Materials.cupronickel);
electrum_block = createBlock(Materials.electrum);
electrum_plate = createPlate(Materials.electrum);
electrum_bars = createBars(Materials.electrum);
electrum_door = createDoor(Materials.electrum);
electrum_trapdoor = createTrapDoor(Materials.electrum);
invar_block = createBlock(Materials.invar);
invar_plate = createPlate(Materials.invar);
invar_bars = createBars(Materials.invar);
invar_door = createDoor(Materials.invar);
invar_trapdoor = createTrapDoor(Materials.invar);
lead_block = createBlock(Materials.lead);
lead_plate = createPlate(Materials.lead);
lead_ore = createOre(Materials.lead);
lead_bars = createBars(Materials.lead);
lead_door = createDoor(Materials.lead);
lead_trapdoor = createTrapDoor(Materials.lead);
mercury_ore = new BlockOre().setHardness(3.0f).setResistance(5.0f).setRegistryName(BaseMetals.MODID, "mercury_ore").setUnlocalizedName(BaseMetals.MODID + ".mercury_ore");
GameRegistry.register(mercury_ore);
ItemBlock mercury_ore_item = new ItemBlock(mercury_ore);
mercury_ore_item.setRegistryName(BaseMetals.MODID, "mercury_ore");
GameRegistry.register(mercury_ore_item);
allBlocks.put("mercury_ore", mercury_ore);
OreDictionary.registerOre("oreMercury", mercury_ore);
mithril_block = createBlock(Materials.mithril);
mithril_plate = createPlate(Materials.mithril);
mithril_bars = createBars(Materials.mithril);
mithril_door = createDoor(Materials.mithril);
mithril_trapdoor = createTrapDoor(Materials.mithril);
nickel_block = createBlock(Materials.nickel);
nickel_plate = createPlate(Materials.nickel);
nickel_ore = createOre(Materials.nickel);
nickel_bars = createBars(Materials.nickel);
nickel_door = createDoor(Materials.nickel);
nickel_trapdoor = createTrapDoor(Materials.nickel);
platinum_block = createBlock(Materials.platinum);
platinum_plate = createPlate(Materials.platinum);
platinum_ore = createOre(Materials.platinum);
platinum_bars = createBars(Materials.platinum);
platinum_door = createDoor(Materials.platinum);
platinum_trapdoor = createTrapDoor(Materials.platinum);
silver_block = createBlock(Materials.silver);
silver_plate = createPlate(Materials.silver);
silver_ore = createOre(Materials.silver);
silver_bars = createBars(Materials.silver);
silver_door = createDoor(Materials.silver);
silver_trapdoor = createTrapDoor(Materials.silver);
starsteel_block = createBlock(Materials.starsteel);
starsteel_plate = createPlate(Materials.starsteel);
starsteel_ore = createOre(Materials.starsteel);
starsteel_bars = createBars(Materials.starsteel);
starsteel_door = createDoor(Materials.starsteel);
starsteel_trapdoor = createTrapDoor(Materials.starsteel);
starsteel_block.setLightLevel(0.5f);
starsteel_plate.setLightLevel(0.5f);
starsteel_ore.setLightLevel(0.5f);
starsteel_bars.setLightLevel(0.5f);
starsteel_door.setLightLevel(0.5f);
starsteel_trapdoor.setLightLevel(0.5f);
steel_block = createBlock(Materials.steel);
steel_plate = createPlate(Materials.steel);
steel_bars = createBars(Materials.steel);
steel_door = createDoor(Materials.steel);
steel_trapdoor = createTrapDoor(Materials.steel);
tin_block = createBlock(Materials.tin);
tin_plate = createPlate(Materials.tin);
tin_ore = createOre(Materials.tin);
tin_bars = createBars(Materials.tin);
tin_door = createDoor(Materials.tin);
tin_trapdoor = createTrapDoor(Materials.tin);
zinc_block = createBlock(Materials.zinc);
zinc_plate = createPlate(Materials.zinc);
zinc_ore = createOre(Materials.zinc);
iron_plate = createPlate(Materials.vanilla_iron);
gold_plate = createPlate(Materials.vanilla_gold);
human_detector = addBlock(new BlockHumanDetector(), "human_detector");
// final block settings
for (Block b : allBlocks.values()) {
if (b instanceof IOreDictionaryEntry) {
OreDictionary.registerOre(((IOreDictionaryEntry) b).getOreDictionaryName(), b);
}
if (b instanceof BlockMetalDoor == false)
b.setCreativeTab(ItemGroups.tab_blocks);
}
initDone = true;
}Example 101
| Project: Runes-of-Wizardry-master File: DustRegistry.java View source code |
/** * 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); if (dustclass instanceof DustPlaceholder) { placeholders.add((DustPlaceholder) dustclass); } String modID = Utils.getCurrentModID(); dustclass.setUnlocalizedName(modID + "_" + dustclass.getName()); dustclass.setCreativeTab(dustclass.creativeTab()); //list of subItems int[] metavalues = dustclass.getMetaValues(); //if we have meta-based subdusts, mark it as such if (metavalues.length > 1) { dustclass.setHasSubtypes(true); } //register the dust item with the appropriate modid GameRegistry.register(dustclass, new ResourceLocation(modID, dustclass.getName())); RunesOfWizardry.proxy.registerDustItemRender(dustclass); //create the block form of the dust IDustStorageBlock dustBlock; if (!dustclass.hasCustomBlock()) { dustBlock = new ADustStorageBlock(Material.SAND, modID) { @Override public IDust getIDust() { return dustclass; } }; RunesOfWizardry.proxy.registerDustBlockRender((ADustStorageBlock) dustBlock); } else { dustBlock = dustclass.getCustomBlock(); } if (dustBlock != null) { blocks.put(dustclass, dustBlock); //Crafting the blocks for (int i : metavalues) { ItemStack dust = new ItemStack(dustclass, 1, i); GameRegistry.addShapedRecipe(new ItemStack(dustBlock.getInstance(), 1, i), new Object[] { "XXX", "XXX", "XXX", 'X', dust }); GameRegistry.addShapelessRecipe(new ItemStack(dustclass, 9, i), new ItemStack(dustBlock.getInstance(), 1, i)); } } }