mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-28 15:36:09 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf496967aa |
No files matched your search
@@ -21,7 +21,6 @@ import com.gtnewhorizons.modularui.api.UIInfos;
|
|||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import emt.EMT;
|
import emt.EMT;
|
||||||
import emt.gthandler.common.implementations.automation.EssentiaFiller;
|
|
||||||
import emt.tile.TileEntityEtherealMacerator;
|
import emt.tile.TileEntityEtherealMacerator;
|
||||||
import emt.tile.TileEntityIndustrialWandRecharge;
|
import emt.tile.TileEntityIndustrialWandRecharge;
|
||||||
import ic2.api.item.IC2Items;
|
import ic2.api.item.IC2Items;
|
||||||
@@ -73,8 +72,6 @@ public class BlockMachines extends BlockBaseContainer {
|
|||||||
return new TileEntityIndustrialWandRecharge();
|
return new TileEntityIndustrialWandRecharge();
|
||||||
} else if (meta == 1) {
|
} else if (meta == 1) {
|
||||||
return new TileEntityEtherealMacerator();
|
return new TileEntityEtherealMacerator();
|
||||||
} else if (meta == 2) {
|
|
||||||
return new EssentiaFiller();
|
|
||||||
}
|
}
|
||||||
return super.createTileEntity(world, meta);
|
return super.createTileEntity(world, meta);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,163 +0,0 @@
|
|||||||
package emt.gthandler.common.implementations;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
|
|
||||||
import gregtech.api.enums.GT_Values;
|
|
||||||
import gregtech.api.interfaces.ITexture;
|
|
||||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
|
||||||
import gregtech.api.metatileentity.MetaTileEntity;
|
|
||||||
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
|
|
||||||
import thaumcraft.api.aspects.Aspect;
|
|
||||||
import thaumcraft.api.aspects.AspectList;
|
|
||||||
|
|
||||||
public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
|
|
||||||
|
|
||||||
private static int ApTe = (int) Math.ceil(Aspect.aspects.size() / GT_Values.V.length);
|
|
||||||
private AspectList current = new AspectList();
|
|
||||||
|
|
||||||
public EssentiaHatch(int aID, String aName, String aNameRegional, int aTier) {
|
|
||||||
super(aID, aName, aNameRegional, aTier);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EssentiaHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
|
|
||||||
super(aName, aTier, aDescription, aTextures);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EssentiaHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
|
|
||||||
super(aName, aTier, aDescription, aTextures);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean addAspectList(final AspectList A) {
|
|
||||||
|
|
||||||
if ((this.mTier + 1) * ApTe > A.size() + current.size()) {
|
|
||||||
if (current.visSize() + A.visSize() < (this.mTier + 1) * ApTe * 64) current.add(A);
|
|
||||||
return true;
|
|
||||||
} else return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCurrent(AspectList List) {
|
|
||||||
this.current = List;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AspectList getAspects() {
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
|
|
||||||
return new EssentiaHatch(
|
|
||||||
"Essentia Hatch " + GT_Values.VN[this.mTier],
|
|
||||||
this.mTier,
|
|
||||||
this.getDescription(),
|
|
||||||
this.mTextures);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getInfoData() {
|
|
||||||
ArrayList<String> list = new ArrayList<String>();
|
|
||||||
list.add("This Essentia-Hatch contains:");
|
|
||||||
for (final Aspect A : this.current.aspects.keySet())
|
|
||||||
list.add(A.getName() + ": " + Integer.toString(current.getAmount(A)));
|
|
||||||
|
|
||||||
String[] ret = new String[list.size()];
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
|
||||||
ret[i] = list.get(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* String[] old = super.getInfoData(); if (old.length!=0) { String[] newDescription = new String[old.length +
|
|
||||||
* 1]; for (int i = 0; i < old.length; i++) { newDescription[i] = old[i]; } newDescription[old.length] =
|
|
||||||
* "This Contains: " + current.size() + " different Aspects"; return newDescription; }else return new
|
|
||||||
* String[]{"This Contains: " + current.size() + " different Aspects"};
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getDescription() { // this is the fucking tooltip -_-'
|
|
||||||
return new String[] { "Essentia Hatch for usage in Multiblocks", "Can only be filled with the Essentia Filler",
|
|
||||||
"Can hold " + Integer.toString((ApTe * (mTier + 1))) + " Different Essentia Types",
|
|
||||||
"Can hold " + Integer.toString((64 * ApTe * (mTier + 1))) + " Essentia in total" };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isGivingInformation() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void saveNBTData(NBTTagCompound var1) {
|
|
||||||
|
|
||||||
NBTTagList tlist = new NBTTagList();
|
|
||||||
Aspect[] aspectA = current.getAspects();
|
|
||||||
for (int i = 0; i < aspectA.length; ++i) {
|
|
||||||
Aspect aspect = aspectA[i];
|
|
||||||
if (aspect != null) {
|
|
||||||
NBTTagCompound f = new NBTTagCompound();
|
|
||||||
f.setString("key", aspect.getTag());
|
|
||||||
f.setInteger("amount", current.getAmount(aspect));
|
|
||||||
tlist.appendTag(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var1.setTag("Aspects", tlist);
|
|
||||||
super.saveNBTData(var1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void loadNBTData(NBTTagCompound var1) {
|
|
||||||
current = new AspectList();
|
|
||||||
NBTTagList tlist = var1.getTagList("Aspects", 10);
|
|
||||||
|
|
||||||
for (int j = 0; j < tlist.tagCount(); ++j) {
|
|
||||||
NBTTagCompound rs = tlist.getCompoundTagAt(j);
|
|
||||||
if (rs.hasKey("key")) {
|
|
||||||
current.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.loadNBTData(var1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int fuelleft() {
|
|
||||||
int ret = 0;
|
|
||||||
for (final Aspect A : current.aspects.keySet()) {
|
|
||||||
ret += current.getAmount(A);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFluidInputAllowed(FluidStack aFluid) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection aSide,
|
|
||||||
ItemStack aStack) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection aSide,
|
|
||||||
ItemStack aStack) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getCapacity() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,246 +0,0 @@
|
|||||||
package emt.gthandler.common.implementations.automation;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
|
|
||||||
import emt.gthandler.common.implementations.EssentiaHatch;
|
|
||||||
import emt.tile.TileEntityEMT;
|
|
||||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
|
||||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
|
||||||
import thaumcraft.api.ThaumcraftApiHelper;
|
|
||||||
import thaumcraft.api.aspects.Aspect;
|
|
||||||
import thaumcraft.api.aspects.AspectList;
|
|
||||||
import thaumcraft.api.aspects.IAspectContainer;
|
|
||||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
|
||||||
|
|
||||||
public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, IEssentiaTransport {
|
|
||||||
|
|
||||||
private AspectList current = new AspectList();
|
|
||||||
private byte tick = 0;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
|
||||||
super.writeToNBT(tagCompound);
|
|
||||||
NBTTagList tlist = new NBTTagList();
|
|
||||||
Aspect[] aspectA = current.getAspects();
|
|
||||||
for (int i = 0; i < aspectA.length; ++i) {
|
|
||||||
Aspect aspect = aspectA[i];
|
|
||||||
if (aspect != null) {
|
|
||||||
NBTTagCompound f = new NBTTagCompound();
|
|
||||||
f.setString("key", aspect.getTag());
|
|
||||||
f.setInteger("amount", current.getAmount(aspect));
|
|
||||||
tlist.appendTag(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tagCompound.setTag("Aspects", tlist);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
|
||||||
super.readFromNBT(tagCompound);
|
|
||||||
current = new AspectList();
|
|
||||||
NBTTagList tlist = tagCompound.getTagList("Aspects", 10);
|
|
||||||
for (int j = 0; j < tlist.tagCount(); ++j) {
|
|
||||||
NBTTagCompound rs = tlist.getCompoundTagAt(j);
|
|
||||||
if (rs.hasKey("key")) {
|
|
||||||
current.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateEntity() {
|
|
||||||
++tick;
|
|
||||||
fillfrompipe();
|
|
||||||
if (tick % 20 == 0) {
|
|
||||||
TileEntity T = this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
|
|
||||||
if (checkTE(T)) {
|
|
||||||
tick = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (T == null) T = this.worldObj.getTileEntity(xCoord + 1, yCoord, zCoord);
|
|
||||||
if (checkTE(T)) {
|
|
||||||
tick = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord + 1);
|
|
||||||
if (checkTE(T)) {
|
|
||||||
tick = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
|
||||||
if (checkTE(T)) {
|
|
||||||
tick = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (T == null) T = this.worldObj.getTileEntity(xCoord - 1, yCoord, zCoord);
|
|
||||||
if (checkTE(T)) {
|
|
||||||
tick = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord - 1);
|
|
||||||
if (checkTE(T)) {
|
|
||||||
tick = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean checkTE(final TileEntity T) {
|
|
||||||
if (T == null) return false;
|
|
||||||
if (this.current.visSize() > 0) if (T instanceof IGregTechTileEntity) {
|
|
||||||
IMetaTileEntity M = ((IGregTechTileEntity) T).getMetaTileEntity();
|
|
||||||
if (M instanceof EssentiaHatch) {
|
|
||||||
if (((EssentiaHatch) M).addAspectList(current)) this.current = new AspectList();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void fillfrompipe() {
|
|
||||||
TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
|
|
||||||
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
|
||||||
te[i] = ThaumcraftApiHelper.getConnectableTile(
|
|
||||||
this.worldObj,
|
|
||||||
this.xCoord,
|
|
||||||
this.yCoord,
|
|
||||||
this.zCoord,
|
|
||||||
ForgeDirection.VALID_DIRECTIONS[i]);
|
|
||||||
if (te[i] != null) {
|
|
||||||
IEssentiaTransport pipe = (IEssentiaTransport) te[i];
|
|
||||||
if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null)
|
|
||||||
&& (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i])
|
|
||||||
< getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) {
|
|
||||||
addToContainer(
|
|
||||||
pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]),
|
|
||||||
pipe.takeEssentia(
|
|
||||||
pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]),
|
|
||||||
1,
|
|
||||||
ForgeDirection.VALID_DIRECTIONS[i]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AspectList getAspects() {
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setAspects(AspectList aspectList) {
|
|
||||||
this.current.add(aspectList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean doesContainerAccept(Aspect aspect) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int addToContainer(Aspect aspect, int i) {
|
|
||||||
current.add(aspect, i);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean takeFromContainer(Aspect aspect, int i) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean takeFromContainer(AspectList aspectList) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean doesContainerContainAmount(Aspect aspect, int i) {
|
|
||||||
return current.aspects.containsKey(aspect) && i <= current.getAmount(aspect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean doesContainerContain(AspectList aspectList) {
|
|
||||||
ArrayList<Boolean> ret = new ArrayList<Boolean>();
|
|
||||||
for (Aspect a : aspectList.aspects.keySet()) if (current.aspects.containsKey(a)) {
|
|
||||||
ret.add(true);
|
|
||||||
} else ret.add(false);
|
|
||||||
return !ret.contains(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int containerContains(Aspect aspect) {
|
|
||||||
return current.aspects.containsKey(aspect) ? current.getAmount(aspect) : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isConnectable(ForgeDirection forgeDirection) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInputFrom(ForgeDirection forgeDirection) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canOutputTo(ForgeDirection forgeDirection) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSuction(Aspect aspect, int i) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Aspect getSuctionType(ForgeDirection forgeDirection) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getSuctionAmount(ForgeDirection forgeDirection) {
|
|
||||||
return 256;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int takeEssentia(Aspect aspect, int i, ForgeDirection forgeDirection) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int addEssentia(Aspect aspect, int i, ForgeDirection forgeDirection) {
|
|
||||||
current.add(aspect, i);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Aspect getEssentiaType(ForgeDirection forgeDirection) {
|
|
||||||
return current.getAspects()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getEssentiaAmount(ForgeDirection forgeDirection) {
|
|
||||||
int ret = 0;
|
|
||||||
for (final Aspect A : current.aspects.keySet()) {
|
|
||||||
ret += current.getAmount(A);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMinimumSuction() {
|
|
||||||
return Integer.MAX_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean renderExtendedTube() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -10,10 +10,8 @@ import net.minecraftforge.fluids.FluidStack;
|
|||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import emt.gthandler.common.implementations.EssentiaHatch;
|
|
||||||
import emt.gthandler.common.items.EMT_CasingBlock;
|
import emt.gthandler.common.items.EMT_CasingBlock;
|
||||||
import emt.gthandler.common.tileentities.machines.multi.DE_Fusion_Crafter;
|
import emt.gthandler.common.tileentities.machines.multi.DE_Fusion_Crafter;
|
||||||
import emt.gthandler.common.tileentities.machines.multi.generator.EMT_Large_Essentia_Gen;
|
|
||||||
import emt.tile.GT_MetaTileEntity_ResearchCompleter;
|
import emt.tile.GT_MetaTileEntity_ResearchCompleter;
|
||||||
import gregtech.api.enums.GT_Values;
|
import gregtech.api.enums.GT_Values;
|
||||||
import gregtech.api.enums.ItemList;
|
import gregtech.api.enums.ItemList;
|
||||||
@@ -29,26 +27,12 @@ public class EMT_GT_Loader implements Runnable {
|
|||||||
public static final int TIERS = GT_Values.VN.length - 1;
|
public static final int TIERS = GT_Values.VN.length - 1;
|
||||||
public static int aIDoffset = 13000 - GT_Values.VN.length - 1;
|
public static int aIDoffset = 13000 - GT_Values.VN.length - 1;
|
||||||
public static ItemStack[] EHatch = new ItemStack[TIERS];
|
public static ItemStack[] EHatch = new ItemStack[TIERS];
|
||||||
public static ItemStack LEG;
|
|
||||||
public static ItemStack DECC;
|
public static ItemStack DECC;
|
||||||
public static ItemStack ResearchMultiblock;
|
public static ItemStack ResearchMultiblock;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
for (int i = 0; i < TIERS; i++) {
|
|
||||||
EHatch[i] = new EssentiaHatch(
|
|
||||||
aIDoffset + i,
|
|
||||||
"Essentia Hatch" + GT_Values.VN[i] + " - Marked for Deprecation",
|
|
||||||
"Essentia Hatch " + GT_Values.VN[i] + " - Marked for Deprecation",
|
|
||||||
i).getStackForm(1L);
|
|
||||||
}
|
|
||||||
|
|
||||||
LEG = new EMT_Large_Essentia_Gen(
|
|
||||||
aIDoffset + GT_Values.VN.length + 1,
|
|
||||||
"Large Essentia Generator - Marked for Deprecation",
|
|
||||||
"Large Essentia Generator - Marked for Deprecation").getStackForm(1L);
|
|
||||||
|
|
||||||
// Dragonblood recipe for magics haters
|
// Dragonblood recipe for magics haters
|
||||||
if (Loader.isModLoaded("miscutils")) {
|
if (Loader.isModLoaded("miscutils")) {
|
||||||
GT_Values.RA.addMixerRecipe(
|
GT_Values.RA.addMixerRecipe(
|
||||||
|
|||||||
-396
@@ -1,396 +0,0 @@
|
|||||||
package emt.gthandler.common.tileentities.machines.multi.generator;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
|
|
||||||
import emt.gthandler.common.implementations.EssentiaHatch;
|
|
||||||
import emt.gthandler.common.items.EMT_CasingBlock;
|
|
||||||
import emt.util.EMTEssentiasOutputs;
|
|
||||||
import emt.util.EMTTextHelper;
|
|
||||||
import gregtech.api.enums.Materials;
|
|
||||||
import gregtech.api.enums.Textures;
|
|
||||||
import gregtech.api.interfaces.ITexture;
|
|
||||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
|
||||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
|
||||||
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
|
|
||||||
import gregtech.api.objects.GT_RenderedTexture;
|
|
||||||
import gregtech.api.objects.XSTR;
|
|
||||||
import thaumcraft.api.aspects.Aspect;
|
|
||||||
import thaumcraft.api.aspects.AspectList;
|
|
||||||
import thaumcraft.api.visnet.VisNetHandler;
|
|
||||||
import thaumcraft.common.config.ConfigBlocks;
|
|
||||||
|
|
||||||
public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
|
|
||||||
|
|
||||||
private static final byte CASING_INDEX = 2;
|
|
||||||
public ArrayList<EssentiaHatch> mEssentiaHatches = new ArrayList();
|
|
||||||
private byte tick = 0;
|
|
||||||
private boolean has_lube = false;
|
|
||||||
|
|
||||||
public EMT_Large_Essentia_Gen(int aID, String aName, String aNameRegional) {
|
|
||||||
super(aID, aName, aNameRegional);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EMT_Large_Essentia_Gen(String aName) {
|
|
||||||
super(aName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getDescription() {
|
|
||||||
return new String[] { "Does not work, please don't use", "Marked for deprecation", "Added by EMT",
|
|
||||||
"Made by bartimaeusnek" };
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCurrentEfficiency(ItemStack itemStack) {
|
|
||||||
return this.mEfficiency
|
|
||||||
- (this.getIdealStatus() - this.getRepairStatus()) * this.getMaxEfficiency(itemStack) / 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing,
|
|
||||||
int colorIndex, boolean aActive, boolean aRedstone) {
|
|
||||||
if (side == facing) {
|
|
||||||
return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
|
|
||||||
new GT_RenderedTexture(
|
|
||||||
aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE
|
|
||||||
: Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER) };
|
|
||||||
}
|
|
||||||
return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) {
|
|
||||||
return new EMT_Large_Essentia_Gen(this.mName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return new int[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getSizeInventory() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getStackInSlot(int p_70301_1_) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getInventoryName() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return this.mName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasCustomInventoryName() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getInventoryStackLimit() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void markDirty() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void openInventory() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void closeInventory() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) {
|
|
||||||
|
|
||||||
final int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * 3;
|
|
||||||
final int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * 3;
|
|
||||||
|
|
||||||
for (int x = -3; x <= 3; x++) {
|
|
||||||
for (int z = -3; z <= 3; z++) {
|
|
||||||
for (int h = 0; h <= 3; h++) {
|
|
||||||
final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
|
|
||||||
.getIGregTechTileEntityOffset(xDir + x, h, zDir + z);
|
|
||||||
|
|
||||||
if (!(Math.abs(x) == 3 || Math.abs(z) == 3)) {
|
|
||||||
// Muffler on top.
|
|
||||||
if ((h == 3)) {
|
|
||||||
if (!this.addMufflerToMachineList(tTileEntity, CASING_INDEX)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (h != 0) {
|
|
||||||
// inside Special Blocks
|
|
||||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
|
|
||||||
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
|
||||||
return false;
|
|
||||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 1)) return false;
|
|
||||||
} else if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
|
|
||||||
|| this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
|
|
||||||
|| this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
|
|
||||||
|| this.addInputToMachineList(tTileEntity, CASING_INDEX)))
|
|
||||||
// ground still casings
|
|
||||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
|
|
||||||
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
|
||||||
return false;
|
|
||||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
|
|
||||||
|
|
||||||
} else if (h != 0) {
|
|
||||||
// walls
|
|
||||||
if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
|
|
||||||
|| this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
|
|
||||||
|| this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
|
|
||||||
|| this.addInputToMachineList(tTileEntity, CASING_INDEX)))
|
|
||||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
|
|
||||||
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
|
||||||
return false;
|
|
||||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
|
|
||||||
} else if (h == 0) {
|
|
||||||
// top and bottom corners
|
|
||||||
if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
|
|
||||||
|| this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
|
|
||||||
|| this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
|
|
||||||
|| this.addInputToMachineList(tTileEntity, CASING_INDEX)))
|
|
||||||
if (((xDir + x) != 0) || ((zDir + z) != 0)) // controller
|
|
||||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
|
|
||||||
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
|
||||||
return false;
|
|
||||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.mDynamoHatches.size() != 1) return false;
|
|
||||||
|
|
||||||
if (this.mInputHatches.size() != 1) return false;
|
|
||||||
|
|
||||||
if (this.mMaintenanceHatches.size() != 1) return false;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* //repair shit debug shit this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true;
|
|
||||||
* this.mHardHammer = true; this.mSolderingTool = true; this.mCrowbar = true;
|
|
||||||
*/
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
|
|
||||||
if (aTileEntity instanceof EssentiaHatch) return addEssetiaHatchToList(aTileEntity, aBaseCasingIndex);
|
|
||||||
return super.addInputToMachineList(aTileEntity, aBaseCasingIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean addEssetiaHatchToList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
|
|
||||||
if (aTileEntity == null) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
|
|
||||||
if (aMetaTileEntity == null) {
|
|
||||||
return false;
|
|
||||||
} else if (aMetaTileEntity instanceof EssentiaHatch) {
|
|
||||||
((EssentiaHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
|
|
||||||
return this.mEssentiaHatches.add((EssentiaHatch) aMetaTileEntity);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void make_energy() {
|
|
||||||
AspectList fuel = this.mEssentiaHatches.get(0).getAspects();
|
|
||||||
double cached = 0;
|
|
||||||
|
|
||||||
++tick;
|
|
||||||
|
|
||||||
// make energy
|
|
||||||
for (final Aspect A : fuel.aspects.keySet()) {
|
|
||||||
if (fuel.getAmount(A) > 0) {
|
|
||||||
double burnvalue = EMTEssentiasOutputs.outputs.get(A.getTag()).doubleValue();
|
|
||||||
cached += (burnvalue / 20D);
|
|
||||||
cached = Math.ceil(cached);
|
|
||||||
|
|
||||||
if (tick % 20 == 0) { // every second consume 1 essentia
|
|
||||||
// consume essentia and remove it from the Aspect List if its 0
|
|
||||||
this.mEssentiaHatches.get(0).getAspects().reduce(A, 1);
|
|
||||||
if (this.mEssentiaHatches.get(0).getAspects().getAmount(A) == 0)
|
|
||||||
this.mEssentiaHatches.get(0).getAspects().remove(A);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tick % 20 == 0) {
|
|
||||||
// consume lubricant
|
|
||||||
if (has_lube) this.mInputHatches.get(0).getFluid().amount -= 1;
|
|
||||||
|
|
||||||
tick = 0; // reset ticktimer
|
|
||||||
}
|
|
||||||
|
|
||||||
// transfer energy into mEU
|
|
||||||
this.mEUt = (int) Math.ceil(cached);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkRecipe(ItemStack arg0) {
|
|
||||||
/*
|
|
||||||
* if (!this.getBaseMetaTileEntity().isActive()) if (this.mEfficiency > 100) this.mEfficiency -= 8; else
|
|
||||||
* this.mEfficiency = 100;
|
|
||||||
*/
|
|
||||||
if (this.mEssentiaHatches.get(0).fuelleft() > 0) {
|
|
||||||
this.mMaxProgresstime = 1;
|
|
||||||
this.mProgresstime = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.mEssentiaHatches.get(0).fuelleft() > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onRunningTick(ItemStack aStack) {
|
|
||||||
|
|
||||||
if (tick % 20 == 0) { // every second
|
|
||||||
// highers eff to max by 0.16% every running tick = 3,2% every second
|
|
||||||
if (this.mEfficiency < this.getMaxEfficiency(null) - 320) this.mEfficiency += 320;
|
|
||||||
else this.mEfficiency = getMaxEfficiency(null);
|
|
||||||
|
|
||||||
// check for Lubricant
|
|
||||||
this.has_lube = this.mInputHatches.get(0).getFluid() != null
|
|
||||||
&& this.mInputHatches.get(0).getFluid().isFluidEqual(Materials.Lubricant.getFluid(1L))
|
|
||||||
&& this.mInputHatches.get(0).getFluidAmount() > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tick % 2 == 0) { // every 2nd tick
|
|
||||||
|
|
||||||
final XSTR R = new XSTR();
|
|
||||||
final World WORLD = this.getBaseMetaTileEntity().getWorld();
|
|
||||||
int x = this.getBaseMetaTileEntity().getXCoord();
|
|
||||||
int y = this.getBaseMetaTileEntity().getYCoord();
|
|
||||||
int z = this.getBaseMetaTileEntity().getZCoord();
|
|
||||||
|
|
||||||
// if out of aqua, make much flux but to not stop.
|
|
||||||
boolean outOfcVis = VisNetHandler.drainVis(WORLD, x, y, z, Aspect.WATER, 10) <= 9;
|
|
||||||
|
|
||||||
// Random Change of a bit of Flux Gas.
|
|
||||||
final int RANDOMHATCH = R.nextInt(this.mMufflerHatches.size());
|
|
||||||
|
|
||||||
// gets a chanche to release flux gas based on missing efficiency, min 1%
|
|
||||||
if ((R.nextInt(getMaxEfficiency(null)) > (this.mEfficiency > 100 ? this.mEfficiency : 100)) || outOfcVis) {
|
|
||||||
x = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getXCoord();
|
|
||||||
y = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getYCoord() + 1;
|
|
||||||
z = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getZCoord();
|
|
||||||
WORLD.setBlock(x, y, z, ConfigBlocks.blockFluxGas, R.nextInt(8), 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
make_energy();
|
|
||||||
++this.mProgresstime;
|
|
||||||
return super.onRunningTick(aStack);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean explodesOnComponentBreak(ItemStack arg0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getDamageToComponent(ItemStack arg0) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxEfficiency(ItemStack arg0) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return 10000;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getPollutionPerTick(ItemStack arg0) {
|
|
||||||
return has_lube ? 50 : 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCorrectMachinePart(ItemStack arg0) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isGivingInformation() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getInfoData() {
|
|
||||||
String[] old = super.getInfoData();
|
|
||||||
old[2] = "Produces " + EMTTextHelper.RED + mEUt + EMTTextHelper.WHITE + "EU/t";
|
|
||||||
return old;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @Override public void explodeMultiblock() { final World WORLD=this.getBaseMetaTileEntity().getWorld(); final int
|
|
||||||
* xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 3; final int zDir =
|
|
||||||
* ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 3; for (int x = -3; x <= 3;
|
|
||||||
* x++) for (int z = -3; z <= 3; z++) for (int h = 0; h <= 3; h++) WORLD.setBlock(xDir+x,
|
|
||||||
* this.getBaseMetaTileEntity().getYCoord()+h, zDir+z, ConfigBlocks.blockFluxGas, 8, 3); super.explodeMultiblock();
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package emt.init;
|
package emt.init;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import emt.gthandler.common.implementations.automation.EssentiaFiller;
|
|
||||||
import emt.tile.TileElectricCloud;
|
import emt.tile.TileElectricCloud;
|
||||||
import emt.tile.TileEntityEtherealMacerator;
|
import emt.tile.TileEntityEtherealMacerator;
|
||||||
import emt.tile.TileEntityIndustrialWandRecharge;
|
import emt.tile.TileEntityIndustrialWandRecharge;
|
||||||
@@ -28,7 +27,6 @@ public class EMTTiles {
|
|||||||
// Machinery
|
// Machinery
|
||||||
GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
|
GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
|
||||||
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
|
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
|
||||||
GameRegistry.registerTileEntity(EssentiaFiller.class, "EssentiaFillerTE");
|
|
||||||
|
|
||||||
// Solars
|
// Solars
|
||||||
// legacy support
|
// legacy support
|
||||||
|
|||||||
Reference in new issue
Block a user