mojang order of things
This commit is contained in:
1 parent
6c01ae6807
commit
4e9a1aa39d
5 files changed
+56
-17
No files matched your search
@@ -0,0 +1,18 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.CarpetServer;
|
||||||
|
import net.minecraft.client.main.Main;
|
||||||
|
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(Main.class)
|
||||||
|
public class Main_clientCoreMixin
|
||||||
|
{
|
||||||
|
@Inject(method = "main", at = @At("HEAD"))
|
||||||
|
private static void onServerStarted(String[] args, CallbackInfo ci)
|
||||||
|
{
|
||||||
|
CarpetServer.onGameStarted();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.CarpetServer;
|
||||||
|
import net.minecraft.server.Main;
|
||||||
|
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(Main.class)
|
||||||
|
public class Main_serverCoreMixin
|
||||||
|
{
|
||||||
|
@Inject(method = "main", at = @At("HEAD"))
|
||||||
|
private static void onServerStarted(String[] args, CallbackInfo ci)
|
||||||
|
{
|
||||||
|
CarpetServer.onGameStarted();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,12 +14,12 @@ public class MinecraftClientMixin
|
|||||||
{
|
{
|
||||||
//to inject right before
|
//to inject right before
|
||||||
// this.tickWorlds(booleanSupplier_1);
|
// this.tickWorlds(booleanSupplier_1);
|
||||||
@Inject(method = "run", at = @At(value = "HEAD")
|
//@Inject(method = "run", at = @At(value = "HEAD")
|
||||||
)
|
//)
|
||||||
private void onInit(CallbackInfo ci) {
|
//private void onInit(CallbackInfo ci) {
|
||||||
//CM start game hook
|
// //CM start game hook
|
||||||
CarpetServer.onGameStarted();
|
// CarpetServer.onGameStarted();
|
||||||
}
|
//}
|
||||||
|
|
||||||
@Inject(method = "disconnect(Lnet/minecraft/client/gui/screen/Screen;)V", at = @At("HEAD"))
|
@Inject(method = "disconnect(Lnet/minecraft/client/gui/screen/Screen;)V", at = @At("HEAD"))
|
||||||
private void onCloseGame(Screen screen, CallbackInfo ci)
|
private void onCloseGame(Screen screen, CallbackInfo ci)
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ public class MinecraftDedicatedServerMixin
|
|||||||
{
|
{
|
||||||
//to inject right before
|
//to inject right before
|
||||||
// this.tickWorlds(booleanSupplier_1);
|
// this.tickWorlds(booleanSupplier_1);
|
||||||
@Inject(method = "setupServer", at = @At(
|
//@Inject(method = "setupServer", at = @At(
|
||||||
value = "INVOKE",
|
// value = "INVOKE",
|
||||||
target = "Lnet/minecraft/server/dedicated/MinecraftDedicatedServer;loadWorld()V",
|
// target = "Lnet/minecraft/server/dedicated/MinecraftDedicatedServer;loadWorld()V",
|
||||||
shift = At.Shift.BEFORE
|
// shift = At.Shift.BEFORE
|
||||||
))
|
//))
|
||||||
private void onSetupServer(CallbackInfoReturnable<Boolean> cir) {
|
//private void onSetupServer(CallbackInfoReturnable<Boolean> cir) {
|
||||||
//CM start game hook
|
// //CM start game hook
|
||||||
CarpetServer.onGameStarted();
|
// CarpetServer.onGameStarted();
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
"refmap": "fabric-carpet-refmap.json",
|
"refmap": "fabric-carpet-refmap.json",
|
||||||
"package": "carpet.mixins",
|
"package": "carpet.mixins",
|
||||||
"compatibilityLevel": "JAVA_8",
|
"compatibilityLevel": "JAVA_8",
|
||||||
"mixins": [ "SpawnHelperInnerMixin",
|
"mixins": [
|
||||||
|
"Main_serverCoreMixin",
|
||||||
|
"SpawnHelperInnerMixin",
|
||||||
"CommandManagerMixin",
|
"CommandManagerMixin",
|
||||||
|
|
||||||
"ServerPlayNetworkHandlerMixin",
|
"ServerPlayNetworkHandlerMixin",
|
||||||
@@ -170,6 +172,7 @@
|
|||||||
|
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
|
"Main_clientCoreMixin",
|
||||||
"RenderTickCounter_tickSpeedMixin",
|
"RenderTickCounter_tickSpeedMixin",
|
||||||
"MinecraftClientMixin",
|
"MinecraftClientMixin",
|
||||||
"MinecraftClient_pausedShakeMixin",
|
"MinecraftClient_pausedShakeMixin",
|
||||||
|
|||||||
Reference in new issue
Block a user