Interface BuiltinTemperatureSources

All Known Implementing Classes:
BuiltinTemperatureSourcesImpl

@NonExtendable public interface BuiltinTemperatureSources
Stores shared temperature change contexts for the built in temperature sources. All sources stored by this class have no cause, direct cause, or position. Also provides convenience methods for creating unshared instances from keys without needing to explicitly lookup sources.
  • Method Details

    • absolute

      TemperatureChange absolute()
      Returns:
      Returns a shared temperature change context with a source of TemperatureSources.ABSOLUTE
    • active

      Returns:
      Returns a shared temperature change context with a source of TemperatureSources.ACTIVE
    • passive

      Returns:
      Returns a shared temperature change context with a source of TemperatureSources.PASSIVE
    • environment

      TemperatureChange environment()
      Returns:
      Returns a shared temperature change context with a source of TemperatureSources.ENVIRONMENT
    • create

      TemperatureChange create(net.minecraft.resources.ResourceKey<TemperatureSource> sourceKey)
      Creates a simple temperature change context with only a type and no cause or position.
      Parameters:
      sourceKey - The key of the change source, may not be null.
    • create

      TemperatureChange create(net.minecraft.resources.ResourceKey<TemperatureSource> sourceKey, net.minecraft.world.phys.Vec3 position)
      Creates a temperature change context with a type and a position, but no cause.
      Parameters:
      sourceKey - The key of the change source, may not be null.
      position - The position of the temperature change source, may not be null.
    • create

      TemperatureChange create(net.minecraft.resources.ResourceKey<TemperatureSource> sourceKey, net.minecraft.world.entity.Entity directCause)
      Creates a temperature change context with a type and a directCause entity. If the directCause is a TraceableEntity and has a non-null owner, then the TemperatureChange.cause() will refer to the owner. Otherwise, the TemperatureChange.directCause() and TemperatureChange.cause() will refer to the same entity. In either case, the TemperatureChange.position() will be the directCause's position.
      Parameters:
      sourceKey - The key of the change source, may not be null.
      directCause - The entity directly responsible for the change, may not be null.
    • create

      TemperatureChange create(net.minecraft.resources.ResourceKey<TemperatureSource> sourceKey, net.minecraft.world.entity.Entity cause, net.minecraft.world.entity.Entity directCause)
      Creates a temperature change context with a type, a cause entity, and a direct cause entity. The TemperatureChange.position() will be the direct cause's position.
      Parameters:
      sourceKey - The key of the change source, may not be null.
      cause - The entity responsible for the change, may not be null.
      directCause - The entity directly responsible for the change, may not be null.