Skip to content

Commit

Permalink
Set BUFFER as default connection type for vanilla tile entities
Browse files Browse the repository at this point in the history
This was changed to INSERT in eb7c87b in an attempt to improve performance for setups where users accidentally left default settings. This should no longer be necessary since 52a6149 .
Using BUFFER as default connection type is also more user-friendly, as the side-configuration of vanilla tile entities can only be changed via cable connections or wrench, preventing simple setups like chest on top of custom block for input from working.
  • Loading branch information
NichtStudioCode committed Aug 21, 2024
1 parent 9d1859f commit 78155bf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import xyz.xenondevs.commons.collections.enumMap
import xyz.xenondevs.commons.collections.enumSet
import xyz.xenondevs.commons.provider.Provider
import xyz.xenondevs.commons.provider.mutable.defaultsToLazily
import xyz.xenondevs.nova.util.CUBE_FACES
import xyz.xenondevs.nova.world.block.tileentity.network.type.NetworkConnectionType
import xyz.xenondevs.nova.world.block.tileentity.network.type.item.ItemFilter
import xyz.xenondevs.nova.world.block.tileentity.network.type.item.holder.DefaultItemHolder.Companion.DEFAULT_CHANNELS
import xyz.xenondevs.nova.world.block.tileentity.network.type.item.inventory.NetworkedInventory
import xyz.xenondevs.nova.util.CUBE_FACES

internal abstract class VanillaItemHolder(
compound: Provider<Compound>
) : ItemHolder {

override val mergedInventory: NetworkedInventory? = null

override val connectionConfig: MutableMap<BlockFace, NetworkConnectionType> by
compound.entry<MutableMap<BlockFace, NetworkConnectionType>>("connectionConfig")
.defaultsToLazily { CUBE_FACES.associateWithTo(enumMap()) { NetworkConnectionType.INSERT } }
override val connectionConfig: MutableMap<BlockFace, NetworkConnectionType>
by compound.entry<MutableMap<BlockFace, NetworkConnectionType>>("connectionConfig")
.defaultsToLazily { CUBE_FACES.associateWithTo(enumMap()) { NetworkConnectionType.BUFFER } }

override val allowedFaces: Set<BlockFace>
get() = connectionConfig.mapNotNullTo(enumSet()) { (face, type) ->
Expand Down

0 comments on commit 78155bf

Please sign in to comment.