Class AbstractBoat
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.vehicle.VehicleEntity
net.minecraft.world.entity.vehicle.AbstractBoat
- All Implemented Interfaces:
DataComponentGetter,SyncedDataHolder,DebugValueSource,ItemOwner,Leashable,EntityAccess,UniquelyIdentifyable,Nameable,ScoreHolder,IAttachmentHolder,IAbstractBoatExtension,IEntityExtension
- Direct Known Subclasses:
AbstractChestBoat,Boat,Raft
public abstract class AbstractBoat
extends VehicleEntity
implements Leashable, IAbstractBoatExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReasonNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T>Nested classes/interfaces inherited from interface net.minecraft.world.entity.ItemOwner
ItemOwner.OffsetFromOwnerNested classes/interfaces inherited from interface net.minecraft.world.entity.Leashable
Leashable.LeashData, Leashable.Wrench -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate floatprivate floatprivate booleanprivate floatprivate static final EntityDataAccessor<Integer> private static final EntityDataAccessor<Boolean> private static final EntityDataAccessor<Boolean> private floatprivate booleanprivate booleanprivate booleanprivate booleanprivate final InterpolationHandlerprivate booleanprivate floatprivate doubleprivate Leashable.LeashDataprivate AbstractBoat.Statusprivate floatstatic final intstatic final intstatic final doubleprivate static final floatprivate final float[]private AbstractBoat.Statusprivate static final intprivate doubleFields inherited from class net.minecraft.world.entity.vehicle.VehicleEntity
DATA_ID_DAMAGE, DATA_ID_HURT, DATA_ID_HURTDIRFields inherited from class net.minecraft.world.entity.Entity
BASE_SAFE_FALL_DISTANCE, BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, CONTENTS_SLOT_INDEX, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_2, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5, DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0, ENTITY_COUNTER, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, forgeFluidTypeHeight, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, MAX_MOVEMENTS_HANDELED_PER_TICK, minorHorizontalCollision, moveDist, noPhysics, portalProcess, random, stringUUID, stuckSpeedMultiplier, TAG_AIR, TAG_CUSTOM_NAME, TAG_DATA, TAG_FALL_DISTANCE, TAG_FIRE, TAG_GLOWING, TAG_ID, TAG_INVULNERABLE, TAG_MOTION, TAG_NO_GRAVITY, TAG_ON_GROUND, TAG_PASSENGERS, TAG_PORTAL_COOLDOWN, TAG_POS, TAG_ROTATION, TAG_SILENT, TAG_UUID, tickCount, TOTAL_AIR_SUPPLY, uuid, verticalCollision, verticalCollisionBelow, wasEyeInWater, wasInPowderSnow, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOldFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.world.entity.Leashable
AXIS_SPECIFIC_ELASTICITY, ENTITY_ATTACHMENT_POINT, LEASH_ELASTIC_DIST, LEASH_TAG, LEASH_TOO_FAR_DIST, LEASHER_ATTACHMENT_POINT, MAXIMUM_ALLOWED_LEASHED_DIST, SHARED_QUAD_ATTACHMENT_POINTS, SPRING_DAMPENING, STIFFNESS, TORSIONAL_ELASTICITYFields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionAbstractBoat(EntityType<? extends AbstractBoat> pEntityType, Level pLevel, Supplier<Item> pDropItem) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAdditionalSaveData(ValueOutput p_422306_) voidanimateHurt(float p_376617_) protected booleancanAddPassenger(Entity p_376443_) booleancanBeCollidedWith(Entity p_423669_) booleancanCollideWith(Entity p_376785_) static booleancanVehicleCollide(Entity pFirst, Entity pSecond) protected voidcheckFallDamage(double p_376661_, boolean p_376924_, BlockState p_376918_, BlockPos p_376727_) private booleanprotected voidclampRotation(Entity pEntity) private voidprotected voiddefineSynchedData(SynchedEntityData.Builder p_376157_) private voidfloatgetBubbleAngle(float pPartialTick) private intprotected doublegetDismountLocationForPassenger(LivingEntity p_376670_) protected final Itemfloatprotected intprotected Entity.MovementEmissionprotected SoundEventbooleangetPaddleState(int pSide) protected Vec3getPassengerAttachmentPoint(Entity p_376607_, EntityDimensions p_376417_, float p_376713_) final ItemStackVec3[]getRelativePortalPosition(Direction.Axis p_376896_, BlockUtil.FoundRectangle p_376254_) floatgetRowingTime(int pSide, float pPartialTick) protected floatprivate AbstractBoat.StatusfloatbooleanhasEnoughSpaceFor(Entity pEntity) interact(Player p_376241_, InteractionHand p_376920_) booleanbooleanprivate AbstractBoat.StatusbooleanvoidonAboveBubbleColumn(boolean p_376266_, BlockPos p_393506_) voidonPassengerTurned(Entity p_376888_) Applies this entity's orientation to another entity.protected voidpositionRider(Entity p_376397_, Entity.MoveFunction p_376131_) voidApplies a velocity to the entities, to push them away from each other.protected voidreadAdditionalSaveData(ValueInput p_421554_) voidremove(Entity.RemovalReason p_376469_) protected abstract doublerideHeight(EntityDimensions pDimensions) private voidsetBubbleTime(int pBubbleTime) voidsetInitialPos(double pX, double pY, double pZ) voidsetInput(boolean pLeft, boolean pRight, boolean pUp, boolean pDown) voidsetLeashData(Leashable.LeashData p_376525_) voidsetPaddleState(boolean pLeft, boolean pRight) booleanvoidtick()private voidMethods inherited from class net.minecraft.world.entity.vehicle.VehicleEntity
destroy, destroy, getDamage, getDimensionChangingDelay, getHurtDir, getHurtTime, hurtClient, hurtServer, ignoreExplosion, setDamage, setHurtDir, setHurtTime, shouldSourceDestroyMethods inherited from class net.minecraft.world.entity.Entity
absSnapRotationTo, absSnapTo, absSnapTo, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, applyComponentsFromItemStack, applyEffectsFromBlocks, applyEffectsFromBlocks, applyGravity, applyImplicitComponent, applyImplicitComponentIfPresent, applyImplicitComponents, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canBeHitByProjectile, canControlVehicle, canFreeze, canInteractWithLevel, canRide, canSimulateMovement, canSpawnSprintParticle, canSprint, canTeleport, canTrample, canUsePortal, captureDrops, captureDrops, castComponentValue, causeFallDamage, checkBelowWorld, checkDespawn, checkFallDistanceAccumulation, checkSupportingBlock, chunkPosition, clearFire, clearFreeze, clearMovementThisTick, closerThan, closerThan, collectAllColliders, collideBoundingBox, collidedWithFluid, collidedWithShapeMovingFrom, considersEntityAsAlly, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStackForNameResolution, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doCheckFallDamage, doWaterSplashEffect, dropAllLeashConnections, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, forceSetRotation, fudgePositionAfterSizeChange, gameEvent, gameEvent, get, getAddEntityPacket, getAirSupply, getAttachments, getAvailableSpaceBelow, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockSpeedFactor, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCapability, getCapability, getCollisionHorizontalEscapeVector, getControlledVehicle, getCustomName, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDimensions, getDirection, getDisplayName, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getId, getInBlockState, getIndirectPassengers, getInputVector, getKnownMovement, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getLootTable, getMaxAirSupply, getMaxFallDistance, getMaxHeightFluidType, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerRidingPosition, getPassengers, getPassengersAndSelf, getPercentFrozen, getPersistentData, getPickRadius, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPreciseBodyRotation, getPrimaryStepSoundBlockPos, getQuadLeashHolderOffsets, getRandom, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRequiresPrecisePosition, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getSharedFlag, getSlot, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getViewYRot, getVisualRotationYInDegrees, getWeaponItem, getX, getX, getXRot, getXRot, getY, getY, getYHeadRot, getYRot, getYRot, getZ, getZ, handleDamageEvent, handleEntityEvent, handleOnAboveBubbleColumn, handleOnInsideBubbleColumn, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPose, hurt, hurtOrSimulate, igniteForSeconds, igniteForTicks, interactAt, is, isAddedToLevel, isAffectedByBlocks, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isClientAuthoritative, isColliding, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFlyingVehicle, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInClouds, isInFluidType, isInFluidType, isInLava, isInLiquid, isInShallowWater, isInterpolating, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableToBase, isInWall, isInWater, isInWaterOrRain, isLocalClientAuthoritative, isLocalInstanceAuthoritative, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killedEntity, lavaHurt, lavaIgnite, lerpHeadTo, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, lookAt, makeBoundingBox, makeBoundingBox, makeStuckInBlock, markHurt, maxUpStep, maybeBackOffFromEdge, mayInteract, mirror, move, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveRelative, moveTowardsClosestSpace, nextStep, notifyLeasheeRemoved, notifyLeashHolder, oldPosition, onAddedToLevel, onBelowWorld, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onRemoval, onRemovedFromLevel, onSyncedDataUpdated, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, problemPath, processFlappingMovement, processPortalCooldown, propagateFallToPassengers, push, push, reapplyPosition, recreateFromPacket, refreshDimensions, registerDebugValues, registryAccess, removeAfterChangingDimensions, removeLatestMovementRecording, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendBubbleColumnParticles, setAirSupply, setAsInsidePortal, setBoundingBox, setComponent, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPos, setOldPosAndRot, setOldPosAndRot, setOldRot, setOnGround, setOnGroundWithMovement, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRequiresPrecisePosition, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSprinting, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYBodyRot, setYHeadRot, setYRot, shearOffAllLeashConnections, shouldBeSaved, shouldBlockExplode, shouldPlayLavaHurtSound, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, snapTo, snapTo, snapTo, snapTo, snapTo, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, supportQuadLeashAsHolder, syncData, syncPacketPositionCodec, teleport, teleportRelative, teleportSetPosition, teleportSetPosition, teleportSpectators, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoCanPushEntityFluidPushing, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming, waterSwimSoundMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.core.component.DataComponentGetter
get, getOrDefault, getOrDefault, getTyped, has, hasMethods inherited from interface net.neoforged.neoforge.common.extensions.IAbstractBoatExtension
canBoatInFluid, canBoatInFluidMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IEntityExtension
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canSwimInFluidType, copyAttachmentsFrom, getClassification, getFluidFallDistanceModifier, getFluidMotionScale, getParts, getSoundFromFluidType, hasCustomOutlineRendering, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, sendPairingData, shouldRiderSitMethods inherited from interface net.minecraft.world.entity.ItemOwner
asLivingEntityMethods inherited from interface net.minecraft.world.entity.Leashable
canBeLeashed, canHaveALeashAttachedTo, checkElasticInteractions, closeRangeLeashBehaviour, dropLeash, getLeashHolder, getLeashOffset, isLeashed, leashDistanceTo, leashElasticDistance, leashSnapDistance, leashTooFarBehaviour, mayBeLeashed, onElasticLeashPull, onLeashRemoved, readLeashData, removeLeash, setDelayedLeashHolderId, setLeashedTo, whenLeashedTo, writeLeashDataMethods inherited from interface net.minecraft.world.Nameable
getPlainTextNameMethods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
DATA_ID_PADDLE_LEFT
-
DATA_ID_PADDLE_RIGHT
-
DATA_ID_BUBBLE_TIME
-
PADDLE_LEFT
public static final int PADDLE_LEFT- See Also:
-
PADDLE_RIGHT
public static final int PADDLE_RIGHT- See Also:
-
TIME_TO_EJECT
private static final int TIME_TO_EJECT- See Also:
-
PADDLE_SPEED
private static final float PADDLE_SPEED- See Also:
-
PADDLE_SOUND_TIME
public static final double PADDLE_SOUND_TIME- See Also:
-
BUBBLE_TIME
public static final int BUBBLE_TIME- See Also:
-
paddlePositions
private final float[] paddlePositions -
outOfControlTicks
private float outOfControlTicks -
deltaRotation
private float deltaRotation -
interpolation
-
inputLeft
private boolean inputLeft -
inputRight
private boolean inputRight -
inputUp
private boolean inputUp -
inputDown
private boolean inputDown -
waterLevel
private double waterLevel -
landFriction
private float landFriction -
status
-
oldStatus
-
lastYd
private double lastYd -
isAboveBubbleColumn
private boolean isAboveBubbleColumn -
bubbleColumnDirectionIsDown
private boolean bubbleColumnDirectionIsDown -
bubbleMultiplier
private float bubbleMultiplier -
bubbleAngle
private float bubbleAngle -
bubbleAngleO
private float bubbleAngleO -
leashData
-
dropItem
-
-
Constructor Details
-
AbstractBoat
public AbstractBoat(EntityType<? extends AbstractBoat> pEntityType, Level pLevel, Supplier<Item> pDropItem)
-
-
Method Details
-
setInitialPos
public void setInitialPos(double pX, double pY, double pZ) -
getMovementEmission
- Overrides:
getMovementEmissionin classEntity
-
defineSynchedData
- Overrides:
defineSynchedDatain classVehicleEntity
-
canCollideWith
- Overrides:
canCollideWithin classEntity
-
canVehicleCollide
-
canBeCollidedWith
- Overrides:
canBeCollidedWithin classEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushablein classEntity
-
getRelativePortalPosition
- Overrides:
getRelativePortalPositionin classEntity
-
rideHeight
-
getPassengerAttachmentPoint
protected Vec3 getPassengerAttachmentPoint(Entity p_376607_, EntityDimensions p_376417_, float p_376713_) - Overrides:
getPassengerAttachmentPointin classEntity
-
onAboveBubbleColumn
- Overrides:
onAboveBubbleColumnin classEntity
-
push
Description copied from class:EntityApplies a velocity to the entities, to push them away from each other. -
animateHurt
public void animateHurt(float p_376617_) - Overrides:
animateHurtin classEntity
-
isPickable
public boolean isPickable()- Overrides:
isPickablein classEntity
-
getInterpolation
- Overrides:
getInterpolationin classEntity
-
getMotionDirection
- Overrides:
getMotionDirectionin classEntity
-
tick
public void tick() -
tickBubbleColumn
private void tickBubbleColumn() -
getPaddleSound
-
setPaddleState
public void setPaddleState(boolean pLeft, boolean pRight) -
getRowingTime
public float getRowingTime(int pSide, float pPartialTick) -
getLeashData
- Specified by:
getLeashDatain interfaceLeashable
-
setLeashData
- Specified by:
setLeashDatain interfaceLeashable
-
getLeashOffset
- Specified by:
getLeashOffsetin interfaceLeashable
-
supportQuadLeash
public boolean supportQuadLeash()- Specified by:
supportQuadLeashin interfaceLeashable
-
getQuadLeashOffsets
- Specified by:
getQuadLeashOffsetsin interfaceLeashable
-
getStatus
-
getWaterLevelAbove
public float getWaterLevelAbove() -
getGroundFriction
public float getGroundFriction() -
checkInWater
private boolean checkInWater() -
isUnderwater
-
getDefaultGravity
protected double getDefaultGravity()- Overrides:
getDefaultGravityin classEntity
-
floatBoat
private void floatBoat() -
controlBoat
private void controlBoat() -
getSinglePassengerXOffset
protected float getSinglePassengerXOffset() -
hasEnoughSpaceFor
-
positionRider
- Overrides:
positionRiderin classEntity
-
getDismountLocationForPassenger
- Overrides:
getDismountLocationForPassengerin classEntity
-
clampRotation
-
onPassengerTurned
Description copied from class:EntityApplies this entity's orientation to another entity. Used to update passenger orientation.- Overrides:
onPassengerTurnedin classEntity
-
addAdditionalSaveData
- Specified by:
addAdditionalSaveDatain classEntity
-
readAdditionalSaveData
- Specified by:
readAdditionalSaveDatain classEntity
-
interact
-
remove
-
checkFallDamage
protected void checkFallDamage(double p_376661_, boolean p_376924_, BlockState p_376918_, BlockPos p_376727_) - Overrides:
checkFallDamagein classEntity
-
getPaddleState
public boolean getPaddleState(int pSide) -
setBubbleTime
private void setBubbleTime(int pBubbleTime) -
getBubbleTime
private int getBubbleTime() -
getBubbleAngle
public float getBubbleAngle(float pPartialTick) -
canAddPassenger
- Overrides:
canAddPassengerin classEntity
-
getMaxPassengers
protected int getMaxPassengers() -
getControllingPassenger
- Overrides:
getControllingPassengerin classEntity
-
setInput
public void setInput(boolean pLeft, boolean pRight, boolean pUp, boolean pDown) -
isUnderWater
public boolean isUnderWater()- Overrides:
isUnderWaterin classEntity
-
getDropItem
- Specified by:
getDropItemin classVehicleEntity
-
getPickResult
- Overrides:
getPickResultin classEntity
-