Class OrientedContraptionEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
com.simibubi.create.content.contraptions.AbstractContraptionEntity
com.simibubi.create.content.contraptions.OrientedContraptionEntity
- All Implemented Interfaces:
net.minecraft.commands.CommandSource,net.minecraft.network.syncher.SyncedDataHolder,net.minecraft.world.level.entity.EntityAccess,net.minecraft.world.Nameable,net.minecraft.world.scores.ScoreHolder,net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.common.extensions.IEntityExtension,net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>,net.neoforged.neoforge.entity.IEntityWithComplexSpawn
- Direct Known Subclasses:
CarriageContraptionEntity
Ex: Minecarts, Couplings
Oriented Contraption Entities can rotate freely around two axes simultaneously.
Oriented Contraption Entities can rotate freely around two axes simultaneously.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.simibubi.create.content.contraptions.AbstractContraptionEntity
AbstractContraptionEntity.ContraptionRotationStateNested classes/interfaces inherited from class net.minecraft.world.entity.Entity
net.minecraft.world.entity.Entity.MoveFunction, net.minecraft.world.entity.Entity.MovementEmission, net.minecraft.world.entity.Entity.RemovalReasonNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected net.minecraft.world.phys.Vec3intfloatfloatfloatfloatfloatFields inherited from class com.simibubi.create.content.contraptions.AbstractContraptionEntity
collidingEntities, contraption, initialized, prevPosInvalid, staleTicksFields 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, removalReason, 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.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionOrientedContraptionEntity(net.minecraft.world.entity.EntityType<?> type, net.minecraft.world.level.Level world) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyLocalTransforms(com.mojang.blaze3d.vertex.PoseStack matrixStack, float partialTicks) net.minecraft.world.phys.Vec3applyRotation(net.minecraft.world.phys.Vec3 localPos, float partialTicks) protected voidattachInventoriesFromRidingCarts(net.minecraft.world.entity.Entity riding, boolean isOnCoupling, UUID couplingId) static OrientedContraptionEntitycreate(net.minecraft.world.level.Level world, Contraption contraption, net.minecraft.core.Direction initialOrientation) static OrientedContraptionEntitycreateAtYaw(net.minecraft.world.level.Level world, Contraption contraption, net.minecraft.core.Direction initialOrientation, float initialYaw) protected voiddefineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder) net.minecraft.world.phys.Vec3@Nullable net.createmod.catnip.data.Couple<MinecartController> @Nullable UUIDnet.minecraft.core.Directionfloatnet.minecraft.world.phys.Vec3protected floatnet.minecraft.world.phys.Vec3getVehicleAttachmentPoint(net.minecraft.world.entity.Entity entity) floatgetViewXRot(float partialTicks) floatgetViewYRot(float partialTicks) floatstatic voidprotected voidhandleStallInformation(double x, double y, double z, float angle) booleanprotected StructureTransformvoidonSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> key) protected voidpowerFurnaceCartWithFuelFromStorage(net.minecraft.world.entity.Entity riding) protected voidreadAdditional(net.minecraft.nbt.CompoundTag compound, boolean spawnPacket) net.minecraft.world.phys.Vec3reverseRotation(net.minecraft.world.phys.Vec3 localPos, float partialTicks) voidsetCouplingId(UUID id) voidsetInitialOrientation(net.minecraft.core.Direction direction) voidvoidstartAtYaw(float yaw) voidprotected voidprotected booleanupdateOrientation(boolean rotationLock, boolean wasStalled, net.minecraft.world.entity.Entity riding, boolean isOnCoupling) protected voidwriteAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean spawnPacket) Methods inherited from class com.simibubi.create.content.contraptions.AbstractContraptionEntity
addAdditionalSaveData, addSittingPassenger, alignPassenger, build, canAddPassenger, canCollideWith, canInteractWithBlock, canInteractWithBlock, collisionEnabled, contraptionInitialize, control, disassemble, doWaterSplashEffect, fireImmune, getContactPointMotion, getContraption, getContraptionName, getControllingPlayer, getDismountLocationForPassenger, getPassengerPosition, getPistonPushReaction, getPrevPositionVec, handleBlockChange, handlePlayerInteraction, hasExactlyOnePlayerPassenger, hurt, igniteForTicks, isActorActive, isAliveOrStale, isIgnoringBlockTriggers, isPickable, isPrevPosInvalid, isReadyForRender, isStalled, kill, move, move, onBelowWorld, onContraptionStalled, onRemovedFromLevel, pitchFromVector, positionRider, readAdditionalSaveData, readSpawnData, refreshPSIs, registerColliding, remove, removePassenger, saveWithoutId, setBlock, setContraption, setContraptionMotion, setControllingPlayer, setDeltaMovement, setPos, shouldActorTrigger, startControlling, stopControlling, supportsTerrainCollision, tick, tickActors, toGlobalVector, toGlobalVector, toLocalVector, toLocalVector, updateInWaterStateAndDoFluidPushing, writeSpawnData, yawFromVectorMethods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, absRotateTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, animateHurt, applyGravity, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canBeCollidedWith, canBeHitByProjectile, canChangeDimensions, canControlVehicle, canFreeze, canRide, canSpawnSprintParticle, canSprint, canTrample, canUsePortal, captureDrops, captureDrops, causeFallDamage, changeDimension, checkBelowWorld, checkDespawn, checkFallDamage, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, 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, getControllingPassenger, getCustomName, getDefaultGravity, 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, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMaxHeightFluidType, getMotionDirection, getMovementEmission, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengerRidingPosition, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPickResult, getPortalCooldown, getPose, getPosition, getPositionCodec, getPreciseBodyRotation, getPrimaryStepSoundBlockPos, getRandom, getRandomX, getRandomY, getRandomZ, getRelativePortalPosition, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSlot, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getVisualRotationYInDegrees, getWeaponItem, getX, getX, getXRot, getY, getY, getYHeadRot, getYRot, getZ, getZ, handleDamageEvent, handleEntityEvent, handlePortal, hasControllingPassenger, hasCustomName, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, igniteForSeconds, ignoreExplosion, interact, interactAt, is, isAddedToLevel, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWall, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPushable, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, killedEntity, lavaHurt, lerpHeadTo, lerpMotion, lerpPositionAndRotationStep, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, level, limitPistonMovement, load, lookAt, makeBoundingBox, makeStuckInBlock, markHurt, maxUpStep, maybeBackOffFromEdge, mayInteract, mirror, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToLevel, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, processFlappingMovement, processPortalCooldown, push, push, push, reapplyPosition, recreateFromPacket, refreshDimensions, registryAccess, removeAfterChangingDimensions, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rideTick, rotate, save, saveAsPassenger, sendSystemMessage, setAirSupply, setAsInsidePortal, setBoundingBox, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, 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, stopSeenByPlayer, syncData, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, 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.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.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
motionBeforeStall
protected net.minecraft.world.phys.Vec3 motionBeforeStall -
forceAngle
protected boolean forceAngle -
prevYaw
public float prevYaw -
yaw
public float yaw -
targetYaw
public float targetYaw -
prevPitch
public float prevPitch -
pitch
public float pitch -
nonDamageTicks
public int nonDamageTicks
-
-
Constructor Details
-
OrientedContraptionEntity
public OrientedContraptionEntity(net.minecraft.world.entity.EntityType<?> type, net.minecraft.world.level.Level world)
-
-
Method Details
-
create
public static OrientedContraptionEntity create(net.minecraft.world.level.Level world, Contraption contraption, net.minecraft.core.Direction initialOrientation) -
createAtYaw
public static OrientedContraptionEntity createAtYaw(net.minecraft.world.level.Level world, Contraption contraption, net.minecraft.core.Direction initialOrientation, float initialYaw) -
setInitialOrientation
public void setInitialOrientation(net.minecraft.core.Direction direction) -
getInitialOrientation
public net.minecraft.core.Direction getInitialOrientation() -
getYawOffset
public float getYawOffset()- Overrides:
getYawOffsetin classAbstractContraptionEntity
-
getInitialYaw
public float getInitialYaw() -
defineSynchedData
protected void defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder) - Overrides:
defineSynchedDatain classAbstractContraptionEntity
-
getRotationState
- Specified by:
getRotationStatein classAbstractContraptionEntity
-
stopRiding
public void stopRiding()- Overrides:
stopRidingin classnet.minecraft.world.entity.Entity
-
readAdditional
protected void readAdditional(net.minecraft.nbt.CompoundTag compound, boolean spawnPacket) - Overrides:
readAdditionalin classAbstractContraptionEntity
-
writeAdditional
protected void writeAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean spawnPacket) - Overrides:
writeAdditionalin classAbstractContraptionEntity
-
onSyncedDataUpdated
public void onSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> key) - Specified by:
onSyncedDataUpdatedin interfacenet.minecraft.network.syncher.SyncedDataHolder- Overrides:
onSyncedDataUpdatedin classnet.minecraft.world.entity.Entity
-
isInitialOrientationPresent
public boolean isInitialOrientationPresent() -
startAtInitialYaw
public void startAtInitialYaw() -
startAtYaw
public void startAtYaw(float yaw) -
applyRotation
public net.minecraft.world.phys.Vec3 applyRotation(net.minecraft.world.phys.Vec3 localPos, float partialTicks) - Specified by:
applyRotationin classAbstractContraptionEntity
-
reverseRotation
public net.minecraft.world.phys.Vec3 reverseRotation(net.minecraft.world.phys.Vec3 localPos, float partialTicks) - Specified by:
reverseRotationin classAbstractContraptionEntity
-
getViewYRot
public float getViewYRot(float partialTicks) - Overrides:
getViewYRotin classnet.minecraft.world.entity.Entity
-
getViewXRot
public float getViewXRot(float partialTicks) - Overrides:
getViewXRotin classnet.minecraft.world.entity.Entity
-
tickContraption
protected void tickContraption()- Specified by:
tickContraptionin classAbstractContraptionEntity
-
updateOrientation
protected boolean updateOrientation(boolean rotationLock, boolean wasStalled, net.minecraft.world.entity.Entity riding, boolean isOnCoupling) -
powerFurnaceCartWithFuelFromStorage
protected void powerFurnaceCartWithFuelFromStorage(net.minecraft.world.entity.Entity riding) -
getCoupledCartsIfPresent
@Nullable public @Nullable net.createmod.catnip.data.Couple<MinecartController> getCoupledCartsIfPresent() -
attachInventoriesFromRidingCarts
protected void attachInventoriesFromRidingCarts(net.minecraft.world.entity.Entity riding, boolean isOnCoupling, UUID couplingId) -
getCouplingId
-
setCouplingId
-
getVehicleAttachmentPoint
public net.minecraft.world.phys.Vec3 getVehicleAttachmentPoint(net.minecraft.world.entity.Entity entity) - Overrides:
getVehicleAttachmentPointin classnet.minecraft.world.entity.Entity
-
getAnchorVec
public net.minecraft.world.phys.Vec3 getAnchorVec()- Overrides:
getAnchorVecin classAbstractContraptionEntity
-
getPrevAnchorVec
public net.minecraft.world.phys.Vec3 getPrevAnchorVec()- Overrides:
getPrevAnchorVecin classAbstractContraptionEntity
-
makeStructureTransform
- Specified by:
makeStructureTransformin classAbstractContraptionEntity
-
getStalledAngle
protected float getStalledAngle()- Specified by:
getStalledAnglein classAbstractContraptionEntity
-
handleStallInformation
protected void handleStallInformation(double x, double y, double z, float angle) - Specified by:
handleStallInformationin classAbstractContraptionEntity
-
applyLocalTransforms
public void applyLocalTransforms(com.mojang.blaze3d.vertex.PoseStack matrixStack, float partialTicks) - Specified by:
applyLocalTransformsin classAbstractContraptionEntity
-
handleRelocationPacket
-