Remove biome temperature caching

Based on 4553ccb0a0
This commit is contained in:
embeddedt 2023-01-02 10:25:39 -05:00
parent e50859f10d
commit f2e557253e
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package org.embeddedt.modernfix.mixin;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
/* Idea from Lithium for 1.19.3 */
@Mixin(Biome.class)
public abstract class BiomeMixin {
@Shadow protected abstract float getTemperatureAtPosition(BlockPos pos);
/**
* @author 2No2Name
* @reason Remove caching, it's not effective
* @param pos
* @return
*/
@Overwrite
public final float getTemperature(BlockPos pos) {
return this.getTemperatureAtPosition(pos);
}
}

View File

@ -5,6 +5,7 @@
"compatibilityLevel": "JAVA_8",
"refmap": "modernfix.refmap.json",
"mixins": [
"BiomeMixin",
"ModFileResourcePackMixin",
"VanillaPackMixin",
"LevelSaveMixin",