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 and emission for a block entity
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRedstoneController.EmittingRedstoneMode<T extends net.minecraft.world.level.block.entity.BlockEntity & IRedstoneControl<T>>static classRedstoneController.ReceivingRedstoneMode<T extends net.minecraft.world.level.block.entity.BlockEntity & IRedstoneControl<T>>static classRedstoneController.RedstoneMode<T extends net.minecraft.world.level.block.entity.BlockEntity & IRedstoneControl<T>> -
Constructor Summary
ConstructorsConstructorDescriptionRedstoneController(T te) RedstoneController(T te, List<RedstoneController.RedstoneMode<T>> modes) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(net.minecraft.nbt.CompoundTag tag) intintnet.minecraft.network.chat.ComponentintgetModeDetails(int idx) net.minecraft.network.chat.ComponentbooleanbooleanparseRedstoneMode(String tag) Attempt to parse a redstone tag string, as received byIGUIButtonSensitive.handleGUIButtonPress(String, boolean, ServerPlayer).voidserialize(net.minecraft.nbt.CompoundTag tag) voidsetCurrentMode(int currentMode) booleanbooleanvoid
-
Constructor Details
-
RedstoneController
-
RedstoneController
-
-
Method Details
-
getModeCount
public int getModeCount() -
getModeDetails
-
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
Attempt to parse a redstone tag string, as received byIGUIButtonSensitive.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()
-