Class KineticTileEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
com.simibubi.create.foundation.tileEntity.SyncedTileEntity
com.simibubi.create.foundation.tileEntity.SmartTileEntity
com.simibubi.create.content.contraptions.base.KineticTileEntity
- All Implemented Interfaces:
com.jozufozu.flywheel.api.FlywheelRendered,IHaveGoggleInformation,IHaveHoveringInformation,IInteractionChecker,IPartialSafeNBT,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>
- Direct Known Subclasses:
AdjustablePulleyTileEntity,ArmTileEntity,BasinOperatingTileEntity,BeltTileEntity,BlockBreakingKineticTileEntity,ClockworkBearingTileEntity,CopperBacktankTileEntity,CrushingWheelTileEntity,CuckooClockTileEntity,DeployerTileEntity,DirectionalShaftHalvesTileEntity,EjectorTileEntity,FluidValveTileEntity,GantryCarriageTileEntity,GantryShaftTileEntity,GaugeTileEntity,GeneratingKineticTileEntity,HosePulleyTileEntity,LinearActuatorTileEntity,MechanicalCrafterTileEntity,MillstoneTileEntity,PumpTileEntity,SimpleKineticTileEntity,SpeedControllerTileEntity,TurntableTileEntity
public class KineticTileEntity
extends SmartTileEntity
implements IHaveGoggleInformation, IHaveHoveringInformation, com.jozufozu.flywheel.api.FlywheelRendered
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>>Nested classes/interfaces inherited from interface com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation
IHaveGoggleInformation.Format -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected net.minecraft.world.phys.AABBprotected floatprotected KineticEffectHandlerprotected floatprotected floatbooleanprotected booleanintnet.minecraft.core.BlockPosprotected floatprotected floatbooleanprotected booleanFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABBFields inherited from interface com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation
componentSpacing, numberFormat, spacing -
Constructor Summary
ConstructorsConstructorDescriptionKineticTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> typeIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBehaviours(List<TileEntityBehaviour> behaviours) List<net.minecraft.core.BlockPos>addPropagationLocations(IRotate block, net.minecraft.world.level.block.state.BlockState state, List<net.minecraft.core.BlockPos> neighbours) Specify additional locations the rotation propagator should look for potentially connected components.booleanaddToGoggleTooltip(List<net.minecraft.network.chat.Component> tooltip, boolean isPlayerSneaking) this method will be called when looking at a TileEntity that implemented this interfacebooleanaddToTooltip(List<net.minecraft.network.chat.Component> tooltip, boolean isPlayerSneaking) voidfloatfloatprotected booleancanPropagateDiagonally(IRotate block, net.minecraft.world.level.block.state.BlockState state) voidstatic floatconvertToAngular(float speed) static floatconvertToDirection(float axisSpeed, net.minecraft.core.Direction d) static floatconvertToLinear(float speed) voidprotected voidfromTag(net.minecraft.nbt.CompoundTag compound, boolean clientPacket) Hook only these in future subclasses of STEintfloatnet.minecraft.world.phys.AABBfloatgetSpeed()protected net.minecraft.world.level.block.BlockfloatbooleanbooleanvoidbooleanisCustomConnection(KineticTileEntity other, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.state.BlockState otherState) Specify whether this component can propagate speed to the other in any circumstance.protected booleanisNoisy()booleanbooleanisSource()booleanprotected net.minecraft.world.phys.AABBbooleanvoidonSpeedChanged(float previousSpeed) floatpropagateRotationTo(KineticTileEntity target, net.minecraft.world.level.block.state.BlockState stateFrom, net.minecraft.world.level.block.state.BlockState stateTo, net.minecraft.core.BlockPos diff, boolean connectedViaAxes, boolean connectedViaCogs) Specify ratio of transferred rotation from this kinetic component to a specific other.voidvoidvoidsetNetwork(Long networkIn) voidvoidsetSource(net.minecraft.core.BlockPos source) voidsetSpeed(float speed) static voidswitchToBlockState(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) voidtick()voidvoidupdateFromNetwork(float maxStress, float currentStress, int networkSize) voidprotected voidwrite(net.minecraft.nbt.CompoundTag compound, boolean clientPacket) Hook only these in future subclasses of STEMethods inherited from class com.simibubi.create.foundation.tileEntity.SmartTileEntity
addBehavioursDeferred, attachBehaviourLate, canPlayerUse, forEachBehaviour, getBehaviour, getRequiredItems, isFluidHandlerCap, isItemHandlerCap, isVirtual, lazyTick, load, markVirtual, readClientUpdate, refreshBlockState, removeBehaviour, saveAdditional, sendToContainer, setLazyTickRate, writeSafe, writeToClientMethods inherited from class com.simibubi.create.foundation.tileEntity.SyncedTileEntity
causeBlockUpdate, containedChunk, getTileData, getUpdatePacket, getUpdateTag, notifyUpdate, onDataPacket, packetTarget, save, sendDataMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jozufozu.flywheel.api.FlywheelRendered
shouldRenderNormallyMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, handleUpdateTag, onLoad, serializeNBTMethods inherited from interface com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation
containedFluidTooltip
-
Field Details
-
network
-
source
@Nullable public net.minecraft.core.BlockPos source -
networkDirty
public boolean networkDirty -
updateSpeed
public boolean updateSpeed -
preventSpeedUpdate
public int preventSpeedUpdate -
effects
-
speed
protected float speed -
capacity
protected float capacity -
stress
protected float stress -
overStressed
protected boolean overStressed -
wasMoved
protected boolean wasMoved -
lastStressApplied
protected float lastStressApplied -
lastCapacityProvided
protected float lastCapacityProvided -
cachedBoundingBox
protected net.minecraft.world.phys.AABB cachedBoundingBox
-
-
Constructor Details
-
KineticTileEntity
public KineticTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> typeIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initializein classSmartTileEntity
-
tick
public void tick()- Overrides:
tickin classSmartTileEntity
-
updateFromNetwork
public void updateFromNetwork(float maxStress, float currentStress, int networkSize) -
getStressConfigKey
protected net.minecraft.world.level.block.Block getStressConfigKey() -
calculateStressApplied
public float calculateStressApplied() -
calculateAddedStressCapacity
public float calculateAddedStressCapacity() -
onSpeedChanged
public void onSpeedChanged(float previousSpeed) -
setRemoved
public void setRemoved()- Overrides:
setRemovedin classSmartTileEntity
-
write
protected void write(net.minecraft.nbt.CompoundTag compound, boolean clientPacket) Description copied from class:SmartTileEntityHook only these in future subclasses of STE- Overrides:
writein classSmartTileEntity
-
needsSpeedUpdate
public boolean needsSpeedUpdate() -
fromTag
protected void fromTag(net.minecraft.nbt.CompoundTag compound, boolean clientPacket) Description copied from class:SmartTileEntityHook only these in future subclasses of STE- Overrides:
fromTagin classSmartTileEntity
-
getGeneratedSpeed
public float getGeneratedSpeed() -
isSource
public boolean isSource() -
getSpeed
public float getSpeed() -
getTheoreticalSpeed
public float getTheoreticalSpeed() -
setSpeed
public void setSpeed(float speed) -
hasSource
public boolean hasSource() -
setSource
public void setSource(net.minecraft.core.BlockPos source) -
removeSource
public void removeSource() -
setNetwork
-
getOrCreateNetwork
-
hasNetwork
public boolean hasNetwork() -
attachKinetics
public void attachKinetics() -
detachKinetics
public void detachKinetics() -
isSpeedRequirementFulfilled
public boolean isSpeedRequirementFulfilled() -
switchToBlockState
public static void switchToBlockState(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
addBehaviours
- Specified by:
addBehavioursin classSmartTileEntity
-
addToTooltip
public boolean addToTooltip(List<net.minecraft.network.chat.Component> tooltip, boolean isPlayerSneaking) - Specified by:
addToTooltipin interfaceIHaveHoveringInformation
-
addToGoggleTooltip
public boolean addToGoggleTooltip(List<net.minecraft.network.chat.Component> tooltip, boolean isPlayerSneaking) Description copied from interface:IHaveGoggleInformationthis method will be called when looking at a TileEntity that implemented this interface- Specified by:
addToGoggleTooltipin interfaceIHaveGoggleInformation- Returns:
trueif the tooltip creation was successful and should be displayed, orfalseif the overlay should not be displayed
-
clearKineticInformation
public void clearKineticInformation() -
warnOfMovement
public void warnOfMovement() -
getFlickerScore
public int getFlickerScore() -
convertToDirection
public static float convertToDirection(float axisSpeed, net.minecraft.core.Direction d) -
convertToLinear
public static float convertToLinear(float speed) -
convertToAngular
public static float convertToAngular(float speed) -
isOverStressed
public boolean isOverStressed() -
propagateRotationTo
public float propagateRotationTo(KineticTileEntity target, net.minecraft.world.level.block.state.BlockState stateFrom, net.minecraft.world.level.block.state.BlockState stateTo, net.minecraft.core.BlockPos diff, boolean connectedViaAxes, boolean connectedViaCogs) Specify ratio of transferred rotation from this kinetic component to a specific other.- Parameters:
target- other Kinetic TE to transfer tostateFrom- this TE's blockstatestateTo- other TE's blockstatediff- difference in position (to.pos - from.pos)connectedViaAxes- whether these kinetic blocks are connected via mutual IRotate.hasShaftTowards()connectedViaCogs- whether these kinetic blocks are connected via mutual IRotate.hasIntegratedCogwheel()- Returns:
- factor of rotation speed from this TE to other. 0 if no rotation is transferred, or the standard rules apply (integrated shafts/cogs)
-
addPropagationLocations
public List<net.minecraft.core.BlockPos> addPropagationLocations(IRotate block, net.minecraft.world.level.block.state.BlockState state, List<net.minecraft.core.BlockPos> neighbours) Specify additional locations the rotation propagator should look for potentially connected components. Neighbour list contains offset positions in all 6 directions by default.- Parameters:
block-state-neighbours-- Returns:
-
isCustomConnection
public boolean isCustomConnection(KineticTileEntity other, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.state.BlockState otherState) Specify whether this component can propagate speed to the other in any circumstance. Shaft and cogwheel connections are already handled by internal logic. Does not have to be specified on both ends, it is assumed that this relation is symmetrical.- Parameters:
other-state-otherState-- Returns:
- true if this and the other component should check their propagation factor and are not already connected via integrated cogs or shafts
-
canPropagateDiagonally
protected boolean canPropagateDiagonally(IRotate block, net.minecraft.world.level.block.state.BlockState state) -
requestModelDataUpdate
public void requestModelDataUpdate()- Specified by:
requestModelDataUpdatein interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-
getRenderBoundingBox
public net.minecraft.world.phys.AABB getRenderBoundingBox()- Specified by:
getRenderBoundingBoxin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-
makeRenderBoundingBox
protected net.minecraft.world.phys.AABB makeRenderBoundingBox() -
tickAudio
public void tickAudio() -
isNoisy
protected boolean isNoisy()
-