Massive rework of configs, items and blocks.

I redone where the items/blocsks are stored and how the configs are
handled to clean up it and give space. You can change the config line to
AWWayofTime if you want to keep the compatibility with old configs. Now
you reference the blocks from the ModBlocks and Items from the ModItems.
This commit is contained in:
Fenn 2014-01-17 21:05:38 +00:00
parent 8601e9faff
commit e3644f2d2b
304 changed files with 3941 additions and 5108 deletions

View file

@ -1,9 +1,10 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import WayofTime.alchemicalWizardry.common.*;
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeComponent;
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -18,24 +19,13 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidEvent;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fluids.IFluidTank;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeComponent;
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraftforge.fluids.*;
public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFluidHandler
{
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFluidHandler {
private ItemStack[] inv;
private int resultID;
private int resultDamage;
@ -189,8 +179,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (fluid != null)
{
fluid.writeToNBT(par1NBTTagCompound);
}
else
} else
{
par1NBTTagCompound.setString("Empty", "");
}
@ -247,8 +236,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (stack.stackSize <= amt)
{
setInventorySlotContents(slot, null);
}
else
} else
{
stack = stack.splitStack(amt);
@ -416,8 +404,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
{
fluidInput.amount += resource.amount;
filled = resource.amount;
}
else
} else
{
fluidInput.amount = bufferCapacity;
}
@ -483,7 +470,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0)
{
//TODO
int syphonMax = (int)(20 * this.dislocationMultiplier);
int syphonMax = (int) (20 * this.dislocationMultiplier);
int fluidInputted = 0;
int fluidOutputted = 0;
fluidInputted = Math.min(syphonMax, -this.fluid.amount + capacity);
@ -511,7 +498,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
return;
}
int worldTime = (int)(worldObj.getWorldTime() % 24000);
int worldTime = (int) (worldObj.getWorldTime() % 24000);
if (worldObj.isRemote)
{
@ -525,7 +512,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (fluid != null && fluid.amount >= 1)
{
int stackSize = getStackInSlot(0).stackSize;
int liquidDrained = Math.min((int)(upgradeLevel >= 2 ? consumptionRate * (1 + consumptionMultiplier) : consumptionRate), fluid.amount);
int liquidDrained = Math.min((int) (upgradeLevel >= 2 ? consumptionRate * (1 + consumptionMultiplier) : consumptionRate), fluid.amount);
if (liquidDrained > (liquidRequired * stackSize - progress))
{
@ -538,7 +525,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (worldTime % 4 == 0)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short)1));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
}
if (progress >= liquidRequired * stackSize)
@ -548,8 +535,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (!isResultBlock)
{
result = new ItemStack(resultID, stackSize, resultDamage);
}
else
} else
{
result = new ItemStack(Block.blocksList[resultID], stackSize, 0);
}
@ -559,24 +545,22 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
for (int i = 0; i < 8; i++)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord + 0.5, yCoord + 1, zCoord + 0.5, (short)4));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord + 0.5, yCoord + 1, zCoord + 0.5, (short) 4));
}
//setInventorySlotContents(1, null);
this.isActive = false;
}
}
else if (progress > 0)
} else if (progress > 0)
{
progress -= (int)(efficiencyMultiplier * drainRate);
progress -= (int) (efficiencyMultiplier * drainRate);
if (worldTime % 2 == 0)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short)2));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 2));
}
}
}
else
} else
{
ItemStack returnedItem = getStackInSlot(0);
@ -585,7 +569,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
return;
}
EnergyBattery item = (EnergyBattery)(returnedItem.getItem());
EnergyBattery item = (EnergyBattery) (returnedItem.getItem());
NBTTagCompound itemTag = returnedItem.stackTagCompound;
if (itemTag == null)
@ -602,7 +586,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
//EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(itemTag.getString("ownerName"));
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork)world.loadItemData(LifeEssenceNetwork.class, ownerName);
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null)
{
@ -618,11 +602,11 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (fluid != null && fluid.amount >= 1)
{
int liquidDrained = Math.min((int)(upgradeLevel >= 2 ? consumptionRate * (1 + consumptionMultiplier) : consumptionRate), fluid.amount);
int liquidDrained = Math.min((int) (upgradeLevel >= 2 ? consumptionRate * (1 + consumptionMultiplier) : consumptionRate), fluid.amount);
if (liquidDrained > (item.getMaxEssence() * this.orbCapacityMultiplier - currentEssence))
{
liquidDrained = (int)(item.getMaxEssence() * this.orbCapacityMultiplier - currentEssence);
liquidDrained = (int) (item.getMaxEssence() * this.orbCapacityMultiplier - currentEssence);
}
if (liquidDrained <= 0)
@ -639,7 +623,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (worldTime % 4 == 0)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short)3));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 3));
}
}
}
@ -695,8 +679,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
dos.writeDouble(y);
dos.writeDouble(z);
dos.writeShort(particleType);
}
catch (IOException e)
} catch (IOException e)
{
e.printStackTrace();
}
@ -719,8 +702,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
{
ItemStack is = new ItemStack(intData[i * 3], intData[i * 3 + 2], intData[i * 3 + 1]);
inv[i] = is;
}
else
} else
{
inv[i] = null;
}
@ -735,7 +717,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
public int[] buildIntDataList()
{
int [] sortList = new int[1 * 3];
int[] sortList = new int[1 * 3];
int pos = 0;
for (ItemStack is : inv)
@ -745,8 +727,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
sortList[pos++] = is.itemID;
sortList[pos++] = is.getItemDamage();
sortList[pos++] = is.stackSize;
}
else
} else
{
sortList[pos++] = 0;
sortList[pos++] = 0;
@ -796,7 +777,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 20;
drainRate = 10;
resultID = AlchemicalWizardry.duskScribeTool.itemID;
resultID = ModItems.duskScribeTool.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -814,14 +795,14 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
consumptionRate = 20;
drainRate = 20;
//ItemStack bloodOrb = new ItemStack(AlchemicalWizardry.magicianBloodOrb);
resultID = AlchemicalWizardry.magicianBloodOrb.itemID;
resultID = ModItems.magicianBloodOrb.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.emptySocket.blockID)
if (getStackInSlot(0).itemID == ModBlocks.emptySocket.blockID)
{
isActive = true;
liquidRequired = 30000;
@ -829,7 +810,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
consumptionRate = 40;
drainRate = 10;
//ItemStack bloodOrb = new ItemStack(AlchemicalWizardry.weakBloodOrb);
resultID = AlchemicalWizardry.bloodSocket.blockID;
resultID = ModBlocks.bloodSocket.blockID;
resultDamage = 0;
isResultBlock = true;
//setInventorySlotContents(1, bloodOrb);
@ -843,7 +824,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
resultID = AlchemicalWizardry.earthScribeTool.itemID;
resultID = ModItems.earthScribeTool.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -857,7 +838,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
resultID = AlchemicalWizardry.waterScribeTool.itemID;
resultID = ModItems.waterScribeTool.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -874,7 +855,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
resultID = AlchemicalWizardry.blankSpell.itemID;
resultID = ModItems.blankSpell.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -889,14 +870,13 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
resultID = AlchemicalWizardry.blankSlate.itemID;
resultID = ModItems.blankSlate.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
}
else
} else
{
// if(!getStackInSlot(0).isItemDamaged()&&getStackInSlot(0).getItemDamage()>16&&!isActive)
// {
@ -904,21 +884,21 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
// }
if (upgradeLevel >= 5)
{
if (getStackInSlot(0).itemID == AlchemicalWizardry.demonBloodShard.itemID)
if (getStackInSlot(0).itemID == ModItems.demonBloodShard.itemID)
{
isActive = true;
liquidRequired = 75000;
canBeFilled = false;
consumptionRate = 50;
drainRate = 100;
resultID = AlchemicalWizardry.archmageBloodOrb.itemID;
resultID = ModItems.archmageBloodOrb.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.archmageBloodOrb.itemID)
if (getStackInSlot(0).itemID == ModItems.archmageBloodOrb.itemID)
{
ItemStack item = getStackInSlot(0);
@ -937,21 +917,21 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (upgradeLevel >= 4)
{
if (getStackInSlot(0).itemID == AlchemicalWizardry.weakBloodShard.itemID)
if (getStackInSlot(0).itemID == ModItems.weakBloodShard.itemID)
{
isActive = true;
liquidRequired = 40000;
canBeFilled = false;
consumptionRate = 30;
drainRate = 50;
resultID = AlchemicalWizardry.masterBloodOrb.itemID;
resultID = ModItems.masterBloodOrb.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.masterBloodOrb.itemID)
if (getStackInSlot(0).itemID == ModItems.masterBloodOrb.itemID)
{
ItemStack item = getStackInSlot(0);
@ -974,36 +954,36 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 10;
drainRate = 10;
resultID = AlchemicalWizardry.telepositionFocus.itemID;
resultID = ModItems.telepositionFocus.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.telepositionFocus.itemID)
if (getStackInSlot(0).itemID == ModItems.telepositionFocus.itemID)
{
isActive = true;
liquidRequired = 10000;
canBeFilled = false;
consumptionRate = 25;
drainRate = 15;
resultID = AlchemicalWizardry.enhancedTelepositionFocus.itemID;
resultID = ModItems.enhancedTelepositionFocus.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.imbuedSlate.itemID)
if (getStackInSlot(0).itemID == ModItems.imbuedSlate.itemID)
{
isActive = true;
liquidRequired = 15000;
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
ItemStack bloodOrb = new ItemStack(AlchemicalWizardry.apprenticeBloodOrb);
resultID = AlchemicalWizardry.demonicSlate.itemID;
ItemStack bloodOrb = new ItemStack(ModItems.apprenticeBloodOrb);
resultID = ModItems.demonicSlate.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -1013,7 +993,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
if (upgradeLevel >= 3)
{
if (getStackInSlot(0).itemID == AlchemicalWizardry.magicianBloodOrb.itemID)
if (getStackInSlot(0).itemID == ModItems.magicianBloodOrb.itemID)
{
ItemStack item = getStackInSlot(0);
@ -1029,7 +1009,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.lavaCrystal.itemID)
if (getStackInSlot(0).itemID == ModItems.lavaCrystal.itemID)
{
isActive = true;
liquidRequired = 10000;
@ -1037,7 +1017,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
consumptionRate = 20;
drainRate = 10;
//ItemStack bloodOrb = new ItemStack(AlchemicalWizardry.weakBloodOrb);
resultID = AlchemicalWizardry.activationCrystal.itemID;
resultID = ModItems.activationCrystal.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -1051,7 +1031,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
resultID = AlchemicalWizardry.fireScribeTool.itemID;
resultID = ModItems.fireScribeTool.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -1065,22 +1045,22 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
resultID = AlchemicalWizardry.airScribeTool.itemID;
resultID = ModItems.airScribeTool.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.reinforcedSlate.itemID)
if (getStackInSlot(0).itemID == ModItems.reinforcedSlate.itemID)
{
isActive = true;
liquidRequired = 7000;
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
ItemStack bloodOrb = new ItemStack(AlchemicalWizardry.apprenticeBloodOrb);
resultID = AlchemicalWizardry.imbuedSlate.itemID;
ItemStack bloodOrb = new ItemStack(ModItems.apprenticeBloodOrb);
resultID = ModItems.imbuedSlate.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -1097,15 +1077,15 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
ItemStack bloodOrb = new ItemStack(AlchemicalWizardry.apprenticeBloodOrb);
resultID = AlchemicalWizardry.apprenticeBloodOrb.itemID;
ItemStack bloodOrb = new ItemStack(ModItems.apprenticeBloodOrb);
resultID = ModItems.apprenticeBloodOrb.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.apprenticeBloodOrb.itemID)
if (getStackInSlot(0).itemID == ModItems.apprenticeBloodOrb.itemID)
{
ItemStack item = getStackInSlot(0);
@ -1128,7 +1108,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
resultID = AlchemicalWizardry.daggerOfSacrifice.itemID;
resultID = ModItems.daggerOfSacrifice.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -1142,22 +1122,22 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
resultID = AlchemicalWizardry.alchemyFlask.itemID;
resultDamage = AlchemicalWizardry.alchemyFlask.getMaxDamage();
resultID = ModItems.alchemyFlask.itemID;
resultDamage = ModItems.alchemyFlask.getMaxDamage();
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.blankSlate.itemID)
if (getStackInSlot(0).itemID == ModItems.blankSlate.itemID)
{
isActive = true;
liquidRequired = 2000;
canBeFilled = false;
consumptionRate = 5;
drainRate = 5;
ItemStack bloodOrb = new ItemStack(AlchemicalWizardry.apprenticeBloodOrb);
resultID = AlchemicalWizardry.reinforcedSlate.itemID;
ItemStack bloodOrb = new ItemStack(ModItems.apprenticeBloodOrb);
resultID = ModItems.reinforcedSlate.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
@ -1172,15 +1152,15 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
canBeFilled = false;
consumptionRate = 2;
drainRate = 1;
ItemStack bloodOrb = new ItemStack(AlchemicalWizardry.weakBloodOrb);
resultID = AlchemicalWizardry.weakBloodOrb.itemID;
ItemStack bloodOrb = new ItemStack(ModItems.weakBloodOrb);
resultID = ModItems.weakBloodOrb.itemID;
resultDamage = 0;
isResultBlock = false;
//setInventorySlotContents(1, bloodOrb);
return;
}
if (getStackInSlot(0).itemID == AlchemicalWizardry.weakBloodOrb.itemID)
if (getStackInSlot(0).itemID == ModItems.weakBloodOrb.itemID)
{
ItemStack item = getStackInSlot(0);
@ -1253,16 +1233,16 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
this.isUpgraded = checkUpgrade;
this.upgradeLevel = upgradeState;
this.consumptionMultiplier = (float)(0.15 * upgrades.getSpeedUpgrades());
this.efficiencyMultiplier = (float)Math.pow(0.85, upgrades.getSpeedUpgrades());
this.sacrificeEfficiencyMultiplier = (float)(0.10 * upgrades.getSacrificeUpgrades());
this.selfSacrificeEfficiencyMultiplier = (float)(0.10 * upgrades.getSelfSacrificeUpgrades());
this.capacityMultiplier = (float)(1 + 0.15 * upgrades.getAltarCapacitiveUpgrades());
this.consumptionMultiplier = (float) (0.15 * upgrades.getSpeedUpgrades());
this.efficiencyMultiplier = (float) Math.pow(0.85, upgrades.getSpeedUpgrades());
this.sacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSacrificeUpgrades());
this.selfSacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSelfSacrificeUpgrades());
this.capacityMultiplier = (float) (1 + 0.15 * upgrades.getAltarCapacitiveUpgrades());
//TODO finalize values
this.dislocationMultiplier = (float)(Math.pow(1.2, upgrades.getDisplacementUpgrades()));
this.orbCapacityMultiplier = (float)(1 + 0.02 * upgrades.getOrbCapacitiveUpgrades());
this.capacity = (int)(FluidContainerRegistry.BUCKET_VOLUME * 10 * capacityMultiplier);
this.bufferCapacity = (int)(FluidContainerRegistry.BUCKET_VOLUME * 1 * capacityMultiplier);
this.dislocationMultiplier = (float) (Math.pow(1.2, upgrades.getDisplacementUpgrades()));
this.orbCapacityMultiplier = (float) (1 + 0.02 * upgrades.getOrbCapacitiveUpgrades());
this.capacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 10 * capacityMultiplier);
this.bufferCapacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 1 * capacityMultiplier);
if (this.fluid.amount > this.capacity)
{
@ -1417,6 +1397,6 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
// TODO Auto-generated method stub
FluidTank compositeTank = new FluidTank(capacity);
compositeTank.setFluid(fluid);
return new FluidTankInfo[] {compositeTank.getInfo()};
return new FluidTankInfo[]{compositeTank.getInfo()};
}
}

View file

@ -3,10 +3,8 @@ package WayofTime.alchemicalWizardry.common.tileEntity;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.packet.Packet;
import net.minecraftforge.common.ForgeDirection;
public class TEConduit extends TEOrientable
{
public class TEConduit extends TEOrientable {
@Override
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{

View file

@ -9,8 +9,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntitySkull;
import net.minecraft.world.World;
public class TEHomHeart extends TileEntity
{
public class TEHomHeart extends TileEntity {
public boolean canCastSpell(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
return true;
@ -53,7 +52,7 @@ public class TEHomHeart extends TileEntity
if (tileEntity instanceof TEAltar)
{
ItemStack itemStack = ((TEAltar)tileEntity).getStackInSlot(0);
ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0);
if (itemStack != null)
{
@ -70,7 +69,7 @@ public class TEHomHeart extends TileEntity
if (tileEntity instanceof TEAltar)
{
ItemStack itemStack = ((TEAltar)tileEntity).getStackInSlot(0);
ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0);
if (itemStack != null)
{
@ -87,7 +86,7 @@ public class TEHomHeart extends TileEntity
if (tileEntity instanceof TEAltar)
{
ItemStack itemStack = ((TEAltar)tileEntity).getStackInSlot(0);
ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0);
if (itemStack != null)
{
@ -104,7 +103,7 @@ public class TEHomHeart extends TileEntity
if (tileEntity instanceof TEAltar)
{
ItemStack itemStack = ((TEAltar)tileEntity).getStackInSlot(0);
ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0);
if (itemStack != null)
{
@ -128,16 +127,13 @@ public class TEHomHeart extends TileEntity
if (blockID == Block.glowStone.blockID)
{
return 0;
}
else if (blockID == Block.blockRedstone.blockID)
} else if (blockID == Block.blockRedstone.blockID)
{
return 1;
}
else if (blockID == Block.anvil.blockID)
} else if (blockID == Block.anvil.blockID)
{
return 2;
}
else if (blockID == Block.glass.blockID)
} else if (blockID == Block.glass.blockID)
{
return 3;
}
@ -146,7 +142,7 @@ public class TEHomHeart extends TileEntity
if (tileEntity instanceof TileEntitySkull)
{
int skullType = ((TileEntitySkull)tileEntity).getSkullType();
int skullType = ((TileEntitySkull) tileEntity).getSkullType();
switch (skullType)
{

View file

@ -1,12 +1,9 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemArmor;
import net.minecraft.tileentity.TileEntity;
public class TEHomHeartRenderer extends TileEntitySpecialRenderer
{
public class TEHomHeartRenderer extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f)
{

View file

@ -2,8 +2,7 @@ package WayofTime.alchemicalWizardry.common.tileEntity;
import net.minecraft.tileentity.TileEntity;
public class TEImperfectRitualStone extends TileEntity
{
public class TEImperfectRitualStone extends TileEntity {
public TEImperfectRitualStone()
{
// TODO Auto-generated constructor stub

View file

@ -1,34 +1,14 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.rituals.Rituals;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
public class TEMasterStone extends TileEntity
{
public class TEMasterStone extends TileEntity {
private int currentRitual;
private boolean isActive;
private String owner;
@ -92,7 +72,7 @@ public class TEMasterStone extends TileEntity
}
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork)worldSave.loadItemData(LifeEssenceNetwork.class, owner);
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
@ -115,7 +95,7 @@ public class TEMasterStone extends TileEntity
for (int i = 0; i < 12; i++)
{
PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short)1));
PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
}
}
@ -140,7 +120,7 @@ public class TEMasterStone extends TileEntity
return;
}
int worldTime = (int)(worldObj.getWorldTime() % 24000);
int worldTime = (int) (worldObj.getWorldTime() % 24000);
if (worldObj.isRemote)
{
@ -150,7 +130,7 @@ public class TEMasterStone extends TileEntity
if (worldTime % 100 == 0)
{
boolean testRunes = Rituals.checkDirectionOfRitualValid(worldObj, xCoord, yCoord, zCoord, currentRitual, direction);
PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short)1));
PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
if (!testRunes)
{

View file

@ -5,8 +5,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
public class TEOrientable extends TileEntity implements IOrientable
{
public class TEOrientable extends TileEntity implements IOrientable {
protected ForgeDirection inputFace;
protected ForgeDirection outputFace;

View file

@ -11,8 +11,7 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.packet.Packet;
import net.minecraft.tileentity.TileEntity;
public class TEPedestal extends TileEntity implements IInventory
{
public class TEPedestal extends TileEntity implements IInventory {
private ItemStack[] inv;
private int resultID;
private int resultDamage;
@ -96,8 +95,7 @@ public class TEPedestal extends TileEntity implements IInventory
if (stack.stackSize <= amt)
{
setInventorySlotContents(slot, null);
}
else
} else
{
stack = stack.splitStack(amt);
@ -209,8 +207,7 @@ public class TEPedestal extends TileEntity implements IInventory
{
ItemStack is = new ItemStack(intData[i * 3], intData[i * 3 + 2], intData[i * 3 + 1]);
inv[i] = is;
}
else
} else
{
inv[i] = null;
}
@ -220,7 +217,7 @@ public class TEPedestal extends TileEntity implements IInventory
public int[] buildIntDataList()
{
int [] sortList = new int[1 * 3];
int[] sortList = new int[1 * 3];
int pos = 0;
for (ItemStack is : inv)
@ -230,8 +227,7 @@ public class TEPedestal extends TileEntity implements IInventory
sortList[pos++] = is.itemID;
sortList[pos++] = is.getItemDamage();
sortList[pos++] = is.stackSize;
}
else
} else
{
sortList[pos++] = 0;
sortList[pos++] = 0;
@ -260,7 +256,7 @@ public class TEPedestal extends TileEntity implements IInventory
for (int i = 0; i < 16; i++)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short)2));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short) 2));
}
}
}

View file

@ -1,8 +1,12 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import java.util.ArrayList;
import java.util.List;
import WayofTime.alchemicalWizardry.common.IDemon;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.PlinthComponent;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.summoning.SummoningRegistry;
import WayofTime.alchemicalWizardry.common.summoning.SummoningRegistryComponent;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -13,16 +17,11 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.packet.Packet;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.common.IDemon;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.PlinthComponent;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.summoning.SummoningRegistry;
import WayofTime.alchemicalWizardry.common.summoning.SummoningRegistryComponent;
import cpw.mods.fml.common.network.PacketDispatcher;
public class TEPlinth extends TileEntity implements IInventory
{
import java.util.ArrayList;
import java.util.List;
public class TEPlinth extends TileEntity implements IInventory {
private ItemStack[] inv;
private boolean isActive;
@ -204,8 +203,7 @@ public class TEPlinth extends TileEntity implements IInventory
if (stack.stackSize <= amt)
{
setInventorySlotContents(slot, null);
}
else
} else
{
stack = stack.splitStack(amt);
@ -294,7 +292,7 @@ public class TEPlinth extends TileEntity implements IInventory
{
if (getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof EnergyBattery)
{
int bloodOrbLevel = ((EnergyBattery)getStackInSlot(0).getItem()).getOrbLevel();
int bloodOrbLevel = ((EnergyBattery) getStackInSlot(0).getItem()).getOrbLevel();
if (SummoningRegistry.isRecipeValid(bloodOrbLevel, composeItemsForRingAndParadigm(1, true), composeItemsForRingAndParadigm(2, true), composeItemsForRingAndParadigm(3, true)))
{
@ -305,8 +303,7 @@ public class TEPlinth extends TileEntity implements IInventory
ring1Inv = src.getRingRecipeForRing(1);
ring2Inv = src.getRingRecipeForRing(2);
ring3Inv = src.getRingRecipeForRing(3);
}
else if (SummoningRegistry.isRecipeValid(bloodOrbLevel, composeItemsForRingAndParadigm(1, false), composeItemsForRingAndParadigm(2, false), composeItemsForRingAndParadigm(3, false)))
} else if (SummoningRegistry.isRecipeValid(bloodOrbLevel, composeItemsForRingAndParadigm(1, false), composeItemsForRingAndParadigm(2, false), composeItemsForRingAndParadigm(3, false)))
{
SummoningRegistryComponent src = SummoningRegistry.getRegistryComponent(bloodOrbLevel, composeItemsForRingAndParadigm(1, false), composeItemsForRingAndParadigm(2, false), composeItemsForRingAndParadigm(3, false));
isActive = true;
@ -315,15 +312,13 @@ public class TEPlinth extends TileEntity implements IInventory
ring1Inv = src.getRingRecipeForRing(1);
ring2Inv = src.getRingRecipeForRing(2);
ring3Inv = src.getRingRecipeForRing(3);
}
else
} else
{
isActive = false;
progress = 0;
}
}
}
else
} else
{
if (getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof EnergyBattery)
{
@ -354,23 +349,21 @@ public class TEPlinth extends TileEntity implements IInventory
if (itemStack == null)
{
progress += progressInterval;
}
else
} else
{
if (this.deleteItemStackInRing(ring, itemStack))
{
progress++;
}
}
}
else
} else
{
progress++;
}
if (progress >= progressInterval * 18)
{
int bloodOrbLevel = ((EnergyBattery)getStackInSlot(0).getItem()).getOrbLevel();
int bloodOrbLevel = ((EnergyBattery) getStackInSlot(0).getItem()).getOrbLevel();
EntityLivingBase entity = SummoningRegistry.getEntity(worldObj, bloodOrbLevel, ring1Inv, ring2Inv, ring3Inv);
//EntityLivingBase entity = new EntityFallenAngel(worldObj);
@ -382,7 +375,7 @@ public class TEPlinth extends TileEntity implements IInventory
if (entity instanceof IDemon)
{
((IDemon)entity).setSummonedConditions();
((IDemon) entity).setSummonedConditions();
}
worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 3, false);
@ -414,14 +407,13 @@ public class TEPlinth extends TileEntity implements IInventory
if (tileEntity instanceof TEPedestal)
{
((TEPedestal)tileEntity).setInventorySlotContents(0, null);
PacketDispatcher.sendPacketToAllInDimension(((TEPedestal)tileEntity).getDescriptionPacket(), worldObj.provider.dimensionId);
((TEPedestal) tileEntity).setInventorySlotContents(0, null);
PacketDispatcher.sendPacketToAllInDimension(((TEPedestal) tileEntity).getDescriptionPacket(), worldObj.provider.dimensionId);
i++;
}
}
}
}
else
} else
{
int i = 0;
@ -433,8 +425,8 @@ public class TEPlinth extends TileEntity implements IInventory
if (tileEntity instanceof TEPedestal)
{
((TEPedestal)tileEntity).setInventorySlotContents(0, null);
PacketDispatcher.sendPacketToAllInDimension(((TEPedestal)tileEntity).getDescriptionPacket(), worldObj.provider.dimensionId);
((TEPedestal) tileEntity).setInventorySlotContents(0, null);
PacketDispatcher.sendPacketToAllInDimension(((TEPedestal) tileEntity).getDescriptionPacket(), worldObj.provider.dimensionId);
i++;
}
}
@ -461,7 +453,7 @@ public class TEPlinth extends TileEntity implements IInventory
if (tileEntity instanceof TEPedestal)
{
ItemStack possibleItem = ((TEPedestal)tileEntity).getStackInSlot(0);
ItemStack possibleItem = ((TEPedestal) tileEntity).getStackInSlot(0);
if (possibleItem == null)
{
@ -477,8 +469,7 @@ public class TEPlinth extends TileEntity implements IInventory
{
test = true;
}
}
else if (!(itemStack.getItem() instanceof ItemBlock))
} else if (!(itemStack.getItem() instanceof ItemBlock))
{
test = true;
}
@ -487,9 +478,9 @@ public class TEPlinth extends TileEntity implements IInventory
{
if (itemStack.itemID == possibleItem.itemID && (itemStack.getItemDamage() == possibleItem.getItemDamage() || itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE))
{
((TEPedestal)tileEntity).decrStackSize(0, 1);
((TEPedestal)tileEntity).onItemDeletion();
PacketDispatcher.sendPacketToAllInDimension(((TEPedestal)tileEntity).getDescriptionPacket(), worldObj.provider.dimensionId);
((TEPedestal) tileEntity).decrStackSize(0, 1);
((TEPedestal) tileEntity).onItemDeletion();
PacketDispatcher.sendPacketToAllInDimension(((TEPedestal) tileEntity).getDescriptionPacket(), worldObj.provider.dimensionId);
return true;
}
}
@ -498,8 +489,7 @@ public class TEPlinth extends TileEntity implements IInventory
}
}
}
}
else
} else
{
int i = 0;
@ -511,7 +501,7 @@ public class TEPlinth extends TileEntity implements IInventory
if (tileEntity instanceof TEPedestal)
{
ItemStack possibleItem = ((TEPedestal)tileEntity).getStackInSlot(0);
ItemStack possibleItem = ((TEPedestal) tileEntity).getStackInSlot(0);
if (possibleItem == null)
{
@ -527,8 +517,7 @@ public class TEPlinth extends TileEntity implements IInventory
{
test = true;
}
}
else if (!(itemStack.getItem() instanceof ItemBlock))
} else if (!(itemStack.getItem() instanceof ItemBlock))
{
test = true;
}
@ -537,10 +526,10 @@ public class TEPlinth extends TileEntity implements IInventory
{
if (itemStack.itemID == possibleItem.itemID && (itemStack.getItemDamage() == possibleItem.getItemDamage() || itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE))
{
((TEPedestal)tileEntity).decrStackSize(0, 1);
((TEPedestal)tileEntity).onItemDeletion();
((TEPedestal) tileEntity).decrStackSize(0, 1);
((TEPedestal) tileEntity).onItemDeletion();
//worldObj.markBlockForUpdate(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset);
PacketDispatcher.sendPacketToAllInDimension(((TEPedestal)tileEntity).getDescriptionPacket(), worldObj.provider.dimensionId);
PacketDispatcher.sendPacketToAllInDimension(((TEPedestal) tileEntity).getDescriptionPacket(), worldObj.provider.dimensionId);
return true;
}
}
@ -570,13 +559,12 @@ public class TEPlinth extends TileEntity implements IInventory
if (tileEntity instanceof TEPedestal)
{
composed[i] = ((TEPedestal)tileEntity).getStackInSlot(0);
composed[i] = ((TEPedestal) tileEntity).getStackInSlot(0);
i++;
}
}
}
}
else
} else
{
int i = 0;
@ -588,7 +576,7 @@ public class TEPlinth extends TileEntity implements IInventory
if (tileEntity instanceof TEPedestal)
{
composed[i] = ((TEPedestal)tileEntity).getStackInSlot(0);
composed[i] = ((TEPedestal) tileEntity).getStackInSlot(0);
i++;
}
}
@ -629,8 +617,7 @@ public class TEPlinth extends TileEntity implements IInventory
{
ItemStack is = new ItemStack(intData[i * 3], intData[i * 3 + 2], intData[i * 3 + 1]);
inv[i] = is;
}
else
} else
{
inv[i] = null;
}
@ -640,7 +627,7 @@ public class TEPlinth extends TileEntity implements IInventory
public int[] buildIntDataList()
{
int [] sortList = new int[1 * 3];
int[] sortList = new int[1 * 3];
int pos = 0;
for (ItemStack is : inv)
@ -650,8 +637,7 @@ public class TEPlinth extends TileEntity implements IInventory
sortList[pos++] = is.itemID;
sortList[pos++] = is.getItemDamage();
sortList[pos++] = is.stackSize;
}
else
} else
{
sortList[pos++] = 0;
sortList[pos++] = 0;

View file

@ -1,34 +1,15 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Random;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidEvent;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidTank;
public class TESocket extends TileEntity implements IInventory
{
public class TESocket extends TileEntity implements IInventory {
private ItemStack[] inv;
private int resultID;
private int resultDamage;
@ -112,8 +93,7 @@ public class TESocket extends TileEntity implements IInventory
if (stack.stackSize <= amt)
{
setInventorySlotContents(slot, null);
}
else
} else
{
stack = stack.splitStack(amt);
@ -225,8 +205,7 @@ public class TESocket extends TileEntity implements IInventory
{
ItemStack is = new ItemStack(intData[i * 3], intData[i * 3 + 2], intData[i * 3 + 1]);
inv[i] = is;
}
else
} else
{
inv[i] = null;
}
@ -236,7 +215,7 @@ public class TESocket extends TileEntity implements IInventory
public int[] buildIntDataList()
{
int [] sortList = new int[1 * 3];
int[] sortList = new int[1 * 3];
int pos = 0;
for (ItemStack is : inv)
@ -246,8 +225,7 @@ public class TESocket extends TileEntity implements IInventory
sortList[pos++] = is.itemID;
sortList[pos++] = is.getItemDamage();
sortList[pos++] = is.stackSize;
}
else
} else
{
sortList[pos++] = 0;
sortList[pos++] = 0;

View file

@ -1,8 +1,9 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import java.util.Iterator;
import java.util.List;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -13,13 +14,11 @@ import net.minecraft.network.packet.Packet;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
public class TETeleposer extends TileEntity implements IInventory
{
import java.util.Iterator;
import java.util.List;
public class TETeleposer extends TileEntity implements IInventory {
private ItemStack[] inv;
private int resultID;
private int resultDamage;
@ -107,8 +106,7 @@ public class TETeleposer extends TileEntity implements IInventory
if (stack.stackSize <= amt)
{
setInventorySlotContents(slot, null);
}
else
} else
{
stack = stack.splitStack(amt);
@ -199,15 +197,15 @@ public class TETeleposer extends TileEntity implements IInventory
{
ItemStack focus = this.getStackInSlot(0);
if (focus != null && focus.getItem()instanceof TelepositionFocus)
if (focus != null && focus.getItem() instanceof TelepositionFocus)
{
TelepositionFocus focusItem = (TelepositionFocus)(focus.getItem());
TelepositionFocus focusItem = (TelepositionFocus) (focus.getItem());
int xf = focusItem.xCoord(focus);
int yf = focusItem.yCoord(focus);
int zf = focusItem.zCoord(focus);
World worldF = focusItem.getWorld(focus);
int damage = (int)(0.5f * Math.sqrt((xCoord - xf) * (xCoord - xf) + (yCoord - yf + 1) * (yCoord - yf + 1) + (zCoord - zf) * (zCoord - zf)));
int focusLevel = ((TelepositionFocus)focusItem).getFocusLevel();
int damage = (int) (0.5f * Math.sqrt((xCoord - xf) * (xCoord - xf) + (yCoord - yf + 1) * (yCoord - yf + 1) + (zCoord - zf) * (zCoord - zf)));
int focusLevel = ((TelepositionFocus) focusItem).getFocusLevel();
int transportCount = 0;
int entityCount = 0;
@ -215,15 +213,15 @@ public class TETeleposer extends TileEntity implements IInventory
{
//Prime the teleportation
int d0 = focusLevel - 1;
AxisAlignedBB axisalignedbb1 = AxisAlignedBB.getAABBPool().getAABB((double)this.xCoord, (double)this.yCoord + d0 + 1, (double)this.zCoord, (double)(this.xCoord + 1), (double)(this.yCoord + 2 + d0), (double)(this.zCoord + 1)).expand(d0, d0, d0);
axisalignedbb1.maxY = Math.min((double)this.worldObj.getHeight(), this.yCoord + 2 + d0 + d0);
AxisAlignedBB axisalignedbb1 = AxisAlignedBB.getAABBPool().getAABB((double) this.xCoord, (double) this.yCoord + d0 + 1, (double) this.zCoord, (double) (this.xCoord + 1), (double) (this.yCoord + 2 + d0), (double) (this.zCoord + 1)).expand(d0, d0, d0);
axisalignedbb1.maxY = Math.min((double) this.worldObj.getHeight(), this.yCoord + 2 + d0 + d0);
List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb1);
Iterator iterator1 = list1.iterator();
EntityLivingBase entityplayer1;
while (iterator1.hasNext())
{
entityplayer1 = (EntityLivingBase)iterator1.next();
entityplayer1 = (EntityLivingBase) iterator1.next();
entityCount++;
}
@ -236,14 +234,14 @@ public class TETeleposer extends TileEntity implements IInventory
while (iterator2.hasNext())
{
entityplayer2 = (EntityLivingBase)iterator2.next();
entityplayer2 = (EntityLivingBase) iterator2.next();
entityCount++;
}
if (EnergyItems.canSyphonInContainer(focus, damage * (focusLevel * 2 - 1) * (focusLevel * 2 - 1) * (focusLevel * 2 - 1) + damage * entityCount))
{
for (int k = 0; k <= (focusLevel * 2 - 2); k++)
//for(int k=(focusLevel*2-1);k>=0;k--)
//for(int k=(focusLevel*2-1);k>=0;k--)
{
for (int i = -(focusLevel - 1); i <= (focusLevel - 1); i++)
{
@ -274,14 +272,14 @@ public class TETeleposer extends TileEntity implements IInventory
while (iterator1.hasNext())
{
entityplayer1 = (EntityLivingBase)iterator1.next();
entityplayer1 = (EntityLivingBase) iterator1.next();
entityplayer1.worldObj = worldF;
entityplayer1.setPositionAndUpdate(entityplayer1.posX - this.xCoord + xf, entityplayer1.posY - this.yCoord + yf, entityplayer1.posZ - this.zCoord + zf);
}
while (iterator2.hasNext())
{
entityplayer2 = (EntityLivingBase)iterator2.next();
entityplayer2 = (EntityLivingBase) iterator2.next();
entityplayer2.worldObj = worldF;
entityplayer2.setPositionAndUpdate(entityplayer2.posX + this.xCoord - xf, entityplayer2.posY + this.yCoord - yf, entityplayer2.posZ + this.zCoord - zf);
}
@ -325,8 +323,7 @@ public class TETeleposer extends TileEntity implements IInventory
{
ItemStack is = new ItemStack(intData[i * 3], intData[i * 3 + 2], intData[i * 3 + 1]);
inv[i] = is;
}
else
} else
{
inv[i] = null;
}
@ -336,7 +333,7 @@ public class TETeleposer extends TileEntity implements IInventory
public int[] buildIntDataList()
{
int [] sortList = new int[1 * 3];
int[] sortList = new int[1 * 3];
int pos = 0;
for (ItemStack is : inv)
@ -346,8 +343,7 @@ public class TETeleposer extends TileEntity implements IInventory
sortList[pos++] = is.itemID;
sortList[pos++] = is.getItemDamage();
sortList[pos++] = is.stackSize;
}
else
} else
{
sortList[pos++] = 0;
sortList[pos++] = 0;

View file

@ -1,9 +1,11 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import WayofTime.alchemicalWizardry.common.*;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemicalPotionCreationHandler;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemBlock;
@ -13,19 +15,12 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.tileentity.TileEntity;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.IBindingAgent;
import WayofTime.alchemicalWizardry.common.ICatalyst;
import WayofTime.alchemicalWizardry.common.IFillingAgent;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemicalPotionCreationHandler;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
import cpw.mods.fml.common.network.PacketDispatcher;
public class TEWritingTable extends TileEntity implements IInventory
{
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public class TEWritingTable extends TileEntity implements IInventory {
private ItemStack[] inv;
private int progress;
private int progressNeeded = 100;
@ -69,8 +64,7 @@ public class TEWritingTable extends TileEntity implements IInventory
if (stack.stackSize <= amt)
{
setInventorySlotContents(slot, null);
}
else
} else
{
stack = stack.splitStack(amt);
@ -110,10 +104,14 @@ public class TEWritingTable extends TileEntity implements IInventory
}
@Override
public void openChest() {}
public void openChest()
{
}
@Override
public void closeChest() {}
public void closeChest()
{
}
@Override
public void readFromNBT(NBTTagCompound tagCompound)
@ -197,8 +195,7 @@ public class TEWritingTable extends TileEntity implements IInventory
dos.writeDouble(y);
dos.writeDouble(z);
dos.writeShort(particleType);
}
catch (IOException e)
} catch (IOException e)
{
e.printStackTrace();
}
@ -221,8 +218,7 @@ public class TEWritingTable extends TileEntity implements IInventory
{
ItemStack is = new ItemStack(intData[i * 3], intData[i * 3 + 2], intData[i * 3 + 1]);
inv[i] = is;
}
else
} else
{
inv[i] = null;
}
@ -232,7 +228,7 @@ public class TEWritingTable extends TileEntity implements IInventory
public int[] buildIntDataList()
{
int [] sortList = new int[7 * 3];
int[] sortList = new int[7 * 3];
int pos = 0;
for (ItemStack is : inv)
@ -242,8 +238,7 @@ public class TEWritingTable extends TileEntity implements IInventory
sortList[pos++] = is.itemID;
sortList[pos++] = is.getItemDamage();
sortList[pos++] = is.stackSize;
}
else
} else
{
sortList[pos++] = 0;
sortList[pos++] = 0;
@ -268,7 +263,7 @@ public class TEWritingTable extends TileEntity implements IInventory
public boolean isRecipeValid()
{
return(getResultingItemStack() != null);
return (getResultingItemStack() != null);
}
public int getAmountNeeded(ItemStack bloodOrb)
@ -288,8 +283,7 @@ public class TEWritingTable extends TileEntity implements IInventory
if (getPotionFlaskPosition() != -1)
{
return true;
}
else
} else
{
return false;
}
@ -299,7 +293,7 @@ public class TEWritingTable extends TileEntity implements IInventory
{
for (int i = 1; i <= 5; i++)
{
if (inv[i] != null && !(inv[i].getItem() instanceof ItemBlock) && inv[i].itemID == AlchemicalWizardry.alchemyFlask.itemID)
if (inv[i] != null && !(inv[i].getItem() instanceof ItemBlock) && inv[i].itemID == ModItems.alchemyFlask.itemID)
{
return i;
}
@ -313,8 +307,7 @@ public class TEWritingTable extends TileEntity implements IInventory
if (getRegisteredPotionIngredientPosition() != -1)
{
return true;
}
else
} else
{
return false;
}
@ -422,7 +415,7 @@ public class TEWritingTable extends TileEntity implements IInventory
{
for (int i = 0; i < 5; i++)
{
if (inv[i + 1] != null && inv[i + 1].itemID == AlchemicalWizardry.blankSlate.itemID)
if (inv[i + 1] != null && inv[i + 1].itemID == ModItems.blankSlate.itemID)
{
return i + 1;
}
@ -459,7 +452,7 @@ public class TEWritingTable extends TileEntity implements IInventory
if (worldTime % 4 == 0)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short)1));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
}
if (progress >= progressNeeded)
@ -481,8 +474,8 @@ public class TEWritingTable extends TileEntity implements IInventory
}
int potionID = AlchemicalPotionCreationHandler.getPotionIDForStack(ingredientStack);
int catalystLevel = ((ICatalyst)catalystStack.getItem()).getCatalystLevel();
boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration();
int catalystLevel = ((ICatalyst) catalystStack.getItem()).getCatalystLevel();
boolean isConcentration = ((ICatalyst) catalystStack.getItem()).isConcentration();
if (potionID == -1 || catalystLevel < 0)
{
@ -498,11 +491,10 @@ public class TEWritingTable extends TileEntity implements IInventory
if (isConcentration)
{
((AlchemyFlask)flaskStack.getItem()).setConcentrationOfPotion(flaskStack, potionID, catalystLevel);
}
else
((AlchemyFlask) flaskStack.getItem()).setConcentrationOfPotion(flaskStack, potionID, catalystLevel);
} else
{
((AlchemyFlask)flaskStack.getItem()).setDurationFactorOfPotion(flaskStack, potionID, catalystLevel);
((AlchemyFlask) flaskStack.getItem()).setDurationFactorOfPotion(flaskStack, potionID, catalystLevel);
}
//((AlchemyFlask)flaskStack.getItem()).setConcentrationOfPotion(flaskStack, Potion.regeneration.id, 2);
@ -518,8 +510,7 @@ public class TEWritingTable extends TileEntity implements IInventory
}
}
}
}
else if (containsBindingAgent())
} else if (containsBindingAgent())
{
if (getStackInSlot(6) == null)
{
@ -527,7 +518,7 @@ public class TEWritingTable extends TileEntity implements IInventory
if (worldTime % 4 == 0)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short)1));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
}
if (progress >= progressNeeded)
@ -548,10 +539,10 @@ public class TEWritingTable extends TileEntity implements IInventory
return;
}
int potionEffectNumber = ((AlchemyFlask)flaskStack.getItem()).getNumberOfPotionEffects(flaskStack);
int potionEffectNumber = ((AlchemyFlask) flaskStack.getItem()).getNumberOfPotionEffects(flaskStack);
int potionID = AlchemicalPotionCreationHandler.getPotionIDForStack(ingredientStack);
int tickDuration = AlchemicalPotionCreationHandler.getPotionTickDurationForStack(ingredientStack);
float successChance = ((IBindingAgent)agentStack.getItem()).getSuccessRateForPotionNumber(potionEffectNumber);
float successChance = ((IBindingAgent) agentStack.getItem()).getSuccessRateForPotionNumber(potionEffectNumber);
//boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration();
if (potionID == -1)
@ -566,15 +557,14 @@ public class TEWritingTable extends TileEntity implements IInventory
return;
}
((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, potionID, tickDuration);
((AlchemyFlask) flaskStack.getItem()).addPotionEffect(flaskStack, potionID, tickDuration);
//((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, Potion.regeneration.id, 1000);
if (successChance > worldObj.rand.nextFloat())
{
this.setInventorySlotContents(6, flaskStack);
}
else
} else
{
worldObj.createExplosion(null, xCoord + 0.5, yCoord + 1, zCoord + 0.5, 2, false);
}
@ -591,8 +581,7 @@ public class TEWritingTable extends TileEntity implements IInventory
}
}
}
}
else if (this.containsBlankSlate() && this.containsPotionFlask())
} else if (this.containsBlankSlate() && this.containsPotionFlask())
{
if (getStackInSlot(6) == null)
{
@ -600,7 +589,7 @@ public class TEWritingTable extends TileEntity implements IInventory
if (worldTime % 4 == 0)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short)1));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
}
if (progress >= progressNeeded)
@ -622,7 +611,7 @@ public class TEWritingTable extends TileEntity implements IInventory
}
//boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration();
((AlchemyFlask)flaskStack.getItem()).setIsPotionThrowable(true, flaskStack);
((AlchemyFlask) flaskStack.getItem()).setIsPotionThrowable(true, flaskStack);
//((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, Potion.regeneration.id, 1000);
//if(successChance>worldObj.rand.nextFloat())
this.setInventorySlotContents(6, flaskStack);
@ -637,8 +626,7 @@ public class TEWritingTable extends TileEntity implements IInventory
}
}
}
}
else if (this.containsFillingAgent() && this.containsPotionFlask())
} else if (this.containsFillingAgent() && this.containsPotionFlask())
{
//TODO
if (getStackInSlot(6) == null)
@ -647,7 +635,7 @@ public class TEWritingTable extends TileEntity implements IInventory
if (worldTime % 4 == 0)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short)1));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
}
if (progress >= progressNeeded)
@ -669,8 +657,8 @@ public class TEWritingTable extends TileEntity implements IInventory
}
//boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration();
int potionEffects = ((AlchemyFlask)flaskStack.getItem()).getNumberOfPotionEffects(flaskStack);
int potionFillAmount = ((IFillingAgent)fillingAgent.getItem()).getFilledAmountForPotionNumber(potionEffects);
int potionEffects = ((AlchemyFlask) flaskStack.getItem()).getNumberOfPotionEffects(flaskStack);
int potionFillAmount = ((IFillingAgent) fillingAgent.getItem()).getFilledAmountForPotionNumber(potionEffects);
flaskStack.setItemDamage(Math.max(0, flaskStack.getItemDamage() - potionFillAmount));
//((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, Potion.regeneration.id, 1000);
//if(successChance>worldObj.rand.nextFloat())
@ -686,8 +674,7 @@ public class TEWritingTable extends TileEntity implements IInventory
}
}
}
}
else
} else
{
if (!isRecipeValid())
{
@ -710,7 +697,7 @@ public class TEWritingTable extends TileEntity implements IInventory
{
if (worldTime % 4 == 0)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short)1));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
}
if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed))
@ -735,12 +722,11 @@ public class TEWritingTable extends TileEntity implements IInventory
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
}
else if (getStackInSlot(6).getItem().itemID == getResultingItemStack().itemID && getResultingItemStack().stackSize <= (getStackInSlot(6).getMaxStackSize() - getStackInSlot(6).stackSize))
} else if (getStackInSlot(6).getItem().itemID == getResultingItemStack().itemID && getResultingItemStack().stackSize <= (getStackInSlot(6).getMaxStackSize() - getStackInSlot(6).stackSize))
{
if (worldTime % 4 == 0)
{
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short)1));
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
}
if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed))

View file

@ -7,8 +7,7 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerAltar extends Container
{
public class ContainerAltar extends Container {
protected TEAltar tileEntity;
public ContainerAltar(InventoryPlayer inventoryPlayer, TEAltar te)
@ -25,6 +24,7 @@ public class ContainerAltar extends Container
bindPlayerInventory(inventoryPlayer);
}
@Override
public boolean canInteractWith(EntityPlayer entityplayer)
{
@ -38,7 +38,7 @@ public class ContainerAltar extends Container
for (int j = 0; j < 9; j++)
{
addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,
8 + j * 18, 84 + i * 18));
8 + j * 18, 84 + i * 18));
}
}
@ -47,6 +47,7 @@ public class ContainerAltar extends Container
addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slot)
{
@ -76,8 +77,7 @@ public class ContainerAltar extends Container
if (stackInSlot.stackSize == 0)
{
slotObject.putStack(null);
}
else
} else
{
slotObject.onSlotChanged();
}

View file

@ -7,8 +7,7 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerTeleposer extends Container
{
public class ContainerTeleposer extends Container {
protected TETeleposer tileEntity;
public ContainerTeleposer(InventoryPlayer inventoryPlayer, TETeleposer te)
@ -88,8 +87,7 @@ public class ContainerTeleposer extends Container
if (stackInSlot.stackSize == 0)
{
slotObject.putStack(null);
}
else
} else
{
slotObject.onSlotChanged();
}

View file

@ -7,8 +7,7 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerWritingTable extends Container
{
public class ContainerWritingTable extends Container {
protected TEWritingTable tileEntity;
public ContainerWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable te)
@ -88,8 +87,7 @@ public class ContainerWritingTable extends Container
if (stackInSlot.stackSize == 0)
{
slotObject.putStack(null);
}
else
} else
{
slotObject.onSlotChanged();
}

View file

@ -4,13 +4,12 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable;
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
public class GuiHandler implements IGuiHandler
{
public class GuiHandler implements IGuiHandler {
//returns an instance of the Container you made earlier
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
@ -62,7 +61,7 @@ public class GuiHandler implements IGuiHandler
if (tileEntity instanceof TETeleposer)
{
return new GuiTeleposer(player.inventory, (TETeleposer)tileEntity);
return new GuiTeleposer(player.inventory, (TETeleposer) tileEntity);
}
break;

View file

@ -1,18 +1,15 @@
package WayofTime.alchemicalWizardry.common.tileEntity.gui;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer;
import net.minecraft.client.gui.inventory.GuiBrewingStand;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer;
public class GuiTeleposer extends GuiContainer
{
public class GuiTeleposer extends GuiContainer {
public GuiTeleposer(InventoryPlayer inventoryPlayer, TETeleposer tileEntity)
{
//the container is instanciated and passed to the superclass for handling

View file

@ -1,18 +1,15 @@
package WayofTime.alchemicalWizardry.common.tileEntity.gui;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable;
import net.minecraft.client.gui.inventory.GuiBrewingStand;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable;
public class GuiWritingTable extends GuiContainer
{
public class GuiWritingTable extends GuiContainer {
public GuiWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable tileEntity)
{
//the container is instanciated and passed to the superclass for handling