Class Boat
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.vehicle.VehicleEntity
net.minecraft.world.entity.vehicle.Boat
- All Implemented Interfaces:
CommandSource
,SyncedDataHolder
,Leashable
,VariantHolder<Boat.Type>
,EntityAccess
,Nameable
,ScoreHolder
,IAttachmentHolder
,IBoatExtension
,IEntityExtension
,INBTSerializable<CompoundTag>
- Direct Known Subclasses:
ChestBoat
public class Boat
extends VehicleEntity
implements Leashable, VariantHolder<Boat.Type>, IBoatExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReason
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
Nested classes/interfaces inherited from interface net.minecraft.world.entity.Leashable
Leashable.LeashData
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
private float
private float
private boolean
private float
private static final EntityDataAccessor
<Integer> private static final EntityDataAccessor
<Boolean> private static final EntityDataAccessor
<Boolean> private static final EntityDataAccessor
<Integer> private float
private boolean
private boolean
private boolean
private boolean
private float
private boolean
private float
private double
private Leashable.LeashData
private int
private double
private double
private double
private double
private double
private Boat.Status
private float
static final int
static final int
static final double
private static final float
private final float[]
private Boat.Status
private static final int
private double
Fields inherited from class net.minecraft.world.entity.vehicle.VehicleEntity
DATA_ID_DAMAGE, DATA_ID_HURT, DATA_ID_HURTDIR
Fields 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, ID_TAG, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalProcess, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOld
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.minecraft.commands.CommandSource
NULL
Fields inherited from interface net.minecraft.world.entity.Leashable
LEASH_ELASTIC_DIST, LEASH_TAG, LEASH_TOO_FAR_DIST
Fields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAdditionalSaveData
(CompoundTag pCompound) void
animateHurt
(float pYaw) protected boolean
canAddPassenger
(Entity pPassenger) boolean
boolean
canCollideWith
(Entity pEntity) static boolean
canVehicleCollide
(Entity pVehicle, Entity pEntity) protected void
checkFallDamage
(double pY, boolean pOnGround, BlockState pState, BlockPos pPos) private boolean
protected void
clampRotation
(Entity pEntityToUpdate) Applies this boat's yaw to the given entity.private void
protected void
defineSynchedData
(SynchedEntityData.Builder pBuilder) void
elasticRangeLeashBehaviour
(Entity pLeashHolder, float pDistance) private void
float
getBubbleAngle
(float pPartialTicks) private int
protected double
getDismountLocationForPassenger
(LivingEntity pLivingEntity) float
protected int
protected Entity.MovementEmission
protected SoundEvent
boolean
getPaddleState
(int pSide) protected Vec3
getPassengerAttachmentPoint
(Entity pEntity, EntityDimensions pDimensions, float pPartialTick) getRelativePortalPosition
(Direction.Axis pAxis, BlockUtil.FoundRectangle pPortal) float
getRowingTime
(int pSide, float pLimbSwing) protected float
private Boat.Status
protected Component
float
boolean
hasEnoughSpaceFor
(Entity pEntity) interact
(Player pPlayer, InteractionHand pHand) boolean
boolean
private Boat.Status
boolean
double
float
double
float
double
void
lerpTo
(double pX, double pY, double pZ, float pYRot, float pXRot, int pSteps) void
onAboveBubbleCol
(boolean pDownwards) void
onPassengerTurned
(Entity pEntityToUpdate) Applies this entity's orientation (pitch/yaw) to another entity.protected void
positionRider
(Entity pPassenger, Entity.MoveFunction pCallback) void
Applies a velocity to the entities, to push them away from each other.protected void
readAdditionalSaveData
(CompoundTag pCompound) (abstract) Protected helper method to read subclass entity data from NBT.void
remove
(Entity.RemovalReason pReason) private void
setBubbleTime
(int pBubbleTime) void
setInput
(boolean pInputLeft, boolean pInputRight, boolean pInputUp, boolean pInputDown) void
setLeashData
(Leashable.LeashData pLeashData) void
setPaddleState
(boolean pLeft, boolean pRight) void
setVariant
(Boat.Type pVariant) void
tick()
private void
private void
tickLerp()
Methods inherited from class net.minecraft.world.entity.vehicle.VehicleEntity
destroy, destroy, getDamage, getHurtDir, getHurtTime, hurt, setDamage, setHurtDir, setHurtTime, shouldSourceDestroy
Methods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, absRotateTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, applyGravity, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canBeHitByProjectile, canChangeDimensions, canControlVehicle, canFreeze, canRide, canSpawnSprintParticle, canSprint, canTrample, canUsePortal, captureDrops, captureDrops, causeFallDamage, changeDimension, checkBelowWorld, checkDespawn, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, fudgePositionAfterSizeChange, gameEvent, gameEvent, getAddEntityPacket, getAirSupply, getAttachments, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockSpeedFactor, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForCulling, getCapability, getCapability, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getCustomName, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDisplayName, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getId, getInBlockState, getIndirectPassengers, getKnownMovement, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMaxHeightFluidType, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerRidingPosition, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPreciseBodyRotation, getPrimaryStepSoundBlockPos, getRandom, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSlot, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getViewYRot, getVisualRotationYInDegrees, getWeaponItem, getX, getX, getXRot, getY, getY, getYHeadRot, getYRot, getZ, getZ, handleDamageEvent, handleEntityEvent, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, igniteForSeconds, igniteForTicks, ignoreExplosion, interactAt, is, isAddedToLevel, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWall, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killedEntity, lavaHurt, lerpHeadTo, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, lookAt, makeBoundingBox, makeStuckInBlock, markHurt, maxUpStep, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAddedToLevel, onBelowWorld, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onRemovedFromLevel, onSyncedDataUpdated, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, processFlappingMovement, processPortalCooldown, push, push, reapplyPosition, recreateFromPacket, refreshDimensions, registryAccess, removeAfterChangingDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendSystemMessage, setAirSupply, setAsInsidePortal, setBoundingBox, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSprinting, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYBodyRot, setYHeadRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming, waterSwimSound
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachments
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.commands.CommandSource
alwaysAccepts
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBoatExtension
canBoatInFluid, canBoatInFluid
Methods inherited from interface net.neoforged.neoforge.common.extensions.IEntityExtension
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canSwimInFluidType, copyAttachmentsFrom, deserializeNBT, getClassification, getFluidFallDistanceModifier, getFluidMotionScale, getParts, getPickedResult, getSoundFromFluidType, hasCustomOutlineRendering, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, sendPairingData, serializeNBT, shouldRiderSit
Methods inherited from interface net.minecraft.world.entity.Leashable
canBeLeashed, canHaveALeashAttachedToIt, closeRangeLeashBehaviour, dropLeash, getLeashHolder, handleLeashAtDistance, isLeashed, leashTooFarBehaviour, mayBeLeashed, readLeashData, setDelayedLeashHolderId, setLeashedTo, writeLeashData
Methods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
DATA_ID_TYPE
-
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 -
invFriction
private float invFriction -
outOfControlTicks
private float outOfControlTicks -
deltaRotation
private float deltaRotation -
lerpSteps
private int lerpSteps -
lerpX
private double lerpX -
lerpY
private double lerpY -
lerpZ
private double lerpZ -
lerpYRot
private double lerpYRot -
lerpXRot
private double lerpXRot -
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
-
-
Constructor Details
-
Boat
-
Boat
-
-
Method Details
-
getMovementEmission
- Overrides:
getMovementEmission
in classEntity
-
defineSynchedData
- Overrides:
defineSynchedData
in classVehicleEntity
-
canCollideWith
- Overrides:
canCollideWith
in classEntity
-
canVehicleCollide
-
canBeCollidedWith
public boolean canBeCollidedWith()- Overrides:
canBeCollidedWith
in classEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushable
in classEntity
-
getRelativePortalPosition
- Overrides:
getRelativePortalPosition
in classEntity
-
getPassengerAttachmentPoint
protected Vec3 getPassengerAttachmentPoint(Entity pEntity, EntityDimensions pDimensions, float pPartialTick) - Overrides:
getPassengerAttachmentPoint
in classEntity
-
onAboveBubbleCol
public void onAboveBubbleCol(boolean pDownwards) - Overrides:
onAboveBubbleCol
in classEntity
-
push
Applies a velocity to the entities, to push them away from each other. -
getDropItem
- Specified by:
getDropItem
in classVehicleEntity
-
animateHurt
public void animateHurt(float pYaw) - Overrides:
animateHurt
in classEntity
-
isPickable
public boolean isPickable()- Overrides:
isPickable
in classEntity
-
lerpTo
public void lerpTo(double pX, double pY, double pZ, float pYRot, float pXRot, int pSteps) -
lerpTargetX
public double lerpTargetX()- Overrides:
lerpTargetX
in classEntity
-
lerpTargetY
public double lerpTargetY()- Overrides:
lerpTargetY
in classEntity
-
lerpTargetZ
public double lerpTargetZ()- Overrides:
lerpTargetZ
in classEntity
-
lerpTargetXRot
public float lerpTargetXRot()- Overrides:
lerpTargetXRot
in classEntity
-
lerpTargetYRot
public float lerpTargetYRot()- Overrides:
lerpTargetYRot
in classEntity
-
getMotionDirection
- Overrides:
getMotionDirection
in classEntity
-
tick
public void tick() -
tickBubbleColumn
private void tickBubbleColumn() -
getPaddleSound
-
tickLerp
private void tickLerp() -
setPaddleState
public void setPaddleState(boolean pLeft, boolean pRight) -
getRowingTime
public float getRowingTime(int pSide, float pLimbSwing) -
getLeashData
- Specified by:
getLeashData
in interfaceLeashable
-
setLeashData
- Specified by:
setLeashData
in interfaceLeashable
-
getLeashOffset
- Overrides:
getLeashOffset
in classEntity
-
elasticRangeLeashBehaviour
- Specified by:
elasticRangeLeashBehaviour
in interfaceLeashable
-
getStatus
-
getWaterLevelAbove
public float getWaterLevelAbove() -
getGroundFriction
public float getGroundFriction() -
checkInWater
private boolean checkInWater() -
isUnderwater
-
getDefaultGravity
protected double getDefaultGravity()- Overrides:
getDefaultGravity
in classEntity
-
floatBoat
private void floatBoat() -
controlBoat
private void controlBoat() -
getSinglePassengerXOffset
protected float getSinglePassengerXOffset() -
hasEnoughSpaceFor
-
positionRider
- Overrides:
positionRider
in classEntity
-
getDismountLocationForPassenger
- Overrides:
getDismountLocationForPassenger
in classEntity
-
clampRotation
Applies this boat's yaw to the given entity. Used to update the orientation of its passenger. -
onPassengerTurned
Applies this entity's orientation (pitch/yaw) to another entity. Used to update passenger orientation.- Overrides:
onPassengerTurned
in classEntity
-
addAdditionalSaveData
- Specified by:
addAdditionalSaveData
in classEntity
-
readAdditionalSaveData
(abstract) Protected helper method to read subclass entity data from NBT.- Specified by:
readAdditionalSaveData
in classEntity
-
interact
-
remove
-
checkFallDamage
- Overrides:
checkFallDamage
in classEntity
-
getPaddleState
public boolean getPaddleState(int pSide) -
setBubbleTime
private void setBubbleTime(int pBubbleTime) -
getBubbleTime
private int getBubbleTime() -
getBubbleAngle
public float getBubbleAngle(float pPartialTicks) -
setVariant
- Specified by:
setVariant
in interfaceVariantHolder<Boat.Type>
-
getVariant
- Specified by:
getVariant
in interfaceVariantHolder<Boat.Type>
-
canAddPassenger
- Overrides:
canAddPassenger
in classEntity
-
getMaxPassengers
protected int getMaxPassengers() -
getControllingPassenger
- Overrides:
getControllingPassenger
in classEntity
-
setInput
public void setInput(boolean pInputLeft, boolean pInputRight, boolean pInputUp, boolean pInputDown) -
getTypeName
- Overrides:
getTypeName
in classEntity
-
isUnderWater
public boolean isUnderWater()- Overrides:
isUnderWater
in classEntity
-
getPickResult
- Overrides:
getPickResult
in classEntity
-