Class EnvironmentAwareEntityMixin

java.lang.Object
net.minecraft.world.entity.Entity
com.github.thedeathlycow.thermoo.mixin.common.EnvironmentAwareEntityMixin
All Implemented Interfaces:
Soakable, TemperatureAware, net.fabricmc.fabric.api.attachment.v1.AttachmentTarget, net.minecraft.core.component.DataComponentGetter, net.minecraft.network.syncher.SyncedDataHolder, net.minecraft.util.debug.DebugValueSource, net.minecraft.world.entity.ItemOwner, net.minecraft.world.level.entity.EntityAccess, net.minecraft.world.level.entity.UniquelyIdentifyable, net.minecraft.world.Nameable, net.minecraft.world.scores.ScoreHolder, org.ladysnake.cca.api.v3.component.ComponentAccess

public abstract class EnvironmentAwareEntityMixin extends net.minecraft.world.entity.Entity implements TemperatureAware, Soakable
  • Nested Class Summary

    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 interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget

    net.fabricmc.fabric.api.attachment.v1.AttachmentTarget.OnAttachedSet<A>

    Nested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource

    net.minecraft.util.debug.DebugValueSource.Registration, net.minecraft.util.debug.DebugValueSource.ValueGetter<T>

    Nested classes/interfaces inherited from interface net.minecraft.world.entity.ItemOwner

    net.minecraft.world.entity.ItemOwner.OffsetFromOwner
  • 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, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, MAX_MOVEMENTS_HANDELED_PER_TICK, minorHorizontalCollision, moveDist, noPhysics, portalProcess, random, stringUUID, stuckSpeedMultiplier, TAG_AIR, TAG_CUSTOM_NAME, TAG_DATA, TAG_FALL_DISTANCE, TAG_FIRE, TAG_GLOWING, TAG_ID, TAG_INVULNERABLE, TAG_MOTION, TAG_NO_GRAVITY, TAG_ON_GROUND, TAG_PASSENGERS, TAG_PORTAL_COOLDOWN, TAG_POS, TAG_ROTATION, TAG_SILENT, TAG_UUID, tickCount, TOTAL_AIR_SUPPLY, uuid, verticalCollision, verticalCollisionBelow, wasEyeInWater, wasInPowderSnow, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOld

    Fields inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget

    NBT_ATTACHMENT_KEY

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

    WILDCARD, WILDCARD_NAME
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    abstract boolean
     
    abstract double
    getAttributeValue(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute)
     
    abstract boolean
    hasEffect(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect)
     
    void
    thermoo$addTemperature(int temperatureChange, HeatingMode mode)
    Adds or removes some amount of temperature to the thermally aware object.
    boolean
     
    boolean
     
    double
    Supplies the cold resistance of the temperature aware object.
    double
    Supplies the environmental cold resistance of a temperature aware object.
    double
    Supplies the environmental heat resistance of a temperature aware object.
    double
    Supplies the heat resistance of the temperature aware object.
    int
     
    int
     
    int
     
    net.minecraft.util.RandomSource
     
    int
     
    int
     
    boolean
    Soakables ignore frigid water if they can breathe in water.
    void
    thermoo$setTemperature(int temperature)
     
    void
    thermoo$setWetTicks(int amount)
    Sets the wet ticks of a soakable to an exact amount.

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

    absSnapRotationTo, absSnapTo, absSnapTo, addAdditionalSaveData, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, animateHurt, applyComponentsFromItemStack, applyEffectsFromBlocks, applyEffectsFromBlocks, applyGravity, applyImplicitComponent, applyImplicitComponentIfPresent, applyImplicitComponents, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canCollideWith, canControlVehicle, canFreeze, canInteractWithLevel, canRide, canSimulateMovement, canSpawnSprintParticle, canSprint, canTeleport, canUsePortal, castComponentValue, causeFallDamage, checkBelowWorld, checkDespawn, checkFallDamage, checkFallDistanceAccumulation, checkSupportingBlock, chunkPosition, clearFire, clearFreeze, clearMovementThisTick, closerThan, closerThan, collectAllColliders, collideBoundingBox, collidedWithFluid, collidedWithShapeMovingFrom, considersEntityAsAlly, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStackForNameResolution, createHoverEvent, damageSources, dampensVibrations, defineSynchedData, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doCheckFallDamage, doWaterSplashEffect, dropAllLeashConnections, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, forceSetRotation, fudgePositionAfterSizeChange, gameEvent, gameEvent, get, getAddEntityPacket, getAirSupply, getAttachments, getAvailableSpaceBelow, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockSpeedFactor, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCollisionHorizontalEscapeVector, 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, getInputVector, getInterpolation, getKnownMovement, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getLootTable, getMaxAirSupply, getMaxFallDistance, getMotionDirection, getMovementEmission, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengerRidingPosition, getPassengers, getPassengersAndSelf, getPercentFrozen, getPickRadius, getPickResult, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPreciseBodyRotation, getPrimaryStepSoundBlockPos, getQuadLeashHolderOffsets, getRandom, getRandomX, getRandomY, getRandomZ, getRelativePortalPosition, getRemainingFireTicks, getRemovalReason, getRequiresPrecisePosition, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, 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, getXRot, getY, getY, getYHeadRot, getYRot, getYRot, getZ, getZ, handleDamageEvent, handleEntityEvent, handleOnAboveBubbleColumn, handleOnInsideBubbleColumn, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPose, hurt, hurtClient, hurtOrSimulate, hurtServer, igniteForSeconds, igniteForTicks, ignoreExplosion, interact, interactAt, is, isAffectedByBlocks, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isClientAuthoritative, isColliding, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFlyingVehicle, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInClouds, isInLava, isInLiquid, isInShallowWater, isInterpolating, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableToBase, isInWall, isInWater, isInWaterOrRain, isLocalClientAuthoritative, isLocalInstanceAuthoritative, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPickable, isPushable, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killedEntity, lavaHurt, lavaIgnite, lerpHeadTo, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, lookAt, makeBoundingBox, makeBoundingBox, makeStuckInBlock, markHurt, maxUpStep, maybeBackOffFromEdge, mayInteract, mirror, move, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveRelative, moveTowardsClosestSpace, nextStep, notifyLeasheeRemoved, notifyLeashHolder, oldPosition, onAboveBubbleColumn, onBelowWorld, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onPassengerTurned, onRemoval, onSyncedDataUpdated, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, problemPath, processFlappingMovement, processPortalCooldown, propagateFallToPassengers, push, push, push, readAdditionalSaveData, reapplyPosition, recreateFromPacket, refreshDimensions, registerDebugValues, registryAccess, remove, removeAfterChangingDimensions, removeLatestMovementRecording, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendBubbleColumnParticles, setAirSupply, setAsInsidePortal, setBoundingBox, setComponent, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPos, setOldPosAndRot, setOldPosAndRot, setOldRot, setOnGround, setOnGroundWithMovement, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRequiresPrecisePosition, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSprinting, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYBodyRot, setYHeadRot, setYRot, shearOffAllLeashConnections, shouldBeSaved, shouldBlockExplode, shouldPlayLavaHurtSound, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, snapTo, snapTo, snapTo, snapTo, snapTo, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, supportQuadLeashAsHolder, syncPacketPositionCodec, teleport, teleportRelative, teleportSetPosition, teleportSetPosition, teleportSpectators, teleportTo, teleportTo, thunderHit, tick, toString, touchingUnloadedChunk, trackingPosition, 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.fabricmc.fabric.api.attachment.v1.AttachmentTarget

    getAttached, getAttachedOrCreate, getAttachedOrCreate, getAttachedOrElse, getAttachedOrGet, getAttachedOrSet, getAttachedOrThrow, hasAttached, modifyAttached, onAttachedSet, removeAttached, setAttached

    Methods inherited from interface org.ladysnake.cca.api.v3.component.ComponentAccess

    asComponentProvider, getComponent, syncComponent, syncComponent, syncComponent

    Methods inherited from interface net.minecraft.core.component.DataComponentGetter

    getOrDefault, getTyped

    Methods inherited from interface net.minecraft.world.entity.ItemOwner

    asLivingEntity

    Methods inherited from interface net.minecraft.world.Nameable

    getPlainTextName

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

    getFeedbackDisplayName

    Methods inherited from interface com.github.thedeathlycow.thermoo.api.temperature.Soakable

    thermoo$addWetTicks, thermoo$getSoakedScale, thermoo$isSoaked, thermoo$isWet

    Methods inherited from interface com.github.thedeathlycow.thermoo.api.temperature.TemperatureAware

    thermoo$addTemperature, thermoo$getTemperatureScale, thermoo$isCold, thermoo$isWarm
  • Constructor Details

    • EnvironmentAwareEntityMixin

      public EnvironmentAwareEntityMixin(net.minecraft.world.entity.EntityType<?> type, net.minecraft.world.level.Level level)
  • Method Details

    • canBreatheUnderwater

      public abstract boolean canBreatheUnderwater()
    • getAttributeValue

      public abstract double getAttributeValue(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute)
    • hasEffect

      public abstract boolean hasEffect(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect)
    • thermoo$setWetTicks

      public void thermoo$setWetTicks(int amount)
      Description copied from interface: Soakable
      Sets the wet ticks of a soakable to an exact amount.

      Clamps the amount between 0 and max wet ticks before setting.

      Specified by:
      thermoo$setWetTicks in interface Soakable
      Parameters:
      amount - The amount of wet ticks
    • thermoo$getWetTicks

      public int thermoo$getWetTicks()
      Specified by:
      thermoo$getWetTicks in interface Soakable
      Returns:
      Returns the wet ticks of the soakable
    • thermoo$getMaxWetTicks

      public int thermoo$getMaxWetTicks()
      Specified by:
      thermoo$getMaxWetTicks in interface Soakable
      Returns:
      Returns the maximum wet ticks the soakable can have
    • thermoo$ignoresFrigidWater

      public boolean thermoo$ignoresFrigidWater()
      Description copied from interface: Soakable
      Soakables ignore frigid water if they can breathe in water.
      Specified by:
      thermoo$ignoresFrigidWater in interface Soakable
      Returns:
      Returns if the soakable ignores the effects of frigid water
    • thermoo$getTemperature

      public int thermoo$getTemperature()
      Specified by:
      thermoo$getTemperature in interface TemperatureAware
      Returns:
      Returns the current temperature of the temperature aware object
    • thermoo$setTemperature

      public void thermoo$setTemperature(int temperature)
      Specified by:
      thermoo$setTemperature in interface TemperatureAware
      Parameters:
      temperature - Sets the current temperature of the temperature aware object to an exact value
    • thermoo$getMinTemperature

      public int thermoo$getMinTemperature()
      Specified by:
      thermoo$getMinTemperature in interface TemperatureAware
      Returns:
      Returns the minimum allowed temperature of the temperature aware object.
    • thermoo$getMaxTemperature

      public int thermoo$getMaxTemperature()
      Specified by:
      thermoo$getMaxTemperature in interface TemperatureAware
      Returns:
      Returns the maximum allowed temperature of the temperature aware object
    • thermoo$getColdResistance

      public double thermoo$getColdResistance()
      Description copied from interface: TemperatureAware
      Supplies the cold resistance of the temperature aware object. Cold Resistance is a percentage on a scale from 0 to 10, where 0 cold resistance corresponds to 0%, and 10 cold resistance corresponds to 100%.
      Specified by:
      thermoo$getColdResistance in interface TemperatureAware
      Returns:
      Returns the cold resistance of the temperature aware object
    • thermoo$getHeatResistance

      public double thermoo$getHeatResistance()
      Description copied from interface: TemperatureAware
      Supplies the heat resistance of the temperature aware object. Heat Resistance is a percentage on a scale from 0 to 10, where 0 heat resistance corresponds to 0%, and 10 heat resistance corresponds to 100%.
      Specified by:
      thermoo$getHeatResistance in interface TemperatureAware
      Returns:
      Returns the heat resistance of the temperature aware object
    • thermoo$getEnvironmentColdResistance

      public double thermoo$getEnvironmentColdResistance()
      Description copied from interface: TemperatureAware
      Supplies the environmental cold resistance of a temperature aware object. Environmental cold resistance is a chance to dodge a strictly negative environment temperature change.
      Specified by:
      thermoo$getEnvironmentColdResistance in interface TemperatureAware
      Returns:
      Returns a double in the range [0, 1] that is the chance that a negative environment temperature change will be dodged
    • thermoo$getEnvironmentHeatResistance

      public double thermoo$getEnvironmentHeatResistance()
      Description copied from interface: TemperatureAware
      Supplies the environmental heat resistance of a temperature aware object. Environmental heat resistance is a chance to dodge a strictly positive environment temperature change.
      Specified by:
      thermoo$getEnvironmentHeatResistance in interface TemperatureAware
      Returns:
      Returns a double in the range [0, 1] that is the chance that a positive environment temperature change will be dodged
    • thermoo$canFreeze

      public boolean thermoo$canFreeze()
      Specified by:
      thermoo$canFreeze in interface TemperatureAware
      Returns:
      Returns if the thermally aware object can be affected by cold
    • thermoo$canOverheat

      public boolean thermoo$canOverheat()
      Specified by:
      thermoo$canOverheat in interface TemperatureAware
      Returns:
      Returns if the thermally aware object can be affected by heat
    • thermoo$addTemperature

      public void thermoo$addTemperature(int temperatureChange, HeatingMode mode)
      Description copied from interface: TemperatureAware
      Adds or removes some amount of temperature to the thermally aware object. Resistance can be applied by specifying a HeatingMode. See HeatingModes for some common modes.
      Specified by:
      thermoo$addTemperature in interface TemperatureAware
      Parameters:
      temperatureChange - The amount of temperature to add/remove. Positive change adds, negative change removes.
      mode - The mode of resistance to apply to the change.
    • thermoo$getRandom

      public net.minecraft.util.RandomSource thermoo$getRandom()
      Specified by:
      thermoo$getRandom in interface TemperatureAware
      Returns:
      Returns a random number generator object associated with this temperature aware