mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-27 23:45:55 +00:00
Implement advanced ender fluid conduits
Adaptation of code in: * https://github.com/GTNewHorizons/EnderIO/pull/23 Co-Authored-By: Prometheus0000 <[email protected]>
This commit is contained in:
1 parent
a6c00f117c
commit
f8605f6642
34 files changed
+728
-503
No files matched your search
@@ -36,6 +36,8 @@ import crazypants.enderio.conduit.gas.GasConduit;
|
||||
import crazypants.enderio.conduit.gas.GasConduitRenderer;
|
||||
import crazypants.enderio.conduit.gas.GasUtil;
|
||||
import crazypants.enderio.conduit.item.ItemConduit;
|
||||
import crazypants.enderio.conduit.liquid.AbstractEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AdvancedEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AdvancedLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AdvancedLiquidConduitRenderer;
|
||||
import crazypants.enderio.conduit.liquid.EnderLiquidConduit;
|
||||
@@ -212,7 +214,9 @@ public class ClientProxy extends CommonProxy {
|
||||
PowerConduitEndergy.initIcons();
|
||||
LiquidConduit.initIcons();
|
||||
AdvancedLiquidConduit.initIcons();
|
||||
AbstractEnderLiquidConduit.initIcons();
|
||||
EnderLiquidConduit.initIcons();
|
||||
AdvancedEnderLiquidConduit.initIcons();
|
||||
ItemConduit.initIcons();
|
||||
if(GasUtil.isGasConduitEnabled()) {
|
||||
GasConduit.initIcons();
|
||||
|
||||
@@ -33,6 +33,7 @@ import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.ItemConduitNetwork;
|
||||
import crazypants.enderio.conduit.liquid.AdvancedEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AdvancedLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AdvancedLiquidConduitNetwork;
|
||||
import crazypants.enderio.conduit.liquid.EnderLiquidConduit;
|
||||
@@ -632,8 +633,10 @@ public abstract class AbstractConduit implements IConduit {
|
||||
return new RedstoneConduitNetwork();
|
||||
} else if (IPowerConduit.class.isAssignableFrom(type)) {
|
||||
return new PowerConduitNetwork();
|
||||
} else if (AdvancedEnderLiquidConduit.class.isAssignableFrom(type)) {
|
||||
return new EnderLiquidConduitNetwork(AdvancedEnderLiquidConduit.TYPE);
|
||||
} else if (EnderLiquidConduit.class.isAssignableFrom(type)) {
|
||||
return new EnderLiquidConduitNetwork();
|
||||
return new EnderLiquidConduitNetwork(EnderLiquidConduit.TYPE);
|
||||
} else if (AdvancedLiquidConduit.class.isAssignableFrom(type)) {
|
||||
return new AdvancedLiquidConduitNetwork();
|
||||
} else if (ILiquidConduit.class.isAssignableFrom(type)) {
|
||||
|
||||
@@ -66,6 +66,7 @@ public class ConduitRecipes {
|
||||
addShaped(new ItemStack(EnderIO.itemLiquidConduit, numConduits, 0), "bbb", "###", "bbb", 'b', binder, '#', fusedGlass);
|
||||
addShaped(new ItemStack(EnderIO.itemLiquidConduit, numConduits, 1), "bbb", "###", "bbb", 'b', binder, '#', fusedQuartz);
|
||||
addShaped(new ItemStack(EnderIO.itemLiquidConduit, numConduits, 2), "bbb", "#p#", "bbb", 'b', binder, '#', fusedQuartz, 'p', phasedGold);
|
||||
addShaped(new ItemStack(EnderIO.itemLiquidConduit, numConduits, 3), "bpb", "#p#", "bpb", 'b', binder, '#', fusedQuartz, 'p', phasedGold);
|
||||
addShaped(new ItemStack(EnderIO.itemRedstoneConduit, numConduits, 0), "###", '#', redstoneAlloy);
|
||||
addShaped(new ItemStack(EnderIO.itemRedstoneConduit, 1, 1), "lbl", "bcb", "lbl", 'b', binder, 'c', redstoneConduit, 'l', Blocks.lever);
|
||||
addShaped(new ItemStack(EnderIO.itemRedstoneConduit, numConduits, 2), "bbb", "###", "bbb", 'b', binder, '#', redstoneAlloy);
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.enderio.core.common.util.DyeColor;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.liquid.EnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AbstractEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.FluidFilter;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.packet.PacketExtractMode;
|
||||
@@ -60,7 +60,7 @@ public class LiquidSettings extends BaseSettingsPanel {
|
||||
|
||||
private final ILiquidConduit conduit;
|
||||
|
||||
private EnderLiquidConduit eConduit;
|
||||
private AbstractEnderLiquidConduit eConduit;
|
||||
private boolean isEnder;
|
||||
private static final int filterX = 59;
|
||||
private static final int filterY = 63;
|
||||
@@ -75,8 +75,8 @@ public class LiquidSettings extends BaseSettingsPanel {
|
||||
super(IconEIO.WRENCH_OVERLAY_FLUID, EnderIO.lang.localize("itemLiquidConduit.name"), gui, con);
|
||||
|
||||
conduit = (ILiquidConduit) con;
|
||||
if(con instanceof EnderLiquidConduit) {
|
||||
eConduit = (EnderLiquidConduit) con;
|
||||
if(con instanceof AbstractEnderLiquidConduit) {
|
||||
eConduit = (AbstractEnderLiquidConduit) con;
|
||||
isEnder = true;
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.liquid.EnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AbstractEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.FluidFilter;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
@@ -24,7 +24,7 @@ public class PacketFluidChannel extends AbstractConduitPacket<ILiquidConduit> im
|
||||
public PacketFluidChannel() {
|
||||
}
|
||||
|
||||
public PacketFluidChannel(EnderLiquidConduit eConduit, ForgeDirection dir, boolean isInput, DyeColor channel) {
|
||||
public PacketFluidChannel(AbstractEnderLiquidConduit eConduit, ForgeDirection dir, boolean isInput, DyeColor channel) {
|
||||
super(eConduit.getBundle().getEntity(), ConTypeEnum.FLUID);
|
||||
this.dir = dir;
|
||||
this.isInput = isInput;
|
||||
@@ -50,10 +50,10 @@ public class PacketFluidChannel extends AbstractConduitPacket<ILiquidConduit> im
|
||||
@Override
|
||||
public IMessage onMessage(PacketFluidChannel message, MessageContext ctx) {
|
||||
ILiquidConduit conduit = message.getTileCasted(ctx);
|
||||
if(! (conduit instanceof EnderLiquidConduit)) {
|
||||
if(! (conduit instanceof AbstractEnderLiquidConduit)) {
|
||||
return null;
|
||||
}
|
||||
EnderLiquidConduit eCon = (EnderLiquidConduit)conduit;
|
||||
AbstractEnderLiquidConduit eCon = (AbstractEnderLiquidConduit)conduit;
|
||||
|
||||
if(message.isInput)
|
||||
eCon.setInputColor(message.dir, message.channel);
|
||||
|
||||
@@ -7,7 +7,7 @@ import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.liquid.EnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AbstractEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.FluidFilter;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
@@ -22,7 +22,7 @@ public class PacketFluidFilter extends AbstractConduitPacket<ILiquidConduit> imp
|
||||
public PacketFluidFilter() {
|
||||
}
|
||||
|
||||
public PacketFluidFilter(EnderLiquidConduit eConduit, ForgeDirection dir, FluidFilter filter, boolean isInput) {
|
||||
public PacketFluidFilter(AbstractEnderLiquidConduit eConduit, ForgeDirection dir, FluidFilter filter, boolean isInput) {
|
||||
super(eConduit.getBundle().getEntity(), ConTypeEnum.FLUID);
|
||||
this.dir = dir;
|
||||
this.filter = filter;
|
||||
@@ -52,10 +52,10 @@ public class PacketFluidFilter extends AbstractConduitPacket<ILiquidConduit> imp
|
||||
@Override
|
||||
public IMessage onMessage(PacketFluidFilter message, MessageContext ctx) {
|
||||
ILiquidConduit conduit = message.getTileCasted(ctx);
|
||||
if(! (conduit instanceof EnderLiquidConduit)) {
|
||||
if(! (conduit instanceof AbstractEnderLiquidConduit)) {
|
||||
return null;
|
||||
}
|
||||
EnderLiquidConduit eCon = (EnderLiquidConduit)conduit;
|
||||
AbstractEnderLiquidConduit eCon = (AbstractEnderLiquidConduit)conduit;
|
||||
eCon.setFilter(message.dir, message.filter, message.isInput);
|
||||
message.getWorld(ctx).markBlockForUpdate(message.x, message.y, message.z);
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,504 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.item.ItemConduit;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public abstract class AbstractEnderLiquidConduit extends AbstractLiquidConduit {
|
||||
|
||||
public static final String ICON_KEY_INPUT = ItemConduit.ICON_KEY_INPUT;
|
||||
public static final String ICON_KEY_OUTPUT = ItemConduit.ICON_KEY_OUTPUT;
|
||||
public static final String ICON_KEY_IN_OUT_BG = ItemConduit.ICON_KEY_IN_OUT_BG;
|
||||
public static final String ICON_KEY_IN_OUT_OUT = ItemConduit.ICON_KEY_IN_OUT_OUT;
|
||||
public static final String ICON_KEY_IN_OUT_IN = ItemConduit.ICON_KEY_IN_OUT_IN;
|
||||
|
||||
static final Map<String, IIcon> ICONS = new HashMap<String, IIcon>();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void initIcons() {
|
||||
IconUtil.addIconProvider(new IconUtil.IIconProvider() {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
ICONS.put(ICON_KEY_INPUT, register.registerIcon(ICON_KEY_INPUT));
|
||||
ICONS.put(ICON_KEY_OUTPUT, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
ICONS.put(ICON_KEY_IN_OUT_OUT, register.registerIcon(ICON_KEY_IN_OUT_OUT));
|
||||
ICONS.put(ICON_KEY_IN_OUT_IN, register.registerIcon(ICON_KEY_IN_OUT_IN));
|
||||
ICONS.put(ICON_KEY_IN_OUT_BG, register.registerIcon(ICON_KEY_IN_OUT_BG));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTextureType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
ENDER, ADVANCED;
|
||||
}
|
||||
|
||||
private EnderLiquidConduitNetwork network;
|
||||
private int ticksSinceFailedExtract;
|
||||
|
||||
private final EnumMap<ForgeDirection, FluidFilter> outputFilters = new EnumMap<ForgeDirection, FluidFilter>(ForgeDirection.class);
|
||||
private final EnumMap<ForgeDirection, FluidFilter> inputFilters = new EnumMap<ForgeDirection, FluidFilter>(ForgeDirection.class);
|
||||
|
||||
protected final EnumMap<ForgeDirection, DyeColor> outputColors = new EnumMap<ForgeDirection, DyeColor>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> inputColors = new EnumMap<ForgeDirection, DyeColor>(ForgeDirection.class);
|
||||
|
||||
private int roundRobin = 0;
|
||||
|
||||
public abstract Type getType();
|
||||
protected abstract IIcon getIconKey();
|
||||
protected abstract IIcon getIconCoreKey();
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, RaytraceResult res, List<RaytraceResult> all) {
|
||||
if(player.getCurrentEquippedItem() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(ToolUtil.isToolEquipped(player)) {
|
||||
|
||||
if(!getBundle().getEntity().getWorldObj().isRemote) {
|
||||
|
||||
if(res != null && res.component != null) {
|
||||
|
||||
ForgeDirection connDir = res.component.dir;
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(res.movingObjectPosition.sideHit);
|
||||
|
||||
if(connDir == ForgeDirection.UNKNOWN || connDir == faceHit) {
|
||||
|
||||
if(getConnectionMode(faceHit) == ConnectionMode.DISABLED) {
|
||||
setConnectionMode(faceHit, getNextConnectionMode(faceHit));
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockCoord loc = getLocation().getLocation(faceHit);
|
||||
ILiquidConduit n = ConduitUtil.getConduit(getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, ILiquidConduit.class);
|
||||
if(n == null) {
|
||||
return false;
|
||||
}
|
||||
if(!(n instanceof AbstractEnderLiquidConduit)) {
|
||||
return false;
|
||||
}
|
||||
if(getType() != ((AbstractEnderLiquidConduit) n).getType()) {
|
||||
return false;
|
||||
}
|
||||
return ConduitUtil.joinConduits(this, faceHit);
|
||||
} else if(containsExternalConnection(connDir)) {
|
||||
// Toggle extraction mode
|
||||
setConnectionMode(connDir, getNextConnectionMode(connDir));
|
||||
} else if(containsConduitConnection(connDir)) {
|
||||
ConduitUtil.disconectConduits(this, connDir);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractConduitNetwork<?, ?> getNetwork() {
|
||||
return network;
|
||||
}
|
||||
|
||||
public FluidFilter getFilter(ForgeDirection dir, boolean isInput) {
|
||||
if(isInput) {
|
||||
return inputFilters.get(dir);
|
||||
}
|
||||
return outputFilters.get(dir);
|
||||
}
|
||||
|
||||
public void setFilter(ForgeDirection dir, FluidFilter filter, boolean isInput) {
|
||||
if(isInput) {
|
||||
inputFilters.put(dir, filter);
|
||||
} else {
|
||||
outputFilters.put(dir, filter);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setNetwork(AbstractConduitNetwork<?, ?> network) {
|
||||
if(network == null) {
|
||||
this.network = null;
|
||||
return true;
|
||||
}
|
||||
if(!(network instanceof EnderLiquidConduitNetwork)) {
|
||||
return false;
|
||||
}
|
||||
this.network = (EnderLiquidConduitNetwork) network;
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
this.network.connectionChanged(this, dir);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
if(component.dir == ForgeDirection.UNKNOWN) {
|
||||
return getIconKey();
|
||||
}
|
||||
return getIconCoreKey();
|
||||
}
|
||||
|
||||
public IIcon getTextureForInputMode() {
|
||||
return ICONS.get(ICON_KEY_INPUT);
|
||||
}
|
||||
|
||||
public IIcon getTextureForOutputMode() {
|
||||
return ICONS.get(ICON_KEY_OUTPUT);
|
||||
}
|
||||
|
||||
|
||||
public IIcon getTextureForInOutMode(boolean input) {
|
||||
return input ? ICONS.get(ICON_KEY_IN_OUT_IN) : ICONS.get(ICON_KEY_IN_OUT_OUT);
|
||||
}
|
||||
|
||||
public IIcon getTextureForInOutBackground() {
|
||||
return ICONS.get(ICON_KEY_IN_OUT_BG);
|
||||
}
|
||||
@Override
|
||||
public IIcon getTransmitionTextureForState(CollidableComponent component) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToConduit(ForgeDirection direction, IConduit con) {
|
||||
if(!super.canConnectToConduit(direction, con)) {
|
||||
return false;
|
||||
}
|
||||
if(!(con instanceof AbstractEnderLiquidConduit)) {
|
||||
return false;
|
||||
}
|
||||
if(getType() != ((AbstractEnderLiquidConduit) con).getType()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConnectionMode(ForgeDirection dir, ConnectionMode mode) {
|
||||
super.setConnectionMode(dir, mode);
|
||||
refreshConnections(dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionRedstoneMode(RedstoneControlMode mode, ForgeDirection dir) {
|
||||
super.setExtractionRedstoneMode(mode, dir);
|
||||
refreshConnections(dir);
|
||||
}
|
||||
|
||||
private void refreshConnections(ForgeDirection dir) {
|
||||
if(network == null) {
|
||||
return;
|
||||
}
|
||||
network.connectionChanged(this, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionAdded(ForgeDirection fromDirection) {
|
||||
super.externalConnectionAdded(fromDirection);
|
||||
refreshConnections(fromDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionRemoved(ForgeDirection fromDirection) {
|
||||
super.externalConnectionRemoved(fromDirection);
|
||||
refreshConnections(fromDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(World world) {
|
||||
super.updateEntity(world);
|
||||
if(world.isRemote) {
|
||||
return;
|
||||
}
|
||||
doExtract();
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
if(!hasExtractableMode()) {
|
||||
return;
|
||||
}
|
||||
if(network == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// assume failure, reset to 0 if we do extract
|
||||
ticksSinceFailedExtract++;
|
||||
if(ticksSinceFailedExtract > 25 && ticksSinceFailedExtract % 10 != 0) {
|
||||
// after 25 ticks of failing, only check every 10 ticks
|
||||
return;
|
||||
}
|
||||
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
if(autoExtractForDir(dir)) {
|
||||
if(network.extractFrom(this, dir)) {
|
||||
ticksSinceFailedExtract = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Fluid API
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
if(network == null || !getConnectionMode(from).acceptsInput()) {
|
||||
return 0;
|
||||
}
|
||||
return network.fillFrom(this, from, resource, doFill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid) {
|
||||
if(network == null) {
|
||||
return false;
|
||||
}
|
||||
return getConnectionMode(from).acceptsInput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
|
||||
if(network == null) {
|
||||
return new FluidTankInfo[0];
|
||||
}
|
||||
return network.getTankInfo(this, from);
|
||||
}
|
||||
//@Override
|
||||
public DyeColor getInputColor(ForgeDirection dir) {
|
||||
DyeColor result = inputColors.get(dir);
|
||||
if(result == null) {
|
||||
return DyeColor.GREEN;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//@Override
|
||||
public DyeColor getOutputColor(ForgeDirection dir) {
|
||||
DyeColor result = outputColors.get(dir);
|
||||
if(result == null) {
|
||||
return DyeColor.GREEN;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//@Override
|
||||
public void setInputColor(ForgeDirection dir, DyeColor col) {
|
||||
inputColors.put(dir, col);
|
||||
if(network != null) {
|
||||
network.notifyNetworkOfUpdate();
|
||||
}
|
||||
setClientStateDirty();
|
||||
collidablesDirty = true;
|
||||
}
|
||||
|
||||
//@Override
|
||||
public void setOutputColor(ForgeDirection dir, DyeColor col) {
|
||||
outputColors.put(dir, col);
|
||||
if(network != null) {
|
||||
network.notifyNetworkOfUpdate();
|
||||
}
|
||||
setClientStateDirty();
|
||||
collidablesDirty = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
super.readTypeSettings(dir, dataRoot);
|
||||
|
||||
if (dataRoot.hasKey("inputColor")) {
|
||||
setInputColor(dir, DyeColor.values()[dataRoot.getShort("inputColor")]);
|
||||
}
|
||||
if (dataRoot.hasKey("outputColor")) {
|
||||
setOutputColor(dir, DyeColor.values()[dataRoot.getShort("outputColor")]);
|
||||
}
|
||||
|
||||
if(dataRoot.hasKey("roundRobin")) {
|
||||
setRoundRobin(dir, dataRoot.getBoolean("roundRobin"));
|
||||
} else {
|
||||
setRoundRobin(dir, true);
|
||||
}
|
||||
|
||||
if (dataRoot.hasKey("outputFilters")) {
|
||||
FluidFilter out = new FluidFilter();
|
||||
out.readFromNBT(dataRoot.getCompoundTag("outputFilters"));
|
||||
outputFilters.put(dir, out);
|
||||
}
|
||||
if (dataRoot.hasKey("inputFilters")) {
|
||||
FluidFilter in = new FluidFilter();
|
||||
in.readFromNBT(dataRoot.getCompoundTag("inputFilters"));
|
||||
inputFilters.put(dir, in);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeTypeSettingsToNbt(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
super.writeTypeSettingsToNbt(dir, dataRoot);
|
||||
|
||||
dataRoot.setShort("inputColor", (short)getInputColor(dir).ordinal());
|
||||
dataRoot.setShort("outputColor", (short)getOutputColor(dir).ordinal());
|
||||
|
||||
dataRoot.setBoolean("roundRobin", isRoundRobin(dir));
|
||||
|
||||
FluidFilter out = outputFilters.get(dir);
|
||||
if (out != null) {
|
||||
NBTTagCompound outTag = new NBTTagCompound();
|
||||
out.writeToNBT(outTag);
|
||||
dataRoot.setTag("outputFilters", outTag);
|
||||
}
|
||||
FluidFilter in = inputFilters.get(dir);
|
||||
if (in != null) {
|
||||
NBTTagCompound inTag = new NBTTagCompound();
|
||||
in.writeToNBT(inTag);
|
||||
dataRoot.setTag("inputFilters", inTag);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setInteger("roundRobin", roundRobin);
|
||||
for (Entry<ForgeDirection, FluidFilter> entry : inputFilters.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
FluidFilter f = entry.getValue();
|
||||
if(f != null && !f.isDefault()) {
|
||||
NBTTagCompound itemRoot = new NBTTagCompound();
|
||||
f.writeToNBT(itemRoot);
|
||||
nbtRoot.setTag("inFilts." + entry.getKey().name(), itemRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Entry<ForgeDirection, FluidFilter> entry : outputFilters.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
FluidFilter f = entry.getValue();
|
||||
if(f != null && !f.isDefault()) {
|
||||
NBTTagCompound itemRoot = new NBTTagCompound();
|
||||
f.writeToNBT(itemRoot);
|
||||
nbtRoot.setTag("outFilts." + entry.getKey().name(), itemRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Entry<ForgeDirection, DyeColor> entry : inputColors.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("inSC." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
|
||||
for (Entry<ForgeDirection, DyeColor> entry : outputColors.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("outSC." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) {
|
||||
super.readFromNBT(nbtRoot, nbtVersion);
|
||||
if(nbtRoot.hasKey("roundRobin")) {
|
||||
roundRobin = nbtRoot.getInteger("roundRobin");
|
||||
} else {
|
||||
roundRobin = 0b111111;
|
||||
}
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
String key = "inFilts." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
NBTTagCompound filterTag = (NBTTagCompound) nbtRoot.getTag(key);
|
||||
FluidFilter f = new FluidFilter();
|
||||
f.readFromNBT(filterTag);
|
||||
if(!f.isEmpty()) {
|
||||
inputFilters.put(dir, f);
|
||||
}
|
||||
}
|
||||
|
||||
key = "outFilts." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
NBTTagCompound filterTag = (NBTTagCompound) nbtRoot.getTag(key);
|
||||
FluidFilter f = new FluidFilter();
|
||||
f.readFromNBT(filterTag);
|
||||
if(!f.isEmpty()) {
|
||||
outputFilters.put(dir, f);
|
||||
}
|
||||
}
|
||||
|
||||
key = "inSC." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if(ord >= 0 && ord < DyeColor.values().length) {
|
||||
inputColors.put(dir, DyeColor.values()[ord]);
|
||||
}
|
||||
}
|
||||
|
||||
key = "outSC." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if(ord >= 0 && ord < DyeColor.values().length) {
|
||||
outputColors.put(dir, DyeColor.values()[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean isRoundRobin(ForgeDirection dir) {
|
||||
return (roundRobin & dir.flag) != 0;
|
||||
}
|
||||
|
||||
public void setRoundRobin(ForgeDirection dir, boolean roundRobin) {
|
||||
if (roundRobin)
|
||||
this.roundRobin |= dir.flag;
|
||||
else
|
||||
this.roundRobin &= ~dir.flag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class AdvancedEnderLiquidConduit extends AbstractEnderLiquidConduit {
|
||||
|
||||
public static final Type TYPE = Type.ADVANCED;
|
||||
public static final String ICON_KEY = "enderio:liquidConduitAdvancedEnder";
|
||||
public static final String ICON_CORE_KEY = "enderio:liquidConduitCoreAdvancedEnder";
|
||||
|
||||
static IIcon iconKey;
|
||||
static IIcon iconCoreKey;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void initIcons() {
|
||||
IconUtil.addIconProvider(new IconUtil.IIconProvider() {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
iconKey = register.registerIcon(ICON_KEY);
|
||||
iconCoreKey = register.registerIcon(ICON_CORE_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTextureType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIcon getIconKey() {
|
||||
return iconKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIcon getIconCoreKey() {
|
||||
return iconCoreKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return new ItemStack(EnderIO.itemLiquidConduit, 1, 3);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +1,22 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.*;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.item.ItemConduit;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class EnderLiquidConduit extends AbstractLiquidConduit {
|
||||
public class EnderLiquidConduit extends AbstractEnderLiquidConduit {
|
||||
|
||||
public static final Type TYPE = Type.ENDER;
|
||||
public static final String ICON_KEY = "enderio:liquidConduitEnder";
|
||||
public static final String ICON_CORE_KEY = "enderio:liquidConduitCoreEnder";
|
||||
|
||||
public static final String ICON_KEY_INPUT = ItemConduit.ICON_KEY_INPUT;
|
||||
public static final String ICON_KEY_OUTPUT = ItemConduit.ICON_KEY_OUTPUT;
|
||||
public static final String ICON_KEY_IN_OUT_BG = ItemConduit.ICON_KEY_IN_OUT_BG;
|
||||
public static final String ICON_KEY_IN_OUT_OUT = ItemConduit.ICON_KEY_IN_OUT_OUT;
|
||||
public static final String ICON_KEY_IN_OUT_IN = ItemConduit.ICON_KEY_IN_OUT_IN;
|
||||
|
||||
static final Map<String, IIcon> ICONS = new HashMap<String, IIcon>();
|
||||
static IIcon iconKey;
|
||||
static IIcon iconCoreKey;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void initIcons() {
|
||||
@@ -49,14 +24,8 @@ public class EnderLiquidConduit extends AbstractLiquidConduit {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
ICONS.put(ICON_KEY, register.registerIcon(ICON_KEY));
|
||||
ICONS.put(ICON_CORE_KEY, register.registerIcon(ICON_CORE_KEY));
|
||||
|
||||
ICONS.put(ICON_KEY_INPUT, register.registerIcon(ICON_KEY_INPUT));
|
||||
ICONS.put(ICON_KEY_OUTPUT, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
ICONS.put(ICON_KEY_IN_OUT_OUT, register.registerIcon(ICON_KEY_IN_OUT_OUT));
|
||||
ICONS.put(ICON_KEY_IN_OUT_IN, register.registerIcon(ICON_KEY_IN_OUT_IN));
|
||||
ICONS.put(ICON_KEY_IN_OUT_BG, register.registerIcon(ICON_KEY_IN_OUT_BG));
|
||||
iconKey = register.registerIcon(ICON_KEY);
|
||||
iconCoreKey = register.registerIcon(ICON_CORE_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,435 +36,23 @@ public class EnderLiquidConduit extends AbstractLiquidConduit {
|
||||
});
|
||||
}
|
||||
|
||||
private EnderLiquidConduitNetwork network;
|
||||
private int ticksSinceFailedExtract;
|
||||
@Override
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
private final EnumMap<ForgeDirection, FluidFilter> outputFilters = new EnumMap<ForgeDirection, FluidFilter>(ForgeDirection.class);
|
||||
private final EnumMap<ForgeDirection, FluidFilter> inputFilters = new EnumMap<ForgeDirection, FluidFilter>(ForgeDirection.class);
|
||||
@Override
|
||||
protected IIcon getIconKey() {
|
||||
return iconKey;
|
||||
}
|
||||
|
||||
protected final EnumMap<ForgeDirection, DyeColor> outputColors = new EnumMap<ForgeDirection, DyeColor>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> inputColors = new EnumMap<ForgeDirection, DyeColor>(ForgeDirection.class);
|
||||
|
||||
private int roundRobin = 0;
|
||||
@Override
|
||||
protected IIcon getIconCoreKey() {
|
||||
return iconCoreKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return new ItemStack(EnderIO.itemLiquidConduit, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, RaytraceResult res, List<RaytraceResult> all) {
|
||||
if(player.getCurrentEquippedItem() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(ToolUtil.isToolEquipped(player)) {
|
||||
|
||||
if(!getBundle().getEntity().getWorldObj().isRemote) {
|
||||
|
||||
if(res != null && res.component != null) {
|
||||
|
||||
ForgeDirection connDir = res.component.dir;
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(res.movingObjectPosition.sideHit);
|
||||
|
||||
if(connDir == ForgeDirection.UNKNOWN || connDir == faceHit) {
|
||||
|
||||
if(getConnectionMode(faceHit) == ConnectionMode.DISABLED) {
|
||||
setConnectionMode(faceHit, getNextConnectionMode(faceHit));
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockCoord loc = getLocation().getLocation(faceHit);
|
||||
ILiquidConduit n = ConduitUtil.getConduit(getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, ILiquidConduit.class);
|
||||
if(n == null) {
|
||||
return false;
|
||||
}
|
||||
if(!(n instanceof EnderLiquidConduit)) {
|
||||
return false;
|
||||
}
|
||||
return ConduitUtil.joinConduits(this, faceHit);
|
||||
} else if(containsExternalConnection(connDir)) {
|
||||
// Toggle extraction mode
|
||||
setConnectionMode(connDir, getNextConnectionMode(connDir));
|
||||
} else if(containsConduitConnection(connDir)) {
|
||||
ConduitUtil.disconectConduits(this, connDir);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractConduitNetwork<?, ?> getNetwork() {
|
||||
return network;
|
||||
}
|
||||
|
||||
public FluidFilter getFilter(ForgeDirection dir, boolean isInput) {
|
||||
if(isInput) {
|
||||
return inputFilters.get(dir);
|
||||
}
|
||||
return outputFilters.get(dir);
|
||||
}
|
||||
|
||||
public void setFilter(ForgeDirection dir, FluidFilter filter, boolean isInput) {
|
||||
if(isInput) {
|
||||
inputFilters.put(dir, filter);
|
||||
} else {
|
||||
outputFilters.put(dir, filter);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setNetwork(AbstractConduitNetwork<?, ?> network) {
|
||||
if(network == null) {
|
||||
this.network = null;
|
||||
return true;
|
||||
}
|
||||
if(!(network instanceof EnderLiquidConduitNetwork)) {
|
||||
return false;
|
||||
}
|
||||
this.network = (EnderLiquidConduitNetwork) network;
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
this.network.connectionChanged(this, dir);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
if(component.dir == ForgeDirection.UNKNOWN) {
|
||||
return ICONS.get(ICON_CORE_KEY);
|
||||
}
|
||||
return ICONS.get(ICON_KEY);
|
||||
}
|
||||
|
||||
public IIcon getTextureForInputMode() {
|
||||
return ICONS.get(ICON_KEY_INPUT);
|
||||
}
|
||||
|
||||
public IIcon getTextureForOutputMode() {
|
||||
return ICONS.get(ICON_KEY_OUTPUT);
|
||||
}
|
||||
|
||||
|
||||
public IIcon getTextureForInOutMode(boolean input) {
|
||||
return input ? ICONS.get(ICON_KEY_IN_OUT_IN) : ICONS.get(ICON_KEY_IN_OUT_OUT);
|
||||
}
|
||||
|
||||
public IIcon getTextureForInOutBackground() {
|
||||
return ICONS.get(ICON_KEY_IN_OUT_BG);
|
||||
}
|
||||
@Override
|
||||
public IIcon getTransmitionTextureForState(CollidableComponent component) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToConduit(ForgeDirection direction, IConduit con) {
|
||||
if(!super.canConnectToConduit(direction, con)) {
|
||||
return false;
|
||||
}
|
||||
if(!(con instanceof EnderLiquidConduit)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConnectionMode(ForgeDirection dir, ConnectionMode mode) {
|
||||
super.setConnectionMode(dir, mode);
|
||||
refreshConnections(dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionRedstoneMode(RedstoneControlMode mode, ForgeDirection dir) {
|
||||
super.setExtractionRedstoneMode(mode, dir);
|
||||
refreshConnections(dir);
|
||||
}
|
||||
|
||||
private void refreshConnections(ForgeDirection dir) {
|
||||
if(network == null) {
|
||||
return;
|
||||
}
|
||||
network.connectionChanged(this, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionAdded(ForgeDirection fromDirection) {
|
||||
super.externalConnectionAdded(fromDirection);
|
||||
refreshConnections(fromDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionRemoved(ForgeDirection fromDirection) {
|
||||
super.externalConnectionRemoved(fromDirection);
|
||||
refreshConnections(fromDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(World world) {
|
||||
super.updateEntity(world);
|
||||
if(world.isRemote) {
|
||||
return;
|
||||
}
|
||||
doExtract();
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
if(!hasExtractableMode()) {
|
||||
return;
|
||||
}
|
||||
if(network == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// assume failure, reset to 0 if we do extract
|
||||
ticksSinceFailedExtract++;
|
||||
if(ticksSinceFailedExtract > 25 && ticksSinceFailedExtract % 10 != 0) {
|
||||
// after 25 ticks of failing, only check every 10 ticks
|
||||
return;
|
||||
}
|
||||
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
if(autoExtractForDir(dir)) {
|
||||
if(network.extractFrom(this, dir)) {
|
||||
ticksSinceFailedExtract = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Fluid API
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
if(network == null || !getConnectionMode(from).acceptsInput()) {
|
||||
return 0;
|
||||
}
|
||||
return network.fillFrom(this, from, resource, doFill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid) {
|
||||
if(network == null) {
|
||||
return false;
|
||||
}
|
||||
return getConnectionMode(from).acceptsInput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
|
||||
if(network == null) {
|
||||
return new FluidTankInfo[0];
|
||||
}
|
||||
return network.getTankInfo(this, from);
|
||||
}
|
||||
//@Override
|
||||
public DyeColor getInputColor(ForgeDirection dir) {
|
||||
DyeColor result = inputColors.get(dir);
|
||||
if(result == null) {
|
||||
return DyeColor.GREEN;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//@Override
|
||||
public DyeColor getOutputColor(ForgeDirection dir) {
|
||||
DyeColor result = outputColors.get(dir);
|
||||
if(result == null) {
|
||||
return DyeColor.GREEN;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//@Override
|
||||
public void setInputColor(ForgeDirection dir, DyeColor col) {
|
||||
inputColors.put(dir, col);
|
||||
if(network != null) {
|
||||
network.notifyNetworkOfUpdate();
|
||||
}
|
||||
setClientStateDirty();
|
||||
collidablesDirty = true;
|
||||
}
|
||||
|
||||
//@Override
|
||||
public void setOutputColor(ForgeDirection dir, DyeColor col) {
|
||||
outputColors.put(dir, col);
|
||||
if(network != null) {
|
||||
network.notifyNetworkOfUpdate();
|
||||
}
|
||||
setClientStateDirty();
|
||||
collidablesDirty = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
super.readTypeSettings(dir, dataRoot);
|
||||
|
||||
if (dataRoot.hasKey("inputColor")) {
|
||||
setInputColor(dir, DyeColor.values()[dataRoot.getShort("inputColor")]);
|
||||
}
|
||||
if (dataRoot.hasKey("outputColor")) {
|
||||
setOutputColor(dir, DyeColor.values()[dataRoot.getShort("outputColor")]);
|
||||
}
|
||||
|
||||
if(dataRoot.hasKey("roundRobin")) {
|
||||
setRoundRobin(dir, dataRoot.getBoolean("roundRobin"));
|
||||
} else {
|
||||
setRoundRobin(dir, true);
|
||||
}
|
||||
|
||||
if (dataRoot.hasKey("outputFilters")) {
|
||||
FluidFilter out = new FluidFilter();
|
||||
out.readFromNBT(dataRoot.getCompoundTag("outputFilters"));
|
||||
outputFilters.put(dir, out);
|
||||
}
|
||||
if (dataRoot.hasKey("inputFilters")) {
|
||||
FluidFilter in = new FluidFilter();
|
||||
in.readFromNBT(dataRoot.getCompoundTag("inputFilters"));
|
||||
inputFilters.put(dir, in);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeTypeSettingsToNbt(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
super.writeTypeSettingsToNbt(dir, dataRoot);
|
||||
|
||||
dataRoot.setShort("inputColor", (short)getInputColor(dir).ordinal());
|
||||
dataRoot.setShort("outputColor", (short)getOutputColor(dir).ordinal());
|
||||
|
||||
dataRoot.setBoolean("roundRobin", isRoundRobin(dir));
|
||||
|
||||
FluidFilter out = outputFilters.get(dir);
|
||||
if (out != null) {
|
||||
NBTTagCompound outTag = new NBTTagCompound();
|
||||
out.writeToNBT(outTag);
|
||||
dataRoot.setTag("outputFilters", outTag);
|
||||
}
|
||||
FluidFilter in = inputFilters.get(dir);
|
||||
if (in != null) {
|
||||
NBTTagCompound inTag = new NBTTagCompound();
|
||||
in.writeToNBT(inTag);
|
||||
dataRoot.setTag("inputFilters", inTag);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setInteger("roundRobin", roundRobin);
|
||||
for (Entry<ForgeDirection, FluidFilter> entry : inputFilters.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
FluidFilter f = entry.getValue();
|
||||
if(f != null && !f.isDefault()) {
|
||||
NBTTagCompound itemRoot = new NBTTagCompound();
|
||||
f.writeToNBT(itemRoot);
|
||||
nbtRoot.setTag("inFilts." + entry.getKey().name(), itemRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Entry<ForgeDirection, FluidFilter> entry : outputFilters.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
FluidFilter f = entry.getValue();
|
||||
if(f != null && !f.isDefault()) {
|
||||
NBTTagCompound itemRoot = new NBTTagCompound();
|
||||
f.writeToNBT(itemRoot);
|
||||
nbtRoot.setTag("outFilts." + entry.getKey().name(), itemRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Entry<ForgeDirection, DyeColor> entry : inputColors.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("inSC." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
|
||||
for (Entry<ForgeDirection, DyeColor> entry : outputColors.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("outSC." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) {
|
||||
super.readFromNBT(nbtRoot, nbtVersion);
|
||||
if(nbtRoot.hasKey("roundRobin")) {
|
||||
roundRobin = nbtRoot.getInteger("roundRobin");
|
||||
} else {
|
||||
roundRobin = 0b111111;
|
||||
}
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
String key = "inFilts." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
NBTTagCompound filterTag = (NBTTagCompound) nbtRoot.getTag(key);
|
||||
FluidFilter f = new FluidFilter();
|
||||
f.readFromNBT(filterTag);
|
||||
if(!f.isEmpty()) {
|
||||
inputFilters.put(dir, f);
|
||||
}
|
||||
}
|
||||
|
||||
key = "outFilts." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
NBTTagCompound filterTag = (NBTTagCompound) nbtRoot.getTag(key);
|
||||
FluidFilter f = new FluidFilter();
|
||||
f.readFromNBT(filterTag);
|
||||
if(!f.isEmpty()) {
|
||||
outputFilters.put(dir, f);
|
||||
}
|
||||
}
|
||||
|
||||
key = "inSC." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if(ord >= 0 && ord < DyeColor.values().length) {
|
||||
inputColors.put(dir, DyeColor.values()[ord]);
|
||||
}
|
||||
}
|
||||
|
||||
key = "outSC." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if(ord >= 0 && ord < DyeColor.values().length) {
|
||||
outputColors.put(dir, DyeColor.values()[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean isRoundRobin(ForgeDirection dir) {
|
||||
return (roundRobin & dir.flag) != 0;
|
||||
}
|
||||
|
||||
public void setRoundRobin(ForgeDirection dir, boolean roundRobin) {
|
||||
if (roundRobin)
|
||||
this.roundRobin |= dir.flag;
|
||||
else
|
||||
this.roundRobin &= ~dir.flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidConduit, EnderLiquidConduit> {
|
||||
public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidConduit, AbstractEnderLiquidConduit> {
|
||||
private class TankIterator implements Iterator<NetworkTank> {
|
||||
private int index = -1;
|
||||
private int currentCount = 0;
|
||||
@@ -54,8 +54,33 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
}
|
||||
}
|
||||
|
||||
public static final int MAX_EXTRACT_PER_TICK = Config.enderFluidConduitExtractRate;
|
||||
public static final int MAX_IO_PER_TICK = Config.enderFluidConduitMaxIoRate;
|
||||
public static int getMaxExtractPerTick(AbstractEnderLiquidConduit.Type type) {
|
||||
switch (type) {
|
||||
case ENDER:
|
||||
return Config.enderFluidConduitExtractRate;
|
||||
|
||||
case ADVANCED:
|
||||
return Config.advancedEnderFluidConduitExtractRate;
|
||||
|
||||
default:
|
||||
throw new IllegalArgumentException("Unrecognized ender fluid conduit type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getMaxIoPerTick(AbstractEnderLiquidConduit.Type type) {
|
||||
switch (type) {
|
||||
case ENDER:
|
||||
return Config.enderFluidConduitMaxIoRate;
|
||||
|
||||
case ADVANCED:
|
||||
return Config.advancedEnderFluidConduitMaxIoRate;
|
||||
|
||||
default:
|
||||
throw new IllegalArgumentException("Unrecognized ender fluid conduit type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
private final AbstractEnderLiquidConduit.Type type;
|
||||
|
||||
List<NetworkTank> tanks = new ArrayList<NetworkTank>();
|
||||
Map<NetworkTankKey, NetworkTank> tankMap = new HashMap<NetworkTankKey, NetworkTank>();
|
||||
@@ -64,11 +89,12 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
|
||||
boolean filling;
|
||||
|
||||
public EnderLiquidConduitNetwork() {
|
||||
super(EnderLiquidConduit.class, ILiquidConduit.class);
|
||||
public EnderLiquidConduitNetwork(AbstractEnderLiquidConduit.Type type) {
|
||||
super(AbstractEnderLiquidConduit.class, ILiquidConduit.class);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void connectionChanged(EnderLiquidConduit con, ForgeDirection conDir) {
|
||||
public void connectionChanged(AbstractEnderLiquidConduit con, ForgeDirection conDir) {
|
||||
NetworkTankKey key = new NetworkTankKey(con, conDir);
|
||||
NetworkTank tank = new NetworkTank(con, conDir);
|
||||
tanks.remove(tank); // remove old tank, NB: =/hash is only calced on location and dir
|
||||
@@ -77,12 +103,12 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
tankMap.put(key, tank);
|
||||
}
|
||||
|
||||
public boolean extractFrom(EnderLiquidConduit con, ForgeDirection conDir) {
|
||||
public boolean extractFrom(AbstractEnderLiquidConduit con, ForgeDirection conDir) {
|
||||
NetworkTank tank = getTank(con, conDir);
|
||||
if(tank == null || !tank.isValid()) {
|
||||
return false;
|
||||
}
|
||||
FluidStack drained = tank.externalTank.drain(conDir.getOpposite(), MAX_EXTRACT_PER_TICK, false);
|
||||
FluidStack drained = tank.externalTank.drain(conDir.getOpposite(), getMaxExtractPerTick(type), false);
|
||||
if(drained == null || drained.amount <= 0 || !matchedFilter(drained, con, conDir, true)) {
|
||||
return false;
|
||||
}
|
||||
@@ -95,17 +121,17 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
return false;
|
||||
}
|
||||
// if(drained.amount != amountAccepted) {
|
||||
// Log.warn("EnderLiquidConduit.extractFrom: Extracted fluid volume is not equal to inserted volume. Drained=" + drained.amount + " filled="
|
||||
// Log.warn("AbstractEnderLiquidConduit.extractFrom: Extracted fluid volume is not equal to inserted volume. Drained=" + drained.amount + " filled="
|
||||
// + amountAccepted + " Fluid: " + drained + " Accepted=" + amountAccepted);
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
private NetworkTank getTank(EnderLiquidConduit con, ForgeDirection conDir) {
|
||||
private NetworkTank getTank(AbstractEnderLiquidConduit con, ForgeDirection conDir) {
|
||||
return tankMap.get(new NetworkTankKey(con, conDir));
|
||||
}
|
||||
|
||||
public int fillFrom(EnderLiquidConduit con, ForgeDirection conDir, FluidStack resource, boolean doFill) {
|
||||
public int fillFrom(AbstractEnderLiquidConduit con, ForgeDirection conDir, FluidStack resource, boolean doFill) {
|
||||
return fillFrom(getTank(con, conDir), resource, doFill);
|
||||
}
|
||||
|
||||
@@ -123,7 +149,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
return 0;
|
||||
}
|
||||
resource = resource.copy();
|
||||
resource.amount = Math.min(resource.amount, MAX_IO_PER_TICK);
|
||||
resource.amount = Math.min(resource.amount, getMaxIoPerTick(type));
|
||||
int filled = 0;
|
||||
int remaining = resource.amount;
|
||||
//TODO: Only change starting pos of iterator is doFill is true so a false then true returns the same
|
||||
@@ -150,7 +176,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
}
|
||||
}
|
||||
|
||||
private boolean matchedFilter(FluidStack drained, EnderLiquidConduit con, ForgeDirection conDir, boolean isInput) {
|
||||
private boolean matchedFilter(FluidStack drained, AbstractEnderLiquidConduit con, ForgeDirection conDir, boolean isInput) {
|
||||
if(drained == null || con == null || conDir == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -173,7 +199,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
return res;
|
||||
}
|
||||
|
||||
public FluidTankInfo[] getTankInfo(EnderLiquidConduit con, ForgeDirection conDir) {
|
||||
public FluidTankInfo[] getTankInfo(AbstractEnderLiquidConduit con, ForgeDirection conDir) {
|
||||
List<FluidTankInfo> res = new ArrayList<FluidTankInfo>(tanks.size());
|
||||
NetworkTank tank = getTank(con, conDir);
|
||||
for (NetworkTank target : tanks) {
|
||||
@@ -194,7 +220,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
ForgeDirection conDir;
|
||||
BlockCoord conduitLoc;
|
||||
|
||||
public NetworkTankKey(EnderLiquidConduit con, ForgeDirection conDir) {
|
||||
public NetworkTankKey(AbstractEnderLiquidConduit con, ForgeDirection conDir) {
|
||||
this(con.getLocation(), conDir);
|
||||
}
|
||||
|
||||
@@ -241,14 +267,14 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
|
||||
static class NetworkTank {
|
||||
|
||||
EnderLiquidConduit con;
|
||||
AbstractEnderLiquidConduit con;
|
||||
ForgeDirection conDir;
|
||||
IFluidHandler externalTank;
|
||||
ForgeDirection tankDir;
|
||||
BlockCoord conduitLoc;
|
||||
boolean acceptsOuput;
|
||||
|
||||
public NetworkTank(EnderLiquidConduit con, ForgeDirection conDir) {
|
||||
public NetworkTank(AbstractEnderLiquidConduit con, ForgeDirection conDir) {
|
||||
this.con = con;
|
||||
this.conDir = conDir;
|
||||
conduitLoc = con.getLocation();
|
||||
|
||||
@@ -18,7 +18,7 @@ public class EnderLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
if(conduit instanceof EnderLiquidConduit) {
|
||||
if(conduit instanceof AbstractEnderLiquidConduit) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -30,7 +30,7 @@ public class EnderLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
float worldLight, RenderBlocks rb) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
|
||||
EnderLiquidConduit pc = (EnderLiquidConduit) conduit;
|
||||
AbstractEnderLiquidConduit pc = (AbstractEnderLiquidConduit) conduit;
|
||||
for (ForgeDirection dir : conduit.getExternalConnections()) {
|
||||
DyeColor inChannel = null;
|
||||
DyeColor outChannel = null;
|
||||
|
||||
@@ -22,8 +22,8 @@ public class ItemLiquidConduit extends AbstractItemConduit implements IAdvancedT
|
||||
private static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemLiquidConduit.name(), "enderio:itemLiquidConduit"),
|
||||
new ItemConduitSubtype(ModObject.itemLiquidConduit.name() + "Advanced", "enderio:itemLiquidConduitAdvanced"),
|
||||
new ItemConduitSubtype(ModObject.itemLiquidConduit.name() + "Ender", "enderio:itemLiquidConduitEnder")
|
||||
|
||||
new ItemConduitSubtype(ModObject.itemLiquidConduit.name() + "Ender", "enderio:itemLiquidConduitEnder"),
|
||||
new ItemConduitSubtype(ModObject.itemLiquidConduit.name() + "AdvancedEnder", "enderio:itemLiquidConduitAdvancedEnder")
|
||||
};
|
||||
|
||||
public static ItemLiquidConduit create() {
|
||||
@@ -47,6 +47,8 @@ public class ItemLiquidConduit extends AbstractItemConduit implements IAdvancedT
|
||||
return new AdvancedLiquidConduit();
|
||||
} else if(stack.getItemDamage() == 2) {
|
||||
return new EnderLiquidConduit();
|
||||
} else if(stack.getItemDamage() == 3) {
|
||||
return new AdvancedEnderLiquidConduit();
|
||||
}
|
||||
return new LiquidConduit();
|
||||
}
|
||||
@@ -74,9 +76,12 @@ public class ItemLiquidConduit extends AbstractItemConduit implements IAdvancedT
|
||||
} else if(itemstack.getItemDamage() == 1){
|
||||
extractRate = Config.advancedFluidConduitExtractRate;
|
||||
maxIo = Config.advancedFluidConduitMaxIoRate;
|
||||
} else {
|
||||
} else if(itemstack.getItemDamage() == 2){
|
||||
extractRate = Config.enderFluidConduitExtractRate;
|
||||
maxIo = Config.enderFluidConduitMaxIoRate;
|
||||
} else {
|
||||
extractRate = Config.advancedEnderFluidConduitExtractRate;
|
||||
maxIo = Config.advancedEnderFluidConduitMaxIoRate;
|
||||
}
|
||||
String mbt = " " + EnderIO.lang.localize("fluid.millibucketsTick");
|
||||
list.add(EnderIO.lang.localize("itemLiquidConduit.tooltip.maxExtract") + " " + extractRate + mbt);
|
||||
@@ -84,7 +89,7 @@ public class ItemLiquidConduit extends AbstractItemConduit implements IAdvancedT
|
||||
|
||||
if(itemstack.getItemDamage() == 0) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, "enderio.itemLiquidConduit");
|
||||
} else if(itemstack.getItemDamage() == 2) {
|
||||
} else if(itemstack.getItemDamage() == 2 || itemstack.getItemDamage() == 3) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, "enderio.itemLiquidConduitEnder");
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package crazypants.enderio.conduit.packet;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.liquid.EnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AbstractEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -15,7 +15,7 @@ public class PacketRoundRobinMode extends AbstractConduitPacket<ILiquidConduit>
|
||||
public PacketRoundRobinMode() {
|
||||
}
|
||||
|
||||
public PacketRoundRobinMode(EnderLiquidConduit eConduit, ForgeDirection dir) {
|
||||
public PacketRoundRobinMode(AbstractEnderLiquidConduit eConduit, ForgeDirection dir) {
|
||||
super(eConduit.getBundle().getEntity(), ConTypeEnum.FLUID);
|
||||
this.dir = dir;
|
||||
roundRobin = eConduit.isRoundRobin(dir);
|
||||
@@ -38,8 +38,8 @@ public class PacketRoundRobinMode extends AbstractConduitPacket<ILiquidConduit>
|
||||
@Override
|
||||
public IMessage onMessage(PacketRoundRobinMode message, MessageContext ctx) {
|
||||
final ILiquidConduit conduit = message.getTileCasted(ctx);
|
||||
if (conduit instanceof EnderLiquidConduit) {
|
||||
((EnderLiquidConduit) conduit).setRoundRobin(message.dir, message.roundRobin);
|
||||
if (conduit instanceof AbstractEnderLiquidConduit) {
|
||||
((AbstractEnderLiquidConduit) conduit).setRoundRobin(message.dir, message.roundRobin);
|
||||
message.getWorld(ctx).markBlockForUpdate(message.x, message.y, message.z);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -119,6 +119,8 @@ public final class Config {
|
||||
|
||||
public static boolean itemConduitUsePhyscialDistance = false;
|
||||
|
||||
public static int advancedEnderFluidConduitExtractRate = 1000;
|
||||
public static int advancedEnderFluidConduitMaxIoRate = 4000;
|
||||
public static int enderFluidConduitExtractRate = 200;
|
||||
public static int enderFluidConduitMaxIoRate = 800;
|
||||
public static int advancedFluidConduitExtractRate = 100;
|
||||
@@ -711,6 +713,12 @@ public final class Config {
|
||||
enderFluidConduitMaxIoRate = config.get(sectionEfficiency.name, "enderFluidConduitMaxIoRate", enderFluidConduitMaxIoRate,
|
||||
"Number of millibuckets per tick that can pass through a single connection to an ender fluid conduit.").getInt(enderFluidConduitMaxIoRate);
|
||||
|
||||
advancedEnderFluidConduitExtractRate = config.get(sectionEfficiency.name, "advancedEnderFluidConduitExtractRate", advancedEnderFluidConduitExtractRate,
|
||||
"Number of millibuckets per tick extracted by advanced ender fluid conduits auto extracting").getInt(advancedEnderFluidConduitExtractRate);
|
||||
|
||||
advancedEnderFluidConduitMaxIoRate = config.get(sectionEfficiency.name, "advancedEnderFluidConduitMaxIoRate", advancedEnderFluidConduitMaxIoRate,
|
||||
"Number of millibuckets per tick that can pass through a single connection to an advanced ender fluid conduit.").getInt(advancedEnderFluidConduitMaxIoRate);
|
||||
|
||||
gasConduitExtractRate = config.get(sectionEfficiency.name, "gasConduitExtractRate", gasConduitExtractRate,
|
||||
"Amount of gas per tick extracted by gas conduits auto extracting").getInt(gasConduitExtractRate);
|
||||
|
||||
|
||||
Reference in new issue
Block a user