Added recipes to almost everything

This commit is contained in:
Calclavia 2014-01-28 12:29:51 +08:00
parent ef6190cf13
commit abcbb00280
4 changed files with 52 additions and 8 deletions

View file

@ -9,6 +9,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import resonantinduction.core.Reference;
@ -116,7 +117,7 @@ public class Electrical
// Transport
blockEMLevitator = contentRegistry.createTile(BlockLevitator.class, TileLevitator.class);
// blockArmbot = contentRegistry.createTile(BlockArmbot.class, TileArmbot.class);
//blockEncoder = contentRegistry.createTile(BlockEncoder.class, TileEncoder.class);
// blockEncoder = contentRegistry.createTile(BlockEncoder.class, TileEncoder.class);
itemDisk = contentRegistry.createItem(ItemDisk.class);
// Generator
@ -126,6 +127,10 @@ public class Electrical
Settings.save();
OreDictionary.registerOre("wire", itemPartWire);
OreDictionary.registerOre("battery", blockBattery);
OreDictionary.registerOre("batteryBox", blockBattery);
/**
* Set reference itemstacks
*/
@ -162,7 +167,9 @@ public class Electrical
GameRegistry.addRecipe(new ShapedOreRecipe(itemMultimeter, "WWW", "ICI", 'W', defaultWire, 'C', UniversalRecipe.BATTERY.get(), 'I', UniversalRecipe.PRIMARY_METAL.get()));
/** Battery */
GameRegistry.addRecipe(new ShapedOreRecipe(blockBattery, "III", "IRI", "III", 'R', Block.blockRedstone, 'I', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockBattery, 1, 0), "III", "IRI", "III", 'R', Block.blockRedstone, 'I', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockBattery, 1, 1), "RRR", "RIR", "RRR", 'R', ItemBlockBattery.getTier(new ItemStack(blockBattery, 1, 0)), 'I', UniversalRecipe.PRIMARY_PLATE.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockBattery, 1, 2), "RRR", "RIR", "RRR", 'R', ItemBlockBattery.getTier(new ItemStack(blockBattery, 1, 1)), 'I', Block.blockDiamond));
/** Wires **/
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.COPPER.getWire(3), "MMM", 'M', "ingotCopper"));
@ -173,6 +180,15 @@ public class Electrical
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.SUPERCONDUCTOR.getWire(3), "MMM", 'M', "ingotSuperconductor"));
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.SUPERCONDUCTOR.getWire(3), "MMM", "MEM", "MMM", 'M', Item.ingotGold, 'E', Item.eyeOfEnder));
GameRegistry.addRecipe(new ShapedOreRecipe(itemTransformer, "WWW", "WWW", "III", 'W', defaultWire, 'I', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockEMLevitator, " G ", "SDS", "SWS", 'W', defaultWire, 'G', Block.glass, 'D', Block.blockDiamond, 'S', UniversalRecipe.PRIMARY_METAL.get()));
/** Generators **/
GameRegistry.addRecipe(new ShapedOreRecipe(blockSolarPanel, "CCC", "WWW", "III", 'W', defaultWire, 'C', Item.coal, 'I', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockGenerator, "SRS", "SMS", "SWS", 'W', defaultWire, 'M', UniversalRecipe.MOTOR.get(), 'S', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockThermopile, "ORO", "OWO", "OOO", 'W', defaultWire, 'O', Block.obsidian, 'R', Item.redstone));
/** Wire Compatiblity **/
if (Loader.isModLoaded("IC2"))
{
@ -188,9 +204,9 @@ public class Electrical
}
proxy.postInit();
/** Inject new furnace tile class */
//replaceTileEntity(TileEntityFurnace.class, TileAdvancedFurnace.class);
// replaceTileEntity(TileEntityFurnace.class, TileAdvancedFurnace.class);
}
public static void replaceTileEntity(Class<? extends TileEntity> findTile, Class<? extends TileEntity> replaceTile)

View file

@ -137,7 +137,7 @@ public class ItemBlockBattery extends ItemBlock implements IEnergyItem, IVoltage
return itemStack;
}
public byte getTier(ItemStack itemStack)
public static byte getTier(ItemStack itemStack)
{
if (itemStack.getTagCompound() == null)
{

View file

@ -2,7 +2,9 @@ package resonantinduction.mechanical;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.Settings;
@ -31,15 +33,18 @@ import resonantinduction.mechanical.process.TileGrinderWheel;
import resonantinduction.mechanical.process.TileMixer;
import calclavia.lib.content.ContentRegistry;
import calclavia.lib.network.PacketHandler;
import calclavia.lib.recipe.UniversalRecipe;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* Resonant Induction Archaic Module
@ -126,4 +131,25 @@ public class Mechanical
proxy.init();
}
@EventHandler
public void postInit(FMLPostInitializationEvent evt)
{
// Add recipes
GameRegistry.addRecipe(new ShapedOreRecipe(itemGear, "SWS", "W W", "SWS", 'W', "plankWood", 'S', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 4), "III", "GGG", 'I', Item.ingotIron, 'G', itemGear));
GameRegistry.addRecipe(new ShapedOreRecipe(blockManipulator, "SSS", "SRS", "SCS", 'S', Item.ingotIron, 'C', blockConveyorBelt, 'R', Block.blockRedstone));
GameRegistry.addRecipe(new ShapedOreRecipe(blockDetector, "SWS", "SRS", "SWS", 'S', Item.ingotIron, 'W', UniversalRecipe.WIRE.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockRejector, "S S", "SPS", "SRS", 'P', Block.pistonBase, 'S', Item.ingotIron, 'R', Item.redstone));
GameRegistry.addRecipe(new ShapedOreRecipe(blockTank, "GGG", "GSG", "GGG", 'G', Block.glass, 'S', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(blockGrate, "BBB", "B B", "BBB", 'B', Block.fenceIron));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 4), "BBB", "GGG", "BBB", 'B', UniversalRecipe.SECONDARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(itemPipeGuage, "RRR", "GGG", " S ", 'S', Item.stick, 'G', Block.glass, 'R', Item.redstone));
GameRegistry.addRecipe(new ShapedOreRecipe(blockGrinderWheel, "III", "LGL", "III", 'I', UniversalRecipe.PRIMARY_METAL.get(), 'L', "logWood", 'G', itemGear));
GameRegistry.addRecipe(new ShapedOreRecipe(blockPurifier, "IGI", "IGI", "IGI", 'I', UniversalRecipe.PRIMARY_METAL.get(), 'G', itemGear));
GameRegistry.addRecipe(new ShapedOreRecipe(blockFilter, "BBB", "PPP", "BBB", 'B', Block.fenceIron, 'P', Item.paper));
}
}

View file

@ -78,8 +78,10 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
ticks++;
angle += angularVelocity / 20;
checkClientUpdate();
if (!world().isRemote)
checkClientUpdate();
super.update();
}
@ -91,7 +93,7 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
markPacketUpdate = true;
}
if (!world().isRemote && markPacketUpdate && ticks % 10 == 0)
if (markPacketUpdate && ticks % 10 == 0)
{
sendRotationPacket();
markPacketUpdate = false;