Class SmartChestBlockEntity

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
All Implemented Interfaces:
IComparatorSupport, IGUIButtonSensitive, ILuaMethodProvider, IRedstoneControl<SmartChestBlockEntity>, IDescSynced, IUpgradeHolder, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.MenuProvider, net.minecraft.world.Nameable, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeBlockEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class SmartChestBlockEntity extends AbstractTickingBlockEntity implements net.minecraft.world.MenuProvider, IRedstoneControl<SmartChestBlockEntity>, IComparatorSupport
  • Field Details

  • Constructor Details

    • SmartChestBlockEntity

      public SmartChestBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • tickClient

      public void tickClient()
      Overrides:
      tickClient in class AbstractTickingBlockEntity
    • tickServer

      public void tickServer()
      Overrides:
      tickServer in class AbstractTickingBlockEntity
    • getTickRate

      public int getTickRate()
    • getMaxItems

      public int getMaxItems()
    • getAbsoluteFacing

      public net.minecraft.core.Direction getAbsoluteFacing(SideConfigurator.RelativeFace face, net.minecraft.core.Direction dir)
    • getPushPullMode

    • getPrimaryInventory

      public net.minecraftforge.items.IItemHandler getPrimaryInventory()
      Specified by:
      getPrimaryInventory in class AbstractPneumaticCraftBlockEntity
    • getInventoryCap

      @Nonnull protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler> getInventoryCap(net.minecraft.core.Direction side)
      Overrides:
      getInventoryCap in class AbstractPneumaticCraftBlockEntity
    • createMenu

      @Nullable public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int windowId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.world.entity.player.Player player)
      Specified by:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
    • shouldPreserveStateOnBreak

      public boolean shouldPreserveStateOnBreak()
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Should this block entity preserve its state (currently: upgrades and stored air) when broken? By default this is true when sneak-wrenched, and false when broken by pick.
      Overrides:
      shouldPreserveStateOnBreak in class AbstractPneumaticCraftBlockEntity
      Returns:
      true if state should be preserved, false otherwise
    • getContentsToDrop

      public void getContentsToDrop(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> drops)
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Collect all items which should be dropped when this BE is broken. Override and extend this in subclassing BE's which have extra inventories to be dropped.
      Overrides:
      getContentsToDrop in class AbstractPneumaticCraftBlockEntity
      Parameters:
      drops - list in which to collect dropped items
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      saveAdditional in class AbstractPneumaticCraftBlockEntity
    • load

      public void load(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      load in class AbstractPneumaticCraftBlockEntity
    • serializeExtraItemData

      public void serializeExtraItemData(net.minecraft.nbt.CompoundTag blockEntityTag, boolean preserveState)
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Get any extra data to be serialized onto a dropped item stack. The supplied tag is the "BlockEntityTag" subtag of the item's NBT data, so will be automatically deserialized into the BE (i.e. available to BlockEntity.load(CompoundTag) method) when the itemblock is next placed.
      Overrides:
      serializeExtraItemData in class AbstractPneumaticCraftBlockEntity
      Parameters:
      blockEntityTag - the existing "BlockEntityTag" subtag to add data to
      preserveState - true when dropped with a wrench, false when broken with a pickaxe etc.
    • handleGUIButtonPress

      public void handleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player)
      Specified by:
      handleGUIButtonPress in interface IGUIButtonSensitive
      Overrides:
      handleGUIButtonPress in class AbstractPneumaticCraftBlockEntity
    • cycleMode

      public void cycleMode(SideConfigurator.RelativeFace face, boolean shiftHeld)
    • getLastSlot

      public int getLastSlot()
    • setLastSlot

      public void setLastSlot(int lastSlot)
    • getFilter

      public List<org.apache.commons.lang3.tuple.Pair<Integer,net.minecraft.world.item.ItemStack>> getFilter()
    • setFilter

      public void setFilter(List<org.apache.commons.lang3.tuple.Pair<Integer,net.minecraft.world.item.ItemStack>> l)
    • getFilter

      public net.minecraft.world.item.ItemStack getFilter(int slotId)
    • setFilter

      public void setFilter(int slotId, net.minecraft.world.item.ItemStack stack)
    • getRedstoneController

      public RedstoneController<SmartChestBlockEntity> getRedstoneController()
      Description copied from interface: IRedstoneControl
      Get the redstone controller object for this BE
      Specified by:
      getRedstoneController in interface IRedstoneControl<SmartChestBlockEntity>
      Returns:
      the redstone controller
    • getComparatorValue

      public int getComparatorValue()
      Specified by:
      getComparatorValue in interface IComparatorSupport
    • deserializeSmartChest

      public static net.minecraftforge.items.IItemHandler deserializeSmartChest(net.minecraft.nbt.CompoundTag tag)