mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-22 21:19:47 +00:00
Actual 1.2 Release!
This commit is contained in:
1 parent
2afb5d21ed
commit
ec5c460d5e
16 files changed
+103
-142
No files matched your search
@@ -167,7 +167,7 @@ public class BloodArsenal
|
||||
{
|
||||
logger.info("Loaded Thaumcraft/Forbidden Magic integration");
|
||||
ModItems.registerThaumcraftItems();
|
||||
BloodArsenalThaumcraft.init();
|
||||
BloodArsenalThaumcraft.addResearch();
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("ForgeMultipart") && BloodArsenalConfig.forgeMultipartIntegration)
|
||||
|
||||
@@ -244,75 +244,4 @@ public class BloodArsenalEventHooks
|
||||
BloodArsenal.logger.info("Refreshing configuration file");
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "Baubles")
|
||||
@SubscribeEvent
|
||||
private void selfSacrificeHandler(LivingAttackEvent event)
|
||||
{
|
||||
EntityLivingBase entityAttacked = event.entityLiving;
|
||||
float damageDone = event.ammount;
|
||||
|
||||
EntityPlayer player = (EntityPlayer) entityAttacked;
|
||||
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
|
||||
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
|
||||
if (stack != null)
|
||||
{
|
||||
if (stack.getItem() == ModItems.self_sacrifice_amulet)
|
||||
{
|
||||
SelfSacrificeAmulet selfSacrificeAmulet = (SelfSacrificeAmulet) ModItems.self_sacrifice_amulet;
|
||||
int lpReceived = (int) damageDone;
|
||||
boolean shouldExecute = selfSacrificeAmulet.getStoredLP(stack) < 10000;
|
||||
|
||||
if (shouldExecute)
|
||||
{
|
||||
PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
|
||||
|
||||
if (regenEffect != null && regenEffect.getAmplifier() >= 2)
|
||||
{
|
||||
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 2) / (regenEffect.getAmplifier() + 1), 10000));
|
||||
}
|
||||
else
|
||||
{
|
||||
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 2), 10000));
|
||||
}
|
||||
}
|
||||
|
||||
// if (player instanceof EntityPlayerMP)
|
||||
{
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, i), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
if (stack.getItem() == ModItems.empowered_self_sacrifice_amulet)
|
||||
{
|
||||
EmpoweredSelfSacrificeAmulet selfSacrificeAmulet = (EmpoweredSelfSacrificeAmulet) ModItems.empowered_self_sacrifice_amulet;
|
||||
int lpReceived = (int) damageDone;
|
||||
boolean shouldExecute = selfSacrificeAmulet.getStoredLP(stack) < 50000;
|
||||
|
||||
if (shouldExecute)
|
||||
{
|
||||
PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
|
||||
|
||||
if (regenEffect != null && regenEffect.getAmplifier() >= 2)
|
||||
{
|
||||
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 5) / (regenEffect.getAmplifier() + 1), 50000));
|
||||
}
|
||||
else
|
||||
{
|
||||
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 5), 50000));
|
||||
}
|
||||
}
|
||||
|
||||
// if (player instanceof EntityPlayerMP)
|
||||
{
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, i), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-4
@@ -9,11 +9,8 @@ import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import baubles.common.network.PacketHandler;
|
||||
import baubles.common.network.PacketSyncBauble;
|
||||
import com.arc.bloodarsenal.common.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -30,6 +27,7 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
|
||||
import java.util.List;
|
||||
@@ -49,7 +47,7 @@ public class EmpoweredSacrificeAmulet extends SacrificeAmulet implements IBauble
|
||||
{
|
||||
Entity killer = event.source.getEntity();
|
||||
|
||||
if (killer != null && killer instanceof EntityPlayer && BloodArsenalConfig.baublesIntegration)
|
||||
if (killer != null && killer instanceof EntityPlayerMP && !(killer instanceof FakePlayer) && BloodArsenalConfig.baublesIntegration)
|
||||
{
|
||||
EntityLivingBase victim = event.entityLiving;
|
||||
|
||||
|
||||
+1
-3
@@ -9,8 +9,6 @@ import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import baubles.common.network.PacketHandler;
|
||||
import baubles.common.network.PacketSyncBauble;
|
||||
import com.arc.bloodarsenal.common.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -51,7 +49,7 @@ public class EmpoweredSelfSacrificeAmulet extends SelfSacrificeAmulet implements
|
||||
EntityLivingBase entityAttacked = event.entityLiving;
|
||||
Entity entityAttacking = event.source.getSourceOfDamage();
|
||||
|
||||
if (entityAttacking != null && entityAttacked != null && entityAttacked instanceof EntityPlayer && BloodArsenalConfig.baublesIntegration)
|
||||
if (entityAttacking != null && entityAttacked != null && entityAttacked instanceof EntityPlayerMP && BloodArsenalConfig.baublesIntegration)
|
||||
{
|
||||
float damageDone = event.ammount;
|
||||
|
||||
|
||||
@@ -6,11 +6,8 @@ import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import baubles.common.network.PacketHandler;
|
||||
import baubles.common.network.PacketSyncBauble;
|
||||
import com.arc.bloodarsenal.common.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -27,6 +24,7 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
|
||||
import java.util.List;
|
||||
@@ -44,7 +42,7 @@ public class SacrificeAmulet extends ItemBauble implements IAltarManipulator, IB
|
||||
{
|
||||
Entity killer = event.source.getEntity();
|
||||
|
||||
if (killer != null && killer instanceof EntityPlayer && BloodArsenalConfig.baublesIntegration)
|
||||
if (killer != null && killer instanceof EntityPlayerMP && !(killer instanceof FakePlayer) && BloodArsenalConfig.baublesIntegration)
|
||||
{
|
||||
EntityLivingBase victim = event.entityLiving;
|
||||
|
||||
|
||||
@@ -6,15 +6,12 @@ import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import baubles.common.network.PacketHandler;
|
||||
import baubles.common.network.PacketSyncBauble;
|
||||
import com.arc.bloodarsenal.common.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -45,7 +42,7 @@ public class SelfSacrificeAmulet extends ItemBauble implements IAltarManipulator
|
||||
{
|
||||
EntityLivingBase entityAttacked = event.entityLiving;
|
||||
|
||||
if (entityAttacked != null && entityAttacked instanceof EntityPlayer && BloodArsenalConfig.baublesIntegration)
|
||||
if (entityAttacked != null && entityAttacked instanceof EntityPlayerMP && BloodArsenalConfig.baublesIntegration)
|
||||
{
|
||||
float damageDone = event.ammount;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class VampireRing extends ItemBauble implements IBauble
|
||||
{
|
||||
super.onWornTick(par1ItemStack, player);
|
||||
|
||||
if (player instanceof EntityPlayer && !player.worldObj.isRemote)
|
||||
if (player instanceof EntityPlayerMP && !player.worldObj.isRemote)
|
||||
{
|
||||
if (player.getActivePotionEffect(BloodArsenal.vampiricAura) != null)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class GlassDaggerOfSacrifice extends EnergyItems
|
||||
{
|
||||
@@ -74,10 +75,13 @@ public class GlassDaggerOfSacrifice extends EnergyItems
|
||||
}
|
||||
|
||||
int lifeEssence = 500;
|
||||
if (par2EntityLivingBase instanceof EntityVillager) lifeEssence = 3000;
|
||||
else if (par2EntityLivingBase instanceof EntitySlime) lifeEssence = 225;
|
||||
Random random = new Random();
|
||||
|
||||
if (random.nextInt(3) == 2) lifeEssence = 100;
|
||||
else if (par2EntityLivingBase instanceof EntityVillager) lifeEssence = 2500;
|
||||
else if (par2EntityLivingBase instanceof EntitySlime) lifeEssence = 200;
|
||||
else if (par2EntityLivingBase instanceof EntityEnderman) lifeEssence = 300;
|
||||
else if (par2EntityLivingBase instanceof EntityAnimal) lifeEssence = 375;
|
||||
else if (par2EntityLivingBase instanceof EntityAnimal) lifeEssence = 350;
|
||||
|
||||
if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, lifeEssence))
|
||||
{
|
||||
|
||||
@@ -1,9 +1,43 @@
|
||||
/**
|
||||
* Taken from SpitefulFox's ForbiddenMagic
|
||||
* https://github.com/SpitefulFox/ForbiddenMagic
|
||||
*/
|
||||
|
||||
package com.arc.bloodarsenal.common.thaumcraft;
|
||||
|
||||
import com.arc.bloodarsenal.common.block.ModBlocks;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.api.wands.StaffRod;
|
||||
import thaumcraft.api.wands.WandCap;
|
||||
import thaumcraft.api.wands.WandRod;
|
||||
|
||||
public class BloodArsenalThaumcraft
|
||||
{
|
||||
public static void init()
|
||||
public static void addResearch()
|
||||
{
|
||||
BloodyResearch.addResearch();
|
||||
final String FORBIDDEN = "FORBIDDEN";
|
||||
|
||||
WandRod bloodRod = WandRod.rods.get("blood");
|
||||
WandCap alchemicalCap = WandCap.caps.get("alchemical");
|
||||
WandRod bloodStaff = StaffRod.rods.get("blood");
|
||||
|
||||
InfusionRecipe rod_blood_wood = ThaumcraftApi.addInfusionCraftingRecipe("ROD_blood_wood", new ItemStack(ModItems.wandCore, 1, 0), 3, (new AspectList()).add(Aspect.LIFE, 32).add(Aspect.MAGIC, 24).add(Aspect.TOOL, 16), bloodRod.getItem(), new ItemStack[] {new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModItems.blood_infused_glowstone_dust)});
|
||||
new BloodArsenalResearchItem("ROD_blood_wood", FORBIDDEN, (new AspectList()).add(Aspect.LIFE, 10).add(Aspect.MAGIC, 8).add(Aspect.TOOL, 4), 4, -5, 2, new ItemStack(ModItems.wandCore, 1, 0)).setPages(new ResearchPage("blood_arsenal.research_page.ROD_blood_wood.1"), new ResearchPage("blood_arsenal.research_page.ROD_blood_wood.2"), new ResearchPage(rod_blood_wood)).setParents("ROD_blood").registerResearchItem();
|
||||
ThaumcraftApi.addWarpToResearch("ROD_blood_wood", 2);
|
||||
ThaumcraftApi.addWarpToItem(new ItemStack(ModItems.wandCore, 1, 0), 2);
|
||||
InfusionRecipe cap_blood_iron = ThaumcraftApi.addInfusionCraftingRecipe("CAP_blood_iron", new ItemStack(ModItems.wandCap, 1, 0), 3, (new AspectList()).add(Aspect.LIFE, 24).add(Aspect.WATER, 24).add(Aspect.MAGIC, 20), alchemicalCap.getItem(), new ItemStack[] { new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModItems.blood_infused_iron), new ItemStack(ModItems.blood_infused_iron), new ItemStack(ModItems.blood_infused_iron), new ItemStack(ModItems.blood_infused_glowstone_dust), new ItemStack(ModItems.blood_infused_glowstone_dust) });
|
||||
new BloodArsenalResearchItem("CAP_blood_iron", FORBIDDEN, (new AspectList()).add(Aspect.LIFE, 6).add(Aspect.TOOL, 2), 2, -5, 2, new ItemStack(ModItems.wandCap, 1, 0)).setPages(new ResearchPage("blood_arsenal.research_page.CAP_blood_iron.1"), new ResearchPage(cap_blood_iron)).setParents("ROD_blood_wood", "CAP_alchemical").registerResearchItem();
|
||||
ThaumcraftApi.addWarpToResearch("CAP_blood_iron", 1);
|
||||
ThaumcraftApi.addWarpToItem(new ItemStack(ModItems.wandCap), 1);
|
||||
InfusionRecipe staff_blood_wood = ThaumcraftApi.addInfusionCraftingRecipe("ROD_blood_wood_staff", new ItemStack(ModItems.wandCore, 1, 1), 6, (new AspectList()).add(Aspect.LIFE, 64).add(Aspect.MAGIC, 48).add(Aspect.WATER, 32).add(Aspect.TOOL, 24), bloodStaff.getItem(), new ItemStack[] {new ItemStack(ModItems.wandCore, 1, 0), new ItemStack(ModItems.blood_infused_glowstone_dust), new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModItems.blood_infused_glowstone_dust), new ItemStack(ModItems.wandCore, 1, 0), new ItemStack(ModItems.blood_infused_glowstone_dust), new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModItems.blood_infused_glowstone_dust)});
|
||||
new BloodArsenalResearchItem("ROD_blood_wood_staff", FORBIDDEN, (new AspectList()).add(Aspect.LIFE, 16).add(Aspect.MAGIC, 12).add(Aspect.TOOL, 8), 5, -3, 3, new ItemStack(ModItems.wandCore, 1, 1)).setPages(new ResearchPage("blood_arsenal.research_page.ROD_blood_wood_staff.1"), new ResearchPage(staff_blood_wood)).setParents("ROD_blood_wood", "ROD_blood_staff").setHidden().setSpecial().registerResearchItem();
|
||||
ThaumcraftApi.addWarpToResearch("ROD_blood_wood_staff", 3);
|
||||
ThaumcraftApi.addWarpToItem(new ItemStack(ModItems.wandCore, 1, 1), 4);
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* Taken from SpitefulFox's ForbiddenMagic
|
||||
* https://github.com/SpitefulFox/ForbiddenMagic
|
||||
*/
|
||||
|
||||
package com.arc.bloodarsenal.common.thaumcraft;
|
||||
|
||||
import com.arc.bloodarsenal.common.block.ModBlocks;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.api.wands.WandCap;
|
||||
import thaumcraft.api.wands.WandRod;
|
||||
|
||||
public class BloodyResearch
|
||||
{
|
||||
public BloodyResearch() {}
|
||||
|
||||
public static void addResearch()
|
||||
{
|
||||
final String FORBIDDEN = "FORBIDDEN";
|
||||
|
||||
WandRod bloodRod = WandRod.rods.get("blood");
|
||||
WandCap alchemicalCap = WandCap.caps.get("alchemical");
|
||||
|
||||
InfusionRecipe rod_blood_wood = ThaumcraftApi.addInfusionCraftingRecipe("ROD_blood_wood", new ItemStack(ModItems.wandCore, 1, 0), 3, (new AspectList()).add(Aspect.LIFE, 24).add(Aspect.MAGIC, 16).add(Aspect.TOOL, 8), bloodRod.getItem(), new ItemStack[] {new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(ModItems.blood_infused_glowstone_dust)});
|
||||
new BloodArsenalResearchItem("ROD_blood_wood", FORBIDDEN, (new AspectList()).add(Aspect.LIFE, 10).add(Aspect.MAGIC, 8).add(Aspect.TOOL, 4), 4, -5, 2, new ItemStack(ModItems.wandCore, 1, 0)).setPages(new ResearchPage("blood_arsenal.research_page.ROD_blood_wood.1"), new ResearchPage("blood_arsenal.research_page.ROD_blood_wood.2"), new ResearchPage(rod_blood_wood)).setParents("ROD_blood").registerResearchItem();
|
||||
InfusionRecipe cap_blood_iron = ThaumcraftApi.addInfusionCraftingRecipe("CAP_blood_iron", new ItemStack(ModItems.wandCap, 1, 0), 3, (new AspectList()).add(Aspect.LIFE, 16).add(Aspect.WATER, 8).add(Aspect.MAGIC, 8), alchemicalCap.getItem(), new ItemStack[] { new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModItems.amorphic_catalyst), new ItemStack(ModItems.blood_infused_iron), new ItemStack(ModItems.blood_infused_iron), new ItemStack(ModItems.blood_infused_iron), new ItemStack(ModItems.blood_infused_glowstone_dust), new ItemStack(ModItems.blood_infused_glowstone_dust) });
|
||||
new BloodArsenalResearchItem("CAP_blood_iron", FORBIDDEN, (new AspectList()).add(Aspect.LIFE, 6).add(Aspect.TOOL, 2), 2, -5, 2, new ItemStack(ModItems.wandCap, 1, 0)).setPages(new ResearchPage("blood_arsenal.research_page.CAP_blood_iron.1"), new ResearchPage(cap_blood_iron)).setParents("ROD_blood_wood", "CAP_alchemical").registerResearchItem();
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
|
||||
public class ItemWandCores extends Item
|
||||
{
|
||||
public final String[] types = new String[]{"blood_wood"};
|
||||
public final String[] types = new String[]{"blood_wood", "blood_wood_staff"};
|
||||
public IIcon[] icon;
|
||||
|
||||
public ItemWandCores()
|
||||
|
||||
@@ -31,6 +31,8 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
private boolean canBeFilled;
|
||||
protected FluidStack fluidInput;
|
||||
|
||||
private int bufferCapacity;
|
||||
|
||||
public FluidTank[] tanks = {new FluidTankRestricted(FluidContainerRegistry.BUCKET_VOLUME * 20, "Life Essence")};
|
||||
|
||||
public TileLifeInfuser()
|
||||
@@ -39,6 +41,8 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
fluid = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 0);
|
||||
fluidInput = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 0);
|
||||
this.capacity = FluidContainerRegistry.BUCKET_VOLUME * 20;
|
||||
|
||||
bufferCapacity = FluidContainerRegistry.BUCKET_VOLUME;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,6 +81,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
|
||||
canBeFilled = par1NBTTagCompound.getBoolean("canBeFilled");
|
||||
capacity = par1NBTTagCompound.getInteger("capacity");
|
||||
bufferCapacity = par1NBTTagCompound.getInteger("bufferCapacity");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,6 +120,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
par1NBTTagCompound.setTag("Inventory", itemList);
|
||||
par1NBTTagCompound.setBoolean("canBeFilled", canBeFilled);
|
||||
par1NBTTagCompound.setInteger("capacity", capacity);
|
||||
par1NBTTagCompound.setInteger("bufferCapacity", bufferCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -419,7 +425,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
{
|
||||
if (fluidInput == null)
|
||||
{
|
||||
return Math.min(capacity, resource.amount);
|
||||
return Math.min(bufferCapacity, resource.amount);
|
||||
}
|
||||
|
||||
if (!fluidInput.isFluidEqual(resource))
|
||||
@@ -427,7 +433,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Math.min(capacity - fluidInput.amount, resource.amount);
|
||||
return Math.min(bufferCapacity - fluidInput.amount, resource.amount);
|
||||
}
|
||||
|
||||
if (fluidInput == null)
|
||||
@@ -447,13 +453,17 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
return 0;
|
||||
}
|
||||
|
||||
int filled = capacity - fluidInput.amount;
|
||||
int filled = bufferCapacity - fluidInput.amount;
|
||||
|
||||
if (resource.amount < filled)
|
||||
{
|
||||
fluidInput.amount += resource.amount;
|
||||
filled = resource.amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
fluidInput.amount = bufferCapacity;
|
||||
}
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
|
||||
@@ -602,9 +602,10 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
if (fluidInput == null)
|
||||
{
|
||||
fluidInput = new FluidStack(resource, Math.min(bufferCapacity, resource.amount));
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this, fluidInput.amount));
|
||||
}
|
||||
|
||||
return fluidInput.amount;
|
||||
@@ -629,7 +630,7 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this, fluidInput.amount));
|
||||
}
|
||||
|
||||
return filled;
|
||||
@@ -663,7 +664,7 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
|
||||
if (this != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluidOutput, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this));
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluidOutput, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this, fluidOutput.amount));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user