mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-27 23:45:55 +00:00
Slice'N and Splice'N
This commit is contained in:
1 parent
48cc9b4bd5
commit
05f7beb67f
20 files changed
+288
-62
No files matched your search
@@ -109,6 +109,7 @@ import crazypants.enderio.material.BlockFusedQuartz;
|
||||
import crazypants.enderio.material.BlockIngotStorage;
|
||||
import crazypants.enderio.material.ItemAlloy;
|
||||
import crazypants.enderio.material.ItemCapacitor;
|
||||
import crazypants.enderio.material.ItemFrankenSkull;
|
||||
import crazypants.enderio.material.ItemFusedQuartzFrame;
|
||||
import crazypants.enderio.material.ItemMachinePart;
|
||||
import crazypants.enderio.material.ItemMaterial;
|
||||
@@ -237,6 +238,7 @@ public class EnderIO {
|
||||
public static ItemMagnet itemMagnet;
|
||||
|
||||
public static ItemSoulVessel itemSoulVessel;
|
||||
public static ItemFrankenSkull itemFrankenSkull;
|
||||
|
||||
public static ItemDarkSteelArmor itemDarkSteelHelmet;
|
||||
public static ItemDarkSteelArmor itemDarkSteelChestplate;
|
||||
@@ -310,6 +312,9 @@ public class EnderIO {
|
||||
itemConduitFacade = ItemConduitFacade.create();
|
||||
|
||||
itemBrokenSpawner = ItemBrokenSpawner.create();
|
||||
|
||||
blockEndermanSkull = BlockEndermanSkull.create();
|
||||
itemFrankenSkull = ItemFrankenSkull.create();
|
||||
|
||||
itemRedstoneConduit = ItemRedstoneConduit.create();
|
||||
itemPowerConduit = ItemPowerConduit.create();
|
||||
@@ -389,8 +394,6 @@ public class EnderIO {
|
||||
itemDarkSteelPickaxe = ItemDarkSteelPickaxe.create();
|
||||
itemDarkSteelAxe = ItemDarkSteelAxe.create();
|
||||
|
||||
blockEndermanSkull = BlockEndermanSkull.create();
|
||||
|
||||
MaterialRecipes.registerOresInDictionary();
|
||||
|
||||
int entityID = EntityRegistry.findGlobalUniqueEntityId();
|
||||
|
||||
@@ -87,7 +87,8 @@ public enum ModObject {
|
||||
itemMagnet,
|
||||
itemGliderWing,
|
||||
blockEndermanSkull,
|
||||
itemSoulVessel;
|
||||
itemSoulVessel,
|
||||
itemFrankenSkull;
|
||||
|
||||
public final String unlocalisedName;
|
||||
|
||||
|
||||
@@ -271,6 +271,10 @@ public final class Config {
|
||||
public static int powerConduitTierTwoRF = 5120;
|
||||
public static int powerConduitTierThreeRF = 20480;
|
||||
|
||||
public static int sliceAndSpliceLevelOnePowerPerTickRF = 80;
|
||||
public static int sliceAndSpliceLevelTwoPowerPerTickRF = 160;
|
||||
public static int sliceAndSpliceLevelThreePowerPerTickRF = 320;
|
||||
|
||||
public static void load(FMLPreInitializationEvent event) {
|
||||
|
||||
FMLCommonHandler.instance().bus().register(new Config());
|
||||
@@ -724,6 +728,14 @@ public final class Config {
|
||||
"The number of RF/t consumed by a soul binder with an octadic capacitor upgrade.").getInt(soulBinderLevelThreePowerPerTickRF);
|
||||
soulBinderBrokenSpawnerRF = config.get(sectionSoulBinder.name, "soulBinderBrokenSpawnerRF", soulBinderBrokenSpawnerRF,
|
||||
"The number of RF required to change the type of a broken spawner.").getInt(soulBinderBrokenSpawnerRF);
|
||||
|
||||
sliceAndSpliceLevelOnePowerPerTickRF = config.get(sectionPower.name, "sliceAndSpliceLevelOnePowerPerTickRF", sliceAndSpliceLevelOnePowerPerTickRF,
|
||||
"The number of RF/t consumed by an unupgraded Slice'N'Splice").getInt(sliceAndSpliceLevelOnePowerPerTickRF);
|
||||
sliceAndSpliceLevelTwoPowerPerTickRF = config.get(sectionPower.name, "sliceAndSpliceLevelTwoPowerPerTickRF", sliceAndSpliceLevelTwoPowerPerTickRF,
|
||||
"The number of RF/t consumed by a Slice'N'Splice with a double layer capacitor upgrade.").getInt(sliceAndSpliceLevelTwoPowerPerTickRF);
|
||||
sliceAndSpliceLevelThreePowerPerTickRF = config.get(sectionPower.name, "sliceAndSpliceLevelThreePowerPerTickRF", sliceAndSpliceLevelThreePowerPerTickRF,
|
||||
"The number of RF/t consumed by a Slice'N'Splice with an octadic capacitor upgrade.").getInt(sliceAndSpliceLevelThreePowerPerTickRF);
|
||||
|
||||
}
|
||||
|
||||
private Config() {
|
||||
|
||||
@@ -280,6 +280,8 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
|
||||
public void setCapacitor(Capacitors capacitorType) {
|
||||
this.capacitorType = capacitorType;
|
||||
forceClientUpdate = true;
|
||||
//Force a check that the new value is in bounds
|
||||
setEnergyStored(getEnergyStored());
|
||||
}
|
||||
|
||||
public int getPowerUsePerTick() {
|
||||
|
||||
@@ -53,11 +53,11 @@ public class MachineRecipes {
|
||||
|
||||
//ZombieGen
|
||||
ItemStack zg = new ItemStack(EnderIO.blockZombieGenerator, 1, 0);
|
||||
GameRegistry.addShapedRecipe(zg, "eee", "qzq", "qcq", 'e', electricSteel, 'q', fusedQuartz, 'z', new ItemStack(Items.skull, 1, 2),'c', capacitor);
|
||||
GameRegistry.addShapedRecipe(zg, "eee", "qzq", "qqq", 'e', electricSteel, 'q', fusedQuartz, 'z', new ItemStack(EnderIO.itemFrankenSkull, 1, 0),'c', capacitor);
|
||||
|
||||
//KillerJoe
|
||||
ItemStack kj = new ItemStack(EnderIO.blockKillerJoe, 1, 0);
|
||||
GameRegistry.addShapedRecipe(kj, "sss", "qzq", "qqq", 's', darkSteel, 'q', fusedQuartz, 'z', new ItemStack(Items.skull, 1, 2));
|
||||
GameRegistry.addShapedRecipe(kj, "sss", "qzq", "qqq", 's', darkSteel, 'q', fusedQuartz, 'z', new ItemStack(EnderIO.itemFrankenSkull, 1, 1));
|
||||
|
||||
ItemStack wirelessCharger = new ItemStack(EnderIO.blockWirelessCharger);
|
||||
GameRegistry.addShapedRecipe(wirelessCharger, "svs", "imi", "scs", 's', electricSteel, 'i', silicon, 'm', machineChassi, 'c', capacitor3, 'v', vibCry);
|
||||
@@ -239,5 +239,10 @@ public class MachineRecipes {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(mJReader, "epe", "gcg", "srs", 'p', powerConduit, 'r', redstoneConduit, 'c', Items.comparator, 'g',
|
||||
Blocks.glass_pane, 's', "itemSilicon", 'e',
|
||||
electricalSteel));
|
||||
|
||||
//Slice'N'Splice
|
||||
ItemStack sns = new ItemStack(EnderIO.blockSliceAndSplice);
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(sns, "isi", "ams","ici", 'i', Items.iron_ingot, 'm', machineChassi, 's', "itemSkull", 'a', Items.iron_axe, 's', Items.shears, 'c', capacitor));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,41 @@
|
||||
package crazypants.enderio.machine.slicensplice;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.generator.stirling.TileEntityStirlingGenerator;
|
||||
import crazypants.enderio.machine.soul.BlockSoulBinder;
|
||||
import crazypants.enderio.machine.soul.ContainerSoulBinder;
|
||||
import crazypants.enderio.machine.soul.GuiSoulBinder;
|
||||
import crazypants.enderio.machine.soul.SoulBinderSpawnerRecipe;
|
||||
import crazypants.enderio.machine.soul.TileSoulBinder;
|
||||
import crazypants.vecmath.Vector3f;
|
||||
|
||||
public class BlockSliceAndSplice extends AbstractMachineBlock<TileSliceAndSplice> {
|
||||
|
||||
public static int renderId;
|
||||
|
||||
public static BlockSliceAndSplice create() {
|
||||
|
||||
public static BlockSliceAndSplice create() {
|
||||
BlockSliceAndSplice result = new BlockSliceAndSplice();
|
||||
result.init();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
protected BlockSliceAndSplice() {
|
||||
super(ModObject.blockSliceAndSplice, TileSliceAndSplice.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
@@ -54,22 +61,45 @@ public class BlockSliceAndSplice extends AbstractMachineBlock<TileSliceAndSplice
|
||||
|
||||
@Override
|
||||
protected String getMachineFrontIconKey(boolean active) {
|
||||
return "enderio:blankMachinePanel";
|
||||
if(active) {
|
||||
return "enderio:sliceAndSpliceFrontOn";
|
||||
}
|
||||
return "enderio:sliceAndSpliceFront";
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
TileSliceAndSplice te = (TileSliceAndSplice) world.getTileEntity(x, y, z);
|
||||
if(isActive(world, x, y, z) && te != null) {
|
||||
|
||||
ForgeDirection front = ForgeDirection.values()[te.facing];
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
double px = x + 0.5 + front.offsetX * 0.6;
|
||||
double pz = z + 0.5 + front.offsetZ * 0.6;
|
||||
double v = 0.05;
|
||||
double vx = 0;
|
||||
double vz = 0;
|
||||
|
||||
if(front == ForgeDirection.NORTH || front == ForgeDirection.SOUTH) {
|
||||
px += world.rand.nextFloat() * 0.9 - 0.45;
|
||||
vz += front == ForgeDirection.NORTH ? -v : v;
|
||||
} else {
|
||||
pz += world.rand.nextFloat() * 0.9 - 0.45;
|
||||
vx += front == ForgeDirection.WEST ? -v : v;
|
||||
}
|
||||
|
||||
EntityFX fx = Minecraft.getMinecraft().renderGlobal.doSpawnParticle("smoke", px, y + 0.5, pz, vx, 0, vz);
|
||||
if(fx != null) {
|
||||
fx.setRBGColorF(0.3f + (rand.nextFloat() * 0.1f), 0.1f + (rand.nextFloat() * 0.1f), 0.1f + (rand.nextFloat() * 0.1f));
|
||||
fx.motionX *= 0.25f;
|
||||
fx.motionY *= 0.25f;
|
||||
fx.motionZ *= 0.25f;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean renderAsNormalBlock() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isOpaqueCube() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getLightOpacity() {
|
||||
// return 7;
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -32,8 +32,8 @@ public class GuiSliceAndSplice extends GuiMachineBase {
|
||||
drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
int i1;
|
||||
|
||||
// i1 = tileEntity.getProgressScaled(24);
|
||||
// drawTexturedModalRect(k + 80, l + 34, 176, 14, i1 + 1, 16);
|
||||
i1 = tileEntity.getProgressScaled(24);
|
||||
drawTexturedModalRect(k + 101, l + 47, 176, 14, i1 + 1, 16);
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.AbstractPoweredTaskEntity;
|
||||
import crazypants.enderio.machine.IMachineRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
@@ -18,15 +19,36 @@ import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.enderio.machine.alloy.VanillaSmeltingRecipe;
|
||||
import crazypants.enderio.machine.recipe.ManyToOneMachineRecipe;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
|
||||
public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
|
||||
public static final int POWER_PER_TICK_ONE = Config.sliceAndSpliceLevelOnePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_ONE = new BasicCapacitor(POWER_PER_TICK_ONE * 2,
|
||||
Capacitors.BASIC_CAPACITOR.capacitor.getMaxEnergyStored(),
|
||||
POWER_PER_TICK_ONE);
|
||||
|
||||
public static final int POWER_PER_TICK_TWO = Config.sliceAndSpliceLevelTwoPowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_TWO = new BasicCapacitor(POWER_PER_TICK_TWO * 2,
|
||||
Capacitors.ACTIVATED_CAPACITOR.capacitor.getMaxEnergyStored(),
|
||||
POWER_PER_TICK_TWO);
|
||||
|
||||
public static final int POWER_PER_TICK_THREE = Config.sliceAndSpliceLevelThreePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_THREE = new BasicCapacitor(POWER_PER_TICK_THREE * 2,
|
||||
Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored(),
|
||||
POWER_PER_TICK_THREE);
|
||||
|
||||
private int axeIndex = 6;
|
||||
private int shearsIndex = 7;
|
||||
private EntityLivingBase fakePlayer;
|
||||
|
||||
private ICapacitor capacitor;
|
||||
|
||||
public TileSliceAndSplice() {
|
||||
super(new SlotDefinition(8, 1));
|
||||
capacitor = CAP_ONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,31 +57,73 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
public int getInventoryStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public void setCapacitor(Capacitors capacitorType) {
|
||||
switch (capacitorType) {
|
||||
case BASIC_CAPACITOR:
|
||||
capacitor = CAP_ONE;
|
||||
break;
|
||||
case ACTIVATED_CAPACITOR:
|
||||
capacitor = CAP_TWO;
|
||||
break;
|
||||
case ENDER_CAPACITOR:
|
||||
capacitor = CAP_THREE;
|
||||
break;
|
||||
default:
|
||||
capacitor = CAP_ONE;
|
||||
break;
|
||||
}
|
||||
super.setCapacitor(capacitorType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICapacitor getCapacitor() {
|
||||
return capacitor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPowerUsePerTick() {
|
||||
if(capacitorType.ordinal() == 0) {
|
||||
return POWER_PER_TICK_ONE;
|
||||
} else if(capacitorType.ordinal() == 1) {
|
||||
return POWER_PER_TICK_TWO;
|
||||
}
|
||||
return POWER_PER_TICK_THREE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProgressScaled(int scale) {
|
||||
int res = super.getProgressScaled(scale);
|
||||
if(currentTask != null) {
|
||||
res = Math.max(1, res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IMachineRecipe canStartNextTask(float chance) {
|
||||
if(getAxe() == null || getShears() == null) {
|
||||
return null;
|
||||
}
|
||||
return super.canStartNextTask(chance);
|
||||
}
|
||||
}
|
||||
|
||||
private ItemStack getAxe() {
|
||||
return inventory[axeIndex];
|
||||
}
|
||||
|
||||
|
||||
private ItemStack getShears() {
|
||||
return inventory[shearsIndex];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void taskComplete() {
|
||||
super.taskComplete();
|
||||
protected void taskComplete() {
|
||||
super.taskComplete();
|
||||
damageTool(getAxe(), axeIndex);
|
||||
damageTool(getShears(), shearsIndex);
|
||||
damageTool(getShears(), shearsIndex);
|
||||
}
|
||||
|
||||
private void damageTool(ItemStack tool, int toolIndex) {
|
||||
@@ -87,7 +151,7 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean isMachineItemValidForSlot(int slot, ItemStack itemstack) {
|
||||
if(itemstack == null || itemstack.getItem() == null) {
|
||||
@@ -95,19 +159,19 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
}
|
||||
if(!slotDefinition.isInputSlot(slot)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(slot == axeIndex) {
|
||||
return itemstack.getItem() instanceof ItemAxe;
|
||||
}
|
||||
if(slot == shearsIndex) {
|
||||
return itemstack.getItem() instanceof ItemShears;
|
||||
}
|
||||
|
||||
|
||||
ItemStack currentStackInSlot = inventory[slot];
|
||||
if(currentStackInSlot != null) {
|
||||
return currentStackInSlot.isItemEqual(itemstack);
|
||||
}
|
||||
|
||||
|
||||
int numSlotsFilled = 0;
|
||||
for (int i = slotDefinition.getMinInputSlot(); i <= slotDefinition.getMaxInputSlot(); i++) {
|
||||
if(i >= 0 && i < inventory.length && i != axeIndex && i != shearsIndex) {
|
||||
@@ -119,12 +183,12 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
List<IMachineRecipe> recipes = MachineRecipeRegistry.instance.getRecipesForInput(getMachineName(), MachineRecipeInput.create(slot, itemstack));
|
||||
if(numSlotsFilled == 0 && !recipes.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return isValidInputForAlloyRecipe(slot, itemstack, numSlotsFilled, recipes);
|
||||
}
|
||||
|
||||
private boolean isValidInputForAlloyRecipe(int slot, ItemStack itemstack, int numSlotsFilled, List<IMachineRecipe> recipes) {
|
||||
|
||||
|
||||
ItemStack[] resultInv = new ItemStack[slotDefinition.getNumInputSlots()];
|
||||
for (int i = slotDefinition.getMinInputSlot(); i <= slotDefinition.getMaxInputSlot(); i++) {
|
||||
if(i >= 0 && i < inventory.length && i != axeIndex && i != shearsIndex) {
|
||||
@@ -135,17 +199,17 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (IMachineRecipe recipe : recipes) {
|
||||
if(recipe instanceof ManyToOneMachineRecipe) {
|
||||
if(recipe instanceof ManyToOneMachineRecipe) {
|
||||
if(((ManyToOneMachineRecipe) recipe).isValidRecipeComponents(resultInv)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private boolean isItemAlreadyInASlot(ItemStack itemstack) {
|
||||
ItemStack currentStackType = null;
|
||||
for (int i = slotDefinition.getMinInputSlot(); i <= slotDefinition.getMaxInputSlot() && currentStackType == null; i++) {
|
||||
|
||||
@@ -16,16 +16,16 @@ import crazypants.enderio.power.PowerHandlerUtil;
|
||||
public class TileSoulBinder extends AbstractPoweredTaskEntity {
|
||||
|
||||
public static final int POWER_PER_TICK_ONE = Config.soulBinderLevelOnePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_ONE = new BasicCapacitor((int) (POWER_PER_TICK_ONE * 2),
|
||||
Capacitors.BASIC_CAPACITOR.capacitor.getMaxEnergyStored());
|
||||
private static final BasicCapacitor CAP_ONE = new BasicCapacitor(POWER_PER_TICK_ONE * 2,
|
||||
Capacitors.BASIC_CAPACITOR.capacitor.getMaxEnergyStored(), POWER_PER_TICK_ONE);
|
||||
|
||||
public static final int POWER_PER_TICK_TWO = Config.soulBinderLevelTwoPowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_TWO = new BasicCapacitor((int) (POWER_PER_TICK_TWO * 2),
|
||||
Capacitors.ACTIVATED_CAPACITOR.capacitor.getMaxEnergyStored());
|
||||
private static final BasicCapacitor CAP_TWO = new BasicCapacitor(POWER_PER_TICK_TWO * 2,
|
||||
Capacitors.ACTIVATED_CAPACITOR.capacitor.getMaxEnergyStored(), POWER_PER_TICK_TWO);
|
||||
|
||||
public static final int POWER_PER_TICK_THREE = Config.soulBinderLevelThreePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_THREE = new BasicCapacitor((int) (POWER_PER_TICK_THREE * 2),
|
||||
Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored());
|
||||
private static final BasicCapacitor CAP_THREE = new BasicCapacitor(POWER_PER_TICK_THREE * 2,
|
||||
Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored(), POWER_PER_TICK_THREE);
|
||||
|
||||
private ICapacitor capacitor;
|
||||
|
||||
@@ -44,8 +44,7 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity {
|
||||
return SoulBinderSpawnerRecipe.instance.isValidInput(new MachineRecipeInput(slot, item));
|
||||
}
|
||||
|
||||
public void setCapacitor(Capacitors capacitorType) {
|
||||
this.capacitorType = capacitorType;
|
||||
public void setCapacitor(Capacitors capacitorType) {
|
||||
switch (capacitorType) {
|
||||
case BASIC_CAPACITOR:
|
||||
capacitor = CAP_ONE;
|
||||
@@ -60,13 +59,9 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity {
|
||||
capacitor = CAP_ONE;
|
||||
break;
|
||||
}
|
||||
//Force a check that the new value is in bounds
|
||||
setEnergyStored(getEnergyStored());
|
||||
forceClientUpdate = true;
|
||||
super.setCapacitor(capacitorType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ICapacitor getCapacitor() {
|
||||
return capacitor;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
public enum FrankenSkull {
|
||||
|
||||
ZOMBIE_ELECTRODE("skullZombieElectrode"),
|
||||
ZOMBIE_CONTROLLER("skullZombieController");
|
||||
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
|
||||
private FrankenSkull(String unlocalisedName) {
|
||||
this.unlocalisedName = unlocalisedName;
|
||||
this.iconKey = "enderio:" + unlocalisedName;
|
||||
}
|
||||
|
||||
public String getUnlocalisedName() {
|
||||
return unlocalisedName;
|
||||
}
|
||||
|
||||
public String getIconKey() {
|
||||
return iconKey;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class ItemFrankenSkull extends Item {
|
||||
|
||||
private final IIcon[] icons;
|
||||
|
||||
public static ItemFrankenSkull create() {
|
||||
ItemFrankenSkull alloy = new ItemFrankenSkull();
|
||||
alloy.init();
|
||||
return alloy;
|
||||
}
|
||||
|
||||
private ItemFrankenSkull() {
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName(ModObject.itemFrankenSkull.unlocalisedName);
|
||||
icons = new IIcon[FrankenSkull.values().length];
|
||||
}
|
||||
|
||||
private void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemFrankenSkull.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, icons.length - 1);
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
for (int i = 0; i < icons.length; i++) {
|
||||
icons[i] = IIconRegister.registerIcon(FrankenSkull.values()[i].iconKey);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, FrankenSkull.values().length - 1);
|
||||
return FrankenSkull.values()[i].unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < FrankenSkull.values().length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public enum Capacitors {
|
||||
"activatedCapacitor"),
|
||||
|
||||
ENDER_CAPACITOR(
|
||||
new BasicCapacitor(400, 1000000, 100),
|
||||
new BasicCapacitor(400, 500000, 100),
|
||||
"enderCapacitor");
|
||||
|
||||
public final ICapacitor capacitor;
|
||||
|
||||
Reference in new issue
Block a user