Class CommandGenerateNetwork.NetworkGenerationHelper

java.lang.Object
org.cyclops.integrateddynamics.command.CommandGenerateNetwork.NetworkGenerationHelper
Enclosing class:
CommandGenerateNetwork

public static class CommandGenerateNetwork.NetworkGenerationHelper extends Object
Helper class for network generation logic, shared between command and game tests.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    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.
    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.
    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.
    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.
    static void
    placeCable(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos)
    Place a single cable block at the given position.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.