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.RemovalReasonNested 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, zOldFields inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
NBT_ATTACHMENT_KEYFields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionEnvironmentAwareEntityMixin(net.minecraft.world.entity.EntityType<?> type, net.minecraft.world.level.Level level) -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanabstract doublegetAttributeValue(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute) abstract booleanhasEffect(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect) voidthermoo$addTemperature(int temperatureChange, HeatingMode mode) Adds or removes some amount of temperature to the thermally aware object.booleanbooleandoubleSupplies the cold resistance of the temperature aware object.doubleSupplies the environmental cold resistance of a temperature aware object.doubleSupplies the environmental heat resistance of a temperature aware object.doubleSupplies the heat resistance of the temperature aware object.intintintnet.minecraft.util.RandomSourceintintbooleanSoakables ignore frigid water if they can breathe in water.voidthermoo$setTemperature(int temperature) voidthermoo$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, waterSwimSoundMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
getAttached, getAttachedOrCreate, getAttachedOrCreate, getAttachedOrElse, getAttachedOrGet, getAttachedOrSet, getAttachedOrThrow, hasAttached, modifyAttached, onAttachedSet, removeAttached, setAttachedMethods inherited from interface org.ladysnake.cca.api.v3.component.ComponentAccess
asComponentProvider, getComponent, syncComponent, syncComponent, syncComponentMethods inherited from interface net.minecraft.core.component.DataComponentGetter
getOrDefault, getTypedMethods inherited from interface net.minecraft.world.entity.ItemOwner
asLivingEntityMethods inherited from interface net.minecraft.world.Nameable
getPlainTextNameMethods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayNameMethods inherited from interface com.github.thedeathlycow.thermoo.api.temperature.Soakable
thermoo$addWetTicks, thermoo$getSoakedScale, thermoo$isSoaked, thermoo$isWetMethods 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:SoakableSets the wet ticks of a soakable to an exact amount.Clamps the amount between 0 and max wet ticks before setting.
- Specified by:
thermoo$setWetTicksin interfaceSoakable- Parameters:
amount- The amount of wet ticks
-
thermoo$getWetTicks
public int thermoo$getWetTicks()- Specified by:
thermoo$getWetTicksin interfaceSoakable- Returns:
- Returns the wet ticks of the soakable
-
thermoo$getMaxWetTicks
public int thermoo$getMaxWetTicks()- Specified by:
thermoo$getMaxWetTicksin interfaceSoakable- Returns:
- Returns the maximum wet ticks the soakable can have
-
thermoo$ignoresFrigidWater
public boolean thermoo$ignoresFrigidWater()Description copied from interface:SoakableSoakables ignore frigid water if they can breathe in water.- Specified by:
thermoo$ignoresFrigidWaterin interfaceSoakable- Returns:
- Returns if the soakable ignores the effects of frigid water
-
thermoo$getTemperature
public int thermoo$getTemperature()- Specified by:
thermoo$getTemperaturein interfaceTemperatureAware- Returns:
- Returns the current temperature of the temperature aware object
-
thermoo$setTemperature
public void thermoo$setTemperature(int temperature) - Specified by:
thermoo$setTemperaturein interfaceTemperatureAware- Parameters:
temperature- Sets the current temperature of the temperature aware object to an exact value
-
thermoo$getMinTemperature
public int thermoo$getMinTemperature()- Specified by:
thermoo$getMinTemperaturein interfaceTemperatureAware- Returns:
- Returns the minimum allowed temperature of the temperature aware object.
-
thermoo$getMaxTemperature
public int thermoo$getMaxTemperature()- Specified by:
thermoo$getMaxTemperaturein interfaceTemperatureAware- Returns:
- Returns the maximum allowed temperature of the temperature aware object
-
thermoo$getColdResistance
public double thermoo$getColdResistance()Description copied from interface:TemperatureAwareSupplies 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$getColdResistancein interfaceTemperatureAware- Returns:
- Returns the cold resistance of the temperature aware object
-
thermoo$getHeatResistance
public double thermoo$getHeatResistance()Description copied from interface:TemperatureAwareSupplies 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$getHeatResistancein interfaceTemperatureAware- Returns:
- Returns the heat resistance of the temperature aware object
-
thermoo$getEnvironmentColdResistance
public double thermoo$getEnvironmentColdResistance()Description copied from interface:TemperatureAwareSupplies the environmental cold resistance of a temperature aware object. Environmental cold resistance is a chance to dodge a strictly negativeenvironment temperature change.- Specified by:
thermoo$getEnvironmentColdResistancein interfaceTemperatureAware- 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:TemperatureAwareSupplies the environmental heat resistance of a temperature aware object. Environmental heat resistance is a chance to dodge a strictly positiveenvironment temperature change.- Specified by:
thermoo$getEnvironmentHeatResistancein interfaceTemperatureAware- 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$canFreezein interfaceTemperatureAware- Returns:
- Returns if the thermally aware object can be affected by cold
-
thermoo$canOverheat
public boolean thermoo$canOverheat()- Specified by:
thermoo$canOverheatin interfaceTemperatureAware- Returns:
- Returns if the thermally aware object can be affected by heat
-
thermoo$addTemperature
Description copied from interface:TemperatureAwareAdds or removes some amount of temperature to the thermally aware object. Resistance can be applied by specifying aHeatingMode. SeeHeatingModesfor some common modes.- Specified by:
thermoo$addTemperaturein interfaceTemperatureAware- 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$getRandomin interfaceTemperatureAware- Returns:
- Returns a random number generator object associated with this temperature aware
-