mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-21 04:22:09 +00:00
+ Solar rework
+ update to Java 8 + added GUI for Solars (in different colors) + changed Terra/Aer solar beeing dynamic (from y=5 to y=220|x1 to x3) + changed Ordo/Perditio solar generating at night/day (x0.75/x2) + changed Aqua solar generation (x1 at day, x2 under water, x3 while rain x6 while thunderstorm) + changed Ignis solar generation (x1 at day, x2 in Nether, x3 when fed with 10Ignis Centivis) + version number increase (1.2.7.0 -> 1.2.7.1)
This commit is contained in:
1 parent
be6fc768f8
commit
2e2b2ef941
35 files changed
+1224
-142
No files matched your search
@@ -54,21 +54,22 @@ public class TileEntityBaseGenerator
|
||||
|
||||
public TileEntityBaseGenerator(Aspect aspect)
|
||||
{
|
||||
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;
|
||||
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.dead = false;
|
||||
this.timer = 1L;
|
||||
this.timer =+ 1L;
|
||||
storeFuel();
|
||||
fillfrompipe();
|
||||
createEnergy();
|
||||
@@ -76,20 +77,6 @@ public class TileEntityBaseGenerator
|
||||
this.energySource.updateEntity();
|
||||
}
|
||||
|
||||
public void inputintoGTnet()
|
||||
{
|
||||
for (byte i = 0; i < 6; i = (byte)(i + 1)) {
|
||||
if (getIGregTechTileEntityAtSide(i) != null)
|
||||
{
|
||||
IGregTechTileEntity aBaseMetaTileEntity = getIGregTechTileEntityAtSide(i);
|
||||
if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage()))
|
||||
{
|
||||
long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this);
|
||||
drainEnergyUnits(i, getOutputVoltage(), tEU);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void storeFuel()
|
||||
{
|
||||
@@ -384,7 +371,21 @@ public class TileEntityBaseGenerator
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void inputintoGTnet()
|
||||
{
|
||||
for (byte i = 0; i < 6; i = (byte)(i + 1)) {
|
||||
if (getIGregTechTileEntityAtSide(i) != null)
|
||||
{
|
||||
IGregTechTileEntity aBaseMetaTileEntity = getIGregTechTileEntityAtSide(i);
|
||||
if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage()))
|
||||
{
|
||||
long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this);
|
||||
drainEnergyUnits(i, getOutputVoltage(), tEU);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public byte getColorization()
|
||||
{
|
||||
return this.color;
|
||||
|
||||
@@ -1,15 +1,32 @@
|
||||
package emt.tile.solar;
|
||||
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.tileentity.IBasicEnergyContainer;
|
||||
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;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public abstract class TileEntitySolarBase extends TileEntityEMT implements IWrenchable {
|
||||
public abstract class TileEntitySolarBase extends TileEntityEMT implements IInventory, IWrenchable, IHasWorldObjectAndCoords, IEnergyConnected, IBasicEnergyContainer {
|
||||
|
||||
public BasicSource energySource;
|
||||
public static Random random = new Random();
|
||||
@@ -19,26 +36,32 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IWren
|
||||
public boolean noSunlight;
|
||||
public int tick;
|
||||
public double output = 0;
|
||||
public long timer = 0L;
|
||||
public boolean dead = true;
|
||||
public double generating;
|
||||
public byte color = (-1);
|
||||
public int storage;
|
||||
public long maxstorage=0;
|
||||
public boolean isActive=false;
|
||||
|
||||
public TileEntitySolarBase() {
|
||||
this.tick = random.nextInt(64);
|
||||
this.tick = 10;
|
||||
this.storage = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
this.dead = false;
|
||||
this.timer =+ 1L;
|
||||
inputintoGTnet();
|
||||
energySource.updateEntity();
|
||||
checkConditions();
|
||||
}
|
||||
|
||||
public abstract float calc_multi();
|
||||
|
||||
public void checkConditions() {
|
||||
if (!initialized && worldObj != null) {
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight) {
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
@@ -48,8 +71,13 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IWren
|
||||
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(output);
|
||||
isActive=true;
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
|
||||
this.energySource.addEnergy(this.output*calc_multi());
|
||||
this.generating=output*calc_multi();
|
||||
}
|
||||
}
|
||||
else isActive=false;
|
||||
}
|
||||
|
||||
public void updateSunState() {
|
||||
@@ -80,6 +108,55 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IWren
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
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.storage * 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;
|
||||
@@ -103,4 +180,493 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IWren
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public void inputintoGTnet()
|
||||
{
|
||||
for (byte i = 0; i < 6; i = (byte)(i + 1)) {
|
||||
if (getIGregTechTileEntityAtSide(i) != null)
|
||||
{
|
||||
IGregTechTileEntity aBaseMetaTileEntity = getIGregTechTileEntityAtSide(i);
|
||||
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 FMLCommonHandler.instance().getEffectiveSide().isServer();
|
||||
}
|
||||
|
||||
public boolean isClientSide()
|
||||
{
|
||||
return FMLCommonHandler.instance().getEffectiveSide().isClient();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -13,20 +13,27 @@ public class TileEntityAirSolar extends TileEntitySolarBase {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
};
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible && this.yCoord >= 160) {
|
||||
energySource.addEnergy(output * 2.5);
|
||||
}
|
||||
else if (theSunIsVisible) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
}
|
||||
public float calc_multi() {
|
||||
if (this.yCoord<5)
|
||||
return 1F;
|
||||
else if (this.yCoord>220)
|
||||
return 3F;
|
||||
else
|
||||
return (float) ((41D/43D) + ((2D/215D) * (double) this.yCoord));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 15);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Compressed Aer Solar";
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,18 @@ public class TileEntityDoubleAirSolar extends TileEntityAirSolar {
|
||||
|
||||
public TileEntityDoubleAirSolar() {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 4);
|
||||
energySource = new BasicSource(this, 100000, 4);
|
||||
output = EMTConfigHandler.doubleCompressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars2, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Double Compressed Aer Solar";
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,17 @@ public class TileEntityTripleAirSolar extends TileEntityAirSolar {
|
||||
public TileEntityTripleAirSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new BasicSource(this, 40000, 5);
|
||||
energySource = new BasicSource(this, 1000000, 5);
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars2, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Triple Compressed Aer Solar";
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,21 @@ public class TileEntityCompressedSolar extends TileEntitySolarBase {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
};
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calc_multi() {
|
||||
return 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Compressed Solar";
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,23 @@ public class TileEntityDoubleCompressedSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityDoubleCompressedSolar() {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 4);
|
||||
energySource = new BasicSource(this, 100000, 4);
|
||||
output = EMTConfigHandler.doubleCompressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calc_multi() {
|
||||
return 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Double Compressed Solar";
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,22 @@ public class TileEntityTripleCompressedSolar extends TileEntitySolarBase {
|
||||
public TileEntityTripleCompressedSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new BasicSource(this, 40000, 5);
|
||||
energySource = new BasicSource(this, 1000000, 5);
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calc_multi() {
|
||||
return 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Triple Compressed Solar";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package emt.tile.solar.dark;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
@@ -13,17 +14,34 @@ public class TileEntityDarkSolar extends TileEntitySolarBase {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
};
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && !worldObj.isDaytime() && !worldObj.isRaining() && !worldObj.isThundering()) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
if ((this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) && (!this.worldObj.isRaining()) && (!this.worldObj.isThundering())) {
|
||||
isActive=true;
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
|
||||
this.generating=output*calc_multi();
|
||||
this.energySource.addEnergy(this.output*calc_multi());
|
||||
}
|
||||
} else isActive = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calc_multi() {
|
||||
if (this.worldObj.isDaytime())
|
||||
return 0.75F;
|
||||
else return 2F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Compressed Perditio Solar";
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,19 @@ public class TileEntityDoubleDarkSolar extends TileEntityDarkSolar {
|
||||
|
||||
public TileEntityDoubleDarkSolar() {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 4);
|
||||
energySource = new BasicSource(this, 100000, 4);
|
||||
output = EMTConfigHandler.doubleCompressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 7);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Double Compressed Perditio Solar";
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,18 @@ public class TileEntityTripleDarkSolar extends TileEntityDarkSolar {
|
||||
public TileEntityTripleDarkSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new BasicSource(this, 40000, 5);
|
||||
energySource = new BasicSource(this, 1000000, 5);
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 8);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Triple Compressed Perditio Solar";
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,19 @@ public class TileEntityDoubleEarthSolar extends TileEntityEarthSolar {
|
||||
|
||||
public TileEntityDoubleEarthSolar() {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 4);
|
||||
energySource = new BasicSource(this, 100000, 4);
|
||||
output = EMTConfigHandler.doubleCompressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars2, 1, 3);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Double Compressed Terra Solar";
|
||||
}
|
||||
}
|
||||
@@ -13,20 +13,26 @@ public class TileEntityEarthSolar extends TileEntitySolarBase {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible && this.yCoord <= 10) {
|
||||
energySource.addEnergy(output * 2.5);
|
||||
}
|
||||
else if (theSunIsVisible) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
public float calc_multi() {
|
||||
if (this.yCoord<5)
|
||||
return 3F;
|
||||
else if (this.yCoord>220)
|
||||
return 1F;
|
||||
else
|
||||
return (float) ((-2D)/215D*(double)this.yCoord + 131D/43D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars2, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Compressed Terra Solar";
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,18 @@ public class TileEntityTripleEarthSolar extends TileEntityEarthSolar {
|
||||
public TileEntityTripleEarthSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new BasicSource(this, 40000, 5);
|
||||
energySource = new BasicSource(this, 1000000, 5);
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars2, 1, 4);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Triple Compressed Terra Solar";
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,19 @@ public class TileEntityDoubleFireSolar extends TileEntityFireSolar {
|
||||
|
||||
public TileEntityDoubleFireSolar() {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 4);
|
||||
energySource = new BasicSource(this, 1000000, 4);
|
||||
output = EMTConfigHandler.doubleCompressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 13);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Double Compressed Ignis Solar";
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
package emt.tile.solar.fire;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import emt.init.EMTBlocks;
|
||||
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;
|
||||
import thaumcraft.api.visnet.VisNetHandler;
|
||||
|
||||
public class TileEntityFireSolar extends TileEntitySolarBase {
|
||||
|
||||
@@ -13,28 +16,49 @@ public class TileEntityFireSolar extends TileEntitySolarBase {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkConditions() {
|
||||
if (!initialized && worldObj != null) {
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
initialized = true;
|
||||
boolean ignis = ((this.worldObj.provider.dimensionId == (-1)) || (theSunIsVisible));
|
||||
if(ignis) {
|
||||
this.isActive=true;
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
|
||||
this.generating=output*calc_multi();
|
||||
this.energySource.addEnergy(this.output*calc_multi());
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.provider.dimensionId == -1) {
|
||||
energySource.addEnergy(output * 2);
|
||||
}
|
||||
else {
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
else this.isActive=false;
|
||||
/*if (!ignis && VisNetHandler.drainVis(worldObj, xCoord, yCoord, zCoord, Aspect.FIRE, 10)>=10) {
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
|
||||
energySource.addEnergy(15F);
|
||||
this.generating=15D;
|
||||
}
|
||||
}*/
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calc_multi() {
|
||||
if (VisNetHandler.drainVis(worldObj, xCoord, yCoord, zCoord, Aspect.FIRE, 10)>=10)
|
||||
return 3F;
|
||||
else if (this.worldObj.provider.dimensionId == (-1))
|
||||
return 2F;
|
||||
else
|
||||
return 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 12);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Compressed Ignis Solar";
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,18 @@ public class TileEntityTripleFireSolar extends TileEntityFireSolar {
|
||||
public TileEntityTripleFireSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new BasicSource(this, 40000, 5);
|
||||
energySource = new BasicSource(this, 1000000, 5);
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 14);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Triple Compressed Ignis Solar";
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,18 @@ public class TileEntityDoubleOrderSolar extends TileEntityOrderSolar {
|
||||
|
||||
public TileEntityDoubleOrderSolar() {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 4);
|
||||
energySource = new BasicSource(this, 100000, 4);
|
||||
output = EMTConfigHandler.doubleCompressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Double Compressed Ordo Solar";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package emt.tile.solar.order;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
@@ -13,17 +14,34 @@ public class TileEntityOrderSolar extends TileEntitySolarBase {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(output * 3);
|
||||
}
|
||||
if ((this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) && (!this.worldObj.isRaining()) && (!this.worldObj.isThundering())) {
|
||||
isActive = true;
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
|
||||
this.energySource.addEnergy(this.output*calc_multi());
|
||||
this.generating=output*calc_multi();
|
||||
}
|
||||
}else isActive = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calc_multi() {
|
||||
if (this.worldObj.isDaytime())
|
||||
return 2F;
|
||||
else return 0.75F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 9);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Compressed Ordo Solar";
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,18 @@ public class TileEntityTripleOrderSolar extends TileEntityOrderSolar {
|
||||
public TileEntityTripleOrderSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new BasicSource(this, 40000, 5);
|
||||
energySource = new BasicSource(this, 1000000, 5);
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 11);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Triple Compressed Ordo Solar";
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,19 @@ public class TileEntityDoubleWaterSolar extends TileEntityWaterSolar {
|
||||
|
||||
public TileEntityDoubleWaterSolar() {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 4);
|
||||
energySource = new BasicSource(this, 100000, 4);
|
||||
output = EMTConfigHandler.doubleCompressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 4);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Double Compressed Aqua Solar";
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,18 @@ public class TileEntityTripleWaterSolar extends TileEntityWaterSolar {
|
||||
public TileEntityTripleWaterSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new BasicSource(this, 40000, 5);
|
||||
energySource = new BasicSource(this, 1000000, 5);
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 5);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Triple Compressed Aqua Solar";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package emt.tile.solar.water;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import emt.init.EMTBlocks;
|
||||
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;
|
||||
|
||||
public class TileEntityWaterSolar extends TileEntitySolarBase {
|
||||
@@ -13,12 +15,21 @@ public class TileEntityWaterSolar extends TileEntitySolarBase {
|
||||
super();
|
||||
energySource = new BasicSource(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)) {
|
||||
energySource.addEnergy(output);
|
||||
if (theSunIsVisible || (this.worldObj.isRaining() && this.worldObj.isDaytime()) || this.worldObj.isThundering()){
|
||||
isActive = true;
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
|
||||
this.generating=output*calc_multi();
|
||||
energySource.addEnergy(output*calc_multi());
|
||||
}
|
||||
}
|
||||
else {
|
||||
isActive = false;
|
||||
this.generating=0D;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,4 +37,22 @@ public class TileEntityWaterSolar extends TileEntitySolarBase {
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtSolars, 1, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calc_multi() {
|
||||
if (worldObj.isThundering())
|
||||
return 6F;
|
||||
else if (worldObj.isRaining())
|
||||
return 3F;
|
||||
else if (!worldObj.isThundering() && !worldObj.isRaining() && worldObj.getBlock(xCoord, yCoord+1, zCoord).equals(Blocks.water))
|
||||
return 2F;
|
||||
else
|
||||
return 1F;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Compressed Aqua Solar";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user