Transport-Lib Mod provides a simple framework for creating custom pipe and transport networks for any type of resource. This mod gives other projects a foundation to handle how items, fluids, energy, or mana move across connected blocks. It includes default settings for resource loss, custom transfer handlers, and client syncing for visual displays.

Transport-Lib Mod

Features:

  • Calculates resource loss per block traveled, such as energy dropping over distance or fluids leaking from pipes.
  • Uses custom transport handlers to manage how resources merge together or split apart inside the network.
  • Syncs resource amounts to the client side so players can see visual displays of what is inside the pipes.
  • Includes network registration options for setting transfer speeds, loss values, and block entity checks.

Configuration:

Below is a code example showing how to register a custom mana network:

public static final DeferredHolder<TransportNetwork, TransportNetworkImpl<Integer>> MANA_NETWORK = NETWORKS.register("mana",
        () -> TransportNetworkImpl.builder(ManaTransportingHandler.INSTANCE)
                .synced(ByteBufCodecs.INT)
                .lossPerBlock((level, node) -> 1f)
                .transferSpeed(TransferSpeed::instant)
                .interactorCheck(((level, pos, direction) -> level.getBlockEntity(pos.relative(direction)) instanceof ManaBatteryBlockEntity))
                .build());

Requirements:

Transport-Lib Mod Download Links

For Minecraft 1.21.1, 1.21

Click to rate this post!
[Total: 0 Average: 0]