Class DroneEntity

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.entity.Entity>
net.minecraft.world.entity.Entity
net.minecraft.world.entity.LivingEntity
net.minecraft.world.entity.Mob
net.minecraft.world.entity.PathfinderMob
me.desht.pneumaticcraft.common.entity.drone.AbstractDroneEntity
me.desht.pneumaticcraft.common.entity.drone.DroneEntity
All Implemented Interfaces:
IPneumaticWrenchable, IDrone, IHackableEntity<DroneEntity>, IManoMeasurable, IDroneBase, IUpgradeHolder, net.minecraft.commands.CommandSource, net.minecraft.world.entity.animal.FlyingAnimal, net.minecraft.world.entity.Attackable, net.minecraft.world.entity.Targeting, net.minecraft.world.level.entity.EntityAccess, net.minecraft.world.Nameable, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.entity.Entity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeEntity, net.minecraftforge.common.extensions.IForgeLivingEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.entity.IEntityAdditionalSpawnData
Direct Known Subclasses:
AmadroneEntity, CollectorDroneEntity, GuardDroneEntity, HarvestingDroneEntity, LogisticsDroneEntity

public class DroneEntity extends AbstractDroneEntity implements IManoMeasurable, IPneumaticWrenchable, net.minecraftforge.entity.IEntityAdditionalSpawnData, IHackableEntity<DroneEntity>, IDroneBase, net.minecraft.world.entity.animal.FlyingAnimal, IUpgradeHolder
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     

    Nested classes/interfaces inherited from class net.minecraft.world.entity.LivingEntity

    net.minecraft.world.entity.LivingEntity.Fallsounds

    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

    Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    net.minecraft.network.chat.Component
     
     

    Fields inherited from class me.desht.pneumaticcraft.common.entity.drone.AbstractDroneEntity

    laserExtension, oldLaserExtension, oldPropRotation, propRotation

    Fields inherited from class net.minecraft.world.entity.PathfinderMob

    DEFAULT_WALK_TARGET_VALUE

    Fields inherited from class net.minecraft.world.entity.Mob

    ambientSoundTime, armorDropChances, DEFAULT_EQUIPMENT_DROP_CHANCE, goalSelector, handDropChances, jumpControl, LEASH_TAG, lookControl, MAX_ENCHANTED_ARMOR_CHANCE, MAX_ENCHANTED_WEAPON_CHANCE, MAX_PICKUP_LOOT_CHANCE, MAX_WEARING_ARMOR_CHANCE, moveControl, navigation, PICKUP_REACH, PRESERVE_ITEM_DROP_CHANCE, targetSelector, UPDATE_GOAL_SELECTOR_EVERY_N_TICKS, xpReward

    Fields inherited from class net.minecraft.world.entity.LivingEntity

    animStep, animStepO, ARMOR_SLOT_OFFSET, ARMOR_SLOTS, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathScore, deathTime, DEFAULT_BASE_GRAVITY, DEFAULT_EYE_HEIGHT, EQUIPMENT_SLOT_OFFSET, EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT, fallFlyTicks, HAND_SLOTS, hurtDuration, hurtTime, invulnerableDuration, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerTime, lerpHeadSteps, lerpSteps, lerpX, lerpXRot, lerpY, lerpYRot, lerpZ, LIVING_ENTITY_FLAG_IS_USING, LIVING_ENTITY_FLAG_OFF_HAND, LIVING_ENTITY_FLAG_SPIN_ATTACK, lyHeadRot, MIN_MOVEMENT_DISTANCE, noActionTime, oAttackAnim, oRun, PLAYER_HURT_EXPERIENCE_TIME, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, SWING_DURATION, swinging, swingingArm, swingTime, timeOffs, USE_ITEM_INTERVAL, useItem, useItemRemaining, walkAnimation, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zza

    Fields inherited from class net.minecraft.world.entity.Entity

    BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, BREATHING_DISTANCE_BELOW_EYES, 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, isInsidePortal, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalEntrancePos, portalTime, 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
  • Constructor Summary

    Constructors
    Constructor
    Description
    DroneEntity(net.minecraft.world.entity.EntityType<? extends DroneEntity> type, net.minecraft.world.level.Level world)
     
    DroneEntity(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAdditionalSaveData(net.minecraft.nbt.CompoundTag tag)
     
    void
    addAirToDrone(int air)
     
    void
    addHackInfo(DroneEntity entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player)
    Add info that is displayed on the entity tracker panel, describing what the hack would do to the entity.
    void
    addPostHackInfo(DroneEntity entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player)
    Add info that is displayed on the entity tracker panel, describing what the hack has done to the entity.
    boolean
    addProgram(net.minecraft.core.BlockPos clickPos, net.minecraft.core.Direction facing, net.minecraft.core.BlockPos placePos, net.minecraft.world.item.ItemStack droneStack, List<IProgWidget> progWidgets)
    Add an initial program to a drone that's about to be placed.
    boolean
    Called every tick after the hack completed.
    boolean
     
    boolean
    canHack(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player)
    Returning true will allow the player to hack this entity.
    boolean
    canMoveIntoFluid(net.minecraft.world.level.material.Fluid fluid)
     
    net.minecraft.world.entity.Entity
    changeDimension(net.minecraft.server.level.ServerLevel p_241206_1_, net.minecraftforge.common.util.ITeleporter teleporter)
     
    protected net.minecraft.world.entity.ai.navigation.PathNavigation
    createNavigation(net.minecraft.world.level.Level worldIn)
     
    protected int
    Decrements the entity's air supply when underwater
    protected void
     
    void
    die(net.minecraft.world.damagesource.DamageSource damageSource)
     
    boolean
    doHurtTarget(net.minecraft.world.entity.Entity entity)
     
    protected void
     
    void
    dropItem(net.minecraft.world.item.ItemStack stack)
    Cause the drone to drop the given item at its position.
    int
     
    net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener>
     
     
    protected BasicAirHandler
     
    int
     
    int
     
    int
     
    <T> net.minecraftforge.common.util.LazyOptional<T>
    getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, net.minecraft.core.Direction facing)
     
    List<net.minecraft.world.entity.Entity>
    Get the list of entities currently carried by this drone.
    net.minecraft.core.BlockPos
    Get the position of the drone's controller.
    protected net.minecraft.sounds.SoundEvent
     
     
    net.minecraft.core.BlockPos
    Get the blockpos at which this drone was deployed (by player or dispenser).
    int
     
    net.minecraft.world.item.ItemStack
     
     
    net.minecraft.network.chat.Component
     
    net.minecraft.world.phys.Vec3
    Get the drone's exact position.
    float
     
    double
     
    net.minecraft.core.BlockPos
     
    int
    getEmittingRedstone(net.minecraft.core.Direction side)
     
    net.minecraftforge.common.util.FakePlayer
    Get the fake player object for the drone.
    net.minecraftforge.fluids.IFluidTank
    Get the drone's fluid tank.
    @NotNull Class<DroneEntity>
    Get the class of the entity this hack should apply to.
    net.minecraft.resources.ResourceLocation
    IHackableEntity
    int
    getHackTime(DroneEntity entity, net.minecraft.world.entity.player.Player player)
    Return the time it takes to hack this entity in ticks.
    protected net.minecraft.sounds.SoundEvent
    getHurtSound(net.minecraft.world.damagesource.DamageSource p_184601_1_)
     
    net.minecraftforge.items.IItemHandlerModifiable
    Get the drone's inventory.
     
    int
     
     
     
     
    net.minecraft.world.entity.player.Player
    Retrieve the owning player of this drone; i.e.
    net.minecraft.network.chat.Component
     
    Get the UUID of the drone's owner.
    Get the drone's path navigator object.
     
    net.minecraft.world.entity.ai.goal.Goal
     
     
    int
    Get the first slot which has any ammo in it.
    protected float
     
    net.minecraft.world.entity.ai.goal.GoalSelector
    Get the drone's current collection of tasks.
    net.minecraft.core.BlockPos
     
     
    net.minecraftforge.items.IItemHandler
     
    int
    Get a count of the installed upgrades of the given type.
    Optional<net.minecraft.core.BlockPos>
     
    boolean
     
    boolean
    hurt(net.minecraft.world.damagesource.DamageSource source, float damage)
     
    void
     
    boolean
     
    boolean
    Has the drone's normal tasks been overridden by special circumstances? E.g.
    boolean
    isBlockValidPathfindBlock(net.minecraft.core.BlockPos pos)
    Is the given position valid for pathfinding purposes? i.e.
    boolean
     
    boolean
     
    boolean
     
    boolean
    isInvulnerableTo(net.minecraft.world.damagesource.DamageSource source)
     
    boolean
     
    boolean
     
    net.minecraft.world.InteractionResult
    mobInteract(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
     
    void
    onHackFinished(DroneEntity entity, net.minecraft.world.entity.player.Player player)
    Called when a player successfully hacks an entity; basically getHackTime(Entity) ticks after the hack was initiated.
    void
    onItemPickupEvent(net.minecraft.world.entity.item.ItemEntity curPickingUpEntity, int stackSize)
    Called when a drone is picking up an item.
    void
     
    void
    onSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> key)
     
    void
     
    boolean
    onWrenched(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand)
    Called when a drone is right-clicked by a Pneumatic Wrench.
    void
    overload(String msgKey, Object... params)
     
    void
    playSound(net.minecraft.sounds.SoundEvent soundEvent, net.minecraft.sounds.SoundSource category, float volume, float pitch)
     
    static net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder
     
    void
    printManometerMessage(net.minecraft.world.entity.player.Player player, List<net.minecraft.network.chat.Component> curInfo)
    This method is invoked by the Manometer when a player right-clicks a BE or Entity with this interface implemented.
    void
    readAdditionalSaveData(net.minecraft.nbt.CompoundTag tag)
     
    void
    readFromItemStack(net.minecraft.world.item.ItemStack droneStack)
    Deserialize stored itemstack data when a drone item is deployed.
    void
    readSpawnData(net.minecraft.network.FriendlyByteBuf buffer)
     
    boolean
    removeWhenFarAway(double dist)
    Determines if an entity can be despawned, used on idle far away entities
    void
     
    void
    sendWireframeToClient(net.minecraft.core.BlockPos pos)
    Send a position to the client to be rendered by the Pneumatic Helmet with Entity Tracker.
    void
     
    void
    setCarryingEntity(net.minecraft.world.entity.Entity entity)
    Make the drone pick up the given entity.
    void
    setDeployPos(net.minecraft.core.BlockPos deployPos)
     
    void
    setDroneSpeed(double droneSpeed)
     
    void
    setDugBlock(net.minecraft.core.BlockPos pos)
    Mark the given block as being dug.
    void
    setEmittingRedstone(net.minecraft.core.Direction side, int value)
    Make the drone emit redstone in the given direction from its current position.
    void
     
    void
    setName(net.minecraft.network.chat.Component string)
    Set the drone's custom name.
    void
    setStandby(boolean standby)
     
    void
    setTarget(net.minecraft.world.entity.LivingEntity entity)
     
    void
    setVariable(String varName, net.minecraft.core.BlockPos pos)
     
    boolean
     
    boolean
    startRiding(net.minecraft.world.entity.Entity entity, boolean force)
     
    void
    storeTrackerData(net.minecraft.world.item.ItemStack stack)
     
    void
     
    void
    travel(net.minecraft.world.phys.Vec3 travelVec)
    Moves the entity based on the specified heading.
    void
    tryFireMinigun(net.minecraft.world.entity.LivingEntity target)
     
    void
    Sets the label that was jumped to last, with a hierarchy in case of External Programs.
    net.minecraft.world.level.Level
    Get the drone's world.
    void
    writeSpawnData(net.minecraft.network.FriendlyByteBuf buffer)
     

    Methods inherited from class me.desht.pneumaticcraft.common.entity.drone.AbstractDroneEntity

    getLaserOffsetY

    Methods inherited from class net.minecraft.world.entity.PathfinderMob

    checkSpawnRules, followLeashSpeed, getWalkTargetValue, getWalkTargetValue, isPathFinding, onLeashDistance, shouldStayCloseToLeashHolder, tickLeash

    Methods inherited from class net.minecraft.world.entity.Mob

    aiStep, ate, baseTick, canAttackType, canBeLeashed, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, clearRestriction, convertTo, createBodyControl, createMobAttributes, customServerAiStep, dropCustomDeathLoot, dropFromLootTable, dropLeash, enchantSpawnedArmor, enchantSpawnedWeapon, equipItemIfPossible, finalizeSpawn, getAmbientSound, getAmbientSoundInterval, getArmorSlots, getControllingPassenger, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getExperienceReward, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashHolder, getLookControl, getLootTable, getLootTableSeed, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMaxSpawnClusterSize, getMeleeAttackRangeSqr, getMoveControl, getNavigation, getPathfindingMalus, getPerceivedTargetDistanceSquareForMeleeAttack, getPickResult, getPickupReach, getRestrictCenter, getRestrictRadius, getSensing, getSpawnType, getTarget, handleEntityEvent, hasRestriction, interact, isAggressive, isEffectiveAi, isLeashed, isLeftHanded, isMaxGroupSizeReached, isNoAi, isPersistenceRequired, isSpawnCancelled, isSunBurnTick, isWithinMeleeAttackRange, isWithinRestriction, isWithinRestriction, jumpInFluid, jumpInLiquid, lookAt, onOffspringSpawnedFromEgg, onPathfindingDone, onPathfindingStart, pickUpItem, playAmbientSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, registerGoals, removeAfterChangingDimensions, removeAllGoals, removeFreeWill, requiresCustomPersistence, restrictTo, sendDebugPackets, serverAiStep, setAggressive, setBaby, setCanPickUpLoot, setDelayedLeashHolderId, setDropChance, setGuaranteedDrop, setItemSlot, setItemSlotAndDropWhenKilled, setLeashedTo, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpawnCancelled, setSpeed, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, tickHeadTurn, updateControlFlags, wantsToPickUp

    Methods inherited from class net.minecraft.world.entity.LivingEntity

    actuallyHurt, addEffect, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, brainProvider, broadcastBreakEvent, broadcastBreakEvent, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canBeAffected, canBeSeenAsEnemy, canBeSeenByAnyone, canChangeDimensions, canDisableShield, canFreeze, canSpawnSoulSpeedParticle, canStandOnFluid, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, curePotionEffects, doAutoAttackOnTouch, doesEmitEquipEvent, doPush, dropAllDeathLoot, dropExperience, eat, equipmentHasChanged, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getArmorCoverPercentage, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributeBaseValue, getAttributes, getAttributeValue, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getBrain, getCombatTracker, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDimensions, getDismountPoses, getDrinkingSound, getEatingSound, getEffect, getEquipmentSlotForItem, getEyeHeight, getFallFlyingTicks, getFallSounds, getFluidFallingAdjustedMovement, getFlyingSpeed, getHealth, getHurtDir, getItemInHand, getJumpBoostPower, getJumpPower, getKillCredit, getLastAttacker, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getMainHandItem, getMaxHealth, getMeleeAttackReferencePosition, getMobType, getNoActionTime, getOffhandItem, getProjectile, getRandom, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSleepingPos, getSlot, getSpeed, getStandingEyeHeight, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleDamageEvent, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, hasLineOfSight, heal, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, increaseAirSupply, indicateDamage, invalidateCaps, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBaby, isBlocking, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInWall, isPickable, isPushable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, knockback, lerpHeadTo, lerpTo, lookAt, makeBrain, maxUpStep, onBelowWorld, onChangedBlock, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onItemPickup, onLeaveCombat, onSoulSpeedBlock, playBlockFallSound, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, remove, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeFrost, removeSoulSpeed, resetForwardDirectionOfRelativePortalPosition, reviveCaps, rideTick, sendEffectToPassengers, setAbsorptionAmount, setArrowCount, setDiscardFriction, setHealth, setItemInHand, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setRecordPlayingNearby, setSleepingPos, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, shouldRemoveSoulSpeed, shouldRiderFaceForward, shouldShowName, skipDropExperience, spawnSoulSpeedParticle, startSleeping, startUsingItem, stopRiding, stopSleeping, stopUsingItem, swing, swing, take, tickDeath, tickEffects, tickRidden, triggerItemUseEffects, tryAddFrost, tryAddSoulSpeed, updateEffectVisibility, updateInvisibilityStatus, updateSwingTime, updateUsingItem, updateWalkAnimation, verifyEquippedItem, wasExperienceConsumed

    Methods inherited from class net.minecraft.world.entity.Entity

    absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canCollideWith, canEnterPose, canRide, canSpawnSprintParticle, canSprint, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, checkBelowWorld, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, fixupDimensions, gameEvent, gameEvent, getAirSupply, getAllSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForPose, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFeetBlockState, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getHandHoldingItemAngle, getId, getIndirectPassengers, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getMovementEmission, getMyRidingOffset, getName, getNameTagOffsetY, getOnPos, getOnPos, getOnPosLegacy, getPassengers, getPassengersAndSelf, getPassengersRidingOffset, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalCooldown, getPortalWaitTime, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handleInsidePortal, handleNetherPortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, ignoreExplosion, interactAt, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCustomNameVisible, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killedEntity, lavaHurt, lerpMotion, level, limitPistonMovement, load, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, pick, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, push, reapplyPosition, refreshDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendSystemMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setMaxUpStep, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithKnownMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSecondsOnFire, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, teleportToWithTicket, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming, waterSwimSound

    Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCaps

    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.minecraftforge.common.capabilities.ICapabilityProvider

    getCapability

    Methods inherited from interface me.desht.pneumaticcraft.common.drone.IDroneBase

    getActiveAIManager, getActiveWidget, onVariableChanged

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity

    canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, deserializeNBT, getClassification, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getPickedResult, getSoundFromFluidType, getStepHeight, hasCustomOutlineRendering, isAddedToWorld, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToWorld, onRemovedFromWorld, revive, serializeNBT, shouldRiderSit

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeLivingEntity

    canDrownInFluidType, canSwimInFluidType, moveInFluid, self, sinkInFluid

    Methods inherited from interface me.desht.pneumaticcraft.api.pneumatic_armor.hacking.IHackableEntity

    _addHackInfo, _addPostHackInfo, _afterHackTick, _getHackTime, _onHackFinished
  • Field Details

    • NBT_DRONE_COLOR

      public static final String NBT_DRONE_COLOR
      See Also:
    • progWidgets

      public List<IProgWidget> progWidgets
    • ownerName

      public net.minecraft.network.chat.Component ownerName
  • Constructor Details

    • DroneEntity

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

      public DroneEntity(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player)
  • Method Details

    • onSemiblockEvent

      public void onSemiblockEvent(SemiblockEvent event)
    • createNavigation

      protected net.minecraft.world.entity.ai.navigation.PathNavigation createNavigation(net.minecraft.world.level.Level worldIn)
      Overrides:
      createNavigation in class net.minecraft.world.entity.Mob
    • readFromItemStack

      public void readFromItemStack(net.minecraft.world.item.ItemStack droneStack)
      Deserialize stored itemstack data when a drone item is deployed.
      Parameters:
      droneStack - the drone itemstack
    • defineSynchedData

      protected void defineSynchedData()
      Overrides:
      defineSynchedData in class net.minecraft.world.entity.Mob
    • prepareAttributes

      public static net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder prepareAttributes()
    • getCapability

      @Nonnull public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(@Nonnull net.minecraftforge.common.capabilities.Capability<T> capability, net.minecraft.core.Direction facing)
      Specified by:
      getCapability in interface net.minecraftforge.common.capabilities.ICapabilityProvider
      Overrides:
      getCapability in class net.minecraft.world.entity.LivingEntity
    • getAddEntityPacket

      public net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> getAddEntityPacket()
      Overrides:
      getAddEntityPacket in class net.minecraft.world.entity.Entity
    • writeSpawnData

      public void writeSpawnData(net.minecraft.network.FriendlyByteBuf buffer)
      Specified by:
      writeSpawnData in interface net.minecraftforge.entity.IEntityAdditionalSpawnData
    • readSpawnData

      public void readSpawnData(net.minecraft.network.FriendlyByteBuf buffer)
      Specified by:
      readSpawnData in interface net.minecraftforge.entity.IEntityAdditionalSpawnData
    • removeWhenFarAway

      public boolean removeWhenFarAway(double dist)
      Determines if an entity can be despawned, used on idle far away entities
      Overrides:
      removeWhenFarAway in class net.minecraft.world.entity.Mob
    • getSoundVolume

      protected float getSoundVolume()
      Overrides:
      getSoundVolume in class net.minecraft.world.entity.LivingEntity
    • getHurtSound

      @Nullable protected net.minecraft.sounds.SoundEvent getHurtSound(net.minecraft.world.damagesource.DamageSource p_184601_1_)
      Overrides:
      getHurtSound in class net.minecraft.world.entity.LivingEntity
    • getDeathSound

      @Nullable protected net.minecraft.sounds.SoundEvent getDeathSound()
      Overrides:
      getDeathSound in class net.minecraft.world.entity.LivingEntity
    • tick

      public void tick()
      Overrides:
      tick in class net.minecraft.world.entity.Mob
    • isDescending

      public boolean isDescending()
      Overrides:
      isDescending in class net.minecraft.world.entity.Entity
    • canBreatheUnderwater

      public boolean canBreatheUnderwater()
      Overrides:
      canBreatheUnderwater in class net.minecraft.world.entity.LivingEntity
    • getTargetedBlock

      public net.minecraft.core.BlockPos getTargetedBlock()
      Specified by:
      getTargetedBlock in class AbstractDroneEntity
    • getLaserColor

      public int getLaserColor()
      Overrides:
      getLaserColor in class AbstractDroneEntity
    • getDugBlock

      public net.minecraft.core.BlockPos getDugBlock()
      Specified by:
      getDugBlock in class AbstractDroneEntity
    • getDroneHeldItem

      public net.minecraft.world.item.ItemStack getDroneHeldItem()
      Specified by:
      getDroneHeldItem in class AbstractDroneEntity
    • setDugBlock

      public void setDugBlock(net.minecraft.core.BlockPos pos)
      Description copied from interface: IDrone
      Mark the given block as being dug.
      Specified by:
      setDugBlock in interface IDrone
      Parameters:
      pos - a block position
    • getRunningTasks

      public List<DroneAIManager.WrappedGoal> getRunningTasks()
    • getRunningTargetAI

      public net.minecraft.world.entity.ai.goal.Goal getRunningTargetAI()
    • setVariable

      public void setVariable(String varName, net.minecraft.core.BlockPos pos)
    • getVariable

      public Optional<net.minecraft.core.BlockPos> getVariable(String varName)
    • getActiveWidgetIndex

      public int getActiveWidgetIndex()
      Specified by:
      getActiveWidgetIndex in interface IDroneBase
    • setActiveProgram

      public void setActiveProgram(IProgWidget widget)
      Specified by:
      setActiveProgram in interface IDroneBase
    • isAccelerating

      public boolean isAccelerating()
      Overrides:
      isAccelerating in class AbstractDroneEntity
    • getDroneColor

      public int getDroneColor()
      Overrides:
      getDroneColor in class AbstractDroneEntity
    • hasMinigun

      public boolean hasMinigun()
      Overrides:
      hasMinigun in class AbstractDroneEntity
    • getAmmoColor

      public int getAmmoColor()
    • getDeployPos

      public net.minecraft.core.BlockPos getDeployPos()
      Description copied from interface: IDrone
      Get the blockpos at which this drone was deployed (by player or dispenser). For the Programmable Controller, this will simply return the controller's block position.
      Specified by:
      getDeployPos in interface IDrone
      Returns:
      the deployment pos
    • setDeployPos

      public void setDeployPos(net.minecraft.core.BlockPos deployPos)
    • decreaseAirSupply

      protected int decreaseAirSupply(int par1)
      Decrements the entity's air supply when underwater
      Overrides:
      decreaseAirSupply in class net.minecraft.world.entity.LivingEntity
    • travel

      public void travel(net.minecraft.world.phys.Vec3 travelVec)
      Moves the entity based on the specified heading. Args: strafe, forward
      Overrides:
      travel in class net.minecraft.world.entity.LivingEntity
    • getTargetLine

      public ProgressingLine getTargetLine()
    • getOldTargetLine

      public ProgressingLine getOldTargetLine()
    • mobInteract

      public net.minecraft.world.InteractionResult mobInteract(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
      Overrides:
      mobInteract in class net.minecraft.world.entity.Mob
    • shouldDropAsItem

      public boolean shouldDropAsItem()
    • onWrenched

      public boolean onWrenched(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand)
      Called when a drone is right-clicked by a Pneumatic Wrench.
      Specified by:
      onWrenched in interface IPneumaticWrenchable
    • changeDimension

      @Nullable public net.minecraft.world.entity.Entity changeDimension(net.minecraft.server.level.ServerLevel p_241206_1_, net.minecraftforge.common.util.ITeleporter teleporter)
      Overrides:
      changeDimension in class net.minecraft.world.entity.Entity
    • dropEquipment

      protected void dropEquipment()
      Overrides:
      dropEquipment in class net.minecraft.world.entity.LivingEntity
    • die

      public void die(net.minecraft.world.damagesource.DamageSource damageSource)
      Overrides:
      die in class net.minecraft.world.entity.LivingEntity
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> key)
      Overrides:
      onSyncedDataUpdated in class net.minecraft.world.entity.LivingEntity
    • setTarget

      public void setTarget(net.minecraft.world.entity.LivingEntity entity)
      Overrides:
      setTarget in class net.minecraft.world.entity.Mob
    • startRiding

      public boolean startRiding(net.minecraft.world.entity.Entity entity, boolean force)
      Overrides:
      startRiding in class net.minecraft.world.entity.Mob
    • getAirHandler

      protected BasicAirHandler getAirHandler()
    • printManometerMessage

      public void printManometerMessage(net.minecraft.world.entity.player.Player player, List<net.minecraft.network.chat.Component> curInfo)
      Description copied from interface: IManoMeasurable
      This method is invoked by the Manometer when a player right-clicks a BE or Entity with this interface implemented.
      Specified by:
      printManometerMessage in interface IManoMeasurable
      Parameters:
      player - player who is right-clicking the measurable BE, and therefore needs to get the message
      curInfo - list you can append info to. If you don't append any info no air will be used.
    • addAdditionalSaveData

      public void addAdditionalSaveData(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      addAdditionalSaveData in class net.minecraft.world.entity.Mob
    • readAdditionalSaveData

      public void readAdditionalSaveData(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      readAdditionalSaveData in class net.minecraft.world.entity.Mob
    • getOwnerName

      public net.minecraft.network.chat.Component getOwnerName()
      Specified by:
      getOwnerName in class AbstractDroneEntity
    • getOwnerUUID

      public UUID getOwnerUUID()
      Description copied from interface: IDrone
      Get the UUID of the drone's owner. This will be non-null even if the owning player is offline. A drone deployed by a Dispenser has an arbitrary owner UUID that was assigned to it when it was spawned.
      Specified by:
      getOwnerUUID in interface IDrone
      Returns:
      the owner's UUID
    • getUpgrades

      public int getUpgrades(PNCUpgrade upgrade)
      Description copied from interface: IDrone
      Get a count of the installed upgrades of the given type.
      Specified by:
      getUpgrades in interface IDrone
      Parameters:
      upgrade - the upgrade to check
      Returns:
      amount of installed upgrades in the drone
    • getFakePlayer

      public net.minecraftforge.common.util.FakePlayer getFakePlayer()
      Description copied from interface: IDrone
      Get the fake player object for the drone. This will always return null if called client-side.
      Specified by:
      getFakePlayer in interface IDrone
      Returns:
      a fake player
    • getMinigun

      public Minigun getMinigun()
    • doHurtTarget

      public boolean doHurtTarget(net.minecraft.world.entity.Entity entity)
      Overrides:
      doHurtTarget in class net.minecraft.world.entity.Mob
    • getArmorValue

      public int getArmorValue()
      Overrides:
      getArmorValue in class net.minecraft.world.entity.LivingEntity
    • hurt

      public boolean hurt(net.minecraft.world.damagesource.DamageSource source, float damage)
      Overrides:
      hurt in class net.minecraft.world.entity.LivingEntity
    • isInvulnerableTo

      public boolean isInvulnerableTo(net.minecraft.world.damagesource.DamageSource source)
      Overrides:
      isInvulnerableTo in class net.minecraft.world.entity.Entity
    • getInv

      public net.minecraftforge.items.IItemHandlerModifiable getInv()
      Description copied from interface: IDrone
      Get the drone's inventory. Note that this is also accessible via the ForgeCapabilities.ITEM_HANDLER capability, which should be used in preference.
      Specified by:
      getInv in interface IDrone
      Returns:
      an inventory
    • getEmittingRedstone

      public int getEmittingRedstone(net.minecraft.core.Direction side)
    • setEmittingRedstone

      public void setEmittingRedstone(net.minecraft.core.Direction side, int value)
      Description copied from interface: IDrone
      Make the drone emit redstone in the given direction from its current position.
      Specified by:
      setEmittingRedstone in interface IDrone
      Parameters:
      side - the direction to emit
      value - the redstone level
    • isBlockValidPathfindBlock

      public boolean isBlockValidPathfindBlock(net.minecraft.core.BlockPos pos)
      Description copied from interface: IDrone
      Is the given position valid for pathfinding purposes? i.e. may the drone move through or to it?

      Custom pathfinding functionality may be added via IDroneRegistry.addPathfindableBlock(Block, IPathfindHandler).

      Specified by:
      isBlockValidPathfindBlock in interface IDrone
      Parameters:
      pos - a block position
      Returns:
      true if the position is valid, false otherwise
    • sendWireframeToClient

      public void sendWireframeToClient(net.minecraft.core.BlockPos pos)
      Description copied from interface: IDrone
      Send a position to the client to be rendered by the Pneumatic Helmet with Entity Tracker. This is used to highlight blacklisted block positions.
      Specified by:
      sendWireframeToClient in interface IDrone
      Parameters:
      pos - a block position
    • getHackableId

      public net.minecraft.resources.ResourceLocation getHackableId()
      IHackableEntity
      Specified by:
      getHackableId in interface IHackableEntity<DroneEntity>
      Returns:
      a unique String id
    • getHackableClass

      @NotNull public @NotNull Class<DroneEntity> getHackableClass()
      Description copied from interface: IHackableEntity
      Get the class of the entity this hack should apply to. All subclasses of this class will also be applicable.
      Specified by:
      getHackableClass in interface IHackableEntity<DroneEntity>
      Returns:
      the target entity class
    • canHack

      public boolean canHack(net.minecraft.world.entity.Entity entity, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Returning true will allow the player to hack this entity. This can be used to only allow hacking under certain conditions. Default implementation just checks the entity's class is appropriate and the entity is alive, but this can be overridden to add extract checks. Just be sure to call this super method in your overridden method.
      Specified by:
      canHack in interface IHackableEntity<DroneEntity>
      Parameters:
      entity - the potential hacking target
      player - the player who is potentially hacking the target entity
    • addHackInfo

      public void addHackInfo(DroneEntity entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Add info that is displayed on the entity tracker panel, describing what the hack would do to the entity. This is only called if IHackableEntity.canHack(Entity, Player) returned true. Keep this message short; one short phrase is enough.
      Specified by:
      addHackInfo in interface IHackableEntity<DroneEntity>
      Parameters:
      entity - the potential hack target
      curInfo - a text component list to append info to
      player - the player who is potentially hacking the target entity
    • addPostHackInfo

      public void addPostHackInfo(DroneEntity entity, List<net.minecraft.network.chat.Component> curInfo, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Add info that is displayed on the entity tracker panel, describing what the hack has done to the entity. This is displayed for a second or so after the hack completes.
      Specified by:
      addPostHackInfo in interface IHackableEntity<DroneEntity>
      Parameters:
      entity - the hacked target
      curInfo - a text component list to append info to
      player - the player who has hacked the entity
    • getHackTime

      public int getHackTime(DroneEntity entity, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Return the time it takes to hack this entity in ticks. Most builtin PneumaticCraft hacks use a time of 60 ticks, but for more powerful hacks, a longer required hacking time is suggested.
      Specified by:
      getHackTime in interface IHackableEntity<DroneEntity>
      Parameters:
      entity - the potential hack target
      player - the player who is potentially hacking the target entity
    • onHackFinished

      public void onHackFinished(DroneEntity entity, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IHackableEntity
      Called when a player successfully hacks an entity; basically getHackTime(Entity) ticks after the hack was initiated.
      Specified by:
      onHackFinished in interface IHackableEntity<DroneEntity>
      Parameters:
      entity - the hacked entity
      player - the player who has hacked the entity
    • afterHackTick

      public boolean afterHackTick(DroneEntity entity)
      Description copied from interface: IHackableEntity
      Called every tick after the hack completed. Return false for one-shot hacks, or true to keep this hack ticking. The majority of hacks are one-shot; see also AbstractPersistentEntityHack for a class to use for persistent hacks.

      Dead or otherwise removed entities will automatically be removed from the after-hack tick list.

      Specified by:
      afterHackTick in interface IHackableEntity<DroneEntity>
      Parameters:
      entity - the hacked entity
      Returns:
      true to keep having this method called each tick for the entity, false to stop ticking
    • getFluidTank

      public net.minecraftforge.fluids.IFluidTank getFluidTank()
      Description copied from interface: IDrone
      Get the drone's fluid tank. Note that this is also accessible via the ForgeCapabilities.FLUID_HANDLER capability, which should be used in preference.
      Specified by:
      getFluidTank in interface IDrone
      Returns:
      a fluid tank
    • getOwner

      public net.minecraft.world.entity.player.Player getOwner()
      Description copied from interface: IDrone
      Retrieve the owning player of this drone; i.e. the player who deployed the drone. A drone deployed by a Dispenser does not have a valid player owner.
      Specified by:
      getOwner in interface IDrone
      Returns:
      the owning player; will be null if the owner is offline or the drone was not player-deployed
    • setStandby

      public void setStandby(boolean standby)
    • world

      public net.minecraft.world.level.Level world()
      Description copied from interface: IDrone
      Get the drone's world.
      Specified by:
      world in interface IDrone
      Returns:
      a world
    • getDronePos

      public net.minecraft.world.phys.Vec3 getDronePos()
      Description copied from interface: IDrone
      Get the drone's exact position.
      Specified by:
      getDronePos in interface IDrone
      Returns:
      the entity position
    • getControllerPos

      public net.minecraft.core.BlockPos getControllerPos()
      Description copied from interface: IDrone
      Get the position of the drone's controller. For actual drone entities, this will always be BlockPos.ZERO. If the drone is actually a Programmable Controller, it will be the controller's block position.
      Specified by:
      getControllerPos in interface IDrone
    • dropItem

      public void dropItem(net.minecraft.world.item.ItemStack stack)
      Description copied from interface: IDrone
      Cause the drone to drop the given item at its position. The specified item does not need to be in the drone's inventory, nor will it be removed from the drone's inventory if present.
      Specified by:
      dropItem in interface IDrone
      Parameters:
      stack - the item stack to drop
    • getProgWidgets

      public List<IProgWidget> getProgWidgets()
      Specified by:
      getProgWidgets in interface IDroneBase
    • getTargetAI

      public net.minecraft.world.entity.ai.goal.GoalSelector getTargetAI()
      Description copied from interface: IDrone
      Get the drone's current collection of tasks.
      Specified by:
      getTargetAI in interface IDrone
      Returns:
      a vanilla GoalSelector object
    • isProgramApplicable

      public boolean isProgramApplicable(ProgWidgetType<?> widgetType)
      Specified by:
      isProgramApplicable in interface IDroneBase
    • setName

      public void setName(net.minecraft.network.chat.Component string)
      Description copied from interface: IDrone
      Set the drone's custom name.
      Specified by:
      setName in interface IDrone
      Parameters:
      string - a custom name
    • setCarryingEntity

      public void setCarryingEntity(net.minecraft.world.entity.Entity entity)
      Description copied from interface: IDrone
      Make the drone pick up the given entity. The given entity will be set as a rider of the drone, but it will not have any control over the drone (in fact, its AI is disabled while being carried).
      Specified by:
      setCarryingEntity in interface IDrone
      Parameters:
      entity - an entity to pick up
    • getCarryingEntities

      public List<net.minecraft.world.entity.Entity> getCarryingEntities()
      Description copied from interface: IDrone
      Get the list of entities currently carried by this drone. Note: although this method returns a list, drones currently support only a single carried entity.
      Specified by:
      getCarryingEntities in interface IDrone
      Returns:
      a list of entities
    • isAIOverridden

      public boolean isAIOverridden()
      Description copied from interface: IDrone
      Has the drone's normal tasks been overridden by special circumstances? E.g. drone hacked, or heading to a charging station.
      Specified by:
      isAIOverridden in interface IDrone
      Returns:
      true if the drone's normal AI has been overridden
    • onItemPickupEvent

      public void onItemPickupEvent(net.minecraft.world.entity.item.ItemEntity curPickingUpEntity, int stackSize)
      Description copied from interface: IDrone
      Called when a drone is picking up an item.
      Specified by:
      onItemPickupEvent in interface IDrone
      Parameters:
      curPickingUpEntity - the item entity
      stackSize - the size of the itemstack in the item entity
    • getPathNavigator

      public IPathNavigator getPathNavigator()
      Description copied from interface: IDrone
      Get the drone's path navigator object.
      Specified by:
      getPathNavigator in interface IDrone
      Returns:
      the path navigator
    • tryFireMinigun

      public void tryFireMinigun(net.minecraft.world.entity.LivingEntity target)
    • getSlotForAmmo

      public int getSlotForAmmo()
      Get the first slot which has any ammo in it.
      Returns:
      a slot number, or -1 if no ammo
    • overload

      public void overload(String msgKey, Object... params)
      Specified by:
      overload in interface IDroneBase
    • getAIManager

      public DroneAIManager getAIManager()
      Specified by:
      getAIManager in interface IDroneBase
    • getLogisticsManager

      public LogisticsManager getLogisticsManager()
      Specified by:
      getLogisticsManager in interface IDroneBase
    • setLogisticsManager

      public void setLogisticsManager(LogisticsManager logisticsManager)
      Specified by:
      setLogisticsManager in interface IDroneBase
    • playSound

      public void playSound(net.minecraft.sounds.SoundEvent soundEvent, net.minecraft.sounds.SoundSource category, float volume, float pitch)
      Specified by:
      playSound in interface IDroneBase
    • addAirToDrone

      public void addAirToDrone(int air)
      Specified by:
      addAirToDrone in interface IDroneBase
    • updateLabel

      public void updateLabel()
      Description copied from interface: IDroneBase
      Sets the label that was jumped to last, with a hierarchy in case of External Programs.
      Specified by:
      updateLabel in interface IDroneBase
    • getLabel

      public String getLabel()
      Specified by:
      getLabel in interface IDroneBase
      Specified by:
      getLabel in class AbstractDroneEntity
    • isTeleportRangeLimited

      public boolean isTeleportRangeLimited()
      Specified by:
      isTeleportRangeLimited in class AbstractDroneEntity
    • getDroneName

      public net.minecraft.network.chat.Component getDroneName()
      Specified by:
      getDroneName in interface IDroneBase
    • getDebugger

      public DroneDebugger getDebugger()
      Specified by:
      getDebugger in interface IDroneBase
    • storeTrackerData

      public void storeTrackerData(net.minecraft.world.item.ItemStack stack)
      Specified by:
      storeTrackerData in interface IDroneBase
    • getUpgradeHandler

      public net.minecraftforge.items.IItemHandler getUpgradeHandler()
      Specified by:
      getUpgradeHandler in interface IUpgradeHolder
    • onUpgradesChanged

      public void onUpgradesChanged()
      Specified by:
      onUpgradesChanged in interface IUpgradeHolder
    • isDroneStillValid

      public boolean isDroneStillValid()
      Specified by:
      isDroneStillValid in interface IDroneBase
    • canMoveIntoFluid

      public boolean canMoveIntoFluid(net.minecraft.world.level.material.Fluid fluid)
      Specified by:
      canMoveIntoFluid in interface IDroneBase
    • getDroneItemHandler

      public DroneItemHandler getDroneItemHandler()
      Specified by:
      getDroneItemHandler in interface IDroneBase
    • addProgram

      public boolean addProgram(net.minecraft.core.BlockPos clickPos, net.minecraft.core.Direction facing, net.minecraft.core.BlockPos placePos, net.minecraft.world.item.ItemStack droneStack, List<IProgWidget> progWidgets)
      Add an initial program to a drone that's about to be placed. This is called right before the entity is spawned. Programmable drones don't do anything here (program is created by the programmer and stored in item NBT), but subclasses will add their static program here.
      Parameters:
      clickPos - block the drone item is clicked against
      facing - side of the clicked block
      placePos - blockpos the drone will appear in
      droneStack - the drone itemstack
      progWidgets - add the program to this list, ideally using DroneProgramBuilder
      Returns:
      true if a program was added, false otherwise
    • incAttackCount

      public void incAttackCount()
    • getAttackCount

      public int getAttackCount()
    • resetAttackCount

      public void resetAttackCount()
      Specified by:
      resetAttackCount in interface IDroneBase
    • getDronePressure

      public float getDronePressure()
      Specified by:
      getDronePressure in interface IDroneBase
    • setDroneSpeed

      public void setDroneSpeed(double droneSpeed)
    • getDroneSpeed

      public double getDroneSpeed()
    • isFlying

      public boolean isFlying()
      Specified by:
      isFlying in interface net.minecraft.world.entity.animal.FlyingAnimal