diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
new file mode 100644
index 00000000..360d5c92
--- /dev/null
+++ b/.vscode/c_cpp_properties.json
@@ -0,0 +1,21 @@
+{
+ "configurations": [
+ {
+ "name": "Win32",
+ "includePath": [
+ "${workspaceFolder}/**",
+ "C:/Program Files/Eclipse Adoptium/jdk-21.0.5.11-hotspot/include/**"
+ ],
+ "defines": [
+ "_DEBUG",
+ "UNICODE",
+ "_UNICODE"
+ ],
+ "compilerPath": "C:\\ProgramData\\mingw64\\mingw64\\bin\\gcc.exe",
+ "cStandard": "c17",
+ "cppStandard": "gnu++17",
+ "intelliSenseMode": "windows-gcc-x64"
+ }
+ ],
+ "version": 4
+}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 681aca98..70c694a4 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -6,5 +6,10 @@
},
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable",
"javascript.preferences.importModuleSpecifier": "non-relative",
- "typescript.preferences.importModuleSpecifier": "non-relative"
+ "typescript.preferences.importModuleSpecifier": "non-relative",
+ "files.associations": {
+ "electrosphere_fluidsim.h": "c",
+ "jni.h": "c",
+ "electrosphere_server_fluid_simulator_fluidacceleratedsimulator.h": "c"
+ }
}
\ No newline at end of file
diff --git a/buildNumber.properties b/buildNumber.properties
index 51c3d3a2..0821db72 100644
--- a/buildNumber.properties
+++ b/buildNumber.properties
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
-#Fri Nov 29 20:08:47 EST 2024
-buildNumber=406
+#Sat Nov 30 14:46:42 EST 2024
+buildNumber=408
diff --git a/pom.xml b/pom.xml
index f2bf0416..5895ff3c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -513,6 +513,18 @@
+
+
+ maven-compiler-plugin
+ 3.11.0
+
+
+ -h
+ src/fluid/includes
+
+
+
+
@@ -536,6 +548,23 @@
+
+
+ build-fluid-lib
+ generate-resources
+
+ exec
+
+
+ bash
+
+ 0
+
+
+ ./src/fluid/compile.sh
+
+
+
diff --git a/src/fluid/compile.sh b/src/fluid/compile.sh
new file mode 100644
index 00000000..74ce0191
--- /dev/null
+++ b/src/fluid/compile.sh
@@ -0,0 +1,86 @@
+cd ./src/fluid
+
+echo "SAVE STEPS $SAVE_STEPS"
+
+LIB_ENDING=".so"
+BASE_INCLUDE_DIR=""
+OS_INCLUDE_DIR=""
+
+#determine os
+if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+ #linux
+ LIB_ENDING=".so"
+ BASE_INCLUDE_DIR="${JAVA_HOME}/include"
+ OS_INCLUDE_DIR="${JAVA_HOME}/include/linux"
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+ # Mac OSX
+ LIB_ENDING=".so"
+elif [[ "$OSTYPE" == "cygwin" ]]; then
+ # POSIX compatibility layer and Linux environment emulation for Windows
+ LIB_ENDING=".dll"
+elif [[ "$OSTYPE" == "msys" ]]; then
+ # Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
+ LIB_ENDING=".dll"
+ BASE_INCLUDE_DIR="${JAVA_HOME}/include"
+ OS_INCLUDE_DIR="${JAVA_HOME}/include/win32"
+elif [[ "$OSTYPE" == "win32" ]]; then
+ # I'm not sure this can happen.
+ LIB_ENDING=".dll"
+elif [[ "$OSTYPE" == "freebsd"* ]]; then
+ # ...
+ LIB_ENDING=".so"
+else
+ # Unknown.
+ LIB_ENDING=".so"
+fi
+
+# echo $PWD
+
+#clean compile dir
+rm -f ./*.o
+rm -f ./*.so
+rm -f ./*.dll
+
+
+#compile object files
+# COMPILE_FLAGS="-c -fPIC -m64 -mavx -mavx2 -march=native -Ofast -msse -msse2 -msse3 -mmmx -m3dnow"
+# INPUT_FILES="./src/densitystep.c"
+# OUTPUT_FILE="./densitystep.o"
+# gcc $COMPILE_FLAGS -I"$BASE_INCLUDE_DIR" -I"$OS_INCLUDE_DIR" $INPUT_FILES -o $OUTPUT_FILE
+
+# COMPILE_FLAGS="-c -fPIC -m64 -mavx -mavx2 -march=native -Ofast -msse -msse2 -msse3 -mmmx -m3dnow"
+# INPUT_FILES="./src/velocitystep.c"
+# OUTPUT_FILE="./velocitystep.o"
+# gcc $COMPILE_FLAGS -I"$BASE_INCLUDE_DIR" -I"$OS_INCLUDE_DIR" $INPUT_FILES -o $OUTPUT_FILE
+
+# COMPILE_FLAGS="-c -fPIC -m64 -mavx -mavx2 -march=native -Ofast -msse -msse2 -msse3 -mmmx -m3dnow"
+# INPUT_FILES="./src/chunkmask.c"
+# OUTPUT_FILE="./chunkmask.o"
+# gcc $COMPILE_FLAGS -I"$BASE_INCLUDE_DIR" -I"$OS_INCLUDE_DIR" $INPUT_FILES -o $OUTPUT_FILE
+
+COMPILE_FLAGS="-c -fPIC -m64 -mavx -mavx2 -march=native -Ofast -DSAVE_STEPS=$SAVE_STEPS"
+INPUT_FILES="./src/javainterface.c"
+OUTPUT_FILE="./javainterface.o"
+gcc $COMPILE_FLAGS -I"$BASE_INCLUDE_DIR" -I"$OS_INCLUDE_DIR" $INPUT_FILES -o $OUTPUT_FILE
+
+COMPILE_FLAGS="-c -fPIC -m64 -mavx -mavx2 -march=native -Ofast -DSAVE_STEPS=$SAVE_STEPS"
+INPUT_FILES="./src/fluidsim.c"
+OUTPUT_FILE="./fluidsim.o"
+gcc $COMPILE_FLAGS -I"$BASE_INCLUDE_DIR" -I"$OS_INCLUDE_DIR" $INPUT_FILES -o $OUTPUT_FILE
+
+
+
+#compile shared object file
+OUTPUT_FILE="libfluidsim$LIB_ENDING"
+COMPILE_FLAGS="-shared"
+INPUT_FILES="fluidsim.o javainterface.o"
+gcc $COMPILE_FLAGS $INPUT_FILES -o $OUTPUT_FILE
+
+#move to resources
+mkdir -p ../../shared-folder
+mv "./libfluidsim$LIB_ENDING" "../../shared-folder/"
+
+#clean compile dir
+rm -f ./*.o
+rm -f ./*.so
+rm -f ./*.dll
\ No newline at end of file
diff --git a/src/fluid/includes/electrosphere_FluidSim.h b/src/fluid/includes/electrosphere_FluidSim.h
deleted file mode 100644
index 84ade9d9..00000000
--- a/src/fluid/includes/electrosphere_FluidSim.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class electrosphere_FluidSim */
-
-#ifndef _Included_electrosphere_FluidSim
-#define _Included_electrosphere_FluidSim
-#ifdef __cplusplus
-extern "C" {
-#endif
-#undef electrosphere_FluidSim_DIM
-#define electrosphere_FluidSim_DIM 18L
-#undef electrosphere_FluidSim_DIFFUSION_CONSTANT
-#define electrosphere_FluidSim_DIFFUSION_CONSTANT 1.0E-5f
-#undef electrosphere_FluidSim_VISCOSITY_CONSTANT
-#define electrosphere_FluidSim_VISCOSITY_CONSTANT 1.0E-5f
-#undef electrosphere_FluidSim_LINEARSOLVERTIMES
-#define electrosphere_FluidSim_LINEARSOLVERTIMES 20L
-#undef electrosphere_FluidSim_GRAVITY
-#define electrosphere_FluidSim_GRAVITY -1000.0f
-/*
- * Class: electrosphere_FluidSim
- * Method: simulate
- * Signature: (Ljava/util/List;F)V
- */
-JNIEXPORT void JNICALL Java_electrosphere_FluidSim_simulate
- (JNIEnv *, jclass, jobject, jfloat);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/fluid/includes/electrosphere_server_fluid_simulator_FluidAcceleratedSimulator.h b/src/fluid/includes/electrosphere_server_fluid_simulator_FluidAcceleratedSimulator.h
new file mode 100644
index 00000000..0e69f63d
--- /dev/null
+++ b/src/fluid/includes/electrosphere_server_fluid_simulator_FluidAcceleratedSimulator.h
@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include
+/* Header for class electrosphere_server_fluid_simulator_FluidAcceleratedSimulator */
+
+#ifndef _Included_electrosphere_server_fluid_simulator_FluidAcceleratedSimulator
+#define _Included_electrosphere_server_fluid_simulator_FluidAcceleratedSimulator
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: electrosphere_server_fluid_simulator_FluidAcceleratedSimulator
+ * Method: simulate
+ * Signature: (Ljava/util/List;F)V
+ */
+JNIEXPORT void JNICALL Java_electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_simulate
+ (JNIEnv *, jclass, jobject, jfloat);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/fluid/src/fluidsim.c b/src/fluid/src/fluidsim.c
index 06e21628..4eea9517 100644
--- a/src/fluid/src/fluidsim.c
+++ b/src/fluid/src/fluidsim.c
@@ -1,7 +1,7 @@
#include
#include "../includes/utilities.h"
#include "../includes/chunkmask.h"
-#include "../includes/electrosphere_FluidSim.h"
+#include "../includes/electrosphere_server_fluid_simulator_FluidAcceleratedSimulator.h"
#include "../includes/mainFunctions.h"
#include "../includes/chunk.h"
#include "../includes/simulation.h"