Closes #1283: Add custom Callable to prevent memory leaks

This commit is contained in:
yueh
2015-08-06 23:30:26 +02:00
committed by thatsIch
parent 20a6e7631f
commit 621952e37d
10 changed files with 163 additions and 77 deletions
@@ -19,12 +19,12 @@
package appeng.tile.spatial;
import java.util.concurrent.Callable;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
import appeng.api.config.YesNo;
@@ -46,10 +46,11 @@ import appeng.tile.events.TileEventType;
import appeng.tile.grid.AENetworkInvTile;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.inventory.InvOperation;
import appeng.util.IWorldCallable;
import appeng.util.Platform;
public class TileSpatialIOPort extends AENetworkInvTile implements Callable
public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallable<Void>
{
final int[] sides = { 0, 1 };
@@ -122,9 +123,8 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable
}
@Override
public Object call() throws Exception
public Void call( World world ) throws Exception
{
ItemStack cell = this.getStackInSlot( 0 );
if( this.isSpatialCell( cell ) && this.getStackInSlot( 1 ) == null )
{