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 Summary
Modifier and TypeMethodDescriptionabsolute()active()create(net.minecraft.resources.ResourceKey<TemperatureSource> sourceKey) Creates a simple temperature change context with only a type and no cause or position.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.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.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.passive()
-
Method Details
-
absolute
TemperatureChange absolute()- Returns:
- Returns a shared temperature change context with a source of
TemperatureSources.ABSOLUTE
-
active
TemperatureChange active()- Returns:
- Returns a shared temperature change context with a source of
TemperatureSources.ACTIVE
-
passive
TemperatureChange 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
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 benull.
-
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 benull.position- The position of the temperature change source, may not benull.
-
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 thedirectCauseis aTraceableEntityand has a non-null owner, then theTemperatureChange.cause()will refer to the owner. Otherwise, theTemperatureChange.directCause()andTemperatureChange.cause()will refer to the same entity. In either case, theTemperatureChange.position()will be the directCause's position.- Parameters:
sourceKey- The key of the change source, may not benull.directCause- The entity directly responsible for the change, may not benull.
-
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. TheTemperatureChange.position()will be the direct cause's position.- Parameters:
sourceKey- The key of the change source, may not benull.cause- The entity responsible for the change, may not benull.directCause- The entity directly responsible for the change, may not benull.
-