Skip to content
Beta: this is a preview of the new SplitScreen.Me. Data may be reset before launch.

Minecraft · handler “Minecraft: Java Edition”

Version 6

Release notes

windowed line fix

Released
Size
1.9 KB
Downloads
1,157
Check
Verified
SHA-256
313aba3f37fcc935601d3276a1dfb96ad26a5b43f09eb917f3f9bbffa96eca0c
Download v6 (.nc)All versions

Files 1

PathSize
handler.js4.9 KB

handler.js

Plain text
Hub.Handler.Version = 6; // Released at https://hub.splitscreen.me/ on Sat Nov 21 2020 01:49:26 GMT+0000 (UTC).
Hub.Handler.Id = "QC7TTYjjZzaQ6Y6Nw";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

Game.NeedsSteamEmulation = false;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = false;
Game.SupportsKeyboard = false;
Game.ExecutableName = "MinecraftLauncher.exe";
Game.SteamID = "15";
Game.GUID = "Minecraft Java Edition";
Game.GameName = "Minecraft Java Edition";
Game.MaxPlayers = 16;
Game.MaxPlayersOneMonitor = 16;
Game.HideTaskbar = true;
Game.Hook.ForceFocus = false;
Game.Hook.ForceFocusWindowName = "Minecraft";
Game.HasDynamicWindowTitle = true;
Game.Hook.DInputEnabled = false;
Game.Hook.DInputForceDisable = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.FakeFocus = true;
Game.FakeFocusInterval = 120;
Game.HookFocus = true;
Game.PreventGameFocus = true;
Game.RefreshWindowAfterStart = true;
Game.ForceProcessPick = true;
Game.NotTopMost = true;
Game.HideCursor = false;
Game.PauseBetweenStarts = 30;
Game.Description =
  "Java version only. If you are using the legit launcher and when launching via Nucleus it asks you to log in close Nucleus and make sure to log in with your account first outside of Nucleus, launch then close minecraft and disconnect your pc from the internet then launch via Nucleus and each launcher instance should have a different name now, that way you don't need to use multiple accounts to connect to each other, you can connect to the internet fine after that. If you use keyboards and mice after the instances open press the END key to lock the input for all instances to have their own cursor. Press the END key again to unlock the input. If you are going to use Controllers, you need to have Forge installed and the Controllable mod, if you want to play with just gamepads disable the Game.SupportsMultipleKeyboardsAndMice option in the script so you can use keyboard shortcuts in gamepad instances and other things that need keyboard.";

Game.SupportsMultipleKeyboardsAndMice = true;

Game.HookSetCursorPos = true;
Game.HookGetCursorPos = true;
Game.HookGetKeyState = true;
Game.HookGetAsyncKeyState = true;
Game.HookGetKeyboardState = true;
Game.HookFilterRawInput = true;
Game.HookFilterMouseMessages = true;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = false;

Game.SendNormalMouseInput = true;
Game.SendNormalKeyboardInput = true;
Game.SendScrollWheel = true;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = true;
Game.HookReRegisterRawInputMouse = true;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = true;
Game.LockInputAtStart = false;
Game.LockInputToggleKey = 0x23;

MakeNotReadonly = function(path) {
  if (System.IO.File.Exists(path)) {
    var oldAttr = System.IO.File.GetAttributes(path);
    var newAttr = oldAttr & ~1;
    System.IO.File.SetAttributes(path, newAttr);
  }
};

MakeReadonly = function(path) {
  if (System.IO.File.Exists(path)) {
    var oldAttr = System.IO.File.GetAttributes(path);
    var newAttr = oldAttr | 1;
    System.IO.File.SetAttributes(path, newAttr);
  }
};

Game.Play = function() {
  var name = "Player" + Context.PlayerID;
  var dotm = System.Environment.GetFolderPath(26) + "\\.minecraft";

  //Kill any running Minecraft Launchers or they will use the old username.
  Context.KillProcessesMatchingWindowName("Minecraft Launcher");
  Context.KillProcessesMatchingProcessName("MinecraftLauncher");

  //Paths
  var lpfp = dotm + "\\launcher_profiles.json";
  var uc = dotm + "\\usercache.json";
  var unc = dotm + "\\usernamecache.json";

  //Mark not readonly
  MakeNotReadonly(lpfp);
  MakeNotReadonly(uc);
  MakeNotReadonly(unc);

  //Wipe files
  var emptyLines = [];
  Context.WriteTextFile(uc, emptyLines);
  Context.WriteTextFile(unc, emptyLines);

  var usernameLineNumber = Context.FindLineNumberInTextFile(lpfp, '"displayName"', 0);

  if (usernameLineNumber != -1) {
    var replaceUsernameLine = [usernameLineNumber + "|" + '"displayName" : "' + name + '"'];

    Context.ReplaceLinesInTextFile(lpfp, replaceUsernameLine);
  }

  //Mark readonly
  MakeReadonly(lpfp);
  MakeReadonly(uc);
  MakeReadonly(unc);

  if (Context.PlayerID == 0) {
    var username = System.Environment.UserName;
    if (System.IO.File.Exists("C:\\Users\\" + username + "\\AppData\\Roaming\\.minecraft\\options.txt")) {
      var cfgFilePath = "C:\\Users\\" + username + "\\AppData\\Roaming\\.minecraft\\options.txt";
      var windowModeLine = Context.FindLineNumberInTextFile(cfgFilePath, "fullscreen", Nucleus.SearchType.StartsWith);

      Context.ReplaceLinesInTextFile(cfgFilePath, [windowModeLine + "|fullscreen:false"]);
    } else {
    }
  }
};