Class CorporeaSparkEntity

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

public class CorporeaSparkEntity extends SparkBaseEntity implements CorporeaSpark
  • 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
    CorporeaSparkEntity(net.minecraft.world.entity.EntityType<CorporeaSparkEntity> type, net.minecraft.world.level.Level world)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addAdditionalSaveData(@NotNull net.minecraft.nbt.CompoundTag cmp)
     
    protected void
    defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
     
     
     
    @NotNull net.minecraft.world.item.ItemStack
     
    Gets the list of sparks that this spark added to the list of connections during registerConnections(), this is mainly used to create a non messy chain of particles to display the network when a spark is right clicked with a wand.
    protected net.minecraft.world.item.Item
     
     
    net.minecraft.world.InteractionResult
    interact(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
     
    void
    Look around this spark for neighbors and introduce them to the network by adding them to network.
    boolean
    Gets if this spark is considered a creative spark.
    boolean
    Gets if this spark is considered a master spark.
    void
    onItemExtracted(net.minecraft.world.item.ItemStack stack)
    Called when an item is extracted from the node this spark is attached to through this spark.
    void
    onItemsRequested(List<net.minecraft.world.item.ItemStack> stacks)
    Called when this spark requests items, passes in the result of the request and not the actual requested stack(s).
    protected void
    readAdditionalSaveData(@NotNull net.minecraft.nbt.CompoundTag cmp)
     
    void
    remove(net.minecraft.world.entity.Entity.RemovalReason reason)
     
    void
    setCreative(boolean creative)
     
    void
    setMaster(boolean master)
     
    void
    setNetwork(net.minecraft.world.item.DyeColor color)
     
    void
     

    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

    • CorporeaSparkEntity

      public CorporeaSparkEntity(net.minecraft.world.entity.EntityType<CorporeaSparkEntity> type, 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
    • getSparkItem

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

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

      public void introduceNearbyTo(Set<CorporeaSpark> network, CorporeaSpark master)
      Description copied from interface: CorporeaSpark
      Look around this spark for neighbors and introduce them to the network by adding them to network. If they weren't already in network, this method should then recursively call this method on all newcomers. This spark should then retain the network object internally for quick access to all members of the network.
      Specified by:
      introduceNearbyTo in interface CorporeaSpark
    • getSparkNode

      public CorporeaNode getSparkNode()
      Specified by:
      getSparkNode in interface CorporeaSpark
      Returns:
      Corporea node this spark is attached to, generally belonging to the block below it
    • getConnections

      public Set<CorporeaSpark> getConnections()
      Specified by:
      getConnections in interface CorporeaSpark
      Returns:
      All sparks in the same logical corporea network as this one, including this spark itself.
    • getRelatives

      public List<CorporeaSpark> getRelatives()
      Description copied from interface: CorporeaSpark
      Gets the list of sparks that this spark added to the list of connections during registerConnections(), this is mainly used to create a non messy chain of particles to display the network when a spark is right clicked with a wand.
      Specified by:
      getRelatives in interface CorporeaSpark
    • onItemExtracted

      public void onItemExtracted(net.minecraft.world.item.ItemStack stack)
      Description copied from interface: CorporeaSpark
      Called when an item is extracted from the node this spark is attached to through this spark.
      Specified by:
      onItemExtracted in interface CorporeaSpark
      Parameters:
      stack - The itemstack, before any extraction was done. Do not mutate this.
    • onItemsRequested

      public void onItemsRequested(List<net.minecraft.world.item.ItemStack> stacks)
      Description copied from interface: CorporeaSpark
      Called when this spark requests items, passes in the result of the request and not the actual requested stack(s).
      Specified by:
      onItemsRequested in interface CorporeaSpark
    • getMaster

      public CorporeaSpark getMaster()
      Specified by:
      getMaster in interface CorporeaSpark
      Returns:
      The master spark of the network this spark is part of. A master spark's master is itself. Returns null if this spark is not in a network with a valid master.
    • setMaster

      public void setMaster(boolean master)
    • isMaster

      public boolean isMaster()
      Description copied from interface: CorporeaSpark
      Gets if this spark is considered a master spark.
      Specified by:
      isMaster in interface CorporeaSpark
    • setCreative

      public void setCreative(boolean creative)
    • isCreative

      public boolean isCreative()
      Description copied from interface: CorporeaSpark
      Gets if this spark is considered a creative spark.
      Specified by:
      isCreative in interface CorporeaSpark
    • 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
    • setNetwork

      public void setNetwork(net.minecraft.world.item.DyeColor color)
      Specified by:
      setNetwork in interface SparkEntity
      Overrides:
      setNetwork in class SparkBaseEntity
    • 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