mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-22 05:02:31 +00:00
Bug fixes and WAILA
This commit is contained in:
1 parent
3f594b1d85
commit
2e87448eb7
27 files changed
+324
-436
No files matched your search
@@ -15,10 +15,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -129,7 +126,7 @@ public class BloodArsenal
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void load(FMLInitializationEvent event)
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
BloodArsenalRecipes.registerBindingRecipes();
|
||||
BloodArsenalRecipes.registerAltarRecipes();
|
||||
@@ -138,6 +135,8 @@ public class BloodArsenal
|
||||
|
||||
proxy.init();
|
||||
|
||||
FMLInterModComms.sendMessage("Waila", "register", "com.arc.bloodarsenal.common.misc.WAILAPlugin.registerAddon");
|
||||
|
||||
vampiricAura = new PotionBloodArsenal(BloodArsenalConfig.vampiricAuraID, false, 0).setIconIndex(0, 0).setPotionName("Vampiric Aura");
|
||||
bleeding = new PotionBloodArsenal(BloodArsenalConfig.bleedingID, true, 0).setIconIndex(1, 0).setPotionName("Bleeding");
|
||||
swimming = new PotionBloodArsenal(BloodArsenalConfig.swimmingID, false, 0).setIconIndex(2, 0).setPotionName("Swimming");
|
||||
|
||||
@@ -48,9 +48,18 @@ public class BlockCompacter extends BlockContainer
|
||||
private float capacityMultiplier;
|
||||
private float orbCapacityMultiplier;
|
||||
private float dislocationMultiplier;
|
||||
private int accelerationUpgrades;
|
||||
private int bufferCapacity;
|
||||
|
||||
private int speedUpgrades = 0;
|
||||
private int efficiencyUpgrades = 0;
|
||||
private int sacrificeUpgrades = 0;
|
||||
private int selfSacrificeUpgrades = 0;
|
||||
private int displacementUpgrades = 0;
|
||||
private int altarCapacitiveUpgrades = 0;
|
||||
private int orbCapacitiveUpgrades = 0;
|
||||
private int betterCapacitiveUpgrades = 0;
|
||||
private int accelerationUpgrades = 0;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -369,6 +378,15 @@ public class BlockCompacter extends BlockContainer
|
||||
orbCapacityMultiplier = (float) (1 + 0.02 * upgrades.getOrbCapacitiveUpgrades());
|
||||
capacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 10 * capacityMultiplier);
|
||||
bufferCapacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 1 * capacityMultiplier);
|
||||
|
||||
speedUpgrades = upgrades.getSpeedUpgrades();
|
||||
efficiencyUpgrades = upgrades.getEfficiencyUpgrades();
|
||||
sacrificeUpgrades = upgrades.getSacrificeUpgrades();
|
||||
selfSacrificeUpgrades = upgrades.getSelfSacrificeUpgrades();
|
||||
displacementUpgrades = upgrades.getDisplacementUpgrades();
|
||||
altarCapacitiveUpgrades = upgrades.getAltarCapacitiveUpgrades();
|
||||
orbCapacitiveUpgrades = upgrades.getOrbCapacitiveUpgrades();
|
||||
betterCapacitiveUpgrades = upgrades.getBetterCapacitiveUpgrades();
|
||||
accelerationUpgrades = upgrades.getAccelerationUpgrades();
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
@@ -421,7 +439,7 @@ public class BlockCompacter extends BlockContainer
|
||||
altar.setCapacityMultiplier(capacityMultiplier);
|
||||
altar.setCapacity(capacity);
|
||||
altar.setBufferCapacity(bufferCapacity);
|
||||
altar.setAccelerationUpgrades(accelerationUpgrades);
|
||||
altar.setUpgrades(speedUpgrades, efficiencyUpgrades, sacrificeUpgrades, selfSacrificeUpgrades, displacementUpgrades, altarCapacitiveUpgrades, orbCapacitiveUpgrades, betterCapacitiveUpgrades, accelerationUpgrades);
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CompactedMRSBlock extends ItemBlock
|
||||
{
|
||||
if (GuiScreen.isShiftKeyDown())
|
||||
{
|
||||
addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
addHiddenTooltip(par1ItemStack, par3List);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -34,7 +34,7 @@ public class CompactedMRSBlock extends ItemBlock
|
||||
}
|
||||
}
|
||||
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, List par3List)
|
||||
{
|
||||
String ritualID = par1ItemStack.getTagCompound().getString("ritualName");
|
||||
String ritualName = Rituals.getNameOfRitual(ritualID);
|
||||
|
||||
@@ -25,7 +25,7 @@ public class PortableAltarBlock extends ItemBlock
|
||||
{
|
||||
if (GuiScreen.isShiftKeyDown())
|
||||
{
|
||||
addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
addHiddenTooltip(par1ItemStack, par3List);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -33,7 +33,7 @@ public class PortableAltarBlock extends ItemBlock
|
||||
}
|
||||
}
|
||||
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, List par3List)
|
||||
{
|
||||
String capacity = par1ItemStack.getTagCompound().getString("capacity");
|
||||
int alterTier = par1ItemStack.getTagCompound().getInteger("upgradeLevel");
|
||||
|
||||
@@ -17,8 +17,6 @@ public class VersionChecker
|
||||
public static boolean startedDownload = false;
|
||||
public static boolean downloadedFile = false;
|
||||
|
||||
private static String BUILD = "GRADLE:BUILD";
|
||||
|
||||
public void init()
|
||||
{
|
||||
new ThreadVersionChecker();
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
package com.arc.bloodarsenal.common.misc;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilDivination;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilSeer;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
|
||||
import com.arc.bloodarsenal.common.block.BlockCompactedMRS;
|
||||
import com.arc.bloodarsenal.common.block.BlockLPMaterializer;
|
||||
import com.arc.bloodarsenal.common.block.BlockLifeInfuser;
|
||||
import com.arc.bloodarsenal.common.block.BlockPortableAltar;
|
||||
import com.arc.bloodarsenal.common.items.sigil.holding.SigilAugmentedHolding;
|
||||
import com.arc.bloodarsenal.common.tileentity.TileCompactedMRS;
|
||||
import com.arc.bloodarsenal.common.tileentity.TileLPMaterializer;
|
||||
import com.arc.bloodarsenal.common.tileentity.TileLifeInfuser;
|
||||
import com.arc.bloodarsenal.common.tileentity.TilePortableAltar;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WAILAPlugin implements IWailaDataProvider
|
||||
{
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor data, IWailaConfigHandler cfg)
|
||||
{
|
||||
return data.getStack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack stack, List<String> tip, IWailaDataAccessor data, IWailaConfigHandler cfg)
|
||||
{
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack stack, List<String> tip, IWailaDataAccessor data, IWailaConfigHandler cfg)
|
||||
{
|
||||
if (data.getTileEntity() != null)
|
||||
{
|
||||
if (data.getTileEntity() instanceof TilePortableAltar)
|
||||
{
|
||||
EntityPlayer player = data.getPlayer();
|
||||
NBTTagCompound tagCompound = data.getNBTData();
|
||||
EnumChatFormatting red = EnumChatFormatting.RED;
|
||||
//Basic
|
||||
int currentEssence = tagCompound.getInteger("currentEssence");
|
||||
int tier = tagCompound.getInteger("upgradeLevel");
|
||||
int capacity = tagCompound.getInteger("capacity");
|
||||
//Extended
|
||||
TilePortableAltar altar = (TilePortableAltar) data.getTileEntity();
|
||||
|
||||
if (player.getCurrentEquippedItem() != null)
|
||||
{
|
||||
if (player.getCurrentEquippedItem().getItem() instanceof SigilDivination || player.getCurrentEquippedItem().getItem() instanceof SigilSeer)
|
||||
{
|
||||
tip.add(StatCollector.translateToLocal("tooltip.currentEssence") + " " + red + currentEssence);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.altarTier") + " " + red + tier);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.capacity") + " " + red + capacity);
|
||||
|
||||
addTonsOfInfo(player, altar, tip, cfg);
|
||||
}
|
||||
else if (player.getCurrentEquippedItem().getItem() instanceof SigilOfHolding)
|
||||
{
|
||||
if (SigilOfHolding.getCurrentSigil(player.getCurrentEquippedItem()).getItem() instanceof SigilDivination || SigilOfHolding.getCurrentSigil(player.getCurrentEquippedItem()).getItem() instanceof SigilSeer)
|
||||
{
|
||||
tip.add(StatCollector.translateToLocal("tooltip.currentEssence") + " " + red + currentEssence);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.altarTier") + " " + red + tier);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.capacity") + " " + red + capacity);
|
||||
}
|
||||
|
||||
addTonsOfInfo(player, altar, tip, cfg);
|
||||
}
|
||||
else if (player.getCurrentEquippedItem().getItem() instanceof SigilAugmentedHolding)
|
||||
{
|
||||
if (SigilAugmentedHolding.getCurrentSigil(player.getCurrentEquippedItem()).getItem() instanceof SigilDivination || SigilAugmentedHolding.getCurrentSigil(player.getCurrentEquippedItem()).getItem() instanceof SigilSeer)
|
||||
{
|
||||
tip.add(StatCollector.translateToLocal("tooltip.currentEssence") + " " + red + currentEssence);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.altarTier") + " " + red + tier);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.capacity") + " " + red + capacity);
|
||||
}
|
||||
|
||||
addTonsOfInfo(player, altar, tip, cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (data.getTileEntity() instanceof TileCompactedMRS)
|
||||
{
|
||||
EnumChatFormatting red = EnumChatFormatting.RED;
|
||||
NBTTagCompound tagCompound = data.getNBTData();
|
||||
|
||||
boolean isRunning = tagCompound.getBoolean("isRunning");
|
||||
String ritualID = tagCompound.getString("ritualName");
|
||||
String ritualName = Rituals.getNameOfRitual(ritualID);
|
||||
int direction = tagCompound.getInteger("direction");
|
||||
|
||||
tip.add(StatCollector.translateToLocal("tooltip.ritualName") + " " + red + ritualName);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.running") + " " + red + (isRunning ? StatCollector.translateToLocal("tooltip.yes") : StatCollector.translateToLocal("tooltip.no")));
|
||||
tip.add(StatCollector.translateToLocal("tooltip.direction") + " " + red + direction);
|
||||
}
|
||||
else if (data.getTileEntity() instanceof TileLifeInfuser)
|
||||
{
|
||||
EnumChatFormatting red = EnumChatFormatting.RED;
|
||||
// NBTTagCompound tagCompound = data.getNBTData();
|
||||
|
||||
// boolean isRunning = tagCompound.getBoolean("isRunning");
|
||||
int currentEssence = ((TileLifeInfuser) data.getTileEntity()).getFluidAmount();
|
||||
|
||||
tip.add(StatCollector.translateToLocal("message.tile.contains") + " " + red + currentEssence);
|
||||
// tip.add(StatCollector.translateToLocal("tooltip.running") + " " + red + (isRunning ? StatCollector.translateToLocal("tooltip.yes") : StatCollector.translateToLocal("tooltip.no")));
|
||||
}
|
||||
else if (data.getTileEntity() instanceof TileLPMaterializer)
|
||||
{
|
||||
EnumChatFormatting red = EnumChatFormatting.RED;
|
||||
|
||||
int currentEssence = ((TileLPMaterializer) data.getTileEntity()).getFluidAmount();
|
||||
|
||||
tip.add(StatCollector.translateToLocal("message.tile.contains") + " " + red + currentEssence);
|
||||
}
|
||||
}
|
||||
|
||||
return tip;
|
||||
}
|
||||
|
||||
protected void addTonsOfInfo(EntityPlayer player, TilePortableAltar altar, List<String> tip, IWailaConfigHandler cfg)
|
||||
{
|
||||
int speedUpgrades = altar.speedUpgrades;
|
||||
int efficiencyUpgrades = altar.efficiencyUpgrades;
|
||||
int sacrificeUpgrades = altar.sacrificeUpgrades;
|
||||
int selfSacrificeUpgrades = altar.selfSacrificeUpgrades;
|
||||
int displacementUpgrades = altar.displacementUpgrades;
|
||||
int altarCapacitiveUpgrades = altar.altarCapacitiveUpgrades;
|
||||
int orbCapacitiveUpgrades = altar.orbCapacitiveUpgrades;
|
||||
int betterCapacitiveUpgrades = altar.betterCapacitiveUpgrades;
|
||||
int accelerationUpgrades = altar.accelerationUpgrades;
|
||||
|
||||
if (cfg.getConfig(showExtendedTooltip) && player.isSneaking())
|
||||
{
|
||||
tip.add(StatCollector.translateToLocal("tooltip.speedUpgrades") + " " + speedUpgrades);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.efficiencyUpgrades") + " " + efficiencyUpgrades);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.sacrificeUpgrades") + " " + sacrificeUpgrades);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.selfSacrificeUpgrades") + " " + selfSacrificeUpgrades);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.displacementUpgrades") + " " + displacementUpgrades);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.altarCapacitiveUpgrades") + " " + altarCapacitiveUpgrades);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.orbCapacitiveUpgrades") + " " + orbCapacitiveUpgrades);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.betterCapacitiveUpgrades") + " " + betterCapacitiveUpgrades);
|
||||
tip.add(StatCollector.translateToLocal("tooltip.accelerationUpgrades") + " " + accelerationUpgrades);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack stack, List<String> tip, IWailaDataAccessor data, IWailaConfigHandler cfg)
|
||||
{
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity tileEntity, NBTTagCompound tag, World world, int x, int y, int z)
|
||||
{
|
||||
if (tileEntity != null)
|
||||
{
|
||||
tileEntity.writeToNBT(tag);
|
||||
}
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
private static String showExtendedTooltip = "bloodarsenal.showExtendedAltarTooltip";
|
||||
|
||||
public static void registerAddon(IWailaRegistrar register)
|
||||
{
|
||||
WAILAPlugin dataProvider = new WAILAPlugin();
|
||||
|
||||
register.addConfig("BloodArsenal", showExtendedTooltip, false);
|
||||
register.registerBodyProvider(dataProvider, BlockPortableAltar.class);
|
||||
register.registerNBTProvider(dataProvider, BlockPortableAltar.class);
|
||||
|
||||
register.registerBodyProvider(dataProvider, BlockCompactedMRS.class);
|
||||
register.registerNBTProvider(dataProvider, BlockCompactedMRS.class);
|
||||
|
||||
register.registerBodyProvider(dataProvider, BlockLifeInfuser.class);
|
||||
register.registerNBTProvider(dataProvider, BlockLifeInfuser.class);
|
||||
|
||||
register.registerBodyProvider(dataProvider, BlockLPMaterializer.class);
|
||||
register.registerBodyProvider(dataProvider, BlockLPMaterializer.class);
|
||||
}
|
||||
}
|
||||
@@ -32,11 +32,6 @@ public enum PacketHandler
|
||||
{
|
||||
addClientHandler();
|
||||
}
|
||||
if (FMLCommonHandler.instance().getSide() == Side.SERVER)
|
||||
{
|
||||
System.out.println("Server sided~");
|
||||
addServerHandler();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -50,15 +45,6 @@ public enum PacketHandler
|
||||
clientChannel.pipeline().addAfter(tileCodec, "TileLPMaterializer", new TileLPMaterializerMessageHandler());
|
||||
}
|
||||
|
||||
@SideOnly(Side.SERVER)
|
||||
private void addServerHandler()
|
||||
{
|
||||
FMLEmbeddedChannel serverChannel = this.channels.get(Side.SERVER);
|
||||
|
||||
String messageCodec = serverChannel.findChannelHandlerNameForType(BATileCodec.class);
|
||||
serverChannel.pipeline().addAfter(messageCodec, "KeyboardMessageHandler", new KeyboardMessageHandler());
|
||||
}
|
||||
|
||||
private static class TilePortableAltarMessageHandler extends SimpleChannelInboundHandler<TilePortableAltarMessage>
|
||||
{
|
||||
@Override
|
||||
@@ -110,21 +96,6 @@ public enum PacketHandler
|
||||
}
|
||||
}
|
||||
|
||||
private static class KeyboardMessageHandler extends SimpleChannelInboundHandler<KeyboardMessage>
|
||||
{
|
||||
public KeyboardMessageHandler()
|
||||
{
|
||||
System.out.println("I am being created");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, KeyboardMessage msg) throws Exception
|
||||
{
|
||||
System.out.println("Hmmm");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static class BAMessage
|
||||
{
|
||||
int index;
|
||||
@@ -163,11 +134,6 @@ public enum PacketHandler
|
||||
int capacity;
|
||||
}
|
||||
|
||||
public static class KeyboardMessage extends BAMessage
|
||||
{
|
||||
byte keyPressed;
|
||||
}
|
||||
|
||||
private class ClientToServerCodec extends FMLIndexedMessageToMessageCodec<BAMessage>
|
||||
{
|
||||
public ClientToServerCodec()
|
||||
|
||||
@@ -76,6 +76,7 @@ public class TileCompactedMRS extends TEMasterStone implements IMasterRitualSton
|
||||
tag.setString("ritualName", ritualName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readClientNBT(NBTTagCompound tag)
|
||||
{
|
||||
ritualName = tag.getString("ritualName");
|
||||
@@ -94,6 +95,7 @@ public class TileCompactedMRS extends TEMasterStone implements IMasterRitualSton
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeClientNBT(NBTTagCompound tag)
|
||||
{
|
||||
tag.setString("ritualName", ritualName);
|
||||
|
||||
@@ -243,7 +243,7 @@ public class TileLPMaterializer extends TileEntity implements IInventory, IFluid
|
||||
|
||||
public void sendChatInfoToPlayer(EntityPlayer player)
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.tile.contains") + " " + this.getFluidAmount() + "LP"));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.tile.contains") + " " + this.getFluidAmount() + "LE"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -275,8 +275,8 @@ public class TileLPMaterializer extends TileEntity implements IInventory, IFluid
|
||||
}
|
||||
}
|
||||
|
||||
FluidStack flMain = new FluidStack(fluidData[0], fluidData[1]);
|
||||
FluidStack flIn = new FluidStack(fluidData[2], fluidData[3]);
|
||||
FluidStack flMain = new FluidStack(fluid, fluidData[1]);
|
||||
FluidStack flIn = new FluidStack(fluidOutput, fluidData[3]);
|
||||
|
||||
this.setMainFluid(flMain);
|
||||
this.setOutputFluid(flIn);
|
||||
@@ -316,6 +316,28 @@ public class TileLPMaterializer extends TileEntity implements IInventory, IFluid
|
||||
{
|
||||
super.updateEntity();
|
||||
|
||||
if (getTankAbove() != null)
|
||||
{
|
||||
IFluidHandler aboveTank = getTankAbove();
|
||||
|
||||
if (aboveTank.canFill(ForgeDirection.DOWN, fluid.getFluid()))
|
||||
{
|
||||
aboveTank.fill(ForgeDirection.DOWN, fluidOutput, true);
|
||||
drain(ForgeDirection.UP, fluidOutput, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (getTankBelow() != null)
|
||||
{
|
||||
IFluidHandler belowTank = getTankBelow();
|
||||
|
||||
if (belowTank.canFill(ForgeDirection.UP, fluid.getFluid()))
|
||||
{
|
||||
belowTank.fill(ForgeDirection.UP, fluidOutput, true);
|
||||
drain(ForgeDirection.DOWN, fluidOutput, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord))
|
||||
{
|
||||
materialize();
|
||||
@@ -373,26 +395,14 @@ public class TileLPMaterializer extends TileEntity implements IInventory, IFluid
|
||||
}
|
||||
}
|
||||
|
||||
private IFluidHandler[] checkForTanks(TileLPMaterializer tile)
|
||||
private IFluidHandler getTankAbove()
|
||||
{
|
||||
ForgeDirection[] directions = ForgeDirection.VALID_DIRECTIONS;
|
||||
return worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) != null && worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) instanceof IFluidHandler ? (IFluidHandler) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) : null;
|
||||
}
|
||||
|
||||
for (ForgeDirection forgeDirection : directions)
|
||||
{
|
||||
IFluidHandler[] fluidHandlers;
|
||||
int x = tile.xCoord;
|
||||
int y = tile.yCoord;
|
||||
int z = tile.zCoord;
|
||||
|
||||
switch (forgeDirection)
|
||||
{
|
||||
case NORTH:
|
||||
worldObj.getTileEntity(x, y, z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
private IFluidHandler getTankBelow()
|
||||
{
|
||||
return worldObj.getTileEntity(xCoord, yCoord - 1, zCoord) != null && worldObj.getTileEntity(xCoord, yCoord - 1, zCoord) instanceof IFluidHandler ? (IFluidHandler) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord) : null;
|
||||
}
|
||||
|
||||
//Fluid Stuffs
|
||||
|
||||
@@ -299,7 +299,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
|
||||
public void sendChatInfoToPlayer(EntityPlayer player)
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.tile.contains") + " " + this.getFluidAmount() + "LP"));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.tile.contains") + " " + this.getFluidAmount() + "LE"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -331,8 +331,8 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
}
|
||||
}
|
||||
|
||||
FluidStack flMain = new FluidStack(fluidData[0], fluidData[1]);
|
||||
FluidStack flIn = new FluidStack(fluidData[2], fluidData[3]);
|
||||
FluidStack flMain = new FluidStack(fluid, fluidData[1]);
|
||||
FluidStack flIn = new FluidStack(fluidInput, fluidData[3]);
|
||||
|
||||
this.setMainFluid(flMain);
|
||||
this.setInputFluid(flIn);
|
||||
@@ -436,7 +436,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this, resource.amount));
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this, fluidInput.amount));
|
||||
}
|
||||
|
||||
return fluidInput.amount;
|
||||
@@ -457,7 +457,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this, resource.amount));
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this, fluidInput.amount));
|
||||
}
|
||||
|
||||
return filled;
|
||||
@@ -501,7 +501,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
return this.fluidInput != null && this.fluid.getFluid().equals(fluidInput.getFluid()) && this.fluid.amount > capacity;
|
||||
return this.fluidInput != null && this.fluid.getFluid().equals(fluidInput.getFluid());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
@@ -32,30 +33,38 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
private int resultID;
|
||||
private int resultDamage;
|
||||
private int upgradeLevel;
|
||||
protected FluidStack fluid;
|
||||
public FluidStack fluid;
|
||||
public int capacity;
|
||||
private boolean isActive;
|
||||
private int liquidRequired; //mB
|
||||
public int liquidRequired; //mB
|
||||
private boolean canBeFilled;
|
||||
private int consumptionRate;
|
||||
public int consumptionRate;
|
||||
private int drainRate;
|
||||
private float consumptionMultiplier;
|
||||
public float consumptionMultiplier;
|
||||
private float efficiencyMultiplier;
|
||||
private float sacrificeEfficiencyMultiplier;
|
||||
private float selfSacrificeEfficiencyMultiplier;
|
||||
private float capacityMultiplier;
|
||||
private float orbCapacityMultiplier;
|
||||
private float dislocationMultiplier;
|
||||
private int accelerationUpgrades;
|
||||
private boolean isUpgraded;
|
||||
private boolean isResultBlock;
|
||||
private int bufferCapacity;
|
||||
protected FluidStack fluidOutput;
|
||||
protected FluidStack fluidInput;
|
||||
private int progress;
|
||||
private int hasChanged = 0;
|
||||
public FluidStack fluidOutput;
|
||||
public FluidStack fluidInput;
|
||||
public int progress;
|
||||
private int cooldownAfterCrafting = 500;
|
||||
|
||||
public int speedUpgrades = 0;
|
||||
public int efficiencyUpgrades = 0;
|
||||
public int sacrificeUpgrades = 0;
|
||||
public int selfSacrificeUpgrades = 0;
|
||||
public int displacementUpgrades = 0;
|
||||
public int altarCapacitiveUpgrades = 0;
|
||||
public int orbCapacitiveUpgrades = 0;
|
||||
public int betterCapacitiveUpgrades = 0;
|
||||
public int accelerationUpgrades = 0;
|
||||
|
||||
private int lockdownDuration;
|
||||
private int demonBloodDuration;
|
||||
|
||||
@@ -421,16 +430,6 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
return fluid;
|
||||
}
|
||||
|
||||
public FluidStack getInputFluid()
|
||||
{
|
||||
return fluidInput;
|
||||
}
|
||||
|
||||
public FluidStack getOutputFluid()
|
||||
{
|
||||
return fluidOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidAmount()
|
||||
{
|
||||
@@ -551,8 +550,16 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
this.capacityMultiplier = capacityMultiplier;
|
||||
}
|
||||
|
||||
public void setAccelerationUpgrades(int accelerationUpgrades)
|
||||
public void setUpgrades(int speedUpgrades, int efficiencyUpgrades, int sacrificeUpgrades, int selfSacrificeUpgrades, int displacementUpgrades, int altarCapacitiveUpgrades, int orbCapacitiveUpgrades, int betterCapacitiveUpgrades, int accelerationUpgrades)
|
||||
{
|
||||
this.speedUpgrades = speedUpgrades;
|
||||
this.efficiencyUpgrades = efficiencyUpgrades;
|
||||
this.sacrificeUpgrades = sacrificeUpgrades;
|
||||
this.selfSacrificeUpgrades = selfSacrificeUpgrades;
|
||||
this.displacementUpgrades = displacementUpgrades;
|
||||
this.altarCapacitiveUpgrades = altarCapacitiveUpgrades;
|
||||
this.orbCapacitiveUpgrades = orbCapacitiveUpgrades;
|
||||
this.betterCapacitiveUpgrades = betterCapacitiveUpgrades;
|
||||
this.accelerationUpgrades = accelerationUpgrades;
|
||||
}
|
||||
|
||||
@@ -935,7 +942,7 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
|
||||
public int[] buildIntDataList()
|
||||
{
|
||||
int[] sortList = new int[1 * 3];
|
||||
int[] sortList = new int[3];//1 * 3
|
||||
int pos = 0;
|
||||
|
||||
for (ItemStack is : inv)
|
||||
@@ -1124,9 +1131,9 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
|
||||
public void sendChatInfoToPlayer(EntityPlayer player)
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("Altar's Current Essence: " + this.fluid.amount + "LP"));
|
||||
player.addChatMessage(new ChatComponentText("Altar's Current Tier: " + this.upgradeLevel));
|
||||
player.addChatMessage(new ChatComponentText("Capacity: " + this.getCapacity() + "LP"));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.altarEssence") + " " + this.fluid.amount + "LP"));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.altarCurrentTier") + " " + this.upgradeLevel));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.capacity") + " " + this.getCapacity() + "LP"));
|
||||
}
|
||||
|
||||
public void sendMoreChatInfoToPlayer(EntityPlayer player)
|
||||
@@ -1134,12 +1141,12 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
if (getStackInSlot(0) != null)
|
||||
{
|
||||
int stackSize = getStackInSlot(0).stackSize;
|
||||
player.addChatMessage(new ChatComponentText("Altar's Progress: " + progress + "LP/" + liquidRequired * stackSize + "LP"));
|
||||
player.addChatMessage(new ChatComponentText("Consumption rate: " + (int) (consumptionRate * (1 + consumptionMultiplier)) + "LP/t"));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.altarProgress") + " " + progress + "LP/" + liquidRequired * stackSize + "LP"));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.consumptionRate") + " " + (int) (consumptionRate * (1 + consumptionMultiplier)) + "LP/t"));
|
||||
}
|
||||
player.addChatMessage(new ChatComponentText("Altar's Current Essence: " + this.fluid.amount + "LP"));
|
||||
player.addChatMessage(new ChatComponentText("Input tank: " + this.fluidInput.amount + "LP"));
|
||||
player.addChatMessage(new ChatComponentText("Output tank: " + this.fluidOutput.amount + "LP"));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.altarEssence") + " " + this.fluid.amount + "LP"));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.inputTank") + " " + this.fluidInput.amount + "LP"));
|
||||
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.outputTank") + " " + this.fluidOutput.amount + "LP"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user