Fix duplication glitch (cherry-pick 8a72ebca8925959bce8809e690f0fb4772ce8c8e)

This commit is contained in:
Sirse 2019-05-14 22:28:54 +07:00
parent 5d0748aade
commit dd14ac0f79
2 changed files with 2 additions and 18 deletions

View File

@ -106,9 +106,9 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
@Override
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() );
this.host.removePart( this.getSide(), false );
Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items );

View File

@ -31,7 +31,6 @@ import appeng.client.texture.CableBusTextures;
import appeng.helpers.Reflected;
import appeng.me.helpers.AENetworkProxy;
import appeng.parts.PartBasicState;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.RenderBlocks;
@ -43,9 +42,7 @@ import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
public class PartToggleBus extends PartBasicState
@ -96,19 +93,6 @@ public class PartToggleBus extends PartBasicState
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
public void getBoxes( final IPartCollisionHelper bch )
{