mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 13:30:04 +00:00
Compare commits
64
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e90fa9478e | ||
|
|
3a7fa881bc | ||
|
|
4ac3c06812 | ||
|
|
29cfee9ab6 | ||
|
|
1057a97d93 | ||
|
|
e00aea2d07 | ||
|
|
c47e49a5aa | ||
|
|
0a21bcf98b | ||
|
|
20a10250df | ||
|
|
c358e041cd | ||
|
|
81c637c37a | ||
|
|
56cdadce75 | ||
|
|
555b5d3071 | ||
|
|
4be7d52d5d | ||
|
|
f29844f2f8 | ||
|
|
f35d6856d5 | ||
|
|
44c33b998c | ||
|
|
9456dd5ecd | ||
|
|
c1ccceb123 | ||
|
|
a900afc9fe | ||
|
|
f876fe9ede | ||
|
|
f942e3a9ab | ||
|
|
15ed08077a | ||
|
|
d4a5bbc9ec | ||
|
|
c8aa902d23 | ||
|
|
a54ee0f6fb | ||
|
|
13e57daf1a | ||
|
|
a90e7c6e09 | ||
|
|
f6242f8862 | ||
|
|
4f61e09ffd | ||
|
|
9176dec955 | ||
|
|
7a00f6e44a | ||
|
|
5adddd2df5 | ||
|
|
b4265992c3 | ||
|
|
e1afdf1c53 | ||
|
|
3107ecf1c0 | ||
|
|
cdc86aaca9 | ||
|
|
53d22de11a | ||
|
|
20e69fa2c3 | ||
|
|
e2947e41c9 | ||
|
|
7a841a1eca | ||
|
|
0039183e37 | ||
|
|
5b2429236c | ||
|
|
024222d305 | ||
|
|
dc50383f00 | ||
|
|
9bc66bbad6 | ||
|
|
9f54e93ade | ||
|
|
4afacb98f0 | ||
|
|
ebd42852ff | ||
|
|
24d30ef078 | ||
|
|
edb027424d | ||
|
|
b9860934ee | ||
|
|
461d574a54 | ||
|
|
644a8a4b42 | ||
|
|
c0b8e58aae | ||
|
|
3567b68acb | ||
|
|
30624682e4 | ||
|
|
7a8ed661cd | ||
|
|
6680f3e91a | ||
|
|
7c567e0c38 | ||
|
|
be7b8d684e | ||
|
|
fce98077ff | ||
|
|
078073e5ce | ||
|
|
34dc6c423b |
No files matched your search
+10
-10
@@ -34,29 +34,29 @@
|
||||
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
|
||||
*/
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.8.40-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-754-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.8.37-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-743-GTNH-pre:dev')
|
||||
api('curse.maven:cofh-core-69162:2388751')
|
||||
api('com.github.GTNewHorizons:waila:1.9.15:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.8.29:dev")
|
||||
api('com.github.GTNewHorizons:waila:1.9.9:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.8.6:dev")
|
||||
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.10:dev") {
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.8-pre:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.4-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.2-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.2:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.8:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.138:dev') {
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.3:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.106:dev') {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.6-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.16-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.4-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.14-GTNH:dev') { transitive = false }
|
||||
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.0:dev")
|
||||
}
|
||||
@@ -16,8 +16,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import com.glodblock.github.common.item.ItemCertusQuartzTank;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
@@ -253,10 +253,10 @@ public class BlockCertusQuartzTank extends BaseBlockContainer implements IRegist
|
||||
public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) {
|
||||
TileEntity tileEntity = worldIn.getTileEntity(x, y, z);
|
||||
if (tileEntity instanceof TileCertusQuartzTank tileCertusQuartzTank) {
|
||||
FluidTankInfo info = tileCertusQuartzTank.getTankInfo(false)[0];
|
||||
if (info.fluid != null) {
|
||||
int nonEmptyBump = info.fluid.amount > 0 ? 1 : 0;
|
||||
return (int) (14.0 * info.fluid.amount / info.capacity) + nonEmptyBump;
|
||||
FluidTankInfo[] info = tileCertusQuartzTank.getTankInfo(false);
|
||||
if (info[0].fluid != null) {
|
||||
int nonEmptyBump = info[0].fluid.amount > 0 ? 1 : 0;
|
||||
return (int) (14.0 * info[0].fluid.amount / info[0].capacity) + nonEmptyBump;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
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.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -101,7 +100,6 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
public static UltraTerminalModes getMode(ItemStack is) {
|
||||
Item item = is.getItem();
|
||||
if (item instanceof ItemWirelessUltraTerminal) {
|
||||
if (!is.hasTagCompound()) is.setTagCompound(new NBTTagCompound());
|
||||
return UltraTerminalModes.values()[is.getTagCompound().getInteger(MODE)];
|
||||
} else if (item instanceof ItemWirelessPatternTerminal) {
|
||||
return UltraTerminalModes.PATTERN;
|
||||
@@ -146,16 +144,4 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
if (wh == null) return null;
|
||||
return new WirelessTerminalGuiObject(wh, is, p, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasInfinityPower(ItemStack is) {
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
return data != null && data.hasKey(infinityEnergyCard) && data.getBoolean(infinityEnergyCard);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasInfinityRange(ItemStack is) {
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
return data != null && data.hasKey(infinityBoosterCard) && data.getBoolean(infinityBoosterCard);
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,6 @@ public class ItemWirelessInterfaceTerminal extends ItemBaseWirelessTerminal
|
||||
public IGuiItemObject getGuiObject(ItemStack is, World world, EntityPlayer p, int x, int y, int z) {
|
||||
final IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler(is);
|
||||
if (wh == null) return null;
|
||||
return new WirelessInterfaceTerminalGuiObject(wh, is, x);
|
||||
return new WirelessInterfaceTerminalGuiObject(wh, is);
|
||||
}
|
||||
}
|
||||
@@ -129,9 +129,7 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
if (terminal == null) return;
|
||||
if (mode != null) setMode(terminal, mode);
|
||||
else mode = getMode(terminal);
|
||||
|
||||
if (AEApi.instance().registries().wireless().performCheck(terminal, player))
|
||||
openGui(terminal, player.worldObj, player, mode, term.getLeft());
|
||||
openGui(terminal, player.worldObj, player, mode, term.getLeft());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +217,7 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
return switch (y != Integer.MIN_VALUE ? UltraTerminalModes.values()[y] : getMode(is)) {
|
||||
case CRAFTING -> new WirelessCraftingTerminalGuiObject(wh, is, p, world, x, y, z);
|
||||
case PATTERN, PATTERN_EX -> new WirelessPatternTerminalGuiObject(wh, is, p, world, x, y, z);
|
||||
case INTERFACE -> new WirelessInterfaceTerminalGuiObject(wh, is, x);
|
||||
case INTERFACE -> new WirelessInterfaceTerminalGuiObject(wh, is);
|
||||
default -> super.getGuiObject(is, world, p, x, y, z);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -95,10 +95,10 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
|
||||
final IMEMonitor<IAEFluidStack> inv, final IEnergySource energy, final FuzzyMode fzMode) {
|
||||
if (myTarget instanceof IFluidHandler fh) {
|
||||
FluidTankInfo[] tanksInfo = fh.getTankInfo(this.getSide().getOpposite());
|
||||
if (tanksInfo == null) return true;
|
||||
if (tanksInfo == null) return false;
|
||||
|
||||
int maxDrain = this.calculateAmountToSend();
|
||||
boolean doBreak = true;
|
||||
boolean drained = false;
|
||||
|
||||
for (FluidTankInfo tankInfo : tanksInfo) {
|
||||
if (tankInfo.fluid == null) continue;
|
||||
@@ -117,14 +117,14 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
|
||||
|
||||
fh.drain(this.getSide().getOpposite(), aeFluidStack.getFluidStack(), true);
|
||||
maxDrain -= aeFluidStack.getFluidStack().amount;
|
||||
doBreak = false;
|
||||
drained = true;
|
||||
}
|
||||
}
|
||||
|
||||
return doBreak;
|
||||
return drained;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,42 +33,57 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
return tankFluid == null || tankFluid.amount == 0 ? 0 : tankFluid.getFluid().getLuminosity(tankFluid);
|
||||
}
|
||||
|
||||
public FluidStack drain(FluidStack fluid, boolean doDrain, boolean findMainTank) {
|
||||
if (fluid == null || this.getFluid() == null || this.getFluid() != fluid.getFluid()) {
|
||||
public FluidStack drain(Fluid fluid, int amount, boolean doDrain, boolean findMainTank) {
|
||||
if (fluid != null && this.getFluid() != fluid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (findMainTank) {
|
||||
// Main tank is the highest tank in the column with desired fluid
|
||||
TileCertusQuartzTank mainTank = this;
|
||||
TileCertusQuartzTank tankAbove;
|
||||
|
||||
while ((tankAbove = mainTank.getTankAbove()) != null) {
|
||||
// We can't drain tank with different or null fluid
|
||||
if (fluid.getFluid() != tankAbove.getFluid()) {
|
||||
break;
|
||||
if (this.tank.getFluid() != null) {
|
||||
// Current tank has a fluid, searching for the highest tank with this fluid
|
||||
TileCertusQuartzTank tankAbove;
|
||||
while ((tankAbove = mainTank.getTankAbove()) != null) {
|
||||
// We can't drain tank with different or null fluid
|
||||
if (tankAbove.getFluid() == null || mainTank.getFluid() != tankAbove.getFluid()) {
|
||||
break;
|
||||
}
|
||||
mainTank = tankAbove;
|
||||
}
|
||||
} else {
|
||||
// Current tank doesn't have a fluid, searching for the first non-empty tank below
|
||||
TileCertusQuartzTank tankBelow;
|
||||
while ((tankBelow = mainTank.getTankBelow()) != null) {
|
||||
// We can't drain tank with different fluid
|
||||
if (fluid != null && tankBelow.getFluid() != fluid) {
|
||||
break;
|
||||
}
|
||||
mainTank = tankBelow;
|
||||
if (tankBelow.getFluid() != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
mainTank = tankAbove;
|
||||
}
|
||||
|
||||
return mainTank.drain(fluid, doDrain, false);
|
||||
return mainTank.drain(fluid, amount, doDrain, false);
|
||||
}
|
||||
|
||||
FluidStack drainedFluid = this.tank.drain(fluid.amount, doDrain);
|
||||
FluidStack drainedFluid = this.tank.drain(amount, doDrain);
|
||||
int drained = drainedFluid != null ? drainedFluid.amount : 0;
|
||||
|
||||
if (drained > 0) {
|
||||
update();
|
||||
}
|
||||
|
||||
if (drained < fluid.amount) {
|
||||
if (drained < amount) {
|
||||
TileCertusQuartzTank tankBelow = this.getTankBelow();
|
||||
if (tankBelow != null) {
|
||||
FluidStack fluidToDrain = new FluidStack(fluid.getFluid(), fluid.amount - drained);
|
||||
FluidStack externallyDrained = tankBelow.drain(fluidToDrain, doDrain, false);
|
||||
FluidStack externallyDrained = tankBelow.drain(fluid, amount - drained, doDrain, false);
|
||||
|
||||
if (externallyDrained != null) {
|
||||
return new FluidStack(fluid.getFluid(), drained + externallyDrained.amount);
|
||||
return new FluidStack(fluid, drained + externallyDrained.amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,14 +93,14 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
return drain(resource, doDrain, true);
|
||||
if (resource == null) return null;
|
||||
|
||||
return drain(resource.getFluid(), resource.amount, doDrain, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
if (this.tank.getFluid() == null) return null;
|
||||
|
||||
return drain(from, new FluidStack(this.tank.getFluid(), maxDrain), doDrain);
|
||||
return drain(null, maxDrain, true, true);
|
||||
}
|
||||
|
||||
public int fill(FluidStack fluid, boolean doFill, boolean findMainTank) {
|
||||
@@ -174,14 +189,14 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
}
|
||||
|
||||
final FluidStack tankFluidStack = this.tank.getFluid();
|
||||
final Fluid mainFluid = tankFluidStack != null ? tankFluidStack.getFluid() : null;
|
||||
Fluid mainFluid = tankFluidStack != null ? tankFluidStack.getFluid() : null;
|
||||
|
||||
int amount = tankFluidStack == null ? 0 : tankFluidStack.amount;
|
||||
int capacity = this.tank.getCapacity();
|
||||
|
||||
TileCertusQuartzTank tankAbove = this;
|
||||
while ((tankAbove = tankAbove.getTankAbove()) != null) {
|
||||
if (tankAbove.getFluid() == null || mainFluid != tankAbove.getFluid()) {
|
||||
if (tankAbove.getFluid() != null && mainFluid != tankAbove.getFluid()) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -192,7 +207,10 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
TileCertusQuartzTank tankBelow = this;
|
||||
while ((tankBelow = tankBelow.getTankBelow()) != null) {
|
||||
if (mainFluid == null || mainFluid != tankBelow.getFluid()) {
|
||||
if (mainFluid == null && tankBelow.getFluid() != null) {
|
||||
mainFluid = tankBelow.getFluid();
|
||||
}
|
||||
if (mainFluid != tankBelow.getFluid()) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -255,24 +255,24 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) {
|
||||
switch (mc) {
|
||||
case setInventorySlotContents -> {
|
||||
if (inv == cell) {
|
||||
if (added != null) {
|
||||
if (added != null) {
|
||||
if (inv == cell) {
|
||||
if (added.getItem() instanceof ItemBasicStorageCell ibsc) {
|
||||
totalBytes = ibsc.getBytesLong(added);
|
||||
} else if (added.getItem() instanceof FCBaseItemCell fcbic) {
|
||||
totalBytes = fcbic.getBytes(added);
|
||||
}
|
||||
getProxy().setIdlePowerUsage(Math.sqrt(Math.pow(totalBytes, 0.576D)));
|
||||
} else if (removed != null) {
|
||||
totalBytes = 0;
|
||||
getProxy().setIdlePowerUsage(4d);
|
||||
}
|
||||
} else if (inv == invItems) {
|
||||
if (added != null) {
|
||||
} else if (inv == invItems) {
|
||||
storedItemCount += added.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
if (removed != null) {
|
||||
if (removed != null) {
|
||||
if (inv == cell) {
|
||||
totalBytes = 0;
|
||||
getProxy().setIdlePowerUsage(4d);
|
||||
} else if (inv == invItems) {
|
||||
storedItemCount -= removed.stackSize;
|
||||
}
|
||||
}
|
||||
@@ -282,12 +282,11 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
|
||||
totalBytes = 0;
|
||||
getProxy().setIdlePowerUsage(4d);
|
||||
}
|
||||
|
||||
if (inv == invItems) {
|
||||
storedItemCount -= removed.stackSize;
|
||||
}
|
||||
}
|
||||
case markDirty -> markDirty();
|
||||
case markDirty -> {}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
+5
-3
@@ -20,9 +20,11 @@ public class CertusQuartzTankWailaDataProvider extends BaseWailaDataProvider {
|
||||
TileEntity tileEntity = accessor.getTileEntity();
|
||||
if (tileEntity instanceof TileCertusQuartzTank quartzTank) {
|
||||
FluidTankInfo info = quartzTank.getTankInfo(true)[0];
|
||||
if (info.fluid != null) {
|
||||
currentToolTip
|
||||
.add(Tooltip.fluidFormat(info.fluid.getLocalizedName(), info.fluid.amount, info.capacity));
|
||||
if (info.fluid == null) {
|
||||
currentToolTip.add(Tooltip.tankEmptyFormat(info.capacity));
|
||||
} else {
|
||||
currentToolTip.add(
|
||||
Tooltip.tankWithFluidFormat(info.fluid.getLocalizedName(), info.fluid.amount, info.capacity));
|
||||
}
|
||||
}
|
||||
return currentToolTip;
|
||||
|
||||
@@ -15,14 +15,18 @@ public class Tooltip {
|
||||
return String.format("%s: %s mB", name, NumberFormat.getInstance().format(amount));
|
||||
}
|
||||
|
||||
public static String fluidFormat(String name, long amount, long capacity) {
|
||||
public static String tankWithFluidFormat(String fluidName, long amount, long capacity) {
|
||||
return String.format(
|
||||
"%s: %s mB / %s mB",
|
||||
name,
|
||||
fluidName,
|
||||
NumberFormat.getInstance().format(amount),
|
||||
NumberFormat.getInstance().format(capacity));
|
||||
}
|
||||
|
||||
public static String tankEmptyFormat(long capacity) {
|
||||
return String.format("0 mB / %s mB", NumberFormat.getInstance().format(capacity));
|
||||
}
|
||||
|
||||
public static String partFluidBusFormat(int amount) {
|
||||
return String
|
||||
.format("%s: %s mB/t", I18n.format(NameConst.WAILA_SPEED), NumberFormat.getInstance().format(amount));
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FluidPrimaryGui extends PrimaryGui {
|
||||
p,
|
||||
p.worldObj,
|
||||
new BlockPos(
|
||||
this.slotIndex == Integer.MIN_VALUE ? p.inventory.currentItem : this.slotIndex,
|
||||
p.inventory.currentItem,
|
||||
Util.GuiHelper.encodeType(0, Util.GuiHelper.GuiType.ITEM),
|
||||
0),
|
||||
Objects.requireNonNull(side),
|
||||
|
||||
Reference in new issue
Block a user