mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-22 19:58:35 +01:00
some more slight API changes
This commit is contained in:
parent
b46fd3be72
commit
d4a895fcde
2 changed files with 6 additions and 2 deletions
|
@ -284,6 +284,10 @@ public class PipeItem implements INBTSerializable<CompoundNBT> {
|
|||
this.path.add(NBTUtil.readBlockPos(list.getCompound(i)));
|
||||
}
|
||||
|
||||
public int getItemsOnTheWay(BlockPos goalInv){
|
||||
return this.stack.getCount();
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void render(PipeTileEntity tile, MatrixStack matrixStack, Random random, float partialTicks, int light, int overlay, IRenderTypeBuffer buffer) {
|
||||
matrixStack.translate(
|
||||
|
|
|
@ -444,7 +444,7 @@ public class PipeNetwork implements ICapabilitySerializable<CompoundNBT>, GraphL
|
|||
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");
|
||||
Stream<PipeItem> ret = this.pipeItems.values().stream().filter(i -> i.getDestInventory().equals(goalInv));
|
||||
this.endProfile();
|
||||
|
@ -454,7 +454,7 @@ public class PipeNetwork implements ICapabilitySerializable<CompoundNBT>, GraphL
|
|||
public int getItemsOnTheWay(BlockPos goalInv, ItemStack type, ItemEqualityType... equalityTypes) {
|
||||
return this.getPipeItemsOnTheWay(goalInv)
|
||||
.filter(i -> type == null || ItemEqualityType.compareItems(i.stack, type, equalityTypes))
|
||||
.mapToInt(i -> i.stack.getCount()).sum();
|
||||
.mapToInt(i -> i.getItemsOnTheWay(goalInv)).sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue