Class UniversalSensorBlockEntity
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.AbstractAirHandlingBlockEntity
me.desht.pneumaticcraft.common.block.entity.UniversalSensorBlockEntity
- All Implemented Interfaces:
IGUIButtonSensitive,IGUITextFieldSensitive,ILuaMethodProvider,IMinWorkingPressure,IRangedTE,IRedstoneControl<UniversalSensorBlockEntity>,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 UniversalSensorBlockEntity
extends AbstractAirHandlingBlockEntity
implements IGUITextFieldSensitive, IMinWorkingPressure, IRangedTE, IRedstoneControl<UniversalSensorBlockEntity>, net.minecraft.world.MenuProvider
-
Nested Class Summary
Nested ClassesNested 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 TypeFieldDescriptionfloatbooleanfloatintintFields inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractAirHandlingBlockEntity
airHandlerFields 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
ConstructorsConstructorDescriptionUniversalSensorBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLuaMethods(LuaMethodRegistry registry) Called lazily to populate the method registry with the methods.booleanareGivenUpgradesInserted(Set<PNCUpgrade> requiredUpgrades) booleancanConnectPneumatic(net.minecraft.core.Direction side) Checks if the given side of this BE can be pneumatically connected to.voidnet.minecraft.world.inventory.AbstractContainerMenucreateMenu(int i, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player playerEntity) Set<net.minecraft.core.BlockPos>protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>floatGet the minimum pressure at which this machine can operate.net.minecraftforge.items.IItemHandlerGet the redstone controller object for this BEnet.minecraft.network.chat.MutableComponentnet.minecraft.world.phys.AABBgetText(int textFieldID) voidhandleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) voidload(net.minecraft.nbt.CompoundTag tag) voidonEvent(net.minecraftforge.eventbus.api.Event event) voidCalled when a key is synced in the container.voidCalled when a machine's upgrades have changed in any way.voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) voidsetPlayerId(UUID playerId) voidvoidprotected booleanvoidCalled on both server and client, before anything elsevoidMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractAirHandlingBlockEntity
addAir, getCapability, getCriticalPressure, getDangerPressure, getDefaultVolume, getPressure, handleUpdateTag, hasNoConnectedAirHandlers, initializeHullAirHandlerClient, initializeHullAirHandlers, onBlockRotated, onLoad, onNeighborBlockUpdate, readFromPacket, writeToPacketMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractTickingBlockEntity
tickClient, tickCommonPostMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
countPlayersUsing, getCachedNeighbor, getContentsToDrop, getCurrentRecipeIdSynced, getCustomName, getDescriptionFields, getDisplayName, getHeatCap, getLuaMethodRegistry, getModelData, getName, getPeripheralType, getPosition, getRotation, getSpeedMultiplierFromUpgrades, getSpeedUsageMultiplierFromUpgrades, getUpdateTag, getUpgradeCache, getUpgradeHandler, getUpgrades, isGuiUseableByPlayer, nonNullLevel, onDescUpdate, onNeighborTileUpdate, requestModelDataUpdate, sendDescriptionPacket, serializeExtraItemData, setChanged, setCustomName, setPreserveStateOnBreak, shouldPreserveStateOnBreak, shouldSyncField, updateNeighboursMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getTileData, 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, 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, onRedstoneModeChangedMethods inherited from interface net.minecraft.world.MenuProvider
getDisplayNameMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
redstoneStrength
public int redstoneStrength -
dishRotation
public float dishRotation -
oldDishRotation
public float oldDishRotation -
isSensorActive
public boolean isSensorActive -
lastSensorExceptionText
-
sensorStatus
-
outOfRange
public int outOfRange
-
-
Constructor Details
-
UniversalSensorBlockEntity
public UniversalSensorBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
tickCommonPre
public void tickCommonPre()Description copied from class:AbstractTickingBlockEntityCalled on both server and client, before anything else- Overrides:
tickCommonPrein classAbstractAirHandlingBlockEntity
-
tickServer
public void tickServer()- Overrides:
tickServerin classAbstractTickingBlockEntity
-
shouldRerenderChunkOnDescUpdate
protected boolean shouldRerenderChunkOnDescUpdate()- Overrides:
shouldRerenderChunkOnDescUpdatein classAbstractPneumaticCraftBlockEntity
-
canConnectPneumatic
public boolean canConnectPneumatic(net.minecraft.core.Direction side) Description copied from class:AbstractAirHandlingBlockEntityChecks if the given side of this BE can be pneumatically connected to.- Overrides:
canConnectPneumaticin classAbstractAirHandlingBlockEntity- Parameters:
side- the side to check- Returns:
- true if connected, false otherwise
-
getRenderBoundingBox
public net.minecraft.world.phys.AABB getRenderBoundingBox()- Specified by:
getRenderBoundingBoxin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-
onEvent
public void onEvent(net.minecraftforge.eventbus.api.Event event) -
getRangeManager
- Specified by:
getRangeManagerin interfaceIRangedTE
-
getSensorSetting
-
onGuiUpdate
public void onGuiUpdate()Description copied from class:AbstractPneumaticCraftBlockEntityCalled when a key is synced in the container.- Overrides:
onGuiUpdatein classAbstractPneumaticCraftBlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classAbstractAirHandlingBlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classAbstractAirHandlingBlockEntity
-
handleGUIButtonPress
public void handleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) - Specified by:
handleGUIButtonPressin interfaceIGUIButtonSensitive- Overrides:
handleGUIButtonPressin classAbstractPneumaticCraftBlockEntity
-
onUpgradesChanged
public void onUpgradesChanged()Description copied from class:AbstractPneumaticCraftBlockEntityCalled when a machine's upgrades have changed in any way. This is also called from readNBT() when saved upgrades are deserialized, so it is not guaranteed that the world field is non-null - beware. If you override this, remember to call the super method!- Specified by:
onUpgradesChangedin interfaceIUpgradeHolder- Overrides:
onUpgradesChangedin classAbstractAirHandlingBlockEntity
-
areGivenUpgradesInserted
-
getGPSPositions
-
setText
- Specified by:
setTextin interfaceIGUITextFieldSensitive
-
getText
- Specified by:
getTextin interfaceIGUITextFieldSensitive
-
addLuaMethods
Description copied from interface:ILuaMethodProviderCalled lazily to populate the method registry with the methods.- Specified by:
addLuaMethodsin interfaceILuaMethodProvider- Overrides:
addLuaMethodsin classAbstractAirHandlingBlockEntity- Parameters:
registry- the registry to populate
-
getPrimaryInventory
public net.minecraftforge.items.IItemHandler getPrimaryInventory()- Specified by:
getPrimaryInventoryin classAbstractPneumaticCraftBlockEntity
-
getInventoryCap
@Nonnull protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler> getInventoryCap()- Overrides:
getInventoryCapin classAbstractPneumaticCraftBlockEntity
-
getRedstoneController
Description copied from interface:IRedstoneControlGet the redstone controller object for this BE- Specified by:
getRedstoneControllerin interfaceIRedstoneControl<UniversalSensorBlockEntity>- Returns:
- the redstone controller
-
getMinWorkingPressure
public float getMinWorkingPressure()Description copied from interface:IMinWorkingPressureGet the minimum pressure at which this machine can operate. Used for GUI display purposes (drawing the yellow region of the pressure gauge, but can also be checked elsewhere.- Specified by:
getMinWorkingPressurein interfaceIMinWorkingPressure- Returns:
- the minimum pressure at which this machine can operate
-
getRedstoneTabTitle
public net.minecraft.network.chat.MutableComponent getRedstoneTabTitle()- Specified by:
getRedstoneTabTitlein interfaceIRedstoneControl<UniversalSensorBlockEntity>
-
setRemoved
public void setRemoved()- Overrides:
setRemovedin classAbstractAirHandlingBlockEntity
-
clearRemoved
public void clearRemoved()- Overrides:
clearRemovedin classnet.minecraft.world.level.block.entity.BlockEntity
-
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
-
setPlayerId
-