Random stuffs

Updated commands
Added in a ritual hologram --Alex's code
Added a Total Stones tooltip to the ritual diviner
Gave the Alchemy Relay a null bounding box
Added localizations to the blocks that didn't have any
This commit is contained in:
Arcaratus 2015-04-18 19:49:09 -04:00
parent 003a65a51b
commit 31f552fe2d
87 changed files with 2513 additions and 682 deletions

View file

@ -4,18 +4,15 @@ import java.util.List;
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;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
@ -352,7 +349,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
return 0;
}
if (resource.fluidID != (new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 1)).fluidID)
if (resource.getFluidID() != (new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 1)).getFluidID())
{
return 0;
}
@ -917,7 +914,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
sortList[1] = 0;
} else
{
sortList[0] = this.fluid.fluidID;
sortList[0] = this.fluid.getFluidID();
sortList[1] = this.fluid.amount;
}
@ -927,7 +924,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
sortList[3] = 0;
} else
{
sortList[2] = this.fluidInput.fluidID;
sortList[2] = this.fluidInput.getFluidID();
sortList[3] = this.fluidInput.amount;
}
@ -937,7 +934,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
sortList[5] = 0;
} else
{
sortList[4] = this.fluidOutput.fluidID;
sortList[4] = this.fluidOutput.getFluidID();
sortList[5] = this.fluidOutput.amount;
}

View file

@ -10,144 +10,146 @@ import net.minecraftforge.common.util.Constants;
/**
* Base class for tile entities with inventory
*
* @author ljfa-ag
*/
public abstract class TEInventory extends TileEntity implements IInventory
{
protected ItemStack[] inv;
public TEInventory(int size)
{
inv = new ItemStack[size];
}
protected ItemStack[] inv;
@Override
public int getSizeInventory()
{
return inv.length;
}
public TEInventory(int size)
{
inv = new ItemStack[size];
}
public ItemStack[] getSlots()
{
return inv;
}
@Override
public int getSizeInventory()
{
return inv.length;
}
@Override
public ItemStack getStackInSlot(int slot)
{
return inv[slot];
}
public ItemStack[] getSlots()
{
return inv;
}
@Override
public ItemStack decrStackSize(int slot, int amt)
{
ItemStack stack = getStackInSlot(slot);
if (stack != null)
{
if (stack.stackSize <= amt)
setInventorySlotContents(slot, null);
else
{
stack = stack.splitStack(amt);
if (stack.stackSize == 0)
setInventorySlotContents(slot, null);
}
}
return stack;
}
@Override
public ItemStack getStackInSlot(int slot)
{
return inv[slot];
}
@Override
public ItemStack getStackInSlotOnClosing(int slot)
{
ItemStack stack = getStackInSlot(slot);
if (stack != null)
setInventorySlotContents(slot, null);
return stack;
}
@Override
public ItemStack decrStackSize(int slot, int amt)
{
ItemStack stack = getStackInSlot(slot);
if (stack != null)
{
if (stack.stackSize <= amt)
setInventorySlotContents(slot, null);
else
{
stack = stack.splitStack(amt);
if (stack.stackSize == 0)
setInventorySlotContents(slot, null);
}
}
return stack;
}
@Override
public void setInventorySlotContents(int slot, ItemStack stack)
{
inv[slot] = stack;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
if (stack != null && stack.stackSize > getInventoryStackLimit())
stack.stackSize = getInventoryStackLimit();
}
@Override
public ItemStack getStackInSlotOnClosing(int slot)
{
ItemStack stack = getStackInSlot(slot);
if (stack != null)
setInventorySlotContents(slot, null);
return stack;
}
@Override
public abstract String getInventoryName();
@Override
public void setInventorySlotContents(int slot, ItemStack stack)
{
inv[slot] = stack;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
if (stack != null && stack.stackSize > getInventoryStackLimit())
stack.stackSize = getInventoryStackLimit();
}
@Override
public boolean hasCustomInventoryName()
{
return false;
}
@Override
public abstract String getInventoryName();
@Override
public int getInventoryStackLimit()
{
return 64;
}
@Override
public boolean hasCustomInventoryName()
{
return false;
}
@Override
public boolean isUseableByPlayer(EntityPlayer player)
{
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this
&& player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64;
}
@Override
public int getInventoryStackLimit()
{
return 64;
}
@Override
public void openInventory()
{
}
@Override
public boolean isUseableByPlayer(EntityPlayer player)
{
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this
&& player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64;
}
@Override
public void closeInventory()
{
}
@Override
public void openInventory()
{
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack)
{
return true;
}
@Override
public void closeInventory()
{
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT(tag);
NBTTagList invList = new NBTTagList();
for (int i = 0; i < inv.length; i++)
{
if (inv[i] != null)
{
NBTTagCompound stackTag = new NBTTagCompound();
stackTag.setByte("Slot", (byte) i);
inv[i].writeToNBT(stackTag);
invList.appendTag(stackTag);
}
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack)
{
return true;
}
tag.setTag("Inventory", invList);
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
super.readFromNBT(tag);
NBTTagList invList = tag.getTagList("Inventory", Constants.NBT.TAG_COMPOUND);
for(int i = 0; i < invList.tagCount(); i++)
@Override
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT(tag);
NBTTagList invList = new NBTTagList();
for (int i = 0; i < inv.length; i++)
{
if (inv[i] != null)
{
NBTTagCompound stackTag = new NBTTagCompound();
stackTag.setByte("Slot", (byte) i);
inv[i].writeToNBT(stackTag);
invList.appendTag(stackTag);
}
}
tag.setTag("Inventory", invList);
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
super.readFromNBT(tag);
NBTTagList invList = tag.getTagList("Inventory",
Constants.NBT.TAG_COMPOUND);
for (int i = 0; i < invList.tagCount(); i++)
{
NBTTagCompound stackTag = invList.getCompoundTagAt(i);
int slot = stackTag.getByte("Slot");
if(slot >= 0 && slot < inv.length)
if (slot >= 0 && slot < inv.length)
inv[slot] = ItemStack.loadItemStackFromNBT(stackTag);
}
}
public void clear()
{
}
public void clear()
{
inv = new ItemStack[inv.length];
}
}

View file

@ -1,17 +1,12 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import net.minecraft.entity.effect.EntityLightningBolt;
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;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class TEPedestal extends TEInventory
{

View file

@ -1,14 +1,9 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistryComponent;
import WayofTime.alchemicalWizardry.common.IDemon;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
import WayofTime.alchemicalWizardry.common.PlinthComponent;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@ -18,9 +13,12 @@ import net.minecraft.network.Packet;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.List;
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistryComponent;
import WayofTime.alchemicalWizardry.common.IDemon;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
import WayofTime.alchemicalWizardry.common.PlinthComponent;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
public class TEPlinth extends TEInventory
{

View file

@ -1,16 +1,11 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
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;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
public class TESocket extends TEInventory
{

View file

@ -1,24 +1,19 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import java.util.Iterator;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.Packet;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
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;
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;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import java.util.Iterator;
import java.util.List;
public class TETeleposer extends TEInventory
{

View file

@ -1,15 +1,10 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.ModItems;