fix ad astra temperature system
This commit is contained in:
parent
efc1642254
commit
2c745a302f
@ -197,10 +197,10 @@ dependencies {
|
||||
runtimeOnly(fg.deobf("curse.maven:jade-324717:${jade_id}"))
|
||||
runtimeOnly(fg.deobf("curse.maven:configured-457570:${configured_id}"))
|
||||
|
||||
implementation(fg.deobf("curse.maven:ad-astra-635042:${ad_astra_id}"))
|
||||
implementation(fg.deobf("curse.maven:resourceful-lib-570073:4378849"))
|
||||
implementation(fg.deobf("curse.maven:resourceful-config-714059:4394154"))
|
||||
implementation(fg.deobf("curse.maven:botarium-704113:4416456"))
|
||||
compileOnly(fg.deobf("curse.maven:ad-astra-635042:${ad_astra_id}"))
|
||||
// implementation(fg.deobf("curse.maven:resourceful-lib-570073:4378849"))
|
||||
// implementation(fg.deobf("curse.maven:resourceful-config-714059:4394154"))
|
||||
// implementation(fg.deobf("curse.maven:botarium-704113:4416456"))
|
||||
|
||||
// runtimeOnly(fg.deobf("curse.maven:worldedit-225608:${worldedit_fileid}"))
|
||||
// runtimeOnly(fg.deobf("at.ridgo8.moreoverlays:MoreOverlays-updated:${more_overlays_version}"))
|
||||
|
@ -0,0 +1,28 @@
|
||||
package ru.dbotthepony.mc.otm.mixin.compat.ad_astra;
|
||||
|
||||
import earth.terrarium.ad_astra.common.data.Planet;
|
||||
import earth.terrarium.ad_astra.common.data.PlanetData;
|
||||
import earth.terrarium.ad_astra.common.entity.system.EntityTemperatureSystem;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import ru.dbotthepony.mc.otm.config.ServerCompatConfig;
|
||||
|
||||
// STAHP!
|
||||
@Mixin(EntityTemperatureSystem.class)
|
||||
public class EntityTemperatureSystemMixin {
|
||||
@Inject(
|
||||
method = "temperatureTick(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/server/level/ServerLevel;)V",
|
||||
at = @At("HEAD"),
|
||||
cancellable = true,
|
||||
remap = false
|
||||
)
|
||||
private static void temperatureTick(LivingEntity entity, ServerLevel level, CallbackInfo hook) {
|
||||
if (ServerCompatConfig.AdAstra.INSTANCE.getWHATS_UP_WITH_TEMPERATURE() && !PlanetData.getPlanetFromLevel(level.dimension()).map(Planet::hasAtmosphere).orElse(true)) {
|
||||
hook.cancel();
|
||||
}
|
||||
}
|
||||
}
|
@ -10,6 +10,11 @@ object ServerCompatConfig : AbstractConfig("compat-server") {
|
||||
.comment("Android do not need oxygen in space")
|
||||
.define("ANDROIDS_DO_NOT_NEED_OXYGEN", true)
|
||||
|
||||
val WHATS_UP_WITH_TEMPERATURE: Boolean by builder
|
||||
.comment("Disables temperature mechanics on planets without atmosphere.")
|
||||
.comment("I attended physics classes in middle school, and this kills me.")
|
||||
.define("WHATS_UP_WITH_TEMPERATURE", true)
|
||||
|
||||
init {
|
||||
builder.pop()
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
"refmap": "overdrive_that_matters.refmap.json",
|
||||
"mixins": [
|
||||
"EntityOxygenSystemMixin",
|
||||
"EntityTemperatureSystemMixin",
|
||||
"OxygenUtilsMixin"
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user