Class SecurityStationBlockEntity

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:
IGUIButtonSensitive, ILuaMethodProvider, IRangedTE, IRedstoneControl<SecurityStationBlockEntity>, 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 SecurityStationBlockEntity extends AbstractTickingBlockEntity implements IRedstoneControl<SecurityStationBlockEntity>, net.minecraft.world.MenuProvider, IRangedTE
  • Field Details

  • Constructor Details

    • SecurityStationBlockEntity

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

    • setRemoved

      public void setRemoved()
      Overrides:
      setRemoved in class AbstractPneumaticCraftBlockEntity
    • clearRemoved

      public void clearRemoved()
      Overrides:
      clearRemoved in class net.minecraft.world.level.block.entity.BlockEntity
    • tickCommonPre

      public void tickCommonPre()
      Description copied from class: AbstractTickingBlockEntity
      Called on both server and client, before anything else
      Overrides:
      tickCommonPre in class AbstractTickingBlockEntity
    • rebootStation

      public void rebootStation()
    • getRebootTime

      public int getRebootTime()
    • getInventoryCap

      protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler> getInventoryCap(net.minecraft.core.Direction side)
      Overrides:
      getInventoryCap in class AbstractPneumaticCraftBlockEntity
    • 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
    • getHackingContainerProvider

      public me.desht.pneumaticcraft.common.block.entity.SecurityStationBlockEntity.HackingContainerProvider getHackingContainerProvider()
    • addTrustedUser

      public void addTrustedUser(com.mojang.authlib.GameProfile user)
    • addHacker

      public void addHacker(com.mojang.authlib.GameProfile user)
    • isHacked

      public boolean isHacked()
    • getRenderBoundingBox

      public net.minecraft.world.phys.AABB getRenderBoundingBox()
      Specified by:
      getRenderBoundingBox in interface net.minecraftforge.common.extensions.IForgeBlockEntity
    • getSecurityCoverage

      public net.minecraft.world.phys.AABB getSecurityCoverage()
    • load

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

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

      public void writeToPacket(net.minecraft.nbt.CompoundTag tag)
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Encoded into the description packet. Also included in saved data written by BlockEntity.saveAdditional(CompoundTag) Prefer to use @DescSynced where possible - use this either for complex fields not handled by @DescSynced, or for non-ticking tile entities.
      Specified by:
      writeToPacket in interface IDescSynced
      Overrides:
      writeToPacket in class AbstractPneumaticCraftBlockEntity
      Parameters:
      tag - NBT tag
    • readFromPacket

      public void readFromPacket(net.minecraft.nbt.CompoundTag tag)
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Encoded into the description packet. Also included in saved data read by AbstractPneumaticCraftBlockEntity.load(CompoundTag). Prefer to use @DescSynced where possible - use this either for complex fields not handled by @DescSynced, or for non-ticking tile entities.
      Specified by:
      readFromPacket in interface IDescSynced
      Overrides:
      readFromPacket in class AbstractPneumaticCraftBlockEntity
      Parameters:
      tag - NBT tag
    • doesAllowPlayer

      public boolean doesAllowPlayer(net.minecraft.world.entity.player.Player player)
      Check if the given player is allowed to interact within the covered area of this Security Station.
      Parameters:
      player - the player
      Returns:
      true if the player is allowed to interact
    • isPlayerOnWhiteList

      public boolean isPlayerOnWhiteList(net.minecraft.world.entity.player.Player player)
    • hasPlayerHacked

      public boolean hasPlayerHacked(net.minecraft.world.entity.player.Player player)
    • connects

      public boolean connects(int firstSlot, int secondSlot)
      Check if the given slots are connected in the network. For this to be true both slots need to have a network component stored as well.
      Parameters:
      firstSlot - slot 1
      secondSlot - slot 2
      Returns:
      true if the slots are connected
    • hasValidNetwork

      public boolean hasValidNetwork()
    • createMenu

      @Nullable public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int i, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player playerEntity)
      Specified by:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
    • initiateHacking

      public void initiateHacking(net.minecraft.world.entity.player.Player hacker)
    • findComponent

      public int findComponent(NetworkComponentItem.NetworkComponentType type)
    • getSimulationController

      public ISimulationController getSimulationController()
    • setSimulationController

      public void setSimulationController(ISimulationController newController)
    • retaliate

      public void retaliate(net.minecraft.world.entity.player.Player hacker)
    • getRangeManager

      public RangeManager getRangeManager()
      Specified by:
      getRangeManager in interface IRangedTE
    • checkForNetworkValidity

      Method used to update the check of the validity of the network.
      Returns:
      optional problem enum
    • getDetectionChance

      public int getDetectionChance()
    • getSecurityLevel

      public int getSecurityLevel()
    • isGuiUseableByPlayer

      public boolean isGuiUseableByPlayer(net.minecraft.world.entity.player.Player par1EntityPlayer)
      Overrides:
      isGuiUseableByPlayer in class AbstractPneumaticCraftBlockEntity
    • getPrimaryInventory

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

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

      public static int getProtectingSecurityStations(net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, boolean isPlacingSecurityStation)
      Get the number of security stations protecting the given blockpos from the given player.
      Parameters:
      player - the player who is trying to do something with the blockpos in question
      pos - the blockpos whose protection is being checked
      isPlacingSecurityStation - true when trying to place a security station, false otherwise
      Returns:
      the number of security stations which currently prevent access by the player
    • isProtectedFromPlayer

      public static boolean isProtectedFromPlayer(net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, boolean isPlacingSecurityStation)
      Check if any security station is preventing the given player from interacting with the given blockpos.
      Parameters:
      player - the player who is trying to do something with the blockpos in question
      pos - the blockpos whose protection is being checked
      isPlacingSecurityStation - true when trying to place a security station, false otherwise
      Returns:
      the number of security stations which currently prevent access by the player