mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-27 21:48:34 +01:00
Compare commits
3 commits
ad981047d7
...
6b5c63059d
Author | SHA1 | Date | |
---|---|---|---|
6b5c63059d | |||
4d022f3489 | |||
6b4f86ce1a |
3 changed files with 7 additions and 6 deletions
|
@ -32,7 +32,7 @@ mod_name=PrettyPipes
|
|||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=MIT
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=1.16.0
|
||||
mod_version=1.16.1
|
||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||
# This should match the base package used for the mod sources.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
|
|
|
@ -21,6 +21,7 @@ import net.minecraft.world.item.ItemStack;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.saveddata.SavedData;
|
||||
import net.neoforged.neoforge.items.IItemHandler;
|
||||
import net.neoforged.neoforge.network.PacketDistributor;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.jgrapht.ListenableGraph;
|
||||
|
@ -339,7 +340,7 @@ public class PipeNetwork extends SavedData implements GraphListener<BlockPos, Ne
|
|||
if (!this.isNode(node))
|
||||
return Collections.emptyList();
|
||||
this.startProfile("get_network_items");
|
||||
List<NetworkLocation> info = new ArrayList<>();
|
||||
var ret = new HashMap<IItemHandler, NetworkLocation>();
|
||||
for (var dest : this.getOrderedNetworkNodes(node)) {
|
||||
if (!this.level.isLoaded(dest))
|
||||
continue;
|
||||
|
@ -349,15 +350,15 @@ public class PipeNetwork extends SavedData implements GraphListener<BlockPos, Ne
|
|||
if (handler == null || !pipe.canNetworkSee(dir, handler))
|
||||
continue;
|
||||
// check if this handler already exists (double-connected pipes, double chests etc.)
|
||||
if (info.stream().anyMatch(l -> handler.equals(l.getItemHandler(this.level))))
|
||||
if (ret.containsKey(handler))
|
||||
continue;
|
||||
var location = new NetworkLocation(dest, dir);
|
||||
if (!location.isEmpty(this.level))
|
||||
info.add(location);
|
||||
ret.put(handler, location);
|
||||
}
|
||||
}
|
||||
this.endProfile();
|
||||
return info;
|
||||
return new ArrayList<>(ret.values());
|
||||
}
|
||||
|
||||
public void createNetworkLock(NetworkLock lock) {
|
||||
|
|
|
@ -45,7 +45,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class PipeBlock extends BaseEntityBlock {
|
||||
public class PipeBlock extends BaseEntityBlock implements SimpleWaterloggedBlock {
|
||||
|
||||
public static final MapCodec<PipeBlock> CODEC = BlockBehaviour.simpleCodec(PipeBlock::new);
|
||||
|
||||
|
|
Loading…
Reference in a new issue