Merge pull request #3 from Pokefenn/master
Massive rework of configs, items and blocks.
This commit is contained in:
commit
f925cdb4eb
267 changed files with 3638 additions and 4494 deletions
|
@ -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,21 +19,11 @@ 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.*;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFluidHandler
|
||||
{
|
||||
|
@ -189,8 +180,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
if (fluid != null)
|
||||
{
|
||||
fluid.writeToNBT(par1NBTTagCompound);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
par1NBTTagCompound.setString("Empty", "");
|
||||
}
|
||||
|
@ -247,8 +237,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 +405,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
{
|
||||
fluidInput.amount += resource.amount;
|
||||
filled = resource.amount;
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
fluidInput.amount = bufferCapacity;
|
||||
}
|
||||
|
@ -483,7 +471,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 +499,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 +513,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 +526,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 +536,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 +546,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 +570,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 +587,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 +603,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 +624,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 +680,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 +703,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 +718,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 +728,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 +778,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 +796,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 +811,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 +825,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 +839,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 +856,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 +871,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 +885,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 +918,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 +955,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 +994,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 +1010,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 +1018,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 +1032,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 +1046,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 +1078,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 +1109,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 +1123,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 +1153,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 +1234,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 +1398,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()};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ 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
|
||||
{
|
||||
|
|
|
@ -53,7 +53,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 +70,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 +87,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 +104,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 +128,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 +143,7 @@ public class TEHomHeart extends TileEntity
|
|||
|
||||
if (tileEntity instanceof TileEntitySkull)
|
||||
{
|
||||
int skullType = ((TileEntitySkull)tileEntity).getSkullType();
|
||||
int skullType = ((TileEntitySkull) tileEntity).getSkullType();
|
||||
|
||||
switch (skullType)
|
||||
{
|
||||
|
|
|
@ -1,11 +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)
|
||||
|
|
|
@ -1,31 +1,12 @@
|
|||
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
|
||||
{
|
||||
|
@ -92,7 +73,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 +96,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 +121,7 @@ public class TEMasterStone extends TileEntity
|
|||
return;
|
||||
}
|
||||
|
||||
int worldTime = (int)(worldObj.getWorldTime() % 24000);
|
||||
int worldTime = (int) (worldObj.getWorldTime() % 24000);
|
||||
|
||||
if (worldObj.isRemote)
|
||||
{
|
||||
|
@ -150,7 +131,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)
|
||||
{
|
||||
|
|
|
@ -96,8 +96,7 @@ public class TEPedestal extends TileEntity implements IInventory
|
|||
if (stack.stackSize <= amt)
|
||||
{
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
stack = stack.splitStack(amt);
|
||||
|
||||
|
@ -209,8 +208,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 +218,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 +228,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 +257,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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,13 +17,9 @@ 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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TEPlinth extends TileEntity implements IInventory
|
||||
{
|
||||
|
@ -204,8 +204,7 @@ public class TEPlinth extends TileEntity implements IInventory
|
|||
if (stack.stackSize <= amt)
|
||||
{
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
stack = stack.splitStack(amt);
|
||||
|
||||
|
@ -294,7 +293,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 +304,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 +313,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 +350,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 +376,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 +408,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 +426,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 +454,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 +470,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 +479,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 +490,7 @@ public class TEPlinth extends TileEntity implements IInventory
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
|
@ -511,7 +502,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 +518,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 +527,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 +560,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 +577,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 +618,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 +628,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 +638,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;
|
||||
|
|
|
@ -1,31 +1,13 @@
|
|||
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
|
||||
{
|
||||
|
@ -112,8 +94,7 @@ public class TESocket extends TileEntity implements IInventory
|
|||
if (stack.stackSize <= amt)
|
||||
{
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
stack = stack.splitStack(amt);
|
||||
|
||||
|
@ -225,8 +206,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 +216,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 +226,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;
|
||||
|
|
|
@ -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,10 +14,9 @@ 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;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class TETeleposer extends TileEntity implements IInventory
|
||||
{
|
||||
|
@ -107,8 +107,7 @@ public class TETeleposer extends TileEntity implements IInventory
|
|||
if (stack.stackSize <= amt)
|
||||
{
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
stack = stack.splitStack(amt);
|
||||
|
||||
|
@ -199,15 +198,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 +214,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 +235,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 +273,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 +324,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 +334,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 +344,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;
|
||||
|
|
|
@ -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,16 +15,10 @@ 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;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class TEWritingTable extends TileEntity implements IInventory
|
||||
{
|
||||
|
@ -69,8 +65,7 @@ public class TEWritingTable extends TileEntity implements IInventory
|
|||
if (stack.stackSize <= amt)
|
||||
{
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
stack = stack.splitStack(amt);
|
||||
|
||||
|
@ -110,10 +105,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 +196,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 +219,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 +229,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 +239,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 +264,7 @@ public class TEWritingTable extends TileEntity implements IInventory
|
|||
|
||||
public boolean isRecipeValid()
|
||||
{
|
||||
return(getResultingItemStack() != null);
|
||||
return (getResultingItemStack() != null);
|
||||
}
|
||||
|
||||
public int getAmountNeeded(ItemStack bloodOrb)
|
||||
|
@ -288,8 +284,7 @@ public class TEWritingTable extends TileEntity implements IInventory
|
|||
if (getPotionFlaskPosition() != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -299,7 +294,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 +308,7 @@ public class TEWritingTable extends TileEntity implements IInventory
|
|||
if (getRegisteredPotionIngredientPosition() != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -422,7 +416,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 +453,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 +475,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 +492,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 +511,7 @@ public class TEWritingTable extends TileEntity implements IInventory
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (containsBindingAgent())
|
||||
} else if (containsBindingAgent())
|
||||
{
|
||||
if (getStackInSlot(6) == null)
|
||||
{
|
||||
|
@ -527,7 +519,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 +540,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 +558,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 +582,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 +590,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 +612,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 +627,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 +636,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 +658,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 +675,7 @@ public class TEWritingTable extends TileEntity implements IInventory
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
if (!isRecipeValid())
|
||||
{
|
||||
|
@ -710,7 +698,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 +723,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))
|
||||
|
|
|
@ -25,6 +25,7 @@ public class ContainerAltar extends Container
|
|||
|
||||
bindPlayerInventory(inventoryPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
|
@ -38,7 +39,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 +48,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 +78,7 @@ public class ContainerAltar extends Container
|
|||
if (stackInSlot.stackSize == 0)
|
||||
{
|
||||
slotObject.putStack(null);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
slotObject.onSlotChanged();
|
||||
}
|
||||
|
|
|
@ -88,8 +88,7 @@ public class ContainerTeleposer extends Container
|
|||
if (stackInSlot.stackSize == 0)
|
||||
{
|
||||
slotObject.putStack(null);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
slotObject.onSlotChanged();
|
||||
}
|
||||
|
|
|
@ -88,8 +88,7 @@ public class ContainerWritingTable extends Container
|
|||
if (stackInSlot.stackSize == 0)
|
||||
{
|
||||
slotObject.putStack(null);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
slotObject.onSlotChanged();
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@ 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
|
||||
{
|
||||
|
@ -62,7 +62,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;
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
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 GuiTeleposer(InventoryPlayer inventoryPlayer, TETeleposer tileEntity)
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
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 GuiWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable tileEntity)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue