Class RedstoneController<T extends net.minecraft.world.level.block.entity.BlockEntity & IRedstoneControl<T>>

java.lang.Object
me.desht.pneumaticcraft.common.block.entity.RedstoneController<T>

public class RedstoneController<T extends net.minecraft.world.level.block.entity.BlockEntity & IRedstoneControl<T>> extends Object
Handles redstone behaviour & emission for a block entity
  • Constructor Details

  • Method Details

    • getModeCount

      public int getModeCount()
    • getModeDetails

      public RedstoneController.RedstoneMode<T> getModeDetails(int idx)
    • getCurrentMode

      public int getCurrentMode()
    • setCurrentMode

      public void setCurrentMode(int currentMode)
    • getCurrentRedstonePower

      public int getCurrentRedstonePower()
    • shouldRun

      public boolean shouldRun()
    • shouldEmit

      public boolean shouldEmit()
    • serialize

      public void serialize(net.minecraft.nbt.CompoundTag tag)
    • deserialize

      public void deserialize(net.minecraft.nbt.CompoundTag tag)
    • parseRedstoneMode

      public boolean parseRedstoneMode(String tag)
      Attempt to parse a redstone tag string, as received by IGUIButtonSensitive.handleGUIButtonPress(String, boolean, ServerPlayer). If the tag can be parsed, then update the redstone mode for this controller to the integer mode parsed from the tag.
      Parameters:
      tag - the string tag in the form "redstone:<int>"
      Returns:
      true if the tag was parsed, false if not
    • updateRedstonePower

      public void updateRedstonePower()
    • isEmitter

      public boolean isEmitter()
    • getRedstoneTabTitle

      public net.minecraft.network.chat.Component getRedstoneTabTitle()
    • getDescription

      public net.minecraft.network.chat.Component getDescription()