RI now loads with content

This commit is contained in:
Robert S 2014-08-13 11:54:36 -04:00
parent ba1a5d5995
commit 2ee8c44722
9 changed files with 81 additions and 73 deletions

View file

@ -3,15 +3,12 @@ package resonantinduction.archaic
import cpw.mods.fml.common.Mod.EventHandler import cpw.mods.fml.common.Mod.EventHandler
import cpw.mods.fml.common.event.{FMLInitializationEvent, FMLPostInitializationEvent, FMLPreInitializationEvent} import cpw.mods.fml.common.event.{FMLInitializationEvent, FMLPostInitializationEvent, FMLPreInitializationEvent}
import cpw.mods.fml.common.network.NetworkRegistry import cpw.mods.fml.common.network.NetworkRegistry
import cpw.mods.fml.common.registry.GameRegistry
import cpw.mods.fml.common.{Mod, SidedProxy} import cpw.mods.fml.common.{Mod, SidedProxy}
import net.minecraft.init.{Blocks, Items} import net.minecraft.init.{Blocks, Items}
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
import net.minecraftforge.oredict.{OreDictionary, ShapedOreRecipe} import net.minecraftforge.oredict.OreDictionary
import resonant.content.loader.ModManager import resonant.content.loader.ModManager
import resonant.lib.recipe.UniversalRecipe
import resonantinduction.archaic.blocks.{ItemImprint, TileImprinter, TileTurntable} import resonantinduction.archaic.blocks.{ItemImprint, TileImprinter, TileTurntable}
import resonantinduction.archaic.crate.CrateRecipe
import resonantinduction.archaic.engineering.{ItemHammer, TileEngineeringTable} import resonantinduction.archaic.engineering.{ItemHammer, TileEngineeringTable}
import resonantinduction.archaic.firebox.{TileFirebox, TileHotPlate} import resonantinduction.archaic.firebox.{TileFirebox, TileHotPlate}
import resonantinduction.archaic.fluid.grate.TileGrate import resonantinduction.archaic.fluid.grate.TileGrate
@ -72,39 +69,9 @@ object Archaic {
if ( OreDictionary.getOres( "stickWood" ) == null ) { if ( OreDictionary.getOres( "stickWood" ) == null ) {
OreDictionary.registerOre( "stickWood", Items.stick ) OreDictionary.registerOre( "stickWood", Items.stick )
} }
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockEngineeringTable, Array( "P", "C", 'P', Blocks.wooden_pressure_plate, 'C', Blocks.crafting_table ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockFilter, Array( "B", "P", "B", 'B', Blocks.iron_bars, 'P', Items.paper ) ) ) ArchaicBlocks.postInit()
GameRegistry.addRecipe( new ShapedOreRecipe( new ItemStack( ArchaicBlocks.blockCrate, 1, 0 ), Array( "WWW", "WSW", "WWW", ArchaicItems.postInit()
'S', "stickWood", 'W', "logWood" ) ) )
GameRegistry.addRecipe( new CrateRecipe( new ItemStack( ArchaicBlocks.blockCrate, 1, 1 ), Array( "WWW", "WSW", "WWW",
'S', new ItemStack( ArchaicBlocks.blockCrate, 1, 0 ), 'W', "ingotIron" ) ) )
GameRegistry.addRecipe( new CrateRecipe( new ItemStack( ArchaicBlocks.blockCrate, 1, 2 ), Array( "WWW", "WSW", "WWW",
'S', new ItemStack( ArchaicBlocks.blockCrate, 1, 1 ), 'W', UniversalRecipe.PRIMARY_METAL.get ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockFirebox, Array( "III", "SFS", "SSS", 'I', Items.iron_ingot,
'F', Blocks.furnace, 'S', Blocks.stone ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( new ItemStack( ArchaicBlocks.blockFirebox, 1, 1 ), Array( "III", "SFS", "SSS",
'I', UniversalRecipe.PRIMARY_METAL.get, 'F', new ItemStack( ArchaicBlocks.blockFirebox, 1, 0 ), 'S', UniversalRecipe.WIRE.get ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockImprinter, Array( "SSS", "W W", "PPP", 'S', Blocks.stone,
'P', Blocks.piston, 'W', "logWood" ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockTurntable, Array( "SSS", "PGP", "WWW", 'S', Blocks.stone,
'G', Items.redstone, 'P', Blocks.piston, 'W', "logWood" ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockCast, Array( "I I", "IBI", "III", 'S', Items.iron_ingot, 'B',
Blocks.iron_bars ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockGutter, Array( "S S", "I I", "III", 'S', Items.stick, 'I',
"cobblestone" ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockGrate, Array( "WBW", "B B", "WBW", 'B', Blocks.iron_bars,
'W', "plankWood" ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockHotPlate, Array( "SSS", "III", 'I', Items.iron_ingot, 'S',
Blocks.stone ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockMillstone, Array( "SPS", "SAS", "SSS", 'P', Blocks.piston,
'A', Items.stone_pickaxe, 'S', Blocks.stone ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicBlocks.blockTank, Array( "GGG", "GSG", "GGG", 'G', Blocks.glass, 'S',
Items.iron_ingot ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicItems.itemHandCrank, Array( "S ", "SSS", " S", 'S', "stickWood" ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicItems.itemImprint, Array( "PPP", "PIP", "PPP", 'P', Items.paper, 'I',
new ItemStack( Items.dye, 0 ) ) ) )
GameRegistry.addRecipe( new ShapedOreRecipe( ArchaicItems.itemHammer, Array( "CC ", "CS ", " S", 'C', "cobblestone", 'S',
"stickWood" ) ) )
proxy.postInit() proxy.postInit()
} }
} }

View file

@ -1,9 +1,13 @@
package resonantinduction.archaic package resonantinduction.archaic
import net.minecraft.block.Block; import net.minecraft.block.Block
import net.minecraft.item.Item; import net.minecraft.init.{Blocks, Items}
import net.minecraft.item.ItemStack
import resonant.content.loader.ContentHolder
import resonant.lib.recipe.UniversalRecipe
;
object ArchaicBlocks { object ArchaicBlocks extends ContentHolder {
var blockEngineeringTable: Block = _ var blockEngineeringTable: Block = _
var blockCrate: Block = _ var blockCrate: Block = _
@ -17,4 +21,24 @@ object ArchaicBlocks {
var blockGrate: Block = _ var blockGrate: Block = _
var blockGutter: Block = _ var blockGutter: Block = _
var blockTank: Block = _ var blockTank: Block = _
override def postInit() {
recipes += shaped(ArchaicBlocks.blockEngineeringTable, "P", "C", 'P', Blocks.wooden_pressure_plate, 'C', Blocks.crafting_table)
//recipes += shaped(ArchaicBlocks.blockFilter, "B", "P", "B", 'B', Blocks.iron_bars, 'P', Items.paper)
//recipes += shaped(new ItemStack(ArchaicBlocks.blockCrate, 1, 0), "WWW", "WSW", "WWW", 'S', "stickWood", 'W', "logWood")
//recipes += new CrateRecipe(new ItemStack(ArchaicBlocks.blockCrate, 1, 1), "WWW", "WSW", "WWW", 'S', new ItemStack(ArchaicBlocks.blockCrate, 1, 0), 'W', "ingotIron")
//recipes +=new CrateRecipe(new ItemStack(ArchaicBlocks.blockCrate, 1, 2), "WWW", "WSW", "WWW", 'S', new ItemStack(ArchaicBlocks.blockCrate, 1, 1), 'W', UniversalRecipe.PRIMARY_METAL.get)
recipes += shaped(ArchaicBlocks.blockFirebox, "III", "SFS", "SSS", 'I', Items.iron_ingot, 'F', Blocks.furnace, 'S', Blocks.stone)
recipes += shaped(new ItemStack(ArchaicBlocks.blockFirebox, 1, 1), "III", "SFS", "SSS", 'I', UniversalRecipe.PRIMARY_METAL.get, 'F', new ItemStack(ArchaicBlocks.blockFirebox, 1, 0), 'S', UniversalRecipe.WIRE.get)
recipes += shaped(ArchaicBlocks.blockImprinter, "SSS", "W W", "PPP", 'S', Blocks.stone, 'P', Blocks.piston, 'W', "logWood")
recipes += shaped(ArchaicBlocks.blockTurntable, "SSS", "PGP", "WWW", 'S', Blocks.stone, 'G', Items.redstone, 'P', Blocks.piston, 'W', "logWood")
recipes += shaped(ArchaicBlocks.blockCast, "I I", "IBI", "III", 'S', Items.iron_ingot, 'B', Blocks.iron_bars)
recipes += shaped(ArchaicBlocks.blockGutter, "S S", "I I", "III", 'S', Items.stick, 'I', "cobblestone")
recipes += shaped(ArchaicBlocks.blockGrate, "WBW", "B B", "WBW", 'B', Blocks.iron_bars, 'W', "plankWood")
recipes += shaped(ArchaicBlocks.blockHotPlate, "SSS", "III", 'I', Items.iron_ingot, 'S', Blocks.stone)
recipes += shaped(ArchaicBlocks.blockMillstone, "SPS", "SAS", "SSS", 'P', Blocks.piston, 'A', Items.stone_pickaxe, 'S', Blocks.stone)
recipes += shaped(ArchaicBlocks.blockTank, "GGG", "GSG", "GGG", 'G', Blocks.glass, 'S', Items.iron_ingot)
}
} }

View file

@ -1,9 +1,20 @@
package resonantinduction.archaic package resonantinduction.archaic
import net.minecraft.item.Item; import net.minecraft.init.Items
import net.minecraft.item.{Item, ItemStack}
import resonant.content.loader.ContentHolder
;
object ArchaicItems { object ArchaicItems extends ContentHolder
{
var itemImprint: Item = _ var itemImprint: Item = _
var itemHammer: Item = _ var itemHammer: Item = _
var itemHandCrank: Item = _ var itemHandCrank: Item = _
override def postInit()
{
recipes += shaped(itemHandCrank, "S ", "SSS", " S", 'S', "stickWood" )
recipes += shaped(itemImprint, "PPP", "PIP", "PPP", 'P', Items.paper, 'I', new ItemStack( Items.dye, 0 ) )
recipes += shaped(itemHammer, "CC ", "CS ", " S", 'C', "cobblestone", 'S', "stickWood" )
}
} }

View file

@ -16,7 +16,7 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderChemicalExtractor extends TileEntitySpecialRenderer public class RenderChemicalExtractor extends TileEntitySpecialRenderer
{ {
public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(new ResourceLocation(Reference.modelPath() + "chemicalExtractor.tcn")); public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(new ResourceLocation(Reference.domain(), Reference.modelPath() + "chemicalExtractor.tcn"));
public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.domain(), Reference.modelPath() + "chemicalExtractor.png"); public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.domain(), Reference.modelPath() + "chemicalExtractor.png");
public void render(TileChemicalExtractor tileEntity, double x, double y, double z, float f) public void render(TileChemicalExtractor tileEntity, double x, double y, double z, float f)

View file

@ -15,7 +15,7 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderPlasmaHeater extends RenderTaggedTile public class RenderPlasmaHeater extends RenderTaggedTile
{ {
public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(new ResourceLocation(Reference.modelPath() + "fusionReactor.tcn")); public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(new ResourceLocation(Reference.domain(), Reference.modelPath() + "fusionReactor.tcn"));
public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.domain(), Reference.modelPath() + "fusionReactor.png"); public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.domain(), Reference.modelPath() + "fusionReactor.png");
@Override @Override

View file

@ -0,0 +1,30 @@
package resonantinduction.core.grid;
import codechicken.multipart.PartMap;
import codechicken.multipart.TMultiPart;
import codechicken.multipart.TileMultipart;
import net.minecraftforge.common.util.ForgeDirection;
import universalelectricity.api.core.grid.INode;
import universalelectricity.api.core.grid.INodeProvider;
/**
* Created by robert on 8/13/2014.
*/
public class TraitNodeProvider extends TileMultipart implements INodeProvider
{
@Override
public INode getNode(Class<? extends INode> nodeType, ForgeDirection from)
{
TMultiPart nodePart = partMap(from.ordinal());
if (nodePart == null)
{
nodePart = partMap(PartMap.CENTER.ordinal());
}
if (nodePart instanceof INodeProvider)
{
return ((INodeProvider)nodePart).getNode(nodeType, from);
}
return null;
}
}

View file

@ -1,24 +0,0 @@
package resonantinduction.core.grid
import codechicken.multipart.{PartMap, TileMultipart}
import net.minecraftforge.common.util.ForgeDirection
import universalelectricity.api.core.grid.{INode, INodeProvider}
trait TraitNodeProvider extends TileMultipart with INodeProvider
{
override def getNode(nodeType: Class[_ <: INode], from: ForgeDirection): INode =
{
var nodePart = partMap(from.ordinal)
if (nodePart == null)
{
nodePart = partMap(PartMap.CENTER.ordinal)
}
if (nodePart.isInstanceOf[INodeProvider])
{
return nodePart.asInstanceOf[INodeProvider].getNode(nodeType, from)
}
return null
}
}

View file

@ -150,10 +150,10 @@ public class Mechanical
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGearShaft, 1, 0), "S", "S", "S", 'S', Items.stick)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGearShaft, 1, 0), "S", "S", "S", 'S', Items.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGearShaft, 1, 1), "S", "G", "S", 'G', new ItemStack(itemGearShaft, 1, 0), 'S', Blocks.cobblestone)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGearShaft, 1, 1), "S", "G", "S", 'G', new ItemStack(itemGearShaft, 1, 0), 'S', Blocks.cobblestone));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGearShaft, 1, 2), "S", "G", "S", 'G', new ItemStack(itemGearShaft, 1, 1), 'S', Items.iron_ingot)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGearShaft, 1, 2), "S", "G", "S", 'G', new ItemStack(itemGearShaft, 1, 1), 'S', Items.iron_ingot));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 4), "III", "GGG", 'I', Items.iron_ingot, 'G', itemGear)); //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 4), "III", "GGG", 'I', Items.iron_ingot, 'G', itemGear));
GameRegistry.addRecipe(new ShapedOreRecipe(blockManipulator, "SSS", "SRS", "SCS", 'S', Items.iron_ingot, 'C', blockConveyorBelt, 'R', Blocks.redstone_block)); //GameRegistry.addRecipe(new ShapedOreRecipe(blockManipulator, "SSS", "SRS", "SCS", 'S', Items.iron_ingot, 'C', blockConveyorBelt, 'R', Blocks.redstone_block));
GameRegistry.addRecipe(new ShapedOreRecipe(blockDetector, "SWS", "SRS", "SWS", 'S', Items.iron_ingot, 'W', UniversalRecipe.WIRE.get())); GameRegistry.addRecipe(new ShapedOreRecipe(blockDetector, "SWS", "SRS", "SWS", 'S', Items.iron_ingot, 'W', UniversalRecipe.WIRE.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockSorter, "SSS", "SPS", "SRS", 'P', Blocks.piston, 'S', Items.iron_ingot, 'R', Blocks.redstone_block)); //GameRegistry.addRecipe(new ShapedOreRecipe(blockSorter, "SSS", "SPS", "SRS", 'P', Blocks.piston, 'S', Items.iron_ingot, 'R', Blocks.redstone_block));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWindTurbine, 1, 0), "CWC", "WGW", "CWC", 'G', itemGear, 'C', Blocks.wool, 'W', Items.stick)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWindTurbine, 1, 0), "CWC", "WGW", "CWC", 'G', itemGear, 'C', Blocks.wool, 'W', Items.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWindTurbine, 1, 1), "CWC", "WGW", "CWC", 'G', new ItemStack(blockWindTurbine, 1, 0), 'C', Blocks.stone, 'W', Items.stick)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWindTurbine, 1, 1), "CWC", "WGW", "CWC", 'G', new ItemStack(blockWindTurbine, 1, 0), 'C', Blocks.stone, 'W', Items.stick));

View file

@ -17,7 +17,7 @@ public class MultipartMechanical implements IPartFactory
public MultipartMechanical() public MultipartMechanical()
{ {
MultiPartRegistry.registerParts(this, PART_TYPES); MultiPartRegistry.registerParts(this, PART_TYPES);
MultipartGenerator.registerPassThroughInterface("resonantinduction.core.grid.fluid.IPressureNodeProvider"); //MultipartGenerator.registerPassThroughInterface("resonantinduction.core.grid.fluid.IPressureNodeProvider");
// TODO: Move to UE // TODO: Move to UE
MultipartGenerator.registerTrait("resonant.api.grid.INodeProvider", "resonantinduction.core.grid.TraitNodeProvider"); MultipartGenerator.registerTrait("resonant.api.grid.INodeProvider", "resonantinduction.core.grid.TraitNodeProvider");
} }