mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-11 13:04:19 +01:00
Filter redundancy
- Brass tunnels now distribute across matching filtered outputs exclusively before sending items to unfiltered sides - Less chute logic on render thread pls
This commit is contained in:
parent
b24648b431
commit
a49aad24c2
@ -138,9 +138,12 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity {
|
|||||||
if (stackToDistribute.isEmpty())
|
if (stackToDistribute.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
for (boolean filterPass : Iterate.trueAndFalse) {
|
||||||
for (Pair<BrassTunnelTileEntity, Direction> pair : validOutputs) {
|
for (Pair<BrassTunnelTileEntity, Direction> pair : validOutputs) {
|
||||||
BrassTunnelTileEntity tunnel = pair.getKey();
|
BrassTunnelTileEntity tunnel = pair.getKey();
|
||||||
Direction output = pair.getValue();
|
Direction output = pair.getValue();
|
||||||
|
if (filterPass && tunnel.flapFilterEmpty(output))
|
||||||
|
continue;
|
||||||
if (insertIntoTunnel(tunnel, output, stackToDistribute, true) == null)
|
if (insertIntoTunnel(tunnel, output, stackToDistribute, true) == null)
|
||||||
continue;
|
continue;
|
||||||
distributionTargets.add(Pair.of(tunnel.pos, output));
|
distributionTargets.add(Pair.of(tunnel.pos, output));
|
||||||
@ -151,6 +154,10 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity {
|
|||||||
distributionDistanceRight = Math.max(distributionDistanceRight, distance);
|
distributionDistanceRight = Math.max(distributionDistanceRight, distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!distributionTargets.isEmpty() && filterPass)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (distributionTargets.isEmpty())
|
if (distributionTargets.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -317,6 +324,21 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity {
|
|||||||
return filtering.test(side, stack);
|
return filtering.test(side, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean flapFilterEmpty(Direction side) {
|
||||||
|
if (filtering == null)
|
||||||
|
return false;
|
||||||
|
if (filtering.get(side) == null) {
|
||||||
|
FilteringBehaviour adjacentFilter =
|
||||||
|
TileEntityBehaviour.get(world, pos.offset(side), FilteringBehaviour.TYPE);
|
||||||
|
if (adjacentFilter == null)
|
||||||
|
return true;
|
||||||
|
return adjacentFilter.getFilter()
|
||||||
|
.isEmpty();
|
||||||
|
}
|
||||||
|
return filtering.getFilter(side)
|
||||||
|
.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
if (filtering == null) {
|
if (filtering == null) {
|
||||||
|
@ -134,6 +134,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
|||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
|
|
||||||
|
if (!world.isRemote)
|
||||||
canPickUpItems = canDirectlyInsert();
|
canPickUpItems = canDirectlyInsert();
|
||||||
|
|
||||||
float itemMotion = getItemMotion();
|
float itemMotion = getItemMotion();
|
||||||
|
Loading…
Reference in New Issue
Block a user