Skip to content

Commit efe27dd

Browse files
committed
[config b1.7.3] fix 'close world' event fired when connecting to server
1 parent c6e158c commit efe27dd

File tree

1 file changed

+4
-1
lines changed
  • libraries/config/config-client-mcb1.3-1750-mcb1.7.3/src/main/java/net/ornithemc/osl/config/impl/mixin/client

1 file changed

+4
-1
lines changed

libraries/config/config-client-mcb1.3-1750-mcb1.7.3/src/main/java/net/ornithemc/osl/config/impl/mixin/client/MinecraftMixin.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package net.ornithemc.osl.config.impl.mixin.client;
22

33
import org.spongepowered.asm.mixin.Mixin;
4+
import org.spongepowered.asm.mixin.Shadow;
45
import org.spongepowered.asm.mixin.Unique;
56
import org.spongepowered.asm.mixin.injection.At;
67
import org.spongepowered.asm.mixin.injection.Inject;
@@ -15,14 +16,16 @@
1516
@Mixin(Minecraft.class)
1617
public class MinecraftMixin {
1718

19+
@Shadow private World world;
20+
1821
@Inject(
1922
method = "setWorld(Lnet/minecraft/world/World;Ljava/lang/String;Lnet/minecraft/entity/living/player/PlayerEntity;)V",
2023
at = @At(
2124
value = "HEAD"
2225
)
2326
)
2427
private void osl$config$closeWorld(World world, String message, PlayerEntity player, CallbackInfo ci) {
25-
if (world == null && osl$config$startGameDepth == 0) {
28+
if (this.world != null && world == null && osl$config$startGameDepth == 0) {
2629
ConfigInitializer.CLOSE_WORLD.invoker().accept((Minecraft)(Object)this);
2730
}
2831
}

0 commit comments

Comments
 (0)