mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-26 06:43:01 +00:00
Refractored Code
+added Solar Factory -removed unnessecary solar and essentia generator classes +started gtnh researches +added tooltip clearance on solars (maximal output) Signed-off-by: bartimaeusnek <[email protected]>
This commit is contained in:
1 parent
980df8516a
commit
0fecf28b65
397 files changed
+8693
-9288
No files matched your search
@@ -2,64 +2,23 @@ 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 class DefinitelyNotAIC2Source {
|
||||
public final TileEntity parent;
|
||||
protected double capacity;
|
||||
protected long capacity;
|
||||
protected byte tier;
|
||||
protected double power;
|
||||
protected double energyStored;
|
||||
protected boolean addedToEnet;
|
||||
protected long power;
|
||||
protected long energyStored;
|
||||
|
||||
public DefinitelyNotAIC2Source(TileEntity parent1, double capacity1, int tier1) {
|
||||
double power = (double) GT_Values.V[tier1];
|
||||
public DefinitelyNotAIC2Source(TileEntity parent1, long capacity1, int tier1) {
|
||||
long power = 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;
|
||||
}
|
||||
@@ -69,14 +28,22 @@ public class DefinitelyNotAIC2Source extends TileEntity {
|
||||
capacity1 = this.power;
|
||||
}
|
||||
|
||||
this.capacity = (long) capacity1;
|
||||
}
|
||||
|
||||
public void setCapacity(long capacity1) {
|
||||
if (capacity1 < this.power) {
|
||||
capacity1 = this.power;
|
||||
}
|
||||
|
||||
this.capacity = capacity1;
|
||||
}
|
||||
|
||||
public double getEnergyStored() {
|
||||
public long getEnergyStored() {
|
||||
return this.energyStored;
|
||||
}
|
||||
|
||||
public void setEnergyStored(double amount) {
|
||||
public void setEnergyStored(long amount) {
|
||||
this.energyStored = amount;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,39 +11,39 @@ import thaumcraft.common.Thaumcraft;
|
||||
|
||||
public class TileElectricCloud extends TileEntity {
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(worldObj.isRemote && FMLCommonHandler.instance().getSide().isClient() && FMLClientHandler.instance().getClient().renderViewEntity != null)
|
||||
fx();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void fx() {
|
||||
if (worldObj.rand.nextInt(4) == 0) {
|
||||
Thaumcraft.proxy.wispFX3(worldObj, xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, xCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, yCoord + 0.5F, zCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, 0.25F, 1, true, -0.02F);
|
||||
}
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (worldObj.isRemote && FMLCommonHandler.instance().getSide().isClient() && FMLClientHandler.instance().getClient().renderViewEntity != null)
|
||||
fx();
|
||||
}
|
||||
|
||||
if (worldObj.rand.nextInt(12) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
if (worldObj.rand.nextInt(2) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
}
|
||||
if (worldObj.rand.nextInt(4) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void fx() {
|
||||
if (worldObj.rand.nextInt(4) == 0) {
|
||||
Thaumcraft.proxy.wispFX3(worldObj, xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, xCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, yCoord + 0.5F, zCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, 0.25F, 1, true, -0.02F);
|
||||
}
|
||||
|
||||
if (worldObj.rand.nextInt(3) == 0) {
|
||||
FXWisp wisp = new FXWisp(worldObj, xCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), yCoord + 0.5, zCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), 0.4f + worldObj.rand.nextInt(40) / 100f, 1);
|
||||
wisp.setGravity(-0.02F);
|
||||
wisp.setRBGColorF(worldObj.rand.nextInt(20) / 100f, worldObj.rand.nextInt(20) / 100f, 1);
|
||||
wisp.setAlphaF(1);
|
||||
ParticleEngine.instance.addEffect(worldObj, wisp);
|
||||
}
|
||||
}
|
||||
if (worldObj.rand.nextInt(12) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
if (worldObj.rand.nextInt(2) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
}
|
||||
if (worldObj.rand.nextInt(4) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.rand.nextInt(3) == 0) {
|
||||
FXWisp wisp = new FXWisp(worldObj, xCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), yCoord + 0.5, zCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), 0.4f + worldObj.rand.nextInt(40) / 100f, 1);
|
||||
wisp.setGravity(-0.02F);
|
||||
wisp.setRBGColorF(worldObj.rand.nextInt(20) / 100f, worldObj.rand.nextInt(20) / 100f, 1);
|
||||
wisp.setAlphaF(1);
|
||||
ParticleEngine.instance.addEffect(worldObj, wisp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,46 +7,40 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityEMT
|
||||
extends TileEntity
|
||||
{
|
||||
public int facing;
|
||||
public boolean isOn;
|
||||
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.readFromNBT(tagCompound);
|
||||
|
||||
this.facing = tagCompound.getInteger("facing");
|
||||
this.isOn = tagCompound.getBoolean("isOn");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
tagCompound.setInteger("facing", this.facing);
|
||||
tagCompound.setBoolean("isOn", this.isOn);
|
||||
super.writeToNBT(tagCompound);
|
||||
}
|
||||
|
||||
public final Packet getDescriptionPacket()
|
||||
{
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
writeToNBT(nbt);
|
||||
S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
return packet;
|
||||
}
|
||||
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
|
||||
{
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
readFromNBT(nbt);
|
||||
}
|
||||
|
||||
public void markDirty()
|
||||
{
|
||||
super.markDirty();
|
||||
if (this.worldObj.isRemote) {
|
||||
return;
|
||||
extends TileEntity {
|
||||
public int facing;
|
||||
public boolean isOn;
|
||||
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
|
||||
this.facing = tagCompound.getInteger("facing");
|
||||
this.isOn = tagCompound.getBoolean("isOn");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
tagCompound.setInteger("facing", this.facing);
|
||||
tagCompound.setBoolean("isOn", this.isOn);
|
||||
super.writeToNBT(tagCompound);
|
||||
}
|
||||
|
||||
public final Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
writeToNBT(nbt);
|
||||
S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
return packet;
|
||||
}
|
||||
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
readFromNBT(nbt);
|
||||
}
|
||||
|
||||
public void markDirty() {
|
||||
super.markDirty();
|
||||
if (this.worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
@@ -18,285 +18,275 @@ import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
public class TileEntityEtherealMacerator extends TileEntityEMT implements ISidedInventory, IWrenchable {
|
||||
|
||||
private static final int[] slots_top = new int[] { 0 };
|
||||
private static final int[] slots_bottom = new int[] { 2, 1 };
|
||||
private static final int[] slots_sides = new int[] { 1 };
|
||||
private static final int[] slots_top = new int[]{0};
|
||||
private static final int[] slots_bottom = new int[]{2, 1};
|
||||
private static final int[] slots_sides = new int[]{1};
|
||||
public int maceratingSpeed = EMTConfigHandler.etherealProcessorBaseSpeed;
|
||||
public int cookTime;
|
||||
private ItemStack[] slots = new ItemStack[3];
|
||||
|
||||
private ItemStack[] slots = new ItemStack[3];
|
||||
public int maceratingSpeed = EMTConfigHandler.etherealProcessorBaseSpeed;
|
||||
public int cookTime;
|
||||
public int getSizeInventory() {
|
||||
return this.slots.length;
|
||||
}
|
||||
|
||||
public int getSizeInventory() {
|
||||
return this.slots.length;
|
||||
}
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
return this.slots[par1];
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
return this.slots[par1];
|
||||
}
|
||||
public ItemStack decrStackSize(int par1, int par2) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack;
|
||||
|
||||
public ItemStack decrStackSize(int par1, int par2) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack;
|
||||
if (this.slots[par1].stackSize <= par2) {
|
||||
itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
itemstack = this.slots[par1].splitStack(par2);
|
||||
|
||||
if (this.slots[par1].stackSize <= par2) {
|
||||
itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
itemstack = this.slots[par1].splitStack(par2);
|
||||
if (this.slots[par1].stackSize == 0) {
|
||||
this.slots[par1] = null;
|
||||
}
|
||||
|
||||
if (this.slots[par1].stackSize == 0) {
|
||||
this.slots[par1] = null;
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public ItemStack getStackInSlotOnClosing(int par1) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlotOnClosing(int par1) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
this.slots[par1] = par2ItemStack;
|
||||
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
this.slots[par1] = par2ItemStack;
|
||||
if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) {
|
||||
par2ItemStack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) {
|
||||
par2ItemStack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
public String getInvName() {
|
||||
return "Ethereal Processor";
|
||||
}
|
||||
|
||||
public String getInvName() {
|
||||
return "Ethereal Processor";
|
||||
}
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
NBTTagList nbttaglist = tagCompound.getTagList("Items", 10);
|
||||
this.slots = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
NBTTagList nbttaglist = tagCompound.getTagList("Items", 10);
|
||||
this.slots = new ItemStack[this.getSizeInventory()];
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
if (b0 >= 0 && b0 < this.slots.length) {
|
||||
this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
this.cookTime = tagCompound.getShort("CookTime");
|
||||
}
|
||||
|
||||
if (b0 >= 0 && b0 < this.slots.length) {
|
||||
this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
this.cookTime = tagCompound.getShort("CookTime");
|
||||
}
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setShort("CookTime", (short) this.cookTime);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setShort("CookTime", (short) this.cookTime);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
for (int i = 0; i < this.slots.length; ++i) {
|
||||
if (this.slots[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.slots[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
tagCompound.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
for (int i = 0; i < this.slots.length; ++i) {
|
||||
if (this.slots[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.slots[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
tagCompound.setTag("Items", nbttaglist);
|
||||
}
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
public void updateEntity() {
|
||||
if (this.canSmelt() && isOverLimit(1) == false && isOverLimit(2) == false && isOP() == false) {
|
||||
++this.cookTime;
|
||||
this.isOn = true;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
|
||||
public void updateEntity() {
|
||||
if (this.canSmelt() && isOverLimit(1) == false && isOverLimit(2) == false && isOP() == false) {
|
||||
++this.cookTime;
|
||||
this.isOn = true;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
if (this.cookTime == this.maceratingSpeed) {
|
||||
this.cookTime = 0;
|
||||
this.smeltItem();
|
||||
}
|
||||
} else {
|
||||
this.cookTime = 0;
|
||||
this.isOn = false;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.cookTime == this.maceratingSpeed) {
|
||||
this.cookTime = 0;
|
||||
this.smeltItem();
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.cookTime = 0;
|
||||
this.isOn = false;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
private boolean canSmelt() {
|
||||
if (this.slots[0] == null) {
|
||||
return false;
|
||||
} else {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
if (itemstack == null)
|
||||
return false;
|
||||
if (this.slots[2] == null)
|
||||
return true;
|
||||
if (!this.slots[2].isItemEqual(itemstack))
|
||||
return false;
|
||||
int result = slots[2].stackSize + (itemstack.stackSize * 2);
|
||||
return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canSmelt() {
|
||||
if (this.slots[0] == null) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
if (itemstack == null)
|
||||
return false;
|
||||
if (this.slots[2] == null)
|
||||
return true;
|
||||
if (!this.slots[2].isItemEqual(itemstack))
|
||||
return false;
|
||||
int result = slots[2].stackSize + (itemstack.stackSize * 2);
|
||||
return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
|
||||
}
|
||||
}
|
||||
public void smeltItem() {
|
||||
if (this.canSmelt()) {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
|
||||
public void smeltItem() {
|
||||
if (this.canSmelt()) {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
if (this.slots[2] == null) {
|
||||
this.slots[2] = itemstack.copy();
|
||||
this.slots[2].stackSize *= 2;
|
||||
} else if (this.slots[2].isItemEqual(itemstack)) {
|
||||
slots[2].stackSize += (itemstack.stackSize * 2);
|
||||
}
|
||||
|
||||
if (this.slots[2] == null) {
|
||||
this.slots[2] = itemstack.copy();
|
||||
this.slots[2].stackSize *= 2;
|
||||
}
|
||||
else if (this.slots[2].isItemEqual(itemstack)) {
|
||||
slots[2].stackSize += (itemstack.stackSize * 2);
|
||||
}
|
||||
--this.slots[0].stackSize;
|
||||
|
||||
--this.slots[0].stackSize;
|
||||
if (this.slots[0].stackSize <= 0) {
|
||||
this.slots[0] = null;
|
||||
}
|
||||
this.addBonus();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.slots[0].stackSize <= 0) {
|
||||
this.slots[0] = null;
|
||||
}
|
||||
this.addBonus();
|
||||
}
|
||||
}
|
||||
public void addBonus() {
|
||||
if (this.canSmelt()) {
|
||||
if (this.worldObj.rand.nextInt(EMTConfigHandler.etherealProcessorBonus) == 0) {
|
||||
if (this.slots[1] == null) {
|
||||
this.setInventorySlotContents(1, new ItemStack(ConfigItems.itemNugget, 1, 6));
|
||||
} else if (this.slots[1].isItemEqual(new ItemStack(ConfigItems.itemNugget, 1, 6)) && this.isOverLimit(1) == false && this.isOverLimit(2) == false) {
|
||||
slots[1] = new ItemStack(getStackInSlot(1).getItem(), slots[1].stackSize + 1, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addBonus() {
|
||||
if (this.canSmelt()) {
|
||||
if (this.worldObj.rand.nextInt(EMTConfigHandler.etherealProcessorBonus) == 0) {
|
||||
if (this.slots[1] == null) {
|
||||
this.setInventorySlotContents(1, new ItemStack(ConfigItems.itemNugget, 1, 6));
|
||||
}
|
||||
else if (this.slots[1].isItemEqual(new ItemStack(ConfigItems.itemNugget, 1, 6)) && this.isOverLimit(1) == false && this.isOverLimit(2) == false) {
|
||||
slots[1] = new ItemStack(getStackInSlot(1).getItem(), slots[1].stackSize + 1, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
|
||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
|
||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D) <= 64.0D;
|
||||
}
|
||||
public void openChest() {
|
||||
}
|
||||
|
||||
public void openChest() {
|
||||
}
|
||||
public void closeChest() {
|
||||
}
|
||||
|
||||
public void closeChest() {
|
||||
}
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
if (slot != 0)
|
||||
return false;
|
||||
if (FurnaceRecipes.smelting().getSmeltingResult(stack) != null)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
if (slot != 0)
|
||||
return false;
|
||||
if (FurnaceRecipes.smelting().getSmeltingResult(stack) != null)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
public int[] getAccessibleSlotsFromSide(int par1) {
|
||||
return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides);
|
||||
}
|
||||
|
||||
public int[] getAccessibleSlotsFromSide(int par1) {
|
||||
return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides);
|
||||
}
|
||||
public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return this.isItemValidForSlot(par1, par2ItemStack);
|
||||
}
|
||||
|
||||
public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return this.isItemValidForSlot(par1, par2ItemStack);
|
||||
}
|
||||
public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return true;
|
||||
}
|
||||
public boolean isOverLimit(int i) {
|
||||
if (slots[i] != null) {
|
||||
if (slots[i].stackSize >= 63)
|
||||
return true;
|
||||
else if (slots[i].stackSize < 63)
|
||||
return false;
|
||||
else
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isOverLimit(int i) {
|
||||
if (slots[i] != null) {
|
||||
if (slots[i].stackSize >= 63)
|
||||
return true;
|
||||
else if (slots[i].stackSize < 63)
|
||||
return false;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public boolean isOP() {
|
||||
final int cobblestoneId = OreDictionary.getOreID("blockCobble");
|
||||
|
||||
public boolean isOP() {
|
||||
final int cobblestoneId = OreDictionary.getOreID("blockCobble");
|
||||
if (OreDictionary.getOreID(this.slots[0]) == cobblestoneId || this.slots[0].getItem() == Item.getItemFromBlock(Blocks.sand) || this.slots[0].getItem() == Items.potato || this.slots[0].getItem() == Items.porkchop || this.slots[0].getItem() == Items.beef || this.slots[0].getItem() == Items.chicken || this.slots[0].getItem() == Items.fish
|
||||
|| this.slots[0].getItem() == IC2Items.getItem("coalDust").getItem()
|
||||
|| (OreDictionary.getOreName(OreDictionary.getOreID(this.slots[0])).toLowerCase().contains("dust") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armour") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armor") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("helm")
|
||||
|| this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("legging") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("boot") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("chestp") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick")
|
||||
|| this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("shovel") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("axe") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick"))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (OreDictionary.getOreID(this.slots[0]) == cobblestoneId || this.slots[0].getItem() == Item.getItemFromBlock(Blocks.sand) || this.slots[0].getItem() == Items.potato || this.slots[0].getItem() == Items.porkchop || this.slots[0].getItem() == Items.beef || this.slots[0].getItem() == Items.chicken || this.slots[0].getItem() == Items.fish
|
||||
|| this.slots[0].getItem() == IC2Items.getItem("coalDust").getItem()
|
||||
|| (OreDictionary.getOreName(OreDictionary.getOreID(this.slots[0])).toLowerCase().contains("dust") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armour") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armor") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("helm")
|
||||
|| this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("legging") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("boot") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("chestp") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick")
|
||||
|| this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("shovel") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("axe") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick"))) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtMachines, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtMachines, 1, 1);
|
||||
}
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Ethereal Macerator";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Ethereal Macerator";
|
||||
}
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void openInventory() {
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,198 +14,194 @@ import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements IInventory, IWrenchable {
|
||||
|
||||
private BasicSink ic2EnergySink = new BasicSink(this, 100000, 4);
|
||||
ItemStack ItemStacks[];
|
||||
private BasicSink ic2EnergySink = new BasicSink(this, 100000, 4);
|
||||
|
||||
ItemStack ItemStacks[];
|
||||
public TileEntityIndustrialWandRecharge() {
|
||||
ItemStacks = new ItemStack[1];
|
||||
}
|
||||
|
||||
public TileEntityIndustrialWandRecharge() {
|
||||
ItemStacks = new ItemStack[1];
|
||||
}
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return ItemStacks[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return ItemStacks[i];
|
||||
}
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if (ItemStacks[i] != null) {
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if (ItemStacks[i] != null) {
|
||||
if (ItemStacks[i].stackSize <= j) {
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
ItemStack itemstack1 = ItemStacks[i].splitStack(j);
|
||||
|
||||
if (ItemStacks[i].stackSize <= j) {
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
ItemStack itemstack1 = ItemStacks[i].splitStack(j);
|
||||
if (ItemStacks[i].stackSize == 0) {
|
||||
ItemStacks[i] = null;
|
||||
}
|
||||
|
||||
if (ItemStacks[i].stackSize == 0) {
|
||||
ItemStacks[i] = null;
|
||||
}
|
||||
return itemstack1;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return itemstack1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if (ItemStacks[i] != null) {
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if (ItemStacks[i] != null) {
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
ic2EnergySink.updateEntity();
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (getStackInSlot(0) != null) {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
ic2EnergySink.updateEntity();
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (getStackInSlot(0) != null) {
|
||||
ItemStack wand = getStackInSlot(0);
|
||||
if (wand != null && wand.getItem() instanceof ItemWandCasting) {
|
||||
ItemWandCasting wandItem = (ItemWandCasting) wand.getItem();
|
||||
if (ic2EnergySink.useEnergy(EMTConfigHandler.wandChargerConsumption) && wandItem.getAspectsWithRoom(wand) != null) {
|
||||
wandItem.addVis(wand, Aspect.ORDER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.FIRE, 1, true);
|
||||
wandItem.addVis(wand, Aspect.ENTROPY, 1, true);
|
||||
wandItem.addVis(wand, Aspect.WATER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.EARTH, 1, true);
|
||||
wandItem.addVis(wand, Aspect.AIR, 1, true);
|
||||
}
|
||||
}
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack wand = getStackInSlot(0);
|
||||
if (wand != null && wand.getItem() instanceof ItemWandCasting) {
|
||||
ItemWandCasting wandItem = (ItemWandCasting) wand.getItem();
|
||||
if (ic2EnergySink.useEnergy(EMTConfigHandler.wandChargerConsumption) && wandItem.getAspectsWithRoom(wand) != null) {
|
||||
wandItem.addVis(wand, Aspect.ORDER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.FIRE, 1, true);
|
||||
wandItem.addVis(wand, Aspect.ENTROPY, 1, true);
|
||||
wandItem.addVis(wand, Aspect.WATER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.EARTH, 1, true);
|
||||
wandItem.addVis(wand, Aspect.AIR, 1, true);
|
||||
}
|
||||
}
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
ItemStacks[i] = itemstack;
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
ItemStacks[i] = itemstack;
|
||||
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) {
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) {
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
public void readFromNBT(NBTTagCompound p_145839_1_) {
|
||||
super.readFromNBT(p_145839_1_);
|
||||
NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
|
||||
this.ItemStacks = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
public void readFromNBT(NBTTagCompound p_145839_1_) {
|
||||
super.readFromNBT(p_145839_1_);
|
||||
NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
|
||||
this.ItemStacks = new ItemStack[this.getSizeInventory()];
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length) {
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length) {
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void writeToNBT(NBTTagCompound p_145841_1_) {
|
||||
super.writeToNBT(p_145841_1_);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
public void writeToNBT(NBTTagCompound p_145841_1_) {
|
||||
super.writeToNBT(p_145841_1_);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i) {
|
||||
if (this.ItemStacks[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i) {
|
||||
if (this.ItemStacks[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
p_145841_1_.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
p_145841_1_.setTag("Items", nbttaglist);
|
||||
}
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
|
||||
return false;
|
||||
}
|
||||
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <= 64D;
|
||||
}
|
||||
|
||||
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <= 64D;
|
||||
}
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public void invalidate() {
|
||||
ic2EnergySink.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
ic2EnergySink.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
ic2EnergySink.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
ic2EnergySink.onChunkUnload();
|
||||
}
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Industrial Wand Charging Station";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Industrial Wand Charging Station";
|
||||
}
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 0.8f;
|
||||
}
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 0.8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtMachines, 1, 0);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.emtMachines, 1, 0);
|
||||
}
|
||||
}
|
||||
@@ -6,17 +6,17 @@ import thaumcraft.common.tiles.TileNode;
|
||||
|
||||
public class TileEntityPortableNode extends TileNode {
|
||||
|
||||
public TileEntityPortableNode() {
|
||||
super();
|
||||
}
|
||||
public TileEntityPortableNode() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NodeModifier getNodeModifier() {
|
||||
return NodeModifier.FADING;
|
||||
}
|
||||
@Override
|
||||
public NodeModifier getNodeModifier() {
|
||||
return NodeModifier.FADING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NodeType getNodeType() {
|
||||
return NodeType.UNSTABLE;
|
||||
}
|
||||
@Override
|
||||
public NodeType getNodeType() {
|
||||
return NodeType.UNSTABLE;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityAerGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityAerGenerator()
|
||||
{
|
||||
super(Aspect.AIR);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityArborGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityArborGenerator()
|
||||
{
|
||||
super(Aspect.TREE);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityAuramGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityAuramGenerator()
|
||||
{
|
||||
super(Aspect.AURA);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
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;
|
||||
@@ -13,7 +11,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 net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -27,18 +24,14 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
import thaumcraft.api.aspects.IAspectSource;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
import thaumcraft.api.aspects.*;
|
||||
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 DefinitelyNotAIC2Source energySource = new DefinitelyNotAIC2Source(this, 100000.0D, 2);
|
||||
public DefinitelyNotAIC2Source energySource = new DefinitelyNotAIC2Source(this, 100000L, 2);
|
||||
public Aspect aspect;
|
||||
public double generating;
|
||||
public int tick = 0;
|
||||
@@ -55,22 +48,42 @@ public class TileEntityBaseGenerator
|
||||
public byte color;
|
||||
private boolean side;
|
||||
|
||||
public TileEntityBaseGenerator(Aspect aspect) {
|
||||
super();
|
||||
public TileEntityBaseGenerator(int aspect) {
|
||||
this();
|
||||
switch (aspect) {
|
||||
case 0:
|
||||
this.aspect = Aspect.ENERGY;
|
||||
break;
|
||||
case 1:
|
||||
this.aspect = Aspect.FIRE;
|
||||
break;
|
||||
case 2:
|
||||
this.aspect = Aspect.AURA;
|
||||
break;
|
||||
case 3:
|
||||
this.aspect = Aspect.TREE;
|
||||
break;
|
||||
case 4:
|
||||
this.aspect = Aspect.AIR;
|
||||
break;
|
||||
case 5:
|
||||
this.aspect = Aspect.GREED;
|
||||
break;
|
||||
}
|
||||
this.generating = EMTEssentiasOutputs.outputs.get(this.aspect.getTag());
|
||||
}
|
||||
|
||||
public TileEntityBaseGenerator() {
|
||||
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.side = !this.worldObj.isRemote;
|
||||
this.dead = false;
|
||||
this.timer += 1L;
|
||||
if (this.timer <= Long.MAX_VALUE - 1)
|
||||
@@ -79,7 +92,6 @@ public class TileEntityBaseGenerator
|
||||
fillfrompipe();
|
||||
createEnergy();
|
||||
inputintoGTnet();
|
||||
this.energySource.updateEntity();
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +101,7 @@ public class TileEntityBaseGenerator
|
||||
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))) {
|
||||
if (tile instanceof IAspectSource) {
|
||||
IAspectSource as = (IAspectSource) tile;
|
||||
if ((as.doesContainerContainAmount(this.aspect, this.refuel)) &&
|
||||
(as.takeFromContainer(this.aspect, this.refuel))) {
|
||||
@@ -138,7 +150,7 @@ public class TileEntityBaseGenerator
|
||||
}
|
||||
} 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)) {
|
||||
} else if ((this.storage + this.generating / 20.0D / 20.0D > this.maxstorage)) {
|
||||
this.isActive = true;
|
||||
if (side) {
|
||||
this.energySource.setEnergyStored(this.maxstorage);
|
||||
@@ -156,31 +168,24 @@ public class TileEntityBaseGenerator
|
||||
}
|
||||
}
|
||||
|
||||
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.energySource.setEnergyStored(tag.getLong("estore"));
|
||||
if (tag.getByte("fuel") > this.fuel) {
|
||||
this.fuel = tag.getByte("fuel");
|
||||
}
|
||||
if (!tag.getString("aspect").isEmpty()) {
|
||||
this.aspect = Aspect.getAspect(tag.getString("aspect"));
|
||||
this.generating = EMTEssentiasOutputs.outputs.get(this.aspect.getTag());
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
tag.setInteger("storage", this.storage);
|
||||
tag.setInteger("fuel", this.fuel);
|
||||
super.writeToNBT(tag);
|
||||
this.energySource.writeToNBT(tag);
|
||||
tag.setInteger("fuel", this.fuel);
|
||||
tag.setLong("estore", this.energySource.getEnergyStored());
|
||||
if (aspect != null)
|
||||
tag.setString("aspect", this.aspect.getTag());
|
||||
}
|
||||
|
||||
public int getSizeInventory() {
|
||||
@@ -268,7 +273,7 @@ public class TileEntityBaseGenerator
|
||||
}
|
||||
|
||||
public boolean doesContainerContain(AspectList ot) {
|
||||
return ot.aspects.containsKey(this.aspect);
|
||||
return ot.aspects.containsKey(this.aspect) && ot.aspects.get(this.aspect) == this.fuel;
|
||||
}
|
||||
|
||||
public int containerContains(Aspect tag) {
|
||||
|
||||
@@ -2,17 +2,15 @@ package emt.tile.generator;
|
||||
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public abstract class TileEntityCompressedGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityCompressedGenerator(Aspect aspect)
|
||||
{
|
||||
super(aspect);
|
||||
this.energySource = new DefinitelyNotAIC2Source(this, 1000000.0D, 3);
|
||||
this.energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage * 10.0D);
|
||||
this.maxfuel *= 10;
|
||||
}
|
||||
extends TileEntityBaseGenerator {
|
||||
public TileEntityCompressedGenerator(Aspect aspect) {
|
||||
super();
|
||||
this.energySource = new DefinitelyNotAIC2Source(this, 1000000L, 3);
|
||||
this.energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage * 10.0D);
|
||||
this.maxfuel *= 10;
|
||||
this.aspect = aspect;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityIgnisGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityIgnisGenerator()
|
||||
{
|
||||
super(Aspect.FIRE);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityLucrumGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityLucrumGenerator()
|
||||
{
|
||||
super(Aspect.GREED);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityPotentiaGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityPotentiaGenerator()
|
||||
{
|
||||
super(Aspect.ENERGY);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityReflexionGen
|
||||
{
|
||||
public static List L = new ArrayList(EMTEssentiasOutputs.outputs.keySet());
|
||||
public static Class<? extends TileEntity>[] GensS = new Class[L.size()];
|
||||
public static TileEntityBaseGenerator[] Gens = new TileEntityBaseGenerator[L.size()];
|
||||
|
||||
public TileEntityReflexionGen()
|
||||
{
|
||||
for (int i = 0; i < L.size(); i++)
|
||||
{
|
||||
GensS[i] = TileEntityBaseGenerator.class;
|
||||
Gens[i] = new TileEntityBaseGenerator((Aspect)Aspect.aspects.get(L.get(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package emt.tile.solar;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import gregtech.GT_Mod;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.util.GT_ModHandler;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import static thaumcraft.api.aspects.Aspect.*;
|
||||
|
||||
//Solar Factory
|
||||
public enum Solars {
|
||||
//compability to older versions
|
||||
Compressed(EMTConfigHandler.compressedSolarOutput, null, 0, 0),
|
||||
Double_Compressed(EMTConfigHandler.doubleCompressedSolarOutput, null, 0, 1),
|
||||
Triple_Compressed(EMTConfigHandler.tripleCompressedSolarOutput, null, 0, 2),
|
||||
Compressed_Aqua(EMTConfigHandler.compressedSolarOutput, WATER, 0, 3),
|
||||
Double_Compressed_Aqua(EMTConfigHandler.doubleCompressedSolarOutput, WATER, 0, 4),
|
||||
Triple_Compressed_Aqua(EMTConfigHandler.tripleCompressedSolarOutput, WATER, 0, 5),
|
||||
Compressed_Perditio(EMTConfigHandler.compressedSolarOutput, ENTROPY, 0, 6),
|
||||
Double_Compressed_Perditio(EMTConfigHandler.doubleCompressedSolarOutput, ENTROPY, 0, 7),
|
||||
Triple_Compressed_Perditio(EMTConfigHandler.tripleCompressedSolarOutput, ENTROPY, 0, 8),
|
||||
Compressed_Ordo(EMTConfigHandler.compressedSolarOutput, ORDER, 0, 9),
|
||||
Double_Compressed_Ordo(EMTConfigHandler.doubleCompressedSolarOutput, ORDER, 0, 10),
|
||||
Triple_Compressed_Ordo(EMTConfigHandler.tripleCompressedSolarOutput, ORDER, 0, 11),
|
||||
Compressed_Ignis(EMTConfigHandler.compressedSolarOutput, FIRE, 0, 12),
|
||||
Double_Compressed_Ignis(EMTConfigHandler.doubleCompressedSolarOutput, FIRE, 0, 13),
|
||||
Triple_Compressed_Ignis(EMTConfigHandler.tripleCompressedSolarOutput, FIRE, 0, 14),
|
||||
Compressed_Aer(EMTConfigHandler.compressedSolarOutput, AIR, 0, 15),
|
||||
Double_Compressed_Aer(EMTConfigHandler.doubleCompressedSolarOutput, AIR, 1, 0),
|
||||
Triple_Compressed_Aer(EMTConfigHandler.tripleCompressedSolarOutput, AIR, 1, 1),
|
||||
Compressed_Terra(EMTConfigHandler.compressedSolarOutput, EARTH, 1, 2),
|
||||
Double_Compressed_Terra(EMTConfigHandler.doubleCompressedSolarOutput, EARTH, 1, 3),
|
||||
Triple_Compressed_Terra(EMTConfigHandler.tripleCompressedSolarOutput, EARTH, 1, 4),
|
||||
|
||||
//New Solars
|
||||
Quadruple_Compressed(EMTConfigHandler.quadrupleCompressedSolarOutput, null, 2, 0),
|
||||
Quadruple_Compressed_Ordo(EMTConfigHandler.quadrupleCompressedSolarOutput, ORDER, 2, 1),
|
||||
Quadruple_Compressed_Perditio(EMTConfigHandler.quadrupleCompressedSolarOutput, ENTROPY, 2, 2),
|
||||
Quadruple_Compressed_Aer(EMTConfigHandler.quadrupleCompressedSolarOutput, AIR, 2, 3),
|
||||
Quadruple_Compressed_Terra(EMTConfigHandler.quadrupleCompressedSolarOutput, EARTH, 2, 4),
|
||||
Quadruple_Compressed_Aqua(EMTConfigHandler.quadrupleCompressedSolarOutput, WATER, 2, 5),
|
||||
Quadruple_Compressed_Ignis(EMTConfigHandler.quadrupleCompressedSolarOutput, FIRE, 2, 6),
|
||||
Quintuple_Compressed(EMTConfigHandler.quintupleCompressedSolarOutput, null, 2, 7),
|
||||
Quintuple_Compressed_Ordo(EMTConfigHandler.quintupleCompressedSolarOutput, ORDER, 2, 8),
|
||||
Quintuple_Compressed_Perditio(EMTConfigHandler.quintupleCompressedSolarOutput, ENTROPY, 2, 9),
|
||||
Quintuple_Compressed_Aer(EMTConfigHandler.quintupleCompressedSolarOutput, AIR, 2, 10),
|
||||
Quintuple_Compressed_Terra(EMTConfigHandler.quintupleCompressedSolarOutput, EARTH, 2, 11),
|
||||
Quintuple_Compressed_Aqua(EMTConfigHandler.quintupleCompressedSolarOutput, WATER, 2, 12),
|
||||
Quintuple_Compressed_Ignis(EMTConfigHandler.quintupleCompressedSolarOutput, FIRE, 2, 13),
|
||||
Sextuple_Compressed(EMTConfigHandler.sextupleCompressedSolarOutput, null, 2, 14),
|
||||
Sextuple_Compressed_Ordo(EMTConfigHandler.sextupleCompressedSolarOutput, ORDER, 2, 15),
|
||||
Sextuple_Compressed_Perditio(EMTConfigHandler.sextupleCompressedSolarOutput, ENTROPY, 3, 0),
|
||||
Sextuple_Compressed_Aer(EMTConfigHandler.sextupleCompressedSolarOutput, AIR, 3, 1),
|
||||
Sextuple_Compressed_Terra(EMTConfigHandler.sextupleCompressedSolarOutput, EARTH, 3, 2),
|
||||
Sextuple_Compressed_Aqua(EMTConfigHandler.sextupleCompressedSolarOutput, WATER, 3, 3),
|
||||
Sextuple_Compressed_Ignis(EMTConfigHandler.sextupleCompressedSolarOutput, FIRE, 3, 4),
|
||||
Septuple_Compressed(EMTConfigHandler.septupleCompressedSolarOutput, null, 3, 5),
|
||||
Septuple_Compressed_Ordo(EMTConfigHandler.septupleCompressedSolarOutput, ORDER, 3, 6),
|
||||
Septuple_Compressed_Perditio(EMTConfigHandler.septupleCompressedSolarOutput, ENTROPY, 3, 7),
|
||||
Septuple_Compressed_Aer(EMTConfigHandler.septupleCompressedSolarOutput, AIR, 3, 8),
|
||||
Septuple_Compressed_Terra(EMTConfigHandler.septupleCompressedSolarOutput, EARTH, 3, 9),
|
||||
Septuple_Compressed_Aqua(EMTConfigHandler.septupleCompressedSolarOutput, WATER, 3, 10),
|
||||
Septuple_Compressed_Ignis(EMTConfigHandler.septupleCompressedSolarOutput, FIRE, 3, 11),
|
||||
Octuple_Compressed(EMTConfigHandler.octupleCompressedSolarOutput, null, 3, 12),
|
||||
Octuple_Compressed_Ordo(EMTConfigHandler.octupleCompressedSolarOutput, ORDER, 3, 13),
|
||||
Octuple_Compressed_Perditio(EMTConfigHandler.octupleCompressedSolarOutput, ENTROPY, 3, 14),
|
||||
Octuple_Compressed_Aer(EMTConfigHandler.octupleCompressedSolarOutput, AIR, 3, 15),
|
||||
Octuple_Compressed_Terra(EMTConfigHandler.octupleCompressedSolarOutput, EARTH, 4, 0),
|
||||
Octuple_Compressed_Aqua(EMTConfigHandler.octupleCompressedSolarOutput, WATER, 4, 1),
|
||||
Octuple_Compressed_Ignis(EMTConfigHandler.octupleCompressedSolarOutput, FIRE, 4, 2),
|
||||
;
|
||||
|
||||
private final static LinkedHashMap<Long, Solars> cachemap = new LinkedHashMap<>();
|
||||
int instance, meta;
|
||||
Aspect aspect;
|
||||
String guiname;
|
||||
private double output;
|
||||
|
||||
Solars(double output, Aspect aspect, int instance, int meta) {
|
||||
this.aspect = aspect;
|
||||
this.output = output;
|
||||
this.guiname = this.name().replaceAll("_", " ") + " Solar";
|
||||
this.instance = instance;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
private static Solars getBaseSolar(double output){
|
||||
for (Solars s : Solars.values()){
|
||||
if (s.output == output && s.aspect == null)
|
||||
return s;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void registerReverseRecipes(){
|
||||
for (Solars s : Solars.values()){
|
||||
if (s.aspect != null){
|
||||
//ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt
|
||||
GT_Values.RA.addChemicalBathRecipe(new ItemStack(EMTBlocks.solars[s.instance],1,s.meta), Materials.Chlorine.getGas(1000),new ItemStack(EMTBlocks.solars[getBaseSolar(s.output).instance],1,getBaseSolar(s.output).meta),null,null,null,30,30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void populateCache() {
|
||||
for (Solars s : Solars.values()) {
|
||||
cachemap.put((long) (s.instance << 4 | s.meta), s);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getCountOfInstances() {
|
||||
int ret = 0;
|
||||
for (Solars s : Solars.values()) {
|
||||
ret = Math.max(s.instance, ret);
|
||||
}
|
||||
return ret + 1;
|
||||
}
|
||||
|
||||
public static int getCountOfMetas(int instance) {
|
||||
int ret = 0;
|
||||
for (Solars s : Solars.values()) {
|
||||
if (s.instance == instance) {
|
||||
ret = Math.max(s.meta, ret);
|
||||
}
|
||||
}
|
||||
return ret + 1;
|
||||
}
|
||||
|
||||
public static TileEntitySolarBase getTileEntitySolarBase(int instance, int meta) {
|
||||
Solars cached = cachemap.get((long) (instance << 4 | meta));
|
||||
if (cached != null)
|
||||
return new TileEntitySolarBase(cached.output, cached.aspect, cached.guiname, instance, meta);
|
||||
for (Solars s : Solars.values()) {
|
||||
if (s.instance == instance && s.meta == meta)
|
||||
return new TileEntitySolarBase(s.output, s.aspect, s.guiname, instance, meta);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getNameFromSolar(int instance, int meta) {
|
||||
Solars cached = cachemap.get((long) (instance << 4 | meta));
|
||||
if (cached != null)
|
||||
return cached.guiname;
|
||||
for (Solars s : Solars.values()) {
|
||||
if (s.instance == instance && s.meta == meta)
|
||||
return s.guiname;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package emt.tile.solar;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
@@ -18,33 +19,86 @@ 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;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.visnet.VisNetHandler;
|
||||
|
||||
public abstract class TileEntitySolarBase extends TileEntityEMT implements IInventory, IWrenchable, IHasWorldObjectAndCoords, IEnergyConnected, IBasicEnergyContainer {
|
||||
public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IWrenchable, IHasWorldObjectAndCoords, IEnergyConnected, IBasicEnergyContainer {
|
||||
|
||||
private static final byte NOTHING = 0;
|
||||
private static final byte ORDO = 1;
|
||||
private static final byte PERDITIO = 2;
|
||||
private static final byte AER = 3;
|
||||
private static final byte TERRA = 4;
|
||||
private static final byte AQUA = 5;
|
||||
private static final byte IGNIS = 6;
|
||||
|
||||
public String guiname;
|
||||
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 long mp_storage = 0;
|
||||
public byte color = (-1);
|
||||
public int storage;
|
||||
public long storage;
|
||||
public long maxstorage = 0;
|
||||
public boolean isActive = false;
|
||||
protected DefinitelyNotAIC2Source energySource;
|
||||
public DefinitelyNotAIC2Source energySource;
|
||||
public byte aspect = 0;
|
||||
protected boolean side;
|
||||
private int instance, meta;
|
||||
|
||||
public TileEntitySolarBase() {
|
||||
public TileEntitySolarBase(double output, Aspect aspect, String guiname, int instance, int meta) {
|
||||
this.tick = 10;
|
||||
this.storage = 0;
|
||||
long capacity = (long) (output * 1000);
|
||||
this.output = output;
|
||||
this.energySource = new DefinitelyNotAIC2Source(this, capacity, (int) getTierFromCapacity(capacity));
|
||||
this.maxstorage = this.getEUCapacity();
|
||||
this.aspect = getByteFromAspect(aspect);
|
||||
this.guiname = guiname;
|
||||
this.instance = instance;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* DO NOT CALL THIS ITS USED INTERNALLY ONLY
|
||||
*/
|
||||
public TileEntitySolarBase() {
|
||||
this.tick = 10;
|
||||
}
|
||||
|
||||
private static byte getByteFromAspect(Aspect aspect) {
|
||||
if (aspect == null)
|
||||
return NOTHING;
|
||||
if (aspect.equals(Aspect.ORDER))
|
||||
return ORDO;
|
||||
else if (aspect.equals(Aspect.ENTROPY))
|
||||
return PERDITIO;
|
||||
else if (aspect.equals(Aspect.AIR))
|
||||
return AER;
|
||||
else if (aspect.equals(Aspect.EARTH))
|
||||
return TERRA;
|
||||
else if (aspect.equals(Aspect.WATER))
|
||||
return AQUA;
|
||||
else if (aspect.equals(Aspect.FIRE))
|
||||
return IGNIS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
private int getTierFromCapacity(long capacity) {
|
||||
for (int i = 0; i < GT_Values.V.length; i++) {
|
||||
if (capacity / 1000 < GT_Values.V[i])
|
||||
return i;
|
||||
}
|
||||
return GT_Values.V.length - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,68 +107,200 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IInve
|
||||
this.dead = false;
|
||||
this.timer = +1L;
|
||||
inputintoGTnet();
|
||||
energySource.updateEntity();
|
||||
checkConditions();
|
||||
this.storage = this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
public abstract float calc_multi();
|
||||
private float getMaxMulti() {
|
||||
switch (aspect) {
|
||||
case ORDO:
|
||||
case PERDITIO: {
|
||||
return 2F;
|
||||
}
|
||||
case AER:
|
||||
case TERRA:
|
||||
case IGNIS: {
|
||||
return 3F;
|
||||
}
|
||||
case AQUA: {
|
||||
return 6F;
|
||||
}
|
||||
default:
|
||||
return 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public float calc_multi() {
|
||||
switch (aspect) {
|
||||
case ORDO: {
|
||||
if (this.worldObj.isDaytime())
|
||||
return 2F;
|
||||
else return 0.75F;
|
||||
}
|
||||
case PERDITIO: {
|
||||
if (this.worldObj.isDaytime())
|
||||
return 0.75F;
|
||||
else return 2F;
|
||||
}
|
||||
case AER: {
|
||||
if (this.yCoord < 5)
|
||||
return 1F;
|
||||
else if (this.yCoord > 220)
|
||||
return 3F;
|
||||
else
|
||||
return (float) ((41D / 43D) + ((2D / 215D) * (double) this.yCoord));
|
||||
}
|
||||
case TERRA: {
|
||||
if (this.yCoord < 5)
|
||||
return 3F;
|
||||
else if (this.yCoord > 220)
|
||||
return 1F;
|
||||
else
|
||||
return (float) ((-2D) / 215D * (double) this.yCoord + 131D / 43D);
|
||||
}
|
||||
case AQUA: {
|
||||
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;
|
||||
}
|
||||
case IGNIS: {
|
||||
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;
|
||||
}
|
||||
default:
|
||||
return 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public double getSourceStored() {
|
||||
return this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
public void checkConditions() {
|
||||
initialized = true;
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
switch (aspect) {
|
||||
case IGNIS: {
|
||||
initialized = true;
|
||||
boolean ignis = ((this.worldObj.provider.dimensionId == (-1)) || (theSunIsVisible));
|
||||
if (ignis) {
|
||||
this.isActive = true;
|
||||
if (side) {
|
||||
this.generating = output * calc_multi();
|
||||
this.energySource.addEnergy(this.output * calc_multi());
|
||||
}
|
||||
} else {
|
||||
isActive = false;
|
||||
this.generating = 0;
|
||||
}
|
||||
if (--tick == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
initialized = true;
|
||||
if (--tick == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
createEnergy();
|
||||
}
|
||||
}
|
||||
createEnergy();
|
||||
}
|
||||
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible) {
|
||||
isActive = true;
|
||||
if (side) {
|
||||
this.energySource.addEnergy(this.output * calc_multi());
|
||||
this.generating = output * calc_multi();
|
||||
switch (aspect) {
|
||||
case ORDO:
|
||||
case PERDITIO: {
|
||||
if ((this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) && (!this.worldObj.isRaining()) && (!this.worldObj.isThundering())) {
|
||||
isActive = true;
|
||||
if (side) {
|
||||
this.energySource.addEnergy(this.output * calc_multi());
|
||||
this.generating = output * calc_multi();
|
||||
}
|
||||
} else {
|
||||
isActive = false;
|
||||
this.generating = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AQUA: {
|
||||
if (theSunIsVisible || this.calc_multi() > 1F && this.worldObj.isDaytime() || this.calc_multi() == 6F) {
|
||||
isActive = true;
|
||||
if (side) {
|
||||
this.generating = output * calc_multi();
|
||||
energySource.addEnergy(output * calc_multi());
|
||||
}
|
||||
} else {
|
||||
isActive = false;
|
||||
this.generating = 0D;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (theSunIsVisible) {
|
||||
isActive = true;
|
||||
if (side) {
|
||||
this.energySource.addEnergy(this.output * calc_multi());
|
||||
this.generating = output * calc_multi();
|
||||
}
|
||||
} else {
|
||||
isActive = false;
|
||||
this.generating = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isActive = false;
|
||||
this.generating = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
boolean isRaining = this.aspect != AQUA && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setLong("storage", this.energySource.getEnergyStored());
|
||||
|
||||
NBTTagCompound subtag = new NBTTagCompound();
|
||||
subtag.setInteger("instance", this.instance);
|
||||
subtag.setInteger("meta", this.meta);
|
||||
subtag.setString("guiname", this.guiname);
|
||||
subtag.setByte("aspect", this.aspect);
|
||||
subtag.setDouble("Output", this.output);
|
||||
nbttagcompound.setTag("solarstats", subtag);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
|
||||
NBTTagCompound subtag = nbttagcompound.getCompoundTag("solarstats");
|
||||
this.instance = subtag.getInteger("instance");
|
||||
this.meta = subtag.getInteger("meta");
|
||||
this.guiname = subtag.getString("guiname");
|
||||
this.aspect = subtag.getByte("aspect");
|
||||
this.output = subtag.getDouble("Output");
|
||||
long capacity = (long) (output * 1000);
|
||||
this.energySource = new DefinitelyNotAIC2Source(this, capacity, (int) Math.floor(Math.log10(capacity) - 1D));
|
||||
this.maxstorage = this.getEUCapacity();
|
||||
this.energySource.setEnergyStored(nbttagcompound.getLong("storage"));
|
||||
this.storage = this.energySource.getEnergyStored();
|
||||
this.mp_storage = this.storage / 1000;
|
||||
}
|
||||
|
||||
public int getSizeInventory() {
|
||||
return 5;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
@@ -137,7 +323,7 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IInve
|
||||
}
|
||||
|
||||
public String getInventoryName() {
|
||||
return StatCollector.translateToLocal("tile.EMT.solar." + getInventoryName().replaceAll(" ", "").toLowerCase() + ".name");
|
||||
return guiname;
|
||||
}
|
||||
|
||||
public int getInventoryStackLimit() {
|
||||
@@ -154,11 +340,10 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IInve
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
public int gaugeEnergyScaled(int i) {
|
||||
return (int) (this.mp_storage * 1000 * i / (int) this.maxstorage);
|
||||
public int gaugeEnergyScaled(long i) {
|
||||
return (int) ((this.mp_storage * 1000 * i) / this.maxstorage);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
return false;
|
||||
@@ -185,7 +370,12 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IInve
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
return 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(EMTBlocks.solars[instance], 1, meta);
|
||||
}
|
||||
|
||||
public void inputintoGTnet() {
|
||||
@@ -220,6 +410,19 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IInve
|
||||
return (long) this.energySource.getCapacity();
|
||||
}
|
||||
|
||||
public long[] calculateMaxVoltAmp() {
|
||||
long[] voltAmp = new long[2];
|
||||
voltAmp[0] = getOutputVoltage();
|
||||
long generating = (long) Math.floor(output * getMaxMulti());
|
||||
if (generating <= GT_Values.V[energySource.getSourceTier()]) {
|
||||
voltAmp[1] = 1L;
|
||||
} else if (generating % GT_Values.V[energySource.getSourceTier()] == 0.0D) {
|
||||
voltAmp[1] = (generating / GT_Values.V[energySource.getSourceTier()]);
|
||||
} else
|
||||
voltAmp[1] = (1L + (generating / GT_Values.V[energySource.getSourceTier()]));
|
||||
return voltAmp;
|
||||
}
|
||||
|
||||
public long getOutputAmperage() {
|
||||
long ret;
|
||||
if (this.energySource.getSourceTier() <= 4) {
|
||||
@@ -240,14 +443,10 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IInve
|
||||
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)];
|
||||
return GT_Values.V[this.energySource.getSourceTier()];
|
||||
}
|
||||
|
||||
public long getInputAmperage() {
|
||||
@@ -261,7 +460,7 @@ public abstract class TileEntitySolarBase extends TileEntityEMT implements IInve
|
||||
public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
|
||||
if (this.energySource.getEnergyStored() > aEnergy) {
|
||||
this.energySource.drawEnergy(aEnergy);
|
||||
this.storage = ((int) this.energySource.getEnergyStored());
|
||||
this.storage = this.energySource.getEnergyStored();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
package emt.tile.solar.air;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityAirSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityAirSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
};
|
||||
|
||||
@Override
|
||||
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";
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package emt.tile.solar.air;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityDoubleAirSolar extends TileEntityAirSolar {
|
||||
|
||||
public TileEntityDoubleAirSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package emt.tile.solar.air;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityTripleAirSolar extends TileEntityAirSolar {
|
||||
|
||||
public TileEntityTripleAirSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package emt.tile.solar.compressed;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityCompressedSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityCompressedSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package emt.tile.solar.compressed;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityDoubleCompressedSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityDoubleCompressedSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package emt.tile.solar.compressed;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityTripleCompressedSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityTripleCompressedSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new DefinitelyNotAIC2Source(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,49 +0,0 @@
|
||||
package emt.tile.solar.dark;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityDarkSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityDarkSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
};
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if ((this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) && (!this.worldObj.isRaining()) && (!this.worldObj.isThundering())) {
|
||||
isActive=true;
|
||||
if (side) {
|
||||
this.generating=output*calc_multi();
|
||||
this.energySource.addEnergy(this.output*calc_multi());
|
||||
}
|
||||
}else {
|
||||
isActive = false;
|
||||
this.generating=0;
|
||||
}
|
||||
}
|
||||
|
||||
@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";
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package emt.tile.solar.dark;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityDoubleDarkSolar extends TileEntityDarkSolar {
|
||||
|
||||
public TileEntityDoubleDarkSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package emt.tile.solar.dark;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityTripleDarkSolar extends TileEntityDarkSolar {
|
||||
|
||||
public TileEntityTripleDarkSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package emt.tile.solar.earth;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityDoubleEarthSolar extends TileEntityEarthSolar {
|
||||
|
||||
public TileEntityDoubleEarthSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package emt.tile.solar.earth;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityEarthSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityEarthSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
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";
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package emt.tile.solar.earth;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityTripleEarthSolar extends TileEntityEarthSolar {
|
||||
|
||||
public TileEntityTripleEarthSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package emt.tile.solar.fire;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityDoubleFireSolar extends TileEntityFireSolar {
|
||||
|
||||
public TileEntityDoubleFireSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(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,66 +0,0 @@
|
||||
package emt.tile.solar.fire;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
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 {
|
||||
|
||||
public TileEntityFireSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkConditions() {
|
||||
boolean ignis = ((this.worldObj.provider.dimensionId == (-1)) || (theSunIsVisible));
|
||||
if(ignis) {
|
||||
this.isActive=true;
|
||||
if (side) {
|
||||
this.generating=output*calc_multi();
|
||||
this.energySource.addEnergy(this.output*calc_multi());
|
||||
}
|
||||
}
|
||||
else {
|
||||
isActive = false;
|
||||
this.generating=0;
|
||||
}
|
||||
/*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";
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package emt.tile.solar.fire;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityTripleFireSolar extends TileEntityFireSolar {
|
||||
|
||||
public TileEntityTripleFireSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package emt.tile.solar.order;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityDoubleOrderSolar extends TileEntityOrderSolar {
|
||||
|
||||
public TileEntityDoubleOrderSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(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,49 +0,0 @@
|
||||
package emt.tile.solar.order;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityOrderSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityOrderSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if ((this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) && (!this.worldObj.isRaining()) && (!this.worldObj.isThundering())) {
|
||||
isActive = true;
|
||||
if (side) {
|
||||
this.energySource.addEnergy(this.output*calc_multi());
|
||||
this.generating=output*calc_multi();
|
||||
}
|
||||
}else {
|
||||
isActive = false;
|
||||
this.generating=0;
|
||||
}
|
||||
}
|
||||
|
||||
@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";
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package emt.tile.solar.order;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityTripleOrderSolar extends TileEntityOrderSolar {
|
||||
|
||||
public TileEntityTripleOrderSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package emt.tile.solar.water;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityDoubleWaterSolar extends TileEntityWaterSolar {
|
||||
|
||||
public TileEntityDoubleWaterSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(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";
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package emt.tile.solar.water;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityTripleWaterSolar extends TileEntityWaterSolar {
|
||||
|
||||
public TileEntityTripleWaterSolar() {
|
||||
super();
|
||||
output = EMTConfigHandler.tripleCompressedSolarOutput;
|
||||
energySource = new DefinitelyNotAIC2Source(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,57 +0,0 @@
|
||||
package emt.tile.solar.water;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TileEntityWaterSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityWaterSolar() {
|
||||
super();
|
||||
energySource = new DefinitelyNotAIC2Source(this, 10000, 3);
|
||||
output = EMTConfigHandler.compressedSolarOutput;
|
||||
this.maxstorage=this.getEUCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible || this.calc_multi()>1F && this.worldObj.isDaytime() || this.calc_multi() == 6F ){
|
||||
isActive = true;
|
||||
if (super.side) {
|
||||
this.generating=output*calc_multi();
|
||||
energySource.addEnergy(output*calc_multi());
|
||||
}
|
||||
}
|
||||
else {
|
||||
isActive = false;
|
||||
this.generating=0D;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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