Cleanup
This commit is contained in:
parent
081698c6f9
commit
fa1bb906d3
7 changed files with 111 additions and 164 deletions
|
@ -19,6 +19,10 @@ public class NBTHolder {
|
||||||
public static final String NBT_RUNNING = "isRunning";
|
public static final String NBT_RUNNING = "isRunning";
|
||||||
public static final String NBT_RUNTIME = "runtime";
|
public static final String NBT_RUNTIME = "runtime";
|
||||||
public static final String NBT_REAGENTTANK = "reagentTanks";
|
public static final String NBT_REAGENTTANK = "reagentTanks";
|
||||||
|
public static final String NBT_ALTAR_TIER = "upgradeLevel";
|
||||||
|
public static final String NBT_ALTAR_ACTIVE = "isActive";
|
||||||
|
public static final String NBT_ALTAR_LIQUID_REQ = "liquidRequired";
|
||||||
|
public static final String NBT_ALTAR_FILLABLE = "canBeFilled";
|
||||||
|
|
||||||
public static ItemStack checkNBT(ItemStack stack) {
|
public static ItemStack checkNBT(ItemStack stack) {
|
||||||
if (stack.getTagCompound() == null)
|
if (stack.getTagCompound() == null)
|
||||||
|
|
|
@ -8,9 +8,10 @@ import javax.annotation.Nullable;
|
||||||
@Getter
|
@Getter
|
||||||
public class AltarRecipe {
|
public class AltarRecipe {
|
||||||
|
|
||||||
public final int minTier, syphon, consumeRate, drainRate;
|
public final int syphon, consumeRate, drainRate;
|
||||||
public final boolean useTag;
|
public final boolean useTag;
|
||||||
public final ItemStack input, output;
|
public final ItemStack input, output;
|
||||||
|
public final EnumAltarTier minTier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows creation of a recipe for the {@link WayofTime.bloodmagic.block.BlockAltar} / {@link WayofTime.bloodmagic.tile.TileAltar}.
|
* Allows creation of a recipe for the {@link WayofTime.bloodmagic.block.BlockAltar} / {@link WayofTime.bloodmagic.tile.TileAltar}.
|
||||||
|
@ -24,7 +25,7 @@ public class AltarRecipe {
|
||||||
* @param drainRate - The rate at which LP is drained during crafting
|
* @param drainRate - The rate at which LP is drained during crafting
|
||||||
* @param useTag -
|
* @param useTag -
|
||||||
*/
|
*/
|
||||||
public AltarRecipe(ItemStack input, @Nullable ItemStack output, int minTier, int syphon, int consumeRate, int drainRate, boolean useTag) {
|
public AltarRecipe(ItemStack input, @Nullable ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean useTag) {
|
||||||
this.input = input;
|
this.input = input;
|
||||||
this.output = output;
|
this.output = output;
|
||||||
this.minTier = minTier;
|
this.minTier = minTier;
|
||||||
|
@ -34,11 +35,11 @@ public class AltarRecipe {
|
||||||
this.useTag = useTag;
|
this.useTag = useTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AltarRecipe(ItemStack input, ItemStack output, int minTier, int syphon, int consumeRate, int drainRate) {
|
public AltarRecipe(ItemStack input, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) {
|
||||||
this(input, output, minTier, syphon, consumeRate, drainRate, false);
|
this(input, output, minTier, syphon, consumeRate, drainRate, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AltarRecipe (ItemStack input, int minTier, int consumeRate, int drainRate) {
|
public AltarRecipe (ItemStack input, EnumAltarTier minTier, int consumeRate, int drainRate) {
|
||||||
this(input, null, minTier, 0, consumeRate, drainRate);
|
this(input, null, minTier, 0, consumeRate, drainRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
package WayofTime.bloodmagic.api.altar;
|
package WayofTime.bloodmagic.api.altar;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class AltarUpgrade {
|
public class AltarUpgrade {
|
||||||
|
|
||||||
private int speedCount;
|
private int speedCount;
|
||||||
private int efficiencyCount;
|
private int efficiencyCount;
|
||||||
private int sacrificeCount;
|
private int sacrificeCount;
|
||||||
|
@ -14,23 +19,6 @@ public class AltarUpgrade {
|
||||||
private int betterCapacityCount;
|
private int betterCapacityCount;
|
||||||
private int accelerationCount;
|
private int accelerationCount;
|
||||||
|
|
||||||
public AltarUpgrade() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public AltarUpgrade(int speedCount, int efficiencyCount, int sacrificeCount, int selfSacrificeCount, int displacementCount, int capacityCount, int orbCapacityCount, int betterCapacityCount, int accelerationCount)
|
|
||||||
{
|
|
||||||
this.speedCount = speedCount;
|
|
||||||
this.efficiencyCount = efficiencyCount;
|
|
||||||
this.sacrificeCount = sacrificeCount;
|
|
||||||
this.selfSacrificeCount = selfSacrificeCount;
|
|
||||||
this.displacementCount = displacementCount;
|
|
||||||
this.capacityCount = capacityCount;
|
|
||||||
this.orbCapacityCount = orbCapacityCount;
|
|
||||||
this.betterCapacityCount = betterCapacityCount;
|
|
||||||
this.accelerationCount = accelerationCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adders
|
// Adders
|
||||||
|
|
||||||
public AltarUpgrade addSpeed() {
|
public AltarUpgrade addSpeed() {
|
||||||
|
@ -77,5 +65,4 @@ public class AltarUpgrade {
|
||||||
accelerationCount++;
|
accelerationCount++;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ public interface IBloodAltar {
|
||||||
|
|
||||||
int getCurrentBlood();
|
int getCurrentBlood();
|
||||||
|
|
||||||
int getTier();
|
EnumAltarTier getTier();
|
||||||
|
|
||||||
int getProgress();
|
int getProgress();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
package WayofTime.bloodmagic.api.iface;
|
package WayofTime.bloodmagic.api.iface;
|
||||||
|
|
||||||
public interface IAltarReader
|
public interface IAltarReader {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,7 @@ import net.minecraft.util.ChatComponentText;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemSigilDivination extends ItemSigilBase implements ISigil, IAltarReader
|
public class ItemSigilDivination extends ItemSigilBase implements ISigil, IAltarReader {
|
||||||
{
|
|
||||||
|
|
||||||
public ItemSigilDivination() {
|
public ItemSigilDivination() {
|
||||||
super("divination");
|
super("divination");
|
||||||
|
@ -32,24 +31,20 @@ public class ItemSigilDivination extends ItemSigilBase implements ISigil, IAltar
|
||||||
if (position == null) {
|
if (position == null) {
|
||||||
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
|
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
|
||||||
return stack;
|
return stack;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
if (position.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
if (position.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity(position.getBlockPos());
|
TileEntity tile = world.getTileEntity(position.getBlockPos());
|
||||||
|
|
||||||
if (tile != null && tile instanceof IBloodAltar)
|
if (tile != null && tile instanceof IBloodAltar) {
|
||||||
{
|
IBloodAltar altar = (IBloodAltar) tile;
|
||||||
int tier = ((IBloodAltar) tile).getTier() + 1;
|
int tier = altar.getTier().ordinal() + 1;
|
||||||
currentEssence = ((IBloodAltar) tile).getCurrentBlood();
|
currentEssence = altar.getCurrentBlood();
|
||||||
int capacity = ((IBloodAltar) tile).getCapacity();
|
int capacity = altar.getCapacity();
|
||||||
|
|
||||||
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentAltarTier", tier)), new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)), new ChatComponentText(TextHelper.localize(tooltipBase + "currentAltarCapacity", capacity)));
|
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentAltarTier", tier), TextHelper.localize(tooltipBase + "currentEssence", currentEssence), TextHelper.localize(tooltipBase + "currentAltarCapacity", capacity));
|
||||||
}
|
} else {
|
||||||
else
|
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentEssence", currentEssence));
|
||||||
{
|
|
||||||
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return stack;
|
return stack;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.tile;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.altar.BloodAltar;
|
import WayofTime.bloodmagic.altar.BloodAltar;
|
||||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||||
|
import WayofTime.bloodmagic.api.NBTHolder;
|
||||||
import WayofTime.bloodmagic.api.altar.AltarRecipe;
|
import WayofTime.bloodmagic.api.altar.AltarRecipe;
|
||||||
import WayofTime.bloodmagic.api.altar.AltarUpgrade;
|
import WayofTime.bloodmagic.api.altar.AltarUpgrade;
|
||||||
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
||||||
|
@ -15,17 +16,15 @@ import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraftforge.fluids.*;
|
import net.minecraftforge.fluids.*;
|
||||||
|
|
||||||
public class TileAltar extends TileInventory implements IBloodAltar, IUpdatePlayerListBox, IFluidTank, IFluidHandler {
|
public class TileAltar extends TileInventory implements IBloodAltar, IUpdatePlayerListBox, IFluidTank, IFluidHandler {
|
||||||
private int tier;
|
|
||||||
|
private EnumAltarTier altarTier = EnumAltarTier.ONE;
|
||||||
private AltarUpgrade upgrade = new AltarUpgrade();
|
private AltarUpgrade upgrade = new AltarUpgrade();
|
||||||
|
private int capacity = FluidContainerRegistry.BUCKET_VOLUME * 10;
|
||||||
|
|
||||||
private FluidStack fluid = new FluidStack(BloodMagicAPI.getLifeEssence(), 0);
|
private FluidStack fluid = new FluidStack(BloodMagicAPI.getLifeEssence(), 0);
|
||||||
protected FluidStack fluidOutput = new FluidStack(BlockLifeEssence.getLifeEssence(), 0);
|
protected FluidStack fluidOutput = new FluidStack(BlockLifeEssence.getLifeEssence(), 0);
|
||||||
protected FluidStack fluidInput = new FluidStack(BlockLifeEssence.getLifeEssence(), 0);
|
protected FluidStack fluidInput = new FluidStack(BlockLifeEssence.getLifeEssence(), 0);
|
||||||
private int capacity;
|
|
||||||
|
|
||||||
private int upgradeLevel;
|
|
||||||
|
|
||||||
private int resultID;
|
|
||||||
private int resultDamage;
|
|
||||||
private int liquidRequired; //mB
|
private int liquidRequired; //mB
|
||||||
private boolean canBeFilled;
|
private boolean canBeFilled;
|
||||||
private int consumptionRate;
|
private int consumptionRate;
|
||||||
|
@ -34,13 +33,13 @@ public class TileAltar extends TileInventory implements IBloodAltar, IUpdatePlay
|
||||||
private float efficiencyMultiplier;
|
private float efficiencyMultiplier;
|
||||||
private float sacrificeEfficiencyMultiplier;
|
private float sacrificeEfficiencyMultiplier;
|
||||||
private float selfSacrificeEfficiencyMultiplier;
|
private float selfSacrificeEfficiencyMultiplier;
|
||||||
private float capacityMultiplier;
|
private float capacityMultiplier = 1;
|
||||||
private float orbCapacityMultiplier;
|
private float orbCapacityMultiplier;
|
||||||
private float dislocationMultiplier;
|
private float dislocationMultiplier;
|
||||||
private int accelerationUpgrades;
|
private int accelerationUpgrades;
|
||||||
private boolean isUpgraded;
|
private boolean isUpgraded;
|
||||||
private boolean isResultBlock;
|
private boolean isResultBlock;
|
||||||
private int bufferCapacity;
|
private int bufferCapacity = FluidContainerRegistry.BUCKET_VOLUME;
|
||||||
private int progress;
|
private int progress;
|
||||||
|
|
||||||
public boolean isActive;
|
public boolean isActive;
|
||||||
|
@ -52,134 +51,99 @@ public class TileAltar extends TileInventory implements IBloodAltar, IUpdatePlay
|
||||||
|
|
||||||
public TileAltar() {
|
public TileAltar() {
|
||||||
super(1, "altar");
|
super(1, "altar");
|
||||||
|
|
||||||
this.capacity = FluidContainerRegistry.BUCKET_VOLUME * 10;
|
|
||||||
this.bufferCapacity = FluidContainerRegistry.BUCKET_VOLUME;
|
|
||||||
this.resultID = 0;
|
|
||||||
this.resultDamage = 0;
|
|
||||||
this.isActive = false;
|
|
||||||
this.consumptionRate = 0;
|
|
||||||
this.drainRate = 0;
|
|
||||||
this.consumptionMultiplier = 0;
|
|
||||||
this.efficiencyMultiplier = 0;
|
|
||||||
this.capacityMultiplier = 1;
|
|
||||||
this.isUpgraded = false;
|
|
||||||
this.isResultBlock = false;
|
|
||||||
this.upgradeLevel = 0;
|
|
||||||
this.progress = 0;
|
|
||||||
this.lockdownDuration = 0;
|
|
||||||
this.demonBloodDuration = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
|
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||||
super.readFromNBT(par1NBTTagCompound);
|
super.readFromNBT(tagCompound);
|
||||||
|
|
||||||
resultID = par1NBTTagCompound.getInteger("resultID");
|
if (!tagCompound.hasKey("Empty")) {
|
||||||
resultDamage = par1NBTTagCompound.getInteger("resultDamage");
|
FluidStack fluid = FluidStack.loadFluidStackFromNBT(tagCompound);
|
||||||
|
|
||||||
if (!par1NBTTagCompound.hasKey("Empty")) {
|
if (fluid != null)
|
||||||
FluidStack fluid = this.fluid.loadFluidStackFromNBT(par1NBTTagCompound);
|
|
||||||
|
|
||||||
if (fluid != null) {
|
|
||||||
setMainFluid(fluid);
|
setMainFluid(fluid);
|
||||||
}
|
|
||||||
|
|
||||||
FluidStack fluidOut = new FluidStack(BloodMagicAPI.getLifeEssence(), par1NBTTagCompound.getInteger("outputAmount"));
|
FluidStack fluidOut = new FluidStack(BloodMagicAPI.getLifeEssence(), tagCompound.getInteger("outputAmount"));
|
||||||
|
setOutputFluid(fluidOut);
|
||||||
|
|
||||||
if (fluidOut != null) {
|
FluidStack fluidIn = new FluidStack(BloodMagicAPI.getLifeEssence(), tagCompound.getInteger("inputAmount"));
|
||||||
setOutputFluid(fluidOut);
|
setInputFluid(fluidIn);
|
||||||
}
|
|
||||||
|
|
||||||
FluidStack fluidIn = new FluidStack(BloodMagicAPI.getLifeEssence(), par1NBTTagCompound.getInteger("inputAmount"));
|
|
||||||
|
|
||||||
if (fluidIn != null) {
|
|
||||||
setInputFluid(fluidIn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
upgradeLevel = par1NBTTagCompound.getInteger("upgradeLevel");
|
altarTier = EnumAltarTier.valueOf(tagCompound.getString(NBTHolder.NBT_ALTAR_TIER));
|
||||||
isActive = par1NBTTagCompound.getBoolean("isActive");
|
isActive = tagCompound.getBoolean(NBTHolder.NBT_ALTAR_ACTIVE);
|
||||||
liquidRequired = par1NBTTagCompound.getInteger("liquidRequired");
|
liquidRequired = tagCompound.getInteger(NBTHolder.NBT_ALTAR_LIQUID_REQ);
|
||||||
canBeFilled = par1NBTTagCompound.getBoolean("canBeFilled");
|
canBeFilled = tagCompound.getBoolean(NBTHolder.NBT_ALTAR_FILLABLE);
|
||||||
isUpgraded = par1NBTTagCompound.getBoolean("isUpgraded");
|
isUpgraded = tagCompound.getBoolean("isUpgraded");
|
||||||
consumptionRate = par1NBTTagCompound.getInteger("consumptionRate");
|
consumptionRate = tagCompound.getInteger("consumptionRate");
|
||||||
drainRate = par1NBTTagCompound.getInteger("drainRate");
|
drainRate = tagCompound.getInteger("drainRate");
|
||||||
consumptionMultiplier = par1NBTTagCompound.getFloat("consumptionMultiplier");
|
consumptionMultiplier = tagCompound.getFloat("consumptionMultiplier");
|
||||||
efficiencyMultiplier = par1NBTTagCompound.getFloat("efficiencyMultiplier");
|
efficiencyMultiplier = tagCompound.getFloat("efficiencyMultiplier");
|
||||||
selfSacrificeEfficiencyMultiplier = par1NBTTagCompound.getFloat("selfSacrificeEfficiencyMultiplier");
|
selfSacrificeEfficiencyMultiplier = tagCompound.getFloat("selfSacrificeEfficiencyMultiplier");
|
||||||
sacrificeEfficiencyMultiplier = par1NBTTagCompound.getFloat("sacrificeEfficiencyMultiplier");
|
sacrificeEfficiencyMultiplier = tagCompound.getFloat("sacrificeEfficiencyMultiplier");
|
||||||
capacityMultiplier = par1NBTTagCompound.getFloat("capacityMultiplier");
|
capacityMultiplier = tagCompound.getFloat("capacityMultiplier");
|
||||||
orbCapacityMultiplier = par1NBTTagCompound.getFloat("orbCapacityMultiplier");
|
orbCapacityMultiplier = tagCompound.getFloat("orbCapacityMultiplier");
|
||||||
dislocationMultiplier = par1NBTTagCompound.getFloat("dislocationMultiplier");
|
dislocationMultiplier = tagCompound.getFloat("dislocationMultiplier");
|
||||||
capacity = par1NBTTagCompound.getInteger("capacity");
|
capacity = tagCompound.getInteger("capacity");
|
||||||
bufferCapacity = par1NBTTagCompound.getInteger("bufferCapacity");
|
bufferCapacity = tagCompound.getInteger("bufferCapacity");
|
||||||
progress = par1NBTTagCompound.getInteger("progress");
|
progress = tagCompound.getInteger("progress");
|
||||||
isResultBlock = par1NBTTagCompound.getBoolean("isResultBlock");
|
isResultBlock = tagCompound.getBoolean("isResultBlock");
|
||||||
lockdownDuration = par1NBTTagCompound.getInteger("lockdownDuration");
|
lockdownDuration = tagCompound.getInteger("lockdownDuration");
|
||||||
accelerationUpgrades = par1NBTTagCompound.getInteger("accelerationUpgrades");
|
accelerationUpgrades = tagCompound.getInteger("accelerationUpgrades");
|
||||||
demonBloodDuration = par1NBTTagCompound.getInteger("demonBloodDuration");
|
demonBloodDuration = tagCompound.getInteger("demonBloodDuration");
|
||||||
cooldownAfterCrafting = par1NBTTagCompound.getInteger("cooldownAfterCrafting");
|
cooldownAfterCrafting = tagCompound.getInteger("cooldownAfterCrafting");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
|
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||||
super.writeToNBT(par1NBTTagCompound);
|
super.writeToNBT(tagCompound);
|
||||||
|
|
||||||
par1NBTTagCompound.setInteger("resultID", resultID);
|
if (fluid != null)
|
||||||
par1NBTTagCompound.setInteger("resultDamage", resultDamage);
|
fluid.writeToNBT(tagCompound);
|
||||||
|
else
|
||||||
|
tagCompound.setString("Empty", "");
|
||||||
|
|
||||||
if (fluid != null) {
|
|
||||||
fluid.writeToNBT(par1NBTTagCompound);
|
|
||||||
} else {
|
|
||||||
par1NBTTagCompound.setString("Empty", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fluidOutput != null) {
|
if (fluidOutput != null)
|
||||||
par1NBTTagCompound.setInteger("outputAmount", fluidOutput.amount);
|
tagCompound.setInteger("outputAmount", fluidOutput.amount);
|
||||||
}
|
|
||||||
|
|
||||||
if (fluidInput != null) {
|
if (fluidInput != null)
|
||||||
par1NBTTagCompound.setInteger("inputAmount", fluidInput.amount);
|
tagCompound.setInteger("inputAmount", fluidInput.amount);
|
||||||
}
|
|
||||||
|
|
||||||
par1NBTTagCompound.setInteger("upgradeLevel", upgradeLevel);
|
tagCompound.setString("upgradeLevel", altarTier.name());
|
||||||
par1NBTTagCompound.setBoolean("isActive", isActive);
|
tagCompound.setBoolean("isActive", isActive);
|
||||||
par1NBTTagCompound.setInteger("liquidRequired", liquidRequired);
|
tagCompound.setInteger("liquidRequired", liquidRequired);
|
||||||
par1NBTTagCompound.setBoolean("canBeFilled", canBeFilled);
|
tagCompound.setBoolean("canBeFilled", canBeFilled);
|
||||||
par1NBTTagCompound.setBoolean("isUpgraded", isUpgraded);
|
tagCompound.setBoolean("isUpgraded", isUpgraded);
|
||||||
par1NBTTagCompound.setInteger("consumptionRate", consumptionRate);
|
tagCompound.setInteger("consumptionRate", consumptionRate);
|
||||||
par1NBTTagCompound.setInteger("drainRate", drainRate);
|
tagCompound.setInteger("drainRate", drainRate);
|
||||||
par1NBTTagCompound.setFloat("consumptionMultiplier", consumptionMultiplier);
|
tagCompound.setFloat("consumptionMultiplier", consumptionMultiplier);
|
||||||
par1NBTTagCompound.setFloat("efficiencyMultiplier", efficiencyMultiplier);
|
tagCompound.setFloat("efficiencyMultiplier", efficiencyMultiplier);
|
||||||
par1NBTTagCompound.setFloat("sacrificeEfficiencyMultiplier", sacrificeEfficiencyMultiplier);
|
tagCompound.setFloat("sacrificeEfficiencyMultiplier", sacrificeEfficiencyMultiplier);
|
||||||
par1NBTTagCompound.setFloat("selfSacrificeEfficiencyMultiplier", selfSacrificeEfficiencyMultiplier);
|
tagCompound.setFloat("selfSacrificeEfficiencyMultiplier", selfSacrificeEfficiencyMultiplier);
|
||||||
par1NBTTagCompound.setBoolean("isResultBlock", isResultBlock);
|
tagCompound.setBoolean("isResultBlock", isResultBlock);
|
||||||
par1NBTTagCompound.setFloat("capacityMultiplier", capacityMultiplier);
|
tagCompound.setFloat("capacityMultiplier", capacityMultiplier);
|
||||||
par1NBTTagCompound.setFloat("orbCapacityMultiplier", orbCapacityMultiplier);
|
tagCompound.setFloat("orbCapacityMultiplier", orbCapacityMultiplier);
|
||||||
par1NBTTagCompound.setFloat("dislocationMultiplier", dislocationMultiplier);
|
tagCompound.setFloat("dislocationMultiplier", dislocationMultiplier);
|
||||||
par1NBTTagCompound.setInteger("capacity", capacity);
|
tagCompound.setInteger("capacity", capacity);
|
||||||
par1NBTTagCompound.setInteger("progress", progress);
|
tagCompound.setInteger("progress", progress);
|
||||||
par1NBTTagCompound.setInteger("bufferCapacity", bufferCapacity);
|
tagCompound.setInteger("bufferCapacity", bufferCapacity);
|
||||||
par1NBTTagCompound.setInteger("lockdownDuration", lockdownDuration);
|
tagCompound.setInteger("lockdownDuration", lockdownDuration);
|
||||||
par1NBTTagCompound.setInteger("accelerationUpgrades", this.accelerationUpgrades);
|
tagCompound.setInteger("accelerationUpgrades", this.accelerationUpgrades);
|
||||||
par1NBTTagCompound.setInteger("demonBloodDuration", demonBloodDuration);
|
tagCompound.setInteger("demonBloodDuration", demonBloodDuration);
|
||||||
par1NBTTagCompound.setInteger("cooldownAfterCrafting", cooldownAfterCrafting);
|
tagCompound.setInteger("cooldownAfterCrafting", cooldownAfterCrafting);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
if (getWorld().isRemote) {
|
if (getWorld().isRemote)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (getWorld().getTotalWorldTime() % (Math.max(20 - getUpgrade().getSpeedCount(), 1)) == 0) {
|
if (getWorld().getTotalWorldTime() % (Math.max(20 - getUpgrade().getSpeedCount(), 1)) == 0)
|
||||||
everySecond();
|
everySecond();
|
||||||
}
|
|
||||||
|
|
||||||
if (getWorld().getTotalWorldTime() % 100 == 0) {
|
if (getWorld().getTotalWorldTime() % 100 == 0)
|
||||||
everyFiveSeconds();
|
everyFiveSeconds();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void everySecond() {
|
private void everySecond() {
|
||||||
|
@ -191,20 +155,18 @@ public class TileAltar extends TileInventory implements IBloodAltar, IUpdatePlay
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startCycle() {
|
public void startCycle() {
|
||||||
if (worldObj != null) {
|
if (worldObj != null)
|
||||||
worldObj.markBlockForUpdate(pos);
|
worldObj.markBlockForUpdate(pos);
|
||||||
}
|
|
||||||
|
|
||||||
if (fluid == null || fluid.amount <= 0) {
|
if (fluid == null || fluid.amount <= 0)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (getStackInSlot(0) != null) {
|
if (getStackInSlot(0) != null) {
|
||||||
// Do recipes
|
// Do recipes
|
||||||
if (AltarRecipeRegistry.getRecipes().containsKey(getStackInSlot(0))) {
|
if (AltarRecipeRegistry.getRecipes().containsKey(getStackInSlot(0))) {
|
||||||
AltarRecipe recipe = AltarRecipeRegistry.getRecipeForInput(getStackInSlot(0));
|
AltarRecipe recipe = AltarRecipeRegistry.getRecipeForInput(getStackInSlot(0));
|
||||||
|
|
||||||
if (tier >= recipe.getMinTier()) {
|
if (altarTier.ordinal() >= recipe.getMinTier().ordinal()) {
|
||||||
this.liquidRequired = recipe.getSyphon();
|
this.liquidRequired = recipe.getSyphon();
|
||||||
// this.canBeFilled = recipe
|
// this.canBeFilled = recipe
|
||||||
this.consumptionRate = recipe.getConsumeRate();
|
this.consumptionRate = recipe.getConsumeRate();
|
||||||
|
@ -220,21 +182,19 @@ public class TileAltar extends TileInventory implements IBloodAltar, IUpdatePlay
|
||||||
|
|
||||||
EnumAltarTier tier = BloodAltar.getAltarTier(getWorld(), getPos());
|
EnumAltarTier tier = BloodAltar.getAltarTier(getWorld(), getPos());
|
||||||
|
|
||||||
if (tier.equals(EnumAltarTier.ONE)) {
|
if (tier.equals(EnumAltarTier.ONE))
|
||||||
upgrade = new AltarUpgrade();
|
upgrade = new AltarUpgrade();
|
||||||
} else {
|
else
|
||||||
upgrade = BloodAltar.getUpgrades(worldObj, pos, tier);
|
upgrade = BloodAltar.getUpgrades(worldObj, pos, tier);
|
||||||
}
|
|
||||||
|
|
||||||
if (this.fluid.amount > this.capacity) {
|
if (this.fluid.amount > this.capacity)
|
||||||
this.fluid.amount = this.capacity;
|
this.fluid.amount = this.capacity;
|
||||||
}
|
|
||||||
|
|
||||||
worldObj.markBlockForUpdate(pos);
|
worldObj.markBlockForUpdate(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sacrificialDaggerCall(int amount, boolean isSacrifice) {
|
public void sacrificialDaggerCall(int amount, boolean isSacrifice) {
|
||||||
if (!isSacrifice && this.lockdownDuration > 0) {
|
if (this.lockdownDuration > 0) {
|
||||||
int amt = (int) Math.min(bufferCapacity - fluidInput.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount);
|
int amt = (int) Math.min(bufferCapacity - fluidInput.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount);
|
||||||
fluidInput.amount += amt;
|
fluidInput.amount += amt;
|
||||||
} else {
|
} else {
|
||||||
|
@ -256,8 +216,8 @@ public class TileAltar extends TileInventory implements IBloodAltar, IUpdatePlay
|
||||||
return upgrade;
|
return upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TileAltar setTier(int tier) {
|
public TileAltar setTier(EnumAltarTier tier) {
|
||||||
this.tier = tier;
|
this.altarTier = tier;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,8 +232,8 @@ public class TileAltar extends TileInventory implements IBloodAltar, IUpdatePlay
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getTier() {
|
public EnumAltarTier getTier() {
|
||||||
return upgradeLevel;
|
return altarTier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue