Fix duplication glitch (cherry-pick 8a72ebca8925959bce8809e690f0fb4772ce8c8e)
This commit is contained in:
parent
5d0748aade
commit
dd14ac0f79
|
@ -106,9 +106,9 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||||
@Override
|
@Override
|
||||||
public void securityBreak()
|
public void securityBreak()
|
||||||
{
|
{
|
||||||
if( this.getItemStack().stackSize > 0 )
|
if( this.getItemStack().stackSize > 0 && this.getGridNode() != null )
|
||||||
{
|
{
|
||||||
final List<ItemStack> items = new ArrayList<ItemStack>();
|
final List<ItemStack> items = new ArrayList<>();
|
||||||
items.add( this.getItemStack().copy() );
|
items.add( this.getItemStack().copy() );
|
||||||
this.host.removePart( this.getSide(), false );
|
this.host.removePart( this.getSide(), false );
|
||||||
Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items );
|
Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items );
|
||||||
|
|
|
@ -31,7 +31,6 @@ import appeng.client.texture.CableBusTextures;
|
||||||
import appeng.helpers.Reflected;
|
import appeng.helpers.Reflected;
|
||||||
import appeng.me.helpers.AENetworkProxy;
|
import appeng.me.helpers.AENetworkProxy;
|
||||||
import appeng.parts.PartBasicState;
|
import appeng.parts.PartBasicState;
|
||||||
import appeng.util.Platform;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
@ -43,9 +42,7 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public class PartToggleBus extends PartBasicState
|
public class PartToggleBus extends PartBasicState
|
||||||
|
@ -96,19 +93,6 @@ public class PartToggleBus extends PartBasicState
|
||||||
return AECableType.GLASS;
|
return AECableType.GLASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void securityBreak()
|
|
||||||
{
|
|
||||||
if( this.getItemStack().stackSize > 0 )
|
|
||||||
{
|
|
||||||
final List<ItemStack> items = new ArrayList<ItemStack>();
|
|
||||||
items.add( this.getItemStack().copy() );
|
|
||||||
this.getHost().removePart( this.getSide(), false );
|
|
||||||
Platform.spawnDrops( this.getTile().getWorldObj(), this.getTile().xCoord, this.getTile().yCoord, this.getTile().zCoord, items );
|
|
||||||
this.getItemStack().stackSize = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getBoxes( final IPartCollisionHelper bch )
|
public void getBoxes( final IPartCollisionHelper bch )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue