some more slight API changes

This commit is contained in:
Ell 2020-10-18 01:57:51 +02:00
parent b46fd3be72
commit d4a895fcde
2 changed files with 6 additions and 2 deletions

View file

@ -284,6 +284,10 @@ public class PipeItem implements INBTSerializable<CompoundNBT> {
this.path.add(NBTUtil.readBlockPos(list.getCompound(i))); this.path.add(NBTUtil.readBlockPos(list.getCompound(i)));
} }
public int getItemsOnTheWay(BlockPos goalInv){
return this.stack.getCount();
}
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public void render(PipeTileEntity tile, MatrixStack matrixStack, Random random, float partialTicks, int light, int overlay, IRenderTypeBuffer buffer) { public void render(PipeTileEntity tile, MatrixStack matrixStack, Random random, float partialTicks, int light, int overlay, IRenderTypeBuffer buffer) {
matrixStack.translate( matrixStack.translate(

View file

@ -444,7 +444,7 @@ public class PipeNetwork implements ICapabilitySerializable<CompoundNBT>, GraphL
return this.pipeItems.get(pos); return this.pipeItems.get(pos);
} }
private Stream<PipeItem> getPipeItemsOnTheWay(BlockPos goalInv) { public Stream<PipeItem> getPipeItemsOnTheWay(BlockPos goalInv) {
this.startProfile("get_pipe_items_on_the_way"); this.startProfile("get_pipe_items_on_the_way");
Stream<PipeItem> ret = this.pipeItems.values().stream().filter(i -> i.getDestInventory().equals(goalInv)); Stream<PipeItem> ret = this.pipeItems.values().stream().filter(i -> i.getDestInventory().equals(goalInv));
this.endProfile(); this.endProfile();
@ -454,7 +454,7 @@ public class PipeNetwork implements ICapabilitySerializable<CompoundNBT>, GraphL
public int getItemsOnTheWay(BlockPos goalInv, ItemStack type, ItemEqualityType... equalityTypes) { public int getItemsOnTheWay(BlockPos goalInv, ItemStack type, ItemEqualityType... equalityTypes) {
return this.getPipeItemsOnTheWay(goalInv) return this.getPipeItemsOnTheWay(goalInv)
.filter(i -> type == null || ItemEqualityType.compareItems(i.stack, type, equalityTypes)) .filter(i -> type == null || ItemEqualityType.compareItems(i.stack, type, equalityTypes))
.mapToInt(i -> i.stack.getCount()).sum(); .mapToInt(i -> i.getItemsOnTheWay(goalInv)).sum();
} }
@Override @Override