@Override
public void updateEntity() {
ItemStack jar = getStackInSlot(0);
if (jar != null && jar.getItem() instanceof ItemJarFilled) {
if (!worldObj.isRemote) {
ItemJarFilled item = (ItemJarFilled) jar.getItem();
AspectList aspectList = item.getAspects(jar);
if (aspectList != null && aspectList.size() == 1) {
Aspect aspect = aspectList.getAspects()[0];
TileEntity tile = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
if (tile != null && tile instanceof TileEntityHopper) {
TileEntity tile1 = getHopperFacing(tile.xCoord, tile.yCoord, tile.zCoord, tile.getBlockMetadata());
if (tile1 instanceof TileJarFillable) {
TileJarFillable jar1 = (TileJarFillable) tile1;
boolean voidJar = tile1 instanceof TileJarFillableVoid;
AspectList aspectList1 = jar1.getAspects();
//noinspection ConstantConditions
if (aspectList1 != null && aspectList1.size() == 0 && (jar1.aspectFilter == null || jar1.aspectFilter == aspect) || aspectList1.getAspects()[0] == aspect && (aspectList1.getAmount(aspectList1.getAspects()[0]) < 64 || voidJar)) {
jar1.addToContainer(aspect, 1);
item.setAspects(jar, aspectList.remove(aspect, 1));
}
}
}
}
}