Soul binder is a go!

This commit is contained in:
CrazyPants committed 2014-08-31 01:46:51 +08:00
1 parent f782626786
commit 88b3daf5a2
14 files changed
+62 -44

No files matched your search

@@ -93,7 +93,7 @@ import crazypants.enderio.machine.painter.BlockPainter;
import crazypants.enderio.machine.power.BlockCapacitorBank;
import crazypants.enderio.machine.reservoir.BlockReservoir;
import crazypants.enderio.machine.solar.BlockSolarPanel;
import crazypants.enderio.machine.soul.BlockSoulFuser;
import crazypants.enderio.machine.soul.BlockSoulBinder;
import crazypants.enderio.machine.spawner.BlockPoweredSpawner;
import crazypants.enderio.machine.spawner.ItemBrokenSpawner;
import crazypants.enderio.machine.still.BlockVat;
@@ -197,7 +197,7 @@ public class EnderIO {
public static BlockCrafter blockCrafter;
public static BlockPoweredSpawner blockPoweredSpawner;
public static ItemBrokenSpawner itemBrokenSpawner;
public static BlockSoulFuser blockSoulFuser;
public static BlockSoulBinder blockSoulFuser;
public static BlockKillerJoe blockKillerJoe;
@@ -306,7 +306,7 @@ public class EnderIO {
blockPoweredSpawner = BlockPoweredSpawner.create();
itemBrokenSpawner = ItemBrokenSpawner.create();
blockSoulFuser = BlockSoulFuser.create();
blockSoulFuser = BlockSoulBinder.create();
itemRedstoneConduit = ItemRedstoneConduit.create();
itemPowerConduit = ItemPowerConduit.create();
@@ -43,7 +43,7 @@ public class GuiHandler implements IGuiHandler {
public static final int GUI_ID_WIRELESS_CHARGER = 90;
public static final int GUI_ID_ENCHANTER = 91;
public static final int GUI_ID_KILLER_JOE = 92;
public static final int GUI_ID_SOUL_FUSER = 93;
public static final int GUI_ID_SOUL_BINDER = 93;
protected final Map<Integer, IGuiHandler> guiHandlers = new HashMap<Integer, IGuiHandler>();
@@ -51,7 +51,7 @@ public enum ModObject {
blockVacuumChest,
blockWirelessCharger,
blockEnchanter,
blockSoulFuser,
blockSoulBinder,
blockPoweredSpawner,
itemBrokenSpawner,
@@ -57,6 +57,7 @@ public final class Config {
public static final Section sectionFluid = new Section("Fluid Settings", "fluid");
public static final Section sectionSpawner = new Section("PoweredSpawner Settings", "spawner");
public static final Section sectionKiller = new Section("Killer Joe Settings", "killerjoe");
public static final Section sectionSoulBinder = new Section("Soul Binder Settings", "soulBinder");
public static final double DEFAULT_CONDUIT_SCALE = 0.5;
@@ -257,10 +258,10 @@ public final class Config {
public static String[] soulVesselBlackList = new String[0];
public static boolean soulVesselCapturesBosses = false;
public static double soulFuserLevelOnePowerPerTick = 50;
public static double soulFuserLevelTwoPowerPerTick = 100;
public static double soulFuserLevelThreePowerPerTick = 200;
public static int soulFuserMjForBrokenSpawner = 250000;
public static double soulBinderLevelOnePowerPerTick = 50;
public static double soulBinderLevelTwoPowerPerTick = 100;
public static double soulBinderLevelThreePowerPerTick = 200;
public static int soulBinderMjForBrokenSpawner = 250000;
public static void load(FMLPreInitializationEvent event) {
@@ -686,11 +687,21 @@ public final class Config {
isGasConduitEnabled = config.getString("isGasConduitEnabled", sectionItems.name, isGasConduitEnabled,
"Can be set to 'auto', 'true' or 'false'. When set to auto the gas conduit will only be enabled when Mekanism is installed.");
soulVesselBlackList = config.getStringList("soulVesselBlackList", sectionItems.name, soulVesselBlackList,
"Entities listed here will can not be captured in a 'Vessel of Souls'");
soulVesselBlackList = config.getStringList("soulVesselBlackList", sectionSoulBinder.name, soulVesselBlackList,
"Entities listed here will can not be captured in a Soul Vial");
soulVesselCapturesBosses = config.getBoolean("soulVesselCapturesBosses", sectionItems.name, soulVesselCapturesBosses,
"When set to false, any mob with a 'boss bar' won't be able to be captured in the 'Vessel of Souls'");
soulVesselCapturesBosses = config.getBoolean("soulVesselCapturesBosses", sectionSoulBinder.name, soulVesselCapturesBosses,
"When set to false, any mob with a 'boss bar' won't be able to be captured in the Soul Vial");
soulBinderLevelOnePowerPerTick = config.get(sectionSoulBinder.name, "soulBinderLevelOnePowerPerTick", soulBinderLevelOnePowerPerTick,
"The number of MJ/t consumed by an unupgraded soul binder.").getDouble(soulBinderLevelOnePowerPerTick);
soulBinderLevelTwoPowerPerTick = config.get(sectionSoulBinder.name, "soulBinderLevelTwoPowerPerTick", soulBinderLevelTwoPowerPerTick,
"The number of MJ/t consumed by a soul binder with a double layer capacitor upgrade.").getDouble(soulBinderLevelTwoPowerPerTick);
soulBinderLevelThreePowerPerTick = config.get(sectionSoulBinder.name, "soulBinderLevelThreePowerPerTick", soulBinderLevelThreePowerPerTick,
"The number of MJ/t consumed by a soul binder with an octadic capacitor upgrade.").getDouble(soulBinderLevelThreePowerPerTick);
soulBinderMjForBrokenSpawner = config.get(sectionSoulBinder.name, "soulBinderMjForBrokenSpawner", soulBinderMjForBrokenSpawner,
"The number of MJ required to change the type of a broken spawner.").getInt(soulBinderMjForBrokenSpawner);
}
private Config() {
@@ -18,30 +18,30 @@ import crazypants.enderio.machine.painter.PainterContainer;
import crazypants.enderio.machine.painter.TileEntityPainter;
import crazypants.enderio.network.PacketHandler;
public class BlockSoulFuser extends AbstractMachineBlock<TileSoulFuser> {
public class BlockSoulBinder extends AbstractMachineBlock<TileSoulBinder> {
public static BlockSoulFuser create() {
BlockSoulFuser result = new BlockSoulFuser();
public static BlockSoulBinder create() {
BlockSoulBinder result = new BlockSoulBinder();
result.init();
return result;
}
protected BlockSoulFuser() {
super(ModObject.blockSoulFuser, TileSoulFuser.class);
protected BlockSoulBinder() {
super(ModObject.blockSoulBinder, TileSoulBinder.class);
}
@Override
protected void init() {
super.init();
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSoulFuser.unlocalisedName, SoulFuserSpawnerRecipe.instance);
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSoulBinder.unlocalisedName, SoulBinderSpawnerRecipe.instance);
}
@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 TileSoulFuser) {
return new ContainerSoulFuser(player.inventory, (AbstractMachineEntity) te);
if(te instanceof TileSoulBinder) {
return new ContainerSoulBinder(player.inventory, (AbstractMachineEntity) te);
}
return null;
}
@@ -49,22 +49,22 @@ public class BlockSoulFuser extends AbstractMachineBlock<TileSoulFuser> {
@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 TileSoulFuser) {
return new GuiSoulFuser(player.inventory, (AbstractMachineEntity) te);
if(te instanceof TileSoulBinder) {
return new GuiSoulBinder(player.inventory, (AbstractMachineEntity) te);
}
return null;
}
@Override
protected int getGuiId() {
return GuiHandler.GUI_ID_SOUL_FUSER;
return GuiHandler.GUI_ID_SOUL_BINDER;
}
@Override
protected String getMachineFrontIconKey(boolean active) {
if(active) {
return "enderio:blockSoulFuserOn";
return "enderio:blockSoulBinderOn";
}
return "enderio:blockSoulFuser";
return "enderio:blockSoulBinder";
}
}
@@ -6,9 +6,9 @@ import net.minecraft.item.ItemStack;
import crazypants.enderio.machine.AbstractMachineContainer;
import crazypants.enderio.machine.AbstractMachineEntity;
public class ContainerSoulFuser extends AbstractMachineContainer {
public class ContainerSoulBinder extends AbstractMachineContainer {
public ContainerSoulFuser(InventoryPlayer playerInv, AbstractMachineEntity te) {
public ContainerSoulBinder(InventoryPlayer playerInv, AbstractMachineEntity te) {
super(playerInv, te);
}
@@ -10,12 +10,12 @@ import crazypants.enderio.machine.painter.PainterContainer;
import crazypants.render.RenderUtil;
import crazypants.vecmath.Vector4f;
public class GuiSoulFuser extends GuiMachineBase {
public class GuiSoulBinder extends GuiMachineBase {
private AbstractMachineEntity tileEntity;
public GuiSoulFuser(InventoryPlayer par1InventoryPlayer, AbstractMachineEntity te) {
super(te, new ContainerSoulFuser(par1InventoryPlayer, te));
public GuiSoulBinder(InventoryPlayer par1InventoryPlayer, AbstractMachineEntity te) {
super(te, new ContainerSoulBinder(par1InventoryPlayer, te));
tileEntity = te;
}
@@ -10,9 +10,9 @@ import crazypants.enderio.config.Config;
import crazypants.enderio.machine.IMachineRecipe;
import crazypants.enderio.machine.MachineRecipeInput;
public class SoulFuserSpawnerRecipe implements IMachineRecipe {
public class SoulBinderSpawnerRecipe implements IMachineRecipe {
public static SoulFuserSpawnerRecipe instance = new SoulFuserSpawnerRecipe();
public static SoulBinderSpawnerRecipe instance = new SoulBinderSpawnerRecipe();
@Override
public String getUid() {
@@ -21,7 +21,7 @@ public class SoulFuserSpawnerRecipe implements IMachineRecipe {
@Override
public float getEnergyRequired(MachineRecipeInput... inputs) {
return Config.soulFuserMjForBrokenSpawner;
return Config.soulBinderMjForBrokenSpawner;
}
@Override
@@ -79,7 +79,7 @@ public class SoulFuserSpawnerRecipe implements IMachineRecipe {
@Override
public String getMachineName() {
return ModObject.blockSoulFuser.unlocalisedName;
return ModObject.blockSoulBinder.unlocalisedName;
}
@Override
@@ -11,32 +11,32 @@ import crazypants.enderio.power.BasicCapacitor;
import crazypants.enderio.power.Capacitors;
import crazypants.enderio.power.PowerHandlerUtil;
public class TileSoulFuser extends AbstractPoweredTaskEntity {
public class TileSoulBinder extends AbstractPoweredTaskEntity {
public static final float POWER_PER_TICK_ONE = (float)Config.soulFuserLevelOnePowerPerTick;
public static final float POWER_PER_TICK_ONE = (float)Config.soulBinderLevelOnePowerPerTick;
private static final BasicCapacitor CAP_ONE = new BasicCapacitor((int) (POWER_PER_TICK_ONE * 1.25),
Capacitors.BASIC_CAPACITOR.capacitor.getMaxEnergyStored());
public static final float POWER_PER_TICK_TWO = (float)Config.soulFuserLevelTwoPowerPerTick;
public static final float POWER_PER_TICK_TWO = (float)Config.soulBinderLevelTwoPowerPerTick;
private static final BasicCapacitor CAP_TWO = new BasicCapacitor((int) (POWER_PER_TICK_TWO * 1.25),
Capacitors.ACTIVATED_CAPACITOR.capacitor.getMaxEnergyStored());
public static final float POWER_PER_TICK_THREE = (float)Config.soulFuserLevelThreePowerPerTick;
public static final float POWER_PER_TICK_THREE = (float)Config.soulBinderLevelThreePowerPerTick;
private static final BasicCapacitor CAP_THREE = new BasicCapacitor((int) (POWER_PER_TICK_THREE * 1.25),
Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored());
public TileSoulFuser() {
public TileSoulBinder() {
super(new SlotDefinition(2, 2, 1));
}
@Override
public String getMachineName() {
return ModObject.blockSoulFuser.unlocalisedName;
return ModObject.blockSoulBinder.unlocalisedName;
}
@Override
protected boolean isMachineItemValidForSlot(int slot, ItemStack item) {
return SoulFuserSpawnerRecipe.instance.isValidInput(new MachineRecipeInput(slot, item));
return SoulBinderSpawnerRecipe.instance.isValidInput(new MachineRecipeInput(slot, item));
}
public void setCapacitor(Capacitors capacitorType) {
@@ -10,6 +10,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.MobSpawnerBaseLogic;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.AnvilUpdateEvent;
@@ -157,7 +158,7 @@ public class BlockPoweredSpawner extends AbstractMachineBlock<TilePoweredSpawner
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
String type = getSpawnerTypeFromItemStack(itemstack);
if(type != null) {
list.add(type);
list.add(StatCollector.translateToLocal("entity." + type + ".name"));
} else {
list.add(Lang.localize("tile.blockPoweredSpawner.tooltip.empty", false));
}
@@ -8,6 +8,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -88,7 +89,7 @@ public class ItemBrokenSpawner extends Item {
if(par1ItemStack != null && par1ItemStack.stackTagCompound != null) {
String mobName = getMobTypeFromStack(par1ItemStack);
if(mobName != null) {
par3List.add(mobName);
par3List.add(StatCollector.translateToLocal("entity." + mobName + ".name"));
}
if(!TooltipAddera.instance.showAdvancedTooltips()) {
TooltipAddera.instance.addShowDetailsTooltip(par3List);