aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java
blob: 70ef9cbdb2499e494436edf74820da3e94c753a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package moe.nea.firmament.mixins;

import moe.nea.firmament.events.WorldReadyEvent;
import net.minecraft.client.Minecraft;
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;

@Mixin(Minecraft.class)
public class WorldReadyEventPatch {
	@Inject(method = "setLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;updateLevelInEngines(Lnet/minecraft/client/multiplayer/ClientLevel;)V", shift = At.Shift.AFTER))
	public void onClose(CallbackInfo ci) {
		WorldReadyEvent.Companion.publish(new WorldReadyEvent());
	}
}