Class CommandGenerateNetwork.NetworkGenerationHelper
java.lang.Object
org.cyclops.integrateddynamics.command.CommandGenerateNetwork.NetworkGenerationHelper
- Enclosing class:
CommandGenerateNetwork
Helper class for network generation logic, shared between command and game tests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddPartToNorthFace(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos) Add a random part to the NORTH face of a cable at the given position.static voidclearCables(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, int radius) Clear all cable blocks within a radius of the given position.static voidgenerateEmptyNetwork(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos startPos, int size) Generate a size x size x size cube of only logic cables.static voidgenerateIdleNetwork(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos startPos, int size) Generate a size x size x size cube of logic cables where all cables on the outer sides contain random parts facing outwards.static voidgenerateRedstoneNetwork(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos startPos, int size) Generate a size x size x size cube of logic cables where all cables on the EAST side contain redstone readers, and all cables on the WEST side contain redstone writers.static voidgenerateRedstoneNetworkVariables(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos startPos, int size) Generate a size x size x size cube of logic cables where all cables on the EAST side contain redstone readers, and all cables on the WEST side contain redstone writers.static voidplaceCable(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos) Place a single cable block at the given position.
-
Constructor Details
-
NetworkGenerationHelper
public NetworkGenerationHelper()
-
-
Method Details
-
generateEmptyNetwork
public static void generateEmptyNetwork(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos startPos, int size) Generate a size x size x size cube of only logic cables. -
generateIdleNetwork
public static void generateIdleNetwork(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos startPos, int size) Generate a size x size x size cube of logic cables where all cables on the outer sides contain random parts facing outwards. -
placeCable
public static void placeCable(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos) Place a single cable block at the given position. -
addPartToNorthFace
public static void addPartToNorthFace(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos) Add a random part to the NORTH face of a cable at the given position. -
clearCables
public static void clearCables(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, int radius) Clear all cable blocks within a radius of the given position. -
generateRedstoneNetwork
public static void generateRedstoneNetwork(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos startPos, int size) Generate a size x size x size cube of logic cables where all cables on the EAST side contain redstone readers, and all cables on the WEST side contain redstone writers. For each reader-writer pair at the same Y and Z coordinates, a variable is created that reads the BOOLEAN_CLOCK aspect from the reader and connects it to the BOOLEAN aspect of the writer at the opposite side. -
generateRedstoneNetworkVariables
public static void generateRedstoneNetworkVariables(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos startPos, int size) Generate a size x size x size cube of logic cables where all cables on the EAST side contain redstone readers, and all cables on the WEST side contain redstone writers. For each reader-writer pair at the same Y and Z coordinates, a CHOICE operator is created that reads the BOOLEAN_CLOCK aspect from the reader and chooses between constants 0 and 10. The result is written to the INTEGER aspect of the writer. Variable cards are stored in variable store blocks placed on the SOUTH side of the network, stacked vertically. Each variable store can hold multiple CHOICE operator configurations. All redstone readers have PROPERTY_LENGTH set to 10.
-