mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-11-17 10:55:07 +00:00
add recipe
This commit is contained in:
1 parent
a71ef8c51a
commit
54346a8719
5 files changed
+64
-16
No files matched your search
@@ -70,7 +70,8 @@ public class TilePatternInterface extends AENetworkInvTile implements IGridTicka
|
||||
private final boolean[] workStarted = new boolean[9];
|
||||
|
||||
public TilePatternInterface() {
|
||||
this.gridInv = new AppEngInternalInventory(this, 9 + 1, 1);
|
||||
this.gridInv = new AppEngInternalInventory(this, 9 + 1 );
|
||||
this.gridInv.setMaxStackSize(1);
|
||||
this.patterns = new AppEngInternalInventory(this, 9);
|
||||
this.ejectInv = new AppEngInternalInventory(this, 9);
|
||||
this.craftingList = new ArrayList<>();
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
public class ClientProxy extends CommonProxy {
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
ClientCommandHandler.instance.registerCommand(new NEECommands());
|
||||
FMLCommonHandler.instance().bus().register(GuiEventHandler.instance);
|
||||
MinecraftForge.EVENT_BUS.register(GuiEventHandler.instance);
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.github.vfyjxf.nee.proxy;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IMaterials;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.core.features.ActivityState;
|
||||
import appeng.core.features.BlockStackSrc;
|
||||
import appeng.tile.AEBaseTile;
|
||||
@@ -9,15 +15,20 @@ import com.github.vfyjxf.nee.block.tile.TilePatternInterface;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import static com.github.vfyjxf.nee.block.BlockPatternInterface.BLOCK_INSTANCE;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
public void init(FMLInitializationEvent event) {
|
||||
AEBaseTile.registerTileItem(TilePatternInterface.class,
|
||||
new BlockStackSrc(BlockPatternInterface.BLOCK_INSTANCE, 0, ActivityState.Enabled));
|
||||
new BlockStackSrc(BLOCK_INSTANCE, 0, ActivityState.Enabled));
|
||||
registerRecipe();
|
||||
}
|
||||
|
||||
public void preInit(FMLPreInitializationEvent event){
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
registerBlocks();
|
||||
registerItems();
|
||||
registerTileEntities();
|
||||
@@ -28,11 +39,46 @@ public class CommonProxy {
|
||||
}
|
||||
|
||||
public void registerBlocks() {
|
||||
GameRegistry.registerBlock(BlockPatternInterface.BLOCK_INSTANCE, null,"tile.pattern_interface");
|
||||
GameRegistry.registerBlock(BLOCK_INSTANCE, null, "tile.pattern_interface");
|
||||
}
|
||||
|
||||
public void registerTileEntities() {
|
||||
GameRegistry.registerTileEntity(TilePatternInterface.class, NotEnoughEnergistics.MODID + "." + "tile.pattern_interface");
|
||||
}
|
||||
|
||||
public void registerRecipe() {
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
final IMaterials materials = definitions.materials();
|
||||
final IParts parts = definitions.parts();
|
||||
final IBlocks blocks = definitions.blocks();
|
||||
|
||||
ItemStack blankPattern = null;
|
||||
ItemStack patternTerm = null;
|
||||
ItemStack meInterface = null;
|
||||
ItemStack monitor = null;
|
||||
ItemStack cableSmart = parts.cableSmart().stack(AEColor.Transparent, 1);
|
||||
if (materials.blankPattern().maybeStack(1).isPresent()) {
|
||||
blankPattern = materials.blankPattern().maybeStack(1).get();
|
||||
}
|
||||
if (parts.patternTerminal().maybeStack(1).isPresent()) {
|
||||
patternTerm = parts.patternTerminal().maybeStack(1).get();
|
||||
}
|
||||
if (blocks.iface().maybeStack(1).isPresent()) {
|
||||
meInterface = blocks.iface().maybeStack(1).get();
|
||||
}
|
||||
if (blocks.craftingMonitor().maybeStack(1).isPresent()) {
|
||||
monitor = blocks.craftingMonitor().maybeStack(1).get();
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(BLOCK_INSTANCE,
|
||||
"aba", "cdc", "eee",
|
||||
'a', blankPattern,
|
||||
'b', patternTerm,
|
||||
'c', meInterface,
|
||||
'd', monitor,
|
||||
'e', cableSmart
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
public class ServerProxy extends CommonProxy {
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
// NO-OP
|
||||
super.init(event);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user