Compare commits

..

No commits in common. "master" and "1.20.1" have entirely different histories.

3 changed files with 16 additions and 28 deletions

View file

@ -1,9 +0,0 @@
# maybeefix - maybe a bee bug fix for mc
尝试修理 [MC-168329](https://bugs.mojang.com/browse/MC-168329): 蜜蜂在阴间和末地时,可能不出来的情况。*"yesterday they came out just fine"*
经过用户[繁茂橡木Oaklively](https://space.bilibili.com/390245989)初步分析,复现的方法是,在主世界下雨/打雷的时候保存退出重进。
推测此时整个末地(或下界)的 isRaining 都会返回 true,即使末地和地狱不可能下雨。
解决方案是给 isRaining 函数加一个是否有天空光的检查,用于区分是不是下界和末地。

View file

@ -6,7 +6,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(World.class) @Mixin(World.class)
public abstract class WorldMixin { public abstract class WorldMixin {
@ -14,13 +14,11 @@ public abstract class WorldMixin {
public abstract DimensionType getDimension(); public abstract DimensionType getDimension();
// 尝试修复 MC-168329 // 尝试修复 MC-168329
// 根据 https://github.com/Lupicus/BeeFix/blob/master/src/main/resources/asm/Level.js 找到问题来源 // 根据 https://github.com/Lupicus/BeeFix/blob/master/src/main/resources/asm/Level.js
// 不过我觉得 hook isRaining 会更香草一点 @Inject(method = "initWeatherGradients", at = @At("HEAD"),cancellable = true)
protected void initWeatherGradientsMixin(CallbackInfo ci){
@Inject(method = "isRaining", at = @At("HEAD"), cancellable = true)
protected void notRainInTheEnd(CallbackInfoReturnable<Boolean> cir) {
if (!getDimension().hasSkyLight()) { if (!getDimension().hasSkyLight()) {
cir.setReturnValue(false); ci.cancel();
} }
} }
} }

View file

@ -4,7 +4,6 @@
"package": "com.alpt.maybeefix.mixin", "package": "com.alpt.maybeefix.mixin",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [
"WorldMixin"
], ],
"client": [ "client": [
], ],