mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-19 19:59:58 +00:00
Remove Mekanism API from shipped APIs. This is only somewhat tested.
This commit is contained in:
1 parent
8420d79140
commit
82ac6b6e1b
69 files changed
+27
-6
No files matched your search
@@ -179,6 +179,7 @@ curse {
|
||||
changelog = System.getenv("CHANGELOG").equals("none") ? getChangelogText() : System.getenv("CHANGELOG")
|
||||
releaseType = project.hasProperty('mod_appendix') ? "${mod_appendix}".toString() : 'release'
|
||||
additionalArtifact deobfJar
|
||||
relatedProject 'endercore'
|
||||
}
|
||||
|
||||
task checkTranslations << {
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -14,6 +14,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
@@ -30,11 +31,13 @@ public abstract class AbstractGasConduit extends AbstractConduit implements IGas
|
||||
protected final Map<ForgeDirection, Integer> externalRedstoneSignals = new HashMap<ForgeDirection, Integer>();
|
||||
protected boolean redstoneStateDirty = true;
|
||||
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public IGasHandler getExternalHandler(ForgeDirection direction) {
|
||||
IGasHandler con = GasUtil.getExternalGasHandler(getBundle().getWorld(), getLocation().getLocation(direction));
|
||||
return (con != null && !(con instanceof IConduitBundle)) ? con : null;
|
||||
}
|
||||
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public IGasHandler getTankContainer(BlockCoord bc) {
|
||||
return GasUtil.getGasHandler(getBundle().getWorld(), bc);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
@@ -97,6 +98,7 @@ public abstract class AbstractGasTankConduit extends AbstractGasConduit {
|
||||
|
||||
public abstract AbstractGasTankConduitNetwork<? extends AbstractGasTankConduit> getTankNetwork();
|
||||
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public void setGasType(GasStack gasType) {
|
||||
if(tank.getGas() != null && tank.getGas().isGasEqual(gasType)) {
|
||||
return;
|
||||
@@ -114,6 +116,7 @@ public abstract class AbstractGasTankConduit extends AbstractGasConduit {
|
||||
return tank;
|
||||
}
|
||||
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public GasStack getGasType() {
|
||||
GasStack result = null;
|
||||
if(getTankNetwork() != null) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.conduit.gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
|
||||
public class ConduitGasTank extends GasTank {
|
||||
|
||||
@@ -55,6 +56,7 @@ public class ConduitGasTank extends GasTank {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public int receive(GasStack resource, boolean doReceive) {
|
||||
if(resource == null || resource.getGas().getID() < 0) {
|
||||
return 0;
|
||||
@@ -95,6 +97,7 @@ public class ConduitGasTank extends GasTank {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public GasStack draw(int maxDrain, boolean doDraw) {
|
||||
if(stored == null || stored.getGas().getID() < 0) {
|
||||
return null;
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
@@ -224,11 +225,13 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public int receiveGas(ForgeDirection side, GasStack stack) {
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public int receiveGas(ForgeDirection side, GasStack stack, boolean doTransfer) {
|
||||
if(network == null || !getConnectionMode(side).acceptsInput()) {
|
||||
return 0;
|
||||
@@ -238,11 +241,13 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public GasStack drawGas(ForgeDirection side, int amount) {
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer) {
|
||||
if(network == null || !getConnectionMode(side).acceptsOutput()) {
|
||||
return null;
|
||||
@@ -251,6 +256,7 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public boolean canReceiveGas(ForgeDirection from, Gas gas) {
|
||||
if(network == null) {
|
||||
return false;
|
||||
@@ -259,6 +265,7 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public boolean canDrawGas(ForgeDirection from, Gas gas) {
|
||||
if(network == null) {
|
||||
return false;
|
||||
|
||||
@@ -16,11 +16,13 @@ public final class GasUtil {
|
||||
|
||||
private static boolean useCheckPerformed = false;
|
||||
private static boolean isGasConduitEnabled = false;
|
||||
|
||||
public static final String API_NAME = "MekanismAPI|gas";
|
||||
|
||||
public static boolean isGasConduitEnabled() {
|
||||
if(!useCheckPerformed) {
|
||||
if(Config.isGasConduitEnabled) {
|
||||
isGasConduitEnabled = ModAPIManager.INSTANCE.hasAPI("MekanismAPI|gas");
|
||||
isGasConduitEnabled = ModAPIManager.INSTANCE.hasAPI(API_NAME);
|
||||
} else {
|
||||
isGasConduitEnabled = false;
|
||||
}
|
||||
@@ -29,24 +31,24 @@ public final class GasUtil {
|
||||
return isGasConduitEnabled;
|
||||
}
|
||||
|
||||
@Method(modid = "MekanismAPI|gas")
|
||||
@Method(modid = API_NAME)
|
||||
public static IGasHandler getExternalGasHandler(IBlockAccess world, BlockCoord bc) {
|
||||
IGasHandler con = getGasHandler(world, bc);
|
||||
return (con != null && !(con instanceof IConduitBundle)) ? con : null;
|
||||
}
|
||||
|
||||
@Method(modid = "MekanismAPI|gas")
|
||||
@Method(modid = API_NAME)
|
||||
public static IGasHandler getGasHandler(IBlockAccess world, BlockCoord bc) {
|
||||
return getGasHandler(world, bc.x, bc.y, bc.z);
|
||||
}
|
||||
|
||||
@Method(modid = "MekanismAPI|gas")
|
||||
@Method(modid = API_NAME)
|
||||
public static IGasHandler getGasHandler(IBlockAccess world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
return getGasHandler(te);
|
||||
}
|
||||
|
||||
@Method(modid = "MekanismAPI|gas")
|
||||
@Method(modid = API_NAME)
|
||||
public static IGasHandler getGasHandler(TileEntity te) {
|
||||
if(te instanceof IGasHandler) {
|
||||
return (IGasHandler) te;
|
||||
@@ -54,7 +56,7 @@ public final class GasUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Method(modid = "MekanismAPI|gas")
|
||||
@Method(modid = API_NAME)
|
||||
public static boolean isGasValid(GasStack gas) {
|
||||
if(gas != null) {
|
||||
String name = gas.getGas().getLocalizedName();
|
||||
|
||||
@@ -2,9 +2,11 @@ package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
|
||||
@Interface(iface = "mekanism.api.gas.IGasHandler", modid = GasUtil.API_NAME)
|
||||
public interface IGasConduit extends IConduit, IGasHandler, IExtractor {
|
||||
|
||||
boolean canOutputToDir(ForgeDirection dir);
|
||||
|
||||
Reference in new issue
Block a user