diff --git a/libs/GalacticraftCore-Dev-1.7-3.0.12.503.jar b/libs/GalacticraftCore-Dev-1.7-3.0.12.503.jar new file mode 100644 index 0000000..2a58075 Binary files /dev/null and b/libs/GalacticraftCore-Dev-1.7-3.0.12.503.jar differ diff --git a/libs/MicdoodleCore-Dev-1.7-3.0.12.503.jar b/libs/MicdoodleCore-Dev-1.7-3.0.12.503.jar new file mode 100644 index 0000000..0578729 Binary files /dev/null and b/libs/MicdoodleCore-Dev-1.7-3.0.12.503.jar differ diff --git a/libs/gregtech-5.09.32.36-dev.jar b/libs/gregtech-5.09.32.36-dev.jar index 255264b..32bdb61 100644 Binary files a/libs/gregtech-5.09.32.36-dev.jar and b/libs/gregtech-5.09.32.36-dev.jar differ diff --git a/src/main/java/emt/client/gui/container/ContainerSolars.java b/src/main/java/emt/client/gui/container/ContainerSolars.java index c8b69c6..0461dbb 100644 --- a/src/main/java/emt/client/gui/container/ContainerSolars.java +++ b/src/main/java/emt/client/gui/container/ContainerSolars.java @@ -38,7 +38,7 @@ public class ContainerSolars ICrafting icrafting = (ICrafting)this.crafters.get(i); icrafting.sendProgressBarUpdate(this, 0, help); - icrafting.sendProgressBarUpdate(this, 1, (short) (this.tileentity.energySource.getEnergyStored()/1000)); + icrafting.sendProgressBarUpdate(this, 1, (short) (this.tileentity.getSourceStored()/1000)); } } diff --git a/src/main/java/emt/tile/DefinitelyNotAIC2Source.java b/src/main/java/emt/tile/DefinitelyNotAIC2Source.java new file mode 100644 index 0000000..5ddbff1 --- /dev/null +++ b/src/main/java/emt/tile/DefinitelyNotAIC2Source.java @@ -0,0 +1,103 @@ +package emt.tile; + +import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.enums.GT_Values; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class DefinitelyNotAIC2Source extends TileEntity { + public final TileEntity parent; + protected double capacity; + protected byte tier; + protected double power; + protected double energyStored; + protected boolean addedToEnet; + + public DefinitelyNotAIC2Source(TileEntity parent1, double capacity1, int tier1) { + double power = (double) GT_Values.V[tier1]; + this.parent = parent1; + this.capacity = capacity1 < power ? power : capacity1; + this.tier = (byte) tier1; + this.power = power; + } + + public void updateEntity() { + if (!this.addedToEnet && !FMLCommonHandler.instance().getEffectiveSide().isClient()) { + this.worldObj = this.parent.getWorldObj(); + this.xCoord = this.parent.xCoord; + this.yCoord = this.parent.yCoord; + this.zCoord = this.parent.zCoord; + this.addedToEnet = true; + } + } + + public void invalidate() { + super.invalidate(); + this.onChunkUnload(); + } + + public void onChunkUnload() { + if (this.addedToEnet) { + this.addedToEnet = false; + } + + } + + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + NBTTagCompound data = tag.getCompoundTag("EMTGTSource"); + this.energyStored = data.getDouble("energy"); + } + + public void writeToNBT(NBTTagCompound tag) { + try { + super.writeToNBT(tag); + } catch (RuntimeException var3) { + } + + NBTTagCompound data = new NBTTagCompound(); + data.setDouble("energy", this.energyStored); + tag.setTag("EMTGTSource", data); + } + + public double getCapacity() { + return this.capacity; + } + + public void setCapacity(double capacity1) { + if (capacity1 < this.power) { + capacity1 = this.power; + } + + this.capacity = capacity1; + } + + public double getEnergyStored() { + return this.energyStored; + } + + public void setEnergyStored(double amount) { + this.energyStored = amount; + } + + public double addEnergy(double amount) { + if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { + return 0.0D; + } else { + if (amount > this.capacity - this.energyStored) { + amount = this.capacity - this.energyStored; + } + + this.energyStored += amount; + return amount; + } + } + + public void drawEnergy(double amount) { + this.energyStored -= amount; + } + + public byte getSourceTier() { + return this.tier; + } +} diff --git a/src/main/java/emt/tile/generator/TileEntityBaseGenerator.java b/src/main/java/emt/tile/generator/TileEntityBaseGenerator.java index 825c753..a17e3db 100644 --- a/src/main/java/emt/tile/generator/TileEntityBaseGenerator.java +++ b/src/main/java/emt/tile/generator/TileEntityBaseGenerator.java @@ -2,7 +2,9 @@ package emt.tile.generator; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.TileEntityEMT; +import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; import emt.util.EMTEssentiasOutputs; import gregtech.api.enums.GT_Values; @@ -34,823 +36,693 @@ import thaumcraft.common.lib.network.PacketHandler; import thaumcraft.common.lib.network.fx.PacketFXEssentiaSource; public class TileEntityBaseGenerator - extends TileEntityEMT - implements IInventory, IAspectContainer, IEssentiaTransport, IHasWorldObjectAndCoords, IEnergyConnected, IBasicEnergyContainer -{ - public BasicSource energySource = new BasicSource(this, 100000.0D, 2); - public Aspect aspect; - public double generating; - public int tick = 0; - public boolean isActive = false; - public int tier; - public int storage; - public short mpshownstroage; - public int maxstorage; - public byte maxfuel; - public byte fuel; - public byte refuel; - public long timer = 0L; - public boolean dead = true; - public byte color; - private boolean side; - - public TileEntityBaseGenerator(Aspect aspect) - { - super(); - this.energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage); - this.maxstorage = ((int)this.energySource.getCapacity()); - this.maxfuel = 64; - this.fuel = 0; - this.storage = 0; - this.refuel = 1; - this.aspect = aspect; - this.generating = ((Double)EMTEssentiasOutputs.outputs.get(aspect.getTag())).doubleValue(); - this.color = -1; - } - - public void updateEntity() - { - - this.side = !this.worldObj.isRemote ? FMLCommonHandler.instance().getEffectiveSide().isServer() : FMLCommonHandler.instance().getSide().isServer(); - this.dead = false; - this.timer += 1L; - if (this.timer <= Long.MAX_VALUE-1) - this.timer = 0L; - storeFuel(); - fillfrompipe(); - createEnergy(); - inputintoGTnet(); - this.energySource.updateEntity(); - } - - - public void storeFuel() - { - if (this.fuel < this.maxfuel) { - for (int x = this.xCoord - 4; x < this.xCoord + 4; x++) { - for (int y = this.yCoord - 4; y < this.yCoord + 4; y++) { - for (int z = this.zCoord - 4; z < this.zCoord + 4; z++) - { - TileEntity tile = this.worldObj.getTileEntity(x, y, z); - if ((tile != null) && ((tile instanceof IAspectSource))) - { - IAspectSource as = (IAspectSource)tile; - if ((as.doesContainerContainAmount(this.aspect, this.refuel)) && - (as.takeFromContainer(this.aspect, this.refuel))) - { - PacketHandler.INSTANCE.sendToAllAround(new PacketFXEssentiaSource(this.xCoord, this.yCoord, this.zCoord, (byte)(this.xCoord - x), (byte)(this.yCoord - y), (byte)(this.zCoord - z), this.aspect.getColor()), new NetworkRegistry.TargetPoint(getWorldObj().provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 32.0D)); - addToContainer(this.aspect, this.refuel); - } + extends TileEntityEMT + implements IInventory, IAspectContainer, IEssentiaTransport, IHasWorldObjectAndCoords, IEnergyConnected, IBasicEnergyContainer { + public DefinitelyNotAIC2Source energySource = new DefinitelyNotAIC2Source(this, 100000.0D, 2); + public Aspect aspect; + public double generating; + public int tick = 0; + public boolean isActive = false; + public int tier; + public int storage; + public short mpshownstroage; + public int maxstorage; + public byte maxfuel; + public byte fuel; + public byte refuel; + public long timer = 0L; + public boolean dead = true; + public byte color; + private boolean side; + + public TileEntityBaseGenerator(Aspect aspect) { + super(); + this.energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage); + this.maxstorage = ((int) this.energySource.getCapacity()); + this.maxfuel = 64; + this.fuel = 0; + this.storage = 0; + this.refuel = 1; + this.aspect = aspect; + this.generating = ((Double) EMTEssentiasOutputs.outputs.get(aspect.getTag())).doubleValue(); + this.color = -1; + } + + public void updateEntity() { + + this.side = !this.worldObj.isRemote ? FMLCommonHandler.instance().getEffectiveSide().isServer() : FMLCommonHandler.instance().getSide().isServer(); + this.dead = false; + this.timer += 1L; + if (this.timer <= Long.MAX_VALUE - 1) + this.timer = 0L; + storeFuel(); + fillfrompipe(); + createEnergy(); + inputintoGTnet(); + this.energySource.updateEntity(); + } + + + public void storeFuel() { + if (this.fuel < this.maxfuel) { + for (int x = this.xCoord - 4; x < this.xCoord + 4; x++) { + for (int y = this.yCoord - 4; y < this.yCoord + 4; y++) { + for (int z = this.zCoord - 4; z < this.zCoord + 4; z++) { + TileEntity tile = this.worldObj.getTileEntity(x, y, z); + if ((tile != null) && ((tile instanceof IAspectSource))) { + IAspectSource as = (IAspectSource) tile; + if ((as.doesContainerContainAmount(this.aspect, this.refuel)) && + (as.takeFromContainer(this.aspect, this.refuel))) { + PacketHandler.INSTANCE.sendToAllAround(new PacketFXEssentiaSource(this.xCoord, this.yCoord, this.zCoord, (byte) (this.xCoord - x), (byte) (this.yCoord - y), (byte) (this.zCoord - z), this.aspect.getColor()), new NetworkRegistry.TargetPoint(getWorldObj().provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 32.0D)); + addToContainer(this.aspect, this.refuel); + } + } + } + } } - } } - } } - } - - 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; + + 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.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]).equals(this.aspect)) && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) { + addToContainer(this.aspect, pipe.takeEssentia(this.aspect, 1, ForgeDirection.VALID_DIRECTIONS[i])); + } + } } - if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null) && (pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]).equals(this.aspect)) && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) { - addToContainer(this.aspect, pipe.takeEssentia(this.aspect, 1, ForgeDirection.VALID_DIRECTIONS[i])); + } + + public String getInventoryName() { + return StatCollector.translateToLocal("tile.EMT.essentia." + this.aspect.getTag() + ".name"); + } + + public void createEnergy() { + if (this.fuel > 0) { + if (this.storage + this.generating / 20.0D / 20.0D < this.maxstorage) { + this.isActive = true; + if (side) { + this.energySource.addEnergy(this.generating / 20.0D / 20.0D); + this.storage = ((int) this.energySource.getEnergyStored()); + } + this.tick += 1; + if (this.tick == 400) { + this.fuel -= 1; + this.tick = 0; + } + } else if (this.storage == this.maxstorage) { + this.isActive = false; + } else if ((this.storage + this.generating / 20.0D / 20.0D > this.maxstorage) && (this.storage != this.maxstorage)) { + this.isActive = true; + if (side) { + this.energySource.setEnergyStored(this.maxstorage); + this.storage = this.maxstorage; + } + this.tick += 1; + if (this.tick == 400) { + this.fuel -= 1; + this.tick = 0; + } + this.isActive = false; + } + } else { + this.isActive = false; } - } } - } - - public String getInventoryName() - { - return StatCollector.translateToLocal("tile.EMT.essentia." + this.aspect.getTag() + ".name"); - } - - public void createEnergy() - { - if (this.fuel > 0) - { - if (this.storage + this.generating / 20.0D / 20.0D < this.maxstorage) - { - this.isActive = true; - if (side) - { - this.energySource.addEnergy(this.generating / 20.0D / 20.0D); - this.storage = ((int)this.energySource.getEnergyStored()); + + public void onChunkUnload() { + this.energySource.onChunkUnload(); + } + + public void invalidate() { + this.energySource.invalidate(); + super.invalidate(); + } + + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + this.energySource.readFromNBT(tag); + if (tag.getInteger("storage") > this.storage) { + this.storage = tag.getInteger("storage"); } - this.tick += 1; - if (this.tick == 400) - { - this.fuel -= 1; - this.tick = 0; + if (tag.getByte("fuel") > this.fuel) { + this.fuel = tag.getByte("fuel"); } - } - else if (this.storage == this.maxstorage) - { - this.isActive = false; - } - else if ((this.storage + this.generating / 20.0D / 20.0D > this.maxstorage) && (this.storage != this.maxstorage)) - { - this.isActive = true; - if (side) - { - this.energySource.setEnergyStored(this.maxstorage); - this.storage = this.maxstorage; + } + + public void writeToNBT(NBTTagCompound tag) { + tag.setInteger("storage", this.storage); + tag.setInteger("fuel", this.fuel); + super.writeToNBT(tag); + this.energySource.writeToNBT(tag); + } + + public int getSizeInventory() { + return 5; + } + + public ItemStack getStackInSlot(int i) { + return null; + } + + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + return null; + } + + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + return null; + } + + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + } + + public boolean hasCustomInventoryName() { + return false; + } + + public int getInventoryStackLimit() { + return 0; + } + + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + public void openInventory() { + } + + public void closeInventory() { + } + + public int gaugeEnergyScaled(int i) { + return this.mpshownstroage * 1000 * i / this.maxstorage; + } + + public int gaugeFuelScaled(int i) { + return this.fuel * i / this.maxfuel; + } + + public boolean isItemValidForSlot(int i, ItemStack Stack) { + return false; + } + + public AspectList getAspects() { + return new AspectList().add(this.aspect, this.fuel); + } + + public void setAspects(AspectList aspects) { + } + + public boolean doesContainerAccept(Aspect tag) { + return tag.equals(this.aspect); + } + + public int addToContainer(Aspect tag, int amount) { + if ((!tag.equals(this.aspect)) || (amount < 0)) { + return amount; } - this.tick += 1; - if (this.tick == 400) - { - this.fuel -= 1; - this.tick = 0; + if (amount + this.fuel < this.maxfuel) { + this.fuel += amount; + return 0; } - this.isActive = false; - } + this.fuel += amount - (amount - (this.maxfuel - this.fuel)); + return amount - (this.maxfuel - this.fuel); } - else { - this.isActive = false; + + public boolean takeFromContainer(Aspect tag, int amount) { + return false; } - } - - public void onChunkUnload() - { - this.energySource.onChunkUnload(); - } - - public void invalidate() - { - this.energySource.invalidate(); - super.invalidate(); - } - - public void readFromNBT(NBTTagCompound tag) - { - super.readFromNBT(tag); - this.energySource.readFromNBT(tag); - if (tag.getInteger("storage") > this.storage) { - this.storage = tag.getInteger("storage"); + + public boolean takeFromContainer(AspectList ot) { + return false; } - if (tag.getByte("fuel") > this.fuel) { - this.fuel = tag.getByte("fuel"); + + public boolean doesContainerContainAmount(Aspect tag, int amount) { + return (tag.equals(this.aspect)) && (amount <= this.fuel); } - } - - public void writeToNBT(NBTTagCompound tag) - { - tag.setInteger("storage", this.storage); - tag.setInteger("fuel", this.fuel); - super.writeToNBT(tag); - this.energySource.writeToNBT(tag); - } - - public int getSizeInventory() - { - return 5; - } - - public ItemStack getStackInSlot(int i) - { - return null; - } - - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) - { - return null; - } - - public ItemStack getStackInSlotOnClosing(int p_70304_1_) - { - return null; - } - - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {} - - public boolean hasCustomInventoryName() - { - return false; - } - - public int getInventoryStackLimit() - { - return 0; - } - - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) - { - return true; - } - - public void openInventory() {} - - public void closeInventory() {} - - public int gaugeEnergyScaled(int i) - { - return this.mpshownstroage * 1000 * i / this.maxstorage; - } - - public int gaugeFuelScaled(int i) - { - return this.fuel * i / this.maxfuel; - } - - public boolean isItemValidForSlot(int i, ItemStack Stack) - { - return false; - } - - public AspectList getAspects() - { - return new AspectList().add(this.aspect, this.fuel); - } - - public void setAspects(AspectList aspects) {} - - public boolean doesContainerAccept(Aspect tag) - { - return tag.equals(this.aspect); - } - - public int addToContainer(Aspect tag, int amount) - { - if ((!tag.equals(this.aspect)) || (amount < 0)) { - return amount; + + public boolean doesContainerContain(AspectList ot) { + return ot.aspects.containsKey(this.aspect); } - if (amount + this.fuel < this.maxfuel) - { - this.fuel += amount; - return 0; + + public int containerContains(Aspect tag) { + return tag == this.aspect ? this.fuel : 0; } - this.fuel += amount - (amount - (this.maxfuel - this.fuel)); - return amount - (this.maxfuel - this.fuel); - } - - public boolean takeFromContainer(Aspect tag, int amount) - { - return false; - } - - public boolean takeFromContainer(AspectList ot) - { - return false; - } - - public boolean doesContainerContainAmount(Aspect tag, int amount) - { - return (tag.equals(this.aspect)) && (amount <= this.fuel); - } - - public boolean doesContainerContain(AspectList ot) - { - return ot.aspects.containsKey(this.aspect); - } - - public int containerContains(Aspect tag) - { - return tag == this.aspect ? this.fuel : 0; - } - - public boolean isConnectable(ForgeDirection face) - { - return true; - } - - public boolean canInputFrom(ForgeDirection face) - { - return true; - } - - public boolean canOutputTo(ForgeDirection face) - { - return false; - } - - public void setSuction(Aspect aspect, int amount) {} - - public Aspect getSuctionType(ForgeDirection face) - { - return this.aspect; - } - - public int getSuctionAmount(ForgeDirection face) - { - return 128; - } - - public int takeEssentia(Aspect aspect, int amount, ForgeDirection face) - { - return 0; - } - - public int addEssentia(Aspect aspect, int amount, ForgeDirection face) - { - if (amount < this.maxfuel - this.fuel) { - return amount; + + public boolean isConnectable(ForgeDirection face) { + return true; } - return this.maxfuel - addToContainer(aspect, amount); - } - - public Aspect getEssentiaType(ForgeDirection face) - { - return this.aspect; - } - - public int getEssentiaAmount(ForgeDirection face) - { - return this.fuel; - } - - public int getMinimumSuction() - { - return Integer.MAX_VALUE; - } - - public boolean renderExtendedTube() - { - return true; - } - public void inputintoGTnet() - { - for (byte i = 0; i < 6; i = (byte)(i + 1)) { - if (getIGregTechTileEntityAtSide(i) != null) - { - if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) - { - long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this); - drainEnergyUnits(i, getOutputVoltage(), tEU); + + public boolean canInputFrom(ForgeDirection face) { + return true; + } + + public boolean canOutputTo(ForgeDirection face) { + return false; + } + + public void setSuction(Aspect aspect, int amount) { + } + + public Aspect getSuctionType(ForgeDirection face) { + return this.aspect; + } + + public int getSuctionAmount(ForgeDirection face) { + return 128; + } + + public int takeEssentia(Aspect aspect, int amount, ForgeDirection face) { + return 0; + } + + public int addEssentia(Aspect aspect, int amount, ForgeDirection face) { + if (amount < this.maxfuel - this.fuel) { + return amount; } - } + return this.maxfuel - addToContainer(aspect, amount); } - } - - public byte getColorization() - { - return this.color; - } - - public byte setColorization(byte aColor) - { - this.color = aColor; - return this.color; - } - - public boolean isUniversalEnergyStored(long aEnergyAmount) - { - return aEnergyAmount < this.energySource.getEnergyStored(); - } - - public long getUniversalEnergyStored() - { - return (long) this.energySource.getEnergyStored(); - } - - public long getUniversalEnergyCapacity() - { - return (long) this.energySource.getCapacity(); - } - - public long getOutputAmperage() - { - if (this.generating / 20.0D / 20.0D <= GT_Values.V[this.energySource.getSourceTier()]) { - return 1L; + + public Aspect getEssentiaType(ForgeDirection face) { + return this.aspect; } - if (this.generating / 20.0D / 20.0D % GT_Values.V[this.energySource.getSourceTier()] == 0.0D) { - return (long) (this.generating / 20.0D / 20.0D / GT_Values.V[this.energySource.getSourceTier()]); + + public int getEssentiaAmount(ForgeDirection face) { + return this.fuel; } - return (long) (1L + (this.generating / 20.0D / 20.0D / GT_Values.V[this.energySource.getSourceTier()])); - } - - public long getOutputVoltage() - { - return GT_Values.V[this.energySource.getSourceTier()]; - } - - public long getInputAmperage() - { - return 0L; - } - - public long getInputVoltage() - { - return 0L; - } - - public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) - { - if (this.energySource.getEnergyStored() > aEnergy) - { - this.energySource.drawEnergy(aEnergy); - this.storage = ((int)this.energySource.getEnergyStored()); - return true; + + public int getMinimumSuction() { + return Integer.MAX_VALUE; } - return false; - } - - public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) - { - return false; - } - - public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) - { - return decreaseStoredEnergyUnits(aVoltage * aAmperage, this.energySource.getEnergyStored() > aVoltage * aAmperage); - } - - public long getAverageElectricInput() - { - return 0L; - } - - public long getAverageElectricOutput() - { - return 0L; - } - - public long getStoredEU() - { - return (long) this.energySource.getEnergyStored(); - } - - public long getEUCapacity() - { - return (long) this.energySource.getCapacity(); - } - - public long getStoredSteam() - { - return 0L; - } - - public long getSteamCapacity() - { - return 0L; - } - - public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) - { - return false; - } - - public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) - { - return 0L; - } - - public boolean inputEnergyFrom(byte aSide) - { - return false; - } - - public boolean outputsEnergyTo(byte aSide) - { - return true; - } - - public boolean energyStateReady() - { - return true; - } - - public World getWorld() - { - return this.worldObj; - } - - public int getXCoord() - { - return this.xCoord; - } - - public short getYCoord() - { - return (short)this.yCoord; - } - - public int getZCoord() - { - return this.zCoord; - } - - public boolean isServerSide() - { - return !worldObj.isRemote; - } - - public boolean isClientSide() - { - return worldObj.isRemote; - } - - public int getRandomNumber(int aRange) - { - return this.worldObj.rand.nextInt(aRange); - } - - public TileEntity getTileEntity(int aX, int aY, int aZ) - { - return this.worldObj.getTileEntity(aX, aY, aZ); - } - - public TileEntity getTileEntityOffset(int aX, int aY, int aZ) - { - return this.worldObj.getTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); - } - - public TileEntity getTileEntityAtSide(byte aSide) - { - if ((aSide < 0) || (aSide >= 6)) { - return null; + + public boolean renderExtendedTube() { + return true; } - int tX = getOffsetX(aSide, 1);int tY = getOffsetY(aSide, 1);int tZ = getOffsetZ(aSide, 1); - return this.worldObj.getTileEntity(tX, tY, tZ); - } - - public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) - { - if (aDistance == 1) { - return getTileEntityAtSide(aSide); + + public void inputintoGTnet() { + for (byte i = 0; i < 6; i = (byte) (i + 1)) { + if (getIGregTechTileEntityAtSide(i) != null) { + if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) { + long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this); + drainEnergyUnits(i, getOutputVoltage(), tEU); + } + } + } } - return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); - } - - public IInventory getIInventory(int aX, int aY, int aZ) - { - return null; - } - - public IInventory getIInventoryOffset(int aX, int aY, int aZ) - { - return null; - } - - public IInventory getIInventoryAtSide(byte aSide) - { - return null; - } - - public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) - { - return null; - } - - public IFluidHandler getITankContainer(int aX, int aY, int aZ) - { - return null; - } - - public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) - { - return null; - } - - public IFluidHandler getITankContainerAtSide(byte aSide) - { - return null; - } - - public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) - { - return null; - } - - public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) - { - TileEntity tTileEntity = getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof IGregTechTileEntity)) { - return (IGregTechTileEntity)tTileEntity; + + public byte getColorization() { + return this.color; } - return null; - } - - public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) - { - return getIGregTechTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); - } - - public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) - { - TileEntity tTileEntity = getTileEntityAtSide(aSide); - if ((tTileEntity instanceof IGregTechTileEntity)) { - return (IGregTechTileEntity)tTileEntity; + + public byte setColorization(byte aColor) { + this.color = aColor; + return this.color; } - return null; - } - - public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) - { - TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance); - if ((tTileEntity instanceof IGregTechTileEntity)) { - return (IGregTechTileEntity)tTileEntity; + + public boolean isUniversalEnergyStored(long aEnergyAmount) { + return aEnergyAmount < this.energySource.getEnergyStored(); } - return null; - } - - public Block getBlock(int aX, int aY, int aZ) - { - return this.worldObj.getBlock(aX, aY, aZ); - } - - public Block getBlockOffset(int aX, int aY, int aZ) - { - return getBlock(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); - } - - public Block getBlockAtSide(byte aSide) - { - if ((aSide < 0) || (aSide >= 6)) { - return null; + + public long getUniversalEnergyStored() { + return (long) this.energySource.getEnergyStored(); } - int tX = getOffsetX(aSide, 1);int tY = getOffsetY(aSide, 1);int tZ = getOffsetZ(aSide, 1); - return this.worldObj.getBlock(tX, tY, tZ); - } - - public Block getBlockAtSideAndDistance(byte aSide, int aDistance) - { - if (aDistance == 1) { - return getBlockAtSide(aSide); + + public long getUniversalEnergyCapacity() { + return (long) this.energySource.getCapacity(); } - return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); - } - - public byte getMetaID(int aX, int aY, int aZ) - { - return (byte)this.worldObj.getBlockMetadata(aX, aY, aZ); - } - - public byte getMetaIDOffset(int aX, int aY, int aZ) - { - return getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); - } - - public byte getMetaIDAtSide(byte aSide) - { - int tX = getOffsetX(aSide, 1);int tY = getOffsetY(aSide, 1);int tZ = getOffsetZ(aSide, 1); - return (byte)this.worldObj.getBlockMetadata(tX, tY, tZ); - } - - public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) - { - if (aDistance == 1) { - return getMetaIDAtSide(aSide); + + public long getOutputAmperage() { + if (this.generating / 20.0D / 20.0D <= GT_Values.V[this.energySource.getSourceTier()]) { + return 1L; + } + if (this.generating / 20.0D / 20.0D % GT_Values.V[this.energySource.getSourceTier()] == 0.0D) { + return (long) (this.generating / 20.0D / 20.0D / GT_Values.V[this.energySource.getSourceTier()]); + } + return (long) (1L + (this.generating / 20.0D / 20.0D / GT_Values.V[this.energySource.getSourceTier()])); + } + + public long getOutputVoltage() { + return GT_Values.V[this.energySource.getSourceTier()]; + } + + public long getInputAmperage() { + return 0L; + } + + public long getInputVoltage() { + return 0L; + } + + public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) { + if (this.energySource.getEnergyStored() > aEnergy) { + this.energySource.drawEnergy(aEnergy); + this.storage = ((int) this.energySource.getEnergyStored()); + return true; + } + return false; + } + + public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) { + return false; + } + + public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + return decreaseStoredEnergyUnits(aVoltage * aAmperage, this.energySource.getEnergyStored() > aVoltage * aAmperage); + } + + public long getAverageElectricInput() { + return 0L; + } + + public long getAverageElectricOutput() { + return 0L; + } + + public long getStoredEU() { + return (long) this.energySource.getEnergyStored(); + } + + public long getEUCapacity() { + return (long) this.energySource.getCapacity(); + } + + public long getStoredSteam() { + return 0L; + } + + public long getSteamCapacity() { + return 0L; + } + + public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) { + return false; + } + + public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + return 0L; + } + + public boolean inputEnergyFrom(byte aSide) { + return false; + } + + public boolean outputsEnergyTo(byte aSide) { + return true; + } + + public boolean energyStateReady() { + return true; + } + + public World getWorld() { + return this.worldObj; + } + + public int getXCoord() { + return this.xCoord; + } + + public short getYCoord() { + return (short) this.yCoord; + } + + public int getZCoord() { + return this.zCoord; + } + + public boolean isServerSide() { + return !worldObj.isRemote; + } + + public boolean isClientSide() { + return worldObj.isRemote; + } + + public int getRandomNumber(int aRange) { + return this.worldObj.rand.nextInt(aRange); + } + + public TileEntity getTileEntity(int aX, int aY, int aZ) { + return this.worldObj.getTileEntity(aX, aY, aZ); + } + + public TileEntity getTileEntityOffset(int aX, int aY, int aZ) { + return this.worldObj.getTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); + } + + public TileEntity getTileEntityAtSide(byte aSide) { + if ((aSide < 0) || (aSide >= 6)) { + return null; + } + int tX = getOffsetX(aSide, 1); + int tY = getOffsetY(aSide, 1); + int tZ = getOffsetZ(aSide, 1); + return this.worldObj.getTileEntity(tX, tY, tZ); + } + + public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) { + if (aDistance == 1) { + return getTileEntityAtSide(aSide); + } + return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); + } + + public IInventory getIInventory(int aX, int aY, int aZ) { + return null; + } + + public IInventory getIInventoryOffset(int aX, int aY, int aZ) { + return null; + } + + public IInventory getIInventoryAtSide(byte aSide) { + return null; + } + + public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) { + return null; + } + + public IFluidHandler getITankContainer(int aX, int aY, int aZ) { + return null; + } + + public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) { + return null; + } + + public IFluidHandler getITankContainerAtSide(byte aSide) { + return null; + } + + public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) { + return null; + } + + public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) { + TileEntity tTileEntity = getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof IGregTechTileEntity)) { + return (IGregTechTileEntity) tTileEntity; + } + return null; + } + + public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) { + return getIGregTechTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); + } + + public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) { + TileEntity tTileEntity = getTileEntityAtSide(aSide); + if ((tTileEntity instanceof IGregTechTileEntity)) { + return (IGregTechTileEntity) tTileEntity; + } + return null; + } + + public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) { + TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance); + if ((tTileEntity instanceof IGregTechTileEntity)) { + return (IGregTechTileEntity) tTileEntity; + } + return null; + } + + public Block getBlock(int aX, int aY, int aZ) { + return this.worldObj.getBlock(aX, aY, aZ); + } + + public Block getBlockOffset(int aX, int aY, int aZ) { + return getBlock(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); + } + + public Block getBlockAtSide(byte aSide) { + if ((aSide < 0) || (aSide >= 6)) { + return null; + } + int tX = getOffsetX(aSide, 1); + int tY = getOffsetY(aSide, 1); + int tZ = getOffsetZ(aSide, 1); + return this.worldObj.getBlock(tX, tY, tZ); + } + + public Block getBlockAtSideAndDistance(byte aSide, int aDistance) { + if (aDistance == 1) { + return getBlockAtSide(aSide); + } + return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); + } + + public byte getMetaID(int aX, int aY, int aZ) { + return (byte) this.worldObj.getBlockMetadata(aX, aY, aZ); + } + + public byte getMetaIDOffset(int aX, int aY, int aZ) { + return getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); + } + + public byte getMetaIDAtSide(byte aSide) { + int tX = getOffsetX(aSide, 1); + int tY = getOffsetY(aSide, 1); + int tZ = getOffsetZ(aSide, 1); + return (byte) this.worldObj.getBlockMetadata(tX, tY, tZ); + } + + public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) { + if (aDistance == 1) { + return getMetaIDAtSide(aSide); + } + return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); + } + + public byte getLightLevel(int aX, int aY, int aZ) { + return 0; + } + + public byte getLightLevelOffset(int aX, int aY, int aZ) { + return 0; + } + + public byte getLightLevelAtSide(byte aSide) { + return 0; + } + + public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) { + return 0; + } + + public boolean getOpacity(int aX, int aY, int aZ) { + return false; + } + + public boolean getOpacityOffset(int aX, int aY, int aZ) { + return false; + } + + public boolean getOpacityAtSide(byte aSide) { + return false; + } + + public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) { + return false; + } + + public boolean getSky(int aX, int aY, int aZ) { + boolean sky = true; + do { + if (!this.worldObj.getBlock(aX, ++aY, aZ).equals(Blocks.air)) { + sky = false; + } + } while ((sky) && (aY < 256)); + return sky; + } + + public boolean getSkyOffset(int aX, int aY, int aZ) { + return getSky(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); + } + + public boolean getSkyAtSide(byte aSide) { + return false; + } + + public boolean getSkyAtSideAndDistance(byte aSide, int aDistance) { + return false; + } + + public boolean getAir(int aX, int aY, int aZ) { + return this.worldObj.getBlock(aX, aY, aZ).equals(Blocks.air); + } + + public boolean getAirOffset(int aX, int aY, int aZ) { + return getAir(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); + } + + public boolean getAirAtSide(byte aSide) { + return getAirAtSideAndDistance(aSide, 1); + } + + public boolean getAirAtSideAndDistance(byte aSide, int aDistance) { + return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); + } + + public BiomeGenBase getBiome() { + return this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord); + } + + public BiomeGenBase getBiome(int aX, int aZ) { + return this.worldObj.getBiomeGenForCoords(aX, aZ); + } + + public int getOffsetX(byte aSide, int aMultiplier) { + return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier; + } + + public short getOffsetY(byte aSide, int aMultiplier) { + return (short) (this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier); + } + + public int getOffsetZ(byte aSide, int aMultiplier) { + return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier; + } + + public boolean isDead() { + return this.dead; + } + + public void sendBlockEvent(byte aID, byte aValue) { + GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Block_Event(this.xCoord, (short) this.yCoord, this.zCoord, aID, aValue), this.xCoord, this.zCoord); + } + + public long getTimer() { + return this.timer; + } + + public void setLightValue(byte aLightValue) { + } + + public boolean isInvalidTileEntity() { + return this.tileEntityInvalid; + } + + public boolean openGUI(EntityPlayer aPlayer, int aID) { + return false; + } + + public boolean openGUI(EntityPlayer aPlayer) { + return false; } - return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); - } - - public byte getLightLevel(int aX, int aY, int aZ) - { - return 0; - } - - public byte getLightLevelOffset(int aX, int aY, int aZ) - { - return 0; - } - - public byte getLightLevelAtSide(byte aSide) - { - return 0; - } - - public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) - { - return 0; - } - - public boolean getOpacity(int aX, int aY, int aZ) - { - return false; - } - - public boolean getOpacityOffset(int aX, int aY, int aZ) - { - return false; - } - - public boolean getOpacityAtSide(byte aSide) - { - return false; - } - - public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) - { - return false; - } - - public boolean getSky(int aX, int aY, int aZ) - { - boolean sky = true; - do - { - if (!this.worldObj.getBlock(aX, ++aY, aZ).equals(Blocks.air)) { - sky = false; - } - } while ((sky) && (aY < 256)); - return sky; - } - - public boolean getSkyOffset(int aX, int aY, int aZ) - { - return getSky(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); - } - - public boolean getSkyAtSide(byte aSide) - { - return false; - } - - public boolean getSkyAtSideAndDistance(byte aSide, int aDistance) - { - return false; - } - - public boolean getAir(int aX, int aY, int aZ) - { - return this.worldObj.getBlock(aX, aY, aZ).equals(Blocks.air); - } - - public boolean getAirOffset(int aX, int aY, int aZ) - { - return getAir(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); - } - - public boolean getAirAtSide(byte aSide) - { - return getAirAtSideAndDistance(aSide, 1); - } - - public boolean getAirAtSideAndDistance(byte aSide, int aDistance) - { - return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); - } - - public BiomeGenBase getBiome() - { - return this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord); - } - - public BiomeGenBase getBiome(int aX, int aZ) - { - return this.worldObj.getBiomeGenForCoords(aX, aZ); - } - - public int getOffsetX(byte aSide, int aMultiplier) - { - return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier; - } - - public short getOffsetY(byte aSide, int aMultiplier) - { - return (short)(this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier); - } - - public int getOffsetZ(byte aSide, int aMultiplier) - { - return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier; - } - - public boolean isDead() - { - return this.dead; - } - - public void sendBlockEvent(byte aID, byte aValue) - { - GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Block_Event(this.xCoord, (short)this.yCoord, this.zCoord, aID, aValue), this.xCoord, this.zCoord); - } - - public long getTimer() - { - return this.timer; - } - - public void setLightValue(byte aLightValue) {} - - public boolean isInvalidTileEntity() - { - return this.tileEntityInvalid; - } - - public boolean openGUI(EntityPlayer aPlayer, int aID) - { - return false; - } - - public boolean openGUI(EntityPlayer aPlayer) - { - return false; - } - public boolean outputsEnergyTo(byte b, boolean b1) { - return true; - } + public boolean outputsEnergyTo(byte b, boolean b1) { + return true; + } - public boolean inputEnergyFrom(byte b, boolean b1) { - return false; - } + public boolean inputEnergyFrom(byte b, boolean b1) { + return false; + } } diff --git a/src/main/java/emt/tile/generator/TileEntityCompressedGenerator.java b/src/main/java/emt/tile/generator/TileEntityCompressedGenerator.java index c3e0165..9bf54c5 100644 --- a/src/main/java/emt/tile/generator/TileEntityCompressedGenerator.java +++ b/src/main/java/emt/tile/generator/TileEntityCompressedGenerator.java @@ -1,5 +1,6 @@ package emt.tile.generator; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; import ic2.api.energy.prefab.BasicSource; import thaumcraft.api.aspects.Aspect; @@ -10,7 +11,7 @@ public abstract class TileEntityCompressedGenerator public TileEntityCompressedGenerator(Aspect aspect) { super(aspect); - this.energySource = new BasicSource(this, 1000000.0D, 3); + this.energySource = new DefinitelyNotAIC2Source(this, 1000000.0D, 3); this.energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage * 10.0D); this.maxfuel *= 10; } diff --git a/src/main/java/emt/tile/solar/TileEntitySolarBase.java b/src/main/java/emt/tile/solar/TileEntitySolarBase.java index ab23176..168620a 100644 --- a/src/main/java/emt/tile/solar/TileEntitySolarBase.java +++ b/src/main/java/emt/tile/solar/TileEntitySolarBase.java @@ -1,6 +1,7 @@ package emt.tile.solar; import cpw.mods.fml.common.FMLCommonHandler; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.TileEntityEMT; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.tileentity.IBasicEnergyContainer; @@ -8,7 +9,6 @@ import gregtech.api.interfaces.tileentity.IEnergyConnected; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.net.GT_Packet_Block_Event; -import ic2.api.energy.prefab.BasicSource; import ic2.api.tile.IWrenchable; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -26,656 +26,581 @@ import net.minecraftforge.fluids.IFluidHandler; public abstract class TileEntitySolarBase extends TileEntityEMT implements IInventory, IWrenchable, IHasWorldObjectAndCoords, IEnergyConnected, IBasicEnergyContainer { - public BasicSource energySource; - public boolean initialized; - public boolean theSunIsVisible; - public boolean canRain; - public int tick; - public double output = 0; - public long timer = 0L; - public boolean dead = true; - public double generating; - public short mp_storage=0; - public byte color = (-1); - public int storage; - public long maxstorage=0; - public boolean isActive=false; - protected boolean side; + public boolean initialized; + public boolean theSunIsVisible; + public boolean canRain; + public int tick; + public double output = 0; + public long timer = 0L; + public boolean dead = true; + public double generating; + public short mp_storage = 0; + public byte color = (-1); + public int storage; + public long maxstorage = 0; + public boolean isActive = false; + protected DefinitelyNotAIC2Source energySource; + protected boolean side; - public TileEntitySolarBase() { - this.tick = 10; - this.storage = 0; - } + public TileEntitySolarBase() { + this.tick = 10; + this.storage = 0; + } - @Override - public void updateEntity() { - this.side = !this.worldObj.isRemote ? FMLCommonHandler.instance().getEffectiveSide().isServer() : FMLCommonHandler.instance().getSide().isServer(); - this.dead = false; - this.timer =+ 1L; - inputintoGTnet(); - energySource.updateEntity(); - checkConditions(); - } + @Override + public void updateEntity() { + this.side = !this.worldObj.isRemote ? FMLCommonHandler.instance().getEffectiveSide().isServer() : FMLCommonHandler.instance().getSide().isServer(); + this.dead = false; + this.timer = +1L; + inputintoGTnet(); + energySource.updateEntity(); + checkConditions(); + } - public abstract float calc_multi(); - - public void checkConditions() { - initialized = true; - if (tick-- == 0) { - updateSunState(); - tick = 64; - } - createEnergy(); - } + public abstract float calc_multi(); - public void createEnergy() { - if (theSunIsVisible) { - isActive=true; - if (side) { - this.energySource.addEnergy(this.output*calc_multi()); - this.generating=output*calc_multi(); - } - } - else { - isActive=false; - this.generating=0; - } - } + public double getSourceStored() { + return this.energySource.getEnergyStored(); + } - public void updateSunState() { - boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering()); - theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord); - } + public void checkConditions() { + initialized = true; + if (tick-- == 0) { + updateSunState(); + tick = 64; + } + createEnergy(); + } - @Override - public void onChunkUnload() { - energySource.onChunkUnload(); - } + public void createEnergy() { + if (theSunIsVisible) { + isActive = true; + if (side) { + this.energySource.addEnergy(this.output * calc_multi()); + this.generating = output * calc_multi(); + } + } else { + isActive = false; + this.generating = 0; + } + } - @Override - public void invalidate() { - energySource.invalidate(); - super.invalidate(); - } + public void updateSunState() { + boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering()); + theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord); + } - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) { - super.writeToNBT(nbttagcompound); - energySource.writeToNBT(nbttagcompound); - } + @Override + public void onChunkUnload() { + energySource.onChunkUnload(); + } - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) { - super.readFromNBT(nbttagcompound); - energySource.readFromNBT(nbttagcompound); - } + @Override + public void invalidate() { + energySource.invalidate(); + super.invalidate(); + } - public int getSizeInventory(){ - return 5; - } - - public ItemStack getStackInSlot(int i){ - return null; - } - - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_){ - return null; - } - - public ItemStack getStackInSlotOnClosing(int p_70304_1_){ - return null; - } - - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {} - - public boolean hasCustomInventoryName(){ - return true; - } - - public String getInventoryName() - { - return StatCollector.translateToLocal("tile.EMT.solar."+getInventoryName().replaceAll(" ", "").toLowerCase()+".name"); - } - - public int getInventoryStackLimit(){ - return 0; - } - - public boolean isUseableByPlayer(EntityPlayer p_70300_1_){ - return true; - } - - public void openInventory() {} - - public void closeInventory() {} - - public int gaugeEnergyScaled(int i){ - return (int) (this.mp_storage*1000*i / (int) this.maxstorage); - } - - - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return false; - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return false; - } + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + energySource.writeToNBT(nbttagcompound); + } - @Override - public short getFacing() { - return 0; - } + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + energySource.readFromNBT(nbttagcompound); + } - @Override - public void setFacing(short facing) { - } + public int getSizeInventory() { + return 5; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } + public ItemStack getStackInSlot(int i) { + return null; + } - @Override - public float getWrenchDropRate() { - return 1; - } - - public void inputintoGTnet() - { - for (byte i = 0; i < 6; i = (byte)(i + 1)) { - if (getIGregTechTileEntityAtSide(i) != null) - { - if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) - { - long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this); - drainEnergyUnits(i, getOutputVoltage(), tEU); - } - } - } - } - - public byte getColorization() - { - return this.color; - } - - public byte setColorization(byte aColor) - { - this.color = aColor; - return this.color; - } - - public boolean isUniversalEnergyStored(long aEnergyAmount) - { - return aEnergyAmount < this.energySource.getEnergyStored(); - } - - public long getUniversalEnergyStored() - { - return (long) this.energySource.getEnergyStored(); - } - - public long getUniversalEnergyCapacity() - { - return (long) this.energySource.getCapacity(); - } - - public long getOutputAmperage(){ - long ret; - if(this.energySource.getSourceTier()<=4) { - if (this.generating <= GT_Values.V[this.energySource.getSourceTier()-2]) { - ret = 1L; - } - if (this.generating % GT_Values.V[this.energySource.getSourceTier()-2] == 0.0D) { - ret = (long) (this.generating / GT_Values.V[this.energySource.getSourceTier()-2]); - } - else - ret = (long) (1L + (this.generating / GT_Values.V[this.energySource.getSourceTier()-2])); - } - else { - if (this.generating <= GT_Values.V[this.energySource.getSourceTier()-1]) { - ret= 1L; - } - if (this.generating % GT_Values.V[this.energySource.getSourceTier()] == 0.0D) { - ret= (long) (this.generating / GT_Values.V[this.energySource.getSourceTier()-1]); - } - else - ret= (long) (1L + (this.generating / GT_Values.V[this.energySource.getSourceTier()-1])); - } - return ret; - - } - - public long getOutputVoltage() - { - if(this.energySource.getSourceTier()<=4) - return GT_Values.V[(this.energySource.getSourceTier()-2)]; - else - return GT_Values.V[(this.energySource.getSourceTier()-1)]; - } - - public long getInputAmperage() - { - return 0L; - } - - public long getInputVoltage() - { - return 0L; - } - - public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) - { - if (this.energySource.getEnergyStored() > aEnergy) - { - this.energySource.drawEnergy(aEnergy); - this.storage = ((int)this.energySource.getEnergyStored()); - return true; - } - return false; - } - - public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) - { - return false; - } - - public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) - { - return decreaseStoredEnergyUnits(aVoltage * aAmperage, this.energySource.getEnergyStored() > aVoltage * aAmperage); - } - - public long getAverageElectricInput() - { - return 0L; - } - - public long getAverageElectricOutput() - { - return 0L; - } - - public long getStoredEU() - { - return (long) this.energySource.getEnergyStored(); - } - - public long getEUCapacity(){ - return (long) this.energySource.getCapacity(); - } - - public long getStoredSteam() - { - return 0L; - } - - public long getSteamCapacity() - { - return 0L; - } - - public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) - { - return false; - } - - public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) - { - return 0L; - } - - public boolean inputEnergyFrom(byte aSide) - { - return false; - } - - public boolean outputsEnergyTo(byte aSide) - { - return true; - } - - public boolean energyStateReady() - { - return true; - } - - public World getWorld() - { - return this.worldObj; - } - - public int getXCoord() - { - return this.xCoord; - } - - public short getYCoord() - { - return (short)this.yCoord; - } - - public int getZCoord() - { - return this.zCoord; - } - - public boolean isServerSide() - { - return side; - } - - public boolean isClientSide() - { - return side; - } - - public int getRandomNumber(int aRange) - { - return this.worldObj.rand.nextInt(aRange); - } - - public TileEntity getTileEntity(int aX, int aY, int aZ) - { - return this.worldObj.getTileEntity(aX, aY, aZ); - } - - public TileEntity getTileEntityOffset(int aX, int aY, int aZ) - { - return this.worldObj.getTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); - } - - public TileEntity getTileEntityAtSide(byte aSide) - { - if ((aSide < 0) || (aSide >= 6)) { - return null; - } - int tX = getOffsetX(aSide, 1);int tY = getOffsetY(aSide, 1);int tZ = getOffsetZ(aSide, 1); - return this.worldObj.getTileEntity(tX, tY, tZ); - } - - public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) - { - if (aDistance == 1) { - return getTileEntityAtSide(aSide); - } - return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); - } - - public IInventory getIInventory(int aX, int aY, int aZ) - { - return null; - } - - public IInventory getIInventoryOffset(int aX, int aY, int aZ) - { - return null; - } - - public IInventory getIInventoryAtSide(byte aSide) - { - return null; - } - - public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) - { - return null; - } - - public IFluidHandler getITankContainer(int aX, int aY, int aZ) - { - return null; - } - - public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) - { - return null; - } - - public IFluidHandler getITankContainerAtSide(byte aSide) - { - return null; - } - - public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) - { - return null; - } - - public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) - { - TileEntity tTileEntity = getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof IGregTechTileEntity)) { - return (IGregTechTileEntity)tTileEntity; - } - return null; - } - - public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) - { - return getIGregTechTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); - } - - public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) - { - TileEntity tTileEntity = getTileEntityAtSide(aSide); - if ((tTileEntity instanceof IGregTechTileEntity)) { - return (IGregTechTileEntity)tTileEntity; - } - return null; - } - - public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) - { - TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance); - if ((tTileEntity instanceof IGregTechTileEntity)) { - return (IGregTechTileEntity)tTileEntity; - } - return null; - } - - public Block getBlock(int aX, int aY, int aZ) - { - return this.worldObj.getBlock(aX, aY, aZ); - } - - public Block getBlockOffset(int aX, int aY, int aZ) - { - return getBlock(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); - } - - public Block getBlockAtSide(byte aSide) - { - if ((aSide < 0) || (aSide >= 6)) { - return null; - } - int tX = getOffsetX(aSide, 1);int tY = getOffsetY(aSide, 1);int tZ = getOffsetZ(aSide, 1); - return this.worldObj.getBlock(tX, tY, tZ); - } - - public Block getBlockAtSideAndDistance(byte aSide, int aDistance) - { - if (aDistance == 1) { - return getBlockAtSide(aSide); - } - return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); - } - - public byte getMetaID(int aX, int aY, int aZ) - { - return (byte)this.worldObj.getBlockMetadata(aX, aY, aZ); - } - - public byte getMetaIDOffset(int aX, int aY, int aZ) - { - return getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); - } - - public byte getMetaIDAtSide(byte aSide) - { - int tX = getOffsetX(aSide, 1);int tY = getOffsetY(aSide, 1);int tZ = getOffsetZ(aSide, 1); - return (byte)this.worldObj.getBlockMetadata(tX, tY, tZ); - } - - public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) - { - if (aDistance == 1) { - return getMetaIDAtSide(aSide); - } - return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); - } - - public byte getLightLevel(int aX, int aY, int aZ) - { - return 0; - } - - public byte getLightLevelOffset(int aX, int aY, int aZ) - { - return 0; - } - - public byte getLightLevelAtSide(byte aSide) - { - return 0; - } - - public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) - { - return 0; - } - - public boolean getOpacity(int aX, int aY, int aZ) - { - return false; - } - - public boolean getOpacityOffset(int aX, int aY, int aZ) - { - return false; - } - - public boolean getOpacityAtSide(byte aSide) - { - return false; - } - - public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) - { - return false; - } - - public boolean getSky(int aX, int aY, int aZ) - { - boolean sky = true; - do - { - if (!this.worldObj.getBlock(aX, ++aY, aZ).getMaterial().equals(Material.air)) { - sky = false; - } - } while ((sky) && (aY < 256)); - return sky; - } - - public boolean getSkyOffset(int aX, int aY, int aZ) - { - return getSky(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); - } - - public boolean getSkyAtSide(byte aSide) - { - return false; - } - - public boolean getSkyAtSideAndDistance(byte aSide, int aDistance) - { - return false; - } - - public boolean getAir(int aX, int aY, int aZ) - { - return this.worldObj.getBlock(aX, aY, aZ).equals(Blocks.air); - } - - public boolean getAirOffset(int aX, int aY, int aZ) - { - return getAir(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); - } - - public boolean getAirAtSide(byte aSide) - { - return getAirAtSideAndDistance(aSide, 1); - } - - public boolean getAirAtSideAndDistance(byte aSide, int aDistance) - { - return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); - } - - public BiomeGenBase getBiome() - { - return this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord); - } - - public BiomeGenBase getBiome(int aX, int aZ) - { - return this.worldObj.getBiomeGenForCoords(aX, aZ); - } - - public int getOffsetX(byte aSide, int aMultiplier) - { - return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier; - } - - public short getOffsetY(byte aSide, int aMultiplier) - { - return (short)(this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier); - } - - public int getOffsetZ(byte aSide, int aMultiplier) - { - return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier; - } - - public boolean isDead() - { - return this.dead; - } - - public void sendBlockEvent(byte aID, byte aValue) - { - GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Block_Event(this.xCoord, (short)this.yCoord, this.zCoord, aID, aValue), this.xCoord, this.zCoord); - } - - public long getTimer() - { - return this.timer; - } - - public void setLightValue(byte aLightValue) {} - - public boolean isInvalidTileEntity() - { - return this.tileEntityInvalid; - } - - public boolean openGUI(EntityPlayer aPlayer, int aID) - { - return false; - } - - public boolean openGUI(EntityPlayer aPlayer) - { - return false; - } + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + return null; + } - public boolean outputsEnergyTo(byte b, boolean b1) { - return true; - } + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + return null; + } - public boolean inputEnergyFrom(byte b, boolean b1) { - return false; - } + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + } + + public boolean hasCustomInventoryName() { + return true; + } + + public String getInventoryName() { + return StatCollector.translateToLocal("tile.EMT.solar." + getInventoryName().replaceAll(" ", "").toLowerCase() + ".name"); + } + + public int getInventoryStackLimit() { + return 0; + } + + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + public void openInventory() { + } + + public void closeInventory() { + } + + public int gaugeEnergyScaled(int i) { + return (int) (this.mp_storage * 1000 * i / (int) this.maxstorage); + } + + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return false; + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } + + @Override + public short getFacing() { + return 0; + } + + @Override + public void setFacing(short facing) { + } + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } + + @Override + public float getWrenchDropRate() { + return 1; + } + + public void inputintoGTnet() { + for (byte i = 0; i < 6; i = (byte) (i + 1)) { + if (getIGregTechTileEntityAtSide(i) != null) { + if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) { + long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this); + drainEnergyUnits(i, getOutputVoltage(), tEU); + } + } + } + } + + public byte getColorization() { + return this.color; + } + + public byte setColorization(byte aColor) { + this.color = aColor; + return this.color; + } + + public boolean isUniversalEnergyStored(long aEnergyAmount) { + return aEnergyAmount < this.energySource.getEnergyStored(); + } + + public long getUniversalEnergyStored() { + return (long) this.energySource.getEnergyStored(); + } + + public long getUniversalEnergyCapacity() { + return (long) this.energySource.getCapacity(); + } + + public long getOutputAmperage() { + long ret; + if (this.energySource.getSourceTier() <= 4) { + if (this.generating <= GT_Values.V[this.energySource.getSourceTier() - 2]) { + ret = 1L; + } + if (this.generating % GT_Values.V[this.energySource.getSourceTier() - 2] == 0.0D) { + ret = (long) (this.generating / GT_Values.V[this.energySource.getSourceTier() - 2]); + } else + ret = (long) (1L + (this.generating / GT_Values.V[this.energySource.getSourceTier() - 2])); + } else { + if (this.generating <= GT_Values.V[this.energySource.getSourceTier() - 1]) { + ret = 1L; + } + if (this.generating % GT_Values.V[this.energySource.getSourceTier()] == 0.0D) { + ret = (long) (this.generating / GT_Values.V[this.energySource.getSourceTier() - 1]); + } else + ret = (long) (1L + (this.generating / GT_Values.V[this.energySource.getSourceTier() - 1])); + } + return ret; + + } + + public long getOutputVoltage() { + if (this.energySource.getSourceTier() <= 4) + return GT_Values.V[(this.energySource.getSourceTier() - 2)]; + else + return GT_Values.V[(this.energySource.getSourceTier() - 1)]; + } + + public long getInputAmperage() { + return 0L; + } + + public long getInputVoltage() { + return 0L; + } + + public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) { + if (this.energySource.getEnergyStored() > aEnergy) { + this.energySource.drawEnergy(aEnergy); + this.storage = ((int) this.energySource.getEnergyStored()); + return true; + } + return false; + } + + public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) { + return false; + } + + public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + return decreaseStoredEnergyUnits(aVoltage * aAmperage, this.energySource.getEnergyStored() > aVoltage * aAmperage); + } + + public long getAverageElectricInput() { + return 0L; + } + + public long getAverageElectricOutput() { + return 0L; + } + + public long getStoredEU() { + return (long) this.energySource.getEnergyStored(); + } + + public long getEUCapacity() { + return (long) this.energySource.getCapacity(); + } + + public long getStoredSteam() { + return 0L; + } + + public long getSteamCapacity() { + return 0L; + } + + public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) { + return false; + } + + public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + return 0L; + } + + public boolean inputEnergyFrom(byte aSide) { + return false; + } + + public boolean outputsEnergyTo(byte aSide) { + return true; + } + + public boolean energyStateReady() { + return false; + } + + public World getWorld() { + return this.worldObj; + } + + public int getXCoord() { + return this.xCoord; + } + + public short getYCoord() { + return (short) this.yCoord; + } + + public int getZCoord() { + return this.zCoord; + } + + public boolean isServerSide() { + return side; + } + + public boolean isClientSide() { + return side; + } + + public int getRandomNumber(int aRange) { + return this.worldObj.rand.nextInt(aRange); + } + + public TileEntity getTileEntity(int aX, int aY, int aZ) { + return this.worldObj.getTileEntity(aX, aY, aZ); + } + + public TileEntity getTileEntityOffset(int aX, int aY, int aZ) { + return this.worldObj.getTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); + } + + public TileEntity getTileEntityAtSide(byte aSide) { + if ((aSide < 0) || (aSide >= 6)) { + return null; + } + int tX = getOffsetX(aSide, 1); + int tY = getOffsetY(aSide, 1); + int tZ = getOffsetZ(aSide, 1); + return this.worldObj.getTileEntity(tX, tY, tZ); + } + + public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) { + if (aDistance == 1) { + return getTileEntityAtSide(aSide); + } + return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); + } + + public IInventory getIInventory(int aX, int aY, int aZ) { + return null; + } + + public IInventory getIInventoryOffset(int aX, int aY, int aZ) { + return null; + } + + public IInventory getIInventoryAtSide(byte aSide) { + return null; + } + + public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) { + return null; + } + + public IFluidHandler getITankContainer(int aX, int aY, int aZ) { + return null; + } + + public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) { + return null; + } + + public IFluidHandler getITankContainerAtSide(byte aSide) { + return null; + } + + public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) { + return null; + } + + public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) { + TileEntity tTileEntity = getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof IGregTechTileEntity)) { + return (IGregTechTileEntity) tTileEntity; + } + return null; + } + + public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) { + return getIGregTechTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); + } + + public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) { + TileEntity tTileEntity = getTileEntityAtSide(aSide); + if ((tTileEntity instanceof IGregTechTileEntity)) { + return (IGregTechTileEntity) tTileEntity; + } + return null; + } + + public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) { + TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance); + if ((tTileEntity instanceof IGregTechTileEntity)) { + return (IGregTechTileEntity) tTileEntity; + } + return null; + } + + public Block getBlock(int aX, int aY, int aZ) { + return this.worldObj.getBlock(aX, aY, aZ); + } + + public Block getBlockOffset(int aX, int aY, int aZ) { + return getBlock(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); + } + + public Block getBlockAtSide(byte aSide) { + if ((aSide < 0) || (aSide >= 6)) { + return null; + } + int tX = getOffsetX(aSide, 1); + int tY = getOffsetY(aSide, 1); + int tZ = getOffsetZ(aSide, 1); + return this.worldObj.getBlock(tX, tY, tZ); + } + + public Block getBlockAtSideAndDistance(byte aSide, int aDistance) { + if (aDistance == 1) { + return getBlockAtSide(aSide); + } + return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); + } + + public byte getMetaID(int aX, int aY, int aZ) { + return (byte) this.worldObj.getBlockMetadata(aX, aY, aZ); + } + + public byte getMetaIDOffset(int aX, int aY, int aZ) { + return getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); + } + + public byte getMetaIDAtSide(byte aSide) { + int tX = getOffsetX(aSide, 1); + int tY = getOffsetY(aSide, 1); + int tZ = getOffsetZ(aSide, 1); + return (byte) this.worldObj.getBlockMetadata(tX, tY, tZ); + } + + public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) { + if (aDistance == 1) { + return getMetaIDAtSide(aSide); + } + return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); + } + + public byte getLightLevel(int aX, int aY, int aZ) { + return 0; + } + + public byte getLightLevelOffset(int aX, int aY, int aZ) { + return 0; + } + + public byte getLightLevelAtSide(byte aSide) { + return 0; + } + + public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) { + return 0; + } + + public boolean getOpacity(int aX, int aY, int aZ) { + return false; + } + + public boolean getOpacityOffset(int aX, int aY, int aZ) { + return false; + } + + public boolean getOpacityAtSide(byte aSide) { + return false; + } + + public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) { + return false; + } + + public boolean getSky(int aX, int aY, int aZ) { + boolean sky = true; + do { + if (!this.worldObj.getBlock(aX, ++aY, aZ).getMaterial().equals(Material.air)) { + sky = false; + } + } while ((sky) && (aY < 256)); + return sky; + } + + public boolean getSkyOffset(int aX, int aY, int aZ) { + return getSky(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord); + } + + public boolean getSkyAtSide(byte aSide) { + return false; + } + + public boolean getSkyAtSideAndDistance(byte aSide, int aDistance) { + return false; + } + + public boolean getAir(int aX, int aY, int aZ) { + return this.worldObj.getBlock(aX, aY, aZ).equals(Blocks.air); + } + + public boolean getAirOffset(int aX, int aY, int aZ) { + return getAir(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ); + } + + public boolean getAirAtSide(byte aSide) { + return getAirAtSideAndDistance(aSide, 1); + } + + public boolean getAirAtSideAndDistance(byte aSide, int aDistance) { + return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance)); + } + + public BiomeGenBase getBiome() { + return this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord); + } + + public BiomeGenBase getBiome(int aX, int aZ) { + return this.worldObj.getBiomeGenForCoords(aX, aZ); + } + + public int getOffsetX(byte aSide, int aMultiplier) { + return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier; + } + + public short getOffsetY(byte aSide, int aMultiplier) { + return (short) (this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier); + } + + public int getOffsetZ(byte aSide, int aMultiplier) { + return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier; + } + + public boolean isDead() { + return this.dead; + } + + public void sendBlockEvent(byte aID, byte aValue) { + GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Block_Event(this.xCoord, (short) this.yCoord, this.zCoord, aID, aValue), this.xCoord, this.zCoord); + } + + public long getTimer() { + return this.timer; + } + + public void setLightValue(byte aLightValue) { + } + + public boolean isInvalidTileEntity() { + return this.tileEntityInvalid; + } + + public boolean openGUI(EntityPlayer aPlayer, int aID) { + return false; + } + + public boolean openGUI(EntityPlayer aPlayer) { + return false; + } + + public boolean outputsEnergyTo(byte b, boolean b1) { + return true; + } + + public boolean inputEnergyFrom(byte b, boolean b1) { + return false; + } } diff --git a/src/main/java/emt/tile/solar/air/TileEntityAirSolar.java b/src/main/java/emt/tile/solar/air/TileEntityAirSolar.java index 035fd1c..8a68234 100644 --- a/src/main/java/emt/tile/solar/air/TileEntityAirSolar.java +++ b/src/main/java/emt/tile/solar/air/TileEntityAirSolar.java @@ -1,9 +1,9 @@ package emt.tile.solar.air; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityAirSolar extends TileEntitySolarBase { public TileEntityAirSolar() { super(); - energySource = new BasicSource(this, 10000, 3); + energySource = new DefinitelyNotAIC2Source(this, 10000, 3); output = EMTConfigHandler.compressedSolarOutput; this.maxstorage=this.getEUCapacity(); }; diff --git a/src/main/java/emt/tile/solar/air/TileEntityDoubleAirSolar.java b/src/main/java/emt/tile/solar/air/TileEntityDoubleAirSolar.java index 9e7a33b..ea10355 100644 --- a/src/main/java/emt/tile/solar/air/TileEntityDoubleAirSolar.java +++ b/src/main/java/emt/tile/solar/air/TileEntityDoubleAirSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.air; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -10,7 +10,7 @@ public class TileEntityDoubleAirSolar extends TileEntityAirSolar { public TileEntityDoubleAirSolar() { super(); - energySource = new BasicSource(this, 100000, 4); + energySource = new DefinitelyNotAIC2Source(this, 100000, 4); output = EMTConfigHandler.doubleCompressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/air/TileEntityTripleAirSolar.java b/src/main/java/emt/tile/solar/air/TileEntityTripleAirSolar.java index c21a0bd..a890b93 100644 --- a/src/main/java/emt/tile/solar/air/TileEntityTripleAirSolar.java +++ b/src/main/java/emt/tile/solar/air/TileEntityTripleAirSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.air; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityTripleAirSolar extends TileEntityAirSolar { public TileEntityTripleAirSolar() { super(); output = EMTConfigHandler.tripleCompressedSolarOutput; - energySource = new BasicSource(this, 1000000, 5); + energySource = new DefinitelyNotAIC2Source(this, 1000000, 5); this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/compressed/TileEntityCompressedSolar.java b/src/main/java/emt/tile/solar/compressed/TileEntityCompressedSolar.java index 43dd883..7e3619d 100644 --- a/src/main/java/emt/tile/solar/compressed/TileEntityCompressedSolar.java +++ b/src/main/java/emt/tile/solar/compressed/TileEntityCompressedSolar.java @@ -1,9 +1,9 @@ package emt.tile.solar.compressed; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityCompressedSolar extends TileEntitySolarBase { public TileEntityCompressedSolar() { super(); - energySource = new BasicSource(this, 10000, 3); + energySource = new DefinitelyNotAIC2Source(this, 10000, 3); output = EMTConfigHandler.compressedSolarOutput; this.maxstorage=this.getEUCapacity(); }; diff --git a/src/main/java/emt/tile/solar/compressed/TileEntityDoubleCompressedSolar.java b/src/main/java/emt/tile/solar/compressed/TileEntityDoubleCompressedSolar.java index e495bb3..805d1db 100644 --- a/src/main/java/emt/tile/solar/compressed/TileEntityDoubleCompressedSolar.java +++ b/src/main/java/emt/tile/solar/compressed/TileEntityDoubleCompressedSolar.java @@ -1,9 +1,9 @@ package emt.tile.solar.compressed; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityDoubleCompressedSolar extends TileEntitySolarBase { public TileEntityDoubleCompressedSolar() { super(); - energySource = new BasicSource(this, 100000, 4); + energySource = new DefinitelyNotAIC2Source(this, 100000, 4); output = EMTConfigHandler.doubleCompressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/compressed/TileEntityTripleCompressedSolar.java b/src/main/java/emt/tile/solar/compressed/TileEntityTripleCompressedSolar.java index cef8f25..534c5c8 100644 --- a/src/main/java/emt/tile/solar/compressed/TileEntityTripleCompressedSolar.java +++ b/src/main/java/emt/tile/solar/compressed/TileEntityTripleCompressedSolar.java @@ -1,9 +1,9 @@ package emt.tile.solar.compressed; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -12,7 +12,7 @@ public class TileEntityTripleCompressedSolar extends TileEntitySolarBase { public TileEntityTripleCompressedSolar() { super(); output = EMTConfigHandler.tripleCompressedSolarOutput; - energySource = new BasicSource(this, 1000000, 5); + energySource = new DefinitelyNotAIC2Source(this, 1000000, 5); this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/dark/TileEntityDarkSolar.java b/src/main/java/emt/tile/solar/dark/TileEntityDarkSolar.java index 9efcaa3..5b847e1 100644 --- a/src/main/java/emt/tile/solar/dark/TileEntityDarkSolar.java +++ b/src/main/java/emt/tile/solar/dark/TileEntityDarkSolar.java @@ -1,9 +1,9 @@ package emt.tile.solar.dark; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityDarkSolar extends TileEntitySolarBase { public TileEntityDarkSolar() { super(); - energySource = new BasicSource(this, 10000, 3); + energySource = new DefinitelyNotAIC2Source(this, 10000, 3); output = EMTConfigHandler.compressedSolarOutput; this.maxstorage=this.getEUCapacity(); }; diff --git a/src/main/java/emt/tile/solar/dark/TileEntityDoubleDarkSolar.java b/src/main/java/emt/tile/solar/dark/TileEntityDoubleDarkSolar.java index 27c2396..59e8ee4 100644 --- a/src/main/java/emt/tile/solar/dark/TileEntityDoubleDarkSolar.java +++ b/src/main/java/emt/tile/solar/dark/TileEntityDoubleDarkSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.dark; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -10,7 +10,7 @@ public class TileEntityDoubleDarkSolar extends TileEntityDarkSolar { public TileEntityDoubleDarkSolar() { super(); - energySource = new BasicSource(this, 100000, 4); + energySource = new DefinitelyNotAIC2Source(this, 100000, 4); output = EMTConfigHandler.doubleCompressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/dark/TileEntityTripleDarkSolar.java b/src/main/java/emt/tile/solar/dark/TileEntityTripleDarkSolar.java index 4bc1ed9..70eee99 100644 --- a/src/main/java/emt/tile/solar/dark/TileEntityTripleDarkSolar.java +++ b/src/main/java/emt/tile/solar/dark/TileEntityTripleDarkSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.dark; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityTripleDarkSolar extends TileEntityDarkSolar { public TileEntityTripleDarkSolar() { super(); output = EMTConfigHandler.tripleCompressedSolarOutput; - energySource = new BasicSource(this, 1000000, 5); + energySource = new DefinitelyNotAIC2Source(this, 1000000, 5); this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/earth/TileEntityDoubleEarthSolar.java b/src/main/java/emt/tile/solar/earth/TileEntityDoubleEarthSolar.java index b33fe65..ae51d16 100644 --- a/src/main/java/emt/tile/solar/earth/TileEntityDoubleEarthSolar.java +++ b/src/main/java/emt/tile/solar/earth/TileEntityDoubleEarthSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.earth; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -10,7 +10,7 @@ public class TileEntityDoubleEarthSolar extends TileEntityEarthSolar { public TileEntityDoubleEarthSolar() { super(); - energySource = new BasicSource(this, 100000, 4); + energySource = new DefinitelyNotAIC2Source(this, 100000, 4); output = EMTConfigHandler.doubleCompressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/earth/TileEntityEarthSolar.java b/src/main/java/emt/tile/solar/earth/TileEntityEarthSolar.java index 6b08979..84253a2 100644 --- a/src/main/java/emt/tile/solar/earth/TileEntityEarthSolar.java +++ b/src/main/java/emt/tile/solar/earth/TileEntityEarthSolar.java @@ -1,9 +1,9 @@ package emt.tile.solar.earth; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityEarthSolar extends TileEntitySolarBase { public TileEntityEarthSolar() { super(); - energySource = new BasicSource(this, 10000, 3); + energySource = new DefinitelyNotAIC2Source(this, 10000, 3); output = EMTConfigHandler.compressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/earth/TileEntityTripleEarthSolar.java b/src/main/java/emt/tile/solar/earth/TileEntityTripleEarthSolar.java index ae1aa26..8b3d877 100644 --- a/src/main/java/emt/tile/solar/earth/TileEntityTripleEarthSolar.java +++ b/src/main/java/emt/tile/solar/earth/TileEntityTripleEarthSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.earth; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityTripleEarthSolar extends TileEntityEarthSolar { public TileEntityTripleEarthSolar() { super(); output = EMTConfigHandler.tripleCompressedSolarOutput; - energySource = new BasicSource(this, 1000000, 5); + energySource = new DefinitelyNotAIC2Source(this, 1000000, 5); this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/fire/TileEntityDoubleFireSolar.java b/src/main/java/emt/tile/solar/fire/TileEntityDoubleFireSolar.java index 10a8dfa..2a5854f 100644 --- a/src/main/java/emt/tile/solar/fire/TileEntityDoubleFireSolar.java +++ b/src/main/java/emt/tile/solar/fire/TileEntityDoubleFireSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.fire; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -10,7 +10,7 @@ public class TileEntityDoubleFireSolar extends TileEntityFireSolar { public TileEntityDoubleFireSolar() { super(); - energySource = new BasicSource(this, 1000000, 4); + energySource = new DefinitelyNotAIC2Source(this, 1000000, 4); output = EMTConfigHandler.doubleCompressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/fire/TileEntityFireSolar.java b/src/main/java/emt/tile/solar/fire/TileEntityFireSolar.java index 066cc46..c8ff473 100644 --- a/src/main/java/emt/tile/solar/fire/TileEntityFireSolar.java +++ b/src/main/java/emt/tile/solar/fire/TileEntityFireSolar.java @@ -1,9 +1,9 @@ package emt.tile.solar.fire; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import thaumcraft.api.aspects.Aspect; @@ -13,7 +13,7 @@ public class TileEntityFireSolar extends TileEntitySolarBase { public TileEntityFireSolar() { super(); - energySource = new BasicSource(this, 10000, 3); + energySource = new DefinitelyNotAIC2Source(this, 10000, 3); output = EMTConfigHandler.compressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/fire/TileEntityTripleFireSolar.java b/src/main/java/emt/tile/solar/fire/TileEntityTripleFireSolar.java index 827e7d7..406e5a9 100644 --- a/src/main/java/emt/tile/solar/fire/TileEntityTripleFireSolar.java +++ b/src/main/java/emt/tile/solar/fire/TileEntityTripleFireSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.fire; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityTripleFireSolar extends TileEntityFireSolar { public TileEntityTripleFireSolar() { super(); output = EMTConfigHandler.tripleCompressedSolarOutput; - energySource = new BasicSource(this, 1000000, 5); + energySource = new DefinitelyNotAIC2Source(this, 1000000, 5); this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/order/TileEntityDoubleOrderSolar.java b/src/main/java/emt/tile/solar/order/TileEntityDoubleOrderSolar.java index 927f007..a197754 100644 --- a/src/main/java/emt/tile/solar/order/TileEntityDoubleOrderSolar.java +++ b/src/main/java/emt/tile/solar/order/TileEntityDoubleOrderSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.order; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -10,7 +10,7 @@ public class TileEntityDoubleOrderSolar extends TileEntityOrderSolar { public TileEntityDoubleOrderSolar() { super(); - energySource = new BasicSource(this, 100000, 4); + energySource = new DefinitelyNotAIC2Source(this, 100000, 4); output = EMTConfigHandler.doubleCompressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/order/TileEntityOrderSolar.java b/src/main/java/emt/tile/solar/order/TileEntityOrderSolar.java index c3fd97e..4f6c6d7 100644 --- a/src/main/java/emt/tile/solar/order/TileEntityOrderSolar.java +++ b/src/main/java/emt/tile/solar/order/TileEntityOrderSolar.java @@ -1,9 +1,9 @@ package emt.tile.solar.order; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityOrderSolar extends TileEntitySolarBase { public TileEntityOrderSolar() { super(); - energySource = new BasicSource(this, 10000, 3); + energySource = new DefinitelyNotAIC2Source(this, 10000, 3); output = EMTConfigHandler.compressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/order/TileEntityTripleOrderSolar.java b/src/main/java/emt/tile/solar/order/TileEntityTripleOrderSolar.java index 9f8bc44..dc58d55 100644 --- a/src/main/java/emt/tile/solar/order/TileEntityTripleOrderSolar.java +++ b/src/main/java/emt/tile/solar/order/TileEntityTripleOrderSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.order; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityTripleOrderSolar extends TileEntityOrderSolar { public TileEntityTripleOrderSolar() { super(); output = EMTConfigHandler.tripleCompressedSolarOutput; - energySource = new BasicSource(this, 1000000, 5); + energySource = new DefinitelyNotAIC2Source(this, 1000000, 5); this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/water/TileEntityDoubleWaterSolar.java b/src/main/java/emt/tile/solar/water/TileEntityDoubleWaterSolar.java index 55a0d8a..cefa7de 100644 --- a/src/main/java/emt/tile/solar/water/TileEntityDoubleWaterSolar.java +++ b/src/main/java/emt/tile/solar/water/TileEntityDoubleWaterSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.water; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -10,7 +10,7 @@ public class TileEntityDoubleWaterSolar extends TileEntityWaterSolar { public TileEntityDoubleWaterSolar() { super(); - energySource = new BasicSource(this, 100000, 4); + energySource = new DefinitelyNotAIC2Source(this, 100000, 4); output = EMTConfigHandler.doubleCompressedSolarOutput; this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/water/TileEntityTripleWaterSolar.java b/src/main/java/emt/tile/solar/water/TileEntityTripleWaterSolar.java index 513e001..921233a 100644 --- a/src/main/java/emt/tile/solar/water/TileEntityTripleWaterSolar.java +++ b/src/main/java/emt/tile/solar/water/TileEntityTripleWaterSolar.java @@ -1,8 +1,8 @@ package emt.tile.solar.water; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,7 +11,7 @@ public class TileEntityTripleWaterSolar extends TileEntityWaterSolar { public TileEntityTripleWaterSolar() { super(); output = EMTConfigHandler.tripleCompressedSolarOutput; - energySource = new BasicSource(this, 1000000, 5); + energySource = new DefinitelyNotAIC2Source(this, 1000000, 5); this.maxstorage=this.getEUCapacity(); } diff --git a/src/main/java/emt/tile/solar/water/TileEntityWaterSolar.java b/src/main/java/emt/tile/solar/water/TileEntityWaterSolar.java index eb6cbe3..8373de4 100644 --- a/src/main/java/emt/tile/solar/water/TileEntityWaterSolar.java +++ b/src/main/java/emt/tile/solar/water/TileEntityWaterSolar.java @@ -1,9 +1,9 @@ package emt.tile.solar.water; import emt.init.EMTBlocks; +import emt.tile.DefinitelyNotAIC2Source; import emt.tile.solar.TileEntitySolarBase; import emt.util.EMTConfigHandler; -import ic2.api.energy.prefab.BasicSource; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -12,7 +12,7 @@ public class TileEntityWaterSolar extends TileEntitySolarBase { public TileEntityWaterSolar() { super(); - energySource = new BasicSource(this, 10000, 3); + energySource = new DefinitelyNotAIC2Source(this, 10000, 3); output = EMTConfigHandler.compressedSolarOutput; this.maxstorage=this.getEUCapacity(); }