Added recipe and GUI for powered spawner.

This commit is contained in:
CrazyPants committed 2014-06-17 20:19:56 +08:00
1 parent db8b914ca6
commit 2ab6085489
7 files changed
+71 -5

No files matched your search

@@ -4,11 +4,13 @@ import static crazypants.enderio.ModObject.*;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadePainterRecipe;
import crazypants.enderio.machine.MachineRecipeRegistry;
import crazypants.enderio.machine.recipe.OreDictionaryRecipeInput;
import crazypants.enderio.material.Alloy;
import crazypants.enderio.material.BlockFusedQuartz;
import crazypants.enderio.material.Material;
@@ -58,9 +60,10 @@ public class ConduitRecipes {
GameRegistry.addShapedRecipe(basicFilter, " p ","php"," p ", 'p', Items.paper, 'h', Blocks.hopper);
ItemStack advFilter = new ItemStack(EnderIO.itemBasicFilterUpgrade, 1, 1);
GameRegistry.addShapedRecipe(advFilter, "rpr","php","rpr", 'p', Items.paper, 'h', new ItemStack(Items.skull, 1, 0), 'r', Items.redstone);
GameRegistry.addShapedRecipe(advFilter, "rpr","php","rpr", 'p', Items.paper, 'h', new ItemStack(Items.skull, 1, 2), 'r', Items.redstone);
GameRegistry.addShapedRecipe(advFilter, "rpr","php","rpr", 'p', Items.paper, 'h', new ItemStack(Items.skull, 1, 4), 'r', Items.redstone);
// GameRegistry.addShapedRecipe(advFilter, "rpr","php","rpr", 'p', Items.paper, 'h', new ItemStack(Items.skull, 1, 0), 'r', Items.redstone);
// GameRegistry.addShapedRecipe(advFilter, "rpr","php","rpr", 'p', Items.paper, 'h', new ItemStack(Items.skull, 1, 2), 'r', Items.redstone);
// GameRegistry.addShapedRecipe(advFilter, "rpr","php","rpr", 'p', Items.paper, 'h', new ItemStack(Items.skull, 1, 4), 'r', Items.redstone);
GameRegistry.addRecipe(new ShapedOreRecipe(advFilter, "rpr","php","rpr", 'p', Items.paper, 'h', "itemSkull", 'r', Items.redstone));
ItemStack exFilt = new ItemStack(EnderIO.itemExistingItemFilter);
GameRegistry.addShapedRecipe(exFilt, "rpr","pcp","rpr", 'p', Items.paper, 'c', new ItemStack(Items.comparator, 1, 0), 'r', Items.redstone);
@@ -30,7 +30,7 @@ public class MachineRecipes {
ItemStack machineChassi = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.MACHINE_CHASSI.ordinal());
ItemStack silicon = new ItemStack(EnderIO.itemMaterial, 1, Material.SILICON.ordinal());
ItemStack pulCry = new ItemStack(EnderIO.itemMaterial, 1, Material.PULSATING_CYSTAL.ordinal());
ItemStack vidCry = new ItemStack(EnderIO.itemMaterial, 1, Material.VIBRANT_CYSTAL.ordinal());
ItemStack vibCry = new ItemStack(EnderIO.itemMaterial, 1, Material.VIBRANT_CYSTAL.ordinal());
ItemStack electricSteel = new ItemStack(EnderIO.itemAlloy,1,Alloy.ELECTRICAL_STEEL.ordinal());
ItemStack darkSteel = new ItemStack(EnderIO.itemAlloy, 1, Alloy.DARK_STEEL.ordinal());
ItemStack phasedGold = new ItemStack(EnderIO.itemAlloy, 1, Alloy.PHASED_GOLD.ordinal());
@@ -57,6 +57,10 @@ public class MachineRecipes {
ItemStack crafter = new ItemStack(EnderIO.blockCrafter, 1, 0);
GameRegistry.addShapedRecipe(crafter, "iti", "imi", "ici", 'i', Items.iron_ingot, 't', Blocks.crafting_table, 'm', machineChassi, 'c', capacitor);
//Powered Spawner
ItemStack poweredSpawner = new ItemStack(EnderIO.blockPoweredSpawner);
GameRegistry.addRecipe(new ShapedOreRecipe(poweredSpawner, "ese","eme","vcv",'e', electricSteel, 's', "itemSkull", 'v', vibCry,'m',machineChassi, 'c', capacitor));
//reservoir
ItemStack reservoir = new ItemStack(EnderIO.blockReservoir, 2, 0);
Object glassSides;
@@ -112,7 +116,7 @@ public class MachineRecipes {
} else {
GameRegistry.addRecipe(new ShapedOreRecipe(solarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', "glassHardened", 'p', silicon, 'e',
energeticAlloy, 'c', electricSteel));
GameRegistry.addRecipe(new ShapedOreRecipe(advSolarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', enlightedQuartz, 'p', vidCry, 'e',
GameRegistry.addRecipe(new ShapedOreRecipe(advSolarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', enlightedQuartz, 'p', vibCry, 'e',
phasedGold, 'c', phasedIron));
}
}
@@ -133,11 +133,19 @@ public class BlockPoweredSpawner extends AbstractMachineBlock<TilePoweredSpawner
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof TilePoweredSpawner) {
return new ContainerPoweredSpawner(player.inventory, (TilePoweredSpawner)te);
}
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof TilePoweredSpawner) {
return new GuiPoweredSpawner(player.inventory, (TilePoweredSpawner)te);
}
return null;
}
@@ -0,0 +1,18 @@
package crazypants.enderio.machine.spawner;
import net.minecraft.entity.player.InventoryPlayer;
import crazypants.enderio.machine.AbstractMachineContainer;
import crazypants.enderio.machine.AbstractMachineEntity;
public class ContainerPoweredSpawner extends AbstractMachineContainer {
public ContainerPoweredSpawner(InventoryPlayer playerInv, AbstractMachineEntity te) {
super(playerInv, te);
}
@Override
protected void addMachineSlots(InventoryPlayer playerInv) {
}
}
@@ -0,0 +1,29 @@
package crazypants.enderio.machine.spawner;
import org.lwjgl.opengl.GL11;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import crazypants.enderio.machine.AbstractMachineEntity;
import crazypants.enderio.machine.GuiMachineBase;
import crazypants.render.RenderUtil;
public class GuiPoweredSpawner extends GuiMachineBase {
public GuiPoweredSpawner(InventoryPlayer par1InventoryPlayer, TilePoweredSpawner te) {
super(te, new ContainerPoweredSpawner(par1InventoryPlayer, te));
}
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
RenderUtil.bindTexture("enderio:textures/gui/poweredSpawner.png");
int sx = (width - xSize) / 2;
int sy = (height - ySize) / 2;
drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
}
}
@@ -45,6 +45,10 @@ public class MaterialRecipes {
ItemStack pureGlass = new ItemStack(EnderIO.blockFusedQuartz, 1, BlockFusedQuartz.Type.GLASS.ordinal());
OreDictionary.registerOre("glass", pureGlass);
OreDictionary.registerOre("glassHardened", new ItemStack(EnderIO.blockFusedQuartz, 1, BlockFusedQuartz.Type.FUSED_QUARTZ.ordinal()));
//Skulls
ItemStack skull = new ItemStack(Items.skull, 1, OreDictionary.WILDCARD_VALUE);
OreDictionary.registerOre("itemSkull", skull);
//Glass stuff for compatability
GameRegistry.addShapedRecipe(new ItemStack(Blocks.glass_pane,16,0), " ", "eee", "eee", 'e', pureGlass);