mirror of
https://github.com/chylex/Hardcore-Ender-Expansion-2.git
synced 2025-04-11 03:15:44 +02:00
Maximize client/server window when debugging
This commit is contained in:
parent
a47db662bc
commit
479815d194
6
.gitignore
vendored
6
.gitignore
vendored
@ -24,6 +24,6 @@ bin
|
||||
build
|
||||
.gradle
|
||||
|
||||
# other
|
||||
eclipse
|
||||
run
|
||||
# game
|
||||
run/*
|
||||
!run/maximize.ps1
|
||||
|
3
run/maximize.ps1
Normal file
3
run/maximize.ps1
Normal file
@ -0,0 +1,3 @@
|
||||
Param([Parameter(Mandatory = $True, Position = 1)][string] $processId)
|
||||
Add-Type -MemberDefinition '[DllImport("user32.dll")]public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);' -Name Functions -Namespace Win32
|
||||
[Win32.Functions]::ShowWindow((Get-Process -Id $processId).MainWindowHandle, 3)
|
@ -3,8 +3,13 @@ import chylex.hee.HardcoreEnderExpansion
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler
|
||||
import net.minecraftforge.fml.relauncher.Side.CLIENT
|
||||
import net.minecraftforge.fml.relauncher.Side.SERVER
|
||||
import org.lwjgl.LWJGLUtil
|
||||
import org.lwjgl.LWJGLUtil.PLATFORM_WINDOWS
|
||||
import org.lwjgl.opengl.Display
|
||||
import java.awt.GraphicsEnvironment
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.lang.management.ManagementFactory
|
||||
import java.util.Properties
|
||||
|
||||
object Debug{
|
||||
@ -29,6 +34,11 @@ object Debug{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (LWJGLUtil.getPlatform() == PLATFORM_WINDOWS && !GraphicsEnvironment.isHeadless() && File("maximize.ps1").exists()){
|
||||
val pid = ManagementFactory.getRuntimeMXBean().name.split("@")[0]
|
||||
ProcessBuilder("powershell.exe", "-ExecutionPolicy", "Unrestricted", "-File", "maximize.ps1", pid).start()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user