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.RemovalReasonNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface net.minecraft.world.entity.Leashable
Leashable.LeashData -
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 static final EntityDataAccessor<Integer> private floatprivate booleanprivate booleanprivate booleanprivate booleanprivate floatprivate booleanprivate floatprivate doubleprivate Leashable.LeashDataprivate intprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate Boat.Statusprivate floatstatic final intstatic final intstatic final doubleprivate static final floatprivate final float[]private Boat.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, 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, zOldFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.commands.CommandSource
NULLFields inherited from interface net.minecraft.world.entity.Leashable
LEASH_ELASTIC_DIST, LEASH_TAG, LEASH_TOO_FAR_DISTFields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAdditionalSaveData(CompoundTag pCompound) voidanimateHurt(float pYaw) protected booleancanAddPassenger(Entity pPassenger) booleanbooleancanCollideWith(Entity pEntity) static booleancanVehicleCollide(Entity pVehicle, Entity pEntity) protected voidcheckFallDamage(double pY, boolean pOnGround, BlockState pState, BlockPos pPos) private booleanprotected voidclampRotation(Entity pEntityToUpdate) Applies this boat's yaw to the given entity.private voidprotected voiddefineSynchedData(SynchedEntityData.Builder pBuilder) voidelasticRangeLeashBehaviour(Entity pLeashHolder, float pDistance) private voidfloatgetBubbleAngle(float pPartialTicks) private intprotected doublegetDismountLocationForPassenger(LivingEntity pLivingEntity) floatprotected intprotected Entity.MovementEmissionprotected SoundEventbooleangetPaddleState(int pSide) protected Vec3getPassengerAttachmentPoint(Entity pEntity, EntityDimensions pDimensions, float pPartialTick) getRelativePortalPosition(Direction.Axis pAxis, BlockUtil.FoundRectangle pPortal) floatgetRowingTime(int pSide, float pLimbSwing) protected floatprivate Boat.Statusprotected ComponentfloatbooleanhasEnoughSpaceFor(Entity pEntity) interact(Player pPlayer, InteractionHand pHand) booleanbooleanprivate Boat.StatusbooleandoublefloatdoublefloatdoublevoidlerpTo(double pX, double pY, double pZ, float pYRot, float pXRot, int pSteps) voidonAboveBubbleCol(boolean pDownwards) voidonPassengerTurned(Entity pEntityToUpdate) Applies this entity's orientation (pitch/yaw) to another entity.protected voidpositionRider(Entity pPassenger, Entity.MoveFunction pCallback) voidApplies a velocity to the entities, to push them away from each other.protected voidreadAdditionalSaveData(CompoundTag pCompound) (abstract) Protected helper method to read subclass entity data from NBT.voidremove(Entity.RemovalReason pReason) private voidsetBubbleTime(int pBubbleTime) voidsetInput(boolean pInputLeft, boolean pInputRight, boolean pInputUp, boolean pInputDown) voidsetLeashData(Leashable.LeashData pLeashData) voidsetPaddleState(boolean pLeft, boolean pRight) voidsetVariant(Boat.Type pVariant) voidtick()private voidprivate voidtickLerp()Methods inherited from class net.minecraft.world.entity.vehicle.VehicleEntity
destroy, destroy, getDamage, getHurtDir, getHurtTime, hurt, setDamage, setHurtDir, setHurtTime, shouldSourceDestroyMethods 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, syncData, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, 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.commands.CommandSource
alwaysAcceptsMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBoatExtension
canBoatInFluid, canBoatInFluidMethods 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, shouldRiderSitMethods inherited from interface net.minecraft.world.entity.Leashable
canBeLeashed, canHaveALeashAttachedToIt, closeRangeLeashBehaviour, dropLeash, getLeashHolder, handleLeashAtDistance, isLeashed, leashTooFarBehaviour, mayBeLeashed, readLeashData, setDelayedLeashHolderId, setLeashedTo, writeLeashDataMethods 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:
getMovementEmissionin classEntity
-
defineSynchedData
- Overrides:
defineSynchedDatain classVehicleEntity
-
canCollideWith
- Overrides:
canCollideWithin classEntity
-
canVehicleCollide
-
canBeCollidedWith
public boolean canBeCollidedWith()- Overrides:
canBeCollidedWithin classEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushablein classEntity
-
getRelativePortalPosition
- Overrides:
getRelativePortalPositionin classEntity
-
getPassengerAttachmentPoint
protected Vec3 getPassengerAttachmentPoint(Entity pEntity, EntityDimensions pDimensions, float pPartialTick) - Overrides:
getPassengerAttachmentPointin classEntity
-
onAboveBubbleCol
public void onAboveBubbleCol(boolean pDownwards) - Overrides:
onAboveBubbleColin classEntity
-
push
Applies a velocity to the entities, to push them away from each other. -
getDropItem
- Specified by:
getDropItemin classVehicleEntity
-
animateHurt
public void animateHurt(float pYaw) - Overrides:
animateHurtin classEntity
-
isPickable
public boolean isPickable()- Overrides:
isPickablein classEntity
-
lerpTo
public void lerpTo(double pX, double pY, double pZ, float pYRot, float pXRot, int pSteps) -
lerpTargetX
public double lerpTargetX()- Overrides:
lerpTargetXin classEntity
-
lerpTargetY
public double lerpTargetY()- Overrides:
lerpTargetYin classEntity
-
lerpTargetZ
public double lerpTargetZ()- Overrides:
lerpTargetZin classEntity
-
lerpTargetXRot
public float lerpTargetXRot()- Overrides:
lerpTargetXRotin classEntity
-
lerpTargetYRot
public float lerpTargetYRot()- Overrides:
lerpTargetYRotin classEntity
-
getMotionDirection
- Overrides:
getMotionDirectionin 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:
getLeashDatain interfaceLeashable
-
setLeashData
- Specified by:
setLeashDatain interfaceLeashable
-
getLeashOffset
- Overrides:
getLeashOffsetin classEntity
-
elasticRangeLeashBehaviour
- Specified by:
elasticRangeLeashBehaviourin 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
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:
onPassengerTurnedin classEntity
-
addAdditionalSaveData
- Specified by:
addAdditionalSaveDatain classEntity
-
readAdditionalSaveData
(abstract) Protected helper method to read subclass entity data from NBT.- Specified by:
readAdditionalSaveDatain classEntity
-
interact
-
remove
-
checkFallDamage
- Overrides:
checkFallDamagein 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:
setVariantin interfaceVariantHolder<Boat.Type>
-
getVariant
- Specified by:
getVariantin interfaceVariantHolder<Boat.Type>
-
canAddPassenger
- Overrides:
canAddPassengerin classEntity
-
getMaxPassengers
protected int getMaxPassengers() -
getControllingPassenger
- Overrides:
getControllingPassengerin classEntity
-
setInput
public void setInput(boolean pInputLeft, boolean pInputRight, boolean pInputUp, boolean pInputDown) -
getTypeName
- Overrides:
getTypeNamein classEntity
-
isUnderWater
public boolean isUnderWater()- Overrides:
isUnderWaterin classEntity
-
getPickResult
- Overrides:
getPickResultin classEntity
-