Package codechicken.multipart.api
Class RedstoneInteractions
java.lang.Object
codechicken.multipart.api.RedstoneInteractions
static helper class for calculating various things about redstone.
Indirect power (also known as strong power) is not handled here, just use world.getIndirectPowerTo
Masks are defined in IRedstoneConnector
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intconnectionMask(MultiPart p, int side) Get the connection mask of part on sidestatic intgetConnectionMask(net.minecraft.world.level.LevelReader world, net.minecraft.core.BlockPos pos, int side, boolean power) static intgetPower(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, int side, int mask) Get the direct power level provided by space (pos) on side with maskstatic intgetPowerTo(MultiPart p, int side) Get the direct power to p on sidestatic intgetPowerTo(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, int side, int mask) Get the direct power level to space (pos) on side with maskstatic intotherConnectionMask(net.minecraft.world.level.LevelReader world, net.minecraft.core.BlockPos pos, int side, boolean power) Get the connection mask of the block on side of (pos).static intvanillaConnectionMask(net.minecraft.world.level.LevelReader world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, int side, boolean power) Returns the connection mask for a vanilla block
-
Constructor Details
-
RedstoneInteractions
public RedstoneInteractions()
-
-
Method Details
-
getPowerTo
Get the direct power to p on side -
getPowerTo
public static int getPowerTo(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, int side, int mask) Get the direct power level to space (pos) on side with mask -
getPower
public static int getPower(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, int side, int mask) Get the direct power level provided by space (pos) on side with mask -
otherConnectionMask
public static int otherConnectionMask(net.minecraft.world.level.LevelReader world, net.minecraft.core.BlockPos pos, int side, boolean power) Get the connection mask of the block on side of (pos).- Parameters:
power- , whether the connection mask is for signal transfer or visual connection. (some blocks accept power without visual connection)
-
connectionMask
Get the connection mask of part on side -
getConnectionMask
public static int getConnectionMask(net.minecraft.world.level.LevelReader world, net.minecraft.core.BlockPos pos, int side, boolean power) - Parameters:
power- If true, don't test canConnectRedstone on blocks, just get a power transmission mask rather than a visual connection
-
vanillaConnectionMask
public static int vanillaConnectionMask(net.minecraft.world.level.LevelReader world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, int side, boolean power) Returns the connection mask for a vanilla block
-