u22
This commit is contained in:
parent
e5c68395c7
commit
35a758f56a
4
MakeSignedClient.bat
Normal file
4
MakeSignedClient.bat
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
@echo off
|
||||||
|
title MakeSignedClient
|
||||||
|
java -cp "desktopRuntime/MakeOfflineDownload.jar;desktopRuntime/CompileEPK.jar" net.lax1dude.eaglercraft.v1_8.buildtools.workspace.MakeSignedClient "javascript/SignedBundleTemplate.txt" "javascript/classes.js" "javascript/assets.epk" "javascript/lang" "javascript/SignedClientTemplate.txt" "javascript/UpdateDownloadSources.txt" "javascript/EaglercraftX_1.8_Offline_Signed_Client.html"
|
||||||
|
pause
|
2
MakeSignedClient.sh
Normal file
2
MakeSignedClient.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
java -cp "desktopRuntime/MakeOfflineDownload.jar:desktopRuntime/CompileEPK.jar" net.lax1dude.eaglercraft.v1_8.buildtools.workspace.MakeSignedClient "javascript/SignedBundleTemplate.txt" "javascript/classes.js" "javascript/assets.epk" "javascript/lang" "javascript/SignedClientTemplate.txt" "javascript/UpdateDownloadSources.txt" "javascript/EaglercraftX_1.8_Offline_Signed_Client.html"
|
87
build.gradle
87
build.gradle
|
@ -1,21 +1,9 @@
|
||||||
|
plugins {
|
||||||
buildscript {
|
id 'java'
|
||||||
repositories {
|
id 'eclipse'
|
||||||
mavenCentral()
|
id 'org.teavm' version '0.9.2'
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath 'io.github.zebalu:teavm-gradle-plugin:1.0.0'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'java'
|
|
||||||
apply plugin: 'eclipse'
|
|
||||||
apply plugin: 'io.github.zebalu.teavm-gradle-plugin'
|
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
|
||||||
targetCompatibility = 1.8
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java {
|
||||||
|
@ -30,57 +18,22 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
/** we use 0.6.1 due to performance issues on 7.0.0 */
|
teavm(teavm.libs.jso)
|
||||||
implementation 'org.teavm:teavm-platform:0.6.1'
|
teavm(teavm.libs.jsoApis)
|
||||||
implementation('org.teavm:teavm-classlib:0.6.1') {
|
|
||||||
exclude group: 'com.google.code.gson', module: 'gson'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
teavm {
|
teavm.js {
|
||||||
|
obfuscated = true
|
||||||
compileScopes = null;
|
sourceMap = true
|
||||||
minifying = true;
|
targetFileName = "../classes.js"
|
||||||
maxTopLevelNames = 10000;
|
optimization = org.teavm.gradle.api.OptimizationLevel.AGGRESSIVE;
|
||||||
properties = null;
|
outOfProcess = false
|
||||||
debugInformationGenerated = false;
|
fastGlobalAnalysis = false
|
||||||
sourceMapsGenerated = true;
|
processMemory = 4048
|
||||||
sourceFilesCopied = false;
|
entryPointName = 'main'
|
||||||
incremental = false;
|
mainClass = 'net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass'
|
||||||
transformers = null;
|
outputDir = file("javascript")
|
||||||
|
properties = null
|
||||||
/** Where to save the result */
|
sourceMap = true
|
||||||
targetDirectory = file("javascript");
|
debugInformation = false
|
||||||
|
|
||||||
/** The directory to monitor to decide if compile is up-to-date or not */
|
|
||||||
sourceDirectory = file("src");
|
|
||||||
|
|
||||||
/** How to name the result file. */
|
|
||||||
targetFileName = "classes.js";
|
|
||||||
|
|
||||||
/** Which class holds your public static void main(Strin[] args) method */
|
|
||||||
mainClass = 'net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass';
|
|
||||||
|
|
||||||
/** This will be the name of your main method after compilation. */
|
|
||||||
entryPointName = 'main';
|
|
||||||
|
|
||||||
classesToPreserve = null;
|
|
||||||
stopOnErrors = false;
|
|
||||||
optimizationLevel = "ADVANCED"; //org.teavm.vm.TeaVMOptimizationLevel.SIMPLE;
|
|
||||||
fastGlobalAnalysis = false;
|
|
||||||
targetType = "JAVASCRIPT"; //org.teavm.tooling.TeaVMTargetType.JAVASCRIPT;
|
|
||||||
cacheDirectory = null;
|
|
||||||
wasmVersion = "V_0x1"; //org.teavm.backend.wasm.render.WasmBinaryVersion.V_0x1;
|
|
||||||
minHeapSize = 4;
|
|
||||||
maxHeapSize = 128;
|
|
||||||
outOfProcess = false;
|
|
||||||
processMemory = 512;
|
|
||||||
longjmpSupported = true;
|
|
||||||
heapDump = false;
|
|
||||||
|
|
||||||
/** Add name of configurations here where to look for jarfiles. */
|
|
||||||
includeJarsFrom = [];
|
|
||||||
|
|
||||||
/** By default teavmc taskd epends on javaCompile task, unless this varaibale is true. */
|
|
||||||
skipJavaCompile = false;
|
|
||||||
}
|
}
|
||||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
53
gradlew
vendored
53
gradlew
vendored
|
@ -1,21 +1,5 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
#
|
|
||||||
# Copyright 2015 the original author or authors.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
##
|
||||||
## Gradle start up script for UN*X
|
## Gradle start up script for UN*X
|
||||||
|
@ -44,7 +28,7 @@ APP_NAME="Gradle"
|
||||||
APP_BASE_NAME=`basename "$0"`
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD="maximum"
|
||||||
|
@ -125,8 +109,8 @@ if $darwin; then
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
if $cygwin ; then
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
@ -154,19 +138,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||||
else
|
else
|
||||||
eval `echo args$i`="\"$arg\""
|
eval `echo args$i`="\"$arg\""
|
||||||
fi
|
fi
|
||||||
i=`expr $i + 1`
|
i=$((i+1))
|
||||||
done
|
done
|
||||||
case $i in
|
case $i in
|
||||||
0) set -- ;;
|
(0) set -- ;;
|
||||||
1) set -- "$args0" ;;
|
(1) set -- "$args0" ;;
|
||||||
2) set -- "$args0" "$args1" ;;
|
(2) set -- "$args0" "$args1" ;;
|
||||||
3) set -- "$args0" "$args1" "$args2" ;;
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -175,9 +159,14 @@ save () {
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
echo " "
|
echo " "
|
||||||
}
|
}
|
||||||
APP_ARGS=`save "$@"`
|
APP_ARGS=$(save "$@")
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
eval set -- $DEFAULT_JVM_OPTS --illegal-access=permit $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
|
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||||
|
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
fi
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
|
|
18
gradlew.bat
vendored
18
gradlew.bat
vendored
|
@ -1,19 +1,3 @@
|
||||||
@rem
|
|
||||||
@rem Copyright 2015 the original author or authors.
|
|
||||||
@rem
|
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
@rem you may not use this file except in compliance with the License.
|
|
||||||
@rem You may obtain a copy of the License at
|
|
||||||
@rem
|
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
@rem
|
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
@rem See the License for the specific language governing permissions and
|
|
||||||
@rem limitations under the License.
|
|
||||||
@rem
|
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%" == "" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
|
@ -30,7 +14,7 @@ set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package net.PeytonPlayz585.shadow.opengl;
|
||||||
|
|
||||||
|
public class GL11 {
|
||||||
|
public static int glGetTexLevelParameteri(int target, int level, int pname) {
|
||||||
|
return org.lwjgl.opengles.GLES31.glGetTexLevelParameteri(target, level, pname);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,16 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8.internal;
|
package net.lax1dude.eaglercraft.v1_8.internal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class OpenGLObjects {
|
class OpenGLObjects {
|
||||||
|
|
|
@ -20,17 +20,23 @@ import javax.swing.JFileChooser;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PlatformApplication {
|
public class PlatformApplication {
|
||||||
|
@ -45,7 +51,7 @@ public class PlatformApplication {
|
||||||
try {
|
try {
|
||||||
Desktop.getDesktop().browse(new URI(url));
|
Desktop.getDesktop().browse(new URI(url));
|
||||||
} catch (Throwable var5) {
|
} catch (Throwable var5) {
|
||||||
var5.printStackTrace();
|
EagRuntime.debugPrintStackTrace(var5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,10 +65,14 @@ public class PlatformApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setLocalStorage(String name, byte[] data) {
|
public static void setLocalStorage(String name, byte[] data) {
|
||||||
try(FileOutputStream f = new FileOutputStream(new File("_eagstorage."+name+".dat"))) {
|
if(data == null) {
|
||||||
f.write(data);
|
(new File("_eagstorage."+name+".dat")).delete();
|
||||||
} catch (IOException e) {
|
}else {
|
||||||
e.printStackTrace();
|
try(FileOutputStream f = new FileOutputStream(new File("_eagstorage."+name+".dat"))) {
|
||||||
|
f.write(data);
|
||||||
|
} catch (IOException e) {
|
||||||
|
EagRuntime.debugPrintStackTrace(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,8 +199,58 @@ public class PlatformApplication {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void clearFileChooserResult() {
|
||||||
|
fileChooserHasResult = false;
|
||||||
|
fileChooserResultObject = null;
|
||||||
|
}
|
||||||
|
|
||||||
public static void openCreditsPopup(String text) {
|
public static void openCreditsPopup(String text) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final File downloadsDirectory = new File("downloads");
|
||||||
|
private static final Logger downloadsLogger = LogManager.getLogger("DownloadsFolder");
|
||||||
|
|
||||||
|
public static void downloadFileWithName(String fileName, byte[] fileContents) {
|
||||||
|
if(!downloadsDirectory.isDirectory() && !downloadsDirectory.mkdirs()) {
|
||||||
|
throw new RuntimeException("Could not create directory: " + downloadsDirectory.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
File f = new File(downloadsDirectory, fileName);
|
||||||
|
if(f.exists()) {
|
||||||
|
String name = fileName;
|
||||||
|
String ext = "";
|
||||||
|
int i = fileName.lastIndexOf('.');
|
||||||
|
if(i != -1) {
|
||||||
|
name = fileName.substring(0, i);
|
||||||
|
ext = fileName.substring(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
do {
|
||||||
|
f = new File(downloadsDirectory, name + " (" + (++i) + ")" + ext);
|
||||||
|
}while(f.exists());
|
||||||
|
}
|
||||||
|
|
||||||
|
try(FileOutputStream fos = new FileOutputStream(f)) {
|
||||||
|
fos.write(fileContents);
|
||||||
|
}catch(IOException ex) {
|
||||||
|
throw new RuntimeException("Could not save file: " + f.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadsLogger.info("Saved {} byte file to: {}", fileContents.length, f.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addLogMessage(String logMessage, boolean isError) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isShowingDebugConsole() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void showDebugConsole() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,16 +14,18 @@ import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.ImageData;
|
import net.lax1dude.eaglercraft.v1_8.opengl.ImageData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PlatformAssets {
|
public class PlatformAssets {
|
||||||
|
|
|
@ -14,16 +14,18 @@ import paulscode.sound.codecs.CodecJOrbis;
|
||||||
import paulscode.sound.codecs.CodecWav;
|
import paulscode.sound.codecs.CodecWav;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PlatformAudio {
|
public class PlatformAudio {
|
||||||
|
|
|
@ -4,16 +4,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer;
|
import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PlatformBufferFunctions {
|
public class PlatformBufferFunctions {
|
||||||
|
|
|
@ -0,0 +1,228 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.internal;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.LWJGLEntryPoint;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.vfs2.EaglerFileSystemException;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFSIterator2.BreakLoop;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.DesktopIntegratedServer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class PlatformFilesystem {
|
||||||
|
|
||||||
|
public static final Logger logger = LogManager.getLogger("PlatformFilesystem");
|
||||||
|
|
||||||
|
public static final File filesystemRoot = (new File("filesystem/sp")).getAbsoluteFile();
|
||||||
|
|
||||||
|
public static void initialize() {
|
||||||
|
assertThread();
|
||||||
|
if(!filesystemRoot.isDirectory() && !filesystemRoot.mkdirs()) {
|
||||||
|
throw new EaglerFileSystemException("Could not create directory for virtual filesystem: " + filesystemRoot.getAbsolutePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void assertThread() {
|
||||||
|
if(Thread.currentThread() != DesktopIntegratedServer.serverThread) {
|
||||||
|
throw new UnsupportedOperationException("[DEBUG CHECK] VFS2 is currently only initialized for server contexts!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean eaglerDelete(String pathName) {
|
||||||
|
assertThread();
|
||||||
|
File f = getJREFile(pathName);
|
||||||
|
if(!f.exists()) {
|
||||||
|
logger.warn("Tried to delete file that doesn't exist: \"{}\"", pathName);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(f.delete()) {
|
||||||
|
deleteParentIfEmpty(f);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ByteBuffer eaglerRead(String pathName) {
|
||||||
|
assertThread();
|
||||||
|
File f = getJREFile(pathName);
|
||||||
|
if(f.isFile()) {
|
||||||
|
long fileSize = f.length();
|
||||||
|
if(fileSize > 2147483647L) throw new EaglerFileSystemException("Too large: " + fileSize + " @ " + f.getAbsolutePath());
|
||||||
|
ByteBuffer buf = PlatformRuntime.allocateByteBuffer((int)fileSize);
|
||||||
|
try(FileInputStream is = new FileInputStream(f)) {
|
||||||
|
byte[] copyBuffer = new byte[4096];
|
||||||
|
int i;
|
||||||
|
while((i = is.read(copyBuffer, 0, copyBuffer.length)) != -1) {
|
||||||
|
buf.put(copyBuffer, 0, i);
|
||||||
|
}
|
||||||
|
if(buf.remaining() > 0) {
|
||||||
|
throw new EaglerFileSystemException("ERROR: " + buf.remaining() + " bytes are remaining after reading: " + f.getAbsolutePath());
|
||||||
|
}
|
||||||
|
buf.flip();
|
||||||
|
ByteBuffer tmp = buf;
|
||||||
|
buf = null;
|
||||||
|
return tmp;
|
||||||
|
}catch (IOException e) {
|
||||||
|
throw new EaglerFileSystemException("Failed to read: " + f.getAbsolutePath(), e);
|
||||||
|
}catch(ArrayIndexOutOfBoundsException ex) {
|
||||||
|
throw new EaglerFileSystemException("ERROR: Expected " + fileSize + " bytes, buffer overflow reading: " + f.getAbsolutePath(), ex);
|
||||||
|
}finally {
|
||||||
|
if(buf != null) {
|
||||||
|
PlatformRuntime.freeByteBuffer(buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
throw new EaglerFileSystemException("Not a file: " + f.getAbsolutePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void eaglerWrite(String pathName, ByteBuffer data) {
|
||||||
|
assertThread();
|
||||||
|
File f = getJREFile(pathName);
|
||||||
|
File p = f.getParentFile();
|
||||||
|
if(!p.isDirectory()) {
|
||||||
|
if(!p.mkdirs()) {
|
||||||
|
throw new EaglerFileSystemException("Could not create parent directory: " + p.getAbsolutePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try(FileOutputStream fos = new FileOutputStream(f)) {
|
||||||
|
byte[] copyBuffer = new byte[4096];
|
||||||
|
int i;
|
||||||
|
while((i = data.remaining()) > 0) {
|
||||||
|
if(i > copyBuffer.length) {
|
||||||
|
i = copyBuffer.length;
|
||||||
|
}
|
||||||
|
data.get(copyBuffer, 0, i);
|
||||||
|
fos.write(copyBuffer, 0, i);
|
||||||
|
}
|
||||||
|
}catch (IOException e) {
|
||||||
|
throw new EaglerFileSystemException("Failed to write: " + f.getAbsolutePath(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean eaglerExists(String pathName) {
|
||||||
|
assertThread();
|
||||||
|
return getJREFile(pathName).isFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean eaglerMove(String pathNameOld, String pathNameNew) {
|
||||||
|
assertThread();
|
||||||
|
File f1 = getJREFile(pathNameOld);
|
||||||
|
File f2 = getJREFile(pathNameNew);
|
||||||
|
if(f2.exists()) {
|
||||||
|
logger.warn("Tried to rename file \"{}\" to \"{}\" which already exists! File will be replaced");
|
||||||
|
if(!f2.delete()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(f1.renameTo(f2)) {
|
||||||
|
deleteParentIfEmpty(f1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int eaglerCopy(String pathNameOld, String pathNameNew) {
|
||||||
|
assertThread();
|
||||||
|
File f1 = getJREFile(pathNameOld);
|
||||||
|
File f2 = getJREFile(pathNameNew);
|
||||||
|
if(!f1.isFile()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if(f2.isDirectory()) {
|
||||||
|
throw new EaglerFileSystemException("Destination file is a directory: " + f2.getAbsolutePath());
|
||||||
|
}
|
||||||
|
File p = f2.getParentFile();
|
||||||
|
if(!p.isDirectory()) {
|
||||||
|
if(!p.mkdirs()) {
|
||||||
|
throw new EaglerFileSystemException("Could not create parent directory: " + p.getAbsolutePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int sz = 0;
|
||||||
|
try(FileInputStream is = new FileInputStream(f1)) {
|
||||||
|
try(FileOutputStream os = new FileOutputStream(f2)) {
|
||||||
|
byte[] copyBuffer = new byte[4096];
|
||||||
|
int i;
|
||||||
|
while((i = is.read(copyBuffer, 0, copyBuffer.length)) != -1) {
|
||||||
|
os.write(copyBuffer, 0, i);
|
||||||
|
sz += i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (IOException e) {
|
||||||
|
throw new EaglerFileSystemException("Failed to copy \"" + f1.getAbsolutePath() + "\" to file \"" + f2.getAbsolutePath() + "\"", e);
|
||||||
|
}
|
||||||
|
return sz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int eaglerSize(String pathName) {
|
||||||
|
assertThread();
|
||||||
|
File f = getJREFile(pathName);
|
||||||
|
if(f.isFile()) {
|
||||||
|
long fileSize = f.length();
|
||||||
|
if(fileSize > 2147483647L) throw new EaglerFileSystemException("Too large: " + fileSize + " @ " + f.getAbsolutePath());
|
||||||
|
return (int)fileSize;
|
||||||
|
}else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void eaglerIterate(String pathName, VFSFilenameIterator itr, boolean recursive) {
|
||||||
|
assertThread();
|
||||||
|
try {
|
||||||
|
iterateFile(pathName, getJREFile(pathName), itr, recursive);
|
||||||
|
}catch(BreakLoop ex) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void iterateFile(String pathName, File f, VFSFilenameIterator itr, boolean recursive) {
|
||||||
|
if(!f.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!f.isDirectory()) {
|
||||||
|
itr.next(pathName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
File[] fa = f.listFiles();
|
||||||
|
for(int i = 0; i < fa.length; ++i) {
|
||||||
|
File ff = fa[i];
|
||||||
|
String fn = pathName + "/" + ff.getName();
|
||||||
|
if(ff.isDirectory()) {
|
||||||
|
if(recursive) {
|
||||||
|
iterateFile(fn, ff, itr, true);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
itr.next(fn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static File getJREFile(String path) {
|
||||||
|
return new File(filesystemRoot, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void deleteParentIfEmpty(File f) {
|
||||||
|
String[] s;
|
||||||
|
while((f = f.getParentFile()) != null && (s = f.list()) != null && s.length == 0) {
|
||||||
|
f.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,25 +8,29 @@ import java.util.List;
|
||||||
import org.lwjgl.PointerBuffer;
|
import org.lwjgl.PointerBuffer;
|
||||||
import org.lwjgl.system.MemoryStack;
|
import org.lwjgl.system.MemoryStack;
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.EagUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PlatformInput {
|
public class PlatformInput {
|
||||||
|
|
||||||
private static long win = 0l;
|
private static long win = 0l;
|
||||||
|
|
||||||
|
private static long cursorDefault = 0l;
|
||||||
|
private static long cursorHand = 0l;
|
||||||
|
private static long cursorText = 0l;
|
||||||
|
|
||||||
private static boolean windowFocused = true;
|
private static boolean windowFocused = true;
|
||||||
private static boolean windowResized = true;
|
private static boolean windowResized = true;
|
||||||
|
|
||||||
|
@ -179,7 +183,11 @@ public class PlatformInput {
|
||||||
mouseEventList.remove(0);
|
mouseEventList.remove(0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cursorDefault = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
|
||||||
|
cursorHand = glfwCreateStandardCursor(GLFW_HAND_CURSOR);
|
||||||
|
cursorText = glfwCreateStandardCursor(GLFW_IBEAM_CURSOR);
|
||||||
|
glfwSetCursor(glfwWindow, cursorDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getWindowWidth() {
|
public static int getWindowWidth() {
|
||||||
|
@ -380,5 +388,19 @@ public class PlatformInput {
|
||||||
public static boolean isFullscreen() {
|
public static boolean isFullscreen() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void showCursor(EnumCursorType cursor) {
|
||||||
|
switch(cursor) {
|
||||||
|
case DEFAULT:
|
||||||
|
default:
|
||||||
|
glfwSetCursor(win, cursorDefault);
|
||||||
|
break;
|
||||||
|
case HAND:
|
||||||
|
glfwSetCursor(win, cursorHand);
|
||||||
|
break;
|
||||||
|
case TEXT:
|
||||||
|
glfwSetCursor(win, cursorText);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package net.lax1dude.eaglercraft.v1_8.internal;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -11,16 +12,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PlatformNetworking {
|
public class PlatformNetworking {
|
||||||
|
@ -86,7 +89,19 @@ public class PlatformNetworking {
|
||||||
return playPackets.size() > 0 ? playPackets.remove(0) : null;
|
return playPackets.size() > 0 ? playPackets.remove(0) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<byte[]> readAllPacket() {
|
||||||
|
synchronized(playPackets) {
|
||||||
|
if(!playPackets.isEmpty()) {
|
||||||
|
List<byte[]> ret = new ArrayList<>(playPackets);
|
||||||
|
playPackets.clear();
|
||||||
|
return ret;
|
||||||
|
}else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static int countAvailableReadData() {
|
public static int countAvailableReadData() {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
synchronized(playPackets) {
|
synchronized(playPackets) {
|
||||||
|
|
|
@ -8,16 +8,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer;
|
||||||
import static org.lwjgl.opengles.GLES30.*;
|
import static org.lwjgl.opengles.GLES30.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PlatformOpenGL {
|
public class PlatformOpenGL {
|
||||||
|
|
|
@ -13,6 +13,7 @@ import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Random;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.zip.DeflaterOutputStream;
|
import java.util.zip.DeflaterOutputStream;
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
|
@ -43,16 +44,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PlatformRuntime {
|
public class PlatformRuntime {
|
||||||
|
@ -430,6 +433,10 @@ public class PlatformRuntime {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isOfflineDownloadURL() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static IClientConfigAdapter getClientConfigAdapter() {
|
public static IClientConfigAdapter getClientConfigAdapter() {
|
||||||
return DesktopClientConfigAdapter.instance;
|
return DesktopClientConfigAdapter.instance;
|
||||||
}
|
}
|
||||||
|
@ -446,4 +453,19 @@ public class PlatformRuntime {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Random seedProvider = new Random();
|
||||||
|
|
||||||
|
public static long randomSeed() {
|
||||||
|
synchronized(seedProvider) {
|
||||||
|
return seedProvider.nextLong();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getWindowXY(int[] x, int[] y) {
|
||||||
|
glfwGetWindowPos(windowHandle, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String currentThreadName() {
|
||||||
|
return Thread.currentThread().getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.internal;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.update.UpdateCertificate;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.update.UpdateProgressStruct;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class PlatformUpdateSvc {
|
||||||
|
|
||||||
|
private static final UpdateProgressStruct dummyStruct = new UpdateProgressStruct();
|
||||||
|
|
||||||
|
public static boolean supported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initialize() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] getClientSignatureData() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] getClientBundleData() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void startClientUpdateFrom(UpdateCertificate clientUpdate) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UpdateProgressStruct getUpdatingStatus() {
|
||||||
|
return dummyStruct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void quine(String filename, byte[] cert, byte[] data, String date) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void quine(UpdateCertificate clientUpdate, byte[] data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,145 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.internal;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANPeerEvent;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayQuery;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocket;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayWorldsQuery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class PlatformWebRTC {
|
||||||
|
|
||||||
|
public static boolean supported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RelayServerSocket openRelayConnection(String addr, int timeout) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RelayQuery openRelayQuery(String addr) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RelayWorldsQuery openRelayWorldsQuery(String addr) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void startRTCLANClient() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int clientLANReadyState() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clientLANCloseConnection() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clientLANSendPacket(byte[] pkt) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] clientLANReadPacket() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<byte[]> clientLANReadAllPacket() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clientLANSetICEServersAndConnect(String[] servers) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clearLANClientState() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String clientLANAwaitICECandidate() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String clientLANAwaitDescription() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean clientLANAwaitChannel() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean clientLANClosed() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clientLANSetICECandidate(String candidate) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clientLANSetDescription(String description) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void startRTCLANServer() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void serverLANInitializeServer(String[] servers) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void serverLANCloseServer() {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LANPeerEvent serverLANGetEvent(String clientId) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<LANPeerEvent> serverLANGetAllEvent(String clientId) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void serverLANWritePacket(String peer, byte[] data) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void serverLANCreatePeer(String peer) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void serverLANPeerICECandidates(String peer, String iceCandidates) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void serverLANPeerDescription(String peer, String description) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void serverLANDisconnectPeer(String peer) {
|
||||||
|
throw new UnsupportedOperationException("LAN not supported on desktop runtime!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int countPeers() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,16 +13,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class WebSocketPlayClient extends WebSocketClient {
|
class WebSocketPlayClient extends WebSocketClient {
|
||||||
|
|
|
@ -16,16 +16,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class WebSocketServerQuery extends WebSocketClient implements IServerQuery {
|
class WebSocketServerQuery extends WebSocketClient implements IServerQuery {
|
||||||
|
|
|
@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.internal.buffer;
|
||||||
import org.lwjgl.system.jemalloc.JEmalloc;
|
import org.lwjgl.system.jemalloc.JEmalloc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglerLWJGLAllocator {
|
public class EaglerLWJGLAllocator {
|
||||||
|
|
|
@ -4,16 +4,18 @@ import org.lwjgl.system.MemoryUtil;
|
||||||
import org.lwjgl.system.jemalloc.JEmalloc;
|
import org.lwjgl.system.jemalloc.JEmalloc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglerLWJGLByteBuffer implements ByteBuffer {
|
public class EaglerLWJGLByteBuffer implements ByteBuffer {
|
||||||
|
|
|
@ -4,16 +4,18 @@ import org.lwjgl.system.MemoryUtil;
|
||||||
import org.lwjgl.system.jemalloc.JEmalloc;
|
import org.lwjgl.system.jemalloc.JEmalloc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglerLWJGLFloatBuffer implements FloatBuffer {
|
public class EaglerLWJGLFloatBuffer implements FloatBuffer {
|
||||||
|
|
|
@ -4,16 +4,18 @@ import org.lwjgl.system.MemoryUtil;
|
||||||
import org.lwjgl.system.jemalloc.JEmalloc;
|
import org.lwjgl.system.jemalloc.JEmalloc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglerLWJGLIntBuffer implements IntBuffer {
|
public class EaglerLWJGLIntBuffer implements IntBuffer {
|
||||||
|
|
|
@ -4,16 +4,18 @@ import org.lwjgl.system.MemoryUtil;
|
||||||
import org.lwjgl.system.jemalloc.JEmalloc;
|
import org.lwjgl.system.jemalloc.JEmalloc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglerLWJGLShortBuffer implements ShortBuffer {
|
public class EaglerLWJGLShortBuffer implements ShortBuffer {
|
||||||
|
|
|
@ -3,19 +3,25 @@ package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
|
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DesktopClientConfigAdapter implements IClientConfigAdapter {
|
public class DesktopClientConfigAdapter implements IClientConfigAdapter {
|
||||||
|
@ -39,4 +45,69 @@ public class DesktopClientConfigAdapter implements IClientConfigAdapter {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getWorldsDB() {
|
||||||
|
return "desktop";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject dumpConfig() {
|
||||||
|
return new JSONObject("{\"container\":null,\"worldsDB\":\"desktop\"}");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RelayEntry> getRelays() {
|
||||||
|
throw new UnsupportedOperationException("TODO");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkShaderGLErrors() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isDemo() {
|
||||||
|
return EaglercraftVersion.forceDemoMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean allowUpdateSvc() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean allowUpdateDL() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEnableDownloadOfflineButton() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDownloadOfflineButtonLink() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean useSpecialCursors() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isLogInvalidCerts() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCheckRelaysForUpdates() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEnableSignatureBadge() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,21 +11,26 @@ import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.ShaderSource;
|
||||||
import net.minecraft.client.main.Main;
|
import net.minecraft.client.main.Main;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class LWJGLEntryPoint {
|
public class LWJGLEntryPoint {
|
||||||
|
|
||||||
|
public static Thread mainThread = null;
|
||||||
|
|
||||||
public static void main_(String[] args) {
|
public static void main_(String[] args) {
|
||||||
|
mainThread = Thread.currentThread();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
|
|
|
@ -22,16 +22,18 @@ import java.awt.Dimension;
|
||||||
import javax.swing.JSeparator;
|
import javax.swing.JSeparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class LaunchRenderDocDialog extends JDialog {
|
public class LaunchRenderDocDialog extends JDialog {
|
||||||
|
|
|
@ -9,19 +9,20 @@ import java.io.InputStream;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
*
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class FolderResourcePack extends AbstractResourcePack {
|
public class FolderResourcePack extends AbstractResourcePack {
|
||||||
public FolderResourcePack(String resourcePackFileIn, String prefix) {
|
public FolderResourcePack(String resourcePackFileIn, String prefix) {
|
||||||
super(resourcePackFileIn);
|
super(resourcePackFileIn);
|
||||||
|
|
|
@ -6,19 +6,20 @@ import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
*
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class SYS {
|
public class SYS {
|
||||||
|
|
||||||
public static final Object VFS = null;
|
public static final Object VFS = null;
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.sp.internal;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.CrashScreenPopup;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.DesktopIntegratedServer;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.MemoryConnection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2023-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ClientPlatformSingleplayer {
|
||||||
|
|
||||||
|
private static CrashScreenPopup crashOverlay = null;
|
||||||
|
|
||||||
|
public static void startIntegratedServer() {
|
||||||
|
DesktopIntegratedServer.startIntegratedServer();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendPacket(IPCPacketData packet) {
|
||||||
|
synchronized(MemoryConnection.clientToServerQueue) {
|
||||||
|
MemoryConnection.clientToServerQueue.add(packet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IPCPacketData recievePacket() {
|
||||||
|
synchronized(MemoryConnection.serverToClientQueue) {
|
||||||
|
if(MemoryConnection.serverToClientQueue.size() > 0) {
|
||||||
|
return MemoryConnection.serverToClientQueue.remove(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<IPCPacketData> recieveAllPacket() {
|
||||||
|
synchronized(MemoryConnection.serverToClientQueue) {
|
||||||
|
if(MemoryConnection.serverToClientQueue.size() == 0) {
|
||||||
|
return null;
|
||||||
|
}else {
|
||||||
|
List<IPCPacketData> ret = new ArrayList(MemoryConnection.serverToClientQueue);
|
||||||
|
MemoryConnection.serverToClientQueue.clear();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean canKillWorker() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void killWorker() {
|
||||||
|
throw new IllegalStateException("Cannot kill worker thread on desktop! (memleak)");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isRunningSingleThreadMode() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void showCrashReportOverlay(String report, int x, int y, int w, int h) {
|
||||||
|
if(crashOverlay == null) {
|
||||||
|
crashOverlay = new CrashScreenPopup();
|
||||||
|
}
|
||||||
|
int[] wx = new int[1];
|
||||||
|
int[] wy = new int[1];
|
||||||
|
PlatformRuntime.getWindowXY(wx, wy);
|
||||||
|
crashOverlay.setBounds(wx[0] + x, wy[0] + y, w, h);
|
||||||
|
crashOverlay.setCrashText(report);
|
||||||
|
crashOverlay.setVisible(true);
|
||||||
|
crashOverlay.requestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void hideCrashReportOverlay() {
|
||||||
|
crashOverlay.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.sp.server.internal;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.PlatformFilesystem;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.DesktopClientConfigAdapter;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.EaglerServerBootstrap;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.MemoryConnection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2023-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ServerPlatformSingleplayer {
|
||||||
|
|
||||||
|
public static void initializeContext() {
|
||||||
|
PlatformFilesystem.initialize();
|
||||||
|
EaglerServerBootstrap.staticInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendPacket(IPCPacketData packet) {
|
||||||
|
synchronized(MemoryConnection.serverToClientQueue) {
|
||||||
|
MemoryConnection.serverToClientQueue.add(packet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IPCPacketData recievePacket() {
|
||||||
|
synchronized(MemoryConnection.clientToServerQueue) {
|
||||||
|
if(MemoryConnection.clientToServerQueue.size() > 0) {
|
||||||
|
return MemoryConnection.clientToServerQueue.remove(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<IPCPacketData> recieveAllPacket() {
|
||||||
|
synchronized(MemoryConnection.clientToServerQueue) {
|
||||||
|
if(MemoryConnection.clientToServerQueue.size() == 0) {
|
||||||
|
return null;
|
||||||
|
}else {
|
||||||
|
List<IPCPacketData> ret = new ArrayList(MemoryConnection.clientToServerQueue);
|
||||||
|
MemoryConnection.clientToServerQueue.clear();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IClientConfigAdapter getClientConfigAdapter() {
|
||||||
|
return DesktopClientConfigAdapter.instance;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl;
|
||||||
|
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JTextArea;
|
||||||
|
import javax.swing.ScrollPaneConstants;
|
||||||
|
import java.awt.Font;
|
||||||
|
import java.awt.Toolkit;
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Window.Type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CrashScreenPopup extends JFrame {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTextArea txtrTest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the frame.
|
||||||
|
*/
|
||||||
|
public CrashScreenPopup() {
|
||||||
|
setType(Type.UTILITY);
|
||||||
|
setResizable(false);
|
||||||
|
setIconImage(Toolkit.getDefaultToolkit().getImage("icon32.png"));
|
||||||
|
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||||
|
setAlwaysOnTop(true);
|
||||||
|
setTitle("EaglercraftX Integrated Server");
|
||||||
|
setBounds(100, 100, 900, 600);
|
||||||
|
setLocationByPlatform(true);
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setBorder(null);
|
||||||
|
|
||||||
|
setContentPane(contentPane);
|
||||||
|
contentPane.setLayout(new BorderLayout(0, 0));
|
||||||
|
|
||||||
|
JScrollPane scrollPane = new JScrollPane();
|
||||||
|
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
|
||||||
|
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
contentPane.add(scrollPane, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
txtrTest = new JTextArea();
|
||||||
|
txtrTest.setBackground(new Color(0, 0, 0));
|
||||||
|
txtrTest.setForeground(new Color(255, 255, 255));
|
||||||
|
txtrTest.setText("test");
|
||||||
|
txtrTest.setFont(new Font("Monospaced", Font.BOLD, 18));
|
||||||
|
txtrTest.setLineWrap(true);
|
||||||
|
txtrTest.setWrapStyleWord(true);
|
||||||
|
txtrTest.setEditable(false);
|
||||||
|
scrollPane.setViewportView(txtrTest);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCrashText(String txt) {
|
||||||
|
txtrTest.setText(txt);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2023-2024 lax1dude. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DesktopIntegratedServer implements Runnable {
|
||||||
|
|
||||||
|
public static Thread serverThread = null;
|
||||||
|
|
||||||
|
public static void startIntegratedServer() {
|
||||||
|
if(serverThread == null) {
|
||||||
|
serverThread = new Thread(new DesktopIntegratedServer(), "IntegratedServer");
|
||||||
|
serverThread.setDaemon(true);
|
||||||
|
serverThread.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
ServerPlatformSingleplayer.initializeContext();
|
||||||
|
EaglerIntegratedServerWorker.serverMain();
|
||||||
|
}finally {
|
||||||
|
serverThread = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2023-2024 lax1dude. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class MemoryConnection {
|
||||||
|
|
||||||
|
public static final List<IPCPacketData> clientToServerQueue = new LinkedList();
|
||||||
|
public static final List<IPCPacketData> serverToClientQueue = new LinkedList();
|
||||||
|
|
||||||
|
}
|
|
@ -1,101 +0,0 @@
|
||||||
package de.Hero.clickgui;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import de.Hero.clickgui.component.Component;
|
|
||||||
import de.Hero.clickgui.component.Frame;
|
|
||||||
import net.FatalCodes.shadow.module.Category;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
//Your Imports
|
|
||||||
|
|
||||||
public class ClickGui extends GuiScreen {
|
|
||||||
|
|
||||||
public static ArrayList<Frame> frames;
|
|
||||||
public static int color = -1;
|
|
||||||
|
|
||||||
public ClickGui() {
|
|
||||||
this.frames = new ArrayList<Frame>();
|
|
||||||
int frameX = 5;
|
|
||||||
for(Category category : Category.values()) {
|
|
||||||
Frame frame = new Frame(category);
|
|
||||||
frame.setX(frameX);
|
|
||||||
frames.add(frame);
|
|
||||||
frameX += frame.getWidth() + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
|
||||||
this.drawDefaultBackground();
|
|
||||||
for(Frame frame : frames) {
|
|
||||||
frame.renderFrame(this.fontRendererObj);
|
|
||||||
frame.updatePosition(mouseX, mouseY);
|
|
||||||
for(Component comp : frame.getComponents()) {
|
|
||||||
comp.updateComponent(mouseX, mouseY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void mouseClicked(final int mouseX, final int mouseY, final int mouseButton) {
|
|
||||||
for(Frame frame : frames) {
|
|
||||||
if(frame.isWithinHeader(mouseX, mouseY) && mouseButton == 0) {
|
|
||||||
frame.setDrag(true);
|
|
||||||
frame.dragX = mouseX - frame.getX();
|
|
||||||
frame.dragY = mouseY - frame.getY();
|
|
||||||
}
|
|
||||||
if(frame.isWithinHeader(mouseX, mouseY) && mouseButton == 1) {
|
|
||||||
frame.setOpen(!frame.isOpen());
|
|
||||||
}
|
|
||||||
if(frame.isOpen()) {
|
|
||||||
if(!frame.getComponents().isEmpty()) {
|
|
||||||
for(Component component : frame.getComponents()) {
|
|
||||||
component.mouseClicked(mouseX, mouseY, mouseButton);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void keyTyped(char typedChar, int keyCode) {
|
|
||||||
for(Frame frame : frames) {
|
|
||||||
if(frame.isOpen() && keyCode != 1) {
|
|
||||||
if(!frame.getComponents().isEmpty()) {
|
|
||||||
for(Component component : frame.getComponents()) {
|
|
||||||
component.keyTyped(typedChar, keyCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (keyCode == 1) {
|
|
||||||
this.mc.displayGuiScreen(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void mouseReleased(int mouseX, int mouseY, int state) {
|
|
||||||
for(Frame frame : frames) {
|
|
||||||
frame.setDrag(false);
|
|
||||||
}
|
|
||||||
for(Frame frame : frames) {
|
|
||||||
if(frame.isOpen()) {
|
|
||||||
if(!frame.getComponents().isEmpty()) {
|
|
||||||
for(Component component : frame.getComponents()) {
|
|
||||||
component.mouseReleased(mouseX, mouseY, state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean doesGuiPauseGame() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
package de.Hero.clickgui.component;
|
|
||||||
|
|
||||||
public class Component {
|
|
||||||
|
|
||||||
public void renderComponent() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateComponent(int mouseX, int mouseY) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int button) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void mouseReleased(int mouseX, int mouseY, int mouseButton) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getParentHeight() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void keyTyped(char typedChar, int key) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOff(int newOff) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getHeight() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,127 +0,0 @@
|
||||||
package de.Hero.clickgui.component;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import de.Hero.clickgui.component.components.Button;
|
|
||||||
import net.FatalCodes.shadow.Shadow;
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
import net.FatalCodes.shadow.module.Category;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
//Your Imports
|
|
||||||
|
|
||||||
public class Frame {
|
|
||||||
|
|
||||||
public ArrayList<Component> components;
|
|
||||||
public Category category;
|
|
||||||
private boolean open;
|
|
||||||
private int width;
|
|
||||||
private int y;
|
|
||||||
private int x;
|
|
||||||
private int barHeight;
|
|
||||||
private boolean isDragging;
|
|
||||||
public int dragX;
|
|
||||||
public int dragY;
|
|
||||||
|
|
||||||
public Frame(Category cat) {
|
|
||||||
this.components = new ArrayList<Component>();
|
|
||||||
this.category = cat;
|
|
||||||
this.width = 88;
|
|
||||||
this.x = 5;
|
|
||||||
this.y = 5;
|
|
||||||
this.barHeight = 13;
|
|
||||||
this.dragX = 0;
|
|
||||||
this.open = false;
|
|
||||||
this.isDragging = false;
|
|
||||||
int tY = this.barHeight;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(Module mod : Shadow.moduleManager.modsInCategory(category)) {
|
|
||||||
Button modButton = new Button(mod, this, tY);
|
|
||||||
this.components.add(modButton);
|
|
||||||
tY += 12;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Component> getComponents() {
|
|
||||||
return components;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setX(int newX) {
|
|
||||||
this.x = newX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setY(int newY) {
|
|
||||||
this.y = newY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDrag(boolean drag) {
|
|
||||||
this.isDragging = drag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOpen() {
|
|
||||||
return open;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpen(boolean open) {
|
|
||||||
this.open = open;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderFrame(FontRenderer fontRenderer) {
|
|
||||||
Gui.drawRect(this.x, this.y, this.x + this.width, this.y + this.barHeight, 0xff7A777C);
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.scale(0.5f,0.5f, 0.5f);
|
|
||||||
fontRenderer.drawStringWithShadow(this.category.name(), (this.x + 2) * 2 + 5, (this.y + 2.5f) * 2 + 5, 0xffffffff);
|
|
||||||
fontRenderer.drawStringWithShadow(this.open ? "-" : "+", (this.x + this.width - 10) * 2 + 5, (this.y + 2.5f) * 2 + 5, 0xffffffff);
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
if(this.open) {
|
|
||||||
if(!this.components.isEmpty()) {
|
|
||||||
Gui.drawRect(this.x, this.y + this.barHeight, this.x + 1, this.y + this.barHeight + (12 * components.size()), 0xffA1A1A1);
|
|
||||||
Gui.drawRect(this.x, this.y + this.barHeight + (12 * components.size()), this.x + this.width, this.y + this.barHeight + (12 * components.size()) + 1, 0xffA1A1A1);
|
|
||||||
Gui.drawRect(this.x + this.width, this.y + this.barHeight, this.x + this.width - 1, this.y + this.barHeight + (12 * components.size()), 0xffA1A1A1);
|
|
||||||
for(Component component : components) {
|
|
||||||
component.renderComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void refresh() {
|
|
||||||
int off = this.barHeight;
|
|
||||||
for(Component comp : components) {
|
|
||||||
comp.setOff(off);
|
|
||||||
off += comp.getHeight();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getX() {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getY() {
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWidth() {
|
|
||||||
return width;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updatePosition(int mouseX, int mouseY) {
|
|
||||||
if(this.isDragging) {
|
|
||||||
this.setX(mouseX - dragX);
|
|
||||||
this.setY(mouseY - dragY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isWithinHeader(int x, int y) {
|
|
||||||
if(x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.barHeight) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,140 +0,0 @@
|
||||||
package de.Hero.clickgui.component.components;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import de.Hero.clickgui.component.Component;
|
|
||||||
import de.Hero.clickgui.component.Frame;
|
|
||||||
import de.Hero.clickgui.component.components.sub.Checkbox;
|
|
||||||
import de.Hero.clickgui.component.components.sub.Keybind;
|
|
||||||
import de.Hero.clickgui.component.components.sub.ModeButton;
|
|
||||||
import de.Hero.clickgui.component.components.sub.Slider;
|
|
||||||
import de.Hero.clickgui.component.components.sub.VisibleButton;
|
|
||||||
import de.Hero.settings.Setting;
|
|
||||||
import net.FatalCodes.shadow.Shadow;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
//Your Imports
|
|
||||||
|
|
||||||
public class Button extends Component {
|
|
||||||
|
|
||||||
public Module mod;
|
|
||||||
public Frame parent;
|
|
||||||
public int offset;
|
|
||||||
private boolean isHovered;
|
|
||||||
private ArrayList<Component> subcomponents;
|
|
||||||
public boolean open;
|
|
||||||
private int height;
|
|
||||||
|
|
||||||
public Button(Module mod, Frame parent, int offset) {
|
|
||||||
this.mod = mod;
|
|
||||||
this.parent = parent;
|
|
||||||
this.offset = offset;
|
|
||||||
this.subcomponents = new ArrayList<Component>();
|
|
||||||
this.open = false;
|
|
||||||
height = 12;
|
|
||||||
int opY = offset + 12;
|
|
||||||
if(Shadow.setmgr.getSettingsByMod(mod) != null) {
|
|
||||||
for(Setting s : Shadow.setmgr.getSettingsByMod(mod)){
|
|
||||||
if(s.isCombo()){
|
|
||||||
this.subcomponents.add(new ModeButton(s, this, mod, opY));
|
|
||||||
opY += 12;
|
|
||||||
}
|
|
||||||
if(s.isSlider()){
|
|
||||||
this.subcomponents.add(new Slider(s, this, opY));
|
|
||||||
opY += 12;
|
|
||||||
}
|
|
||||||
if(s.isCheck()){
|
|
||||||
this.subcomponents.add(new Checkbox(s, this, opY));
|
|
||||||
opY += 12;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.subcomponents.add(new Keybind(this, opY));
|
|
||||||
this.subcomponents.add(new VisibleButton(this, mod, opY));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setOff(int newOff) {
|
|
||||||
offset = newOff;
|
|
||||||
int opY = offset + 12;
|
|
||||||
for(Component comp : this.subcomponents) {
|
|
||||||
comp.setOff(opY);
|
|
||||||
opY += 12;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderComponent() {
|
|
||||||
Gui.drawRect(parent.getX(), this.parent.getY() + this.offset, parent.getX() + parent.getWidth(), this.parent.getY() + 12 + this.offset, this.isHovered ? (this.mod.isToggled() ? 0xFF222222 : 0xFF222222) : (this.mod.isToggled() ? 0xFF111111 : 0xFF111111));
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.scale(0.5f,0.5f, 0.5f);
|
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.mod.getName(), (parent.getX() + 2) * 2, (parent.getY() + offset + 2) * 2 + 4, this.mod.isToggled() ? 0xFF00FF : -1);
|
|
||||||
if(this.subcomponents.size() > 2)
|
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.open ? "-" : "+", (parent.getX() + parent.getWidth() - 10) * 2, (parent.getY() + offset + 2) * 2 + 4, -1);
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
if(this.open) {
|
|
||||||
if(!this.subcomponents.isEmpty()) {
|
|
||||||
for(Component comp : this.subcomponents) {
|
|
||||||
comp.renderComponent();
|
|
||||||
}
|
|
||||||
Gui.drawRect(parent.getX() + 2, parent.getY() + this.offset + 12, parent.getX() + 3, parent.getY() + this.offset + ((this.subcomponents.size() + 1) * 12), 0xff68159E);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getHeight() {
|
|
||||||
if(this.open) {
|
|
||||||
return (12 * (this.subcomponents.size() + 1));
|
|
||||||
}
|
|
||||||
return 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateComponent(int mouseX, int mouseY) {
|
|
||||||
this.isHovered = isMouseOnButton(mouseX, mouseY);
|
|
||||||
if(!this.subcomponents.isEmpty()) {
|
|
||||||
for(Component comp : this.subcomponents) {
|
|
||||||
comp.updateComponent(mouseX, mouseY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int button) {
|
|
||||||
if(isMouseOnButton(mouseX, mouseY) && button == 0) {
|
|
||||||
this.mod.toggle();
|
|
||||||
}
|
|
||||||
if(isMouseOnButton(mouseX, mouseY) && button == 1) {
|
|
||||||
this.open = !this.open;
|
|
||||||
this.parent.refresh();
|
|
||||||
}
|
|
||||||
for(Component comp : this.subcomponents) {
|
|
||||||
comp.mouseClicked(mouseX, mouseY, button);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseReleased(int mouseX, int mouseY, int mouseButton) {
|
|
||||||
for(Component comp : this.subcomponents) {
|
|
||||||
comp.mouseReleased(mouseX, mouseY, mouseButton);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void keyTyped(char typedChar, int key) {
|
|
||||||
for(Component comp : this.subcomponents) {
|
|
||||||
comp.keyTyped(typedChar, key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMouseOnButton(int x, int y) {
|
|
||||||
if(x > parent.getX() && x < parent.getX() + parent.getWidth() && y > this.parent.getY() + this.offset && y < this.parent.getY() + 12 + this.offset) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,68 +0,0 @@
|
||||||
package de.Hero.clickgui.component.components.sub;
|
|
||||||
|
|
||||||
|
|
||||||
import de.Hero.clickgui.component.Component;
|
|
||||||
import de.Hero.clickgui.component.components.Button;
|
|
||||||
import de.Hero.settings.Setting;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
|
|
||||||
//Your Imports
|
|
||||||
|
|
||||||
public class Checkbox extends Component {
|
|
||||||
|
|
||||||
private boolean hovered;
|
|
||||||
private Setting op;
|
|
||||||
private Button parent;
|
|
||||||
private int offset;
|
|
||||||
private int x;
|
|
||||||
private int y;
|
|
||||||
|
|
||||||
public Checkbox(Setting option, Button button, int offset) {
|
|
||||||
this.op = option;
|
|
||||||
this.parent = button;
|
|
||||||
this.x = button.parent.getX() + button.parent.getWidth();
|
|
||||||
this.y = button.parent.getY() + button.offset;
|
|
||||||
this.offset = offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderComponent() {
|
|
||||||
Gui.drawRect(parent.parent.getX() + 2, parent.parent.getY() + offset, parent.parent.getX() + (parent.parent.getWidth() * 1), parent.parent.getY() + offset + 12, this.hovered ? 0xFF222222 : 0xFF111111);
|
|
||||||
Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + 2, parent.parent.getY() + offset + 12, 0xFF111111);
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.scale(0.5f,0.5f, 0.5f);
|
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.op.getName(), (parent.parent.getX() + 10 + 4) * 2 + 5, (parent.parent.getY() + offset + 2) * 2 + 4, -1);
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
Gui.drawRect(parent.parent.getX() + 3 + 4, parent.parent.getY() + offset + 3, parent.parent.getX() + 9 + 4, parent.parent.getY() + offset + 9, 0xFF999999);
|
|
||||||
if(this.op.isEnabled())
|
|
||||||
Gui.drawRect(parent.parent.getX() + 4 + 4, parent.parent.getY() + offset + 4, parent.parent.getX() + 8 + 4, parent.parent.getY() + offset + 8, 0xFF666666);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setOff(int newOff) {
|
|
||||||
offset = newOff;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateComponent(int mouseX, int mouseY) {
|
|
||||||
this.hovered = isMouseOnButton(mouseX, mouseY);
|
|
||||||
this.y = parent.parent.getY() + offset;
|
|
||||||
this.x = parent.parent.getX();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int button) {
|
|
||||||
if(isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.open) {
|
|
||||||
this.op.setEnabled(!op.isEnabled());;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMouseOnButton(int x, int y) {
|
|
||||||
if(x > this.x && x < this.x + 88 && y > this.y && y < this.y + 12) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,73 +0,0 @@
|
||||||
package de.Hero.clickgui.component.components.sub;
|
|
||||||
|
|
||||||
import de.Hero.clickgui.component.Component;
|
|
||||||
import de.Hero.clickgui.component.components.Button;
|
|
||||||
import net.FatalCodes.shadow.Shadow;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
|
|
||||||
//Your Imports
|
|
||||||
|
|
||||||
public class Keybind extends Component {
|
|
||||||
|
|
||||||
private boolean hovered;
|
|
||||||
private boolean binding;
|
|
||||||
private Button parent;
|
|
||||||
private int offset;
|
|
||||||
private int x;
|
|
||||||
private int y;
|
|
||||||
|
|
||||||
public Keybind(Button button, int offset) {
|
|
||||||
this.parent = button;
|
|
||||||
this.x = button.parent.getX() + button.parent.getWidth();
|
|
||||||
this.y = button.parent.getY() + button.offset;
|
|
||||||
this.offset = offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setOff(int newOff) {
|
|
||||||
offset = newOff;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderComponent() {
|
|
||||||
Gui.drawRect(parent.parent.getX() + 2, parent.parent.getY() + offset, parent.parent.getX() + (parent.parent.getWidth() * 1), parent.parent.getY() + offset + 12, this.hovered ? 0xFF222222 : 0xFF111111);
|
|
||||||
Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + 2, parent.parent.getY() + offset + 12, 0xFF111111);
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.scale(0.5f,0.5f, 0.5f);
|
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(binding ? "Press a key..." : ("Key: " + Keyboard.getKeyName(this.parent.mod.getKey())), (parent.parent.getX() + 7) * 2, (parent.parent.getY() + offset + 2) * 2 + 5, -1);
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateComponent(int mouseX, int mouseY) {
|
|
||||||
this.hovered = isMouseOnButton(mouseX, mouseY);
|
|
||||||
this.y = parent.parent.getY() + offset;
|
|
||||||
this.x = parent.parent.getX();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int button) {
|
|
||||||
if(isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.open) {
|
|
||||||
this.binding = !this.binding;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void keyTyped(char typedChar, int key) {
|
|
||||||
if(this.binding) {
|
|
||||||
this.parent.mod.setKey(key);
|
|
||||||
this.binding = false;
|
|
||||||
Shadow.moduleManager.addChatMessage("Shadow >> Bound" + parent.mod + "to" + parent.mod.getKey());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMouseOnButton(int x, int y) {
|
|
||||||
if(x > this.x && x < this.x + 88 && y > this.y && y < this.y + 12) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,83 +0,0 @@
|
||||||
package de.Hero.clickgui.component.components.sub;
|
|
||||||
|
|
||||||
|
|
||||||
import de.Hero.clickgui.component.Component;
|
|
||||||
import de.Hero.clickgui.component.components.Button;
|
|
||||||
import de.Hero.settings.Setting;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
|
|
||||||
//Your Imports
|
|
||||||
|
|
||||||
public class ModeButton extends Component {
|
|
||||||
|
|
||||||
private boolean hovered;
|
|
||||||
private Button parent;
|
|
||||||
private Setting set;
|
|
||||||
private int offset;
|
|
||||||
private int x;
|
|
||||||
private int y;
|
|
||||||
private net.FatalCodes.shadow.module.Module mod;
|
|
||||||
|
|
||||||
private int modeIndex;
|
|
||||||
|
|
||||||
public ModeButton(Setting set, Button button, net.FatalCodes.shadow.module.Module mod2, int offset) {
|
|
||||||
this.set = set;
|
|
||||||
this.parent = button;
|
|
||||||
this.mod = mod2;
|
|
||||||
this.x = button.parent.getX() + button.parent.getWidth();
|
|
||||||
this.y = button.parent.getY() + button.offset;
|
|
||||||
this.offset = offset;
|
|
||||||
this.modeIndex = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setOff(int newOff) {
|
|
||||||
offset = newOff;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderComponent() {
|
|
||||||
Gui.drawRect(parent.parent.getX() + 2, parent.parent.getY() + offset, parent.parent.getX() + (parent.parent.getWidth() * 1), parent.parent.getY() + offset + 12, this.hovered ? 0xFF222222 : 0xFF111111);
|
|
||||||
Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + 2, parent.parent.getY() + offset + 12, 0xFF111111);
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.scale(0.5f,0.5f, 0.5f);
|
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("Mode: " + set.getMode(), (parent.parent.getX() + 7) * 2, (parent.parent.getY() + offset + 2) * 2 + 5, -1);
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateComponent(int mouseX, int mouseY) {
|
|
||||||
this.hovered = isMouseOnButton(mouseX, mouseY);
|
|
||||||
this.y = parent.parent.getY() + offset;
|
|
||||||
this.x = parent.parent.getX();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int button) {
|
|
||||||
if(isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.open) {
|
|
||||||
int maxIndex = set.getOptions().size();
|
|
||||||
|
|
||||||
if(button == 0) {
|
|
||||||
if(modeIndex + 1 >= maxIndex)
|
|
||||||
modeIndex = 0;
|
|
||||||
else
|
|
||||||
modeIndex++;
|
|
||||||
} else if(button == 1) {
|
|
||||||
if(modeIndex <= 0)
|
|
||||||
modeIndex = maxIndex - 1;
|
|
||||||
else
|
|
||||||
modeIndex--;
|
|
||||||
}
|
|
||||||
set.setValString(set.getOptions().get(modeIndex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMouseOnButton(int x, int y) {
|
|
||||||
if(x > this.x && x < this.x + 88 && y > this.y && y < this.y + 12) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,116 +0,0 @@
|
||||||
package de.Hero.clickgui.component.components.sub;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
|
|
||||||
import de.Hero.clickgui.component.Component;
|
|
||||||
import de.Hero.clickgui.component.components.Button;
|
|
||||||
import de.Hero.settings.Setting;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
|
|
||||||
//Your Imports
|
|
||||||
|
|
||||||
|
|
||||||
public class Slider extends Component {
|
|
||||||
|
|
||||||
private boolean hovered;
|
|
||||||
|
|
||||||
private Setting set;
|
|
||||||
private Button parent;
|
|
||||||
private int offset;
|
|
||||||
private int x;
|
|
||||||
private int y;
|
|
||||||
private boolean dragging = false;
|
|
||||||
|
|
||||||
private double renderWidth;
|
|
||||||
|
|
||||||
public Slider(Setting value, Button button, int offset) {
|
|
||||||
this.set = value;
|
|
||||||
this.parent = button;
|
|
||||||
this.x = button.parent.getX() + button.parent.getWidth();
|
|
||||||
this.y = button.parent.getY() + button.offset;
|
|
||||||
this.offset = offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderComponent() {
|
|
||||||
Gui.drawRect(parent.parent.getX() + 2, parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset + 12, this.hovered ? 0xFF222222 : 0xFF111111);
|
|
||||||
final int drag = (int)(this.set.getValDouble() / this.set.getMax() * this.parent.parent.getWidth());
|
|
||||||
Gui.drawRect(parent.parent.getX() + 2, parent.parent.getY() + offset, parent.parent.getX() + (int) renderWidth, parent.parent.getY() + offset + 12,hovered ? 0xFF555555 : 0xFF444444);
|
|
||||||
Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + 2, parent.parent.getY() + offset + 12, 0xFF111111);
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.scale(0.5f,0.5f, 0.5f);
|
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.set.getName() + ": " + this.set.getValDouble() , (parent.parent.getX()* 2 + 15), (parent.parent.getY() + offset + 2) * 2 + 5, -1);
|
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setOff(int newOff) {
|
|
||||||
offset = newOff;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateComponent(int mouseX, int mouseY) {
|
|
||||||
this.hovered = isMouseOnButtonD(mouseX, mouseY) || isMouseOnButtonI(mouseX, mouseY);
|
|
||||||
this.y = parent.parent.getY() + offset;
|
|
||||||
this.x = parent.parent.getX();
|
|
||||||
|
|
||||||
double diff = Math.min(88, Math.max(0, mouseX - this.x));
|
|
||||||
|
|
||||||
double min = set.getMin();
|
|
||||||
double max = set.getMax();
|
|
||||||
|
|
||||||
renderWidth = (88) * (set.getValDouble() - min) / (max - min);
|
|
||||||
|
|
||||||
if (dragging) {
|
|
||||||
if (diff == 0) {
|
|
||||||
set.setValDouble(set.getMin());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
double newValue = roundToPlace(((diff / 88) * (max - min) + min), 2);
|
|
||||||
set.setValDouble(newValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static double roundToPlace(double value, int places) {
|
|
||||||
if (places < 0) {
|
|
||||||
throw new IllegalArgumentException();
|
|
||||||
}
|
|
||||||
BigDecimal bd = new BigDecimal(value);
|
|
||||||
bd = bd.setScale(places, RoundingMode.HALF_UP);
|
|
||||||
return bd.doubleValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int button) {
|
|
||||||
if(isMouseOnButtonD(mouseX, mouseY) && button == 0 && this.parent.open) {
|
|
||||||
dragging = true;
|
|
||||||
}
|
|
||||||
if(isMouseOnButtonI(mouseX, mouseY) && button == 0 && this.parent.open) {
|
|
||||||
dragging = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseReleased(int mouseX, int mouseY, int mouseButton) {
|
|
||||||
dragging = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMouseOnButtonD(int x, int y) {
|
|
||||||
if(x > this.x && x < this.x + (parent.parent.getWidth() / 2 + 1) && y > this.y && y < this.y + 12) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMouseOnButtonI(int x, int y) {
|
|
||||||
if(x > this.x + parent.parent.getWidth() / 2 && x < this.x + parent.parent.getWidth() && y > this.y && y < this.y + 12) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
package de.Hero.clickgui.component.components.sub;
|
|
||||||
|
|
||||||
|
|
||||||
import de.Hero.clickgui.component.Component;
|
|
||||||
import de.Hero.settings.Setting;
|
|
||||||
import de.Hero.clickgui.component.components.Button;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
|
|
||||||
//Your Imports
|
|
||||||
|
|
||||||
public class VisibleButton extends Component { // Remove this class if you don't want it (it's kinda useless)
|
|
||||||
|
|
||||||
private boolean hovered;
|
|
||||||
private Button parent;
|
|
||||||
private int offset;
|
|
||||||
private int x;
|
|
||||||
private int y;
|
|
||||||
private Module mod;
|
|
||||||
|
|
||||||
public VisibleButton(Button button, Module mod, int offset) {
|
|
||||||
this.parent = button;
|
|
||||||
this.mod = mod;
|
|
||||||
this.x = button.parent.getX() + button.parent.getWidth();
|
|
||||||
this.y = button.parent.getY() + button.offset;
|
|
||||||
this.offset = offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setOff(int newOff) {
|
|
||||||
offset = newOff;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderComponent() {
|
|
||||||
Gui.drawRect(parent.parent.getX() + 2, parent.parent.getY() + offset, parent.parent.getX() + (parent.parent.getWidth() * 1), parent.parent.getY() + offset + 12, this.hovered ? 0xFF222222 : 0xFF111111);
|
|
||||||
Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + 2, parent.parent.getY() + offset + 12, 0xFF111111);
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.scale(0.5f,0.5f, 0.5f);
|
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("Visible: " + mod.toggled, (parent.parent.getX() + 7) * 2, (parent.parent.getY() + offset + 2) * 2 + 5, -1);
|
|
||||||
GlStateManager.popMatrix(); // mod.visible is a public boolean variable in the Module.java class. If it's == false, the mod won't show up in the ArrayList
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateComponent(int mouseX, int mouseY) {
|
|
||||||
this.hovered = isMouseOnButton(mouseX, mouseY);
|
|
||||||
this.y = parent.parent.getY() + offset;
|
|
||||||
this.x = parent.parent.getX();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int button) {
|
|
||||||
if(isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.open) {
|
|
||||||
mod.toggled = (!mod.toggled);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMouseOnButton(int x, int y) {
|
|
||||||
if(x > this.x && x < this.x + 88 && y > this.y && y < this.y + 12) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,124 +0,0 @@
|
||||||
package de.Hero.settings;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
//Your Imports
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Made by HeroCode
|
|
||||||
* it's free to use
|
|
||||||
* but you have to credit him
|
|
||||||
*
|
|
||||||
* @author HeroCode
|
|
||||||
*/
|
|
||||||
public class Setting {
|
|
||||||
|
|
||||||
public String name;
|
|
||||||
public String description;
|
|
||||||
private Module parent;
|
|
||||||
private String mode;
|
|
||||||
|
|
||||||
private String sval;
|
|
||||||
private ArrayList<String> options;
|
|
||||||
|
|
||||||
private boolean bval;
|
|
||||||
|
|
||||||
private double dval;
|
|
||||||
private double min;
|
|
||||||
private double max;
|
|
||||||
private boolean onlyint = false;
|
|
||||||
|
|
||||||
|
|
||||||
public Setting(String name, Module parent, String... options){
|
|
||||||
this.name = name;
|
|
||||||
this.parent = parent;
|
|
||||||
this.options = new ArrayList<>(Arrays.asList(options));
|
|
||||||
this.sval = options[0];
|
|
||||||
this.mode = "Combo";
|
|
||||||
}
|
|
||||||
|
|
||||||
public Setting(String name, Module parent, boolean bval){
|
|
||||||
this.name = name;
|
|
||||||
this.parent = parent;
|
|
||||||
this.bval = bval;
|
|
||||||
this.mode = "Check";
|
|
||||||
}
|
|
||||||
|
|
||||||
public Setting(String name, Module parent, double dval, double min, double max, boolean onlyint){
|
|
||||||
this.name = name;
|
|
||||||
this.parent = parent;
|
|
||||||
this.dval = dval;
|
|
||||||
this.min = min;
|
|
||||||
this.max = max;
|
|
||||||
this.onlyint = onlyint;
|
|
||||||
this.mode = "Slider";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onPress() {}
|
|
||||||
|
|
||||||
public String getName(){
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Module getParentMod(){
|
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMode(){
|
|
||||||
return this.sval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValString(String in){
|
|
||||||
this.sval = in;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<String> getOptions(){
|
|
||||||
return this.options;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnabled(){
|
|
||||||
return this.bval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnabled(boolean in){
|
|
||||||
this.bval = in;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getValDouble(){
|
|
||||||
if(this.onlyint){
|
|
||||||
this.dval = (int)dval;
|
|
||||||
}
|
|
||||||
return this.dval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValDouble(double in){
|
|
||||||
this.dval = in;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getMin(){
|
|
||||||
return this.min;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getMax(){
|
|
||||||
return this.max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCombo(){
|
|
||||||
return this.mode.equalsIgnoreCase("Combo") ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCheck(){
|
|
||||||
return this.mode.equalsIgnoreCase("Check") ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSlider(){
|
|
||||||
return this.mode.equalsIgnoreCase("Slider") ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean onlyInt(){
|
|
||||||
return this.onlyint;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
package de.Hero.settings;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
|
|
||||||
//Your Imports
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Made by HeroCode
|
|
||||||
* it's free to use
|
|
||||||
* but you have to credit him
|
|
||||||
*
|
|
||||||
* @author HeroCode
|
|
||||||
*/
|
|
||||||
public class SettingsManager {
|
|
||||||
|
|
||||||
private ArrayList<Setting> settings;
|
|
||||||
|
|
||||||
public SettingsManager(){
|
|
||||||
this.settings = new ArrayList<Setting>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void rSetting(Setting in){
|
|
||||||
this.settings.add(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Setting> getSettings(){
|
|
||||||
return this.settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Setting> getSettingsByMod(Module mod){
|
|
||||||
ArrayList<Setting> out = new ArrayList<Setting>();
|
|
||||||
for(Setting s : getSettings()){
|
|
||||||
if(s.getParentMod().equals(mod)){
|
|
||||||
out.add(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(out.isEmpty()){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Setting getSettingByName(String name){
|
|
||||||
for(Setting set : getSettings()){
|
|
||||||
if(set.getName().equalsIgnoreCase(name)){
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
System.err.println("[DragonX] Error Setting NOT found: '" + name +"'!");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package net.FatalCodes.shadow;
|
|
||||||
|
|
||||||
import de.Hero.clickgui.ClickGui;
|
|
||||||
import de.Hero.settings.SettingsManager;
|
|
||||||
import net.FatalCodes.shadow.event.Event;
|
|
||||||
import net.FatalCodes.shadow.module.ModuleManager;
|
|
||||||
|
|
||||||
public class Shadow {
|
|
||||||
public static ModuleManager moduleManager;
|
|
||||||
public static SettingsManager setmgr;
|
|
||||||
public static ClickGui clickGui;
|
|
||||||
|
|
||||||
|
|
||||||
public static void ShadowClientStartup() {
|
|
||||||
moduleManager = new ModuleManager();
|
|
||||||
setmgr = new SettingsManager();
|
|
||||||
clickGui = new ClickGui();
|
|
||||||
|
|
||||||
}
|
|
||||||
public final static ClickGui getClickgui() { return clickGui; }
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
package net.FatalCodes.shadow.event;
|
|
||||||
|
|
||||||
public class Event<T> {
|
|
||||||
|
|
||||||
public boolean cancelled;
|
|
||||||
public EventType type;
|
|
||||||
public EventDirection direction;
|
|
||||||
|
|
||||||
public boolean isCancelled() {
|
|
||||||
return cancelled;
|
|
||||||
}
|
|
||||||
public void setCancelled(boolean cancelled) {
|
|
||||||
this.cancelled = cancelled;
|
|
||||||
}
|
|
||||||
public EventType getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
public void setType(EventType type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
public EventDirection getDirection() {
|
|
||||||
return direction;
|
|
||||||
}
|
|
||||||
public void setDirection(EventDirection direction) {
|
|
||||||
this.direction = direction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPre() {
|
|
||||||
if(type == null)
|
|
||||||
return false;
|
|
||||||
return type == EventType.PRE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPost() {
|
|
||||||
if(type == null)
|
|
||||||
return false;
|
|
||||||
return type == EventType.POST;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isIncoming() {
|
|
||||||
if(type == null)
|
|
||||||
return false;
|
|
||||||
return direction == EventDirection.INCOMING;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOutgoing() {
|
|
||||||
if(type == null)
|
|
||||||
return false;
|
|
||||||
return direction == EventDirection.OUTGOING;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
package net.FatalCodes.shadow.event;
|
|
||||||
|
|
||||||
public enum EventDirection {
|
|
||||||
OUTGOING,
|
|
||||||
INCOMING;
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
package net.FatalCodes.shadow.event;
|
|
||||||
|
|
||||||
public enum EventType {
|
|
||||||
PRE,
|
|
||||||
POST;
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
package net.FatalCodes.shadow.module;
|
|
||||||
|
|
||||||
public enum Category {
|
|
||||||
HUD, PVP, ADMIN
|
|
||||||
}
|
|
|
@ -1,116 +0,0 @@
|
||||||
package net.FatalCodes.shadow.module;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.Hero.settings.Setting;
|
|
||||||
import net.FatalCodes.shadow.Shadow;
|
|
||||||
import net.FatalCodes.shadow.event.Event;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
|
||||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
|
||||||
import net.minecraft.client.multiplayer.WorldClient;
|
|
||||||
import net.minecraft.network.Packet;
|
|
||||||
|
|
||||||
public class Module {
|
|
||||||
|
|
||||||
protected Minecraft mc = Minecraft.getMinecraft();
|
|
||||||
public String name;
|
|
||||||
private int key;
|
|
||||||
public boolean toggled;
|
|
||||||
//if jesus no work change above to private again
|
|
||||||
Category category;
|
|
||||||
public boolean blatant;
|
|
||||||
public Module(String nm, int k, Category c) {
|
|
||||||
name = nm;
|
|
||||||
key = k;
|
|
||||||
category = c;
|
|
||||||
toggled = false;
|
|
||||||
}
|
|
||||||
public Module(String nm, int k, Category c, boolean blatant) {
|
|
||||||
if(blatant) {
|
|
||||||
this.blatant = true;
|
|
||||||
name = "⚠ " + nm;
|
|
||||||
} else
|
|
||||||
name = nm;
|
|
||||||
key = k;
|
|
||||||
category = c;
|
|
||||||
toggled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toggle() {
|
|
||||||
toggled = !toggled;
|
|
||||||
if(toggled) {
|
|
||||||
onEnable();
|
|
||||||
}else {
|
|
||||||
onDisable();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onEnable() { }
|
|
||||||
public void onDisable() { }
|
|
||||||
public void onUpdate() { }
|
|
||||||
public void onRender() { }
|
|
||||||
|
|
||||||
public void addAll(Setting... settings) {
|
|
||||||
for(Setting s : settings)
|
|
||||||
Shadow.setmgr.rSetting(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Minecraft getMc() {
|
|
||||||
return mc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMc(Minecraft mc) {
|
|
||||||
this.mc = mc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getKey() {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setKey(int key) {
|
|
||||||
this.key = key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isToggled() {
|
|
||||||
return toggled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setToggled(boolean toggled) {
|
|
||||||
this.toggled = toggled;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected EntityPlayerSP player() {
|
|
||||||
return mc.thePlayer;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected PlayerControllerMP playerController() {
|
|
||||||
return mc.playerController;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected WorldClient world() {
|
|
||||||
return mc.theWorld;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
protected void sendPacket(Packet p) {
|
|
||||||
player().sendQueue.addToSendQueue(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onEvent(Event e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
package net.FatalCodes.shadow.module;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.FatalCodes.shadow.event.Event;
|
|
||||||
import net.FatalCodes.shadow.module.hud.ClickGui;
|
|
||||||
import net.FatalCodes.shadow.module.hud.Drag;
|
|
||||||
import net.FatalCodes.shadow.module.pvp.AutoWtap;
|
|
||||||
import net.FatalCodes.shadow.module.pvp.NoHurtCam;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.util.ChatComponentText;
|
|
||||||
|
|
||||||
public class ModuleManager {
|
|
||||||
|
|
||||||
public static ArrayList<Module> mods;
|
|
||||||
|
|
||||||
public ModuleManager() {
|
|
||||||
mods = new ArrayList<Module>();
|
|
||||||
newMod(new ClickGui());
|
|
||||||
newMod(new Drag());
|
|
||||||
|
|
||||||
//PVP
|
|
||||||
newMod(new NoHurtCam());
|
|
||||||
newMod(new AutoWtap());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void newMod(Module m) {
|
|
||||||
mods.add(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ArrayList<Module> getModules(){
|
|
||||||
return mods;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onUpdate() {
|
|
||||||
for(Module m : mods) {
|
|
||||||
m.onUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onRender() {
|
|
||||||
for(Module m : mods) {
|
|
||||||
m.onRender();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onKey(int k) {
|
|
||||||
for(Module m : mods) {
|
|
||||||
if(m.getKey() == k) {
|
|
||||||
m.toggle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addChatMessage(String message) {
|
|
||||||
message = "\2479" + "Shadow Client" + "\2477: " + message;
|
|
||||||
|
|
||||||
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(message));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Module> modsInCategory(Category c){
|
|
||||||
ArrayList<Module> inCategory = new ArrayList<>();
|
|
||||||
for(Module m : this.mods){
|
|
||||||
if(m.category == c)
|
|
||||||
inCategory.add(m);
|
|
||||||
}
|
|
||||||
return inCategory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onEvent(Event e) {
|
|
||||||
for(Module m : mods) {
|
|
||||||
if(!m.isToggled())
|
|
||||||
continue;
|
|
||||||
m.onEvent(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,128 +0,0 @@
|
||||||
package net.FatalCodes.shadow.module;
|
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
|
|
||||||
public class RenderModule extends Module {
|
|
||||||
|
|
||||||
public boolean dragging = false;
|
|
||||||
|
|
||||||
public RenderModule(String name, int k, Category cat, int x, int y, int width, int height) {
|
|
||||||
super(name, k, cat);
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.width = width;
|
|
||||||
this.height = height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int x,y,width,height;
|
|
||||||
public int lastX;
|
|
||||||
public int lastY;
|
|
||||||
|
|
||||||
public void draw() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Resize() {
|
|
||||||
if((getX() + getWidth()) > GuiScreen.width) {
|
|
||||||
this.x = GuiScreen.width - getWidth();
|
|
||||||
dragging = false;
|
|
||||||
} else if ((getY() + getHeight()) > GuiScreen.height) {
|
|
||||||
this.y = GuiScreen.height - getHeight();
|
|
||||||
dragging = false;
|
|
||||||
} else if ((getX()) < 0) {
|
|
||||||
this.x = 0;
|
|
||||||
dragging = false;
|
|
||||||
} else if ((getY()) < 0) {
|
|
||||||
this.y = 0;
|
|
||||||
dragging = false;
|
|
||||||
} else if (getX() <= 0 && getY() < 0) {
|
|
||||||
this.y = 0;
|
|
||||||
this.x = 0;
|
|
||||||
dragging = false;
|
|
||||||
} else if (getX() + getWidth() > GuiScreen.width && getY() < 0) {
|
|
||||||
this.x = GuiScreen.width - getWidth();
|
|
||||||
this.y = 0;
|
|
||||||
dragging = false;
|
|
||||||
} else if (getX() + getWidth() > GuiScreen.width && getY() + getHeight() > GuiScreen.height) {
|
|
||||||
this.x = GuiScreen.width - getWidth();
|
|
||||||
this.y = GuiScreen.height - getHeight();
|
|
||||||
dragging = false;
|
|
||||||
} else if (getY() + getHeight() > GuiScreen.height && getX() < 0) {
|
|
||||||
this.x = GuiScreen.width - getWidth();
|
|
||||||
this.y = GuiScreen.height - getHeight();
|
|
||||||
dragging = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void draggingFix(int mouseX, int mouseY) {
|
|
||||||
if (this.dragging) {
|
|
||||||
this.x = mouseX + this.lastX;
|
|
||||||
this.y = mouseY + this.lastY;
|
|
||||||
if(!Mouse.isButtonDown(0)) this.dragging = false;
|
|
||||||
|
|
||||||
if(this.x >= GuiScreen.width - getWidth()) {
|
|
||||||
this.dragging = false;
|
|
||||||
}
|
|
||||||
if(this.y >= GuiScreen.height - getHeight()) {
|
|
||||||
this.dragging = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderLayout(int mouseX, int mouseY) {
|
|
||||||
Resize();
|
|
||||||
boolean mouseOver = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + getWidth() && mouseY < getY() + this.getHeight();
|
|
||||||
boolean mouseOverX = (mouseX >= this.x && mouseX <= this.x+this.getWidth());
|
|
||||||
boolean mouseOverY = (mouseY >= this.y && mouseY <= this.y+this.getHeight());
|
|
||||||
boolean drag = (mouseOverX && mouseOverY && Mouse.isButtonDown(0));
|
|
||||||
draggingFix(mouseX, mouseY);
|
|
||||||
if(drag) {
|
|
||||||
if (!this.dragging) {
|
|
||||||
this.lastX = x - mouseX;
|
|
||||||
this.lastY = y - mouseY;
|
|
||||||
this.dragging = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
draw();
|
|
||||||
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y+this.getHeight(), 0x50FFFFFF);
|
|
||||||
Gui.drawRect(this.x, this.y, this.x+this.getWidth(), this.y+1, 0xFFFFFFFF);
|
|
||||||
Gui.drawRect(this.x, this.y, this.x+1, this.y+getHeight(), 0xFFFFFFFF);
|
|
||||||
Gui.drawRect(this.x+this.getWidth()-1, this.y, this.x+getWidth(), this.y+this.getHeight(), 0xFFFFFFFF);
|
|
||||||
Gui.drawRect(this.x, this.y+this.getHeight()-1, this.x+getWidth(), this.y+this.getHeight(), 0xFFFFFFFF);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getX() {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getY() {
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setX(int x) {
|
|
||||||
this.x = x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setY(int y) {
|
|
||||||
this.y = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWidth() {
|
|
||||||
return width;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getHeight() {
|
|
||||||
return height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWidth(int width) {
|
|
||||||
this.width = width;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeight(int height) {
|
|
||||||
this.height = height;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
package net.FatalCodes.shadow.module.hud;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import de.Hero.settings.Setting;
|
|
||||||
import net.FatalCodes.shadow.Shadow;
|
|
||||||
import net.FatalCodes.shadow.module.Category;
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
|
|
||||||
public class ClickGui extends Module {
|
|
||||||
public ClickGui clickgui;
|
|
||||||
|
|
||||||
public ClickGui() {
|
|
||||||
super("ClickGui", KeyboardConstants.KEY_RSHIFT, Category.HUD);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onEnable() {
|
|
||||||
if(this.clickgui == null)
|
|
||||||
this.clickgui = new ClickGui();
|
|
||||||
|
|
||||||
mc.displayGuiScreen(Shadow.getClickgui());
|
|
||||||
super.onEnable();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onDisable() {
|
|
||||||
super.onDisable();
|
|
||||||
mc.displayGuiScreen((GuiScreen) null);
|
|
||||||
mc.setIngameFocus();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
package net.FatalCodes.shadow.module.hud;
|
|
||||||
|
|
||||||
import net.FatalCodes.shadow.module.Category;
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import net.FatalCodes.shadow.ui.DragScreen;
|
|
||||||
|
|
||||||
public class Drag extends Module {
|
|
||||||
public DragScreen dragScreen;
|
|
||||||
public Drag() {
|
|
||||||
super("DragScreen", KeyboardConstants.KEY_O, Category.HUD);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onEnable() {
|
|
||||||
if(this.dragScreen == null)
|
|
||||||
this.dragScreen = new DragScreen();
|
|
||||||
mc.displayGuiScreen(new DragScreen());
|
|
||||||
super.onEnable();
|
|
||||||
}
|
|
||||||
public void onDisable() {
|
|
||||||
super.onDisable();
|
|
||||||
mc.displayGuiScreen((GuiScreen) null);
|
|
||||||
mc.setIngameFocus();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
package net.FatalCodes.shadow.module.pvp;
|
|
||||||
|
|
||||||
import net.FatalCodes.shadow.module.Category;
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
|
|
||||||
import net.minecraft.network.Packet;
|
|
||||||
|
|
||||||
|
|
||||||
public class AutoWtap extends Module {
|
|
||||||
public AutoWtap() {
|
|
||||||
super("AutoWtap", KeyboardConstants.KEY_NONE, Category.PVP);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Float coolDown = 0f;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpdate() {
|
|
||||||
if(this.isToggled()) {
|
|
||||||
coolDown -= 1f;
|
|
||||||
mc.thePlayer.setSprinting(true);
|
|
||||||
if (mc.thePlayer.isSwingInProgress)
|
|
||||||
if (coolDown < 0) {
|
|
||||||
mc.thePlayer.setSprinting(false);
|
|
||||||
coolDown = 3f;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
package net.FatalCodes.shadow.module.pvp;
|
|
||||||
|
|
||||||
import net.FatalCodes.shadow.module.Category;
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
|
|
||||||
|
|
||||||
public class NoHurtCam extends Module {
|
|
||||||
public NoHurtCam() {
|
|
||||||
super("NoHurtCam", KeyboardConstants.KEY_NONE, Category.PVP);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onUpdate() {
|
|
||||||
if(this.isToggled()) {
|
|
||||||
mc.thePlayer.maxHurtTime = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
package net.FatalCodes.shadow.ui;
|
|
||||||
|
|
||||||
import net.FatalCodes.shadow.Shadow;
|
|
||||||
import net.FatalCodes.shadow.module.ModuleManager;
|
|
||||||
import net.FatalCodes.shadow.module.RenderModule;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import net.FatalCodes.shadow.module.Module;
|
|
||||||
|
|
||||||
public class DragScreen extends GuiScreen {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initGui() {
|
|
||||||
this.buttonList.add(new GuiButton(1, width/2-100, height/6+148, "Back"));
|
|
||||||
super.initGui();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int i, int j, float var3) {
|
|
||||||
for(Module m : ModuleManager.mods) {
|
|
||||||
if(m.isToggled() && m instanceof RenderModule) {
|
|
||||||
((RenderModule)m).renderLayout(i, j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
super.drawScreen(i, j, var3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void actionPerformed(GuiButton parGuiButton) {
|
|
||||||
if(parGuiButton.id == 1) {
|
|
||||||
mc.displayGuiScreen(Shadow.getClickgui());
|
|
||||||
}
|
|
||||||
super.actionPerformed(parGuiButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,160 @@
|
||||||
|
package net.PeytonPlayz585.shadow;
|
||||||
|
|
||||||
|
import com.google.common.collect.AbstractIterator;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.*;
|
||||||
|
|
||||||
|
public class BlockPosMSingleplayer extends BlockPos {
|
||||||
|
private int mx;
|
||||||
|
private int my;
|
||||||
|
private int mz;
|
||||||
|
private int level;
|
||||||
|
private BlockPosMSingleplayer[] facings;
|
||||||
|
private boolean needsUpdate;
|
||||||
|
|
||||||
|
public BlockPosMSingleplayer(int p_i22_1_, int p_i22_2_, int p_i22_3_) {
|
||||||
|
this(p_i22_1_, p_i22_2_, p_i22_3_, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPosMSingleplayer(double p_i23_1_, double p_i23_3_, double p_i23_5_) {
|
||||||
|
this(MathHelper.floor_double(p_i23_1_), MathHelper.floor_double(p_i23_3_), MathHelper.floor_double(p_i23_5_));
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPosMSingleplayer(int p_i24_1_, int p_i24_2_, int p_i24_3_, int p_i24_4_) {
|
||||||
|
super(0, 0, 0);
|
||||||
|
this.mx = p_i24_1_;
|
||||||
|
this.my = p_i24_2_;
|
||||||
|
this.mz = p_i24_3_;
|
||||||
|
this.level = p_i24_4_;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the X coordinate
|
||||||
|
*/
|
||||||
|
public int getX() {
|
||||||
|
return this.mx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Y coordinate
|
||||||
|
*/
|
||||||
|
public int getY() {
|
||||||
|
return this.my;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Z coordinate
|
||||||
|
*/
|
||||||
|
public int getZ() {
|
||||||
|
return this.mz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXyz(int p_setXyz_1_, int p_setXyz_2_, int p_setXyz_3_) {
|
||||||
|
this.mx = p_setXyz_1_;
|
||||||
|
this.my = p_setXyz_2_;
|
||||||
|
this.mz = p_setXyz_3_;
|
||||||
|
this.needsUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXyz(double p_setXyz_1_, double p_setXyz_3_, double p_setXyz_5_) {
|
||||||
|
this.setXyz(MathHelper.floor_double(p_setXyz_1_), MathHelper.floor_double(p_setXyz_3_), MathHelper.floor_double(p_setXyz_5_));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offset this BlockPos 1 block in the given direction
|
||||||
|
*/
|
||||||
|
public BlockPos offset(EnumFacing facing) {
|
||||||
|
if (this.level <= 0) {
|
||||||
|
return super.offset(facing, 1);
|
||||||
|
} else {
|
||||||
|
if (this.facings == null) {
|
||||||
|
this.facings = new BlockPosMSingleplayer[EnumFacing.VALUES.length];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.needsUpdate) {
|
||||||
|
this.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
int i = facing.getIndex();
|
||||||
|
BlockPosMSingleplayer blockposm = this.facings[i];
|
||||||
|
|
||||||
|
if (blockposm == null) {
|
||||||
|
int j = this.mx + facing.getFrontOffsetX();
|
||||||
|
int k = this.my + facing.getFrontOffsetY();
|
||||||
|
int l = this.mz + facing.getFrontOffsetZ();
|
||||||
|
blockposm = new BlockPosMSingleplayer(j, k, l, this.level - 1);
|
||||||
|
this.facings[i] = blockposm;
|
||||||
|
}
|
||||||
|
|
||||||
|
return blockposm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offsets this BlockPos n blocks in the given direction
|
||||||
|
*/
|
||||||
|
public BlockPos offset(EnumFacing facing, int n) {
|
||||||
|
return n == 1 ? this.offset(facing) : super.offset(facing, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void update() {
|
||||||
|
for (int i = 0; i < 6; ++i) {
|
||||||
|
BlockPosMSingleplayer blockposm = this.facings[i];
|
||||||
|
|
||||||
|
if (blockposm != null) {
|
||||||
|
EnumFacing enumfacing = EnumFacing.VALUES[i];
|
||||||
|
int j = this.mx + enumfacing.getFrontOffsetX();
|
||||||
|
int k = this.my + enumfacing.getFrontOffsetY();
|
||||||
|
int l = this.mz + enumfacing.getFrontOffsetZ();
|
||||||
|
blockposm.setXyz(j, k, l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.needsUpdate = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Iterable getAllInBoxMutable(BlockPos p_getAllInBoxMutable_0_, BlockPos p_getAllInBoxMutable_1_) {
|
||||||
|
final BlockPos blockpos = new BlockPos(Math.min(p_getAllInBoxMutable_0_.getX(), p_getAllInBoxMutable_1_.getX()), Math.min(p_getAllInBoxMutable_0_.getY(), p_getAllInBoxMutable_1_.getY()), Math.min(p_getAllInBoxMutable_0_.getZ(), p_getAllInBoxMutable_1_.getZ()));
|
||||||
|
final BlockPos blockpos1 = new BlockPos(Math.max(p_getAllInBoxMutable_0_.getX(), p_getAllInBoxMutable_1_.getX()), Math.max(p_getAllInBoxMutable_0_.getY(), p_getAllInBoxMutable_1_.getY()), Math.max(p_getAllInBoxMutable_0_.getZ(), p_getAllInBoxMutable_1_.getZ()));
|
||||||
|
return new Iterable() {
|
||||||
|
public Iterator iterator() {
|
||||||
|
return new AbstractIterator() {
|
||||||
|
private BlockPosMSingleplayer theBlockPosM = null;
|
||||||
|
protected BlockPosMSingleplayer computeNext0() {
|
||||||
|
if (this.theBlockPosM == null) {
|
||||||
|
this.theBlockPosM = new BlockPosMSingleplayer(blockpos.getX(), blockpos.getY(), blockpos.getZ(), 3);
|
||||||
|
return this.theBlockPosM;
|
||||||
|
} else if (this.theBlockPosM.equals(blockpos1)) {
|
||||||
|
return (BlockPosMSingleplayer)this.endOfData();
|
||||||
|
} else {
|
||||||
|
int i = this.theBlockPosM.getX();
|
||||||
|
int j = this.theBlockPosM.getY();
|
||||||
|
int k = this.theBlockPosM.getZ();
|
||||||
|
|
||||||
|
if (i < blockpos1.getX()) {
|
||||||
|
++i;
|
||||||
|
} else if (j < blockpos1.getY()) {
|
||||||
|
i = blockpos.getX();
|
||||||
|
++j;
|
||||||
|
} else if (k < blockpos1.getZ()) {
|
||||||
|
i = blockpos.getX();
|
||||||
|
j = blockpos.getY();
|
||||||
|
++k;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.theBlockPosM.setXyz(i, j, k);
|
||||||
|
return this.theBlockPosM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected Object computeNext() {
|
||||||
|
return this.computeNext0();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos getImmutable() {
|
||||||
|
return new BlockPos(this.getX(), this.getY(), this.getZ());
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,10 @@
|
||||||
package net.PeytonPlayz585.shadow;
|
package net.PeytonPlayz585.shadow;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer;
|
||||||
import net.minecraft.block.BlockLeavesBase;
|
import net.minecraft.block.BlockLeavesBase;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.settings.GameSettings;
|
import net.minecraft.client.settings.GameSettings;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
|
@ -11,7 +13,6 @@ import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
import net.minecraft.world.chunk.EmptyChunk;
|
import net.minecraft.world.chunk.EmptyChunk;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
|
|
||||||
public class ClearWater {
|
public class ClearWater {
|
||||||
public static void updateWaterOpacity(GameSettings p_updateWaterOpacity_0_, World p_updateWaterOpacity_1_) {
|
public static void updateWaterOpacity(GameSettings p_updateWaterOpacity_0_, World p_updateWaterOpacity_1_) {
|
||||||
|
@ -77,7 +78,89 @@ public class ClearWater {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l1 > 0) {
|
if (l1 > 0) {
|
||||||
Config.dbg("ClearWater (Server) relighted " + l1 + " chunks");
|
String s = "server";
|
||||||
|
|
||||||
|
if (Minecraft.getMinecraft().isIntegratedServerRunning()) {
|
||||||
|
s = "client";
|
||||||
|
}
|
||||||
|
|
||||||
|
Config.dbg("ClearWater (" + s + ") relighted " + l1 + " chunks");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void updateWaterOpacity(GameSettings p_updateWaterOpacity_0_, WorldServer p_updateWaterOpacity_1_) {
|
||||||
|
if (p_updateWaterOpacity_0_ != null) {
|
||||||
|
int i = 3;
|
||||||
|
|
||||||
|
if (p_updateWaterOpacity_0_.ofClearWater) {
|
||||||
|
i = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
BlockLeavesBase.setLightOpacity(Blocks.water, i);
|
||||||
|
BlockLeavesBase.setLightOpacity(Blocks.flowing_water, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p_updateWaterOpacity_1_ != null) {
|
||||||
|
net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.IChunkProvider ichunkprovider = p_updateWaterOpacity_1_.getChunkProvider();
|
||||||
|
|
||||||
|
if (ichunkprovider != null) {
|
||||||
|
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
|
||||||
|
|
||||||
|
if (entity != null) {
|
||||||
|
int j = (int) entity.posX / 16;
|
||||||
|
int k = (int) entity.posZ / 16;
|
||||||
|
int l = j - 512;
|
||||||
|
int i1 = j + 512;
|
||||||
|
int j1 = k - 512;
|
||||||
|
int k1 = k + 512;
|
||||||
|
int l1 = 0;
|
||||||
|
|
||||||
|
for (int i2 = l; i2 < i1; ++i2) {
|
||||||
|
for (int j2 = j1; j2 < k1; ++j2) {
|
||||||
|
if (ichunkprovider.chunkExists(i2, j2)) {
|
||||||
|
net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.Chunk chunk = ichunkprovider.provideChunk(i2, j2);
|
||||||
|
|
||||||
|
if (chunk != null && !(chunk instanceof net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.EmptyChunk)) {
|
||||||
|
int k2 = i2 << 4;
|
||||||
|
int l2 = j2 << 4;
|
||||||
|
int i3 = k2 + 16;
|
||||||
|
int j3 = l2 + 16;
|
||||||
|
BlockPosMSingleplayer blockposm = new BlockPosMSingleplayer(0, 0, 0);
|
||||||
|
BlockPosMSingleplayer blockposm1 = new BlockPosMSingleplayer(0, 0, 0);
|
||||||
|
|
||||||
|
for (int k3 = k2; k3 < i3; ++k3) {
|
||||||
|
for (int l3 = l2; l3 < j3; ++l3) {
|
||||||
|
blockposm.setXyz(k3, 0, l3);
|
||||||
|
net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos blockpos = p_updateWaterOpacity_1_.getPrecipitationHeight(blockposm);
|
||||||
|
|
||||||
|
for (int i4 = 0; i4 < blockpos.getY(); ++i4) {
|
||||||
|
blockposm1.setXyz(k3, i4, l3);
|
||||||
|
net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState iblockstate = p_updateWaterOpacity_1_.getBlockState(blockposm1);
|
||||||
|
|
||||||
|
if (iblockstate.getBlock().getMaterial() == net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.material.Material.water) {
|
||||||
|
p_updateWaterOpacity_1_.markBlocksDirtyVertical(k3, l3, blockposm1.getY(), blockpos.getY());
|
||||||
|
++l1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (l1 > 0) {
|
||||||
|
String s = "server";
|
||||||
|
|
||||||
|
if (Minecraft.getMinecraft().isIntegratedServerRunning()) {
|
||||||
|
s = "client";
|
||||||
|
}
|
||||||
|
|
||||||
|
Config.dbg("ClearWater (" + s + ") relighted " + l1 + " chunks");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ public class Config {
|
||||||
public static boolean chunkFixNether = false;
|
public static boolean chunkFixNether = false;
|
||||||
public static boolean chunkFixEnd = false;
|
public static boolean chunkFixEnd = false;
|
||||||
public static WorldClient worldClient = null;
|
public static WorldClient worldClient = null;
|
||||||
|
public static boolean waterOpacityChanged = false;
|
||||||
|
|
||||||
public static boolean isAnimatedWater() {
|
public static boolean isAnimatedWater() {
|
||||||
return Minecraft.getMinecraft().gameSettings.ofAnimatedWater != 2;
|
return Minecraft.getMinecraft().gameSettings.ofAnimatedWater != 2;
|
||||||
|
|
86
src/main/java/net/PeytonPlayz585/shadow/WorldServerOF.java
Normal file
86
src/main/java/net/PeytonPlayz585/shadow/WorldServerOF.java
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
package net.PeytonPlayz585.shadow;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.profiler.Profiler;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.MinecraftServer;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.WorldServer;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.IChunkProvider;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.ISaveHandler;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage.WorldInfo;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network.play.server.S2BPacketChangeGameState;
|
||||||
|
|
||||||
|
public class WorldServerOF extends WorldServer {
|
||||||
|
private MinecraftServer mcServer;
|
||||||
|
|
||||||
|
public WorldServerOF(MinecraftServer p_i98_1_, ISaveHandler p_i98_2_, WorldInfo p_i98_3_, int p_i98_4_, Profiler p_i98_5_) {
|
||||||
|
super(p_i98_1_, p_i98_2_, p_i98_3_, p_i98_4_, p_i98_5_);
|
||||||
|
this.mcServer = p_i98_1_;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs a single tick for the world
|
||||||
|
*/
|
||||||
|
public void tick() {
|
||||||
|
super.tick();
|
||||||
|
|
||||||
|
// if (!Config.isTimeDefault()) {
|
||||||
|
// this.fixWorldTime();
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (Config.waterOpacityChanged) {
|
||||||
|
Config.waterOpacityChanged = false;
|
||||||
|
ClearWater.updateWaterOpacity(Config.getGameSettings(), this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates all weather states.
|
||||||
|
*/
|
||||||
|
protected void updateWeather() {
|
||||||
|
// if (!Config.isWeatherEnabled()) {
|
||||||
|
// this.fixWorldWeather();
|
||||||
|
// }
|
||||||
|
|
||||||
|
super.updateWeather();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fixWorldWeather() {
|
||||||
|
if (this.worldInfo.isRaining() || this.worldInfo.isThundering()) {
|
||||||
|
this.worldInfo.setRainTime(0);
|
||||||
|
this.worldInfo.setRaining(false);
|
||||||
|
this.setRainStrength(0.0F);
|
||||||
|
this.worldInfo.setThunderTime(0);
|
||||||
|
this.worldInfo.setThundering(false);
|
||||||
|
this.setThunderStrength(0.0F);
|
||||||
|
this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(2, 0.0F));
|
||||||
|
this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(7, 0.0F));
|
||||||
|
this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(8, 0.0F));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fixWorldTime() {
|
||||||
|
if (this.worldInfo.getGameType().getID() == 1) {
|
||||||
|
long i = this.getWorldTime();
|
||||||
|
long j = i % 24000L;
|
||||||
|
|
||||||
|
// if (Config.isTimeDayOnly()) {
|
||||||
|
// if (j <= 1000L) {
|
||||||
|
// this.setWorldTime(i - j + 1001L);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (j >= 11000L) {
|
||||||
|
// this.setWorldTime(i - j + 24001L);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (Config.isTimeNightOnly()) {
|
||||||
|
// if (j <= 14000L) {
|
||||||
|
// this.setWorldTime(i - j + 14001L);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (j >= 22000L) {
|
||||||
|
// this.setWorldTime(i - j + 24000L + 14001L);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -68,7 +68,7 @@ public class GuiOther extends GuiScreen implements GuiYesNoCallback {
|
||||||
|
|
||||||
public void confirmClicked(boolean result, int id) {
|
public void confirmClicked(boolean result, int id) {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.mc.gameSettings.resetSettings();
|
//this.mc.gameSettings.resetSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mc.displayGuiScreen(this);
|
this.mc.displayGuiScreen(this);
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class GuiShaders extends GuiScreen {
|
||||||
java.util.Map<Integer, String> languageMap = new java.util.HashMap<>();
|
java.util.Map<Integer, String> languageMap = new java.util.HashMap<>();
|
||||||
|
|
||||||
public List(Minecraft mcIn) {
|
public List(Minecraft mcIn) {
|
||||||
super(mcIn, GuiShaders.width - 120 - 20, GuiShaders.height, 30, GuiShaders.height - 50, 16);
|
super(mcIn, GuiShaders.this.width - 120 - 20, GuiShaders.this.height, 30, GuiShaders.this.height - 50, 16);
|
||||||
|
|
||||||
languageMap.put(1, "OFF");
|
languageMap.put(1, "OFF");
|
||||||
languageMap.put(2, "High Performance PBR");
|
languageMap.put(2, "High Performance PBR");
|
||||||
|
|
|
@ -1,76 +0,0 @@
|
||||||
package net.PeytonPlayz585.shadow.input;
|
|
||||||
|
|
||||||
import org.teavm.jso.JSBody;
|
|
||||||
|
|
||||||
public class Controller {
|
|
||||||
|
|
||||||
@JSBody(params = {"i"}, script = "return isKeyDown(i);")
|
|
||||||
private static native boolean isKeyDown2(int i);
|
|
||||||
|
|
||||||
@JSBody(params = {"i"}, script = "return isPressed(i);")
|
|
||||||
private static native boolean isPressed2(int i);
|
|
||||||
|
|
||||||
@JSBody(params = {}, script = "return isWalkingForward();")
|
|
||||||
public static native boolean isWalkingForward();
|
|
||||||
|
|
||||||
@JSBody(params = {}, script = "return isWalkingBackward();")
|
|
||||||
public static native boolean isWalkingBackward();
|
|
||||||
|
|
||||||
@JSBody(params = {}, script = "return isWalkingLeft();")
|
|
||||||
public static native boolean isWalkingLeft();
|
|
||||||
|
|
||||||
@JSBody(params = {}, script = "return isWalkingRight();")
|
|
||||||
public static native boolean isWalkingRight();
|
|
||||||
|
|
||||||
@JSBody(params = {}, script = "return getCameraX();")
|
|
||||||
public static native int getCameraX();
|
|
||||||
|
|
||||||
@JSBody(params = {}, script = "return getCameraY();")
|
|
||||||
public static native int getCameraY();
|
|
||||||
|
|
||||||
public static boolean isKeyDown(String i) {
|
|
||||||
if(keyboardToGamepad(i) == -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return isKeyDown2(keyboardToGamepad(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isPressed(String i) {
|
|
||||||
if(keyboardToGamepad(i) == -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return isPressed2(keyboardToGamepad(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getEventDWheel() {
|
|
||||||
if(isPressed2(4)) {
|
|
||||||
return -1;
|
|
||||||
} else if(isPressed2(5)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int keyboardToGamepad(String s) {
|
|
||||||
if(s.contains("attack")) {
|
|
||||||
return 7;
|
|
||||||
} else if(s.contains("use")) {
|
|
||||||
return 6;
|
|
||||||
} else if(s.contains("drop")) {
|
|
||||||
return 13;
|
|
||||||
} else if(s.contains("togglePerspective")) {
|
|
||||||
return 12;
|
|
||||||
} else if(s.contains("inventory")) {
|
|
||||||
return 3;
|
|
||||||
} else if(s.contains("jump")) {
|
|
||||||
return 0;
|
|
||||||
} else if(s.contains("sneak")) {
|
|
||||||
return 1;
|
|
||||||
} else if(s.contains("sprint")) {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +1,22 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ArrayUtils {
|
public class ArrayUtils {
|
||||||
|
@ -51,6 +55,16 @@ public class ArrayUtils {
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T> void eaglerShuffle(List<T> list, EaglercraftRandom rnd) {
|
||||||
|
T k;
|
||||||
|
for (int i = list.size() - 1, j; i > 0; --i) {
|
||||||
|
j = rnd.nextInt(i + 1);
|
||||||
|
k = list.get(j);
|
||||||
|
list.set(j, list.get(i));
|
||||||
|
list.set(i, k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean contains(String[] array, String value) {
|
public static boolean contains(String[] array, String value) {
|
||||||
for (String item : array) {
|
for (String item : array) {
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DecoderException extends RuntimeException {
|
public class DecoderException extends RuntimeException {
|
||||||
|
|
|
@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
|
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Display {
|
public class Display {
|
||||||
|
|
|
@ -8,7 +8,9 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
|
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer;
|
import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
@ -23,18 +25,21 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.update.UpdateService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EagRuntime {
|
public class EagRuntime {
|
||||||
|
@ -42,6 +47,7 @@ public class EagRuntime {
|
||||||
private static final Logger logger = LogManager.getLogger("EagRuntime");
|
private static final Logger logger = LogManager.getLogger("EagRuntime");
|
||||||
private static final Logger exceptionLogger = LogManager.getLogger("Exception");
|
private static final Logger exceptionLogger = LogManager.getLogger("Exception");
|
||||||
private static boolean ssl = false;
|
private static boolean ssl = false;
|
||||||
|
private static boolean offlineDownloadURL = false;
|
||||||
|
|
||||||
public static String getVersion() {
|
public static String getVersion() {
|
||||||
return "EagRuntimeX 1.0";
|
return "EagRuntimeX 1.0";
|
||||||
|
@ -51,6 +57,9 @@ public class EagRuntime {
|
||||||
logger.info("Version: {}", getVersion());
|
logger.info("Version: {}", getVersion());
|
||||||
PlatformRuntime.create();
|
PlatformRuntime.create();
|
||||||
ssl = PlatformRuntime.requireSSL();
|
ssl = PlatformRuntime.requireSSL();
|
||||||
|
offlineDownloadURL = PlatformRuntime.isOfflineDownloadURL();
|
||||||
|
UpdateService.initialize();
|
||||||
|
EaglerXBungeeVersion.initialize();
|
||||||
EaglercraftGPU.warmUpCache();
|
EaglercraftGPU.warmUpCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,11 +220,15 @@ public class EagRuntime {
|
||||||
public static long freeMemory() {
|
public static long freeMemory() {
|
||||||
return PlatformRuntime.freeMemory();
|
return PlatformRuntime.freeMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean requireSSL() {
|
public static boolean requireSSL() {
|
||||||
return ssl;
|
return ssl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isOfflineDownloadURL() {
|
||||||
|
return offlineDownloadURL;
|
||||||
|
}
|
||||||
|
|
||||||
public static void showPopup(String msg) {
|
public static void showPopup(String msg) {
|
||||||
PlatformApplication.showPopup(msg);
|
PlatformApplication.showPopup(msg);
|
||||||
}
|
}
|
||||||
|
@ -244,6 +257,10 @@ public class EagRuntime {
|
||||||
return PlatformApplication.getFileChooserResult();
|
return PlatformApplication.getFileChooserResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void clearFileChooserResult() {
|
||||||
|
PlatformApplication.clearFileChooserResult();
|
||||||
|
}
|
||||||
|
|
||||||
public static void setStorage(String name, byte[] data) {
|
public static void setStorage(String name, byte[] data) {
|
||||||
PlatformApplication.setLocalStorage(name, data);
|
PlatformApplication.setLocalStorage(name, data);
|
||||||
}
|
}
|
||||||
|
@ -271,4 +288,25 @@ public class EagRuntime {
|
||||||
public static void openCreditsPopup(String text) {
|
public static void openCreditsPopup(String text) {
|
||||||
PlatformApplication.openCreditsPopup(text);
|
PlatformApplication.openCreditsPopup(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void downloadFileWithName(String fileName, byte[] fileContents) {
|
||||||
|
PlatformApplication.downloadFileWithName(fileName, fileContents);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String currentThreadName() {
|
||||||
|
return PlatformRuntime.currentThreadName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void showDebugConsole() {
|
||||||
|
PlatformApplication.showDebugConsole();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Calendar getLocaleCalendar() {
|
||||||
|
return Calendar.getInstance(); //TODO: fix teavm calendar's time zone offset
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T extends DateFormat> T fixDateFormat(T input) {
|
||||||
|
input.setCalendar(getLocaleCalendar());
|
||||||
|
return input;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,28 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EagUtils {
|
public class EagUtils {
|
||||||
|
|
||||||
private static final String hex = "0123456789ABCDEF";
|
private static final String hex = "0123456789ABCDEF";
|
||||||
|
public static final Pattern splitPattern = Pattern.compile("(\\r\\n|\\n|\\r)");
|
||||||
|
|
||||||
public static String hexString(int value, int digits) {
|
public static String hexString(int value, int digits) {
|
||||||
String ret = "";
|
String ret = "";
|
||||||
|
@ -24,6 +31,14 @@ public class EagUtils {
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String[] linesArray(String input) {
|
||||||
|
return splitPattern.split(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> linesList(String input) {
|
||||||
|
return Arrays.asList(splitPattern.split(input));
|
||||||
|
}
|
||||||
|
|
||||||
public static int decodeHex(CharSequence num) {
|
public static int decodeHex(CharSequence num) {
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
|
@ -6,16 +6,18 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglerInputStream extends ByteArrayInputStream {
|
public class EaglerInputStream extends ByteArrayInputStream {
|
||||||
|
|
|
@ -0,0 +1,97 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class EaglerXBungeeVersion {
|
||||||
|
|
||||||
|
public static final String pluginFileEPK = "plugin_download.zip";
|
||||||
|
|
||||||
|
private static String pluginName = null;
|
||||||
|
private static String pluginVersion = null;
|
||||||
|
private static long pluginVersionLong = 0l;
|
||||||
|
private static String pluginButton = null;
|
||||||
|
private static String pluginFilename = null;
|
||||||
|
|
||||||
|
public static void initialize() {
|
||||||
|
String pluginVersionJson = EagRuntime.getResourceString("plugin_version.json");
|
||||||
|
if(pluginVersionJson == null) {
|
||||||
|
throw new RuntimeException("File \"plugin_version.json\" is missing in the epk!");
|
||||||
|
}
|
||||||
|
JSONObject json = new JSONObject(pluginVersionJson);
|
||||||
|
pluginName = json.getString("pluginName");
|
||||||
|
pluginVersion = json.getString("pluginVersion");
|
||||||
|
pluginVersionLong = getVersionAsLong(pluginVersion);
|
||||||
|
pluginButton = json.getString("pluginButton");
|
||||||
|
pluginFilename = json.getString("pluginFilename");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPluginName() {
|
||||||
|
return pluginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPluginVersion() {
|
||||||
|
return pluginVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long getPluginVersionLong() {
|
||||||
|
return pluginVersionLong;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPluginButton() {
|
||||||
|
return pluginButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPluginFilename() {
|
||||||
|
return pluginFilename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long getVersionAsLong(String vers) {
|
||||||
|
try {
|
||||||
|
String[] verz = vers.split("\\.");
|
||||||
|
long ret = 0;
|
||||||
|
long div = 1000000000000l;
|
||||||
|
for(int i = 0; i < verz.length; ++i) {
|
||||||
|
ret += div * Long.parseLong(verz[i]);
|
||||||
|
div /= 10000l;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}catch(Throwable t) {
|
||||||
|
return -1l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] getPluginDownload() {
|
||||||
|
byte[] ret = EagRuntime.getResourceBytes(pluginFileEPK);
|
||||||
|
if(ret == null) {
|
||||||
|
throw new RuntimeException("File \"" + pluginFileEPK + "\" is missing in the epk!");
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void startPluginDownload() {
|
||||||
|
EagRuntime.downloadFileWithName(pluginFilename, getPluginDownload());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isUpdateToPluginAvailable(String brand, String vers) {
|
||||||
|
if(pluginVersionLong == -1l || !pluginName.equals(brand)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
long verz = getVersionAsLong(vers);
|
||||||
|
return verz != -1l && verz < pluginVersionLong;
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,16 +7,18 @@ import java.io.OutputStream;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglerZLIB {
|
public class EaglerZLIB {
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglercraftRandom {
|
public class EaglercraftRandom {
|
||||||
|
@ -25,7 +29,7 @@ public class EaglercraftRandom {
|
||||||
private static int yee = 0;
|
private static int yee = 0;
|
||||||
|
|
||||||
public EaglercraftRandom() {
|
public EaglercraftRandom() {
|
||||||
this(System.currentTimeMillis() + (++yee));
|
this(PlatformRuntime.randomSeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
public EaglercraftRandom(long seed) {
|
public EaglercraftRandom(long seed) {
|
||||||
|
|
|
@ -25,16 +25,18 @@ import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglercraftSoundManager {
|
public class EaglercraftSoundManager {
|
||||||
|
|
|
@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8;
|
||||||
import net.lax1dude.eaglercraft.v1_8.crypto.MD5Digest;
|
import net.lax1dude.eaglercraft.v1_8.crypto.MD5Digest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglercraftUUID implements Comparable<EaglercraftUUID> {
|
public class EaglercraftUUID implements Comparable<EaglercraftUUID> {
|
||||||
|
@ -223,6 +225,16 @@ public class EaglercraftUUID implements Comparable<EaglercraftUUID> {
|
||||||
return new EaglercraftUUID(md5Bytes);
|
return new EaglercraftUUID(md5Bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EaglercraftUUID randomUUID() {
|
||||||
|
byte[] randomBytes = new byte[16];
|
||||||
|
(new EaglercraftRandom()).nextBytes(randomBytes);
|
||||||
|
randomBytes[6] &= 0x0f; /* clear version */
|
||||||
|
randomBytes[6] |= 0x40; /* set to version 4 */
|
||||||
|
randomBytes[8] &= 0x3f; /* clear variant */
|
||||||
|
randomBytes[8] |= 0x80; /* set to IETF variant */
|
||||||
|
return new EaglercraftUUID(randomBytes);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(EaglercraftUUID val) {
|
public int compareTo(EaglercraftUUID val) {
|
||||||
return (this.msb < val.msb ? -1
|
return (this.msb < val.msb ? -1
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
|
||||||
public class EaglercraftVersion {
|
public class EaglercraftVersion {
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,9 +9,9 @@ public class EaglercraftVersion {
|
||||||
|
|
||||||
/// Customize these to fit your fork:
|
/// Customize these to fit your fork:
|
||||||
|
|
||||||
public static final String projectForkName = "";
|
public static final String projectForkName = "Shadow";
|
||||||
public static final String projectForkVersion = "";
|
public static final String projectForkVersion = "4.0";
|
||||||
public static final String projectForkVendor = "";
|
public static final String projectForkVendor = "PeytonPlayz585";
|
||||||
|
|
||||||
public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
|
public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
|
||||||
|
|
||||||
|
@ -20,28 +22,47 @@ public class EaglercraftVersion {
|
||||||
// Do not change these, they must stay as credit to lax1dude's
|
// Do not change these, they must stay as credit to lax1dude's
|
||||||
// original repository for maintaining the project:
|
// original repository for maintaining the project:
|
||||||
|
|
||||||
public static final String projectOriginName = "Shadow Client 3.0";
|
public static final String projectOriginName = "EaglercraftX";
|
||||||
public static final String projectOriginAuthor = "PeytonPlayz585";
|
public static final String projectOriginAuthor = "lax1dude";
|
||||||
public static final String projectOriginRevision = "";
|
public static final String projectOriginRevision = "1.8";
|
||||||
public static final String projectOriginVersion = "";
|
public static final String projectOriginVersion = "u22";
|
||||||
|
|
||||||
|
public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; // rest in peace
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Updating configuration
|
||||||
|
|
||||||
|
public static final boolean enableUpdateService = true;
|
||||||
|
|
||||||
|
public static final String updateBundlePackageName = "net.lax1dude.eaglercraft.v1_8.client";
|
||||||
|
public static final int updateBundlePackageVersionInt = 22;
|
||||||
|
|
||||||
|
public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName;
|
||||||
|
|
||||||
|
// public key modulus for official 1.8 updates
|
||||||
|
public static final BigInteger updateSignatureModulus = new BigInteger("14419476194820052109078379102436982757438300194194974078260570958862225232043861026588258585967060437391326494976080031137298500457111529693806931143421725626747051503616606418909609840275122831550688481329699012469742002429706330734797679859799085213517354399295425740214330234086361416936984593337389989505613123225737002654977194421571825036717017788527234114501215218715499682638139386636103589791643964827904791195488978835113700772208317974307363542114867750505953323167521731238542123593257269990619007858952216110012513121779359926747737258698347806747854986471035713105133999027704095451858121831297923962641");
|
||||||
|
|
||||||
public static final String projectOriginURL = "https://github.com/PeytonPlayz595/Shadow-3.0";
|
|
||||||
|
|
||||||
|
|
||||||
// Miscellaneous variables:
|
// Miscellaneous variables:
|
||||||
|
|
||||||
public static final String mainMenuStringA = "";
|
public static final String mainMenuStringA = "Minecraft 1.8.8";
|
||||||
public static final String mainMenuStringB = projectOriginName + "" +
|
public static final String mainMenuStringB = projectOriginName + " " +
|
||||||
projectOriginRevision + "" + projectOriginVersion + "";
|
projectOriginRevision + "-" + projectOriginVersion + " ultimate";
|
||||||
public static final String mainMenuStringC = "";
|
public static final String mainMenuStringC = "";
|
||||||
public static final String mainMenuStringD = "EaglercraftX 1.8.8";
|
public static final String mainMenuStringD = "Resources Copyright Mojang AB";
|
||||||
|
|
||||||
public static final String mainMenuStringE = projectForkName + "" + projectForkVersion;
|
public static final String mainMenuStringE = projectForkName + " " + projectForkVersion;
|
||||||
public static final String mainMenuStringF = "";
|
public static final String mainMenuStringF = "Made by " + projectForkVendor;
|
||||||
|
|
||||||
public static final String mainMenuStringG = "Shadow Client 3.0";
|
public static final String mainMenuStringG = "Collector's Edition";
|
||||||
public static final String mainMenuStringH = "Optifine + Shaders";
|
public static final String mainMenuStringH = "PBR Shaders";
|
||||||
|
|
||||||
|
public static final long demoWorldSeed = (long) "North Carolina".hashCode();
|
||||||
|
|
||||||
public static final boolean mainMenuEnableGithubButton = false;
|
public static final boolean mainMenuEnableGithubButton = false;
|
||||||
|
|
||||||
|
public static final boolean forceDemoMode = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EncoderException extends RuntimeException {
|
public class EncoderException extends RuntimeException {
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ExceptionUtils {
|
public class ExceptionUtils {
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class HString {
|
public class HString {
|
||||||
|
|
|
@ -11,16 +11,18 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class IOUtils {
|
public class IOUtils {
|
||||||
|
|
|
@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class JDKBackports {
|
public class JDKBackports {
|
||||||
|
|
|
@ -4,16 +4,18 @@ import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
|
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Keyboard {
|
public class Keyboard {
|
||||||
|
|
|
@ -1,18 +1,21 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
|
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Mouse {
|
public class Mouse {
|
||||||
|
@ -89,4 +92,29 @@ public class Mouse {
|
||||||
return PlatformInput.isMouseGrabbed();
|
return PlatformInput.isMouseGrabbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int customCursorCounter = 0;
|
||||||
|
private static EnumCursorType currentCursorType = EnumCursorType.DEFAULT;
|
||||||
|
|
||||||
|
public static void showCursor(EnumCursorType cursor) {
|
||||||
|
if(EagRuntime.getConfiguration().useSpecialCursors()) {
|
||||||
|
customCursorCounter = 2;
|
||||||
|
if(currentCursorType != cursor) {
|
||||||
|
PlatformInput.showCursor(cursor);
|
||||||
|
currentCursorType = cursor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void tickCursorShape() {
|
||||||
|
if(EagRuntime.getConfiguration().useSpecialCursors()) {
|
||||||
|
if(customCursorCounter > 0) {
|
||||||
|
if(--customCursorCounter == 0) {
|
||||||
|
if(currentCursorType != EnumCursorType.DEFAULT) {
|
||||||
|
PlatformInput.showCursor(EnumCursorType.DEFAULT);
|
||||||
|
currentCursorType = EnumCursorType.DEFAULT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8;
|
package net.lax1dude.eaglercraft.v1_8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ThreadLocalRandom {
|
public class ThreadLocalRandom {
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8.cache;
|
package net.lax1dude.eaglercraft.v1_8.cache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface EaglerCacheProvider<K, V> {
|
public interface EaglerCacheProvider<K, V> {
|
||||||
|
|
|
@ -4,16 +4,18 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EaglerLoadingCache<K, V> {
|
public class EaglerLoadingCache<K, V> {
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8.futures;
|
package net.lax1dude.eaglercraft.v1_8.futures;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CancellationException extends IllegalStateException {
|
public class CancellationException extends IllegalStateException {
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8.futures;
|
package net.lax1dude.eaglercraft.v1_8.futures;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ExecutionException extends RuntimeException {
|
public class ExecutionException extends RuntimeException {
|
||||||
|
|
|
@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.futures;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Executors {
|
public class Executors {
|
||||||
|
|
|
@ -3,16 +3,18 @@ package net.lax1dude.eaglercraft.v1_8.futures;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface Future<V> {
|
public interface Future<V> {
|
||||||
|
|
|
@ -4,16 +4,18 @@ import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class FutureTask<V> implements RunnableFuture<V> {
|
public class FutureTask<V> implements RunnableFuture<V> {
|
||||||
|
|
|
@ -11,16 +11,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Futures {
|
public class Futures {
|
||||||
|
|
|
@ -6,16 +6,18 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface ListenableFuture<V> extends Future<V> {
|
public interface ListenableFuture<V> extends Future<V> {
|
||||||
|
|
|
@ -6,16 +6,18 @@ import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ListenableFutureTask<V> extends FutureTask<V> implements ListenableFuture<V> {
|
public class ListenableFutureTask<V> extends FutureTask<V> implements ListenableFuture<V> {
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8.futures;
|
package net.lax1dude.eaglercraft.v1_8.futures;
|
||||||
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
*
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
*
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface RunnableFuture<V> extends Runnable, Future<V> {
|
public interface RunnableFuture<V> extends Runnable, Future<V> {
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.internal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public enum EnumCursorType {
|
||||||
|
DEFAULT, HAND, TEXT;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user