diff --git a/.idea/artifacts/Runtime.xml b/.idea/artifacts/Runtime.xml
new file mode 100644
index 000000000..25a93b315
--- /dev/null
+++ b/.idea/artifacts/Runtime.xml
@@ -0,0 +1,74 @@
+
+
+ $PROJECT_DIR$/out/artifacts/Runtime
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/artifacts/TerrarumBuild.xml b/.idea/artifacts/TerrarumBuild.xml
index 7bbf5d5e6..1c180ad5f 100644
--- a/.idea/artifacts/TerrarumBuild.xml
+++ b/.idea/artifacts/TerrarumBuild.xml
@@ -5,7 +5,6 @@
-
@@ -59,7 +58,6 @@
-
diff --git a/.idea/libraries/ibm_icu_icu4j.xml b/.idea/libraries/ibm_icu_icu4j.xml
deleted file mode 100644
index 15026b6c7..000000000
--- a/.idea/libraries/ibm_icu_icu4j.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/App.xml b/.idea/runConfigurations/App.xml
deleted file mode 100644
index 2049f3459..000000000
--- a/.idea/runConfigurations/App.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/Terrarum.xml b/.idea/runConfigurations/Terrarum.xml
new file mode 100644
index 000000000..a04dbd166
--- /dev/null
+++ b/.idea/runConfigurations/Terrarum.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Terrarum__no_DEV_MODE_.xml b/.idea/runConfigurations/Terrarum__no_DEV_MODE_.xml
new file mode 100644
index 000000000..a4ceb41ac
--- /dev/null
+++ b/.idea/runConfigurations/Terrarum__no_DEV_MODE_.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ModuleComputers/ModuleComputers.iml b/ModuleComputers/ModuleComputers.iml
index bc46cc7e7..7eb3b20b5 100644
--- a/ModuleComputers/ModuleComputers.iml
+++ b/ModuleComputers/ModuleComputers.iml
@@ -9,7 +9,6 @@
-
diff --git a/ModuleComputers/src/net/torvald/terrarum/modulecomputers/EntryPoint.kt b/ModuleComputers/src/net/torvald/terrarum/modulecomputers/EntryPoint.kt
index 2886e94a5..8a361d8b7 100644
--- a/ModuleComputers/src/net/torvald/terrarum/modulecomputers/EntryPoint.kt
+++ b/ModuleComputers/src/net/torvald/terrarum/modulecomputers/EntryPoint.kt
@@ -12,7 +12,7 @@ class EntryPoint : ModuleEntryPoint() {
override fun invoke() {
ModMgr.GameItemLoader.invoke(moduleName)
- println("[${moduleName[0].uppercase()}${moduleName.substring(1)}] Dirtboard(tm) go drrrrr")
+ println("[${moduleName[0].toUpperCase()}${moduleName.substring(1)}] Dirtboard(tm) go drrrrr")
}
override fun dispose() {
diff --git a/SYSTEM_REQUIREMENTS.md b/SYSTEM_REQUIREMENTS.md
deleted file mode 100644
index 1aa0f5da2..000000000
--- a/SYSTEM_REQUIREMENTS.md
+++ /dev/null
@@ -1,26 +0,0 @@
-## Minimum requirements ##
-
-* Processor with 2.4 GHz speed
-* GeForce MX 150
-* 4 GB of RAM
-* 4 GB of free disk space
-* Windows Vista/Mac OS X Lion or higher (Mac OS X Snow Leopard is incompatible with a shader the game uses)
-* PC: Java 8
-
-## Recommended requirements ##
-
-* Processor with 3.0 GHz speed, 4 threads available
-* GPU that can support OpenGL 2.1, is capable of 4K texture
-* 8 GB of RAM
-* 8 GB of free disk space
-* Windows Vista/Mac OS X Lion or higher
-* PC: Java 8
-
-## Tested environments ##
-
-(to devs: please extend this list with your test results!)
-
-* MacBookPro9,2 (MacBook Pro 13 inch mid-2012) -- shader don't work
-* Intel 6700K, nVidia GTX970, Windows 10 -- fully works
-* Intel 6600, nVidia GT 710, Windows 8 -- unplayable framerate
-* Intel 8265U, Intel UHD620/nVidia MX 250, Windows 10 -- fully works with Intel iGPU (24 fps), fully works with MX 250 (66 fps)
diff --git a/how_to_build_jre_with_jlink.md b/how_to_build_jre_with_jlink.md
new file mode 100644
index 000000000..524a355fd
--- /dev/null
+++ b/how_to_build_jre_with_jlink.md
@@ -0,0 +1,32 @@
+### Preparation
+
+Download and unzip the JDK for the appropriate operation systems first! JDKs can be downloaded on https://jdk.java.net/archive/.
+
+Then, on the terminal, run following commands:
+
+jlink --add-modules java.base,java.desktop,java.logging,jdk.unsupported --output /home/installed/Documents/Terrarum/out/runtime-linux --no-header-files --no-man-pages --strip-debug --compress=2
+
+jlink --module-path /home/installed/Documents/openjdk/jdk-11.0.2-windows/jmods:mods --add-modules java.base,java.desktop,java.logging,jdk.unsupported --output /home/installed/Documents/Terrarum/out/runtime-windows --no-header-files --no-man-pages --strip-debug --compress=2
+
+jlink --module-path /home/installed/Documents/openjdk/jdk-11.0.2.jdk-mac/Contents/Home/jmods:mods --add-modules java.base,java.desktop,java.logging,jdk.unsupported --output /home/installed/Documents/Terrarum/out/runtime-osx --no-header-files --no-man-pages --strip-debug --compress=2
+
+This process assumes that the game does NOT use the Java 9+ modules and every single required libraries are fat-jar'd (their contents extracted right into the Jar)
+
+### Packaging
+
+Create an output directory; its contents shall be:
+
+```
++assets
++runtime-linux
++runtime-osx
++runtime-windows
+start_game_linux.sh
+start_game_mac.sh
+start_game_windows.bat
+TerrarumBuild.jar
+```
+
+whereas `runtime-*` are runtime directories generated from the commands above, `TerrarumBuild.jar` is the artifact built using the TerrarumBuild.
+
+`start_game_*` files are on the root directory of the project; you only need to simply copy them over.
\ No newline at end of file
diff --git a/lib/icu4j-70.1-javadoc.jar b/lib/icu4j-70.1-javadoc.jar
deleted file mode 100644
index 3ca30e212..000000000
Binary files a/lib/icu4j-70.1-javadoc.jar and /dev/null differ
diff --git a/lib/icu4j-70.1-sources.jar b/lib/icu4j-70.1-sources.jar
deleted file mode 100644
index 03348fd70..000000000
Binary files a/lib/icu4j-70.1-sources.jar and /dev/null differ
diff --git a/lib/icu4j-70.1.jar b/lib/icu4j-70.1.jar
deleted file mode 100644
index 9f0747378..000000000
Binary files a/lib/icu4j-70.1.jar and /dev/null differ
diff --git a/lib/luaj-javadoc.jar b/lib/luaj-javadoc.jar
deleted file mode 100644
index aa170d028..000000000
Binary files a/lib/luaj-javadoc.jar and /dev/null differ
diff --git a/lib/luaj-jse-3.0.2.jar b/lib/luaj-jse-3.0.2.jar
deleted file mode 100644
index f14957539..000000000
Binary files a/lib/luaj-jse-3.0.2.jar and /dev/null differ
diff --git a/lib/luaj-sources-3.0.2.jar b/lib/luaj-sources-3.0.2.jar
deleted file mode 100644
index 3a89c23bd..000000000
Binary files a/lib/luaj-sources-3.0.2.jar and /dev/null differ
diff --git a/screenshot_01.png b/screenshot_01.png
deleted file mode 100644
index 27146d05d..000000000
Binary files a/screenshot_01.png and /dev/null differ
diff --git a/src/module-info.java.wtf b/src/module-info.java.wtf
index f0af35259..bdc471f86 100644
--- a/src/module-info.java.wtf
+++ b/src/module-info.java.wtf
@@ -1,11 +1,15 @@
module terrarum.terrarum {
// java
+ requires java.base;
requires java.desktop;
requires java.logging;
requires jdk.unsupported; // sun.misc.Unsafe
// kotlin
+ requires kotlin.stdlib;
requires kotlin.test;
+ requires kotlin.reflect;
+ requires kotlin.stdlib.jdk8;
// gdx
requires gdx;
@@ -16,15 +20,16 @@ module terrarum.terrarum {
// terrarum
requires TerrarumSansBitmap;
- requires TerranVirtualDisk;
requires Terrarum.Joise;
// etc
requires GetCpuName;
- requires kotlinx.serialization.core.jvm;
- requires kotlinx.serialization.json;
- requires kotlinx.serialization.json.jvm;
requires org.apache.commons.codec;
requires commons.csv;
requires jxinput;
+ requires org.graalvm.sdk;
+ requires com.ibm.icu;
+ requires org.lwjgl.opengl;
+
+ exports net.torvald.terrarum;
}
\ No newline at end of file
diff --git a/src/net/torvald/terrarum/TerrarumAppConfiguration.kt b/src/net/torvald/terrarum/TerrarumAppConfiguration.kt
index 8c165cdc4..91accdfd9 100644
--- a/src/net/torvald/terrarum/TerrarumAppConfiguration.kt
+++ b/src/net/torvald/terrarum/TerrarumAppConfiguration.kt
@@ -49,7 +49,7 @@ along with this program. If not, see .
*
*/
const val VERSION_RAW = 0x00030000
- // Commit counts up to the Release 0.3: 2257 (plz update!)
+ // Commit counts up to the Release 0.3: 2259 (plz update!)
//////////////////////////////////////////////////////////
// CONFIGURATION FOR TILE MAKER //
diff --git a/src/net/torvald/terrarum/debuggerapp/SavegameCracker.kt b/src/net/torvald/terrarum/debuggerapp/SavegameCracker.kt
index c71cd7676..0c480921a 100644
--- a/src/net/torvald/terrarum/debuggerapp/SavegameCracker.kt
+++ b/src/net/torvald/terrarum/debuggerapp/SavegameCracker.kt
@@ -1,11 +1,11 @@
package net.torvald.terrarum.debuggerapp
import net.torvald.terrarum.TerrarumAppConfiguration
-import net.torvald.terrarum.serialise.Common
import net.torvald.terrarum.savegame.EntryFile
import net.torvald.terrarum.savegame.VDUtil
import net.torvald.terrarum.savegame.VirtualDisk
import net.torvald.terrarum.savegame.diskIDtoReadableFilename
+import net.torvald.terrarum.serialise.Common
import java.io.File
import java.io.PrintStream
import java.nio.charset.Charset
@@ -110,7 +110,7 @@ class SavegameCracker(
it.call(this, args)
}
catch (e: Throwable) {
- val error = e.cause ?: e
+ val error = (e.cause ?: e) as java.lang.Throwable
printerrln("Error -- ${error}")
error.printStackTrace(stderr)
printerrln("Error -- ${error}")
diff --git a/src/net/torvald/terrarum/savegame/VDUtil.kt b/src/net/torvald/terrarum/savegame/VDUtil.kt
index cdc3e0c90..677b9649c 100644
--- a/src/net/torvald/terrarum/savegame/VDUtil.kt
+++ b/src/net/torvald/terrarum/savegame/VDUtil.kt
@@ -6,7 +6,6 @@ import java.util.*
import java.util.logging.Level
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
-import javax.naming.OperationNotSupportedException
import kotlin.experimental.and
/**
@@ -499,7 +498,7 @@ object VDUtil {
}
fun ByteArray64.toIntBig(): Int {
if (this.size != 4L)
- throw OperationNotSupportedException("ByteArray is not Int")
+ throw UnsupportedOperationException("ByteArray is not Int")
var i = 0
var c = 0
@@ -508,7 +507,7 @@ object VDUtil {
}
fun ByteArray64.toLongBig(): Long {
if (this.size != 8L)
- throw OperationNotSupportedException("ByteArray is not Long")
+ throw UnsupportedOperationException("ByteArray is not Long")
var i = 0L
var c = 0
@@ -517,7 +516,7 @@ object VDUtil {
}
fun ByteArray64.toInt48Big(): Long {
if (this.size != 6L)
- throw OperationNotSupportedException("ByteArray is not Long")
+ throw UnsupportedOperationException("ByteArray is not Long")
var i = 0L
var c = 0
@@ -526,7 +525,7 @@ object VDUtil {
}
fun ByteArray64.toShortBig(): Short {
if (this.size != 2L)
- throw OperationNotSupportedException("ByteArray is not Short")
+ throw UnsupportedOperationException("ByteArray is not Short")
return (this[0].toUint().shl(256) + this[1].toUint()).toShort()
}
diff --git a/src/net/torvald/terrarum/ui/UIItemTextLineInput.kt b/src/net/torvald/terrarum/ui/UIItemTextLineInput.kt
index f6aea9b5f..4ea547b58 100644
--- a/src/net/torvald/terrarum/ui/UIItemTextLineInput.kt
+++ b/src/net/torvald/terrarum/ui/UIItemTextLineInput.kt
@@ -13,7 +13,6 @@ import net.torvald.terrarum.*
import net.torvald.terrarum.gamecontroller.*
import net.torvald.terrarum.utils.Clipboard
import net.torvald.terrarumsansbitmap.gdx.CodepointSequence
-import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
import net.torvald.toJavaString
import kotlin.streams.toList
@@ -382,7 +381,7 @@ class UIItemTextLineInput(
}
}
- private fun String.toCodePoints() = this.codePoints().toList().filter { it > 0 }.toList()
+ private fun String.toCodePoints() = (this as java.lang.CharSequence).codePoints().toList().filter { it > 0 }.toList()
private fun endComposing(force: Boolean = false) {
getIME(force)?.let {
diff --git a/start_game_linux.sh b/start_game_linux.sh
new file mode 100755
index 000000000..1382b188d
--- /dev/null
+++ b/start_game_linux.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+./runtime-linux/bin/java -Xms1G -Xmx6G -jar TerrarumBuild.jar
diff --git a/start_game_mac.sh b/start_game_mac.sh
new file mode 100755
index 000000000..a1c31415c
--- /dev/null
+++ b/start_game_mac.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+./runtime-osx/bin/java -Xms1G -Xmx6G -jar TerrarumBuild.jar
diff --git a/start_game_windows.bat b/start_game_windows.bat
new file mode 100755
index 000000000..bdaeddb66
--- /dev/null
+++ b/start_game_windows.bat
@@ -0,0 +1 @@
+runtime-windows\bin\java -Xms1G -Xmx6G -jar TerrarumBuild.jar
diff --git a/terrarum.terrarum.iml b/terrarum.terrarum.iml
index a89b041ee..b09d72d6b 100644
--- a/terrarum.terrarum.iml
+++ b/terrarum.terrarum.iml
@@ -16,13 +16,11 @@
-
-
-
+
\ No newline at end of file