- Jars are ugly (Void jar stuff)

This commit is contained in:
HellFirePvP committed 2016-04-19 01:37:05 +02:00
1 parent 6760c8146c
commit b7a3d302b9
3 files changed
+19 -3

No files matched your search

@@ -39,6 +39,7 @@ import java.util.Map;
* Created by makeo @ 13.07.2015 15:42
*/
public class BlockStickyJar extends BlockJar implements IBlockTransparent {
public BlockStickyJar() {
setCreativeTab(null);
}
@@ -208,8 +209,15 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent {
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile != null && tile instanceof TileStickyJar && ((TileStickyJar) tile).isValid()) {
((TileStickyJar) tile).getParent().validate(); //Ugh...
world.setTileEntity(x, y, z, ((TileStickyJar) tile).getParent()); //Ugh. that fix...
ArrayList<ItemStack> drops = ((TileStickyJar) tile).getParentBlock()
.getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), fortune);
.getDrops(world, x, y, z, ((TileStickyJar) tile).getParentMetadata(), fortune);
((TileStickyJar) tile).getParent().invalidate(); //Uhm...
world.setTileEntity(x, y, z, tile); //Revert. xD
boolean found = false;
for (ItemStack drop : drops) {
@@ -225,7 +225,7 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
//Special to inputTile only!
private void handleIO() {
if ((!worldObj.isRemote) && ((ticksExisted % 40) == 0) && (getEssentiaAmount() < getMaxAmount())) {
if ((!worldObj.isRemote) && ((ticksExisted & 15) == 0) && (getEssentiaAmount() < getMaxAmount())) {
TileEntity te = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.DOWN);
if (te != null) {
IEssentiaTransport ic = (IEssentiaTransport) te;
@@ -14,6 +14,7 @@ import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IEssentiaTransport;
import thaumcraft.common.tiles.TileJarFillable;
import thaumcraft.common.tiles.TileJarFillableVoid;
import java.lang.reflect.Field;
@@ -94,6 +95,10 @@ public class TileStickyJar extends TileJarFillable {
sync(parent, this);
}
public Integer getParentMetadata() {
return parentMetadata;
}
private int count;
@Override
@@ -112,7 +117,10 @@ public class TileStickyJar extends TileJarFillable {
syncToParent();
if ((!this.worldObj.isRemote) && (++this.count % 5 == 0) && (this.amount < this.maxAmount)) {
boolean canTakeEssentia = this.amount < this.maxAmount;
if(parent instanceof TileJarFillableVoid) canTakeEssentia = true;
if ((!this.worldObj.isRemote) && (++this.count % 5 == 0) && canTakeEssentia) {
fillJar();
}