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 1

Release notes

First release

Released
Size
1.4 KB
Downloads
42
Check
Verified
SHA-256
09e26a6589671b7df9a2cd7e0bec4c3e445b6244ce464451743ceecb3d48198c
Download v1 (.nc)All versions

Files 1

PathSize
handler.js3.6 KB

handler.js

Plain text
Hub.Handler.Version = 1; // Released at https://hub.splitscreen.me/ on Mon Apr 13 2020 04:19:09 GMT+0000 (UTC).
Hub.Handler.Id = "QC7TTYjjZzaQ6Y6Nw";
Hub.Maintainer.Name = "dr.oldboi";
Hub.Maintainer.Id = "dPRj3q6kFtT4HvMGg";

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 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.";

Game.SupportsMultipleKeyboardsAndMice = false;

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) {
  var oldAttr = System.IO.File.GetAttributes(path);
  var newAttr = oldAttr & ~1;
  System.IO.File.SetAttributes(path, newAttr);
};

MakeReadonly = function(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);
};