Setup Mech's Content threw the ContentLoader
This commit is contained in:
parent
b14bda2e5f
commit
5ceb97cb6b
5 changed files with 225 additions and 264 deletions
|
@ -22,68 +22,69 @@ import scala.collection.convert.wrapAll._
|
||||||
@ModstatInfo(prefix = "resonantin")
|
@ModstatInfo(prefix = "resonantin")
|
||||||
object ResonantInduction
|
object ResonantInduction
|
||||||
{
|
{
|
||||||
/** Packets */
|
/** Packets */
|
||||||
val packetHandler = ResonantEngine.instance.packetHandler
|
val packetHandler = ResonantEngine.instance.packetHandler
|
||||||
val loadables = new LoadableHandler
|
val loadables = new LoadableHandler
|
||||||
|
|
||||||
@SidedProxy(clientSide = "resonantinduction.core.ClientProxy", serverSide = "resonantinduction.core.CommonProxy")
|
@SidedProxy(clientSide = "resonantinduction.core.ClientProxy", serverSide = "resonantinduction.core.CommonProxy")
|
||||||
var proxy: CommonProxy = _
|
var proxy: CommonProxy = _
|
||||||
|
|
||||||
@Mod.Metadata(References.ID)
|
@Mod.Metadata(References.ID)
|
||||||
var metadata: ModMetadata = null
|
var metadata: ModMetadata = null
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
def preInit(evt: FMLPreInitializationEvent)
|
def preInit(evt: FMLPreInitializationEvent)
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Registrations
|
|
||||||
*/
|
|
||||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy)
|
|
||||||
Modstats.instance.getReporter.registerMod(this)
|
|
||||||
|
|
||||||
Settings.config = new Configuration(evt.getSuggestedConfigurationFile)
|
|
||||||
ConfigHandler.sync(Settings, Settings.config)
|
|
||||||
|
|
||||||
MinecraftForge.EVENT_BUS.register(new TextureHookHandler)
|
|
||||||
|
|
||||||
loadables.applyModule(proxy)
|
|
||||||
loadables.applyModule(packetHandler)
|
|
||||||
loadables.applyModule(CoreContent)
|
|
||||||
|
|
||||||
proxy.preInit()
|
|
||||||
|
|
||||||
ResonantTab.itemStack = new ItemStack(CoreContent.decoration)
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
def init(evt: FMLInitializationEvent)
|
|
||||||
{
|
|
||||||
//TODO: Why is there an if statement check here?
|
|
||||||
if (ResonantInduction.metadata != null)
|
|
||||||
{
|
{
|
||||||
ResonantInduction.metadata.modId = Reference.name
|
/**
|
||||||
ResonantInduction.metadata.name = Reference.name
|
* Registrations
|
||||||
ResonantInduction.metadata.description = Reference.name + " is a mod... TODO add description"
|
*/
|
||||||
ResonantInduction.metadata.url = "http://calclavia.com/resonant-induction/"
|
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy)
|
||||||
ResonantInduction.metadata.version = Reference.version + Reference.build
|
Modstats.instance.getReporter.registerMod(this)
|
||||||
ResonantInduction.metadata.authorList = List[String]("Calclavia", "DarkCow", "tgame14", "Maxwolf")
|
|
||||||
ResonantInduction.metadata.autogenerated = false
|
Settings.config = new Configuration(evt.getSuggestedConfigurationFile)
|
||||||
|
ConfigHandler.sync(Settings, Settings.config)
|
||||||
|
|
||||||
|
MinecraftForge.EVENT_BUS.register(new TextureHookHandler)
|
||||||
|
|
||||||
|
loadables.applyModule(proxy)
|
||||||
|
loadables.applyModule(packetHandler)
|
||||||
|
loadables.applyModule(CoreContent)
|
||||||
|
|
||||||
|
loadables.preInit()
|
||||||
|
|
||||||
|
ResonantTab.itemStack = new ItemStack(CoreContent.decoration)
|
||||||
}
|
}
|
||||||
|
|
||||||
ResonantPartFactory.init()
|
@EventHandler
|
||||||
ResonantEngine.resourceFactory.generateAll();
|
def init(evt: FMLInitializationEvent)
|
||||||
proxy.init()
|
{
|
||||||
}
|
//TODO: Why is there an if statement check here?
|
||||||
|
if (ResonantInduction.metadata != null)
|
||||||
|
{
|
||||||
|
ResonantInduction.metadata.modId = Reference.name
|
||||||
|
ResonantInduction.metadata.name = Reference.name
|
||||||
|
ResonantInduction.metadata.description = Reference.name + " is a mod... TODO add description"
|
||||||
|
ResonantInduction.metadata.url = "http://calclavia.com/resonant-induction/"
|
||||||
|
ResonantInduction.metadata.version = Reference.version + Reference.build
|
||||||
|
ResonantInduction.metadata.authorList = List[String]("Calclavia", "DarkCow", "tgame14", "Maxwolf")
|
||||||
|
ResonantInduction.metadata.autogenerated = false
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
ResonantPartFactory.init()
|
||||||
def postInit(evt: FMLPostInitializationEvent)
|
ResonantEngine.resourceFactory.generateAll();
|
||||||
{
|
|
||||||
/*
|
loadables.init()
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(itemFlour, Array[AnyRef](Item.wheat, Item.wheat)))
|
}
|
||||||
FurnaceRecipes.smelting.addSmelting(itemFlour.itemID, 1, new ItemStack(Item.bread), 50f)
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(itemFlour, 1, 1), Array[AnyRef](itemFlour, Item.bucketWater)))
|
@EventHandler
|
||||||
MachineRecipes.INSTANCE.addRecipe(RecipeType.GRINDER.name, Item.wheat, itemFlour)
|
def postInit(evt: FMLPostInitializationEvent)
|
||||||
*/
|
{
|
||||||
proxy.postInit()
|
/*
|
||||||
}
|
GameRegistry.addRecipe(new ShapelessOreRecipe(itemFlour, Array[AnyRef](Item.wheat, Item.wheat)))
|
||||||
|
FurnaceRecipes.smelting.addSmelting(itemFlour.itemID, 1, new ItemStack(Item.bread), 50f)
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(itemFlour, 1, 1), Array[AnyRef](itemFlour, Item.bucketWater)))
|
||||||
|
MachineRecipes.INSTANCE.addRecipe(RecipeType.GRINDER.name, Item.wheat, itemFlour)
|
||||||
|
*/
|
||||||
|
loadables.postInit()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,24 +1,7 @@
|
||||||
package resonantinduction.mechanical
|
package resonantinduction.mechanical
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.IGuiHandler
|
import resonant.lib.prefab.AbstractProxy
|
||||||
import net.minecraft.entity.player.EntityPlayer
|
|
||||||
import net.minecraft.world.World
|
|
||||||
|
|
||||||
class CommonProxy extends IGuiHandler {
|
class CommonProxy extends AbstractProxy {
|
||||||
def preInit {
|
|
||||||
}
|
|
||||||
|
|
||||||
def init {
|
|
||||||
}
|
|
||||||
|
|
||||||
def postInit {
|
|
||||||
}
|
|
||||||
|
|
||||||
def getServerGuiElement(ID: Int, player: EntityPlayer, world: World, x: Int, y: Int, z: Int): AnyRef = {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
def getClientGuiElement(ID: Int, player: EntityPlayer, world: World, x: Int, y: Int, z: Int): AnyRef = {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
package resonantinduction.mechanical
|
||||||
|
|
||||||
|
import net.minecraft.block.Block
|
||||||
|
import net.minecraft.init.{Blocks, Items}
|
||||||
|
import net.minecraft.item.{Item, ItemStack}
|
||||||
|
import resonant.content.loader.ContentHolder
|
||||||
|
import resonant.lib.recipe.UniversalRecipe
|
||||||
|
import resonantinduction.core.{Reference, ResonantTab}
|
||||||
|
import resonantinduction.mechanical.fluid.pipe.{ItemPipe, PipeMaterials}
|
||||||
|
import resonantinduction.mechanical.fluid.transport.TilePump
|
||||||
|
import resonantinduction.mechanical.machine.TileDetector
|
||||||
|
import resonantinduction.mechanical.machine.edit.{TilePlacer, TileBreaker}
|
||||||
|
import resonantinduction.mechanical.mech.gear.ItemGear
|
||||||
|
import resonantinduction.mechanical.mech.gearshaft.ItemGearShaft
|
||||||
|
import resonantinduction.mechanical.mech.process.crusher.TileMechanicalPiston
|
||||||
|
import resonantinduction.mechanical.mech.process.grinder.TileGrindingWheel
|
||||||
|
import resonantinduction.mechanical.mech.process.mixer.TileMixer
|
||||||
|
import resonantinduction.mechanical.mech.turbine.{TileElectricTurbine, TileWaterTurbine, TileWindTurbine}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The core contents of Resonant Induction
|
||||||
|
* @author Calclavia
|
||||||
|
*/
|
||||||
|
object MechContent extends ContentHolder
|
||||||
|
{
|
||||||
|
//Constructor
|
||||||
|
manager.setTab(ResonantTab)
|
||||||
|
manager.setPrefix(Reference.prefix)
|
||||||
|
|
||||||
|
//Content
|
||||||
|
var itemGear: Item = manager.newItem(classOf[ItemGear])
|
||||||
|
var itemGearShaft: Item = manager.newItem(classOf[ItemGearShaft])
|
||||||
|
var itemPipe: Item = manager.newItem(classOf[ItemPipe])
|
||||||
|
|
||||||
|
var blockWindTurbine: Block = manager.newBlock(classOf[TileWindTurbine])
|
||||||
|
var blockWaterTurbine: Block = manager.newBlock(classOf[TileWaterTurbine])
|
||||||
|
var blockElectricTurbine: Block = manager.newBlock(classOf[TileElectricTurbine])
|
||||||
|
var blockDetector: Block = manager.newBlock(classOf[TileDetector])
|
||||||
|
var blockPump: Block = manager.newBlock(classOf[TilePump])
|
||||||
|
var blockGrinderWheel: Block = manager.newBlock(classOf[TileGrindingWheel])
|
||||||
|
var blockMixer: Block = manager.newBlock(classOf[TileMixer])
|
||||||
|
var blockMechanicalPiston: Block = manager.newBlock(classOf[TileMechanicalPiston])
|
||||||
|
var blockTileBreaker: Block = manager.newBlock(classOf[TileBreaker])
|
||||||
|
var blockTilePlacer: Block = manager.newBlock(classOf[TilePlacer])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recipe registration
|
||||||
|
*/
|
||||||
|
override def postInit()
|
||||||
|
{
|
||||||
|
//recipes += shaped(new ItemStack(decoration, 8, 3), "XXX", "XCX", "XXX", 'X', Blocks.cobblestone, 'C', new ItemStack(Items.coal, 1, 1))
|
||||||
|
recipes += shaped(new ItemStack(itemGear, 1, 0), "SWS", "W W", "SWS", 'W', "plankWood", 'S', Items.stick)
|
||||||
|
recipes += shaped(new ItemStack(itemGear, 1, 1), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 0), 'W', Blocks.cobblestone)
|
||||||
|
recipes += shaped(new ItemStack(itemGear, 1, 2), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 1), 'W', Items.iron_ingot)
|
||||||
|
|
||||||
|
recipes += shaped(new ItemStack(itemGearShaft, 1, 0), "S", "S", "S", 'S', Items.stick)
|
||||||
|
recipes += shaped(new ItemStack(itemGearShaft, 1, 1), "S", "G", "S", 'G', new ItemStack(itemGearShaft, 1, 0), 'S', Blocks.cobblestone)
|
||||||
|
recipes += shaped(new ItemStack(itemGearShaft, 1, 2), "S", "G", "S", 'G', new ItemStack(itemGearShaft, 1, 1), 'S', Items.iron_ingot)
|
||||||
|
|
||||||
|
recipes += shaped(blockDetector, "SWS", "SRS", "SWS", 'S', Items.iron_ingot, 'W', UniversalRecipe.WIRE.get)
|
||||||
|
|
||||||
|
recipes += shaped(new ItemStack(blockWindTurbine, 1, 0), "CWC", "WGW", "CWC", 'G', itemGear, 'C', Blocks.wool, 'W', Items.stick)
|
||||||
|
recipes += shaped(new ItemStack(blockWindTurbine, 1, 1), "CWC", "WGW", "CWC", 'G', new ItemStack(blockWindTurbine, 1, 0), 'C', Blocks.stone, 'W', Items.stick)
|
||||||
|
recipes += shaped(new ItemStack(blockWindTurbine, 1, 2), "CWC", "WGW", "CWC", 'G', new ItemStack(blockWindTurbine, 1, 1), 'C', Items.iron_ingot, 'W', Items.stick)
|
||||||
|
|
||||||
|
recipes += shaped(new ItemStack(blockWaterTurbine, 1, 0), "SWS", "WGW", "SWS", 'G', itemGear, 'W', "plankWood", 'S', Items.stick)
|
||||||
|
recipes += shaped(new ItemStack(blockWaterTurbine, 1, 1), "SWS", "WGW", "SWS", 'G', new ItemStack(blockWaterTurbine, 1, 0), 'W', Blocks.stone, 'S', Items.stick)
|
||||||
|
recipes += shaped(new ItemStack(blockWaterTurbine, 1, 2), "SWS", "WGW", "SWS", 'G', new ItemStack(blockWaterTurbine, 1, 1), 'W', UniversalRecipe.PRIMARY_METAL.get, 'S', Items.stick)
|
||||||
|
|
||||||
|
recipes += shaped(blockElectricTurbine, " B ", "BMB", " B ", 'B', UniversalRecipe.SECONDARY_PLATE.get, 'M', UniversalRecipe.MOTOR.get)
|
||||||
|
recipes += shaped(blockPump, "PPP", "GGG", "PPP", 'P', itemPipe, 'G', new ItemStack(itemGear, 1, 2))
|
||||||
|
|
||||||
|
recipes += shaped(new ItemStack(itemPipe, 3, PipeMaterials.ceramic.id), "BBB", " ", "BBB", 'B', Items.brick)
|
||||||
|
recipes += shaped(new ItemStack(itemPipe, 3, PipeMaterials.bronze.id), "BBB", " ", "BBB", 'B', "ingotBronze")
|
||||||
|
recipes += shaped(new ItemStack(itemPipe, 3, PipeMaterials.plastic.id), "BBB", " ", "BBB", 'B', UniversalRecipe.RUBBER.get)
|
||||||
|
recipes += shaped(new ItemStack(itemPipe, 3, PipeMaterials.iron.id), "BBB", " ", "BBB", 'B', Items.iron_ingot)
|
||||||
|
recipes += shaped(new ItemStack(itemPipe, 3, PipeMaterials.steel.id), "BBB", " ", "BBB", 'B', "ingotSteel")
|
||||||
|
recipes += shaped(new ItemStack(itemPipe, 3, PipeMaterials.fiberglass.id), "BBB", " ", "BBB", 'B', Items.diamond)
|
||||||
|
|
||||||
|
recipes += shaped(blockMechanicalPiston, "SGS", "SPS", "SRS", 'P', Blocks.piston, 'S', Items.iron_ingot, 'R', Items.redstone, 'G', new ItemStack(itemGear, 1, 2))
|
||||||
|
recipes += shaped(blockGrinderWheel, "III", "LGL", "III", 'I', UniversalRecipe.PRIMARY_METAL.get, 'L', "logWood", 'G', itemGear)
|
||||||
|
recipes += shaped(blockMixer, "IGI", "IGI", "IGI", 'I', UniversalRecipe.PRIMARY_METAL.get, 'G', itemGear)
|
||||||
|
recipes += shaped(blockTileBreaker, "CGC", "CPC", "CDC", 'C', Blocks.cobblestone, 'G', itemGear, 'P', Blocks.piston, 'D', Items.diamond_pickaxe)
|
||||||
|
recipes += shaped(blockTilePlacer, "CGC", "CSC", "CRC", 'C', Blocks.cobblestone, 'G', itemGear, 'S', Items.iron_ingot, 'R', Blocks.redstone_block)
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,188 +0,0 @@
|
||||||
package resonantinduction.mechanical;
|
|
||||||
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.init.Items;
|
|
||||||
import resonant.content.loader.ModManager;
|
|
||||||
import resonant.engine.content.debug.TileCreativeBuilder;
|
|
||||||
import resonant.lib.network.discriminator.PacketAnnotationManager;
|
|
||||||
import resonant.lib.schematic.SchematicPlate;
|
|
||||||
import resonantinduction.core.ResonantPartFactory$;
|
|
||||||
import resonantinduction.core.ResonantTab;
|
|
||||||
import resonantinduction.mechanical.fluid.pipe.PartPipe;
|
|
||||||
import resonantinduction.mechanical.mech.MechanicalNode;
|
|
||||||
import resonantinduction.mechanical.fluid.pipe.PipeMaterials;
|
|
||||||
import resonantinduction.mechanical.mech.gear.PartGear;
|
|
||||||
import resonantinduction.mechanical.mech.gearshaft.PartGearShaft;
|
|
||||||
import resonantinduction.mechanical.mech.turbine.*;
|
|
||||||
import resonantinduction.mechanical.fluid.pipe.ItemPipe;
|
|
||||||
import resonantinduction.mechanical.fluid.transport.TilePump;
|
|
||||||
import resonantinduction.mechanical.mech.gear.ItemGear;
|
|
||||||
import resonantinduction.mechanical.mech.gearshaft.ItemGearShaft;
|
|
||||||
import resonantinduction.mechanical.machine.TileDetector;
|
|
||||||
import resonantinduction.mechanical.mech.process.crusher.TileMechanicalPiston;
|
|
||||||
import resonantinduction.mechanical.machine.edit.TileBreaker;
|
|
||||||
import resonantinduction.mechanical.machine.edit.TilePlacer;
|
|
||||||
import resonantinduction.mechanical.mech.process.grinder.TileGrindingWheel;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
|
||||||
import resonant.lib.recipe.UniversalRecipe;
|
|
||||||
import resonantinduction.core.Reference;
|
|
||||||
import resonantinduction.core.interfaces.IMechanicalNode;
|
|
||||||
import resonantinduction.mechanical.mech.process.mixer.TileMixer;
|
|
||||||
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.NetworkRegistry;
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import universalelectricity.api.core.grid.NodeRegistry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resonant Induction Mechanical Module
|
|
||||||
*
|
|
||||||
* @author DarkCow, Calclavia
|
|
||||||
*/
|
|
||||||
@Mod(modid = Mechanical.ID, name = "Resonant Induction Mechanical", version = "", dependencies = "before:ThermalExpansion;required-after:ResonantInductionCore;after:ResonantInduction|Archaic")
|
|
||||||
public class Mechanical
|
|
||||||
{
|
|
||||||
/** Mod Information */
|
|
||||||
public static final String ID = "ResonantInduction|Mechanical";
|
|
||||||
public static final String NAME = Reference.name() + " Mechanical";
|
|
||||||
|
|
||||||
@Instance(ID)
|
|
||||||
public static Mechanical INSTANCE;
|
|
||||||
|
|
||||||
@SidedProxy(clientSide = "resonantinduction.mechanical.ClientProxy", serverSide = "resonantinduction.mechanical.CommonProxy")
|
|
||||||
public static CommonProxy proxy;
|
|
||||||
|
|
||||||
@Mod.Metadata(ID)
|
|
||||||
public static ModMetadata metadata;
|
|
||||||
|
|
||||||
public static final ModManager contentRegistry = new ModManager().setPrefix(Reference.prefix()).setTab(ResonantTab.tab());
|
|
||||||
|
|
||||||
// Energy
|
|
||||||
public static Item itemGear;
|
|
||||||
public static Item itemGearShaft;
|
|
||||||
public static Block blockWindTurbine;
|
|
||||||
public static Block blockWaterTurbine;
|
|
||||||
public static Block blockElectricTurbine;
|
|
||||||
|
|
||||||
// Transport
|
|
||||||
public static Block blockConveyorBelt;
|
|
||||||
public static Block blockManipulator;
|
|
||||||
public static Block blockDetector;
|
|
||||||
// public static Block blockRejector;
|
|
||||||
public static Block blockSorter;
|
|
||||||
|
|
||||||
// Fluids
|
|
||||||
public static Block blockReleaseValve;
|
|
||||||
public static Block blockPump;
|
|
||||||
public static Item itemPipe;
|
|
||||||
|
|
||||||
// Machines/Processes
|
|
||||||
public static Block blockGrinderWheel;
|
|
||||||
public static Block blockMixer;
|
|
||||||
public static Block blockMechanicalPiston;
|
|
||||||
|
|
||||||
// Block Breaker and Placer
|
|
||||||
public static Block blockTileBreaker;
|
|
||||||
public static Block blockTilePlacer;
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void preInit(FMLPreInitializationEvent evt)
|
|
||||||
{
|
|
||||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
|
||||||
MinecraftForge.EVENT_BUS.register(new MicroblockHighlightHandler());
|
|
||||||
TileCreativeBuilder.register(new SchematicPlate("schematic.waterTurbine.name", blockWaterTurbine));
|
|
||||||
TileCreativeBuilder.register(new SchematicPlate("schematic.windTurbine.name", blockWindTurbine));
|
|
||||||
TileCreativeBuilder.register(new SchematicPlate("schematic.electricTurbine.name", blockElectricTurbine));
|
|
||||||
NodeRegistry.register(IMechanicalNode.class, MechanicalNode.class);
|
|
||||||
|
|
||||||
itemGear = contentRegistry.newItem(ItemGear.class);
|
|
||||||
itemGearShaft = contentRegistry.newItem(ItemGearShaft.class);
|
|
||||||
itemPipe = contentRegistry.newItem(ItemPipe.class);
|
|
||||||
|
|
||||||
blockWindTurbine = contentRegistry.newBlock(TileWindTurbine.class);
|
|
||||||
blockWaterTurbine = contentRegistry.newBlock(TileWaterTurbine.class);
|
|
||||||
blockDetector = contentRegistry.newBlock(TileDetector.class);
|
|
||||||
blockPump = contentRegistry.newBlock(TilePump.class);
|
|
||||||
|
|
||||||
// Machines
|
|
||||||
blockGrinderWheel = contentRegistry.newBlock(TileGrindingWheel.class);
|
|
||||||
blockMixer = contentRegistry.newBlock(TileMixer.class);
|
|
||||||
blockMechanicalPiston = contentRegistry.newBlock(TileMechanicalPiston.class);
|
|
||||||
OreDictionary.registerOre("gear", itemGear);
|
|
||||||
|
|
||||||
blockTileBreaker = contentRegistry.newBlock(TileBreaker.class);
|
|
||||||
blockTilePlacer = contentRegistry.newBlock(TilePlacer.class);
|
|
||||||
|
|
||||||
//TODO disable if electrical module is not enabled
|
|
||||||
blockElectricTurbine = contentRegistry.newBlock(TileElectricTurbine.class);
|
|
||||||
|
|
||||||
proxy.preInit();
|
|
||||||
|
|
||||||
ResonantTab.itemStack(new ItemStack(blockGrinderWheel));
|
|
||||||
|
|
||||||
PacketAnnotationManager.INSTANCE.register(TileWindTurbine.class);
|
|
||||||
PacketAnnotationManager.INSTANCE.register(TileWaterTurbine.class);
|
|
||||||
|
|
||||||
ResonantPartFactory$.MODULE$.register(PartGear.class);
|
|
||||||
ResonantPartFactory$.MODULE$.register(PartGearShaft.class);
|
|
||||||
ResonantPartFactory$.MODULE$.register(PartPipe.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void init(FMLInitializationEvent evt)
|
|
||||||
{
|
|
||||||
proxy.init();
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void postInit(FMLPostInitializationEvent evt)
|
|
||||||
{
|
|
||||||
// Add recipes
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 0), "SWS", "W W", "SWS", 'W', "plankWood", 'S', Items.stick));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 1), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 0), 'W', Blocks.cobblestone));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 2), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 1), 'W', Items.iron_ingot));
|
|
||||||
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, 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(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(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, 1), "CWC", "WGW", "CWC", 'G', new ItemStack(blockWindTurbine, 1, 0), 'C', Blocks.stone, 'W', Items.stick));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWindTurbine, 1, 2), "CWC", "WGW", "CWC", 'G', new ItemStack(blockWindTurbine, 1, 1), 'C', Items.iron_ingot, 'W', Items.stick));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWaterTurbine, 1, 0), "SWS", "WGW", "SWS", 'G', itemGear, 'W', "plankWood", 'S', Items.stick));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWaterTurbine, 1, 1), "SWS", "WGW", "SWS", 'G', new ItemStack(blockWaterTurbine, 1, 0), 'W', Blocks.stone, 'S', Items.stick));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWaterTurbine, 1, 2), "SWS", "WGW", "SWS", 'G', new ItemStack(blockWaterTurbine, 1, 1), 'W', UniversalRecipe.PRIMARY_METAL.get(), 'S', Items.stick));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockElectricTurbine, " B ", "BMB", " B ", 'B', UniversalRecipe.SECONDARY_PLATE.get(), 'M', UniversalRecipe.MOTOR.get()));
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockPump, "PPP", "GGG", "PPP", 'P', itemPipe, 'G', new ItemStack(itemGear, 1, 2)));
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 3, PipeMaterials.ceramic().id()), "BBB", " ", "BBB", 'B', Items.brick));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 3, PipeMaterials.bronze().id()), "BBB", " ", "BBB", 'B', "ingotBronze"));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 3, PipeMaterials.plastic().id()), "BBB", " ", "BBB", 'B', UniversalRecipe.RUBBER.get()));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 3, PipeMaterials.iron().id()), "BBB", " ", "BBB", 'B', Items.iron_ingot));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 3, PipeMaterials.steel().id()), "BBB", " ", "BBB", 'B', "ingotSteel"));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 3, PipeMaterials.fiberglass().id()), "BBB", " ", "BBB", 'B', Items.diamond));
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockMechanicalPiston, "SGS", "SPS", "SRS", 'P', Blocks.piston, 'S', Items.iron_ingot, 'R', Items.redstone, 'G', new ItemStack(itemGear, 1, 2)));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockGrinderWheel, "III", "LGL", "III", 'I', UniversalRecipe.PRIMARY_METAL.get(), 'L', "logWood", 'G', itemGear));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockMixer, "IGI", "IGI", "IGI", 'I', UniversalRecipe.PRIMARY_METAL.get(), 'G', itemGear));
|
|
||||||
|
|
||||||
// block break and placer recipes
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockTileBreaker, "CGC", "CPC", "CDC", 'C', Blocks.cobblestone, 'G', itemGear, 'P', Blocks.piston, 'D', Items.diamond_pickaxe));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockTilePlacer, "CGC", "CSC", "CRC", 'C', Blocks.cobblestone, 'G', itemGear, 'S', Items.iron_ingot, 'R', Blocks.redstone_block));
|
|
||||||
}
|
|
||||||
}
|
|
79
src/main/scala/resonantinduction/mechanical/Mechanical.scala
Normal file
79
src/main/scala/resonantinduction/mechanical/Mechanical.scala
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
package resonantinduction.mechanical
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Mod.EventHandler
|
||||||
|
import cpw.mods.fml.common.event.{FMLInitializationEvent, FMLPostInitializationEvent, FMLPreInitializationEvent}
|
||||||
|
import cpw.mods.fml.common.network.NetworkRegistry
|
||||||
|
import cpw.mods.fml.common.{Mod, ModMetadata, SidedProxy}
|
||||||
|
import net.minecraft.item.ItemStack
|
||||||
|
import net.minecraftforge.common.MinecraftForge
|
||||||
|
import resonant.engine.content.debug.TileCreativeBuilder
|
||||||
|
import resonant.lib.loadable.LoadableHandler
|
||||||
|
import resonant.lib.network.discriminator.PacketAnnotationManager
|
||||||
|
import resonant.lib.schematic.SchematicPlate
|
||||||
|
import resonantinduction.core.interfaces.IMechanicalNode
|
||||||
|
import resonantinduction.core.{Reference, ResonantPartFactory, ResonantTab}
|
||||||
|
import resonantinduction.mechanical.fluid.pipe.PartPipe
|
||||||
|
import resonantinduction.mechanical.mech.MechanicalNode
|
||||||
|
import resonantinduction.mechanical.mech.gear.PartGear
|
||||||
|
import resonantinduction.mechanical.mech.gearshaft.PartGearShaft
|
||||||
|
import resonantinduction.mechanical.mech.turbine._
|
||||||
|
import universalelectricity.api.core.grid.NodeRegistry
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resonant Induction Mechanical Module
|
||||||
|
*
|
||||||
|
* @author DarkCow, Calclavia
|
||||||
|
*/
|
||||||
|
@Mod(modid = Mechanical.ID, name = "Resonant Induction Mechanical", version = "", modLanguage = "scala", dependencies = "before:ThermalExpansion;required-after:ResonantInductionCore;after:ResonantInduction|Archaic") object Mechanical
|
||||||
|
{
|
||||||
|
/** Mod Information */
|
||||||
|
final val ID: String = "ResonantInduction|Mechanical"
|
||||||
|
final val NAME: String = Reference.name + " Mechanical"
|
||||||
|
|
||||||
|
@SidedProxy(clientSide = "resonantinduction.mechanical.ClientProxy", serverSide = "resonantinduction.mechanical.CommonProxy")
|
||||||
|
var proxy: CommonProxy = null
|
||||||
|
|
||||||
|
@Mod.Metadata(ID)
|
||||||
|
var metadata: ModMetadata = null
|
||||||
|
|
||||||
|
val loadables = new LoadableHandler
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
def preInit(evt: FMLPreInitializationEvent)
|
||||||
|
{
|
||||||
|
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy)
|
||||||
|
MinecraftForge.EVENT_BUS.register(new MicroblockHighlightHandler)
|
||||||
|
|
||||||
|
loadables.applyModule(proxy)
|
||||||
|
loadables.applyModule(MechContent)
|
||||||
|
|
||||||
|
TileCreativeBuilder.register(new SchematicPlate("schematic.waterTurbine.name", MechContent.blockWaterTurbine))
|
||||||
|
TileCreativeBuilder.register(new SchematicPlate("schematic.windTurbine.name", MechContent.blockWindTurbine))
|
||||||
|
TileCreativeBuilder.register(new SchematicPlate("schematic.electricTurbine.name", MechContent.blockElectricTurbine))
|
||||||
|
|
||||||
|
NodeRegistry.register(classOf[IMechanicalNode], classOf[MechanicalNode])
|
||||||
|
|
||||||
|
ResonantTab.itemStack(new ItemStack(MechContent.blockGrinderWheel))
|
||||||
|
|
||||||
|
PacketAnnotationManager.INSTANCE.register(classOf[TileWindTurbine])
|
||||||
|
PacketAnnotationManager.INSTANCE.register(classOf[TileWaterTurbine])
|
||||||
|
|
||||||
|
ResonantPartFactory.register(classOf[PartGear])
|
||||||
|
ResonantPartFactory.register(classOf[PartGearShaft])
|
||||||
|
ResonantPartFactory.register(classOf[PartPipe])
|
||||||
|
|
||||||
|
loadables.preInit()
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
def init(evt: FMLInitializationEvent)
|
||||||
|
{
|
||||||
|
loadables.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
def postInit(evt: FMLPostInitializationEvent)
|
||||||
|
{
|
||||||
|
loadables.postInit()
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue