Class ThresholdSwitchBlockEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
All Implemented Interfaces:
PartialSafeNBT, SpecialBlockEntityItemRequirement, IInteractionChecker, net.createmod.ponder.api.VirtualBlockEntity, net.minecraft.world.Clearable, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.IBlockEntityExtension

public class ThresholdSwitchBlockEntity extends SmartBlockEntity implements net.minecraft.world.Clearable
  • Field Details

    • onWhenAbove

      public int onWhenAbove
    • offWhenBelow

      public int offWhenBelow
    • currentMinLevel

      public int currentMinLevel
    • currentLevel

      public int currentLevel
    • currentMaxLevel

      public int currentMaxLevel
    • inStacks

      public boolean inStacks
  • Constructor Details

    • ThresholdSwitchBlockEntity

      public ThresholdSwitchBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • read

      protected void read(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
      Description copied from class: SmartBlockEntity
      Hook only these in future subclasses of STE
      Overrides:
      read in class SmartBlockEntity
    • writeCommon

      protected void writeCommon(net.minecraft.nbt.CompoundTag compound)
    • write

      public void write(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
      Description copied from class: SmartBlockEntity
      Hook only these in future subclasses of STE
      Overrides:
      write in class SmartBlockEntity
    • writeSafe

      public void writeSafe(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries)
      Description copied from interface: PartialSafeNBT
      This will always be called from the logical server
      Specified by:
      writeSafe in interface PartialSafeNBT
      Overrides:
      writeSafe in class SmartBlockEntity
    • getMinLevel

      public int getMinLevel()
    • getStockLevel

      public int getStockLevel()
    • getMaxLevel

      public int getMaxLevel()
    • updateCurrentLevel

      public void updateCurrentLevel()
    • getDisplayItemForScreen

      public net.minecraft.world.item.ItemStack getDisplayItemForScreen()
    • format

      public net.minecraft.network.chat.MutableComponent format(int value, boolean stacks)
    • getTypeOfCurrentTarget

      public ThresholdSwitchBlockEntity.ThresholdType getTypeOfCurrentTarget()
    • scheduleBlockTick

      protected void scheduleBlockTick()
    • lazyTick

      public void lazyTick()
      Overrides:
      lazyTick in class SmartBlockEntity
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface net.minecraft.world.Clearable
    • addBehaviours

      public void addBehaviours(List<BlockEntityBehaviour> behaviours)
      Specified by:
      addBehaviours in class SmartBlockEntity
    • getLevelForDisplay

      public float getLevelForDisplay()
    • getState

      public boolean getState()
    • shouldBePowered

      public boolean shouldBePowered()
    • updatePowerAfterDelay

      public void updatePowerAfterDelay()
    • isPowered

      public boolean isPowered()
    • isInverted

      public boolean isInverted()
    • setInverted

      public void setInverted(boolean inverted)