Class ManaSparkEntity

java.lang.Object
net.minecraft.world.entity.Entity
vazkii.botania.common.entity.SparkBaseEntity
vazkii.botania.common.entity.ManaSparkEntity
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, SparkEntity, ManaSpark

public class ManaSparkEntity extends SparkBaseEntity implements ManaSpark
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
     

    Nested 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.RemovalReason
  • Field Summary

    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, entityData, fallDistance, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, 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 interface net.minecraft.commands.CommandSource

    NULL

    Fields inherited from interface net.minecraft.world.scores.ScoreHolder

    WILDCARD, WILDCARD_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    ManaSparkEntity(net.minecraft.world.entity.EntityType<ManaSparkEntity> type, net.minecraft.world.level.Level world)
     
    ManaSparkEntity(net.minecraft.world.level.Level world)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addAdditionalSaveData(@NotNull net.minecraft.nbt.CompoundTag cmp)
     
    boolean
    protected void
    defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
     
    @Nullable ManaReceiver
     
    Get the thing this spark is attached to, if any
    Gets a collection of all Sparks this is tranfering to.
    @NotNull net.minecraft.world.item.ItemStack
     
    protected net.minecraft.world.item.Item
     
     
    net.minecraft.world.InteractionResult
    interact(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
     
    static void
    particleBeam(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.Entity e1, net.minecraft.world.entity.Entity e2)
     
    protected void
    readAdditionalSaveData(@NotNull net.minecraft.nbt.CompoundTag cmp)
     
    void
    Registers the Spark passed in as a Spark meant for mana to be transfered towards.
    void
    remove(net.minecraft.world.entity.Entity.RemovalReason removalReason)
     
    void
    setNetwork(net.minecraft.world.item.DyeColor color)
     
    void
     
    void
     
    void
    Makes that spark register transfers for all relevant sparks, needs to be called whenever the connected sparks may change (setNetwork, remove and setUpgrade should already do this)

    Methods inherited from class vazkii.botania.common.entity.SparkBaseEntity

    getAddEntityPacket, getAttachPos, getNetwork, isPickable

    Methods 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, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canChangeDimensions, canCollideWith, canControlVehicle, canFreeze, canRide, canSpawnSprintParticle, canSprint, canUsePortal, 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, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, fudgePositionAfterSizeChange, gameEvent, gameEvent, getAirSupply, getAttachments, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockSpeedFactor, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForCulling, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getControllingPassenger, getCustomName, getDefaultGravity, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyePosition, getEyePosition, getEyeY, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getForward, getGravity, getHandHoldingItemAngle, getId, getInBlockState, getIndirectPassengers, getKnownMovement, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMotionDirection, getMovementEmission, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengerRidingPosition, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPickRadius, getPistonPushReaction, 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, 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, hurt, igniteForSeconds, igniteForTicks, ignoreExplosion, interactAt, is, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, 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, kill, killedEntity, lavaHurt, lerpHeadTo, lerpMotion, lerpPositionAndRotationStep, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, level, limitPistonMovement, load, lookAt, makeBoundingBox, makeStuckInBlock, markHurt, maxUpStep, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onBelowWorld, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onSyncedDataUpdated, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, push, push, push, reapplyPosition, recreateFromPacket, refreshDimensions, registryAccess, removeAfterChangingDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendSystemMessage, setAirSupply, setAsInsidePortal, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, 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, updateInWaterStateAndDoFluidPushing, updateSwimming, waterSwimSound

    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.minecraft.world.scores.ScoreHolder

    getFeedbackDisplayName

    Methods inherited from interface vazkii.botania.api.item.SparkEntity

    entity, getAttachPos, getNetwork
  • Constructor Details

    • ManaSparkEntity

      public ManaSparkEntity(net.minecraft.world.entity.EntityType<ManaSparkEntity> type, net.minecraft.world.level.Level world)
    • ManaSparkEntity

      public ManaSparkEntity(net.minecraft.world.level.Level world)
  • Method Details

    • defineSynchedData

      protected void defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
      Overrides:
      defineSynchedData in class SparkBaseEntity
    • getPickResult

      @NotNull public @NotNull net.minecraft.world.item.ItemStack getPickResult()
      Overrides:
      getPickResult in class net.minecraft.world.entity.Entity
    • tick

      public void tick()
      Overrides:
      tick in class net.minecraft.world.entity.Entity
    • updateTransfers

      public void updateTransfers()
      Description copied from interface: ManaSpark
      Makes that spark register transfers for all relevant sparks, needs to be called whenever the connected sparks may change (setNetwork, remove and setUpgrade should already do this)
      Specified by:
      updateTransfers in interface ManaSpark
    • particleBeam

      public static void particleBeam(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.Entity e1, net.minecraft.world.entity.Entity e2)
    • getSparkItem

      protected net.minecraft.world.item.Item getSparkItem()
    • remove

      public void remove(net.minecraft.world.entity.Entity.RemovalReason removalReason)
      Overrides:
      remove in class net.minecraft.world.entity.Entity
    • interact

      public net.minecraft.world.InteractionResult interact(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
      Overrides:
      interact in class net.minecraft.world.entity.Entity
    • readAdditionalSaveData

      protected void readAdditionalSaveData(@NotNull @NotNull net.minecraft.nbt.CompoundTag cmp)
      Overrides:
      readAdditionalSaveData in class SparkBaseEntity
    • addAdditionalSaveData

      protected void addAdditionalSaveData(@NotNull @NotNull net.minecraft.nbt.CompoundTag cmp)
      Overrides:
      addAdditionalSaveData in class SparkBaseEntity
    • getAttachedTile

      public SparkAttachable getAttachedTile()
      Description copied from interface: ManaSpark
      Get the thing this spark is attached to, if any
      Specified by:
      getAttachedTile in interface ManaSpark
    • getAttachedManaReceiver

      @Nullable public @Nullable ManaReceiver getAttachedManaReceiver()
      Specified by:
      getAttachedManaReceiver in interface ManaSpark
      Returns:
      The attached mana receiver under the spark, if available
    • getOutgoingTransfers

      public Collection<ManaSpark> getOutgoingTransfers()
      Description copied from interface: ManaSpark
      Gets a collection of all Sparks this is tranfering to.
      Specified by:
      getOutgoingTransfers in interface ManaSpark
    • registerTransfer

      public void registerTransfer(ManaSpark entity)
      Description copied from interface: ManaSpark
      Registers the Spark passed in as a Spark meant for mana to be transfered towards.
      Specified by:
      registerTransfer in interface ManaSpark
    • getUpgrade

      public SparkUpgradeType getUpgrade()
      Specified by:
      getUpgrade in interface ManaSpark
    • setUpgrade

      public void setUpgrade(SparkUpgradeType upgrade)
      Specified by:
      setUpgrade in interface ManaSpark
    • setNetwork

      public void setNetwork(net.minecraft.world.item.DyeColor color)
      Specified by:
      setNetwork in interface SparkEntity
      Overrides:
      setNetwork in class SparkBaseEntity
    • areIncomingTransfersDone

      public boolean areIncomingTransfersDone()
      Description copied from interface: ManaSpark
      Specified by:
      areIncomingTransfersDone in interface ManaSpark