fixed pipe items getting stuck in single-pipe networks

Closes #60
This commit is contained in:
Ell 2020-11-26 02:21:32 +01:00
parent 78deb87993
commit 8ef981d50c

View file

@ -6,42 +6,33 @@ import de.ellpeck.prettypipes.Utility;
import de.ellpeck.prettypipes.pipe.IPipeConnectable;
import de.ellpeck.prettypipes.pipe.IPipeItem;
import de.ellpeck.prettypipes.pipe.PipeTileEntity;
import joptsimple.internal.Strings;
import net.minecraft.block.BlockState;
import net.minecraft.block.ILiquidContainer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.FluidState;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.INBTSerializable;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import org.jgrapht.Graph;
import org.jgrapht.GraphPath;
import java.util.*;
import java.util.function.BiFunction;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.function.Consumer;
public class PipeItem implements IPipeItem {
@ -144,7 +135,7 @@ public class PipeItem implements IPipeItem {
// we're past the start of the pipe, so move to the center of the next pipe
BlockPos nextPos;
PipeTileEntity next = this.getNextTile(currPipe, false);
if (next == null) {
if (next == null || next == currPipe) {
if (currPipe.getPos().equals(this.getDestPipe())) {
nextPos = this.destInventory;
} else {