mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 17:44:46 +00:00
Certus Quartz Tank add waila support
fluid packet decode add support to use conduit to export fluid
This commit is contained in:
1 parent
ebf5a23ab9
commit
78e9291fc6
8 files changed
+285
-7
No files matched your search
@@ -40,6 +40,10 @@ public class BlockPos {
|
||||
return new BlockPos(this.x + face.offsetX, this.y + face.offsetY, this.z + face.offsetZ, this.w);
|
||||
}
|
||||
|
||||
public BlockPos getOffSet(int x, int y, int z) {
|
||||
return new BlockPos(this.x + x, this.y + y, this.z + z, this.w);
|
||||
}
|
||||
|
||||
public TileEntity getTileEntity() {
|
||||
if (w != null) {
|
||||
return w.getTileEntity(x, y, z);
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.glodblock.github.util;
|
||||
import static com.glodblock.github.common.item.ItemBaseWirelessTerminal.infinityBoosterCard;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -415,6 +417,36 @@ public final class Util {
|
||||
|
||||
public static class FluidUtil {
|
||||
|
||||
public static void fluidTankInfoWriteToNBT(FluidTankInfo[] infos, NBTTagCompound data) {
|
||||
int i = 0;
|
||||
for (FluidTankInfo info : infos) {
|
||||
if (info.fluid != null && info.fluid.amount > 0) {
|
||||
NBTTagCompound fs = new NBTTagCompound();
|
||||
info.fluid.writeToNBT(fs);
|
||||
fs.setInteger("capacity", info.capacity);
|
||||
data.setTag("#" + i, fs);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
data.setInteger("fluidInvSize", i);
|
||||
}
|
||||
|
||||
public static FluidTankInfo[] fluidTankInfoReadFromNBT(NBTTagCompound data) {
|
||||
int i = 0;
|
||||
List<FluidTankInfo> infos = new ArrayList<>();
|
||||
while (data.hasKey("fluidInvSize") && i < data.getInteger("fluidInvSize")) {
|
||||
if (data.hasKey("#" + i)) {
|
||||
NBTTagCompound tag = (NBTTagCompound) data.getTag("#" + i);
|
||||
FluidStack fs = FluidStack.loadFluidStackFromNBT(tag);
|
||||
infos.add(new FluidTankInfo(fs, tag.getInteger("capacity")));
|
||||
} else {
|
||||
infos.add(new FluidTankInfo(null, 0));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return infos.toArray(new FluidTankInfo[0]);
|
||||
}
|
||||
|
||||
public static IAEFluidStack createAEFluidStack(Fluid fluid) {
|
||||
return createAEFluidStack(new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user