Class SecurityStationBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
me.desht.pneumaticcraft.common.block.entity.AbstractTickingBlockEntity
me.desht.pneumaticcraft.common.block.entity.SecurityStationBlockEntity
- 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classNested classes/interfaces inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
AbstractPneumaticCraftBlockEntity.UpgradeHandlerNested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>> -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal List<com.mojang.authlib.GameProfile>static final intstatic final intfinal List<com.mojang.authlib.GameProfile>Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
ConstructorsConstructorDescriptionSecurityStationBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHacker(com.mojang.authlib.GameProfile user) voidaddTrustedUser(com.mojang.authlib.GameProfile user) Method used to update the check of the validity of the network.voidbooleanconnects(int firstSlot, int secondSlot) Check if the given slots are connected in the network.net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int i, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player playerEntity) booleandoesAllowPlayer(net.minecraft.world.entity.player.Player player) Check if the given player is allowed to interact within the covered area of this Security Station.intintme.desht.pneumaticcraft.common.block.entity.SecurityStationBlockEntity.HackingContainerProviderprotected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>getInventoryCap(net.minecraft.core.Direction side) net.minecraftforge.items.IItemHandlerstatic intgetProtectingSecurityStations(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.intGet the redstone controller object for this BEnet.minecraft.world.phys.AABBnet.minecraft.world.phys.AABBintvoidhandleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) booleanhasPlayerHacked(net.minecraft.world.entity.player.Player player) booleanvoidinitiateHacking(net.minecraft.world.entity.player.Player hacker) booleanisGuiUseableByPlayer(net.minecraft.world.entity.player.Player par1EntityPlayer) booleanisHacked()booleanisPlayerOnWhiteList(net.minecraft.world.entity.player.Player player) static booleanisProtectedFromPlayer(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.voidload(net.minecraft.nbt.CompoundTag tag) voidreadFromPacket(net.minecraft.nbt.CompoundTag tag) Encoded into the description packet.voidvoidretaliate(net.minecraft.world.entity.player.Player hacker) voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) voidvoidsetSimulationController(ISimulationController newController) voidCalled on both server and client, before anything elsevoidwriteToPacket(net.minecraft.nbt.CompoundTag tag) Encoded into the description packet.Methods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractTickingBlockEntity
tickClient, tickCommonPost, tickServerMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
addLuaMethods, countPlayersUsing, getCachedNeighbor, getCapability, getContentsToDrop, getCurrentRecipeIdSynced, getCustomName, getDescriptionFields, getDisplayName, getEnergyCap, getFluidCap, getHeatCap, getLuaMethodRegistry, getModelData, getName, getPeripheralType, getPosition, getRotation, getSpeedMultiplierFromUpgrades, getSpeedUsageMultiplierFromUpgrades, getUpdateTag, getUpgradeCache, getUpgradeHandler, getUpgrades, handleUpdateTag, nonNullLevel, onBlockRotated, onDescUpdate, onGuiUpdate, onLoad, onNeighborBlockUpdate, onNeighborTileUpdate, onUpgradesChanged, requestModelDataUpdate, sendDescriptionPacket, serializeExtraItemData, setChanged, setCustomName, setPreserveStateOnBreak, shouldPreserveStateOnBreak, shouldRerenderChunkOnDescUpdate, shouldSyncField, updateNeighboursMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setLevel, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, hasCustomOutlineRendering, onDataPacket, serializeNBTMethods inherited from interface me.desht.pneumaticcraft.common.block.entity.IRangedTE
getRange, rangeTextMethods inherited from interface me.desht.pneumaticcraft.common.block.entity.IRedstoneControl
getCurrentRedstonePower, getRedstoneMode, getRedstoneTabTitle, onRedstoneModeChangedMethods inherited from interface net.minecraft.world.MenuProvider
getDisplayNameMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
INV_ROWS
public static final int INV_ROWS- See Also:
-
INV_COLS
public static final int INV_COLS- See Also:
-
hackedUsers
-
rsController
-
-
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:
setRemovedin classAbstractPneumaticCraftBlockEntity
-
clearRemoved
public void clearRemoved()- Overrides:
clearRemovedin classnet.minecraft.world.level.block.entity.BlockEntity
-
tickCommonPre
public void tickCommonPre()Description copied from class:AbstractTickingBlockEntityCalled on both server and client, before anything else- Overrides:
tickCommonPrein classAbstractTickingBlockEntity
-
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:
getInventoryCapin classAbstractPneumaticCraftBlockEntity
-
handleGUIButtonPress
public void handleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) - Specified by:
handleGUIButtonPressin interfaceIGUIButtonSensitive- Overrides:
handleGUIButtonPressin classAbstractPneumaticCraftBlockEntity
-
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:
getRenderBoundingBoxin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-
getSecurityCoverage
public net.minecraft.world.phys.AABB getSecurityCoverage() -
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classAbstractPneumaticCraftBlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classAbstractPneumaticCraftBlockEntity
-
writeToPacket
public void writeToPacket(net.minecraft.nbt.CompoundTag tag) Description copied from class:AbstractPneumaticCraftBlockEntityEncoded into the description packet. Also included in saved data written byBlockEntity.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:
writeToPacketin interfaceIDescSynced- Overrides:
writeToPacketin classAbstractPneumaticCraftBlockEntity- Parameters:
tag- NBT tag
-
readFromPacket
public void readFromPacket(net.minecraft.nbt.CompoundTag tag) Description copied from class:AbstractPneumaticCraftBlockEntityEncoded into the description packet. Also included in saved data read byAbstractPneumaticCraftBlockEntity.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:
readFromPacketin interfaceIDescSynced- Overrides:
readFromPacketin classAbstractPneumaticCraftBlockEntity- 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 1secondSlot- 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:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor
-
initiateHacking
public void initiateHacking(net.minecraft.world.entity.player.Player hacker) -
findComponent
-
getSimulationController
-
setSimulationController
-
retaliate
public void retaliate(net.minecraft.world.entity.player.Player hacker) -
getRangeManager
- Specified by:
getRangeManagerin interfaceIRangedTE
-
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:
isGuiUseableByPlayerin classAbstractPneumaticCraftBlockEntity
-
getPrimaryInventory
public net.minecraftforge.items.IItemHandler getPrimaryInventory()- Specified by:
getPrimaryInventoryin classAbstractPneumaticCraftBlockEntity
-
getRedstoneController
Description copied from interface:IRedstoneControlGet the redstone controller object for this BE- Specified by:
getRedstoneControllerin interfaceIRedstoneControl<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 questionpos- the blockpos whose protection is being checkedisPlacingSecurityStation- 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 questionpos- the blockpos whose protection is being checkedisPlacingSecurityStation- true when trying to place a security station, false otherwise- Returns:
- the number of security stations which currently prevent access by the player
-